blob: fa1a9676b22af1b72e855a339af2a39f9d6e98a2 [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,
Vishnu Emmadi21ad5202014-10-28 17:29:59 -0700163 OFPPF_BSN_BREAKOUT_CAPABLE = 0x80000000,
Rich Lane5d33a622013-04-08 17:33:11 -0700164};
165
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700166enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700167 OFPPR_ADD = 0,
168 OFPPR_DELETE = 1,
169 OFPPR_MODIFY = 2,
170};
171
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700172enum ofp_match_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700173 OFPMT_STANDARD = 0,
174 OFPMT_OXM = 1,
175};
176
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700177enum ofp_oxm_class(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700178 OFPXMC_NXM_0 = 0,
179 OFPXMC_NXM_1 = 1,
180 OFPXMC_OPENFLOW_BASIC = 0x8000,
181 OFPXMC_EXPERIMENTER = 0xffff,
182};
183
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700184enum ofp_vlan_id(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700185 OFPVID_NONE = 0,
186 OFPVID_PRESENT = 0x1000,
187};
188
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700189// FIXME: OF spec specified this as '9' bits, implicitly adding
190// to full byte
191enum ofp_ipv6exthdr_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700192 OFPIEH_NONEXT = 0x1,
193 OFPIEH_ESP = 0x2,
194 OFPIEH_AUTH = 0x4,
195 OFPIEH_DEST = 0x8,
196 OFPIEH_FRAG = 0x10,
197 OFPIEH_ROUTER = 0x20,
198 OFPIEH_HOP = 0x40,
199 OFPIEH_UNREP = 0x80,
200 OFPIEH_UNSEQ = 0x100,
201};
202
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700203enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700204 OFPAT_OUTPUT = 0,
205 OFPAT_COPY_TTL_OUT = 0xb,
206 OFPAT_COPY_TTL_IN = 0xc,
207 OFPAT_SET_MPLS_TTL = 0xf,
208 OFPAT_DEC_MPLS_TTL = 0x10,
209 OFPAT_PUSH_VLAN = 0x11,
210 OFPAT_POP_VLAN = 0x12,
211 OFPAT_PUSH_MPLS = 0x13,
212 OFPAT_POP_MPLS = 0x14,
213 OFPAT_SET_QUEUE = 0x15,
214 OFPAT_GROUP = 0x16,
215 OFPAT_SET_NW_TTL = 0x17,
216 OFPAT_DEC_NW_TTL = 0x18,
217 OFPAT_SET_FIELD = 0x19,
218 OFPAT_PUSH_PBB = 0x1a,
219 OFPAT_POP_PBB = 0x1b,
220 OFPAT_EXPERIMENTER = 0xffff,
221};
222
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700223enum ofp_controller_max_len(wire_type=uint16_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700224 OFPCML_MAX = 0xffe5,
225 OFPCML_NO_BUFFER = 0xffff,
226};
227
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700228enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700229 OFPIT_GOTO_TABLE = 0x1,
230 OFPIT_WRITE_METADATA = 0x2,
231 OFPIT_WRITE_ACTIONS = 0x3,
232 OFPIT_APPLY_ACTIONS = 0x4,
233 OFPIT_CLEAR_ACTIONS = 0x5,
234 OFPIT_METER = 0x6,
235 OFPIT_EXPERIMENTER = 0xffff,
236};
237
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700238enum ofp_flow_mod_command(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700239 OFPFC_ADD = 0,
240 OFPFC_MODIFY = 1,
241 OFPFC_MODIFY_STRICT = 2,
242 OFPFC_DELETE = 3,
243 OFPFC_DELETE_STRICT = 4,
244};
245
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700246enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700247 OFPFF_SEND_FLOW_REM = 0x1,
248 OFPFF_CHECK_OVERLAP = 0x2,
249 OFPFF_RESET_COUNTS = 0x4,
250 OFPFF_NO_PKT_COUNTS = 0x8,
251 OFPFF_NO_BYT_COUNTS = 0x10,
Rich Lanef86f39a2013-10-07 18:04:11 -0700252
253 /* Non-standard, enabled by an experimenter message */
254 /* See the bsn_flow_idle input file */
255 OFPFF_BSN_SEND_IDLE = 0x80,
Rich Lane5d33a622013-04-08 17:33:11 -0700256};
257
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700258enum ofp_group(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700259 OFPG_MAX = 0xffffff00,
260 OFPG_ALL = 0xfffffffc,
261 OFPG_ANY = 0xffffffff,
262};
263
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700264enum ofp_group_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700265 OFPGC_ADD = 0,
266 OFPGC_MODIFY = 1,
267 OFPGC_DELETE = 2,
268};
269
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700270enum ofp_group_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700271 OFPGT_ALL = 0,
272 OFPGT_SELECT = 1,
273 OFPGT_INDIRECT = 2,
274 OFPGT_FF = 3,
275};
276
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700277enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700278 OFPR_NO_MATCH = 0,
279 OFPR_ACTION = 1,
280 OFPR_INVALID_TTL = 2,
Andreas Wundsam7723c562013-10-23 16:27:40 -0700281
282 // non-standard BSN extensions. OF does not have a standard-conformant
283 // way to extend the set of packet_in reasons
284 OFPR_BSN_NEW_HOST = 128,
285 OFPR_BSN_STATION_MOVE = 129,
286 OFPR_BSN_BAD_VLAN = 130,
287 OFPR_BSN_DESTINATION_LOOKUP_FAILURE = 131,
Rich Lanee13d7842013-12-21 14:39:25 -0800288 OFPR_BSN_NO_ROUTE = 132,
Harshmeet Singh192b1b02013-12-14 07:46:24 -0800289 OFPR_BSN_ICMP_ECHO_REQUEST = 133,
290 OFPR_BSN_DEST_NETWORK_UNREACHABLE = 134,
291 OFPR_BSN_DEST_HOST_UNREACHABLE = 135,
292 OFPR_BSN_DEST_PORT_UNREACHABLE = 136,
293 OFPR_BSN_FRAGMENTATION_REQUIRED = 137,
Rich Lanec1c6df62014-01-24 17:18:00 -0800294 OFPR_BSN_ARP = 139,
Duc Pham9d29ed02014-01-30 16:23:16 -0800295 OFPR_BSN_DHCP = 140,
xinwud847c692014-02-20 18:37:34 -0800296 OFPR_BSN_DEBUG = 141,
Rich Laneb2de0052014-03-19 16:57:46 -0700297 OFPR_BSN_PACKET_OF_DEATH = 142,
Rich Lane5d33a622013-04-08 17:33:11 -0700298};
299
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700300enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700301 OFPRR_IDLE_TIMEOUT = 0,
302 OFPRR_HARD_TIMEOUT = 1,
303 OFPRR_DELETE = 2,
304 OFPRR_GROUP_DELETE = 3,
305};
306
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700307enum ofp_meter(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700308 OFPM_MAX = 0xffff0000,
309 OFPM_SLOWPATH = 0xfffffffd,
310 OFPM_CONTROLLER = 0xfffffffe,
311 OFPM_ALL = 0xffffffff,
312};
313
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700314enum ofp_meter_band_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700315 OFPMBT_DROP = 0x1,
316 OFPMBT_DSCP_REMARK = 0x2,
317 OFPMBT_EXPERIMENTER = 0xffff,
318};
319
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700320enum ofp_meter_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700321 OFPMC_ADD = 0,
322 OFPMC_MODIFY = 1,
323 OFPMC_DELETE = 2,
324};
325
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700326enum ofp_meter_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700327 OFPMF_KBPS = 0x1,
328 OFPMF_PKTPS = 0x2,
329 OFPMF_BURST = 0x4,
330 OFPMF_STATS = 0x8,
331};
332
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700333enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700334 OFPET_HELLO_FAILED = 0,
335 OFPET_BAD_REQUEST = 1,
336 OFPET_BAD_ACTION = 2,
337 OFPET_BAD_INSTRUCTION = 3,
338 OFPET_BAD_MATCH = 4,
339 OFPET_FLOW_MOD_FAILED = 5,
340 OFPET_GROUP_MOD_FAILED = 6,
341 OFPET_PORT_MOD_FAILED = 7,
342 OFPET_TABLE_MOD_FAILED = 8,
343 OFPET_QUEUE_OP_FAILED = 9,
344 OFPET_SWITCH_CONFIG_FAILED = 10,
345 OFPET_ROLE_REQUEST_FAILED = 11,
346 OFPET_METER_MOD_FAILED = 12,
347 OFPET_TABLE_FEATURES_FAILED = 13,
348 OFPET_EXPERIMENTER = 0xffff,
349};
350
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700351enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700352 OFPHFC_INCOMPATIBLE = 0,
353 OFPHFC_EPERM = 1,
354};
355
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700356enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700357 OFPBRC_BAD_VERSION = 0,
358 OFPBRC_BAD_TYPE = 1,
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700359 OFPBRC_BAD_STAT = 2,
Rich Lane5d33a622013-04-08 17:33:11 -0700360 OFPBRC_BAD_EXPERIMENTER = 3,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700361 OFPBRC_BAD_EXPERIMENTER_TYPE = 4,
Rich Lane5d33a622013-04-08 17:33:11 -0700362 OFPBRC_EPERM = 5,
363 OFPBRC_BAD_LEN = 6,
364 OFPBRC_BUFFER_EMPTY = 7,
365 OFPBRC_BUFFER_UNKNOWN = 8,
366 OFPBRC_BAD_TABLE_ID = 9,
367 OFPBRC_IS_SLAVE = 10,
368 OFPBRC_BAD_PORT = 11,
369 OFPBRC_BAD_PACKET = 12,
370 OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13,
371};
372
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700373enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700374 OFPBAC_BAD_TYPE = 0,
375 OFPBAC_BAD_LEN = 1,
376 OFPBAC_BAD_EXPERIMENTER = 2,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700377 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700378 OFPBAC_BAD_OUT_PORT = 4,
379 OFPBAC_BAD_ARGUMENT = 5,
380 OFPBAC_EPERM = 6,
381 OFPBAC_TOO_MANY = 7,
382 OFPBAC_BAD_QUEUE = 8,
383 OFPBAC_BAD_OUT_GROUP = 9,
384 OFPBAC_MATCH_INCONSISTENT = 10,
385 OFPBAC_UNSUPPORTED_ORDER = 11,
386 OFPBAC_BAD_TAG = 12,
387 OFPBAC_BAD_SET_TYPE = 13,
388 OFPBAC_BAD_SET_LEN = 14,
389 OFPBAC_BAD_SET_ARGUMENT = 15,
390};
391
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700392enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700393 OFPBIC_UNKNOWN_INST = 0,
394 OFPBIC_UNSUP_INST = 1,
395 OFPBIC_BAD_TABLE_ID = 2,
396 OFPBIC_UNSUP_METADATA = 3,
397 OFPBIC_UNSUP_METADATA_MASK = 4,
398 OFPBIC_BAD_EXPERIMENTER = 5,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700399 OFPBIC_BAD_EXPERIMENTER_TYPE = 6,
Rich Lane5d33a622013-04-08 17:33:11 -0700400 OFPBIC_BAD_LEN = 7,
401 OFPBIC_EPERM = 8,
402};
403
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700404enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700405 OFPBMC_BAD_TYPE = 0,
406 OFPBMC_BAD_LEN = 1,
407 OFPBMC_BAD_TAG = 2,
408 OFPBMC_BAD_DL_ADDR_MASK = 3,
409 OFPBMC_BAD_NW_ADDR_MASK = 4,
410 OFPBMC_BAD_WILDCARDS = 5,
411 OFPBMC_BAD_FIELD = 6,
412 OFPBMC_BAD_VALUE = 7,
413 OFPBMC_BAD_MASK = 8,
414 OFPBMC_BAD_PREREQ = 9,
415 OFPBMC_DUP_FIELD = 10,
416 OFPBMC_EPERM = 11,
417};
418
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700419enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700420 OFPFMFC_UNKNOWN = 0,
421 OFPFMFC_TABLE_FULL = 1,
422 OFPFMFC_BAD_TABLE_ID = 2,
423 OFPFMFC_OVERLAP = 3,
424 OFPFMFC_EPERM = 4,
425 OFPFMFC_BAD_TIMEOUT = 5,
426 OFPFMFC_BAD_COMMAND = 6,
427 OFPFMFC_BAD_FLAGS = 7,
428};
429
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700430enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700431 OFPGMFC_GROUP_EXISTS = 0,
432 OFPGMFC_INVALID_GROUP = 1,
433 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
434 OFPGMFC_OUT_OF_GROUPS = 3,
435 OFPGMFC_OUT_OF_BUCKETS = 4,
436 OFPGMFC_CHAINING_UNSUPPORTED = 5,
437 OFPGMFC_WATCH_UNSUPPORTED = 6,
438 OFPGMFC_LOOP = 7,
439 OFPGMFC_UNKNOWN_GROUP = 8,
440 OFPGMFC_CHAINED_GROUP = 9,
441 OFPGMFC_BAD_TYPE = 10,
442 OFPGMFC_BAD_COMMAND = 11,
443 OFPGMFC_BAD_BUCKET = 12,
444 OFPGMFC_BAD_WATCH = 13,
445 OFPGMFC_EPERM = 14,
446};
447
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700448enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700449 OFPPMFC_BAD_PORT = 0,
450 OFPPMFC_BAD_HW_ADDR = 1,
451 OFPPMFC_BAD_CONFIG = 2,
452 OFPPMFC_BAD_ADVERTISE = 3,
453 OFPPMFC_EPERM = 4,
454};
455
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700456enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700457 OFPTMFC_BAD_TABLE = 0,
458 OFPTMFC_BAD_CONFIG = 1,
459 OFPTMFC_EPERM = 2,
460};
461
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700462enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700463 OFPQOFC_BAD_PORT = 0,
464 OFPQOFC_BAD_QUEUE = 1,
465 OFPQOFC_EPERM = 2,
466};
467
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700468enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700469 OFPSCFC_BAD_FLAGS = 0,
470 OFPSCFC_BAD_LEN = 1,
471 OFPSCFC_EPERM = 2,
472};
473
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700474enum ofp_role_request_failed_code(wire_type=uint16_t){
Rich Lane5d33a622013-04-08 17:33:11 -0700475 OFPRRFC_STALE = 0,
476 OFPRRFC_UNSUP = 1,
477 OFPRRFC_BAD_ROLE = 2,
478};
479
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700480enum ofp_meter_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700481 OFPMMFC_UNKNOWN = 0,
482 OFPMMFC_METER_EXISTS = 1,
483 OFPMMFC_INVALID_METER = 2,
484 OFPMMFC_UNKNOWN_METER = 3,
485 OFPMMFC_BAD_COMMAND = 4,
486 OFPMMFC_BAD_FLAGS = 5,
487 OFPMMFC_BAD_RATE = 6,
488 OFPMMFC_BAD_BURST = 7,
489 OFPMMFC_BAD_BAND = 8,
490 OFPMMFC_BAD_BAND_VALUE = 9,
491 OFPMMFC_OUT_OF_METERS = 10,
492 OFPMMFC_OUT_OF_BANDS = 11,
493};
494
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700495enum ofp_table_features_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700496 OFPTFFC_BAD_TABLE = 0,
497 OFPTFFC_BAD_METADATA = 1,
498 OFPTFFC_BAD_TYPE = 2,
499 OFPTFFC_BAD_LEN = 3,
500 OFPTFFC_BAD_ARGUMENT = 4,
501 OFPTFFC_EPERM = 5,
502};
503
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700504enum ofp_stats_type(wire_type=uint16_t) {
505 OFPST_DESC = 0,
506 OFPST_FLOW = 1,
507 OFPST_AGGREGATE = 2,
508 OFPST_TABLE = 3,
509 OFPST_PORT = 4,
510 OFPST_QUEUE = 5,
511 OFPST_GROUP = 6,
512 OFPST_GROUP_DESC = 7,
513 OFPST_GROUP_FEATURES = 8,
514 OFPST_METER = 9,
515 OFPST_METER_CONFIG = 10,
516 OFPST_METER_FEATURES = 11,
517 OFPST_TABLE_FEATURES = 12,
518 OFPST_PORT_DESC = 13,
519 OFPST_EXPERIMENTER = 0xffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700520};
521
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700522enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) {
523 OFPSF_REQ_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700524};
525
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700526enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
527 OFPSF_REPLY_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700528};
529
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700530enum ofp_table_feature_prop_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700531 OFPTFPT_INSTRUCTIONS = 0,
532 OFPTFPT_INSTRUCTIONS_MISS = 1,
533 OFPTFPT_NEXT_TABLES = 2,
534 OFPTFPT_NEXT_TABLES_MISS = 3,
535 OFPTFPT_WRITE_ACTIONS = 4,
536 OFPTFPT_WRITE_ACTIONS_MISS = 5,
537 OFPTFPT_APPLY_ACTIONS = 6,
538 OFPTFPT_APPLY_ACTIONS_MISS = 7,
539 OFPTFPT_MATCH = 8,
540 OFPTFPT_WILDCARDS = 0xa,
541 OFPTFPT_WRITE_SETFIELD = 0xc,
542 OFPTFPT_WRITE_SETFIELD_MISS = 0xd,
543 OFPTFPT_APPLY_SETFIELD = 0xe,
544 OFPTFPT_APPLY_SETFIELD_MISS = 0xf,
545 OFPTFPT_EXPERIMENTER = 0xfffe,
546 OFPTFPT_EXPERIMENTER_MISS = 0xffff,
547};
548
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700549enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700550 OFPGFC_SELECT_WEIGHT = 0x1,
551 OFPGFC_SELECT_LIVENESS = 0x2,
552 OFPGFC_CHAINING = 0x4,
553 OFPGFC_CHAINING_CHECKS = 0x8,
554};
555
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700556enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700557 OFPQT_MIN_RATE = 0x1,
558 OFPQT_MAX_RATE = 0x2,
559 OFPQT_EXPERIMENTER = 0xffff,
560};
561
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700562enum ofp_controller_role(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700563 OFPCR_ROLE_NOCHANGE = 0,
564 OFPCR_ROLE_EQUAL = 1,
565 OFPCR_ROLE_MASTER = 2,
566 OFPCR_ROLE_SLAVE = 3,
567};
568
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700569enum ofp_hello_elem_type(wire_type=uint16_t) {
Rich Lane0733cd62013-04-18 21:14:42 -0700570 OFPHET_VERSIONBITMAP = 1,
571};
572
Rich Lanee9c37db2013-06-21 18:30:24 -0700573/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700574struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700575 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700576 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700577 uint16_t length;
578 uint32_t xid;
579};
580
xinwuf08ef682013-12-05 18:29:20 -0800581struct of_uint64 {
582 uint64_t value;
583};
584
Rich Lanea06d0c32013-03-25 08:52:03 -0700585// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700586struct of_uint32 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700587 uint32_t value;
588};
589
590// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700591struct of_uint8 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700592 uint8_t value;
593};
594
Rich Lane68ae4d72013-05-09 10:55:19 -0700595struct of_hello_elem {
Andreas Wundsam70411bf2013-08-02 22:26:38 -0700596 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700597 uint16_t length;
598};
599
Rich Lanee9c37db2013-06-21 18:30:24 -0700600struct of_hello_elem_versionbitmap : of_hello_elem {
Rich Lane31b87142013-05-09 22:05:42 -0700601 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700602 uint16_t length;
603 list(of_uint32_t) bitmaps;
604};
605
Rich Lanee9c37db2013-06-21 18:30:24 -0700606struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700607 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700608 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700609 uint16_t length;
610 uint32_t xid;
611 list(of_hello_elem_t) elements;
612};
613
Rich Lanee9c37db2013-06-21 18:30:24 -0700614struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700615 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700616 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700617 uint16_t length;
618 uint32_t xid;
619 of_octets_t data;
620};
621
Rich Lanee9c37db2013-06-21 18:30:24 -0700622struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700623 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700624 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700625 uint16_t length;
626 uint32_t xid;
627 of_octets_t data;
628};
629
Rich Lanee9c37db2013-06-21 18:30:24 -0700630struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700631 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700632 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700633 uint16_t length;
634 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700635 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700636 uint32_t subtype;
637 of_octets_t data;
638};
639
Rich Lanee9c37db2013-06-21 18:30:24 -0700640struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700641 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700642 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700643 uint16_t length;
644 uint32_t xid;
645};
646
Rich Lanee9c37db2013-06-21 18:30:24 -0700647struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700648 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700649 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700650 uint16_t length;
651 uint32_t xid;
652};
653
Rich Lanee9c37db2013-06-21 18:30:24 -0700654struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700655 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700656 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700657 uint16_t length;
658 uint32_t xid;
659};
660
Rich Lanee9c37db2013-06-21 18:30:24 -0700661struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700662 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700663 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700664 uint16_t length;
665 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800666 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700667 uint16_t miss_send_len;
668};
669
Rich Lanee9c37db2013-06-21 18:30:24 -0700670struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700671 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700672 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700673 uint16_t length;
674 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800675 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700676 uint16_t miss_send_len;
677};
678
Rich Lanee9c37db2013-06-21 18:30:24 -0700679struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700680 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700681 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700682 uint16_t length;
683 uint32_t xid;
684 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700685 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700686 uint32_t config;
687};
688
Rich Lane68ae4d72013-05-09 10:55:19 -0700689struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700690 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700691 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700692 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700693 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700694 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700695 enum ofp_port_config config;
696 enum ofp_port_state state;
697 enum ofp_port_features curr;
698 enum ofp_port_features advertised;
699 enum ofp_port_features supported;
700 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700701 uint32_t curr_speed;
702 uint32_t max_speed;
703};
704
Rich Lanee9c37db2013-06-21 18:30:24 -0700705struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700706 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700707 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700708 uint16_t length;
709 uint32_t xid;
710};
711
Rich Lanee9c37db2013-06-21 18:30:24 -0700712struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700713 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700714 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700715 uint16_t length;
716 uint32_t xid;
717 uint64_t datapath_id;
718 uint32_t n_buffers;
719 uint8_t n_tables;
720 uint8_t auxiliary_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700721 pad(2);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700722 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700723 uint32_t reserved;
724};
725
Rich Lanee9c37db2013-06-21 18:30:24 -0700726struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700727 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700728 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700729 uint16_t length;
730 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700731 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700732 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700733 of_port_desc_t desc;
734};
735
Rich Lanee9c37db2013-06-21 18:30:24 -0700736struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700737 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700738 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700739 uint16_t length;
740 uint32_t xid;
741 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700742 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700743 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700744 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700745 uint32_t config;
746 uint32_t mask;
747 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700748 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700749};
750
751// FIXME Does this need to be v4?
Andreas Wundsam5da68512013-10-22 22:18:00 -0700752struct of_match_v3(align=8, length_includes_align=False) {
Rich Lane31b87142013-05-09 22:05:42 -0700753 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700754 uint16_t length;
755 list(of_oxm_t) oxm_list;
756};
757
Rich Lanea06d0c32013-03-25 08:52:03 -0700758// This looks like an action header, but is standalone. See
759// ofp_table_features_prop_actions
Rich Lane68ae4d72013-05-09 10:55:19 -0700760struct of_action_id {
Rich Lanea06d0c32013-03-25 08:52:03 -0700761 uint16_t type;
762 uint16_t len;
Rich Lanea06d0c32013-03-25 08:52:03 -0700763};
764
Rich Lanee9c37db2013-06-21 18:30:24 -0700765struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700766 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700767 uint16_t len;
768 of_port_no_t port;
769 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700770 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700771};
772
Rich Lanee9c37db2013-06-21 18:30:24 -0700773struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700774 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700775 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700776 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700777};
778
Rich Lanee9c37db2013-06-21 18:30:24 -0700779struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700780 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700781 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700782 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700783};
784
Rich Lanee9c37db2013-06-21 18:30:24 -0700785struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700786 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700787 uint16_t len;
788 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700789 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700790};
791
Rich Lanee9c37db2013-06-21 18:30:24 -0700792struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700793 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700794 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700795 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700796};
797
Rich Lanee9c37db2013-06-21 18:30:24 -0700798struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700799 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700800 uint16_t len;
801 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700802 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700803};
804
Rich Lanee9c37db2013-06-21 18:30:24 -0700805struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700806 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700807 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700808 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700809};
810
Rich Lanee9c37db2013-06-21 18:30:24 -0700811struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700812 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700813 uint16_t len;
814 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700815 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700816};
817
Rich Lanee9c37db2013-06-21 18:30:24 -0700818struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700819 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700820 uint16_t len;
821 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700822 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700823};
824
Rich Lanee9c37db2013-06-21 18:30:24 -0700825struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700826 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700827 uint16_t len;
828 uint32_t queue_id;
829};
830
Rich Lanee9c37db2013-06-21 18:30:24 -0700831struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700832 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700833 uint16_t len;
834 uint32_t group_id;
835};
836
Rich Lanee9c37db2013-06-21 18:30:24 -0700837struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700838 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700839 uint16_t len;
840 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700841 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700842};
843
Rich Lanee9c37db2013-06-21 18:30:24 -0700844struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700845 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700846 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700847 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700848};
849
Andreas Wundsam5da68512013-10-22 22:18:00 -0700850struct of_action_set_field(align=8, length_includes_align=True) : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700851 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700852 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700853 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700854};
855
Andreas Wundsam5da68512013-10-22 22:18:00 -0700856struct of_action_experimenter(align=8, length_includes_align=True): of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700857 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700858 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700859 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700860 of_octets_t data;
861};
862
Rich Lanee9c37db2013-06-21 18:30:24 -0700863struct of_action_pop_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700864 uint16_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -0700865 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700866 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700867};
868
Rich Lanee9c37db2013-06-21 18:30:24 -0700869struct of_action_push_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700870 uint16_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -0700871 uint16_t len;
872 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700873 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700874};
875
Rich Lane68ae4d72013-05-09 10:55:19 -0700876struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700877 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700878 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700879 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700880};
881
Jonathan Stout661c4682014-03-03 12:35:31 -0500882struct of_instruction_id {
883 uint16_t type;
884 uint16_t len;
885};
886
Rich Lane68ae4d72013-05-09 10:55:19 -0700887struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700888 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700889 uint16_t len;
890};
891
Rich Lanee9c37db2013-06-21 18:30:24 -0700892struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700893 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700894 uint16_t len;
895 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700896 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700897};
898
Rich Lanee9c37db2013-06-21 18:30:24 -0700899struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700900 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700901 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700902 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700903 uint64_t metadata;
904 uint64_t metadata_mask;
905};
906
Rich Lanee9c37db2013-06-21 18:30:24 -0700907struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700908 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700909 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700910 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700911 list(of_action_t) actions;
912};
913
Rich Lanee9c37db2013-06-21 18:30:24 -0700914struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700915 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700916 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700917 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700918 list(of_action_t) actions;
919};
920
Rich Lanee9c37db2013-06-21 18:30:24 -0700921struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700922 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700923 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700924 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700925};
926
Rich Lanee9c37db2013-06-21 18:30:24 -0700927struct of_instruction_meter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700928 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700929 uint16_t len;
930 uint32_t meter_id;
931};
932
Rich Lanee9c37db2013-06-21 18:30:24 -0700933struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700934 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700935 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700936 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700937 of_octets_t data;
938};
939
Rich Lanee9c37db2013-06-21 18:30:24 -0700940struct of_flow_mod : of_header {
941 uint8_t version;
942 uint8_t type == 14;
943 uint16_t length;
944 uint32_t xid;
945 uint64_t cookie;
946 uint64_t cookie_mask;
947 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700948 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700949 uint16_t idle_timeout;
950 uint16_t hard_timeout;
951 uint16_t priority;
952 uint32_t buffer_id;
953 of_port_no_t out_port;
954 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700955 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700956 pad(2);
957 of_match_t match;
958 list(of_instruction_t) instructions;
959};
960
961struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700962 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700963 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700964 uint16_t length;
965 uint32_t xid;
966 uint64_t cookie;
967 uint64_t cookie_mask;
968 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700969 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700970 uint16_t idle_timeout;
971 uint16_t hard_timeout;
972 uint16_t priority;
973 uint32_t buffer_id;
974 of_port_no_t out_port;
975 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700976 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700977 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700978 of_match_t match;
979 list(of_instruction_t) instructions;
980};
981
Rich Lanee9c37db2013-06-21 18:30:24 -0700982struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700983 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700984 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700985 uint16_t length;
986 uint32_t xid;
987 uint64_t cookie;
988 uint64_t cookie_mask;
989 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700990 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700991 uint16_t idle_timeout;
992 uint16_t hard_timeout;
993 uint16_t priority;
994 uint32_t buffer_id;
995 of_port_no_t out_port;
996 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700997 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700998 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700999 of_match_t match;
1000 list(of_instruction_t) instructions;
1001};
1002
Rich Lanee9c37db2013-06-21 18:30:24 -07001003struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001004 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001005 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001006 uint16_t length;
1007 uint32_t xid;
1008 uint64_t cookie;
1009 uint64_t cookie_mask;
1010 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001011 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001012 uint16_t idle_timeout;
1013 uint16_t hard_timeout;
1014 uint16_t priority;
1015 uint32_t buffer_id;
1016 of_port_no_t out_port;
1017 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001018 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001019 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001020 of_match_t match;
1021 list(of_instruction_t) instructions;
1022};
1023
Rich Lanee9c37db2013-06-21 18:30:24 -07001024struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001025 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001026 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001027 uint16_t length;
1028 uint32_t xid;
1029 uint64_t cookie;
1030 uint64_t cookie_mask;
1031 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001032 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001033 uint16_t idle_timeout;
1034 uint16_t hard_timeout;
1035 uint16_t priority;
1036 uint32_t buffer_id;
1037 of_port_no_t out_port;
1038 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001039 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001040 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001041 of_match_t match;
1042 list(of_instruction_t) instructions;
1043};
1044
Rich Lanee9c37db2013-06-21 18:30:24 -07001045struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001046 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001047 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001048 uint16_t length;
1049 uint32_t xid;
1050 uint64_t cookie;
1051 uint64_t cookie_mask;
1052 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001053 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001054 uint16_t idle_timeout;
1055 uint16_t hard_timeout;
1056 uint16_t priority;
1057 uint32_t buffer_id;
1058 of_port_no_t out_port;
1059 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001060 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001061 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001062 of_match_t match;
1063 list(of_instruction_t) instructions;
1064};
1065
Rich Lane68ae4d72013-05-09 10:55:19 -07001066struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -07001067 uint16_t len;
1068 uint16_t weight;
1069 of_port_no_t watch_port;
1070 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001071 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001072 list(of_action_t) actions;
1073};
1074
Rich Lanee9c37db2013-06-21 18:30:24 -07001075struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001076 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001077 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001078 uint16_t length;
1079 uint32_t xid;
Andreas Wundsam5812cf32013-11-15 13:51:24 -08001080 enum ofp_group_mod_command command == ?;
1081 enum ofp_group_type group_type;
1082 pad(1);
1083 uint32_t group_id;
1084 list(of_bucket_t) buckets;
1085};
1086
1087struct of_group_add : of_group_mod {
1088 uint8_t version;
1089 uint8_t type == 15;
1090 uint16_t length;
1091 uint32_t xid;
1092 enum ofp_group_mod_command command == 0;
1093 enum ofp_group_type group_type;
1094 pad(1);
1095 uint32_t group_id;
1096 list(of_bucket_t) buckets;
1097};
1098
1099struct of_group_modify : of_group_mod {
1100 uint8_t version;
1101 uint8_t type == 15;
1102 uint16_t length;
1103 uint32_t xid;
1104 enum ofp_group_mod_command command == 1;
1105 enum ofp_group_type group_type;
1106 pad(1);
1107 uint32_t group_id;
1108 list(of_bucket_t) buckets;
1109};
1110
1111struct of_group_delete : of_group_mod {
1112 uint8_t version;
1113 uint8_t type == 15;
1114 uint16_t length;
1115 uint32_t xid;
1116 enum ofp_group_mod_command command == 2;
1117 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001118 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001119 uint32_t group_id;
1120 list(of_bucket_t) buckets;
1121};
1122
Rich Lanee9c37db2013-06-21 18:30:24 -07001123struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001124 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001125 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001126 uint16_t length;
1127 uint32_t xid;
1128 uint32_t buffer_id;
1129 of_port_no_t in_port;
1130 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001131 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001132 list(of_action_t) actions;
1133 of_octets_t data;
1134};
1135
Rich Lanee9c37db2013-06-21 18:30:24 -07001136struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001137 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001138 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001139 uint16_t length;
1140 uint32_t xid;
1141 uint32_t buffer_id;
1142 uint16_t total_len;
1143 uint8_t reason;
1144 uint8_t table_id;
1145 uint64_t cookie;
1146 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001147 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001148 of_octets_t data; /* FIXME: Ensure total_len gets updated */
1149};
1150
Rich Lanee9c37db2013-06-21 18:30:24 -07001151struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001152 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001153 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001154 uint16_t length;
1155 uint32_t xid;
1156 uint64_t cookie;
1157 uint16_t priority;
1158 uint8_t reason;
1159 uint8_t table_id;
1160 uint32_t duration_sec;
1161 uint32_t duration_nsec;
1162 uint16_t idle_timeout;
1163 uint16_t hard_timeout;
1164 uint64_t packet_count;
1165 uint64_t byte_count;
1166 of_match_t match;
1167};
1168
Rich Lane68ae4d72013-05-09 10:55:19 -07001169struct of_meter_band {
Andreas Wundsam9ba65362013-08-02 19:14:42 -07001170 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001171 uint16_t len;
1172// uint32_t rate; // These are excluded b/c this is the header
1173// uint32_t burst_size; // These are excluded b/c this is the header
1174};
1175
Rich Lanee9c37db2013-06-21 18:30:24 -07001176struct of_meter_band_drop : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001177 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001178 uint16_t len;
1179 uint32_t rate;
1180 uint32_t burst_size;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001181 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001182};
1183
Rich Lanee9c37db2013-06-21 18:30:24 -07001184struct of_meter_band_dscp_remark : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001185 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001186 uint16_t len;
1187 uint32_t rate;
1188 uint32_t burst_size;
1189 uint8_t prec_level;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001190 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001191};
1192
Rich Lanee9c37db2013-06-21 18:30:24 -07001193struct of_meter_band_experimenter : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001194 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001195 uint16_t len;
1196 uint32_t rate;
1197 uint32_t burst_size;
1198 uint32_t experimenter;
1199};
1200
Rich Lanee9c37db2013-06-21 18:30:24 -07001201struct of_meter_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001202 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001203 uint8_t type == 29;
Rich Lanea06d0c32013-03-25 08:52:03 -07001204 uint16_t length;
1205 uint32_t xid;
1206 uint16_t command;
1207 uint16_t flags;
1208 uint32_t meter_id;
1209 list(of_meter_band_t) meters;
1210};
1211
Rich Lanee9c37db2013-06-21 18:30:24 -07001212struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001213 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001214 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001215 uint16_t length;
1216 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001217 uint16_t err_type == ?;
1218};
1219
1220struct of_hello_failed_error_msg : of_error_msg {
1221 uint8_t version;
1222 uint8_t type == 1;
1223 uint16_t length;
1224 uint32_t xid;
1225 uint16_t err_type == 0;
1226 enum ofp_hello_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001227 of_octets_t data;
1228};
1229
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001230struct of_bad_request_error_msg : of_error_msg {
1231 uint8_t version;
1232 uint8_t type == 1;
1233 uint16_t length;
1234 uint32_t xid;
1235 uint16_t err_type == 1;
1236 enum ofp_bad_request_code code;
1237 of_octets_t data;
1238};
1239
1240struct of_bad_action_error_msg : of_error_msg {
1241 uint8_t version;
1242 uint8_t type == 1;
1243 uint16_t length;
1244 uint32_t xid;
1245 uint16_t err_type == 2;
1246 enum ofp_bad_action_code code;
1247 of_octets_t data;
1248};
1249
1250struct of_bad_instruction_error_msg : of_error_msg {
1251 uint8_t version;
1252 uint8_t type == 1;
1253 uint16_t length;
1254 uint32_t xid;
1255 uint16_t err_type == 3;
1256 enum ofp_bad_instruction_code code;
1257 of_octets_t data;
1258};
1259
1260struct of_bad_match_error_msg : of_error_msg {
1261 uint8_t version;
1262 uint8_t type == 1;
1263 uint16_t length;
1264 uint32_t xid;
1265 uint16_t err_type == 4;
1266 enum ofp_bad_match_code code;
1267 of_octets_t data;
1268};
1269
1270struct of_flow_mod_failed_error_msg : of_error_msg {
1271 uint8_t version;
1272 uint8_t type == 1;
1273 uint16_t length;
1274 uint32_t xid;
1275 uint16_t err_type == 5;
1276 enum ofp_flow_mod_failed_code code;
1277 of_octets_t data;
1278};
1279
1280struct of_group_mod_failed_error_msg : of_error_msg {
1281 uint8_t version;
1282 uint8_t type == 1;
1283 uint16_t length;
1284 uint32_t xid;
1285 uint16_t err_type == 6;
1286 enum ofp_group_mod_failed_code code;
1287 of_octets_t data;
1288};
1289
1290struct of_port_mod_failed_error_msg : of_error_msg {
1291 uint8_t version;
1292 uint8_t type == 1;
1293 uint16_t length;
1294 uint32_t xid;
1295 uint16_t err_type == 7;
1296 enum ofp_port_mod_failed_code code;
1297 of_octets_t data;
1298};
1299
1300struct of_table_mod_failed_error_msg : of_error_msg {
1301 uint8_t version;
1302 uint8_t type == 1;
1303 uint16_t length;
1304 uint32_t xid;
1305 uint16_t err_type == 8;
1306 enum ofp_table_mod_failed_code code;
1307 of_octets_t data;
1308};
1309
1310struct of_queue_op_failed_error_msg : of_error_msg {
1311 uint8_t version;
1312 uint8_t type == 1;
1313 uint16_t length;
1314 uint32_t xid;
1315 uint16_t err_type == 9;
1316 enum ofp_queue_op_failed_code code;
1317 of_octets_t data;
1318};
1319
1320struct of_switch_config_failed_error_msg : of_error_msg {
1321 uint8_t version;
1322 uint8_t type == 1;
1323 uint16_t length;
1324 uint32_t xid;
1325 uint16_t err_type == 10;
1326 enum ofp_switch_config_failed_code code;
1327 of_octets_t data;
1328};
1329
1330struct of_role_request_failed_error_msg : of_error_msg {
1331 uint8_t version;
1332 uint8_t type == 1;
1333 uint16_t length;
1334 uint32_t xid;
1335 uint16_t err_type == 11;
1336 enum ofp_role_request_failed_code code;
1337 of_octets_t data;
1338};
1339
1340struct of_meter_mod_failed_error_msg : of_error_msg {
1341 uint8_t version;
1342 uint8_t type == 1;
1343 uint16_t length;
1344 uint32_t xid;
1345 uint16_t err_type == 12;
1346 enum ofp_meter_mod_failed_code code;
1347 of_octets_t data;
1348};
1349
1350struct of_table_features_failed_error_msg : of_error_msg {
1351 uint8_t version;
1352 uint8_t type == 1;
1353 uint16_t length;
1354 uint32_t xid;
1355 uint16_t err_type == 13;
1356 enum ofp_table_features_failed_code code;
1357 of_octets_t data;
1358};
1359
Andreas Wundsamcc8cd662013-11-15 13:52:06 -08001360struct of_experimenter_error_msg : of_error_msg {
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001361 uint8_t version;
1362 uint8_t type == 1;
1363 uint16_t length;
1364 uint32_t xid;
1365 uint16_t err_type == 0xffff;
1366 uint16_t subtype;
1367 uint32_t experimenter;
1368 of_octets_t data;
1369};
Rich Lanea06d0c32013-03-25 08:52:03 -07001370
1371// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1372
Rich Lane68ae4d72013-05-09 10:55:19 -07001373struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001374 uint16_t length;
1375 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001376 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001377 uint32_t duration_sec;
1378 uint32_t duration_nsec;
1379 uint16_t priority;
1380 uint16_t idle_timeout;
1381 uint16_t hard_timeout;
Andreas Wundsam078fcfd2014-06-25 15:49:01 -07001382 enum ofp_flow_mod_flags flags;
Rich Lane1a47c1c2013-08-28 15:27:00 -07001383 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001384 uint64_t cookie;
1385 uint64_t packet_count;
1386 uint64_t byte_count;
1387 of_match_t match;
1388 list(of_instruction_t) instructions;
1389};
1390
1391
Rich Lane68ae4d72013-05-09 10:55:19 -07001392struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001393 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001394 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001395 uint32_t active_count;
1396 uint64_t lookup_count;
1397 uint64_t matched_count;
1398};
1399
Rich Lane68ae4d72013-05-09 10:55:19 -07001400struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001401 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001402 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001403 uint64_t rx_packets;
1404 uint64_t tx_packets;
1405 uint64_t rx_bytes;
1406 uint64_t tx_bytes;
1407 uint64_t rx_dropped;
1408 uint64_t tx_dropped;
1409 uint64_t rx_errors;
1410 uint64_t tx_errors;
1411 uint64_t rx_frame_err;
1412 uint64_t rx_over_err;
1413 uint64_t rx_crc_err;
1414 uint64_t collisions;
1415 uint32_t duration_sec;
1416 uint32_t duration_nsec;
1417};
1418
Rich Lane68ae4d72013-05-09 10:55:19 -07001419struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001420 of_port_no_t port_no;
1421 uint32_t queue_id;
1422 uint64_t tx_bytes;
1423 uint64_t tx_packets;
1424 uint64_t tx_errors;
1425 uint32_t duration_sec;
1426 uint32_t duration_nsec;
1427};
1428
Rich Lane68ae4d72013-05-09 10:55:19 -07001429struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001430 uint64_t packet_count;
1431 uint64_t byte_count;
1432};
1433
Rich Lane68ae4d72013-05-09 10:55:19 -07001434struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001435 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001436 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001437 uint32_t group_id;
1438 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001439 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001440 uint64_t packet_count;
1441 uint64_t byte_count;
1442 uint32_t duration_sec;
1443 uint32_t duration_nsec;
1444 list(of_bucket_counter_t) bucket_stats;
1445};
1446
Rich Lane68ae4d72013-05-09 10:55:19 -07001447struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001448 uint16_t length;
Andreas Wundsam84603f02013-11-18 18:45:30 -08001449 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001450 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001451 uint32_t group_id;
1452 list(of_bucket_t) buckets;
1453};
1454
1455// STATS:
1456// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1457
Rich Lanee9c37db2013-06-21 18:30:24 -07001458struct of_stats_request : of_header {
1459 uint8_t version;
1460 uint8_t type == 18;
1461 uint16_t length;
1462 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001463 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001464 enum ofp_stats_request_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001465 pad(4);
1466};
1467
1468struct of_stats_reply : of_header {
1469 uint8_t version;
1470 uint8_t type == 19;
1471 uint16_t length;
1472 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001473 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001474 enum ofp_stats_reply_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001475 pad(4);
1476};
1477
1478struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001479 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001480 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001481 uint16_t length;
1482 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001483 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001484 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001485 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001486};
1487
Rich Lanee9c37db2013-06-21 18:30:24 -07001488struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001489 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001490 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001491 uint16_t length;
1492 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001493 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001494 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001495 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001496 of_desc_str_t mfr_desc;
1497 of_desc_str_t hw_desc;
1498 of_desc_str_t sw_desc;
1499 of_serial_num_t serial_num;
1500 of_desc_str_t dp_desc;
1501};
1502
Rich Lanee9c37db2013-06-21 18:30:24 -07001503struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001504 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001505 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001506 uint16_t length;
1507 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001508 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001509 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001510 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001511 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001512 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001513 of_port_no_t out_port;
1514 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001515 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001516 uint64_t cookie;
1517 uint64_t cookie_mask;
1518 of_match_t match;
1519};
1520
Rich Lanee9c37db2013-06-21 18:30:24 -07001521struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001522 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001523 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001524 uint16_t length;
1525 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001526 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001527 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001528 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001529 list(of_flow_stats_entry_t) entries;
1530};
1531
Rich Lanee9c37db2013-06-21 18:30:24 -07001532struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001533 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001534 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001535 uint16_t length;
1536 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001537 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001538 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001539 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001540 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001541 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001542 of_port_no_t out_port;
1543 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001544 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001545 uint64_t cookie;
1546 uint64_t cookie_mask;
1547 of_match_t match;
1548};
1549
Rich Lanee9c37db2013-06-21 18:30:24 -07001550struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001551 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001552 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001553 uint16_t length;
1554 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001555 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001556 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001557 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001558 uint64_t packet_count;
1559 uint64_t byte_count;
1560 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001561 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001562};
1563
Rich Lanee9c37db2013-06-21 18:30:24 -07001564struct of_table_stats_request : of_stats_request {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001565 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001566 uint8_t type == 18;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001567 uint16_t length;
1568 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001569 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001570 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001571 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001572};
1573
Rich Lanee9c37db2013-06-21 18:30:24 -07001574struct of_table_stats_reply : of_stats_reply {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001575 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001576 uint8_t type == 19;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001577 uint16_t length;
1578 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001579 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001580 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001581 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001582 list(of_table_stats_entry_t) entries;
1583};
1584
Rich Lane6d434332013-11-13 09:23:10 -08001585struct of_experimenter_stats_request : of_stats_request {
1586 uint8_t version;
1587 uint8_t type == 18;
1588 uint16_t length;
1589 uint32_t xid;
1590 uint16_t stats_type == 0xffff;
1591 enum ofp_stats_request_flags flags;
1592 pad(4);
1593 uint32_t experimenter == ?;
1594 uint32_t subtype;
1595};
1596
1597struct of_experimenter_stats_reply : of_stats_reply {
1598 uint8_t version;
1599 uint8_t type == 19;
1600 uint16_t length;
1601 uint32_t xid;
1602 uint16_t stats_type == 0xffff;
1603 enum ofp_stats_reply_flags flags;
1604 pad(4);
1605 uint32_t experimenter == ?;
1606 uint32_t subtype;
1607};
1608
Rich Lanea06d0c32013-03-25 08:52:03 -07001609// FIXME: These are padded to 8 byte align beyond the length indicated
1610
Rich Lane68ae4d72013-05-09 10:55:19 -07001611struct of_table_feature_prop {
Rich Lanea1b8f442013-10-01 22:05:22 -07001612 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001613 uint16_t length;
1614};
1615
Rich Lanee9c37db2013-06-21 18:30:24 -07001616struct of_table_feature_prop_instructions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001617 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001618 uint16_t length;
1619 // FIXME Check if instruction_t is right for ids here
Jonathan Stout661c4682014-03-03 12:35:31 -05001620 list(of_instruction_id_t) instruction_ids;
Rich Lanea06d0c32013-03-25 08:52:03 -07001621};
1622
Rich Lanee9c37db2013-06-21 18:30:24 -07001623struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001624 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001625 uint16_t length;
Jonathan Stout661c4682014-03-03 12:35:31 -05001626 list(of_instruction_id_t) instruction_ids;
Rich Lanea06d0c32013-03-25 08:52:03 -07001627};
1628
Rich Lanee9c37db2013-06-21 18:30:24 -07001629struct of_table_feature_prop_next_tables : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001630 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001631 uint16_t length;
1632 list(of_uint8_t) next_table_ids;
1633};
1634
Rich Lanee9c37db2013-06-21 18:30:24 -07001635struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001636 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001637 uint16_t length;
1638 list(of_uint8_t) next_table_ids;
1639};
1640
Rich Lanee9c37db2013-06-21 18:30:24 -07001641struct of_table_feature_prop_write_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001642 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001643 uint16_t length;
1644 list(of_action_id_t) action_ids;
1645};
1646
Rich Lanee9c37db2013-06-21 18:30:24 -07001647struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001648 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001649 uint16_t length;
1650 list(of_action_id_t) action_ids;
1651};
1652
Rich Lanee9c37db2013-06-21 18:30:24 -07001653struct of_table_feature_prop_apply_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001654 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001655 uint16_t length;
1656 list(of_action_id_t) action_ids;
1657};
1658
Rich Lanee9c37db2013-06-21 18:30:24 -07001659struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001660 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001661 uint16_t length;
1662 list(of_action_id_t) action_ids;
1663};
1664
Rich Lanee9c37db2013-06-21 18:30:24 -07001665struct of_table_feature_prop_match : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001666 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001667 uint16_t length;
1668 list(of_uint32_t) oxm_ids;
1669};
1670
Rich Lanee9c37db2013-06-21 18:30:24 -07001671struct of_table_feature_prop_wildcards : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001672 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001673 uint16_t length;
1674 list(of_uint32_t) oxm_ids;
1675};
1676
Rich Lanee9c37db2013-06-21 18:30:24 -07001677struct of_table_feature_prop_write_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001678 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001679 uint16_t length;
1680 list(of_uint32_t) oxm_ids;
1681};
1682
Rich Lanee9c37db2013-06-21 18:30:24 -07001683struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001684 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001685 uint16_t length;
1686 list(of_uint32_t) oxm_ids;
1687};
1688
Rich Lanee9c37db2013-06-21 18:30:24 -07001689struct of_table_feature_prop_apply_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001690 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001691 uint16_t length;
1692 list(of_uint32_t) oxm_ids;
1693};
1694
Rich Lanee9c37db2013-06-21 18:30:24 -07001695struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001696 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001697 uint16_t length;
1698 list(of_uint32_t) oxm_ids;
1699};
1700
Rich Lanee9c37db2013-06-21 18:30:24 -07001701struct of_table_feature_prop_experimenter : of_table_feature_prop {
Jonathan Stoutacb3e322014-02-13 13:23:16 -05001702 uint16_t type == 65534;
Rich Lanea06d0c32013-03-25 08:52:03 -07001703 uint16_t length;
Rich Lane13517e72014-10-03 16:18:16 -07001704 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001705 uint32_t subtype;
1706 of_octets_t experimenter_data;
1707};
1708
Jonathan Stoutaf15dee2014-02-13 14:22:26 -05001709struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
1710 uint16_t type == 65535;
1711 uint16_t length;
Rich Lane13517e72014-10-03 16:18:16 -07001712 uint32_t experimenter == ?;
Jonathan Stoutaf15dee2014-02-13 14:22:26 -05001713 uint32_t subtype;
1714 of_octets_t experimenter_data;
1715};
Rich Lanea06d0c32013-03-25 08:52:03 -07001716
Rich Lane68ae4d72013-05-09 10:55:19 -07001717struct of_table_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001718 uint16_t length;
1719 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001720 pad(5);
Rich Lanea06d0c32013-03-25 08:52:03 -07001721 of_table_name_t name;
1722 uint64_t metadata_match;
1723 uint64_t metadata_write;
1724 uint32_t config;
1725 uint32_t max_entries;
1726 list(of_table_feature_prop_t) properties;
1727};
1728
Rich Lane68ae4d72013-05-09 10:55:19 -07001729struct of_meter_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001730 uint32_t max_meter;
1731 uint32_t band_types;
1732 uint32_t capabilities;
1733 uint8_t max_bands;
1734 uint8_t max_color;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001735 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001736};
1737
Rich Lanee9c37db2013-06-21 18:30:24 -07001738struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001739 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001740 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001741 uint16_t length;
1742 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001743 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001744 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001745 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001746 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001747 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001748};
1749
Rich Lanee9c37db2013-06-21 18:30:24 -07001750struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001751 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001752 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001753 uint16_t length;
1754 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001755 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001756 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001757 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001758 list(of_port_stats_entry_t) entries;
1759};
1760
Rich Lanee9c37db2013-06-21 18:30:24 -07001761struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001762 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001763 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001764 uint16_t length;
1765 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001766 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001767 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001768 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001769 of_port_no_t port_no;
1770 uint32_t queue_id;
1771};
1772
Rich Lanee9c37db2013-06-21 18:30:24 -07001773struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001774 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001775 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001776 uint16_t length;
1777 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001778 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001779 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001780 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001781 list(of_queue_stats_entry_t) entries;
1782};
1783
Rich Lanee9c37db2013-06-21 18:30:24 -07001784struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001785 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001786 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001787 uint16_t length;
1788 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001789 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001790 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001791 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001792 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001793 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001794};
1795
Rich Lanee9c37db2013-06-21 18:30:24 -07001796struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001797 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001798 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001799 uint16_t length;
1800 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001801 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001802 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001803 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001804 list(of_group_stats_entry_t) entries;
1805};
1806
Rich Lanee9c37db2013-06-21 18:30:24 -07001807struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001808 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001809 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001810 uint16_t length;
1811 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001812 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001813 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001814 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001815};
1816
Rich Lanee9c37db2013-06-21 18:30:24 -07001817struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001818 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001819 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001820 uint16_t length;
1821 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001822 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001823 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001824 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001825 list(of_group_desc_stats_entry_t) entries;
1826};
1827
Rich Lanee9c37db2013-06-21 18:30:24 -07001828struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001829 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001830 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001831 uint16_t length;
1832 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001833 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001834 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001835 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001836};
1837
Rich Lanee9c37db2013-06-21 18:30:24 -07001838struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001839 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001840 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001841 uint16_t length;
1842 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001843 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001844 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001845 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001846 uint32_t types;
1847 uint32_t capabilities;
1848 uint32_t max_groups_all;
1849 uint32_t max_groups_select;
1850 uint32_t max_groups_indirect;
1851 uint32_t max_groups_ff;
1852 uint32_t actions_all;
1853 uint32_t actions_select;
1854 uint32_t actions_indirect;
1855 uint32_t actions_ff;
1856};
1857
Rich Lanee9c37db2013-06-21 18:30:24 -07001858struct of_meter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001859 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001860 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001861 uint16_t length;
1862 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001863 uint16_t stats_type == 9;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001864 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001865 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001866 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001867 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001868};
1869
Rich Lanee9c37db2013-06-21 18:30:24 -07001870struct of_meter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001871 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001872 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001873 uint16_t length;
1874 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001875 uint16_t stats_type == 9;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001876 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001877 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001878 list(of_meter_stats_t) entries;
1879};
1880
Rich Lanee9c37db2013-06-21 18:30:24 -07001881struct of_meter_config_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001882 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001883 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001884 uint16_t length;
1885 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001886 uint16_t stats_type == 10;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001887 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001888 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001889 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001890 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001891};
1892
Rich Lanee9c37db2013-06-21 18:30:24 -07001893struct of_meter_config_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001894 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001895 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001896 uint16_t length;
1897 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001898 uint16_t stats_type == 10;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001899 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001900 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001901 list(of_meter_band_t) entries;
1902};
1903
1904// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001905struct of_meter_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001906 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001907 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001908 uint16_t length;
1909 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001910 uint16_t stats_type == 11;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001911 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001912 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001913};
1914
1915// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001916struct of_meter_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001917 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001918 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001919 uint16_t length;
1920 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001921 uint16_t stats_type == 11;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001922 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001923 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001924 of_meter_features_t features;
1925};
1926
1927// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001928struct of_table_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001929 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001930 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001931 uint16_t length;
1932 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001933 uint16_t stats_type == 12;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001934 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001935 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001936 list(of_table_features_t) entries;
1937};
1938
1939// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001940struct of_table_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001941 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001942 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001943 uint16_t length;
1944 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001945 uint16_t stats_type == 12;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001946 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001947 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001948 list(of_table_features_t) entries;
1949};
1950
1951// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001952struct of_port_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001953 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001954 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001955 uint16_t length;
1956 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001957 uint16_t stats_type == 13;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001958 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001959 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001960};
1961
1962// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001963struct of_port_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001964 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001965 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001966 uint16_t length;
1967 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001968 uint16_t stats_type == 13;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001969 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001970 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001971 list(of_port_desc_t) entries;
1972};
1973
Rich Lane68ae4d72013-05-09 10:55:19 -07001974struct of_meter_band_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001975 uint64_t packet_band_count;
1976 uint64_t byte_band_count;
1977};
1978
Rich Lane68ae4d72013-05-09 10:55:19 -07001979struct of_meter_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001980 uint32_t meter_id;
1981 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001982 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001983 uint32_t flow_count;
1984 uint64_t packet_in_count;
1985 uint64_t byte_in_count;
1986 uint32_t duration_sec;
1987 uint32_t duration_nsec;
1988 list(of_meter_band_stats_t) band_stats;
1989};
1990
Rich Lane68ae4d72013-05-09 10:55:19 -07001991struct of_meter_config {
Rich Lanea06d0c32013-03-25 08:52:03 -07001992 uint16_t length;
1993 uint16_t flags;
1994 uint32_t meter_id;
1995 list(of_meter_band_t) entries;
1996};
1997
Rich Lanea06d0c32013-03-25 08:52:03 -07001998// END OF STATS OBJECTS
1999
Rich Lane68ae4d72013-05-09 10:55:19 -07002000struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07002001 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07002002 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002003 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002004};
2005
Rich Lanee9c37db2013-06-21 18:30:24 -07002006struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002007 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07002008 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002009 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002010 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002011 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002012};
2013
Rich Lanee9c37db2013-06-21 18:30:24 -07002014struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002015 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07002016 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002017 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002018 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002019 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002020};
2021
Rich Lanee9c37db2013-06-21 18:30:24 -07002022struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002023 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07002024 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002025 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07002026 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002027 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002028 of_octets_t data;
2029};
2030
Rich Lane68ae4d72013-05-09 10:55:19 -07002031struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07002032 uint32_t queue_id;
2033 of_port_no_t port;
2034 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002035 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002036 list(of_queue_prop_t) properties;
2037};
2038
Rich Lanee9c37db2013-06-21 18:30:24 -07002039struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002040 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002041 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07002042 uint16_t length;
2043 uint32_t xid;
2044 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002045 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002046};
2047
Rich Lanee9c37db2013-06-21 18:30:24 -07002048struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002049 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002050 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07002051 uint16_t length;
2052 uint32_t xid;
2053 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002054 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002055 list(of_packet_queue_t) queues;
2056};
2057
Rich Lanee9c37db2013-06-21 18:30:24 -07002058struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002059 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002060 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07002061 uint16_t length;
2062 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07002063 enum ofp_controller_role role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002064 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002065 uint64_t generation_id;
2066};
2067
Rich Lanee9c37db2013-06-21 18:30:24 -07002068struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002069 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002070 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07002071 uint16_t length;
2072 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07002073 enum ofp_controller_role role;
2074 pad(4);
2075 uint64_t generation_id;
Rich Lanea06d0c32013-03-25 08:52:03 -07002076};
2077
2078////////////////////////////////////////////////////////////////
2079// FIXME understand async; where do bitmasks live?
2080// Determine bitmap type for masks below.
2081// DOCUMENT masks where uint32_t[0] is interest for equal/master
2082// while uint32_t[1] is interest for slave
2083////////////////////////////////////////////////////////////////
2084
Rich Lanee9c37db2013-06-21 18:30:24 -07002085struct of_async_get_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002086 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002087 uint8_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -07002088 uint16_t length;
2089 uint32_t xid;
2090 uint32_t packet_in_mask_equal_master;
2091 uint32_t packet_in_mask_slave;
2092 uint32_t port_status_mask_equal_master;
2093 uint32_t port_status_mask_slave;
2094 uint32_t flow_removed_mask_equal_master;
2095 uint32_t flow_removed_mask_slave;
2096};
2097
Rich Lanee9c37db2013-06-21 18:30:24 -07002098struct of_async_get_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002099 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002100 uint8_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -07002101 uint16_t length;
2102 uint32_t xid;
2103 uint32_t packet_in_mask_equal_master;
2104 uint32_t packet_in_mask_slave;
2105 uint32_t port_status_mask_equal_master;
2106 uint32_t port_status_mask_slave;
2107 uint32_t flow_removed_mask_equal_master;
2108 uint32_t flow_removed_mask_slave;
2109};
2110
Rich Lanee9c37db2013-06-21 18:30:24 -07002111struct of_async_set : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002112 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002113 uint8_t type == 28;
Rich Lanea06d0c32013-03-25 08:52:03 -07002114 uint16_t length;
2115 uint32_t xid;
2116 uint32_t packet_in_mask_equal_master;
2117 uint32_t packet_in_mask_slave;
2118 uint32_t port_status_mask_equal_master;
2119 uint32_t port_status_mask_slave;
2120 uint32_t flow_removed_mask_equal_master;
2121 uint32_t flow_removed_mask_slave;
2122};