Module Frenetic_netkat.Syntax

NetKAT Syntax

The NetKAT language is central to Frenetic, and we factor out the central types here. The big actors on NetKAT structures are Compiler which compiles NetKAT into flow tables, Parser which turns NetKAT strings (e.g "TcpSrcPort(8080); port := 2") into NetKAT, and Json which turns JSON-formatted NetKAT into NetKAT

exception Non_local

Basics

type switchId = Frenetic_kernel.OpenFlow.switchId
val equal_switchId : switchId ‑> switchId ‑> Ppx_deriving_runtime.bool
include sig ... end
val switchId_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> switchId
val sexp_of_switchId : switchId ‑> Ppx_sexp_conv_lib.Sexp.t
val compare_switchId : switchId ‑> switchId ‑> int
type portId = Frenetic_kernel.OpenFlow.portId
val equal_portId : portId ‑> portId ‑> Ppx_deriving_runtime.bool
include sig ... end
val portId_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> portId
val sexp_of_portId : portId ‑> Ppx_sexp_conv_lib.Sexp.t
val compare_portId : portId ‑> portId ‑> int
type payload = Frenetic_kernel.OpenFlow.payload
include sig ... end
val payload_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> payload
val sexp_of_payload : payload ‑> Ppx_sexp_conv_lib.Sexp.t
type vswitchId = int64
val equal_vswitchId : vswitchId ‑> vswitchId ‑> Ppx_deriving_runtime.bool
include sig ... end
val vswitchId_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> vswitchId
val sexp_of_vswitchId : vswitchId ‑> Ppx_sexp_conv_lib.Sexp.t
val compare_vswitchId : vswitchId ‑> vswitchId ‑> int
type vportId = int64
val equal_vportId : vportId ‑> vportId ‑> Ppx_deriving_runtime.bool
include sig ... end
val vportId_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> vportId
val sexp_of_vportId : vportId ‑> Ppx_sexp_conv_lib.Sexp.t
val compare_vportId : vportId ‑> vportId ‑> int
type vfabricId = int64
val equal_vfabricId : vfabricId ‑> vfabricId ‑> Ppx_deriving_runtime.bool
include sig ... end
val vfabricId_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> vfabricId
val sexp_of_vfabricId : vfabricId ‑> Ppx_sexp_conv_lib.Sexp.t
val compare_vfabricId : vfabricId ‑> vfabricId ‑> int
type metaId = string
val equal_metaId : metaId ‑> metaId ‑> Ppx_deriving_runtime.bool
include sig ... end
val metaId_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> metaId
val sexp_of_metaId : metaId ‑> Ppx_sexp_conv_lib.Sexp.t
val compare_metaId : metaId ‑> metaId ‑> int
type abstract_location = string
val equal_abstract_location : abstract_location ‑> abstract_location ‑> Ppx_deriving_runtime.bool
include sig ... end
val abstract_location_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> abstract_location
val sexp_of_abstract_location : abstract_location ‑> Ppx_sexp_conv_lib.Sexp.t
val compare_abstract_location : abstract_location ‑> abstract_location ‑> int
val hash_fold_abstract_location : Ppx_hash_lib.Std.Hash.state ‑> abstract_location ‑> Ppx_hash_lib.Std.Hash.state
val hash_abstract_location : abstract_location ‑> Ppx_hash_lib.Std.Hash.hash_value

Policies

val string_of_fastfail : int32 list ‑> string
type location =
| Physical of int32
| FastFail of int32 list
| Pipe of string
| Query of string
include sig ... end
val location_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> location
val sexp_of_location : location ‑> Ppx_sexp_conv_lib.Sexp.t
val compare_location : location ‑> location ‑> int
type header_val =
| Switch of switchId
| Location of location
| EthSrc of Frenetic_kernel.Packet.dlAddr
| EthDst of Frenetic_kernel.Packet.dlAddr
| Vlan of Frenetic_kernel.Packet.int16
| VlanPcp of Frenetic_kernel.Packet.dlVlanPcp
| EthType of Frenetic_kernel.Packet.dlTyp
| IPProto of Frenetic_kernel.Packet.nwProto
| IP4Src of Frenetic_kernel.Packet.nwAddr * int32
| IP4Dst of Frenetic_kernel.Packet.nwAddr * int32
| TCPSrcPort of Frenetic_kernel.Packet.tpPort
| TCPDstPort of Frenetic_kernel.Packet.tpPort
| VSwitch of vswitchId
| VPort of vportId
| VFabric of vfabricId
| Meta of metaId * int64
| From of abstract_location
| AbstractLoc of abstract_location
include sig ... end
val header_val_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> header_val
val sexp_of_header_val : header_val ‑> Ppx_sexp_conv_lib.Sexp.t
type pred =
| True
| False
| Test of header_val
| And of pred * pred
| Or of pred * pred
| Neg of pred
include sig ... end
val pred_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> pred
val sexp_of_pred : pred ‑> Ppx_sexp_conv_lib.Sexp.t
type meta_init =
| Alias of header_val
| Const of int64
include sig ... end
val meta_init_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> meta_init
val sexp_of_meta_init : meta_init ‑> Ppx_sexp_conv_lib.Sexp.t
type policy =
| Filter of pred
| Mod of header_val
| Union of policy * policy
| Seq of policy * policy
| Star of policy
| Let of {
id : metaId;
init : meta_init;
mut : bool;
body : policy;
}
| Dup
include sig ... end
val policy_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> policy
val sexp_of_policy : policy ‑> Ppx_sexp_conv_lib.Sexp.t
val id : policy
val drop : policy

Applications

type action = Frenetic_kernel.OpenFlow.action
type switch_port = switchId * portId
include sig ... end
val switch_port_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> switch_port
val sexp_of_switch_port : switch_port ‑> Ppx_sexp_conv_lib.Sexp.t
type host = Frenetic_kernel.Packet.dlAddr * Frenetic_kernel.Packet.nwAddr
include sig ... end
val host_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> host
val sexp_of_host : host ‑> Ppx_sexp_conv_lib.Sexp.t
type bufferId = Core.Int32.t
include sig ... end
val bufferId_of_sexp : Ppx_sexp_conv_lib.Sexp.t ‑> bufferId
val sexp_of_bufferId : bufferId ‑> Ppx_sexp_conv_lib.Sexp.t