blob: 723595f8dd050d9b415216287647e2f7ae89f07c [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 4
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 = 0,
46
47 OFP_FLOW_PERMANENT = 0,
48
49 OFP_DEFAULT_PRIORITY = 0x8000,
50
51 OFP_NO_BUFFER = 0xffffffff,
52
53 DESC_STR_LEN = 256,
54 SERIAL_NUM_LEN = 32,
55
56 OFPQ_ALL = 0xffffffff,
57 OFPQ_MAX_RATE_UNCFG = 0xffff,
58 OFPQ_MIN_RATE_UNCFG = 0xffff,
59};
60
Andreas Wundsam4ee51462013-07-30 11:00:37 -070061enum ofp_port(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070062 OFPP_MAX = 0xffffff00,
63 OFPP_IN_PORT = 0xfffffff8,
64 OFPP_TABLE = 0xfffffff9,
65 OFPP_NORMAL = 0xfffffffa,
66 OFPP_FLOOD = 0xfffffffb,
67 OFPP_ALL = 0xfffffffc,
68 OFPP_CONTROLLER = 0xfffffffd,
69 OFPP_LOCAL = 0xfffffffe,
Tomasz949aa522013-10-23 16:12:27 -070070 OFPP_ANY = 0xffffffff,
Rich Lane5d33a622013-04-08 17:33:11 -070071};
72
Andreas Wundsam4ee51462013-07-30 11:00:37 -070073enum ofp_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070074 OFPT_HELLO = 0,
75 OFPT_ERROR = 1,
76 OFPT_ECHO_REQUEST = 2,
77 OFPT_ECHO_REPLY = 3,
78 OFPT_EXPERIMENTER = 4,
79 OFPT_FEATURES_REQUEST = 5,
80 OFPT_FEATURES_REPLY = 6,
81 OFPT_GET_CONFIG_REQUEST = 7,
82 OFPT_GET_CONFIG_REPLY = 8,
83 OFPT_SET_CONFIG = 9,
84 OFPT_PACKET_IN = 10,
85 OFPT_FLOW_REMOVED = 11,
86 OFPT_PORT_STATUS = 12,
87 OFPT_PACKET_OUT = 13,
88 OFPT_FLOW_MOD = 14,
89 OFPT_GROUP_MOD = 15,
90 OFPT_PORT_MOD = 16,
91 OFPT_TABLE_MOD = 17,
Rob Vaterlausfeee3712013-09-30 11:24:19 -070092 OFPT_STATS_REQUEST = 18,
93 OFPT_STATS_REPLY = 19,
Rich Lane5d33a622013-04-08 17:33:11 -070094 OFPT_BARRIER_REQUEST = 20,
95 OFPT_BARRIER_REPLY = 21,
96 OFPT_QUEUE_GET_CONFIG_REQUEST = 22,
97 OFPT_QUEUE_GET_CONFIG_REPLY = 23,
98 OFPT_ROLE_REQUEST = 24,
99 OFPT_ROLE_REPLY = 25,
100 OFPT_GET_ASYNC_REQUEST = 26,
101 OFPT_GET_ASYNC_REPLY = 27,
102 OFPT_SET_ASYNC = 28,
103 OFPT_METER_MOD = 29,
104};
105
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700106enum ofp_config_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700107 OFPC_FRAG_NORMAL = 0,
108 OFPC_FRAG_DROP = 1,
109 OFPC_FRAG_REASM = 2,
110 OFPC_FRAG_MASK = 3,
111};
112
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700113enum ofp_table_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700114 OFPTC_DEPRECATED_MASK = 0x3,
115};
116
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700117enum ofp_table(wire_type=uint8_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700118 OFPTT_MAX = 0xfe,
119 OFPTT_ALL = 0xff,
120};
121
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700122enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700123 OFPC_FLOW_STATS = 0x1,
124 OFPC_TABLE_STATS = 0x2,
125 OFPC_PORT_STATS = 0x4,
126 OFPC_GROUP_STATS = 0x8,
127 OFPC_IP_REASM = 0x20,
128 OFPC_QUEUE_STATS = 0x40,
129 OFPC_PORT_BLOCKED = 0x100,
130};
131
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700132enum ofp_port_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700133 OFPPC_PORT_DOWN = 0x1,
134 OFPPC_NO_RECV = 0x4,
135 OFPPC_NO_FWD = 0x20,
136 OFPPC_NO_PACKET_IN = 0x40,
Rob Vaterlaus0a8ec142013-10-10 13:27:14 -0700137 OFPPC_BSN_MIRROR_DEST = 0x80000000,
Rich Lane5d33a622013-04-08 17:33:11 -0700138};
139
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700140enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700141 OFPPS_LINK_DOWN = 0x1,
142 OFPPS_BLOCKED = 0x2,
143 OFPPS_LIVE = 0x4,
144};
145
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700146enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700147 OFPPF_10MB_HD = 0x1,
148 OFPPF_10MB_FD = 0x2,
149 OFPPF_100MB_HD = 0x4,
150 OFPPF_100MB_FD = 0x8,
151 OFPPF_1GB_HD = 0x10,
152 OFPPF_1GB_FD = 0x20,
153 OFPPF_10GB_FD = 0x40,
154 OFPPF_40GB_FD = 0x80,
155 OFPPF_100GB_FD = 0x100,
156 OFPPF_1TB_FD = 0x200,
157 OFPPF_OTHER = 0x400,
158 OFPPF_COPPER = 0x800,
159 OFPPF_FIBER = 0x1000,
160 OFPPF_AUTONEG = 0x2000,
161 OFPPF_PAUSE = 0x4000,
162 OFPPF_PAUSE_ASYM = 0x8000,
163};
164
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700165enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700166 OFPPR_ADD = 0,
167 OFPPR_DELETE = 1,
168 OFPPR_MODIFY = 2,
169};
170
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700171enum ofp_match_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700172 OFPMT_STANDARD = 0,
173 OFPMT_OXM = 1,
174};
175
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700176enum ofp_oxm_class(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700177 OFPXMC_NXM_0 = 0,
178 OFPXMC_NXM_1 = 1,
179 OFPXMC_OPENFLOW_BASIC = 0x8000,
180 OFPXMC_EXPERIMENTER = 0xffff,
181};
182
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700183enum ofp_vlan_id(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700184 OFPVID_NONE = 0,
185 OFPVID_PRESENT = 0x1000,
186};
187
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700188// FIXME: OF spec specified this as '9' bits, implicitly adding
189// to full byte
190enum ofp_ipv6exthdr_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700191 OFPIEH_NONEXT = 0x1,
192 OFPIEH_ESP = 0x2,
193 OFPIEH_AUTH = 0x4,
194 OFPIEH_DEST = 0x8,
195 OFPIEH_FRAG = 0x10,
196 OFPIEH_ROUTER = 0x20,
197 OFPIEH_HOP = 0x40,
198 OFPIEH_UNREP = 0x80,
199 OFPIEH_UNSEQ = 0x100,
200};
201
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700202enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700203 OFPAT_OUTPUT = 0,
204 OFPAT_COPY_TTL_OUT = 0xb,
205 OFPAT_COPY_TTL_IN = 0xc,
206 OFPAT_SET_MPLS_TTL = 0xf,
207 OFPAT_DEC_MPLS_TTL = 0x10,
208 OFPAT_PUSH_VLAN = 0x11,
209 OFPAT_POP_VLAN = 0x12,
210 OFPAT_PUSH_MPLS = 0x13,
211 OFPAT_POP_MPLS = 0x14,
212 OFPAT_SET_QUEUE = 0x15,
213 OFPAT_GROUP = 0x16,
214 OFPAT_SET_NW_TTL = 0x17,
215 OFPAT_DEC_NW_TTL = 0x18,
216 OFPAT_SET_FIELD = 0x19,
217 OFPAT_PUSH_PBB = 0x1a,
218 OFPAT_POP_PBB = 0x1b,
219 OFPAT_EXPERIMENTER = 0xffff,
220};
221
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700222enum ofp_controller_max_len(wire_type=uint16_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700223 OFPCML_MAX = 0xffe5,
224 OFPCML_NO_BUFFER = 0xffff,
225};
226
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700227enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700228 OFPIT_GOTO_TABLE = 0x1,
229 OFPIT_WRITE_METADATA = 0x2,
230 OFPIT_WRITE_ACTIONS = 0x3,
231 OFPIT_APPLY_ACTIONS = 0x4,
232 OFPIT_CLEAR_ACTIONS = 0x5,
233 OFPIT_METER = 0x6,
234 OFPIT_EXPERIMENTER = 0xffff,
235};
236
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700237enum ofp_flow_mod_command(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700238 OFPFC_ADD = 0,
239 OFPFC_MODIFY = 1,
240 OFPFC_MODIFY_STRICT = 2,
241 OFPFC_DELETE = 3,
242 OFPFC_DELETE_STRICT = 4,
243};
244
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700245enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700246 OFPFF_SEND_FLOW_REM = 0x1,
247 OFPFF_CHECK_OVERLAP = 0x2,
248 OFPFF_RESET_COUNTS = 0x4,
249 OFPFF_NO_PKT_COUNTS = 0x8,
250 OFPFF_NO_BYT_COUNTS = 0x10,
Rich Lanef86f39a2013-10-07 18:04:11 -0700251
252 /* Non-standard, enabled by an experimenter message */
253 /* See the bsn_flow_idle input file */
254 OFPFF_BSN_SEND_IDLE = 0x80,
Rich Lane5d33a622013-04-08 17:33:11 -0700255};
256
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700257enum ofp_group(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700258 OFPG_MAX = 0xffffff00,
259 OFPG_ALL = 0xfffffffc,
260 OFPG_ANY = 0xffffffff,
261};
262
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700263enum ofp_group_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700264 OFPGC_ADD = 0,
265 OFPGC_MODIFY = 1,
266 OFPGC_DELETE = 2,
267};
268
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700269enum ofp_group_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700270 OFPGT_ALL = 0,
271 OFPGT_SELECT = 1,
272 OFPGT_INDIRECT = 2,
273 OFPGT_FF = 3,
274};
275
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700276enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700277 OFPR_NO_MATCH = 0,
278 OFPR_ACTION = 1,
279 OFPR_INVALID_TTL = 2,
Andreas Wundsam7723c562013-10-23 16:27:40 -0700280
281 // non-standard BSN extensions. OF does not have a standard-conformant
282 // way to extend the set of packet_in reasons
283 OFPR_BSN_NEW_HOST = 128,
284 OFPR_BSN_STATION_MOVE = 129,
285 OFPR_BSN_BAD_VLAN = 130,
286 OFPR_BSN_DESTINATION_LOOKUP_FAILURE = 131,
Rich Lanee13d7842013-12-21 14:39:25 -0800287 OFPR_BSN_NO_ROUTE = 132,
Harshmeet Singh192b1b02013-12-14 07:46:24 -0800288 OFPR_BSN_ICMP_ECHO_REQUEST = 133,
289 OFPR_BSN_DEST_NETWORK_UNREACHABLE = 134,
290 OFPR_BSN_DEST_HOST_UNREACHABLE = 135,
291 OFPR_BSN_DEST_PORT_UNREACHABLE = 136,
292 OFPR_BSN_FRAGMENTATION_REQUIRED = 137,
Rich Lanec1c6df62014-01-24 17:18:00 -0800293 OFPR_BSN_ARP = 139,
Duc Pham9d29ed02014-01-30 16:23:16 -0800294 OFPR_BSN_DHCP = 140,
xinwud847c692014-02-20 18:37:34 -0800295 OFPR_BSN_DEBUG = 141,
Rich Lane5d33a622013-04-08 17:33:11 -0700296};
297
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700298enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700299 OFPRR_IDLE_TIMEOUT = 0,
300 OFPRR_HARD_TIMEOUT = 1,
301 OFPRR_DELETE = 2,
302 OFPRR_GROUP_DELETE = 3,
303};
304
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700305enum ofp_meter(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700306 OFPM_MAX = 0xffff0000,
307 OFPM_SLOWPATH = 0xfffffffd,
308 OFPM_CONTROLLER = 0xfffffffe,
309 OFPM_ALL = 0xffffffff,
310};
311
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700312enum ofp_meter_band_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700313 OFPMBT_DROP = 0x1,
314 OFPMBT_DSCP_REMARK = 0x2,
315 OFPMBT_EXPERIMENTER = 0xffff,
316};
317
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700318enum ofp_meter_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700319 OFPMC_ADD = 0,
320 OFPMC_MODIFY = 1,
321 OFPMC_DELETE = 2,
322};
323
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700324enum ofp_meter_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700325 OFPMF_KBPS = 0x1,
326 OFPMF_PKTPS = 0x2,
327 OFPMF_BURST = 0x4,
328 OFPMF_STATS = 0x8,
329};
330
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700331enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700332 OFPET_HELLO_FAILED = 0,
333 OFPET_BAD_REQUEST = 1,
334 OFPET_BAD_ACTION = 2,
335 OFPET_BAD_INSTRUCTION = 3,
336 OFPET_BAD_MATCH = 4,
337 OFPET_FLOW_MOD_FAILED = 5,
338 OFPET_GROUP_MOD_FAILED = 6,
339 OFPET_PORT_MOD_FAILED = 7,
340 OFPET_TABLE_MOD_FAILED = 8,
341 OFPET_QUEUE_OP_FAILED = 9,
342 OFPET_SWITCH_CONFIG_FAILED = 10,
343 OFPET_ROLE_REQUEST_FAILED = 11,
344 OFPET_METER_MOD_FAILED = 12,
345 OFPET_TABLE_FEATURES_FAILED = 13,
346 OFPET_EXPERIMENTER = 0xffff,
347};
348
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700349enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700350 OFPHFC_INCOMPATIBLE = 0,
351 OFPHFC_EPERM = 1,
352};
353
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700354enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700355 OFPBRC_BAD_VERSION = 0,
356 OFPBRC_BAD_TYPE = 1,
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700357 OFPBRC_BAD_STAT = 2,
Rich Lane5d33a622013-04-08 17:33:11 -0700358 OFPBRC_BAD_EXPERIMENTER = 3,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700359 OFPBRC_BAD_EXPERIMENTER_TYPE = 4,
Rich Lane5d33a622013-04-08 17:33:11 -0700360 OFPBRC_EPERM = 5,
361 OFPBRC_BAD_LEN = 6,
362 OFPBRC_BUFFER_EMPTY = 7,
363 OFPBRC_BUFFER_UNKNOWN = 8,
364 OFPBRC_BAD_TABLE_ID = 9,
365 OFPBRC_IS_SLAVE = 10,
366 OFPBRC_BAD_PORT = 11,
367 OFPBRC_BAD_PACKET = 12,
368 OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13,
369};
370
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700371enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700372 OFPBAC_BAD_TYPE = 0,
373 OFPBAC_BAD_LEN = 1,
374 OFPBAC_BAD_EXPERIMENTER = 2,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700375 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700376 OFPBAC_BAD_OUT_PORT = 4,
377 OFPBAC_BAD_ARGUMENT = 5,
378 OFPBAC_EPERM = 6,
379 OFPBAC_TOO_MANY = 7,
380 OFPBAC_BAD_QUEUE = 8,
381 OFPBAC_BAD_OUT_GROUP = 9,
382 OFPBAC_MATCH_INCONSISTENT = 10,
383 OFPBAC_UNSUPPORTED_ORDER = 11,
384 OFPBAC_BAD_TAG = 12,
385 OFPBAC_BAD_SET_TYPE = 13,
386 OFPBAC_BAD_SET_LEN = 14,
387 OFPBAC_BAD_SET_ARGUMENT = 15,
388};
389
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700390enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700391 OFPBIC_UNKNOWN_INST = 0,
392 OFPBIC_UNSUP_INST = 1,
393 OFPBIC_BAD_TABLE_ID = 2,
394 OFPBIC_UNSUP_METADATA = 3,
395 OFPBIC_UNSUP_METADATA_MASK = 4,
396 OFPBIC_BAD_EXPERIMENTER = 5,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700397 OFPBIC_BAD_EXPERIMENTER_TYPE = 6,
Rich Lane5d33a622013-04-08 17:33:11 -0700398 OFPBIC_BAD_LEN = 7,
399 OFPBIC_EPERM = 8,
400};
401
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700402enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700403 OFPBMC_BAD_TYPE = 0,
404 OFPBMC_BAD_LEN = 1,
405 OFPBMC_BAD_TAG = 2,
406 OFPBMC_BAD_DL_ADDR_MASK = 3,
407 OFPBMC_BAD_NW_ADDR_MASK = 4,
408 OFPBMC_BAD_WILDCARDS = 5,
409 OFPBMC_BAD_FIELD = 6,
410 OFPBMC_BAD_VALUE = 7,
411 OFPBMC_BAD_MASK = 8,
412 OFPBMC_BAD_PREREQ = 9,
413 OFPBMC_DUP_FIELD = 10,
414 OFPBMC_EPERM = 11,
415};
416
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700417enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700418 OFPFMFC_UNKNOWN = 0,
419 OFPFMFC_TABLE_FULL = 1,
420 OFPFMFC_BAD_TABLE_ID = 2,
421 OFPFMFC_OVERLAP = 3,
422 OFPFMFC_EPERM = 4,
423 OFPFMFC_BAD_TIMEOUT = 5,
424 OFPFMFC_BAD_COMMAND = 6,
425 OFPFMFC_BAD_FLAGS = 7,
426};
427
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700428enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700429 OFPGMFC_GROUP_EXISTS = 0,
430 OFPGMFC_INVALID_GROUP = 1,
431 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
432 OFPGMFC_OUT_OF_GROUPS = 3,
433 OFPGMFC_OUT_OF_BUCKETS = 4,
434 OFPGMFC_CHAINING_UNSUPPORTED = 5,
435 OFPGMFC_WATCH_UNSUPPORTED = 6,
436 OFPGMFC_LOOP = 7,
437 OFPGMFC_UNKNOWN_GROUP = 8,
438 OFPGMFC_CHAINED_GROUP = 9,
439 OFPGMFC_BAD_TYPE = 10,
440 OFPGMFC_BAD_COMMAND = 11,
441 OFPGMFC_BAD_BUCKET = 12,
442 OFPGMFC_BAD_WATCH = 13,
443 OFPGMFC_EPERM = 14,
444};
445
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700446enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700447 OFPPMFC_BAD_PORT = 0,
448 OFPPMFC_BAD_HW_ADDR = 1,
449 OFPPMFC_BAD_CONFIG = 2,
450 OFPPMFC_BAD_ADVERTISE = 3,
451 OFPPMFC_EPERM = 4,
452};
453
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700454enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700455 OFPTMFC_BAD_TABLE = 0,
456 OFPTMFC_BAD_CONFIG = 1,
457 OFPTMFC_EPERM = 2,
458};
459
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700460enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700461 OFPQOFC_BAD_PORT = 0,
462 OFPQOFC_BAD_QUEUE = 1,
463 OFPQOFC_EPERM = 2,
464};
465
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700466enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700467 OFPSCFC_BAD_FLAGS = 0,
468 OFPSCFC_BAD_LEN = 1,
469 OFPSCFC_EPERM = 2,
470};
471
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700472enum ofp_role_request_failed_code(wire_type=uint16_t){
Rich Lane5d33a622013-04-08 17:33:11 -0700473 OFPRRFC_STALE = 0,
474 OFPRRFC_UNSUP = 1,
475 OFPRRFC_BAD_ROLE = 2,
476};
477
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700478enum ofp_meter_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700479 OFPMMFC_UNKNOWN = 0,
480 OFPMMFC_METER_EXISTS = 1,
481 OFPMMFC_INVALID_METER = 2,
482 OFPMMFC_UNKNOWN_METER = 3,
483 OFPMMFC_BAD_COMMAND = 4,
484 OFPMMFC_BAD_FLAGS = 5,
485 OFPMMFC_BAD_RATE = 6,
486 OFPMMFC_BAD_BURST = 7,
487 OFPMMFC_BAD_BAND = 8,
488 OFPMMFC_BAD_BAND_VALUE = 9,
489 OFPMMFC_OUT_OF_METERS = 10,
490 OFPMMFC_OUT_OF_BANDS = 11,
491};
492
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700493enum ofp_table_features_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700494 OFPTFFC_BAD_TABLE = 0,
495 OFPTFFC_BAD_METADATA = 1,
496 OFPTFFC_BAD_TYPE = 2,
497 OFPTFFC_BAD_LEN = 3,
498 OFPTFFC_BAD_ARGUMENT = 4,
499 OFPTFFC_EPERM = 5,
500};
501
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700502enum ofp_stats_type(wire_type=uint16_t) {
503 OFPST_DESC = 0,
504 OFPST_FLOW = 1,
505 OFPST_AGGREGATE = 2,
506 OFPST_TABLE = 3,
507 OFPST_PORT = 4,
508 OFPST_QUEUE = 5,
509 OFPST_GROUP = 6,
510 OFPST_GROUP_DESC = 7,
511 OFPST_GROUP_FEATURES = 8,
512 OFPST_METER = 9,
513 OFPST_METER_CONFIG = 10,
514 OFPST_METER_FEATURES = 11,
515 OFPST_TABLE_FEATURES = 12,
516 OFPST_PORT_DESC = 13,
517 OFPST_EXPERIMENTER = 0xffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700518};
519
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700520enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) {
521 OFPSF_REQ_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700522};
523
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700524enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
525 OFPSF_REPLY_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700526};
527
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700528enum ofp_table_feature_prop_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700529 OFPTFPT_INSTRUCTIONS = 0,
530 OFPTFPT_INSTRUCTIONS_MISS = 1,
531 OFPTFPT_NEXT_TABLES = 2,
532 OFPTFPT_NEXT_TABLES_MISS = 3,
533 OFPTFPT_WRITE_ACTIONS = 4,
534 OFPTFPT_WRITE_ACTIONS_MISS = 5,
535 OFPTFPT_APPLY_ACTIONS = 6,
536 OFPTFPT_APPLY_ACTIONS_MISS = 7,
537 OFPTFPT_MATCH = 8,
538 OFPTFPT_WILDCARDS = 0xa,
539 OFPTFPT_WRITE_SETFIELD = 0xc,
540 OFPTFPT_WRITE_SETFIELD_MISS = 0xd,
541 OFPTFPT_APPLY_SETFIELD = 0xe,
542 OFPTFPT_APPLY_SETFIELD_MISS = 0xf,
543 OFPTFPT_EXPERIMENTER = 0xfffe,
544 OFPTFPT_EXPERIMENTER_MISS = 0xffff,
545};
546
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700547enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700548 OFPGFC_SELECT_WEIGHT = 0x1,
549 OFPGFC_SELECT_LIVENESS = 0x2,
550 OFPGFC_CHAINING = 0x4,
551 OFPGFC_CHAINING_CHECKS = 0x8,
552};
553
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700554enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700555 OFPQT_MIN_RATE = 0x1,
556 OFPQT_MAX_RATE = 0x2,
557 OFPQT_EXPERIMENTER = 0xffff,
558};
559
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700560enum ofp_controller_role(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700561 OFPCR_ROLE_NOCHANGE = 0,
562 OFPCR_ROLE_EQUAL = 1,
563 OFPCR_ROLE_MASTER = 2,
564 OFPCR_ROLE_SLAVE = 3,
565};
566
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700567enum ofp_hello_elem_type(wire_type=uint16_t) {
Rich Lane0733cd62013-04-18 21:14:42 -0700568 OFPHET_VERSIONBITMAP = 1,
569};
570
Rich Lanee9c37db2013-06-21 18:30:24 -0700571/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700572struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700573 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700574 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700575 uint16_t length;
576 uint32_t xid;
577};
578
xinwuf08ef682013-12-05 18:29:20 -0800579struct of_uint64 {
580 uint64_t value;
581};
582
Rich Lanea06d0c32013-03-25 08:52:03 -0700583// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700584struct of_uint32 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700585 uint32_t value;
586};
587
588// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700589struct of_uint8 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700590 uint8_t value;
591};
592
Rich Lane68ae4d72013-05-09 10:55:19 -0700593struct of_hello_elem {
Andreas Wundsam70411bf2013-08-02 22:26:38 -0700594 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700595 uint16_t length;
596};
597
Rich Lanee9c37db2013-06-21 18:30:24 -0700598struct of_hello_elem_versionbitmap : of_hello_elem {
Rich Lane31b87142013-05-09 22:05:42 -0700599 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700600 uint16_t length;
601 list(of_uint32_t) bitmaps;
602};
603
Rich Lanee9c37db2013-06-21 18:30:24 -0700604struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700605 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700606 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700607 uint16_t length;
608 uint32_t xid;
609 list(of_hello_elem_t) elements;
610};
611
Rich Lanee9c37db2013-06-21 18:30:24 -0700612struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700613 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700614 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700615 uint16_t length;
616 uint32_t xid;
617 of_octets_t data;
618};
619
Rich Lanee9c37db2013-06-21 18:30:24 -0700620struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700621 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700622 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700623 uint16_t length;
624 uint32_t xid;
625 of_octets_t data;
626};
627
Rich Lanee9c37db2013-06-21 18:30:24 -0700628struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700629 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700630 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700631 uint16_t length;
632 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700633 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700634 uint32_t subtype;
635 of_octets_t data;
636};
637
Rich Lanee9c37db2013-06-21 18:30:24 -0700638struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700639 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700640 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700641 uint16_t length;
642 uint32_t xid;
643};
644
Rich Lanee9c37db2013-06-21 18:30:24 -0700645struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700646 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700647 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700648 uint16_t length;
649 uint32_t xid;
650};
651
Rich Lanee9c37db2013-06-21 18:30:24 -0700652struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700653 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700654 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700655 uint16_t length;
656 uint32_t xid;
657};
658
Rich Lanee9c37db2013-06-21 18:30:24 -0700659struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700660 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700661 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700662 uint16_t length;
663 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800664 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700665 uint16_t miss_send_len;
666};
667
Rich Lanee9c37db2013-06-21 18:30:24 -0700668struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700669 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700670 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700671 uint16_t length;
672 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800673 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700674 uint16_t miss_send_len;
675};
676
Rich Lanee9c37db2013-06-21 18:30:24 -0700677struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700678 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700679 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700680 uint16_t length;
681 uint32_t xid;
682 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700683 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700684 uint32_t config;
685};
686
Rich Lane68ae4d72013-05-09 10:55:19 -0700687struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700688 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700689 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700690 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700691 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700692 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700693 enum ofp_port_config config;
694 enum ofp_port_state state;
695 enum ofp_port_features curr;
696 enum ofp_port_features advertised;
697 enum ofp_port_features supported;
698 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700699 uint32_t curr_speed;
700 uint32_t max_speed;
701};
702
Rich Lanee9c37db2013-06-21 18:30:24 -0700703struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700704 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700705 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700706 uint16_t length;
707 uint32_t xid;
708};
709
Rich Lanee9c37db2013-06-21 18:30:24 -0700710struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700711 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700712 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700713 uint16_t length;
714 uint32_t xid;
715 uint64_t datapath_id;
716 uint32_t n_buffers;
717 uint8_t n_tables;
718 uint8_t auxiliary_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700719 pad(2);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700720 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700721 uint32_t reserved;
722};
723
Rich Lanee9c37db2013-06-21 18:30:24 -0700724struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700725 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700726 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700727 uint16_t length;
728 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700729 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700730 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700731 of_port_desc_t desc;
732};
733
Rich Lanee9c37db2013-06-21 18:30:24 -0700734struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700735 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700736 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700737 uint16_t length;
738 uint32_t xid;
739 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700740 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700741 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700742 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700743 uint32_t config;
744 uint32_t mask;
745 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700746 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700747};
748
749// FIXME Does this need to be v4?
Andreas Wundsam5da68512013-10-22 22:18:00 -0700750struct of_match_v3(align=8, length_includes_align=False) {
Rich Lane31b87142013-05-09 22:05:42 -0700751 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700752 uint16_t length;
753 list(of_oxm_t) oxm_list;
754};
755
Rich Lanea06d0c32013-03-25 08:52:03 -0700756// This looks like an action header, but is standalone. See
757// ofp_table_features_prop_actions
Rich Lane68ae4d72013-05-09 10:55:19 -0700758struct of_action_id {
Rich Lanea06d0c32013-03-25 08:52:03 -0700759 uint16_t type;
760 uint16_t len;
Rich Lanea06d0c32013-03-25 08:52:03 -0700761};
762
Rich Lanee9c37db2013-06-21 18:30:24 -0700763struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700764 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700765 uint16_t len;
766 of_port_no_t port;
767 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700768 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700769};
770
Rich Lanee9c37db2013-06-21 18:30:24 -0700771struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700772 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700773 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700774 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700775};
776
Rich Lanee9c37db2013-06-21 18:30:24 -0700777struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700778 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700779 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700780 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700781};
782
Rich Lanee9c37db2013-06-21 18:30:24 -0700783struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700784 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700785 uint16_t len;
786 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700787 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700788};
789
Rich Lanee9c37db2013-06-21 18:30:24 -0700790struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700791 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700792 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700793 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700794};
795
Rich Lanee9c37db2013-06-21 18:30:24 -0700796struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700797 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700798 uint16_t len;
799 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700800 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700801};
802
Rich Lanee9c37db2013-06-21 18:30:24 -0700803struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700804 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700805 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700806 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700807};
808
Rich Lanee9c37db2013-06-21 18:30:24 -0700809struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700810 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700811 uint16_t len;
812 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700813 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700814};
815
Rich Lanee9c37db2013-06-21 18:30:24 -0700816struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700817 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700818 uint16_t len;
819 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700820 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700821};
822
Rich Lanee9c37db2013-06-21 18:30:24 -0700823struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700824 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700825 uint16_t len;
826 uint32_t queue_id;
827};
828
Rich Lanee9c37db2013-06-21 18:30:24 -0700829struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700830 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700831 uint16_t len;
832 uint32_t group_id;
833};
834
Rich Lanee9c37db2013-06-21 18:30:24 -0700835struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700836 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700837 uint16_t len;
838 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700839 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700840};
841
Rich Lanee9c37db2013-06-21 18:30:24 -0700842struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700843 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700844 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700845 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700846};
847
Andreas Wundsam5da68512013-10-22 22:18:00 -0700848struct of_action_set_field(align=8, length_includes_align=True) : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700849 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700850 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700851 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700852};
853
Andreas Wundsam5da68512013-10-22 22:18:00 -0700854struct of_action_experimenter(align=8, length_includes_align=True): of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700855 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700856 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700857 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700858 of_octets_t data;
859};
860
Rich Lanee9c37db2013-06-21 18:30:24 -0700861struct of_action_pop_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700862 uint16_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -0700863 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700864 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700865};
866
Rich Lanee9c37db2013-06-21 18:30:24 -0700867struct of_action_push_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700868 uint16_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -0700869 uint16_t len;
870 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700871 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700872};
873
Rich Lane68ae4d72013-05-09 10:55:19 -0700874struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700875 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700876 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700877 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700878};
879
Jonathan Stout661c4682014-03-03 12:35:31 -0500880struct of_instruction_id {
881 uint16_t type;
882 uint16_t len;
883};
884
Rich Lane68ae4d72013-05-09 10:55:19 -0700885struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700886 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700887 uint16_t len;
888};
889
Rich Lanee9c37db2013-06-21 18:30:24 -0700890struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700891 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700892 uint16_t len;
893 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700894 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700895};
896
Rich Lanee9c37db2013-06-21 18:30:24 -0700897struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700898 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700899 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700900 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700901 uint64_t metadata;
902 uint64_t metadata_mask;
903};
904
Rich Lanee9c37db2013-06-21 18:30:24 -0700905struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700906 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700907 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700908 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700909 list(of_action_t) actions;
910};
911
Rich Lanee9c37db2013-06-21 18:30:24 -0700912struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700913 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700914 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700915 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700916 list(of_action_t) actions;
917};
918
Rich Lanee9c37db2013-06-21 18:30:24 -0700919struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700920 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700921 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700922 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700923};
924
Rich Lanee9c37db2013-06-21 18:30:24 -0700925struct of_instruction_meter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700926 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700927 uint16_t len;
928 uint32_t meter_id;
929};
930
Rich Lanee9c37db2013-06-21 18:30:24 -0700931struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700932 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700933 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700934 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700935 of_octets_t data;
936};
937
Rich Lanee9c37db2013-06-21 18:30:24 -0700938struct of_flow_mod : of_header {
939 uint8_t version;
940 uint8_t type == 14;
941 uint16_t length;
942 uint32_t xid;
943 uint64_t cookie;
944 uint64_t cookie_mask;
945 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700946 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700947 uint16_t idle_timeout;
948 uint16_t hard_timeout;
949 uint16_t priority;
950 uint32_t buffer_id;
951 of_port_no_t out_port;
952 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700953 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700954 pad(2);
955 of_match_t match;
956 list(of_instruction_t) instructions;
957};
958
959struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700960 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700961 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700962 uint16_t length;
963 uint32_t xid;
964 uint64_t cookie;
965 uint64_t cookie_mask;
966 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700967 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700968 uint16_t idle_timeout;
969 uint16_t hard_timeout;
970 uint16_t priority;
971 uint32_t buffer_id;
972 of_port_no_t out_port;
973 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700974 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700975 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700976 of_match_t match;
977 list(of_instruction_t) instructions;
978};
979
Rich Lanee9c37db2013-06-21 18:30:24 -0700980struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700981 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700982 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700983 uint16_t length;
984 uint32_t xid;
985 uint64_t cookie;
986 uint64_t cookie_mask;
987 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700988 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700989 uint16_t idle_timeout;
990 uint16_t hard_timeout;
991 uint16_t priority;
992 uint32_t buffer_id;
993 of_port_no_t out_port;
994 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700995 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700996 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700997 of_match_t match;
998 list(of_instruction_t) instructions;
999};
1000
Rich Lanee9c37db2013-06-21 18:30:24 -07001001struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001002 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001003 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001004 uint16_t length;
1005 uint32_t xid;
1006 uint64_t cookie;
1007 uint64_t cookie_mask;
1008 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001009 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001010 uint16_t idle_timeout;
1011 uint16_t hard_timeout;
1012 uint16_t priority;
1013 uint32_t buffer_id;
1014 of_port_no_t out_port;
1015 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001016 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001017 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001018 of_match_t match;
1019 list(of_instruction_t) instructions;
1020};
1021
Rich Lanee9c37db2013-06-21 18:30:24 -07001022struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001023 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001024 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001025 uint16_t length;
1026 uint32_t xid;
1027 uint64_t cookie;
1028 uint64_t cookie_mask;
1029 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001030 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001031 uint16_t idle_timeout;
1032 uint16_t hard_timeout;
1033 uint16_t priority;
1034 uint32_t buffer_id;
1035 of_port_no_t out_port;
1036 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001037 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001038 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001039 of_match_t match;
1040 list(of_instruction_t) instructions;
1041};
1042
Rich Lanee9c37db2013-06-21 18:30:24 -07001043struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001044 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001045 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001046 uint16_t length;
1047 uint32_t xid;
1048 uint64_t cookie;
1049 uint64_t cookie_mask;
1050 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001051 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001052 uint16_t idle_timeout;
1053 uint16_t hard_timeout;
1054 uint16_t priority;
1055 uint32_t buffer_id;
1056 of_port_no_t out_port;
1057 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001058 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001059 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001060 of_match_t match;
1061 list(of_instruction_t) instructions;
1062};
1063
Rich Lane68ae4d72013-05-09 10:55:19 -07001064struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -07001065 uint16_t len;
1066 uint16_t weight;
1067 of_port_no_t watch_port;
1068 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001069 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001070 list(of_action_t) actions;
1071};
1072
Rich Lanee9c37db2013-06-21 18:30:24 -07001073struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001074 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001075 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001076 uint16_t length;
1077 uint32_t xid;
Andreas Wundsam5812cf32013-11-15 13:51:24 -08001078 enum ofp_group_mod_command command == ?;
1079 enum ofp_group_type group_type;
1080 pad(1);
1081 uint32_t group_id;
1082 list(of_bucket_t) buckets;
1083};
1084
1085struct of_group_add : of_group_mod {
1086 uint8_t version;
1087 uint8_t type == 15;
1088 uint16_t length;
1089 uint32_t xid;
1090 enum ofp_group_mod_command command == 0;
1091 enum ofp_group_type group_type;
1092 pad(1);
1093 uint32_t group_id;
1094 list(of_bucket_t) buckets;
1095};
1096
1097struct of_group_modify : of_group_mod {
1098 uint8_t version;
1099 uint8_t type == 15;
1100 uint16_t length;
1101 uint32_t xid;
1102 enum ofp_group_mod_command command == 1;
1103 enum ofp_group_type group_type;
1104 pad(1);
1105 uint32_t group_id;
1106 list(of_bucket_t) buckets;
1107};
1108
1109struct of_group_delete : of_group_mod {
1110 uint8_t version;
1111 uint8_t type == 15;
1112 uint16_t length;
1113 uint32_t xid;
1114 enum ofp_group_mod_command command == 2;
1115 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001116 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001117 uint32_t group_id;
1118 list(of_bucket_t) buckets;
1119};
1120
Rich Lanee9c37db2013-06-21 18:30:24 -07001121struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001122 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001123 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001124 uint16_t length;
1125 uint32_t xid;
1126 uint32_t buffer_id;
1127 of_port_no_t in_port;
1128 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001129 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001130 list(of_action_t) actions;
1131 of_octets_t data;
1132};
1133
Rich Lanee9c37db2013-06-21 18:30:24 -07001134struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001135 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001136 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001137 uint16_t length;
1138 uint32_t xid;
1139 uint32_t buffer_id;
1140 uint16_t total_len;
1141 uint8_t reason;
1142 uint8_t table_id;
1143 uint64_t cookie;
1144 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001145 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001146 of_octets_t data; /* FIXME: Ensure total_len gets updated */
1147};
1148
Rich Lanee9c37db2013-06-21 18:30:24 -07001149struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001150 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001151 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001152 uint16_t length;
1153 uint32_t xid;
1154 uint64_t cookie;
1155 uint16_t priority;
1156 uint8_t reason;
1157 uint8_t table_id;
1158 uint32_t duration_sec;
1159 uint32_t duration_nsec;
1160 uint16_t idle_timeout;
1161 uint16_t hard_timeout;
1162 uint64_t packet_count;
1163 uint64_t byte_count;
1164 of_match_t match;
1165};
1166
Rich Lane68ae4d72013-05-09 10:55:19 -07001167struct of_meter_band {
Andreas Wundsam9ba65362013-08-02 19:14:42 -07001168 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001169 uint16_t len;
1170// uint32_t rate; // These are excluded b/c this is the header
1171// uint32_t burst_size; // These are excluded b/c this is the header
1172};
1173
Rich Lanee9c37db2013-06-21 18:30:24 -07001174struct of_meter_band_drop : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001175 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001176 uint16_t len;
1177 uint32_t rate;
1178 uint32_t burst_size;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001179 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001180};
1181
Rich Lanee9c37db2013-06-21 18:30:24 -07001182struct of_meter_band_dscp_remark : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001183 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001184 uint16_t len;
1185 uint32_t rate;
1186 uint32_t burst_size;
1187 uint8_t prec_level;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001188 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001189};
1190
Rich Lanee9c37db2013-06-21 18:30:24 -07001191struct of_meter_band_experimenter : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001192 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001193 uint16_t len;
1194 uint32_t rate;
1195 uint32_t burst_size;
1196 uint32_t experimenter;
1197};
1198
Rich Lanee9c37db2013-06-21 18:30:24 -07001199struct of_meter_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001200 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001201 uint8_t type == 29;
Rich Lanea06d0c32013-03-25 08:52:03 -07001202 uint16_t length;
1203 uint32_t xid;
1204 uint16_t command;
1205 uint16_t flags;
1206 uint32_t meter_id;
1207 list(of_meter_band_t) meters;
1208};
1209
Rich Lanee9c37db2013-06-21 18:30:24 -07001210struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001211 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001212 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001213 uint16_t length;
1214 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001215 uint16_t err_type == ?;
1216};
1217
1218struct of_hello_failed_error_msg : of_error_msg {
1219 uint8_t version;
1220 uint8_t type == 1;
1221 uint16_t length;
1222 uint32_t xid;
1223 uint16_t err_type == 0;
1224 enum ofp_hello_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001225 of_octets_t data;
1226};
1227
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001228struct of_bad_request_error_msg : of_error_msg {
1229 uint8_t version;
1230 uint8_t type == 1;
1231 uint16_t length;
1232 uint32_t xid;
1233 uint16_t err_type == 1;
1234 enum ofp_bad_request_code code;
1235 of_octets_t data;
1236};
1237
1238struct of_bad_action_error_msg : of_error_msg {
1239 uint8_t version;
1240 uint8_t type == 1;
1241 uint16_t length;
1242 uint32_t xid;
1243 uint16_t err_type == 2;
1244 enum ofp_bad_action_code code;
1245 of_octets_t data;
1246};
1247
1248struct of_bad_instruction_error_msg : of_error_msg {
1249 uint8_t version;
1250 uint8_t type == 1;
1251 uint16_t length;
1252 uint32_t xid;
1253 uint16_t err_type == 3;
1254 enum ofp_bad_instruction_code code;
1255 of_octets_t data;
1256};
1257
1258struct of_bad_match_error_msg : of_error_msg {
1259 uint8_t version;
1260 uint8_t type == 1;
1261 uint16_t length;
1262 uint32_t xid;
1263 uint16_t err_type == 4;
1264 enum ofp_bad_match_code code;
1265 of_octets_t data;
1266};
1267
1268struct of_flow_mod_failed_error_msg : of_error_msg {
1269 uint8_t version;
1270 uint8_t type == 1;
1271 uint16_t length;
1272 uint32_t xid;
1273 uint16_t err_type == 5;
1274 enum ofp_flow_mod_failed_code code;
1275 of_octets_t data;
1276};
1277
1278struct of_group_mod_failed_error_msg : of_error_msg {
1279 uint8_t version;
1280 uint8_t type == 1;
1281 uint16_t length;
1282 uint32_t xid;
1283 uint16_t err_type == 6;
1284 enum ofp_group_mod_failed_code code;
1285 of_octets_t data;
1286};
1287
1288struct of_port_mod_failed_error_msg : of_error_msg {
1289 uint8_t version;
1290 uint8_t type == 1;
1291 uint16_t length;
1292 uint32_t xid;
1293 uint16_t err_type == 7;
1294 enum ofp_port_mod_failed_code code;
1295 of_octets_t data;
1296};
1297
1298struct of_table_mod_failed_error_msg : of_error_msg {
1299 uint8_t version;
1300 uint8_t type == 1;
1301 uint16_t length;
1302 uint32_t xid;
1303 uint16_t err_type == 8;
1304 enum ofp_table_mod_failed_code code;
1305 of_octets_t data;
1306};
1307
1308struct of_queue_op_failed_error_msg : of_error_msg {
1309 uint8_t version;
1310 uint8_t type == 1;
1311 uint16_t length;
1312 uint32_t xid;
1313 uint16_t err_type == 9;
1314 enum ofp_queue_op_failed_code code;
1315 of_octets_t data;
1316};
1317
1318struct of_switch_config_failed_error_msg : of_error_msg {
1319 uint8_t version;
1320 uint8_t type == 1;
1321 uint16_t length;
1322 uint32_t xid;
1323 uint16_t err_type == 10;
1324 enum ofp_switch_config_failed_code code;
1325 of_octets_t data;
1326};
1327
1328struct of_role_request_failed_error_msg : of_error_msg {
1329 uint8_t version;
1330 uint8_t type == 1;
1331 uint16_t length;
1332 uint32_t xid;
1333 uint16_t err_type == 11;
1334 enum ofp_role_request_failed_code code;
1335 of_octets_t data;
1336};
1337
1338struct of_meter_mod_failed_error_msg : of_error_msg {
1339 uint8_t version;
1340 uint8_t type == 1;
1341 uint16_t length;
1342 uint32_t xid;
1343 uint16_t err_type == 12;
1344 enum ofp_meter_mod_failed_code code;
1345 of_octets_t data;
1346};
1347
1348struct of_table_features_failed_error_msg : of_error_msg {
1349 uint8_t version;
1350 uint8_t type == 1;
1351 uint16_t length;
1352 uint32_t xid;
1353 uint16_t err_type == 13;
1354 enum ofp_table_features_failed_code code;
1355 of_octets_t data;
1356};
1357
Andreas Wundsamcc8cd662013-11-15 13:52:06 -08001358struct of_experimenter_error_msg : of_error_msg {
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001359 uint8_t version;
1360 uint8_t type == 1;
1361 uint16_t length;
1362 uint32_t xid;
1363 uint16_t err_type == 0xffff;
1364 uint16_t subtype;
1365 uint32_t experimenter;
1366 of_octets_t data;
1367};
Rich Lanea06d0c32013-03-25 08:52:03 -07001368
1369// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1370
Rich Lane68ae4d72013-05-09 10:55:19 -07001371struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001372 uint16_t length;
1373 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001374 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001375 uint32_t duration_sec;
1376 uint32_t duration_nsec;
1377 uint16_t priority;
1378 uint16_t idle_timeout;
1379 uint16_t hard_timeout;
Rich Lane1a47c1c2013-08-28 15:27:00 -07001380 uint16_t flags;
1381 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001382 uint64_t cookie;
1383 uint64_t packet_count;
1384 uint64_t byte_count;
1385 of_match_t match;
1386 list(of_instruction_t) instructions;
1387};
1388
1389
Rich Lane68ae4d72013-05-09 10:55:19 -07001390struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001391 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001392 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001393 uint32_t active_count;
1394 uint64_t lookup_count;
1395 uint64_t matched_count;
1396};
1397
Rich Lane68ae4d72013-05-09 10:55:19 -07001398struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001399 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001400 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001401 uint64_t rx_packets;
1402 uint64_t tx_packets;
1403 uint64_t rx_bytes;
1404 uint64_t tx_bytes;
1405 uint64_t rx_dropped;
1406 uint64_t tx_dropped;
1407 uint64_t rx_errors;
1408 uint64_t tx_errors;
1409 uint64_t rx_frame_err;
1410 uint64_t rx_over_err;
1411 uint64_t rx_crc_err;
1412 uint64_t collisions;
1413 uint32_t duration_sec;
1414 uint32_t duration_nsec;
1415};
1416
Rich Lane68ae4d72013-05-09 10:55:19 -07001417struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001418 of_port_no_t port_no;
1419 uint32_t queue_id;
1420 uint64_t tx_bytes;
1421 uint64_t tx_packets;
1422 uint64_t tx_errors;
1423 uint32_t duration_sec;
1424 uint32_t duration_nsec;
1425};
1426
Rich Lane68ae4d72013-05-09 10:55:19 -07001427struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001428 uint64_t packet_count;
1429 uint64_t byte_count;
1430};
1431
Rich Lane68ae4d72013-05-09 10:55:19 -07001432struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001433 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001434 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001435 uint32_t group_id;
1436 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001437 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001438 uint64_t packet_count;
1439 uint64_t byte_count;
1440 uint32_t duration_sec;
1441 uint32_t duration_nsec;
1442 list(of_bucket_counter_t) bucket_stats;
1443};
1444
Rich Lane68ae4d72013-05-09 10:55:19 -07001445struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001446 uint16_t length;
Andreas Wundsam84603f02013-11-18 18:45:30 -08001447 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001448 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001449 uint32_t group_id;
1450 list(of_bucket_t) buckets;
1451};
1452
1453// STATS:
1454// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1455
Rich Lanee9c37db2013-06-21 18:30:24 -07001456struct of_stats_request : of_header {
1457 uint8_t version;
1458 uint8_t type == 18;
1459 uint16_t length;
1460 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001461 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001462 enum ofp_stats_request_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001463 pad(4);
1464};
1465
1466struct of_stats_reply : of_header {
1467 uint8_t version;
1468 uint8_t type == 19;
1469 uint16_t length;
1470 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001471 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001472 enum ofp_stats_reply_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001473 pad(4);
1474};
1475
1476struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001477 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001478 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001479 uint16_t length;
1480 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001481 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001482 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001483 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001484};
1485
Rich Lanee9c37db2013-06-21 18:30:24 -07001486struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001487 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001488 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001489 uint16_t length;
1490 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001491 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001492 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001493 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001494 of_desc_str_t mfr_desc;
1495 of_desc_str_t hw_desc;
1496 of_desc_str_t sw_desc;
1497 of_serial_num_t serial_num;
1498 of_desc_str_t dp_desc;
1499};
1500
Rich Lanee9c37db2013-06-21 18:30:24 -07001501struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001502 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001503 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001504 uint16_t length;
1505 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001506 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001507 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001508 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001509 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001510 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001511 of_port_no_t out_port;
1512 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001513 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001514 uint64_t cookie;
1515 uint64_t cookie_mask;
1516 of_match_t match;
1517};
1518
Rich Lanee9c37db2013-06-21 18:30:24 -07001519struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001520 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001521 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001522 uint16_t length;
1523 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001524 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001525 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001526 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001527 list(of_flow_stats_entry_t) entries;
1528};
1529
Rich Lanee9c37db2013-06-21 18:30:24 -07001530struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001531 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001532 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001533 uint16_t length;
1534 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001535 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001536 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001537 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001538 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001539 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001540 of_port_no_t out_port;
1541 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001542 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001543 uint64_t cookie;
1544 uint64_t cookie_mask;
1545 of_match_t match;
1546};
1547
Rich Lanee9c37db2013-06-21 18:30:24 -07001548struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001549 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001550 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001551 uint16_t length;
1552 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001553 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001554 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001555 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001556 uint64_t packet_count;
1557 uint64_t byte_count;
1558 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001559 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001560};
1561
Rich Lanee9c37db2013-06-21 18:30:24 -07001562struct of_table_stats_request : of_stats_request {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001563 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001564 uint8_t type == 18;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001565 uint16_t length;
1566 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001567 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001568 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001569 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001570};
1571
Rich Lanee9c37db2013-06-21 18:30:24 -07001572struct of_table_stats_reply : of_stats_reply {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001573 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001574 uint8_t type == 19;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001575 uint16_t length;
1576 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001577 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001578 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001579 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001580 list(of_table_stats_entry_t) entries;
1581};
1582
Rich Lane6d434332013-11-13 09:23:10 -08001583struct of_experimenter_stats_request : of_stats_request {
1584 uint8_t version;
1585 uint8_t type == 18;
1586 uint16_t length;
1587 uint32_t xid;
1588 uint16_t stats_type == 0xffff;
1589 enum ofp_stats_request_flags flags;
1590 pad(4);
1591 uint32_t experimenter == ?;
1592 uint32_t subtype;
1593};
1594
1595struct of_experimenter_stats_reply : of_stats_reply {
1596 uint8_t version;
1597 uint8_t type == 19;
1598 uint16_t length;
1599 uint32_t xid;
1600 uint16_t stats_type == 0xffff;
1601 enum ofp_stats_reply_flags flags;
1602 pad(4);
1603 uint32_t experimenter == ?;
1604 uint32_t subtype;
1605};
1606
Rich Lanea06d0c32013-03-25 08:52:03 -07001607// FIXME: These are padded to 8 byte align beyond the length indicated
1608
Rich Lane68ae4d72013-05-09 10:55:19 -07001609struct of_table_feature_prop {
Rich Lanea1b8f442013-10-01 22:05:22 -07001610 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001611 uint16_t length;
1612};
1613
Rich Lanee9c37db2013-06-21 18:30:24 -07001614struct of_table_feature_prop_instructions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001615 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001616 uint16_t length;
1617 // FIXME Check if instruction_t is right for ids here
Jonathan Stout661c4682014-03-03 12:35:31 -05001618 list(of_instruction_id_t) instruction_ids;
Rich Lanea06d0c32013-03-25 08:52:03 -07001619};
1620
Rich Lanee9c37db2013-06-21 18:30:24 -07001621struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001622 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001623 uint16_t length;
Jonathan Stout661c4682014-03-03 12:35:31 -05001624 list(of_instruction_id_t) instruction_ids;
Rich Lanea06d0c32013-03-25 08:52:03 -07001625};
1626
Rich Lanee9c37db2013-06-21 18:30:24 -07001627struct of_table_feature_prop_next_tables : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001628 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001629 uint16_t length;
1630 list(of_uint8_t) next_table_ids;
1631};
1632
Rich Lanee9c37db2013-06-21 18:30:24 -07001633struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001634 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001635 uint16_t length;
1636 list(of_uint8_t) next_table_ids;
1637};
1638
Rich Lanee9c37db2013-06-21 18:30:24 -07001639struct of_table_feature_prop_write_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001640 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001641 uint16_t length;
1642 list(of_action_id_t) action_ids;
1643};
1644
Rich Lanee9c37db2013-06-21 18:30:24 -07001645struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001646 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001647 uint16_t length;
1648 list(of_action_id_t) action_ids;
1649};
1650
Rich Lanee9c37db2013-06-21 18:30:24 -07001651struct of_table_feature_prop_apply_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001652 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001653 uint16_t length;
1654 list(of_action_id_t) action_ids;
1655};
1656
Rich Lanee9c37db2013-06-21 18:30:24 -07001657struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001658 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001659 uint16_t length;
1660 list(of_action_id_t) action_ids;
1661};
1662
Rich Lanee9c37db2013-06-21 18:30:24 -07001663struct of_table_feature_prop_match : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001664 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001665 uint16_t length;
1666 list(of_uint32_t) oxm_ids;
1667};
1668
Rich Lanee9c37db2013-06-21 18:30:24 -07001669struct of_table_feature_prop_wildcards : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001670 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001671 uint16_t length;
1672 list(of_uint32_t) oxm_ids;
1673};
1674
Rich Lanee9c37db2013-06-21 18:30:24 -07001675struct of_table_feature_prop_write_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001676 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001677 uint16_t length;
1678 list(of_uint32_t) oxm_ids;
1679};
1680
Rich Lanee9c37db2013-06-21 18:30:24 -07001681struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001682 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001683 uint16_t length;
1684 list(of_uint32_t) oxm_ids;
1685};
1686
Rich Lanee9c37db2013-06-21 18:30:24 -07001687struct of_table_feature_prop_apply_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001688 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001689 uint16_t length;
1690 list(of_uint32_t) oxm_ids;
1691};
1692
Rich Lanee9c37db2013-06-21 18:30:24 -07001693struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001694 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001695 uint16_t length;
1696 list(of_uint32_t) oxm_ids;
1697};
1698
Rich Lanee9c37db2013-06-21 18:30:24 -07001699struct of_table_feature_prop_experimenter : of_table_feature_prop {
Jonathan Stoutacb3e322014-02-13 13:23:16 -05001700 uint16_t type == 65534;
Rich Lanea06d0c32013-03-25 08:52:03 -07001701 uint16_t length;
1702 uint32_t experimenter;
1703 uint32_t subtype;
1704 of_octets_t experimenter_data;
1705};
1706
Jonathan Stoutaf15dee2014-02-13 14:22:26 -05001707struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
1708 uint16_t type == 65535;
1709 uint16_t length;
1710 uint32_t experimenter;
1711 uint32_t subtype;
1712 of_octets_t experimenter_data;
1713};
Rich Lanea06d0c32013-03-25 08:52:03 -07001714
Rich Lane68ae4d72013-05-09 10:55:19 -07001715struct of_table_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001716 uint16_t length;
1717 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001718 pad(5);
Rich Lanea06d0c32013-03-25 08:52:03 -07001719 of_table_name_t name;
1720 uint64_t metadata_match;
1721 uint64_t metadata_write;
1722 uint32_t config;
1723 uint32_t max_entries;
1724 list(of_table_feature_prop_t) properties;
1725};
1726
Rich Lane68ae4d72013-05-09 10:55:19 -07001727struct of_meter_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001728 uint32_t max_meter;
1729 uint32_t band_types;
1730 uint32_t capabilities;
1731 uint8_t max_bands;
1732 uint8_t max_color;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001733 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001734};
1735
Rich Lanee9c37db2013-06-21 18:30:24 -07001736struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001737 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001738 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001739 uint16_t length;
1740 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001741 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001742 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001743 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001744 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001745 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001746};
1747
Rich Lanee9c37db2013-06-21 18:30:24 -07001748struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001749 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001750 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001751 uint16_t length;
1752 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001753 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001754 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001755 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001756 list(of_port_stats_entry_t) entries;
1757};
1758
Rich Lanee9c37db2013-06-21 18:30:24 -07001759struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001760 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001761 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001762 uint16_t length;
1763 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001764 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001765 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001766 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001767 of_port_no_t port_no;
1768 uint32_t queue_id;
1769};
1770
Rich Lanee9c37db2013-06-21 18:30:24 -07001771struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001772 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001773 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001774 uint16_t length;
1775 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001776 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001777 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001778 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001779 list(of_queue_stats_entry_t) entries;
1780};
1781
Rich Lanee9c37db2013-06-21 18:30:24 -07001782struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001783 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001784 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001785 uint16_t length;
1786 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001787 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001788 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001789 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001790 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001791 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001792};
1793
Rich Lanee9c37db2013-06-21 18:30:24 -07001794struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001795 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001796 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001797 uint16_t length;
1798 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001799 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001800 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001801 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001802 list(of_group_stats_entry_t) entries;
1803};
1804
Rich Lanee9c37db2013-06-21 18:30:24 -07001805struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001806 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001807 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001808 uint16_t length;
1809 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001810 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001811 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001812 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001813};
1814
Rich Lanee9c37db2013-06-21 18:30:24 -07001815struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001816 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001817 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001818 uint16_t length;
1819 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001820 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001821 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001822 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001823 list(of_group_desc_stats_entry_t) entries;
1824};
1825
Rich Lanee9c37db2013-06-21 18:30:24 -07001826struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001827 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001828 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001829 uint16_t length;
1830 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001831 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001832 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001833 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001834};
1835
Rich Lanee9c37db2013-06-21 18:30:24 -07001836struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001837 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001838 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001839 uint16_t length;
1840 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001841 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001842 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001843 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001844 uint32_t types;
1845 uint32_t capabilities;
1846 uint32_t max_groups_all;
1847 uint32_t max_groups_select;
1848 uint32_t max_groups_indirect;
1849 uint32_t max_groups_ff;
1850 uint32_t actions_all;
1851 uint32_t actions_select;
1852 uint32_t actions_indirect;
1853 uint32_t actions_ff;
1854};
1855
Rich Lanee9c37db2013-06-21 18:30:24 -07001856struct of_meter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001857 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001858 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001859 uint16_t length;
1860 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001861 uint16_t stats_type == 9;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001862 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001863 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001864 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001865 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001866};
1867
Rich Lanee9c37db2013-06-21 18:30:24 -07001868struct of_meter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001869 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001870 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001871 uint16_t length;
1872 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001873 uint16_t stats_type == 9;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001874 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001875 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001876 list(of_meter_stats_t) entries;
1877};
1878
Rich Lanee9c37db2013-06-21 18:30:24 -07001879struct of_meter_config_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001880 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001881 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001882 uint16_t length;
1883 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001884 uint16_t stats_type == 10;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001885 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001886 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001887 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001888 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001889};
1890
Rich Lanee9c37db2013-06-21 18:30:24 -07001891struct of_meter_config_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001892 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001893 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001894 uint16_t length;
1895 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001896 uint16_t stats_type == 10;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001897 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001898 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001899 list(of_meter_band_t) entries;
1900};
1901
1902// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001903struct of_meter_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001904 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001905 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001906 uint16_t length;
1907 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001908 uint16_t stats_type == 11;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001909 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001910 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001911};
1912
1913// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001914struct of_meter_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001915 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001916 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001917 uint16_t length;
1918 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001919 uint16_t stats_type == 11;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001920 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001921 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001922 of_meter_features_t features;
1923};
1924
1925// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001926struct of_table_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001927 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001928 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001929 uint16_t length;
1930 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001931 uint16_t stats_type == 12;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001932 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001933 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001934 list(of_table_features_t) entries;
1935};
1936
1937// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001938struct of_table_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001939 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001940 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001941 uint16_t length;
1942 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001943 uint16_t stats_type == 12;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001944 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001945 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001946 list(of_table_features_t) entries;
1947};
1948
1949// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001950struct of_port_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001951 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001952 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001953 uint16_t length;
1954 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001955 uint16_t stats_type == 13;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001956 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001957 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001958};
1959
1960// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001961struct of_port_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001962 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001963 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001964 uint16_t length;
1965 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001966 uint16_t stats_type == 13;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001967 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001968 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001969 list(of_port_desc_t) entries;
1970};
1971
Rich Lane68ae4d72013-05-09 10:55:19 -07001972struct of_meter_band_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001973 uint64_t packet_band_count;
1974 uint64_t byte_band_count;
1975};
1976
Rich Lane68ae4d72013-05-09 10:55:19 -07001977struct of_meter_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001978 uint32_t meter_id;
1979 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001980 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001981 uint32_t flow_count;
1982 uint64_t packet_in_count;
1983 uint64_t byte_in_count;
1984 uint32_t duration_sec;
1985 uint32_t duration_nsec;
1986 list(of_meter_band_stats_t) band_stats;
1987};
1988
Rich Lane68ae4d72013-05-09 10:55:19 -07001989struct of_meter_config {
Rich Lanea06d0c32013-03-25 08:52:03 -07001990 uint16_t length;
1991 uint16_t flags;
1992 uint32_t meter_id;
1993 list(of_meter_band_t) entries;
1994};
1995
Rich Lanea06d0c32013-03-25 08:52:03 -07001996// END OF STATS OBJECTS
1997
Rich Lane68ae4d72013-05-09 10:55:19 -07001998struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001999 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07002000 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002001 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002002};
2003
Rich Lanee9c37db2013-06-21 18:30:24 -07002004struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002005 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07002006 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002007 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002008 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002009 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002010};
2011
Rich Lanee9c37db2013-06-21 18:30:24 -07002012struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002013 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07002014 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002015 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002016 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002017 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002018};
2019
Rich Lanee9c37db2013-06-21 18:30:24 -07002020struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002021 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07002022 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002023 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07002024 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002025 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002026 of_octets_t data;
2027};
2028
Rich Lane68ae4d72013-05-09 10:55:19 -07002029struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07002030 uint32_t queue_id;
2031 of_port_no_t port;
2032 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002033 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002034 list(of_queue_prop_t) properties;
2035};
2036
Rich Lanee9c37db2013-06-21 18:30:24 -07002037struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002038 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002039 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07002040 uint16_t length;
2041 uint32_t xid;
2042 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002043 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002044};
2045
Rich Lanee9c37db2013-06-21 18:30:24 -07002046struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002047 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002048 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07002049 uint16_t length;
2050 uint32_t xid;
2051 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002052 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002053 list(of_packet_queue_t) queues;
2054};
2055
Rich Lanee9c37db2013-06-21 18:30:24 -07002056struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002057 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002058 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07002059 uint16_t length;
2060 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07002061 enum ofp_controller_role role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002062 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002063 uint64_t generation_id;
2064};
2065
Rich Lanee9c37db2013-06-21 18:30:24 -07002066struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002067 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002068 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07002069 uint16_t length;
2070 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07002071 enum ofp_controller_role role;
2072 pad(4);
2073 uint64_t generation_id;
Rich Lanea06d0c32013-03-25 08:52:03 -07002074};
2075
2076////////////////////////////////////////////////////////////////
2077// FIXME understand async; where do bitmasks live?
2078// Determine bitmap type for masks below.
2079// DOCUMENT masks where uint32_t[0] is interest for equal/master
2080// while uint32_t[1] is interest for slave
2081////////////////////////////////////////////////////////////////
2082
Rich Lanee9c37db2013-06-21 18:30:24 -07002083struct of_async_get_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002084 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002085 uint8_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -07002086 uint16_t length;
2087 uint32_t xid;
2088 uint32_t packet_in_mask_equal_master;
2089 uint32_t packet_in_mask_slave;
2090 uint32_t port_status_mask_equal_master;
2091 uint32_t port_status_mask_slave;
2092 uint32_t flow_removed_mask_equal_master;
2093 uint32_t flow_removed_mask_slave;
2094};
2095
Rich Lanee9c37db2013-06-21 18:30:24 -07002096struct of_async_get_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002097 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002098 uint8_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -07002099 uint16_t length;
2100 uint32_t xid;
2101 uint32_t packet_in_mask_equal_master;
2102 uint32_t packet_in_mask_slave;
2103 uint32_t port_status_mask_equal_master;
2104 uint32_t port_status_mask_slave;
2105 uint32_t flow_removed_mask_equal_master;
2106 uint32_t flow_removed_mask_slave;
2107};
2108
Rich Lanee9c37db2013-06-21 18:30:24 -07002109struct of_async_set : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002110 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002111 uint8_t type == 28;
Rich Lanea06d0c32013-03-25 08:52:03 -07002112 uint16_t length;
2113 uint32_t xid;
2114 uint32_t packet_in_mask_equal_master;
2115 uint32_t packet_in_mask_slave;
2116 uint32_t port_status_mask_equal_master;
2117 uint32_t port_status_mask_slave;
2118 uint32_t flow_removed_mask_equal_master;
2119 uint32_t flow_removed_mask_slave;
2120};