package frenetic

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

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

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

Policies

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

Applications

type switch_port = switchId * portId
val sexp_of_switch_port : switch_port -> Ppx_sexp_conv_lib.Sexp.t
val switch_port_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> switch_port
val sexp_of_host : host -> Ppx_sexp_conv_lib.Sexp.t
val host_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> host
type bufferId = Core.Int32.t
val sexp_of_bufferId : bufferId -> Ppx_sexp_conv_lib.Sexp.t
val bufferId_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> bufferId