package frenetic

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Frenetic_netkat.Local_compilerSource

Sourcemodule Field = Fdd.Field
Sourcemodule Action = Fdd.Action
Sourcemodule Value = Fdd.Value
Sourcetype order = [
  1. | `Default
  2. | `Static of Field.t list
  3. | `Heuristic
]
Sourcemodule FDD : sig ... end
Sourcetype t = FDD.t

The type of the intermediate compiler representation (FDD).

Sourceval to_dot : t -> string
Sourcetype cache = [
  1. | `Keep
  2. | `Empty
  3. | `Preserve of t
]
Sourcetype compiler_options = {
  1. cache_prepare : cache;
  2. field_order : order;
  3. remove_tail_drops : bool;
  4. dedup_flows : bool;
  5. optimize : bool;
}

Compilation

Sourceexception Non_local

The exception that's thrown when the local compiler is given a policy with a Link term in it. To compile policies with Link terms, invoke global compiler.

Sourceval default_compiler_options : compiler_options
Sourceval prepare_compilation : options:compiler_options -> Syntax.policy -> unit
Sourceval compile : ?options:compiler_options -> Syntax.policy -> t

compile p returns the intermediate representation of the local policy p. You can generate a flowtable from t by passing it to the to_table function below.

Sourceval restrict : Syntax.header_val -> t -> t

restrict hv t returns the fragment of t that applies when the assignment hv is true. The result will no longer make any reference to the header named in hv. This is equivalent to traversing the original NetKAT syntax tree and replacing all occurrences of Test(hv) with True.

This function is called by to_table to restrict t to the portion that should run on a single switch.

to_table sw t returns a flowtable that implements t for switch sw.

Composition

Sourceval seq : t -> t -> t

seq p q returns the sequential composotion of the two intermediate representations p and q. The result is semantically equivalent to the seqential composition of the two policies from which p and q were derived.

Sourceval union : t -> t -> t

union p q returns the parallel composition of the two intermediate representations p and q. The result is semantically equivalent to the parallel composition of the two policies from which p and q were derived.

Sourceval star : t -> t

star p returns the star of the intermediate representation p. The result is semantically equivalent to the star of the policy from which p was derived.

Utilities

Sourceval dedup : t -> t
Sourceval pipes : t -> string list

pipes t returns the list of pipe names that occur in t.

Sourceval queries : t -> (string * Syntax.pred) list

queries t returns the list of queries that occur in t along with the predicates associated with the query. Frenetic_kernel.Packet and byte counts of flows that match the predicate should count towards its associated query.

Sourceval equal : t -> t -> bool

equal a b returns whether or not the two intermediate representations are structurally equal.

If the two representations are structurally equal, then the policies they derived from are semantically equivalent. However, if the two representations are not equal, the policies they were derived from may still be semantically equivalent.

Sourceval size : t -> int

size t returns the size of t.

Sourceval compression_ratio : t -> int * int
Sourceval to_local_pol : t -> Syntax.policy

to_local_pol t returns a NetKAT policy that is semantically equivalent to t. If was generated from compiling a policy p, it is not guarateed that to_local_pol t will be identical to p.

Sourceval to_string : t -> string

to_string t returns a string representation of t. This will be a representation of the Vlr diagram from the tdk package.

Interpreter

Sourceval eval : Semantics.packet -> t -> Frenetic_netkat.Semantics.PacketSet.t

eval pkt t returns a PacketSet.t that is the result of the packet pkt being run through the policy represented by t.

Sourceval eval_pipes : Semantics.packet -> t -> (string * Semantics.packet) list * (string * Semantics.packet) list * Semantics.packet list

eval_pipes pkt t returns the result of running the packet pkt through the policy represented by t, with packets grouped according to the type of location to which the policy assigns them. The result is a triple whose first component is a list of packets and corresponding pipe location, whose second is a list of packets and corresponding query location, and whose third is a list of packets that are at physical locations.

Sourceval to_dotfile : t -> string -> unit
Sourceval field_order_from_string : string -> order
Sourceval field_order_to_string : order -> string
Sourceval options_from_json_string : string -> compiler_options

options_from_json_string s returns a compiler_options type suitable. Mostly for HTTP servers

Sourceval options_to_json_string : compiler_options -> string
Sourcetype flow_layout = Field.t list list
Sourceval sexp_of_flow_layout : flow_layout -> Ppx_sexp_conv_lib.Sexp.t
Sourceval flow_layout_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> flow_layout
Sourcetype tableId = int
Sourceval sexp_of_tableId : tableId -> Ppx_sexp_conv_lib.Sexp.t
Sourceval tableId_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> tableId
Sourcetype metaId = int
Sourceval sexp_of_metaId : metaId -> Ppx_sexp_conv_lib.Sexp.t
Sourceval metaId_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> metaId
Sourcetype flowId = tableId * metaId
Sourceval sexp_of_flowId : flowId -> Ppx_sexp_conv_lib.Sexp.t
Sourceval flowId_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> flowId
Sourcetype instruction = [
  1. | `Action of Frenetic_kernel.OpenFlow.group
  2. | `GotoTable of flowId
]
Sourceval sexp_of_instruction : instruction -> Ppx_sexp_conv_lib.Sexp.t
Sourceval instruction_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> instruction
Sourceval __instruction_of_sexp__ : Ppx_sexp_conv_lib.Sexp.t -> instruction
Sourcetype multitable_flow = {
  1. pattern : Frenetic_kernel.OpenFlow.Pattern.t;
  2. cookie : int64;
  3. idle_timeout : Frenetic_kernel.OpenFlow.timeout;
  4. hard_timeout : Frenetic_kernel.OpenFlow.timeout;
  5. instruction : instruction;
  6. flowId : flowId;
}
Sourceval sexp_of_multitable_flow : multitable_flow -> Ppx_sexp_conv_lib.Sexp.t
Sourceval multitable_flow_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> multitable_flow
Sourceval layout_to_string : flow_layout -> string
OCaml

Innovation. Community. Security.