blob: 1e4750bc98906782edbea1c67f8434266279ef4f [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 Wundsam057540b2013-11-19 16:51:36 -0800193enum ofp_config_flags(wire_type=uint16_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 Wundsamb47d7e82013-10-18 17:43:00 -0700214enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) {
215};
216
217
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700218enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700219 OFPSF_REPLY_MORE = 0x1,
220};
221
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700222enum ofp_stats_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700223 OFPST_DESC = 0,
224 OFPST_FLOW = 1,
225 OFPST_AGGREGATE = 2,
226 OFPST_TABLE = 3,
227 OFPST_PORT = 4,
228 OFPST_QUEUE = 5,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700229 OFPST_EXPERIMENTER = 0xffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700230};
231
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700232enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700233 OFPR_NO_MATCH = 0,
234 OFPR_ACTION = 1,
235};
236
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700237enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700238 OFPRR_IDLE_TIMEOUT = 0,
239 OFPRR_HARD_TIMEOUT = 1,
240 OFPRR_DELETE = 2,
241};
242
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700243enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700244 OFPPR_ADD = 0,
245 OFPPR_DELETE = 1,
246 OFPPR_MODIFY = 2,
247};
248
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700249enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700250 OFPET_HELLO_FAILED = 0,
251 OFPET_BAD_REQUEST = 1,
252 OFPET_BAD_ACTION = 2,
253 OFPET_FLOW_MOD_FAILED = 3,
254 OFPET_PORT_MOD_FAILED = 4,
255 OFPET_QUEUE_OP_FAILED = 5,
256};
257
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700258enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700259 OFPHFC_INCOMPATIBLE = 0,
260 OFPHFC_EPERM = 1,
261};
262
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700263enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700264 OFPBRC_BAD_VERSION = 0,
265 OFPBRC_BAD_TYPE = 1,
266 OFPBRC_BAD_STAT = 2,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700267 OFPBRC_BAD_EXPERIMENTER = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700268 OFPBRC_BAD_SUBTYPE = 4,
269 OFPBRC_EPERM = 5,
270 OFPBRC_BAD_LEN = 6,
271 OFPBRC_BUFFER_EMPTY = 7,
272 OFPBRC_BUFFER_UNKNOWN = 8,
273};
274
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700275enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700276 OFPBAC_BAD_TYPE = 0,
277 OFPBAC_BAD_LEN = 1,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700278 OFPBAC_BAD_EXPERIMENTER = 2,
279 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700280 OFPBAC_BAD_OUT_PORT = 4,
281 OFPBAC_BAD_ARGUMENT = 5,
282 OFPBAC_EPERM = 6,
283 OFPBAC_TOO_MANY = 7,
284 OFPBAC_BAD_QUEUE = 8,
285};
286
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700287enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700288 OFPFMFC_ALL_TABLES_FULL = 0,
289 OFPFMFC_OVERLAP = 1,
290 OFPFMFC_EPERM = 2,
291 OFPFMFC_BAD_EMERG_TIMEOUT = 3,
292 OFPFMFC_BAD_COMMAND = 4,
293 OFPFMFC_UNSUPPORTED = 5,
294};
295
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700296enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700297 OFPPMFC_BAD_PORT = 0,
298 OFPPMFC_BAD_HW_ADDR = 1,
299};
300
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700301enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700302 OFPQOFC_BAD_PORT = 0,
303 OFPQOFC_BAD_QUEUE = 1,
304 OFPQOFC_EPERM = 2,
305};
306
Rich Lanee9c37db2013-06-21 18:30:24 -0700307/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700308struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700309 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700310 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700311 uint16_t length;
312 uint32_t xid;
313};
314
Rich Lanee9c37db2013-06-21 18:30:24 -0700315struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700316 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700317 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700318 uint16_t length;
319 uint32_t xid;
320};
321
Rich Lanee9c37db2013-06-21 18:30:24 -0700322struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700323 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700324 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700325 uint16_t length;
326 uint32_t xid;
327 of_octets_t data;
328};
329
Rich Lanee9c37db2013-06-21 18:30:24 -0700330struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700331 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700332 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700333 uint16_t length;
334 uint32_t xid;
335 of_octets_t data;
336};
337
Rich Lanee9c37db2013-06-21 18:30:24 -0700338struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700339 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700340 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700341 uint16_t length;
342 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700343 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700344 of_octets_t data;
345};
346
Rich Lanee9c37db2013-06-21 18:30:24 -0700347struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700348 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700349 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700350 uint16_t length;
351 uint32_t xid;
352};
353
Rich Lanee9c37db2013-06-21 18:30:24 -0700354struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700355 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700356 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700357 uint16_t length;
358 uint32_t xid;
359};
360
Rich Lanee9c37db2013-06-21 18:30:24 -0700361struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700362 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700363 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700364 uint16_t length;
365 uint32_t xid;
366};
367
Rich Lanee9c37db2013-06-21 18:30:24 -0700368struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700369 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700370 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700371 uint16_t length;
372 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800373 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700374 uint16_t miss_send_len;
375};
376
Rich Lanee9c37db2013-06-21 18:30:24 -0700377struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700378 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700379 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700380 uint16_t length;
381 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800382 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700383 uint16_t miss_send_len;
384};
385
Rich Lane68ae4d72013-05-09 10:55:19 -0700386struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700387 of_port_no_t port_no;
388 of_mac_addr_t hw_addr;
389 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700390 enum ofp_port_config config;
391 enum ofp_port_state state;
392 enum ofp_port_features curr;
393 enum ofp_port_features advertised;
394 enum ofp_port_features supported;
395 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700396};
397
Rich Lanee9c37db2013-06-21 18:30:24 -0700398struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700399 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700400 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700401 uint16_t length;
402 uint32_t xid;
403};
404
Rich Lanee9c37db2013-06-21 18:30:24 -0700405struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700406 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700407 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700408 uint16_t length;
409 uint32_t xid;
410 uint64_t datapath_id;
411 uint32_t n_buffers;
412 uint8_t n_tables;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700413 pad(3);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700414 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700415 uint32_t actions;
416 list(of_port_desc_t) ports;
417};
418
Rich Lanee9c37db2013-06-21 18:30:24 -0700419struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700420 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700421 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700422 uint16_t length;
423 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700424 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700425 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700426 of_port_desc_t desc;
427};
428
Rich Lanee9c37db2013-06-21 18:30:24 -0700429struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700430 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700431 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700432 uint16_t length;
433 uint32_t xid;
434 of_port_no_t port_no;
435 of_mac_addr_t hw_addr;
436 uint32_t config;
437 uint32_t mask;
438 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700439 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700440};
441
Rich Lanee9c37db2013-06-21 18:30:24 -0700442struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700443 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700444 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700445 uint16_t length;
446 uint32_t xid;
447 uint32_t buffer_id;
448 uint16_t total_len;
449 of_port_no_t in_port;
450 uint8_t reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700451 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700452 of_octets_t data;
453};
454
Rich Lanee9c37db2013-06-21 18:30:24 -0700455struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700456 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700457 uint16_t len;
458 of_port_no_t port;
459 uint16_t max_len;
460};
461
Rich Lanee9c37db2013-06-21 18:30:24 -0700462struct of_action_set_vlan_vid : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700463 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700464 uint16_t len;
465 uint16_t vlan_vid;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700466 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700467};
468
Rich Lanee9c37db2013-06-21 18:30:24 -0700469struct of_action_strip_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700470 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700471 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700472 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700473};
474
Rich Lanee9c37db2013-06-21 18:30:24 -0700475struct of_action_set_vlan_pcp : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700476 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700477 uint16_t len;
478 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700479 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700480};
481
Rich Lanee9c37db2013-06-21 18:30:24 -0700482struct of_action_set_dl_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700483 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700484 uint16_t len;
485 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700486 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700487};
488
Rich Lanee9c37db2013-06-21 18:30:24 -0700489struct of_action_set_dl_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700490 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700491 uint16_t len;
492 of_mac_addr_t dl_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700493 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700494};
495
Rich Lanee9c37db2013-06-21 18:30:24 -0700496struct of_action_set_nw_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700497 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700498 uint16_t len;
499 uint32_t nw_addr;
500};
501
Rich Lanee9c37db2013-06-21 18:30:24 -0700502struct of_action_set_nw_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700503 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700504 uint16_t len;
505 uint32_t nw_addr;
506};
507
Rich Lanee9c37db2013-06-21 18:30:24 -0700508struct of_action_set_tp_src : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700509 uint16_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700510 uint16_t len;
511 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700512 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700513};
514
Rich Lanee9c37db2013-06-21 18:30:24 -0700515struct of_action_set_tp_dst : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700516 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -0700517 uint16_t len;
518 uint16_t tp_port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700519 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700520};
521
Rich Lanee9c37db2013-06-21 18:30:24 -0700522struct of_action_set_nw_tos : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700523 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700524 uint16_t len;
525 uint8_t nw_tos;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700526 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700527};
528
Rich Lanee9c37db2013-06-21 18:30:24 -0700529struct of_action_experimenter : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700530 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700531 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700532 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700533 of_octets_t data;
534};
535
Rich Lanee9c37db2013-06-21 18:30:24 -0700536struct of_action_enqueue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700537 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700538 uint16_t len;
539 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700540 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700541 uint32_t queue_id;
542};
543
Rich Lane68ae4d72013-05-09 10:55:19 -0700544struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700545 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700546 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700547 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700548};
549
Rich Lanee9c37db2013-06-21 18:30:24 -0700550struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700551 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700552 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -0700553 uint16_t length;
554 uint32_t xid;
555 uint32_t buffer_id;
556 of_port_no_t in_port;
557 uint16_t actions_len;
558 list(of_action_t) actions;
559 of_octets_t data;
560};
561
Rich Lane68ae4d72013-05-09 10:55:19 -0700562struct of_match_v1 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700563 of_wc_bmap_t wildcards;
564 of_port_no_t in_port;
565 of_mac_addr_t eth_src;
566 of_mac_addr_t eth_dst;
567 uint16_t vlan_vid;
568 uint8_t vlan_pcp;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700569 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700570 uint16_t eth_type;
571 uint8_t ip_dscp;
572 uint8_t ip_proto;
Rob Sherwood53989c82013-07-03 16:49:50 -0700573 pad(2);
Andreas Wundsamb566a162013-07-18 19:30:23 -0700574 of_ipv4_t ipv4_src;
575 of_ipv4_t ipv4_dst;
Rich Lanea06d0c32013-03-25 08:52:03 -0700576 uint16_t tcp_src;
577 uint16_t tcp_dst;
578};
579
Rich Lanee9c37db2013-06-21 18:30:24 -0700580struct of_flow_mod : of_header {
581 uint8_t version;
582 uint8_t type == 14;
583 uint16_t length;
584 uint32_t xid;
585 of_match_t match;
586 uint64_t cookie;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700587 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700588 uint16_t idle_timeout;
589 uint16_t hard_timeout;
590 uint16_t priority;
591 uint32_t buffer_id;
592 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700593 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700594 list(of_action_t) actions;
595};
596
597struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700598 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700599 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700600 uint16_t length;
601 uint32_t xid;
602 of_match_t match;
603 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700604 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700605 uint16_t idle_timeout;
606 uint16_t hard_timeout;
607 uint16_t priority;
608 uint32_t buffer_id;
609 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700610 enum ofp_flow_mod_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700611 list(of_action_t) actions;
612};
613
Rich Lanee9c37db2013-06-21 18:30:24 -0700614struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700615 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700616 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700617 uint16_t length;
618 uint32_t xid;
619 of_match_t match;
620 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700621 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700622 uint16_t idle_timeout;
623 uint16_t hard_timeout;
624 uint16_t priority;
625 uint32_t buffer_id;
626 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700627 enum ofp_flow_mod_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700628 list(of_action_t) actions;
629};
630
Rich Lanee9c37db2013-06-21 18:30:24 -0700631struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700632 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700633 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700634 uint16_t length;
635 uint32_t xid;
636 of_match_t match;
637 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700638 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700639 uint16_t idle_timeout;
640 uint16_t hard_timeout;
641 uint16_t priority;
642 uint32_t buffer_id;
643 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700644 enum ofp_flow_mod_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700645 list(of_action_t) actions;
646};
647
Rich Lanee9c37db2013-06-21 18:30:24 -0700648struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700649 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700650 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700651 uint16_t length;
652 uint32_t xid;
653 of_match_t match;
654 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700655 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700656 uint16_t idle_timeout;
657 uint16_t hard_timeout;
658 uint16_t priority;
659 uint32_t buffer_id;
660 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700661 enum ofp_flow_mod_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700662 list(of_action_t) actions;
663};
664
Rich Lanee9c37db2013-06-21 18:30:24 -0700665struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700666 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700667 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700668 uint16_t length;
669 uint32_t xid;
670 of_match_t match;
671 uint64_t cookie;
Rich Lane31b87142013-05-09 22:05:42 -0700672 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700673 uint16_t idle_timeout;
674 uint16_t hard_timeout;
675 uint16_t priority;
676 uint32_t buffer_id;
677 of_port_no_t out_port;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700678 enum ofp_flow_mod_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700679 list(of_action_t) actions;
680};
681
Rich Lanee9c37db2013-06-21 18:30:24 -0700682struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700683 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700684 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700685 uint16_t length;
686 uint32_t xid;
687 of_match_t match;
688 uint64_t cookie;
689 uint16_t priority;
690 uint8_t reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700691 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700692 uint32_t duration_sec;
693 uint32_t duration_nsec;
694 uint16_t idle_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700695 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700696 uint64_t packet_count;
697 uint64_t byte_count;
698};
699
Rich Lanee9c37db2013-06-21 18:30:24 -0700700struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700701 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700702 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700703 uint16_t length;
704 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700705 uint16_t err_type == ?;
706};
707
708struct of_hello_failed_error_msg : of_error_msg {
709 uint8_t version;
710 uint8_t type == 1;
711 uint16_t length;
712 uint32_t xid;
713 uint16_t err_type == 0;
714 enum ofp_hello_failed_code code;
715 of_octets_t data;
716};
717
718struct of_bad_request_error_msg : of_error_msg {
719 uint8_t version;
720 uint8_t type == 1;
721 uint16_t length;
722 uint32_t xid;
723 uint16_t err_type == 1;
724 enum ofp_bad_request_code code;
725 of_octets_t data;
726};
727
728struct of_bad_action_error_msg : of_error_msg {
729 uint8_t version;
730 uint8_t type == 1;
731 uint16_t length;
732 uint32_t xid;
733 uint16_t err_type == 2;
734 enum ofp_bad_action_code code;
735 of_octets_t data;
736};
737
738struct of_flow_mod_failed_error_msg : of_error_msg {
739 uint8_t version;
740 uint8_t type == 1;
741 uint16_t length;
742 uint32_t xid;
743 uint16_t err_type == 3;
744 enum ofp_flow_mod_failed_code code;
745 of_octets_t data;
746};
747
748struct of_port_mod_failed_error_msg : of_error_msg {
749 uint8_t version;
750 uint8_t type == 1;
751 uint16_t length;
752 uint32_t xid;
753 uint16_t err_type == 4;
754 enum ofp_port_mod_failed_code code;
755 of_octets_t data;
756};
757
758struct of_queue_op_failed_error_msg : of_error_msg {
759 uint8_t version;
760 uint8_t type == 1;
761 uint16_t length;
762 uint32_t xid;
763 uint16_t err_type == 5;
764 enum ofp_queue_op_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -0700765 of_octets_t data;
766};
767
768// STATS ENTRIES: flow, table, port, queue,
Rich Lane68ae4d72013-05-09 10:55:19 -0700769struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700770 uint16_t length;
771 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700772 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700773 of_match_t match;
774 uint32_t duration_sec;
775 uint32_t duration_nsec;
776 uint16_t priority;
777 uint16_t idle_timeout;
778 uint16_t hard_timeout;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700779 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700780 uint64_t cookie;
781 uint64_t packet_count;
782 uint64_t byte_count;
783 list(of_action_t) actions;
784};
785
Rich Lane68ae4d72013-05-09 10:55:19 -0700786struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700787 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700788 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700789 of_table_name_t name;
790 of_wc_bmap_t wildcards;
791 uint32_t max_entries;
792 uint32_t active_count;
793 uint64_t lookup_count;
794 uint64_t matched_count;
795};
796
Rich Lane68ae4d72013-05-09 10:55:19 -0700797struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700798 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700799 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700800 uint64_t rx_packets;
801 uint64_t tx_packets;
802 uint64_t rx_bytes;
803 uint64_t tx_bytes;
804 uint64_t rx_dropped;
805 uint64_t tx_dropped;
806 uint64_t rx_errors;
807 uint64_t tx_errors;
808 uint64_t rx_frame_err;
809 uint64_t rx_over_err;
810 uint64_t rx_crc_err;
811 uint64_t collisions;
812};
813
Rich Lane68ae4d72013-05-09 10:55:19 -0700814struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -0700815 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700816 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700817 uint32_t queue_id;
818 uint64_t tx_bytes;
819 uint64_t tx_packets;
820 uint64_t tx_errors;
821};
822
823// STATS request/reply: Desc, flow, agg, table, port, queue
824
Rich Lanee9c37db2013-06-21 18:30:24 -0700825struct of_stats_request : of_header {
826 uint8_t version;
827 uint8_t type == 16;
828 uint16_t length;
829 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700830 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700831 enum ofp_stats_request_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700832};
833
834struct of_stats_reply : of_header {
835 uint8_t version;
836 uint8_t type == 17;
837 uint16_t length;
838 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700839 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700840 enum ofp_stats_reply_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700841};
842
843struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700844 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700845 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700846 uint16_t length;
847 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700848 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700849 enum ofp_stats_request_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700850};
851
Rich Lanee9c37db2013-06-21 18:30:24 -0700852struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700853 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700854 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700855 uint16_t length;
856 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700857 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700858 enum ofp_stats_reply_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700859 of_desc_str_t mfr_desc;
860 of_desc_str_t hw_desc;
861 of_desc_str_t sw_desc;
862 of_serial_num_t serial_num;
863 of_desc_str_t dp_desc;
864};
865
Rich Lanee9c37db2013-06-21 18:30:24 -0700866struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700867 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700868 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700869 uint16_t length;
870 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700871 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700872 enum ofp_stats_request_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700873 of_match_t match;
874 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700875 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700876 of_port_no_t out_port;
877};
878
Rich Lanee9c37db2013-06-21 18:30:24 -0700879struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700880 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700881 uint8_t type == 17;
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 == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700885 enum ofp_stats_reply_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700886 list(of_flow_stats_entry_t) entries;
887};
888
Rich Lanee9c37db2013-06-21 18:30:24 -0700889struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700890 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700891 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700892 uint16_t length;
893 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700894 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700895 enum ofp_stats_request_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700896 of_match_t match;
897 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700898 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -0700899 of_port_no_t out_port;
900};
901
Rich Lanee9c37db2013-06-21 18:30:24 -0700902struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700903 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700904 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700905 uint16_t length;
906 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700907 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700908 enum ofp_stats_reply_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700909 uint64_t packet_count;
910 uint64_t byte_count;
911 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700912 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700913};
914
Rich Lanee9c37db2013-06-21 18:30:24 -0700915struct of_table_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700916 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700917 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700918 uint16_t length;
919 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700920 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700921 enum ofp_stats_request_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700922};
923
Rich Lanee9c37db2013-06-21 18:30:24 -0700924struct of_table_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700925 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700926 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700927 uint16_t length;
928 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700929 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700930 enum ofp_stats_reply_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700931 list(of_table_stats_entry_t) entries;
932};
933
Rich Lanee9c37db2013-06-21 18:30:24 -0700934struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700935 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700936 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700937 uint16_t length;
938 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700939 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700940 enum ofp_stats_request_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700941 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700942 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700943};
944
Rich Lanee9c37db2013-06-21 18:30:24 -0700945struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700946 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700947 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700948 uint16_t length;
949 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700950 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700951 enum ofp_stats_reply_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700952 list(of_port_stats_entry_t) entries;
953};
954
Rich Lanee9c37db2013-06-21 18:30:24 -0700955struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700956 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700957 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700958 uint16_t length;
959 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700960 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700961 enum ofp_stats_request_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700962 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700963 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700964 uint32_t queue_id;
965};
966
Rich Lanee9c37db2013-06-21 18:30:24 -0700967struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700968 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700969 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700970 uint16_t length;
971 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700972 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700973 enum ofp_stats_reply_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700974 list(of_queue_stats_entry_t) entries;
975};
976
Rich Lanee9c37db2013-06-21 18:30:24 -0700977struct of_experimenter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -0700978 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700979 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700980 uint16_t length;
981 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700982 uint16_t stats_type == 0xffff;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700983 enum ofp_stats_request_flags flags;
Rich Laneb25d07c2013-08-22 17:22:43 -0700984 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700985 of_octets_t data;
986};
987
Rich Lanee9c37db2013-06-21 18:30:24 -0700988struct of_experimenter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -0700989 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700990 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700991 uint16_t length;
992 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -0700993 uint16_t stats_type == 0xffff;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -0700994 enum ofp_stats_reply_flags flags;
Rich Laneb25d07c2013-08-22 17:22:43 -0700995 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700996 of_octets_t data;
997};
998
999// END OF STATS OBJECTS
1000
Rich Lane68ae4d72013-05-09 10:55:19 -07001001struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001002 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001003 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001004 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001005};
1006
Rich Lanee9c37db2013-06-21 18:30:24 -07001007struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001008 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001009 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001010 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001011 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001012 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001013};
1014
Rich Lane68ae4d72013-05-09 10:55:19 -07001015struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001016 uint32_t queue_id;
1017 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001018 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001019 list(of_queue_prop_t) properties;
1020};
1021
Rich Lanee9c37db2013-06-21 18:30:24 -07001022struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001023 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001024 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -07001025 uint16_t length;
1026 uint32_t xid;
1027 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001028 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001029};
1030
Rich Lanee9c37db2013-06-21 18:30:24 -07001031struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001032 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001033 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -07001034 uint16_t length;
1035 uint32_t xid;
1036 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001037 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001038 list(of_packet_queue_t) queues;
1039};