blob: 3493c6bdb3848b9f3740fb5ef6ea71f19adeb586 [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,
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_LINK_DOWN = 1,
Andreas Wundsamc1acfcc2013-09-20 13:10:20 -0700101 OFPPS_STP_LISTEN = 0,
Rich Lane5d33a622013-04-08 17:33:11 -0700102 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,
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700162 OFPFW_ALL(virtual=True) = 0x3fffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700163};
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,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700178 OFPAT_EXPERIMENTER = 0xffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700179};
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
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700217enum ofp_stats_type(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,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700224 OFPST_EXPERIMENTER = 0xffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700225};
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,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700262 OFPBRC_BAD_EXPERIMENTER = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700263 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,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700273 OFPBAC_BAD_EXPERIMENTER = 2,
274 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700275 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 Lanee9c37db2013-06-21 18:30:24 -0700302/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700303struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700304 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700305 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700306 uint16_t length;
307 uint32_t xid;
308};
309
Rich Lanee9c37db2013-06-21 18:30:24 -0700310struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700311 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700312 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700313 uint16_t length;
314 uint32_t xid;
315};
316
Rich Lanee9c37db2013-06-21 18:30:24 -0700317struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700318 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700319 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700320 uint16_t length;
321 uint32_t xid;
322 of_octets_t data;
323};
324
Rich Lanee9c37db2013-06-21 18:30:24 -0700325struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700326 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700327 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700328 uint16_t length;
329 uint32_t xid;
330 of_octets_t data;
331};
332
Rich Lanee9c37db2013-06-21 18:30:24 -0700333struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700334 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700335 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700336 uint16_t length;
337 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700338 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700339 uint32_t subtype;
340 of_octets_t data;
341};
342
Rich Lanee9c37db2013-06-21 18:30:24 -0700343struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700344 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700345 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700346 uint16_t length;
347 uint32_t xid;
348};
349
Rich Lanee9c37db2013-06-21 18:30:24 -0700350struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700351 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700352 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700353 uint16_t length;
354 uint32_t xid;
355};
356
Rich Lanee9c37db2013-06-21 18:30:24 -0700357struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700358 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700359 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700360 uint16_t length;
361 uint32_t xid;
362};
363
Rich Lanee9c37db2013-06-21 18:30:24 -0700364struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700365 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700366 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700367 uint16_t length;
368 uint32_t xid;
369 uint16_t flags;
370 uint16_t miss_send_len;
371};
372
Rich Lanee9c37db2013-06-21 18:30:24 -0700373struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700374 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700375 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700376 uint16_t length;
377 uint32_t xid;
378 uint16_t flags;
379 uint16_t miss_send_len;
380};
381
Rich Lane68ae4d72013-05-09 10:55:19 -0700382struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700383 of_port_no_t port_no;
384 of_mac_addr_t hw_addr;
385 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700386 enum ofp_port_config config;
387 enum ofp_port_state state;
388 enum ofp_port_features curr;
389 enum ofp_port_features advertised;
390 enum ofp_port_features supported;
391 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700392};
393
Rich Lanee9c37db2013-06-21 18:30:24 -0700394struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700395 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700396 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700397 uint16_t length;
398 uint32_t xid;
399};
400
Rich Lanee9c37db2013-06-21 18:30:24 -0700401struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700402 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700403 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700404 uint16_t length;
405 uint32_t xid;
406 uint64_t datapath_id;
407 uint32_t n_buffers;
408 uint8_t n_tables;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700409 pad(3);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700410 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700411 uint32_t actions;
412 list(of_port_desc_t) ports;
413};
414
Rich Lanee9c37db2013-06-21 18:30:24 -0700415struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700416 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700417 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700418 uint16_t length;
419 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700420 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700421 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700422 of_port_desc_t desc;
423};
424
Rich Lanee9c37db2013-06-21 18:30:24 -0700425struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700426 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700427 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700428 uint16_t length;
429 uint32_t xid;
430 of_port_no_t port_no;
431 of_mac_addr_t hw_addr;
432 uint32_t config;
433 uint32_t mask;
434 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700435 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700436};
437
Rich Lanee9c37db2013-06-21 18:30:24 -0700438struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700439 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700440 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700441 uint16_t length;
442 uint32_t xid;
443 uint32_t buffer_id;
444 uint16_t total_len;
445 of_port_no_t in_port;
446 uint8_t reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700447 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700448 of_octets_t data;
449};
450
Rich Lanee9c37db2013-06-21 18:30:24 -0700451struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700452 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700453 uint16_t len;
454 of_port_no_t port;
455 uint16_t max_len;
456};
457
Rich Lanee9c37db2013-06-21 18:30:24 -0700458struct of_action_set_vlan_vid : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700459 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700460 uint16_t len;
461 uint16_t vlan_vid;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700462 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700463};
464
Rich Lanee9c37db2013-06-21 18:30:24 -0700465struct of_action_strip_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700466 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700467 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700468 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700469};
470
Rich Lanee9c37db2013-06-21 18:30:24 -0700471struct of_action_set_vlan_pcp : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700472 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700473 uint16_t len;
474 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700475 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700476};
477
Rich Lanee9c37db2013-06-21 18:30:24 -0700478struct of_action_set_dl_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700479 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700480 uint16_t len;
481 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700482 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700483};
484
Rich Lanee9c37db2013-06-21 18:30:24 -0700485struct of_action_set_dl_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700486 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700487 uint16_t len;
488 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700489 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700490};
491
Rich Lanee9c37db2013-06-21 18:30:24 -0700492struct of_action_set_nw_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700493 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700494 uint16_t len;
495 uint32_t nw_addr;
496};
497
Rich Lanee9c37db2013-06-21 18:30:24 -0700498struct of_action_set_nw_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700499 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700500 uint16_t len;
501 uint32_t nw_addr;
502};
503
Rich Lanee9c37db2013-06-21 18:30:24 -0700504struct of_action_set_tp_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700505 uint16_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700506 uint16_t len;
507 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700508 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700509};
510
Rich Lanee9c37db2013-06-21 18:30:24 -0700511struct of_action_set_tp_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700512 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700513 uint16_t len;
514 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700515 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700516};
517
Rich Lanee9c37db2013-06-21 18:30:24 -0700518struct of_action_set_nw_tos : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700519 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700520 uint16_t len;
521 uint8_t nw_tos;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700522 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700523};
524
Rich Lanee9c37db2013-06-21 18:30:24 -0700525struct of_action_experimenter : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700526 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700527 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700528 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700529 of_octets_t data;
530};
531
Rich Lanee9c37db2013-06-21 18:30:24 -0700532struct of_action_enqueue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700533 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700534 uint16_t len;
535 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700536 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700537 uint32_t queue_id;
538};
539
Rich Lane68ae4d72013-05-09 10:55:19 -0700540struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700541 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700542 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700543 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700544};
545
Rich Lanee9c37db2013-06-21 18:30:24 -0700546struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700547 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700548 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700549 uint16_t length;
550 uint32_t xid;
551 uint32_t buffer_id;
552 of_port_no_t in_port;
553 uint16_t actions_len;
554 list(of_action_t) actions;
555 of_octets_t data;
556};
557
Rich Lane68ae4d72013-05-09 10:55:19 -0700558struct of_match_v1 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700559 of_wc_bmap_t wildcards;
560 of_port_no_t in_port;
561 of_mac_addr_t eth_src;
562 of_mac_addr_t eth_dst;
563 uint16_t vlan_vid;
564 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700565 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700566 uint16_t eth_type;
567 uint8_t ip_dscp;
568 uint8_t ip_proto;
Rob Sherwood53989c82013-07-03 16:49:50 -0700569 pad(2);
Andreas Wundsamb566a162013-07-18 19:30:23 -0700570 of_ipv4_t ipv4_src;
571 of_ipv4_t ipv4_dst;
Rich Lanea06d0c32013-03-25 08:52:03 -0700572 uint16_t tcp_src;
573 uint16_t tcp_dst;
574};
575
Rich Lanee9c37db2013-06-21 18:30:24 -0700576struct of_flow_mod : of_header {
577 uint8_t version;
578 uint8_t type == 14;
579 uint16_t length;
580 uint32_t xid;
581 of_match_t match;
582 uint64_t cookie;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700583 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700584 uint16_t idle_timeout;
585 uint16_t hard_timeout;
586 uint16_t priority;
587 uint32_t buffer_id;
588 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700589 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700590 list(of_action_t) actions;
591};
592
593struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700594 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700595 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700596 uint16_t length;
597 uint32_t xid;
598 of_match_t match;
599 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700600 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700601 uint16_t idle_timeout;
602 uint16_t hard_timeout;
603 uint16_t priority;
604 uint32_t buffer_id;
605 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700606 enum ofp_flow_mod_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700607 list(of_action_t) actions;
608};
609
Rich Lanee9c37db2013-06-21 18:30:24 -0700610struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700611 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700612 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700613 uint16_t length;
614 uint32_t xid;
615 of_match_t match;
616 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700617 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700618 uint16_t idle_timeout;
619 uint16_t hard_timeout;
620 uint16_t priority;
621 uint32_t buffer_id;
622 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700623 enum ofp_flow_mod_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700624 list(of_action_t) actions;
625};
626
Rich Lanee9c37db2013-06-21 18:30:24 -0700627struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700628 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700629 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700630 uint16_t length;
631 uint32_t xid;
632 of_match_t match;
633 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700634 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700635 uint16_t idle_timeout;
636 uint16_t hard_timeout;
637 uint16_t priority;
638 uint32_t buffer_id;
639 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700640 enum ofp_flow_mod_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700641 list(of_action_t) actions;
642};
643
Rich Lanee9c37db2013-06-21 18:30:24 -0700644struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700645 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700646 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700647 uint16_t length;
648 uint32_t xid;
649 of_match_t match;
650 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700651 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700652 uint16_t idle_timeout;
653 uint16_t hard_timeout;
654 uint16_t priority;
655 uint32_t buffer_id;
656 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700657 enum ofp_flow_mod_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700658 list(of_action_t) actions;
659};
660
Rich Lanee9c37db2013-06-21 18:30:24 -0700661struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700662 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700663 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700664 uint16_t length;
665 uint32_t xid;
666 of_match_t match;
667 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700668 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700669 uint16_t idle_timeout;
670 uint16_t hard_timeout;
671 uint16_t priority;
672 uint32_t buffer_id;
673 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700674 enum ofp_flow_mod_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700675 list(of_action_t) actions;
676};
677
Rich Lanee9c37db2013-06-21 18:30:24 -0700678struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700679 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700680 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700681 uint16_t length;
682 uint32_t xid;
683 of_match_t match;
684 uint64_t cookie;
685 uint16_t priority;
686 uint8_t reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700687 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700688 uint32_t duration_sec;
689 uint32_t duration_nsec;
690 uint16_t idle_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700691 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700692 uint64_t packet_count;
693 uint64_t byte_count;
694};
695
Rich Lanee9c37db2013-06-21 18:30:24 -0700696struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700697 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700698 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700699 uint16_t length;
700 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700701 uint16_t err_type == ?;
702};
703
704struct of_hello_failed_error_msg : of_error_msg {
705 uint8_t version;
706 uint8_t type == 1;
707 uint16_t length;
708 uint32_t xid;
709 uint16_t err_type == 0;
710 enum ofp_hello_failed_code code;
711 of_octets_t data;
712};
713
714struct of_bad_request_error_msg : of_error_msg {
715 uint8_t version;
716 uint8_t type == 1;
717 uint16_t length;
718 uint32_t xid;
719 uint16_t err_type == 1;
720 enum ofp_bad_request_code code;
721 of_octets_t data;
722};
723
724struct of_bad_action_error_msg : of_error_msg {
725 uint8_t version;
726 uint8_t type == 1;
727 uint16_t length;
728 uint32_t xid;
729 uint16_t err_type == 2;
730 enum ofp_bad_action_code code;
731 of_octets_t data;
732};
733
734struct of_flow_mod_failed_error_msg : of_error_msg {
735 uint8_t version;
736 uint8_t type == 1;
737 uint16_t length;
738 uint32_t xid;
739 uint16_t err_type == 3;
740 enum ofp_flow_mod_failed_code code;
741 of_octets_t data;
742};
743
744struct of_port_mod_failed_error_msg : of_error_msg {
745 uint8_t version;
746 uint8_t type == 1;
747 uint16_t length;
748 uint32_t xid;
749 uint16_t err_type == 4;
750 enum ofp_port_mod_failed_code code;
751 of_octets_t data;
752};
753
754struct of_queue_op_failed_error_msg : of_error_msg {
755 uint8_t version;
756 uint8_t type == 1;
757 uint16_t length;
758 uint32_t xid;
759 uint16_t err_type == 5;
760 enum ofp_queue_op_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -0700761 of_octets_t data;
762};
763
764// STATS ENTRIES: flow, table, port, queue,
Rich Lane68ae4d72013-05-09 10:55:19 -0700765struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700766 uint16_t length;
767 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700768 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700769 of_match_t match;
770 uint32_t duration_sec;
771 uint32_t duration_nsec;
772 uint16_t priority;
773 uint16_t idle_timeout;
774 uint16_t hard_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700775 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700776 uint64_t cookie;
777 uint64_t packet_count;
778 uint64_t byte_count;
779 list(of_action_t) actions;
780};
781
Rich Lane68ae4d72013-05-09 10:55:19 -0700782struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700783 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700784 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700785 of_table_name_t name;
786 of_wc_bmap_t wildcards;
787 uint32_t max_entries;
788 uint32_t active_count;
789 uint64_t lookup_count;
790 uint64_t matched_count;
791};
792
Rich Lane68ae4d72013-05-09 10:55:19 -0700793struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700794 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700795 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700796 uint64_t rx_packets;
797 uint64_t tx_packets;
798 uint64_t rx_bytes;
799 uint64_t tx_bytes;
800 uint64_t rx_dropped;
801 uint64_t tx_dropped;
802 uint64_t rx_errors;
803 uint64_t tx_errors;
804 uint64_t rx_frame_err;
805 uint64_t rx_over_err;
806 uint64_t rx_crc_err;
807 uint64_t collisions;
808};
809
Rich Lane68ae4d72013-05-09 10:55:19 -0700810struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700811 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700812 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700813 uint32_t queue_id;
814 uint64_t tx_bytes;
815 uint64_t tx_packets;
816 uint64_t tx_errors;
817};
818
819// STATS request/reply: Desc, flow, agg, table, port, queue
820
Rich Lanee9c37db2013-06-21 18:30:24 -0700821struct of_stats_request : of_header {
822 uint8_t version;
823 uint8_t type == 16;
824 uint16_t length;
825 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700826 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700827 uint16_t flags;
828};
829
830struct of_stats_reply : of_header {
831 uint8_t version;
832 uint8_t type == 17;
833 uint16_t length;
834 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700835 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700836 uint16_t flags;
837};
838
839struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700840 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700841 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700842 uint16_t length;
843 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700844 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700845 uint16_t flags;
846};
847
Rich Lanee9c37db2013-06-21 18:30:24 -0700848struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700849 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700850 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700851 uint16_t length;
852 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700853 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700854 uint16_t flags;
855 of_desc_str_t mfr_desc;
856 of_desc_str_t hw_desc;
857 of_desc_str_t sw_desc;
858 of_serial_num_t serial_num;
859 of_desc_str_t dp_desc;
860};
861
Rich Lanee9c37db2013-06-21 18:30:24 -0700862struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700863 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700864 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700865 uint16_t length;
866 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700867 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700868 uint16_t flags;
869 of_match_t match;
870 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700871 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700872 of_port_no_t out_port;
873};
874
Rich Lanee9c37db2013-06-21 18:30:24 -0700875struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700876 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700877 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700878 uint16_t length;
879 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700880 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700881 uint16_t flags;
882 list(of_flow_stats_entry_t) entries;
883};
884
Rich Lanee9c37db2013-06-21 18:30:24 -0700885struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700886 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700887 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700888 uint16_t length;
889 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700890 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700891 uint16_t flags;
892 of_match_t match;
893 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700894 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700895 of_port_no_t out_port;
896};
897
Rich Lanee9c37db2013-06-21 18:30:24 -0700898struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700899 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700900 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700901 uint16_t length;
902 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700903 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700904 uint16_t flags;
905 uint64_t packet_count;
906 uint64_t byte_count;
907 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700908 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700909};
910
Rich Lanee9c37db2013-06-21 18:30:24 -0700911struct of_table_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700912 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700913 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700914 uint16_t length;
915 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700916 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700917 uint16_t flags;
918};
919
Rich Lanee9c37db2013-06-21 18:30:24 -0700920struct of_table_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700921 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700922 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700923 uint16_t length;
924 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700925 uint16_t stats_type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700926 uint16_t flags;
927 list(of_table_stats_entry_t) entries;
928};
929
Rich Lanee9c37db2013-06-21 18:30:24 -0700930struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700931 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700932 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700933 uint16_t length;
934 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700935 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700936 uint16_t flags;
937 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700938 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700939};
940
Rich Lanee9c37db2013-06-21 18:30:24 -0700941struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700942 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700943 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700944 uint16_t length;
945 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700946 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700947 uint16_t flags;
948 list(of_port_stats_entry_t) entries;
949};
950
Rich Lanee9c37db2013-06-21 18:30:24 -0700951struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700952 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700953 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700954 uint16_t length;
955 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700956 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700957 uint16_t flags;
958 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700959 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700960 uint32_t queue_id;
961};
962
Rich Lanee9c37db2013-06-21 18:30:24 -0700963struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700964 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700965 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700966 uint16_t length;
967 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700968 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700969 uint16_t flags;
970 list(of_queue_stats_entry_t) entries;
971};
972
Rich Lanee9c37db2013-06-21 18:30:24 -0700973struct of_experimenter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700974 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700975 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700976 uint16_t length;
977 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700978 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -0700979 uint16_t flags;
Rich Laneb25d07c2013-08-22 17:22:43 -0700980 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700981 of_octets_t data;
982};
983
Rich Lanee9c37db2013-06-21 18:30:24 -0700984struct of_experimenter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700985 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700986 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700987 uint16_t length;
988 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700989 uint16_t stats_type == 0xffff;
Rich Lanea06d0c32013-03-25 08:52:03 -0700990 uint16_t flags;
Rich Laneb25d07c2013-08-22 17:22:43 -0700991 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700992 of_octets_t data;
993};
994
995// END OF STATS OBJECTS
996
Rich Lane68ae4d72013-05-09 10:55:19 -0700997struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700998 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700999 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001000 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001001};
1002
Rich Lanee9c37db2013-06-21 18:30:24 -07001003struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001004 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001005 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001006 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001007 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001008 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001009};
1010
Rich Lane68ae4d72013-05-09 10:55:19 -07001011struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001012 uint32_t queue_id;
1013 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001014 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001015 list(of_queue_prop_t) properties;
1016};
1017
Rich Lanee9c37db2013-06-21 18:30:24 -07001018struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001019 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001020 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -07001021 uint16_t length;
1022 uint32_t xid;
1023 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001024 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001025};
1026
Rich Lanee9c37db2013-06-21 18:30:24 -07001027struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001028 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001029 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -07001030 uint16_t length;
1031 uint32_t xid;
1032 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001033 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001034 list(of_packet_queue_t) queues;
1035};