blob: 79d5badfb3d40dd1db9a340724f6efae9165d112 [file] [log] [blame]
Rich Lanea06d0c32013-03-25 08:52:03 -07001// Copyright 2013, Big Switch Networks, Inc.
2//
3// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
4// the following special exception:
5//
6// LOXI Exception
7//
8// As a special exception to the terms of the EPL, you may distribute libraries
9// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
10// that copyright and licensing notices generated by LoxiGen are not altered or removed
11// from the LoxiGen Libraries and the notice provided below is (i) included in
12// the LoxiGen Libraries, if distributed in source code form and (ii) included in any
13// documentation for the LoxiGen Libraries, if distributed in binary form.
14//
15// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
16//
17// You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
18// a copy of the EPL at:
19//
20// http://www.eclipse.org/legal/epl-v10.html
21//
22// Unless required by applicable law or agreed to in writing, software
23// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
24// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
25// EPL for the specific language governing permissions and limitations
26// under the EPL.
Rich Lane5d33a622013-04-08 17:33:11 -070027//
28// Also derived from the OpenFlow header files which have these copyrights:
29// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
30// Copyright (c) 2011, 2012 Open Networking Foundation
Rich Lanea06d0c32013-03-25 08:52:03 -070031
32#version 1
33
Rich Lane5d33a622013-04-08 17:33:11 -070034enum macro_definitions {
35 OFP_MAX_TABLE_NAME_LEN = 32,
36 OFP_MAX_PORT_NAME_LEN = 16,
37
Wilson Ngd72013d2013-09-29 10:21:48 -070038 OFP_TCP_PORT = 6653,
39 OFP_SSL_PORT = 6653,
Rich Lane5d33a622013-04-08 17:33:11 -070040
41 OFP_ETH_ALEN = 6,
42
43 OFP_DEFAULT_MISS_SEND_LEN = 128,
44
45 OFP_VLAN_NONE = 0xffff,
46
47 OFPFW_ICMP_TYPE = 0x40,
48 OFPFW_ICMP_CODE = 0x80,
49
50 OFP_DL_TYPE_ETH2_CUTOFF = 0x600,
51 OFP_DL_TYPE_NOT_ETH_TYPE = 0x5ff,
52
53 OFP_FLOW_PERMANENT = 0,
54
55 OFP_DEFAULT_PRIORITY = 0x8000,
56
57 DESC_STR_LEN = 256,
58 SERIAL_NUM_LEN = 32,
59
60 OFPQ_ALL = 0xffffffff,
61 OFPQ_MIN_RATE_UNCFG = 0xffff,
62};
63
Andreas Wundsam4ee51462013-07-30 11:00:37 -070064enum ofp_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070065 OFPT_HELLO = 0,
66 OFPT_ERROR = 1,
67 OFPT_ECHO_REQUEST = 2,
68 OFPT_ECHO_REPLY = 3,
Rob Vaterlausfeee3712013-09-30 11:24:19 -070069 OFPT_EXPERIMENTER = 4,
Rich Lane5d33a622013-04-08 17:33:11 -070070 OFPT_FEATURES_REQUEST = 5,
71 OFPT_FEATURES_REPLY = 6,
72 OFPT_GET_CONFIG_REQUEST = 7,
73 OFPT_GET_CONFIG_REPLY = 8,
74 OFPT_SET_CONFIG = 9,
75 OFPT_PACKET_IN = 10,
76 OFPT_FLOW_REMOVED = 11,
77 OFPT_PORT_STATUS = 12,
78 OFPT_PACKET_OUT = 13,
79 OFPT_FLOW_MOD = 14,
80 OFPT_PORT_MOD = 15,
81 OFPT_STATS_REQUEST = 16,
82 OFPT_STATS_REPLY = 17,
83 OFPT_BARRIER_REQUEST = 18,
84 OFPT_BARRIER_REPLY = 19,
85 OFPT_QUEUE_GET_CONFIG_REQUEST = 20,
86 OFPT_QUEUE_GET_CONFIG_REPLY = 21,
87};
88
Andreas Wundsam4ee51462013-07-30 11:00:37 -070089enum ofp_port_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -070090 OFPPC_PORT_DOWN = 0x1,
91 OFPPC_NO_STP = 0x2,
92 OFPPC_NO_RECV = 0x4,
93 OFPPC_NO_RECV_STP = 0x8,
94 OFPPC_NO_FLOOD = 0x10,
95 OFPPC_NO_FWD = 0x20,
96 OFPPC_NO_PACKET_IN = 0x40,
Rob Vaterlaus0a8ec142013-10-10 13:27:14 -070097 OFPPC_BSN_MIRROR_DEST = 0x80000000,
Rich Lane5d33a622013-04-08 17:33:11 -070098};
99
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700100enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700101 OFPPS_LINK_DOWN = 1,
Andreas Wundsamc1acfcc2013-09-20 13:10:20 -0700102 OFPPS_STP_LISTEN = 0,
Rich Lane5d33a622013-04-08 17:33:11 -0700103 OFPPS_STP_LEARN = 0x100,
104 OFPPS_STP_FORWARD = 0x200,
105 OFPPS_STP_BLOCK = 0x300,
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700106 OFPPS_STP_MASK(virtual=True) = 0x300,
Rich Lane5d33a622013-04-08 17:33:11 -0700107};
108
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700109// FIXME: these constants are currently 32 bit due to implementation
110// details of loci, which is in violation of the OpenFlow spec.
111// Should recast to 32 bits and fix/glue the c backend
112enum ofp_port(wire_type=uint16_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700113 OFPP_MAX = 0xffffff00,
114 OFPP_IN_PORT = 0xfffffff8,
115 OFPP_TABLE = 0xfffffff9,
116 OFPP_NORMAL = 0xfffffffa,
117 OFPP_FLOOD = 0xfffffffb,
118 OFPP_ALL = 0xfffffffc,
119 OFPP_CONTROLLER = 0xfffffffd,
120 OFPP_LOCAL = 0xfffffffe,
121 OFPP_NONE = 0xffffffff,
122};
123
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700124enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700125 OFPPF_10MB_HD = 0x1,
126 OFPPF_10MB_FD = 0x2,
127 OFPPF_100MB_HD = 0x4,
128 OFPPF_100MB_FD = 0x8,
129 OFPPF_1GB_HD = 0x10,
130 OFPPF_1GB_FD = 0x20,
131 OFPPF_10GB_FD = 0x40,
132 OFPPF_COPPER = 0x80,
133 OFPPF_FIBER = 0x100,
134 OFPPF_AUTONEG = 0x200,
135 OFPPF_PAUSE = 0x400,
136 OFPPF_PAUSE_ASYM = 0x800,
137};
138
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700139enum ofp_queue_properties(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700140 OFPQT_NONE = 0,
141 OFPQT_MIN_RATE = 1,
142};
143
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700144enum ofp_flow_wildcards(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700145 OFPFW_IN_PORT = 0x1,
146 OFPFW_DL_VLAN = 0x2,
147 OFPFW_DL_SRC = 0x4,
148 OFPFW_NW_DST_BITS = 0x6,
149 OFPFW_NW_SRC_BITS = 0x6,
150 OFPFW_NW_SRC_SHIFT = 0x8,
151 OFPFW_DL_DST = 0x8,
152 OFPFW_NW_DST_SHIFT = 0xe,
153 OFPFW_DL_TYPE = 0x10,
154 OFPFW_NW_PROTO = 0x20,
155 OFPFW_TP_SRC = 0x40,
156 OFPFW_TP_DST = 0x80,
157 OFPFW_NW_SRC_ALL = 0x2000,
158 OFPFW_NW_SRC_MASK = 0x3f00,
159 OFPFW_NW_DST_ALL = 0x80000,
160 OFPFW_NW_DST_MASK = 0xfc000,
161 OFPFW_DL_VLAN_PCP = 0x100000,
162 OFPFW_NW_TOS = 0x200000,
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700163 OFPFW_ALL(virtual=True) = 0x3fffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700164};
165
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700166enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700167 OFPAT_OUTPUT = 0,
168 OFPAT_SET_VLAN_VID = 1,
169 OFPAT_SET_VLAN_PCP = 2,
170 OFPAT_STRIP_VLAN = 3,
171 OFPAT_SET_DL_SRC = 4,
172 OFPAT_SET_DL_DST = 5,
173 OFPAT_SET_NW_SRC = 6,
174 OFPAT_SET_NW_DST = 7,
175 OFPAT_SET_NW_TOS = 8,
176 OFPAT_SET_TP_SRC = 9,
177 OFPAT_SET_TP_DST = 10,
178 OFPAT_ENQUEUE = 11,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700179 OFPAT_EXPERIMENTER = 0xffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700180};
181
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700182enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700183 OFPC_FLOW_STATS = 0x1,
184 OFPC_TABLE_STATS = 0x2,
185 OFPC_PORT_STATS = 0x4,
186 OFPC_STP = 0x8,
187 OFPC_RESERVED = 0x10,
188 OFPC_IP_REASM = 0x20,
189 OFPC_QUEUE_STATS = 0x40,
190 OFPC_ARP_MATCH_IP = 0x80,
191};
192
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700193enum ofp_config_flags(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700194 OFPC_FRAG_NORMAL = 0x0,
195 OFPC_FRAG_DROP = 0x1,
196 OFPC_FRAG_REASM = 0x2,
197 OFPC_FRAG_MASK = 0x3,
198};
199
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700200enum ofp_flow_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700201 OFPFC_ADD = 0,
202 OFPFC_MODIFY = 1,
203 OFPFC_MODIFY_STRICT = 2,
204 OFPFC_DELETE = 3,
205 OFPFC_DELETE_STRICT = 4,
206};
207
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700208enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700209 OFPFF_SEND_FLOW_REM = 0x1,
210 OFPFF_CHECK_OVERLAP = 0x2,
211 OFPFF_EMERG = 0x4,
212};
213
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700214enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700215 OFPSF_REPLY_MORE = 0x1,
216};
217
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700218enum ofp_stats_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700219 OFPST_DESC = 0,
220 OFPST_FLOW = 1,
221 OFPST_AGGREGATE = 2,
222 OFPST_TABLE = 3,
223 OFPST_PORT = 4,
224 OFPST_QUEUE = 5,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700225 OFPST_EXPERIMENTER = 0xffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700226};
227
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700228enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700229 OFPR_NO_MATCH = 0,
230 OFPR_ACTION = 1,
231};
232
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700233enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700234 OFPRR_IDLE_TIMEOUT = 0,
235 OFPRR_HARD_TIMEOUT = 1,
236 OFPRR_DELETE = 2,
237};
238
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700239enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700240 OFPPR_ADD = 0,
241 OFPPR_DELETE = 1,
242 OFPPR_MODIFY = 2,
243};
244
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700245enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700246 OFPET_HELLO_FAILED = 0,
247 OFPET_BAD_REQUEST = 1,
248 OFPET_BAD_ACTION = 2,
249 OFPET_FLOW_MOD_FAILED = 3,
250 OFPET_PORT_MOD_FAILED = 4,
251 OFPET_QUEUE_OP_FAILED = 5,
252};
253
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700254enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700255 OFPHFC_INCOMPATIBLE = 0,
256 OFPHFC_EPERM = 1,
257};
258
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700259enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700260 OFPBRC_BAD_VERSION = 0,
261 OFPBRC_BAD_TYPE = 1,
262 OFPBRC_BAD_STAT = 2,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700263 OFPBRC_BAD_EXPERIMENTER = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700264 OFPBRC_BAD_SUBTYPE = 4,
265 OFPBRC_EPERM = 5,
266 OFPBRC_BAD_LEN = 6,
267 OFPBRC_BUFFER_EMPTY = 7,
268 OFPBRC_BUFFER_UNKNOWN = 8,
269};
270
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700271enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700272 OFPBAC_BAD_TYPE = 0,
273 OFPBAC_BAD_LEN = 1,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700274 OFPBAC_BAD_EXPERIMENTER = 2,
275 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700276 OFPBAC_BAD_OUT_PORT = 4,
277 OFPBAC_BAD_ARGUMENT = 5,
278 OFPBAC_EPERM = 6,
279 OFPBAC_TOO_MANY = 7,
280 OFPBAC_BAD_QUEUE = 8,
281};
282
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700283enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700284 OFPFMFC_ALL_TABLES_FULL = 0,
285 OFPFMFC_OVERLAP = 1,
286 OFPFMFC_EPERM = 2,
287 OFPFMFC_BAD_EMERG_TIMEOUT = 3,
288 OFPFMFC_BAD_COMMAND = 4,
289 OFPFMFC_UNSUPPORTED = 5,
290};
291
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700292enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700293 OFPPMFC_BAD_PORT = 0,
294 OFPPMFC_BAD_HW_ADDR = 1,
295};
296
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700297enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700298 OFPQOFC_BAD_PORT = 0,
299 OFPQOFC_BAD_QUEUE = 1,
300 OFPQOFC_EPERM = 2,
301};
302
Rich Lanee9c37db2013-06-21 18:30:24 -0700303/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700304struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700305 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700306 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700307 uint16_t length;
308 uint32_t xid;
309};
310
Rich Lanee9c37db2013-06-21 18:30:24 -0700311struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700312 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700313 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700314 uint16_t length;
315 uint32_t xid;
316};
317
Rich Lanee9c37db2013-06-21 18:30:24 -0700318struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700319 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700320 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700321 uint16_t length;
322 uint32_t xid;
323 of_octets_t data;
324};
325
Rich Lanee9c37db2013-06-21 18:30:24 -0700326struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700327 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700328 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700329 uint16_t length;
330 uint32_t xid;
331 of_octets_t data;
332};
333
Rich Lanee9c37db2013-06-21 18:30:24 -0700334struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700335 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700336 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700337 uint16_t length;
338 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700339 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700340 uint32_t subtype;
341 of_octets_t data;
342};
343
Rich Lanee9c37db2013-06-21 18:30:24 -0700344struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700345 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700346 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700347 uint16_t length;
348 uint32_t xid;
349};
350
Rich Lanee9c37db2013-06-21 18:30:24 -0700351struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700352 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700353 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700354 uint16_t length;
355 uint32_t xid;
356};
357
Rich Lanee9c37db2013-06-21 18:30:24 -0700358struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700359 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700360 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700361 uint16_t length;
362 uint32_t xid;
363};
364
Rich Lanee9c37db2013-06-21 18:30:24 -0700365struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700366 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700367 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700368 uint16_t length;
369 uint32_t xid;
370 uint16_t flags;
371 uint16_t miss_send_len;
372};
373
Rich Lanee9c37db2013-06-21 18:30:24 -0700374struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700375 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700376 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700377 uint16_t length;
378 uint32_t xid;
379 uint16_t flags;
380 uint16_t miss_send_len;
381};
382
Rich Lane68ae4d72013-05-09 10:55:19 -0700383struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700384 of_port_no_t port_no;
385 of_mac_addr_t hw_addr;
386 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700387 enum ofp_port_config config;
388 enum ofp_port_state state;
389 enum ofp_port_features curr;
390 enum ofp_port_features advertised;
391 enum ofp_port_features supported;
392 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700393};
394
Rich Lanee9c37db2013-06-21 18:30:24 -0700395struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700396 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700397 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700398 uint16_t length;
399 uint32_t xid;
400};
401
Rich Lanee9c37db2013-06-21 18:30:24 -0700402struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700403 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700404 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700405 uint16_t length;
406 uint32_t xid;
407 uint64_t datapath_id;
408 uint32_t n_buffers;
409 uint8_t n_tables;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700410 pad(3);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700411 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700412 uint32_t actions;
413 list(of_port_desc_t) ports;
414};
415
Rich Lanee9c37db2013-06-21 18:30:24 -0700416struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700417 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700418 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700419 uint16_t length;
420 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700421 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700422 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700423 of_port_desc_t desc;
424};
425
Rich Lanee9c37db2013-06-21 18:30:24 -0700426struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700427 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700428 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700429 uint16_t length;
430 uint32_t xid;
431 of_port_no_t port_no;
432 of_mac_addr_t hw_addr;
433 uint32_t config;
434 uint32_t mask;
435 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700436 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700437};
438
Rich Lanee9c37db2013-06-21 18:30:24 -0700439struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700440 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700441 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700442 uint16_t length;
443 uint32_t xid;
444 uint32_t buffer_id;
445 uint16_t total_len;
446 of_port_no_t in_port;
447 uint8_t reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700448 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700449 of_octets_t data;
450};
451
Rich Lanee9c37db2013-06-21 18:30:24 -0700452struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700453 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700454 uint16_t len;
455 of_port_no_t port;
456 uint16_t max_len;
457};
458
Rich Lanee9c37db2013-06-21 18:30:24 -0700459struct of_action_set_vlan_vid : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700460 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700461 uint16_t len;
462 uint16_t vlan_vid;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700463 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700464};
465
Rich Lanee9c37db2013-06-21 18:30:24 -0700466struct of_action_strip_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700467 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700468 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700469 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700470};
471
Rich Lanee9c37db2013-06-21 18:30:24 -0700472struct of_action_set_vlan_pcp : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700473 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700474 uint16_t len;
475 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700476 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700477};
478
Rich Lanee9c37db2013-06-21 18:30:24 -0700479struct of_action_set_dl_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700480 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700481 uint16_t len;
482 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700483 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700484};
485
Rich Lanee9c37db2013-06-21 18:30:24 -0700486struct of_action_set_dl_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700487 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700488 uint16_t len;
489 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700490 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700491};
492
Rich Lanee9c37db2013-06-21 18:30:24 -0700493struct of_action_set_nw_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700494 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700495 uint16_t len;
496 uint32_t nw_addr;
497};
498
Rich Lanee9c37db2013-06-21 18:30:24 -0700499struct of_action_set_nw_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700500 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700501 uint16_t len;
502 uint32_t nw_addr;
503};
504
Rich Lanee9c37db2013-06-21 18:30:24 -0700505struct of_action_set_tp_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700506 uint16_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700507 uint16_t len;
508 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700509 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700510};
511
Rich Lanee9c37db2013-06-21 18:30:24 -0700512struct of_action_set_tp_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700513 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700514 uint16_t len;
515 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700516 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700517};
518
Rich Lanee9c37db2013-06-21 18:30:24 -0700519struct of_action_set_nw_tos : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700520 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700521 uint16_t len;
522 uint8_t nw_tos;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700523 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700524};
525
Rich Lanee9c37db2013-06-21 18:30:24 -0700526struct of_action_experimenter : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700527 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700528 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700529 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700530 of_octets_t data;
531};
532
Rich Lanee9c37db2013-06-21 18:30:24 -0700533struct of_action_enqueue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700534 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700535 uint16_t len;
536 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700537 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700538 uint32_t queue_id;
539};
540
Rich Lane68ae4d72013-05-09 10:55:19 -0700541struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700542 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700543 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700544 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700545};
546
Rich Lanee9c37db2013-06-21 18:30:24 -0700547struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700548 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700549 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700550 uint16_t length;
551 uint32_t xid;
552 uint32_t buffer_id;
553 of_port_no_t in_port;
554 uint16_t actions_len;
555 list(of_action_t) actions;
556 of_octets_t data;
557};
558
Rich Lane68ae4d72013-05-09 10:55:19 -0700559struct of_match_v1 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700560 of_wc_bmap_t wildcards;
561 of_port_no_t in_port;
562 of_mac_addr_t eth_src;
563 of_mac_addr_t eth_dst;
564 uint16_t vlan_vid;
565 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700566 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700567 uint16_t eth_type;
568 uint8_t ip_dscp;
569 uint8_t ip_proto;
Rob Sherwood53989c82013-07-03 16:49:50 -0700570 pad(2);
Andreas Wundsamb566a162013-07-18 19:30:23 -0700571 of_ipv4_t ipv4_src;
572 of_ipv4_t ipv4_dst;
Rich Lanea06d0c32013-03-25 08:52:03 -0700573 uint16_t tcp_src;
574 uint16_t tcp_dst;
575};
576
Rich Lanee9c37db2013-06-21 18:30:24 -0700577struct of_flow_mod : of_header {
578 uint8_t version;
579 uint8_t type == 14;
580 uint16_t length;
581 uint32_t xid;
582 of_match_t match;
583 uint64_t cookie;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700584 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700585 uint16_t idle_timeout;
586 uint16_t hard_timeout;
587 uint16_t priority;
588 uint32_t buffer_id;
589 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700590 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700591 list(of_action_t) actions;
592};
593
594struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700595 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700596 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700597 uint16_t length;
598 uint32_t xid;
599 of_match_t match;
600 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700601 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700602 uint16_t idle_timeout;
603 uint16_t hard_timeout;
604 uint16_t priority;
605 uint32_t buffer_id;
606 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700607 enum ofp_flow_mod_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700608 list(of_action_t) actions;
609};
610
Rich Lanee9c37db2013-06-21 18:30:24 -0700611struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700612 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700613 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700614 uint16_t length;
615 uint32_t xid;
616 of_match_t match;
617 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700618 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700619 uint16_t idle_timeout;
620 uint16_t hard_timeout;
621 uint16_t priority;
622 uint32_t buffer_id;
623 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700624 enum ofp_flow_mod_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700625 list(of_action_t) actions;
626};
627
Rich Lanee9c37db2013-06-21 18:30:24 -0700628struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700629 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700630 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700631 uint16_t length;
632 uint32_t xid;
633 of_match_t match;
634 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700635 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700636 uint16_t idle_timeout;
637 uint16_t hard_timeout;
638 uint16_t priority;
639 uint32_t buffer_id;
640 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700641 enum ofp_flow_mod_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700642 list(of_action_t) actions;
643};
644
Rich Lanee9c37db2013-06-21 18:30:24 -0700645struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700646 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700647 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700648 uint16_t length;
649 uint32_t xid;
650 of_match_t match;
651 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700652 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700653 uint16_t idle_timeout;
654 uint16_t hard_timeout;
655 uint16_t priority;
656 uint32_t buffer_id;
657 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700658 enum ofp_flow_mod_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700659 list(of_action_t) actions;
660};
661
Rich Lanee9c37db2013-06-21 18:30:24 -0700662struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700663 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700664 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700665 uint16_t length;
666 uint32_t xid;
667 of_match_t match;
668 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700669 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700670 uint16_t idle_timeout;
671 uint16_t hard_timeout;
672 uint16_t priority;
673 uint32_t buffer_id;
674 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700675 enum ofp_flow_mod_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700676 list(of_action_t) actions;
677};
678
Rich Lanee9c37db2013-06-21 18:30:24 -0700679struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700680 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700681 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700682 uint16_t length;
683 uint32_t xid;
684 of_match_t match;
685 uint64_t cookie;
686 uint16_t priority;
687 uint8_t reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700688 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700689 uint32_t duration_sec;
690 uint32_t duration_nsec;
691 uint16_t idle_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700692 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700693 uint64_t packet_count;
694 uint64_t byte_count;
695};
696
Rich Lanee9c37db2013-06-21 18:30:24 -0700697struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700698 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700699 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700700 uint16_t length;
701 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700702 uint16_t err_type == ?;
703};
704
705struct of_hello_failed_error_msg : of_error_msg {
706 uint8_t version;
707 uint8_t type == 1;
708 uint16_t length;
709 uint32_t xid;
710 uint16_t err_type == 0;
711 enum ofp_hello_failed_code code;
712 of_octets_t data;
713};
714
715struct of_bad_request_error_msg : of_error_msg {
716 uint8_t version;
717 uint8_t type == 1;
718 uint16_t length;
719 uint32_t xid;
720 uint16_t err_type == 1;
721 enum ofp_bad_request_code code;
722 of_octets_t data;
723};
724
725struct of_bad_action_error_msg : of_error_msg {
726 uint8_t version;
727 uint8_t type == 1;
728 uint16_t length;
729 uint32_t xid;
730 uint16_t err_type == 2;
731 enum ofp_bad_action_code code;
732 of_octets_t data;
733};
734
735struct of_flow_mod_failed_error_msg : of_error_msg {
736 uint8_t version;
737 uint8_t type == 1;
738 uint16_t length;
739 uint32_t xid;
740 uint16_t err_type == 3;
741 enum ofp_flow_mod_failed_code code;
742 of_octets_t data;
743};
744
745struct of_port_mod_failed_error_msg : of_error_msg {
746 uint8_t version;
747 uint8_t type == 1;
748 uint16_t length;
749 uint32_t xid;
750 uint16_t err_type == 4;
751 enum ofp_port_mod_failed_code code;
752 of_octets_t data;
753};
754
755struct of_queue_op_failed_error_msg : of_error_msg {
756 uint8_t version;
757 uint8_t type == 1;
758 uint16_t length;
759 uint32_t xid;
760 uint16_t err_type == 5;
761 enum ofp_queue_op_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -0700762 of_octets_t data;
763};
764
765// STATS ENTRIES: flow, table, port, queue,
Rich Lane68ae4d72013-05-09 10:55:19 -0700766struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700767 uint16_t length;
768 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700769 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700770 of_match_t match;
771 uint32_t duration_sec;
772 uint32_t duration_nsec;
773 uint16_t priority;
774 uint16_t idle_timeout;
775 uint16_t hard_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700776 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700777 uint64_t cookie;
778 uint64_t packet_count;
779 uint64_t byte_count;
780 list(of_action_t) actions;
781};
782
Rich Lane68ae4d72013-05-09 10:55:19 -0700783struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700784 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700785 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700786 of_table_name_t name;
787 of_wc_bmap_t wildcards;
788 uint32_t max_entries;
789 uint32_t active_count;
790 uint64_t lookup_count;
791 uint64_t matched_count;
792};
793
Rich Lane68ae4d72013-05-09 10:55:19 -0700794struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700795 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700796 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700797 uint64_t rx_packets;
798 uint64_t tx_packets;
799 uint64_t rx_bytes;
800 uint64_t tx_bytes;
801 uint64_t rx_dropped;
802 uint64_t tx_dropped;
803 uint64_t rx_errors;
804 uint64_t tx_errors;
805 uint64_t rx_frame_err;
806 uint64_t rx_over_err;
807 uint64_t rx_crc_err;
808 uint64_t collisions;
809};
810
Rich Lane68ae4d72013-05-09 10:55:19 -0700811struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700812 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700813 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700814 uint32_t queue_id;
815 uint64_t tx_bytes;
816 uint64_t tx_packets;
817 uint64_t tx_errors;
818};
819
820// STATS request/reply: Desc, flow, agg, table, port, queue
821
Rich Lanee9c37db2013-06-21 18:30:24 -0700822struct of_stats_request : of_header {
823 uint8_t version;
824 uint8_t type == 16;
825 uint16_t length;
826 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700827 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700828 uint16_t flags;
829};
830
831struct of_stats_reply : of_header {
832 uint8_t version;
833 uint8_t type == 17;
834 uint16_t length;
835 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700836 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700837 uint16_t flags;
838};
839
840struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700841 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700842 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700843 uint16_t length;
844 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700845 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700846 uint16_t flags;
847};
848
Rich Lanee9c37db2013-06-21 18:30:24 -0700849struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700850 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700851 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700852 uint16_t length;
853 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700854 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700855 uint16_t flags;
856 of_desc_str_t mfr_desc;
857 of_desc_str_t hw_desc;
858 of_desc_str_t sw_desc;
859 of_serial_num_t serial_num;
860 of_desc_str_t dp_desc;
861};
862
Rich Lanee9c37db2013-06-21 18:30:24 -0700863struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700864 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700865 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700866 uint16_t length;
867 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700868 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700869 uint16_t flags;
870 of_match_t match;
871 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700872 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700873 of_port_no_t out_port;
874};
875
Rich Lanee9c37db2013-06-21 18:30:24 -0700876struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700877 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700878 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700879 uint16_t length;
880 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700881 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700882 uint16_t flags;
883 list(of_flow_stats_entry_t) entries;
884};
885
Rich Lanee9c37db2013-06-21 18:30:24 -0700886struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700887 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700888 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700889 uint16_t length;
890 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700891 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700892 uint16_t flags;
893 of_match_t match;
894 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700895 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700896 of_port_no_t out_port;
897};
898
Rich Lanee9c37db2013-06-21 18:30:24 -0700899struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700900 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700901 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700902 uint16_t length;
903 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700904 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700905 uint16_t flags;
906 uint64_t packet_count;
907 uint64_t byte_count;
908 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700909 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700910};
911
Rich Lanee9c37db2013-06-21 18:30:24 -0700912struct of_table_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700913 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700914 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700915 uint16_t length;
916 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700917 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700918 uint16_t flags;
919};
920
Rich Lanee9c37db2013-06-21 18:30:24 -0700921struct of_table_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700922 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700923 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700924 uint16_t length;
925 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700926 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700927 uint16_t flags;
928 list(of_table_stats_entry_t) entries;
929};
930
Rich Lanee9c37db2013-06-21 18:30:24 -0700931struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700932 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700933 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700934 uint16_t length;
935 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700936 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700937 uint16_t flags;
938 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700939 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700940};
941
Rich Lanee9c37db2013-06-21 18:30:24 -0700942struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700943 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700944 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700945 uint16_t length;
946 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700947 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700948 uint16_t flags;
949 list(of_port_stats_entry_t) entries;
950};
951
Rich Lanee9c37db2013-06-21 18:30:24 -0700952struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700953 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700954 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700955 uint16_t length;
956 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700957 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700958 uint16_t flags;
959 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700960 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700961 uint32_t queue_id;
962};
963
Rich Lanee9c37db2013-06-21 18:30:24 -0700964struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700965 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700966 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700967 uint16_t length;
968 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700969 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700970 uint16_t flags;
971 list(of_queue_stats_entry_t) entries;
972};
973
Rich Lanee9c37db2013-06-21 18:30:24 -0700974struct of_experimenter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700975 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700976 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700977 uint16_t length;
978 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700979 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -0700980 uint16_t flags;
Rich Laneb25d07c2013-08-22 17:22:43 -0700981 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700982 of_octets_t data;
983};
984
Rich Lanee9c37db2013-06-21 18:30:24 -0700985struct of_experimenter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700986 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700987 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700988 uint16_t length;
989 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700990 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -0700991 uint16_t flags;
Rich Laneb25d07c2013-08-22 17:22:43 -0700992 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700993 of_octets_t data;
994};
995
996// END OF STATS OBJECTS
997
Rich Lane68ae4d72013-05-09 10:55:19 -0700998struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700999 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001000 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001001 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001002};
1003
Rich Lanee9c37db2013-06-21 18:30:24 -07001004struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001005 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001006 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001007 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001008 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001009 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001010};
1011
Rich Lane68ae4d72013-05-09 10:55:19 -07001012struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001013 uint32_t queue_id;
1014 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001015 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001016 list(of_queue_prop_t) properties;
1017};
1018
Rich Lanee9c37db2013-06-21 18:30:24 -07001019struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001020 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001021 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -07001022 uint16_t length;
1023 uint32_t xid;
1024 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001025 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001026};
1027
Rich Lanee9c37db2013-06-21 18:30:24 -07001028struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001029 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001030 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -07001031 uint16_t length;
1032 uint32_t xid;
1033 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001034 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001035 list(of_packet_queue_t) queues;
1036};