blob: ceb20163168a555ebfb2a3e2af344d078f834a10 [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
38 OFP_TCP_PORT = 6633,
39 OFP_SSL_PORT = 6633,
40
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,
69 OFPT_VENDOR = 4,
70 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,
97};
98
Andreas Wundsam4ee51462013-07-30 11:00:37 -070099enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700100 OFPPS_STP_LISTEN = 0,
101 OFPPS_LINK_DOWN = 1,
102 OFPPS_STP_LEARN = 0x100,
103 OFPPS_STP_FORWARD = 0x200,
104 OFPPS_STP_BLOCK = 0x300,
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700105 OFPPS_STP_MASK(virtual=True) = 0x300,
Rich Lane5d33a622013-04-08 17:33:11 -0700106};
107
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700108// FIXME: these constants are currently 32 bit due to implementation
109// details of loci, which is in violation of the OpenFlow spec.
110// Should recast to 32 bits and fix/glue the c backend
111enum ofp_port(wire_type=uint16_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700112 OFPP_MAX = 0xffffff00,
113 OFPP_IN_PORT = 0xfffffff8,
114 OFPP_TABLE = 0xfffffff9,
115 OFPP_NORMAL = 0xfffffffa,
116 OFPP_FLOOD = 0xfffffffb,
117 OFPP_ALL = 0xfffffffc,
118 OFPP_CONTROLLER = 0xfffffffd,
119 OFPP_LOCAL = 0xfffffffe,
120 OFPP_NONE = 0xffffffff,
121};
122
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700123enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700124 OFPPF_10MB_HD = 0x1,
125 OFPPF_10MB_FD = 0x2,
126 OFPPF_100MB_HD = 0x4,
127 OFPPF_100MB_FD = 0x8,
128 OFPPF_1GB_HD = 0x10,
129 OFPPF_1GB_FD = 0x20,
130 OFPPF_10GB_FD = 0x40,
131 OFPPF_COPPER = 0x80,
132 OFPPF_FIBER = 0x100,
133 OFPPF_AUTONEG = 0x200,
134 OFPPF_PAUSE = 0x400,
135 OFPPF_PAUSE_ASYM = 0x800,
136};
137
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700138enum ofp_queue_properties(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700139 OFPQT_NONE = 0,
140 OFPQT_MIN_RATE = 1,
141};
142
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700143enum ofp_flow_wildcards(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700144 OFPFW_IN_PORT = 0x1,
145 OFPFW_DL_VLAN = 0x2,
146 OFPFW_DL_SRC = 0x4,
147 OFPFW_NW_DST_BITS = 0x6,
148 OFPFW_NW_SRC_BITS = 0x6,
149 OFPFW_NW_SRC_SHIFT = 0x8,
150 OFPFW_DL_DST = 0x8,
151 OFPFW_NW_DST_SHIFT = 0xe,
152 OFPFW_DL_TYPE = 0x10,
153 OFPFW_NW_PROTO = 0x20,
154 OFPFW_TP_SRC = 0x40,
155 OFPFW_TP_DST = 0x80,
156 OFPFW_NW_SRC_ALL = 0x2000,
157 OFPFW_NW_SRC_MASK = 0x3f00,
158 OFPFW_NW_DST_ALL = 0x80000,
159 OFPFW_NW_DST_MASK = 0xfc000,
160 OFPFW_DL_VLAN_PCP = 0x100000,
161 OFPFW_NW_TOS = 0x200000,
162 OFPFW_ALL = 0x3fffff,
163};
164
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700165enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700166 OFPAT_OUTPUT = 0,
167 OFPAT_SET_VLAN_VID = 1,
168 OFPAT_SET_VLAN_PCP = 2,
169 OFPAT_STRIP_VLAN = 3,
170 OFPAT_SET_DL_SRC = 4,
171 OFPAT_SET_DL_DST = 5,
172 OFPAT_SET_NW_SRC = 6,
173 OFPAT_SET_NW_DST = 7,
174 OFPAT_SET_NW_TOS = 8,
175 OFPAT_SET_TP_SRC = 9,
176 OFPAT_SET_TP_DST = 10,
177 OFPAT_ENQUEUE = 11,
178 OFPAT_VENDOR = 0xffff,
179};
180
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700181enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700182 OFPC_FLOW_STATS = 0x1,
183 OFPC_TABLE_STATS = 0x2,
184 OFPC_PORT_STATS = 0x4,
185 OFPC_STP = 0x8,
186 OFPC_RESERVED = 0x10,
187 OFPC_IP_REASM = 0x20,
188 OFPC_QUEUE_STATS = 0x40,
189 OFPC_ARP_MATCH_IP = 0x80,
190};
191
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700192enum ofp_config_flags(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700193 OFPC_FRAG_NORMAL = 0x0,
194 OFPC_FRAG_DROP = 0x1,
195 OFPC_FRAG_REASM = 0x2,
196 OFPC_FRAG_MASK = 0x3,
197};
198
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700199enum ofp_flow_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700200 OFPFC_ADD = 0,
201 OFPFC_MODIFY = 1,
202 OFPFC_MODIFY_STRICT = 2,
203 OFPFC_DELETE = 3,
204 OFPFC_DELETE_STRICT = 4,
205};
206
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700207enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700208 OFPFF_SEND_FLOW_REM = 0x1,
209 OFPFF_CHECK_OVERLAP = 0x2,
210 OFPFF_EMERG = 0x4,
211};
212
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700213enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700214 OFPSF_REPLY_MORE = 0x1,
215};
216
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700217enum ofp_stats_types(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700218 OFPST_DESC = 0,
219 OFPST_FLOW = 1,
220 OFPST_AGGREGATE = 2,
221 OFPST_TABLE = 3,
222 OFPST_PORT = 4,
223 OFPST_QUEUE = 5,
224 OFPST_VENDOR = 0xffff,
225};
226
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700227enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700228 OFPR_NO_MATCH = 0,
229 OFPR_ACTION = 1,
230};
231
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700232enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700233 OFPRR_IDLE_TIMEOUT = 0,
234 OFPRR_HARD_TIMEOUT = 1,
235 OFPRR_DELETE = 2,
236};
237
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700238enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700239 OFPPR_ADD = 0,
240 OFPPR_DELETE = 1,
241 OFPPR_MODIFY = 2,
242};
243
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700244enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700245 OFPET_HELLO_FAILED = 0,
246 OFPET_BAD_REQUEST = 1,
247 OFPET_BAD_ACTION = 2,
248 OFPET_FLOW_MOD_FAILED = 3,
249 OFPET_PORT_MOD_FAILED = 4,
250 OFPET_QUEUE_OP_FAILED = 5,
251};
252
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700253enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700254 OFPHFC_INCOMPATIBLE = 0,
255 OFPHFC_EPERM = 1,
256};
257
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700258enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700259 OFPBRC_BAD_VERSION = 0,
260 OFPBRC_BAD_TYPE = 1,
261 OFPBRC_BAD_STAT = 2,
262 OFPBRC_BAD_VENDOR = 3,
263 OFPBRC_BAD_SUBTYPE = 4,
264 OFPBRC_EPERM = 5,
265 OFPBRC_BAD_LEN = 6,
266 OFPBRC_BUFFER_EMPTY = 7,
267 OFPBRC_BUFFER_UNKNOWN = 8,
268};
269
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700270enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700271 OFPBAC_BAD_TYPE = 0,
272 OFPBAC_BAD_LEN = 1,
273 OFPBAC_BAD_VENDOR = 2,
274 OFPBAC_BAD_VENDOR_TYPE = 3,
275 OFPBAC_BAD_OUT_PORT = 4,
276 OFPBAC_BAD_ARGUMENT = 5,
277 OFPBAC_EPERM = 6,
278 OFPBAC_TOO_MANY = 7,
279 OFPBAC_BAD_QUEUE = 8,
280};
281
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700282enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700283 OFPFMFC_ALL_TABLES_FULL = 0,
284 OFPFMFC_OVERLAP = 1,
285 OFPFMFC_EPERM = 2,
286 OFPFMFC_BAD_EMERG_TIMEOUT = 3,
287 OFPFMFC_BAD_COMMAND = 4,
288 OFPFMFC_UNSUPPORTED = 5,
289};
290
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700291enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700292 OFPPMFC_BAD_PORT = 0,
293 OFPPMFC_BAD_HW_ADDR = 1,
294};
295
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700296enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700297 OFPQOFC_BAD_PORT = 0,
298 OFPQOFC_BAD_QUEUE = 1,
299 OFPQOFC_EPERM = 2,
300};
301
Rich Lane68ae4d72013-05-09 10:55:19 -0700302struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700303 uint8_t version;
304 uint8_t type;
305 uint16_t length;
306 uint32_t xid;
307};
308
Rich Lane68ae4d72013-05-09 10:55:19 -0700309struct of_hello {
Rich Lanea06d0c32013-03-25 08:52:03 -0700310 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700311 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700312 uint16_t length;
313 uint32_t xid;
314};
315
Rich Lane68ae4d72013-05-09 10:55:19 -0700316struct of_echo_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700317 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700318 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700319 uint16_t length;
320 uint32_t xid;
321 of_octets_t data;
322};
323
Rich Lane68ae4d72013-05-09 10:55:19 -0700324struct of_echo_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700325 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700326 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700327 uint16_t length;
328 uint32_t xid;
329 of_octets_t data;
330};
331
Rich Lane68ae4d72013-05-09 10:55:19 -0700332struct of_experimenter {
Rich Lanea06d0c32013-03-25 08:52:03 -0700333 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700334 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700335 uint16_t length;
336 uint32_t xid;
337 uint32_t experimenter;
338 uint32_t subtype;
339 of_octets_t data;
340};
341
Rich Lane68ae4d72013-05-09 10:55:19 -0700342struct of_barrier_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700343 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700344 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700345 uint16_t length;
346 uint32_t xid;
347};
348
Rich Lane68ae4d72013-05-09 10:55:19 -0700349struct of_barrier_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700350 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700351 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700352 uint16_t length;
353 uint32_t xid;
354};
355
Rich Lane68ae4d72013-05-09 10:55:19 -0700356struct of_get_config_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700357 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700358 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700359 uint16_t length;
360 uint32_t xid;
361};
362
Rich Lane68ae4d72013-05-09 10:55:19 -0700363struct of_get_config_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700364 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700365 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700366 uint16_t length;
367 uint32_t xid;
368 uint16_t flags;
369 uint16_t miss_send_len;
370};
371
Rich Lane68ae4d72013-05-09 10:55:19 -0700372struct of_set_config {
Rich Lanea06d0c32013-03-25 08:52:03 -0700373 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700374 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700375 uint16_t length;
376 uint32_t xid;
377 uint16_t flags;
378 uint16_t miss_send_len;
379};
380
Rich Lane68ae4d72013-05-09 10:55:19 -0700381struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700382 of_port_no_t port_no;
383 of_mac_addr_t hw_addr;
384 of_port_name_t name;
385 uint32_t config;
386 uint32_t state;
387 uint32_t curr;
388 uint32_t advertised;
389 uint32_t supported;
390 uint32_t peer;
391};
392
Rich Lane68ae4d72013-05-09 10:55:19 -0700393struct of_features_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700394 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700395 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700396 uint16_t length;
397 uint32_t xid;
398};
399
Rich Lane68ae4d72013-05-09 10:55:19 -0700400struct of_features_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700401 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700402 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700403 uint16_t length;
404 uint32_t xid;
405 uint64_t datapath_id;
406 uint32_t n_buffers;
407 uint8_t n_tables;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700408 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700409 uint32_t capabilities;
410 uint32_t actions;
411 list(of_port_desc_t) ports;
412};
413
Rich Lane68ae4d72013-05-09 10:55:19 -0700414struct of_port_status {
Rich Lanea06d0c32013-03-25 08:52:03 -0700415 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700416 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700417 uint16_t length;
418 uint32_t xid;
419 uint8_t reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700420 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700421 of_port_desc_t desc;
422};
423
Rich Lane68ae4d72013-05-09 10:55:19 -0700424struct of_port_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700425 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700426 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700427 uint16_t length;
428 uint32_t xid;
429 of_port_no_t port_no;
430 of_mac_addr_t hw_addr;
431 uint32_t config;
432 uint32_t mask;
433 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700434 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700435};
436
Rich Lane68ae4d72013-05-09 10:55:19 -0700437struct of_packet_in {
Rich Lanea06d0c32013-03-25 08:52:03 -0700438 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700439 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700440 uint16_t length;
441 uint32_t xid;
442 uint32_t buffer_id;
443 uint16_t total_len;
444 of_port_no_t in_port;
445 uint8_t reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700446 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700447 of_octets_t data;
448};
449
Rich Lane68ae4d72013-05-09 10:55:19 -0700450struct of_action_output {
Rich Lane31b87142013-05-09 22:05:42 -0700451 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700452 uint16_t len;
453 of_port_no_t port;
454 uint16_t max_len;
455};
456
Rich Lane68ae4d72013-05-09 10:55:19 -0700457struct of_action_set_vlan_vid {
Rich Lane31b87142013-05-09 22:05:42 -0700458 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700459 uint16_t len;
460 uint16_t vlan_vid;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700461 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700462};
463
Rich Lane68ae4d72013-05-09 10:55:19 -0700464struct of_action_strip_vlan {
Rich Lane31b87142013-05-09 22:05:42 -0700465 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700466 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700467 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700468};
469
Rich Lane68ae4d72013-05-09 10:55:19 -0700470struct of_action_set_vlan_pcp {
Rich Lane31b87142013-05-09 22:05:42 -0700471 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700472 uint16_t len;
473 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700474 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700475};
476
Rich Lane68ae4d72013-05-09 10:55:19 -0700477struct of_action_set_dl_src {
Rich Lane31b87142013-05-09 22:05:42 -0700478 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700479 uint16_t len;
480 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700481 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700482};
483
Rich Lane68ae4d72013-05-09 10:55:19 -0700484struct of_action_set_dl_dst {
Rich Lane31b87142013-05-09 22:05:42 -0700485 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700486 uint16_t len;
487 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700488 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700489};
490
Rich Lane68ae4d72013-05-09 10:55:19 -0700491struct of_action_set_nw_src {
Rich Lane31b87142013-05-09 22:05:42 -0700492 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700493 uint16_t len;
494 uint32_t nw_addr;
495};
496
Rich Lane68ae4d72013-05-09 10:55:19 -0700497struct of_action_set_nw_dst {
Rich Lane31b87142013-05-09 22:05:42 -0700498 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700499 uint16_t len;
500 uint32_t nw_addr;
501};
502
Rich Lane68ae4d72013-05-09 10:55:19 -0700503struct of_action_set_tp_src {
Rich Lane31b87142013-05-09 22:05:42 -0700504 uint16_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700505 uint16_t len;
506 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700507 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700508};
509
Rich Lane68ae4d72013-05-09 10:55:19 -0700510struct of_action_set_tp_dst {
Rich Lane31b87142013-05-09 22:05:42 -0700511 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700512 uint16_t len;
513 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700514 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700515};
516
Rich Lane68ae4d72013-05-09 10:55:19 -0700517struct of_action_set_nw_tos {
Rich Lane31b87142013-05-09 22:05:42 -0700518 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700519 uint16_t len;
520 uint8_t nw_tos;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700521 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700522};
523
Rich Lane68ae4d72013-05-09 10:55:19 -0700524struct of_action_experimenter {
Rich Lane31b87142013-05-09 22:05:42 -0700525 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700526 uint16_t len;
527 uint32_t experimenter;
528 of_octets_t data;
529};
530
Rich Lane68ae4d72013-05-09 10:55:19 -0700531struct of_action_enqueue {
Rich Lane31b87142013-05-09 22:05:42 -0700532 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700533 uint16_t len;
534 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700535 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700536 uint32_t queue_id;
537};
538
Rich Lane68ae4d72013-05-09 10:55:19 -0700539struct of_action {
Rich Lanea06d0c32013-03-25 08:52:03 -0700540 uint16_t type;
541 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700542 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700543};
544
Rich Lane68ae4d72013-05-09 10:55:19 -0700545struct of_packet_out {
Rich Lanea06d0c32013-03-25 08:52:03 -0700546 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700547 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700548 uint16_t length;
549 uint32_t xid;
550 uint32_t buffer_id;
551 of_port_no_t in_port;
552 uint16_t actions_len;
553 list(of_action_t) actions;
554 of_octets_t data;
555};
556
Rich Lane68ae4d72013-05-09 10:55:19 -0700557struct of_match_v1 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700558 of_wc_bmap_t wildcards;
559 of_port_no_t in_port;
560 of_mac_addr_t eth_src;
561 of_mac_addr_t eth_dst;
562 uint16_t vlan_vid;
563 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700564 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700565 uint16_t eth_type;
566 uint8_t ip_dscp;
567 uint8_t ip_proto;
Rob Sherwood53989c82013-07-03 16:49:50 -0700568 pad(2);
Andreas Wundsamb566a162013-07-18 19:30:23 -0700569 of_ipv4_t ipv4_src;
570 of_ipv4_t ipv4_dst;
Rich Lanea06d0c32013-03-25 08:52:03 -0700571 uint16_t tcp_src;
572 uint16_t tcp_dst;
573};
574
Rich Lane68ae4d72013-05-09 10:55:19 -0700575struct of_flow_add {
Rich Lanea06d0c32013-03-25 08:52:03 -0700576 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700577 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700578 uint16_t length;
579 uint32_t xid;
580 of_match_t match;
581 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700582 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700583 uint16_t idle_timeout;
584 uint16_t hard_timeout;
585 uint16_t priority;
586 uint32_t buffer_id;
587 of_port_no_t out_port;
588 uint16_t flags;
589 list(of_action_t) actions;
590};
591
Rich Lane68ae4d72013-05-09 10:55:19 -0700592struct of_flow_modify {
Rich Lanea06d0c32013-03-25 08:52:03 -0700593 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700594 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700595 uint16_t length;
596 uint32_t xid;
597 of_match_t match;
598 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700599 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700600 uint16_t idle_timeout;
601 uint16_t hard_timeout;
602 uint16_t priority;
603 uint32_t buffer_id;
604 of_port_no_t out_port;
605 uint16_t flags;
606 list(of_action_t) actions;
607};
608
Rich Lane68ae4d72013-05-09 10:55:19 -0700609struct of_flow_modify_strict {
Rich Lanea06d0c32013-03-25 08:52:03 -0700610 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700611 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700612 uint16_t length;
613 uint32_t xid;
614 of_match_t match;
615 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700616 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700617 uint16_t idle_timeout;
618 uint16_t hard_timeout;
619 uint16_t priority;
620 uint32_t buffer_id;
621 of_port_no_t out_port;
622 uint16_t flags;
623 list(of_action_t) actions;
624};
625
Rich Lane68ae4d72013-05-09 10:55:19 -0700626struct of_flow_delete {
Rich Lanea06d0c32013-03-25 08:52:03 -0700627 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700628 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700629 uint16_t length;
630 uint32_t xid;
631 of_match_t match;
632 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700633 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700634 uint16_t idle_timeout;
635 uint16_t hard_timeout;
636 uint16_t priority;
637 uint32_t buffer_id;
638 of_port_no_t out_port;
639 uint16_t flags;
640 list(of_action_t) actions;
641};
642
Rich Lane68ae4d72013-05-09 10:55:19 -0700643struct of_flow_delete_strict {
Rich Lanea06d0c32013-03-25 08:52:03 -0700644 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700645 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700646 uint16_t length;
647 uint32_t xid;
648 of_match_t match;
649 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700650 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700651 uint16_t idle_timeout;
652 uint16_t hard_timeout;
653 uint16_t priority;
654 uint32_t buffer_id;
655 of_port_no_t out_port;
656 uint16_t flags;
657 list(of_action_t) actions;
658};
659
Rich Lane68ae4d72013-05-09 10:55:19 -0700660struct of_flow_removed {
Rich Lanea06d0c32013-03-25 08:52:03 -0700661 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700662 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700663 uint16_t length;
664 uint32_t xid;
665 of_match_t match;
666 uint64_t cookie;
667 uint16_t priority;
668 uint8_t reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700669 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700670 uint32_t duration_sec;
671 uint32_t duration_nsec;
672 uint16_t idle_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700673 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700674 uint64_t packet_count;
675 uint64_t byte_count;
676};
677
Rich Lane68ae4d72013-05-09 10:55:19 -0700678struct of_error_msg {
Rich Lanea06d0c32013-03-25 08:52:03 -0700679 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700680 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700681 uint16_t length;
682 uint32_t xid;
683 uint16_t err_type;
684 uint16_t code;
685 of_octets_t data;
686};
687
688// STATS ENTRIES: flow, table, port, queue,
Rich Lane68ae4d72013-05-09 10:55:19 -0700689struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700690 uint16_t length;
691 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700692 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700693 of_match_t match;
694 uint32_t duration_sec;
695 uint32_t duration_nsec;
696 uint16_t priority;
697 uint16_t idle_timeout;
698 uint16_t hard_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700699 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700700 uint64_t cookie;
701 uint64_t packet_count;
702 uint64_t byte_count;
703 list(of_action_t) actions;
704};
705
Rich Lane68ae4d72013-05-09 10:55:19 -0700706struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700707 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700708 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700709 of_table_name_t name;
710 of_wc_bmap_t wildcards;
711 uint32_t max_entries;
712 uint32_t active_count;
713 uint64_t lookup_count;
714 uint64_t matched_count;
715};
716
Rich Lane68ae4d72013-05-09 10:55:19 -0700717struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700718 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700719 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700720 uint64_t rx_packets;
721 uint64_t tx_packets;
722 uint64_t rx_bytes;
723 uint64_t tx_bytes;
724 uint64_t rx_dropped;
725 uint64_t tx_dropped;
726 uint64_t rx_errors;
727 uint64_t tx_errors;
728 uint64_t rx_frame_err;
729 uint64_t rx_over_err;
730 uint64_t rx_crc_err;
731 uint64_t collisions;
732};
733
Rich Lane68ae4d72013-05-09 10:55:19 -0700734struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700735 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700736 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700737 uint32_t queue_id;
738 uint64_t tx_bytes;
739 uint64_t tx_packets;
740 uint64_t tx_errors;
741};
742
743// STATS request/reply: Desc, flow, agg, table, port, queue
744
Rich Lane68ae4d72013-05-09 10:55:19 -0700745struct of_desc_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700746 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700747 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700748 uint16_t length;
749 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700750 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700751 uint16_t flags;
752};
753
Rich Lane68ae4d72013-05-09 10:55:19 -0700754struct of_desc_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700755 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700756 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700757 uint16_t length;
758 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700759 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700760 uint16_t flags;
761 of_desc_str_t mfr_desc;
762 of_desc_str_t hw_desc;
763 of_desc_str_t sw_desc;
764 of_serial_num_t serial_num;
765 of_desc_str_t dp_desc;
766};
767
Rich Lane68ae4d72013-05-09 10:55:19 -0700768struct of_flow_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700769 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700770 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700771 uint16_t length;
772 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700773 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700774 uint16_t flags;
775 of_match_t match;
776 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700777 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700778 of_port_no_t out_port;
779};
780
Rich Lane68ae4d72013-05-09 10:55:19 -0700781struct of_flow_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700782 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700783 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700784 uint16_t length;
785 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700786 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700787 uint16_t flags;
788 list(of_flow_stats_entry_t) entries;
789};
790
Rich Lane68ae4d72013-05-09 10:55:19 -0700791struct of_aggregate_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700792 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700793 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700794 uint16_t length;
795 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700796 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700797 uint16_t flags;
798 of_match_t match;
799 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700800 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700801 of_port_no_t out_port;
802};
803
Rich Lane68ae4d72013-05-09 10:55:19 -0700804struct of_aggregate_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700805 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700806 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700807 uint16_t length;
808 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700809 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700810 uint16_t flags;
811 uint64_t packet_count;
812 uint64_t byte_count;
813 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700814 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700815};
816
Rich Lane68ae4d72013-05-09 10:55:19 -0700817struct of_table_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700818 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700819 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700820 uint16_t length;
821 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700822 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700823 uint16_t flags;
824};
825
Rich Lane68ae4d72013-05-09 10:55:19 -0700826struct of_table_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700827 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700828 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700829 uint16_t length;
830 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700831 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700832 uint16_t flags;
833 list(of_table_stats_entry_t) entries;
834};
835
Rich Lane68ae4d72013-05-09 10:55:19 -0700836struct of_port_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700837 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700838 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700839 uint16_t length;
840 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700841 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700842 uint16_t flags;
843 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700844 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700845};
846
Rich Lane68ae4d72013-05-09 10:55:19 -0700847struct of_port_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700848 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700849 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700850 uint16_t length;
851 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700852 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700853 uint16_t flags;
854 list(of_port_stats_entry_t) entries;
855};
856
Rich Lane68ae4d72013-05-09 10:55:19 -0700857struct of_queue_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700858 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700859 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700860 uint16_t length;
861 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700862 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700863 uint16_t flags;
864 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700865 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700866 uint32_t queue_id;
867};
868
Rich Lane68ae4d72013-05-09 10:55:19 -0700869struct of_queue_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700870 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700871 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700872 uint16_t length;
873 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700874 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700875 uint16_t flags;
876 list(of_queue_stats_entry_t) entries;
877};
878
Rich Lane68ae4d72013-05-09 10:55:19 -0700879struct of_experimenter_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700880 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700881 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700882 uint16_t length;
883 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700884 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -0700885 uint16_t flags;
886 uint32_t experimenter;
887 of_octets_t data;
888};
889
Rich Lane68ae4d72013-05-09 10:55:19 -0700890struct of_experimenter_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700891 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700892 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700893 uint16_t length;
894 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700895 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -0700896 uint16_t flags;
897 uint32_t experimenter;
898 of_octets_t data;
899};
900
901// END OF STATS OBJECTS
902
Rich Lane68ae4d72013-05-09 10:55:19 -0700903struct of_queue_prop {
Rich Lanea06d0c32013-03-25 08:52:03 -0700904 uint16_t type;
905 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700906 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700907};
908
Rich Lane68ae4d72013-05-09 10:55:19 -0700909struct of_queue_prop_min_rate {
Rich Lane31b87142013-05-09 22:05:42 -0700910 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700911 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700912 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700913 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700914 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700915};
916
Rich Lane68ae4d72013-05-09 10:55:19 -0700917struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -0700918 uint32_t queue_id;
919 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700920 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700921 list(of_queue_prop_t) properties;
922};
923
Rich Lane68ae4d72013-05-09 10:55:19 -0700924struct of_queue_get_config_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700925 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700926 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700927 uint16_t length;
928 uint32_t xid;
929 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700930 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700931};
932
Rich Lane68ae4d72013-05-09 10:55:19 -0700933struct of_queue_get_config_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700934 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700935 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700936 uint16_t length;
937 uint32_t xid;
938 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700939 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700940 list(of_packet_queue_t) queues;
941};