1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
open Sexplib.Conv
open Core
open Frenetic_kernel.Packet
exception Non_local
type switchId = Frenetic_kernel.OpenFlow.switchId [@@deriving sexp, compare, eq]
type portId = Frenetic_kernel.OpenFlow.portId [@@deriving sexp, compare, eq]
type payload = Frenetic_kernel.OpenFlow.payload [@@deriving sexp]
type vswitchId = int64 [@@deriving sexp, compare, eq]
type vportId = int64 [@@deriving sexp, compare, eq]
type vfabricId = int64 [@@deriving sexp, compare, eq]
type metaId = string [@@deriving sexp, compare, eq]
type abstract_location = string [@@deriving sexp, compare, eq, hash]
let string_of_fastfail = Frenetic_kernel.OpenFlow.format_list ~to_string:Int32.to_string
type location =
| Physical of int32
| FastFail of int32 list
| Pipe of string
| Query of string
[@@deriving sexp, compare]
type pred =
| True
| False
| Test of header_val
| And of pred * pred
| Or of pred * pred
| Neg of pred
[@@deriving sexp]
type meta_init =
| Alias of header_val
| Const of int64
[@@deriving sexp]
type policy =
| Filter of pred
| Mod of header_val
| Union of policy * policy
| Seq of policy * policy
| Star of policy
| Link of switchId * portId * switchId * portId
| VLink of vswitchId * vportId * vswitchId * vportId
| Let of { id : metaId; init : meta_init; mut : bool; body : policy }
| Dup
[@@deriving sexp]
let id = Filter True
let drop = Filter False
type action = Frenetic_kernel.OpenFlow.action
type switch_port = switchId * portId [@@deriving sexp]
type host = Frenetic_kernel.Packet.dlAddr * Frenetic_kernel.Packet.nwAddr [@@deriving sexp]
type bufferId = Int32.t [@@deriving sexp]