blob: 764ad218ed25c50c06ecd93e248e26d47a6dbfdd [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 Lanee2af4ee2013-05-09 11:04:06 -0700761 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700762};
763
Rich Lanee9c37db2013-06-21 18:30:24 -0700764struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700765 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700766 uint16_t len;
767 of_port_no_t port;
768 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700769 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700770};
771
Rich Lanee9c37db2013-06-21 18:30:24 -0700772struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700773 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700774 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700775 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700776};
777
Rich Lanee9c37db2013-06-21 18:30:24 -0700778struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700779 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700780 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700781 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700782};
783
Rich Lanee9c37db2013-06-21 18:30:24 -0700784struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700785 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700786 uint16_t len;
787 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700788 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700789};
790
Rich Lanee9c37db2013-06-21 18:30:24 -0700791struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700792 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700793 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700794 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700795};
796
Rich Lanee9c37db2013-06-21 18:30:24 -0700797struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700798 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700799 uint16_t len;
800 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700801 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700802};
803
Rich Lanee9c37db2013-06-21 18:30:24 -0700804struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700805 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700806 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700807 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700808};
809
Rich Lanee9c37db2013-06-21 18:30:24 -0700810struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700811 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700812 uint16_t len;
813 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700814 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700815};
816
Rich Lanee9c37db2013-06-21 18:30:24 -0700817struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700818 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700819 uint16_t len;
820 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700821 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700822};
823
Rich Lanee9c37db2013-06-21 18:30:24 -0700824struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700825 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700826 uint16_t len;
827 uint32_t queue_id;
828};
829
Rich Lanee9c37db2013-06-21 18:30:24 -0700830struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700831 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700832 uint16_t len;
833 uint32_t group_id;
834};
835
Rich Lanee9c37db2013-06-21 18:30:24 -0700836struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700837 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700838 uint16_t len;
839 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700840 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700841};
842
Rich Lanee9c37db2013-06-21 18:30:24 -0700843struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700844 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700845 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700846 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700847};
848
Andreas Wundsam5da68512013-10-22 22:18:00 -0700849struct of_action_set_field(align=8, length_includes_align=True) : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700850 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700851 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700852 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700853};
854
Andreas Wundsam5da68512013-10-22 22:18:00 -0700855struct of_action_experimenter(align=8, length_includes_align=True): of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700856 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700857 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700858 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700859 of_octets_t data;
860};
861
Rich Lanee9c37db2013-06-21 18:30:24 -0700862struct of_action_pop_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700863 uint16_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -0700864 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700865 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700866};
867
Rich Lanee9c37db2013-06-21 18:30:24 -0700868struct of_action_push_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700869 uint16_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -0700870 uint16_t len;
871 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700872 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700873};
874
Rich Lane68ae4d72013-05-09 10:55:19 -0700875struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700876 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700877 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700878 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700879};
880
Rich Lane68ae4d72013-05-09 10:55:19 -0700881struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700882 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700883 uint16_t len;
884};
885
Rich Lanee9c37db2013-06-21 18:30:24 -0700886struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700887 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700888 uint16_t len;
889 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700890 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700891};
892
Rich Lanee9c37db2013-06-21 18:30:24 -0700893struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700894 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700895 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700896 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700897 uint64_t metadata;
898 uint64_t metadata_mask;
899};
900
Rich Lanee9c37db2013-06-21 18:30:24 -0700901struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700902 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700903 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700904 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700905 list(of_action_t) actions;
906};
907
Rich Lanee9c37db2013-06-21 18:30:24 -0700908struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700909 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700910 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700911 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700912 list(of_action_t) actions;
913};
914
Rich Lanee9c37db2013-06-21 18:30:24 -0700915struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700916 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700917 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700918 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700919};
920
Rich Lanee9c37db2013-06-21 18:30:24 -0700921struct of_instruction_meter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700922 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700923 uint16_t len;
924 uint32_t meter_id;
925};
926
Rich Lanee9c37db2013-06-21 18:30:24 -0700927struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700928 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700929 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700930 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700931 of_octets_t data;
932};
933
Rich Lanee9c37db2013-06-21 18:30:24 -0700934struct of_flow_mod : of_header {
935 uint8_t version;
936 uint8_t type == 14;
937 uint16_t length;
938 uint32_t xid;
939 uint64_t cookie;
940 uint64_t cookie_mask;
941 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700942 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700943 uint16_t idle_timeout;
944 uint16_t hard_timeout;
945 uint16_t priority;
946 uint32_t buffer_id;
947 of_port_no_t out_port;
948 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700949 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700950 pad(2);
951 of_match_t match;
952 list(of_instruction_t) instructions;
953};
954
955struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700956 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700957 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700958 uint16_t length;
959 uint32_t xid;
960 uint64_t cookie;
961 uint64_t cookie_mask;
962 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700963 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700964 uint16_t idle_timeout;
965 uint16_t hard_timeout;
966 uint16_t priority;
967 uint32_t buffer_id;
968 of_port_no_t out_port;
969 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700970 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700971 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700972 of_match_t match;
973 list(of_instruction_t) instructions;
974};
975
Rich Lanee9c37db2013-06-21 18:30:24 -0700976struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700977 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700978 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700979 uint16_t length;
980 uint32_t xid;
981 uint64_t cookie;
982 uint64_t cookie_mask;
983 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700984 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700985 uint16_t idle_timeout;
986 uint16_t hard_timeout;
987 uint16_t priority;
988 uint32_t buffer_id;
989 of_port_no_t out_port;
990 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700991 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700992 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700993 of_match_t match;
994 list(of_instruction_t) instructions;
995};
996
Rich Lanee9c37db2013-06-21 18:30:24 -0700997struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700998 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700999 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001000 uint16_t length;
1001 uint32_t xid;
1002 uint64_t cookie;
1003 uint64_t cookie_mask;
1004 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001005 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001006 uint16_t idle_timeout;
1007 uint16_t hard_timeout;
1008 uint16_t priority;
1009 uint32_t buffer_id;
1010 of_port_no_t out_port;
1011 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001012 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001013 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001014 of_match_t match;
1015 list(of_instruction_t) instructions;
1016};
1017
Rich Lanee9c37db2013-06-21 18:30:24 -07001018struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001019 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001020 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001021 uint16_t length;
1022 uint32_t xid;
1023 uint64_t cookie;
1024 uint64_t cookie_mask;
1025 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001026 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001027 uint16_t idle_timeout;
1028 uint16_t hard_timeout;
1029 uint16_t priority;
1030 uint32_t buffer_id;
1031 of_port_no_t out_port;
1032 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001033 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001034 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001035 of_match_t match;
1036 list(of_instruction_t) instructions;
1037};
1038
Rich Lanee9c37db2013-06-21 18:30:24 -07001039struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001040 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001041 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001042 uint16_t length;
1043 uint32_t xid;
1044 uint64_t cookie;
1045 uint64_t cookie_mask;
1046 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001047 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001048 uint16_t idle_timeout;
1049 uint16_t hard_timeout;
1050 uint16_t priority;
1051 uint32_t buffer_id;
1052 of_port_no_t out_port;
1053 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001054 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001055 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001056 of_match_t match;
1057 list(of_instruction_t) instructions;
1058};
1059
Rich Lane68ae4d72013-05-09 10:55:19 -07001060struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -07001061 uint16_t len;
1062 uint16_t weight;
1063 of_port_no_t watch_port;
1064 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001065 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001066 list(of_action_t) actions;
1067};
1068
Rich Lanee9c37db2013-06-21 18:30:24 -07001069struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001070 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001071 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001072 uint16_t length;
1073 uint32_t xid;
Andreas Wundsam5812cf32013-11-15 13:51:24 -08001074 enum ofp_group_mod_command command == ?;
1075 enum ofp_group_type group_type;
1076 pad(1);
1077 uint32_t group_id;
1078 list(of_bucket_t) buckets;
1079};
1080
1081struct of_group_add : of_group_mod {
1082 uint8_t version;
1083 uint8_t type == 15;
1084 uint16_t length;
1085 uint32_t xid;
1086 enum ofp_group_mod_command command == 0;
1087 enum ofp_group_type group_type;
1088 pad(1);
1089 uint32_t group_id;
1090 list(of_bucket_t) buckets;
1091};
1092
1093struct of_group_modify : of_group_mod {
1094 uint8_t version;
1095 uint8_t type == 15;
1096 uint16_t length;
1097 uint32_t xid;
1098 enum ofp_group_mod_command command == 1;
1099 enum ofp_group_type group_type;
1100 pad(1);
1101 uint32_t group_id;
1102 list(of_bucket_t) buckets;
1103};
1104
1105struct of_group_delete : of_group_mod {
1106 uint8_t version;
1107 uint8_t type == 15;
1108 uint16_t length;
1109 uint32_t xid;
1110 enum ofp_group_mod_command command == 2;
1111 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001112 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001113 uint32_t group_id;
1114 list(of_bucket_t) buckets;
1115};
1116
Rich Lanee9c37db2013-06-21 18:30:24 -07001117struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001118 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001119 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001120 uint16_t length;
1121 uint32_t xid;
1122 uint32_t buffer_id;
1123 of_port_no_t in_port;
1124 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001125 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001126 list(of_action_t) actions;
1127 of_octets_t data;
1128};
1129
Rich Lanee9c37db2013-06-21 18:30:24 -07001130struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001131 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001132 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001133 uint16_t length;
1134 uint32_t xid;
1135 uint32_t buffer_id;
1136 uint16_t total_len;
1137 uint8_t reason;
1138 uint8_t table_id;
1139 uint64_t cookie;
1140 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001141 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001142 of_octets_t data; /* FIXME: Ensure total_len gets updated */
1143};
1144
Rich Lanee9c37db2013-06-21 18:30:24 -07001145struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001146 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001147 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001148 uint16_t length;
1149 uint32_t xid;
1150 uint64_t cookie;
1151 uint16_t priority;
1152 uint8_t reason;
1153 uint8_t table_id;
1154 uint32_t duration_sec;
1155 uint32_t duration_nsec;
1156 uint16_t idle_timeout;
1157 uint16_t hard_timeout;
1158 uint64_t packet_count;
1159 uint64_t byte_count;
1160 of_match_t match;
1161};
1162
Rich Lane68ae4d72013-05-09 10:55:19 -07001163struct of_meter_band {
Andreas Wundsam9ba65362013-08-02 19:14:42 -07001164 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001165 uint16_t len;
1166// uint32_t rate; // These are excluded b/c this is the header
1167// uint32_t burst_size; // These are excluded b/c this is the header
1168};
1169
Rich Lanee9c37db2013-06-21 18:30:24 -07001170struct of_meter_band_drop : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001171 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001172 uint16_t len;
1173 uint32_t rate;
1174 uint32_t burst_size;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001175 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001176};
1177
Rich Lanee9c37db2013-06-21 18:30:24 -07001178struct of_meter_band_dscp_remark : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001179 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001180 uint16_t len;
1181 uint32_t rate;
1182 uint32_t burst_size;
1183 uint8_t prec_level;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001184 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001185};
1186
Rich Lanee9c37db2013-06-21 18:30:24 -07001187struct of_meter_band_experimenter : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001188 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001189 uint16_t len;
1190 uint32_t rate;
1191 uint32_t burst_size;
1192 uint32_t experimenter;
1193};
1194
Rich Lanee9c37db2013-06-21 18:30:24 -07001195struct of_meter_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001196 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001197 uint8_t type == 29;
Rich Lanea06d0c32013-03-25 08:52:03 -07001198 uint16_t length;
1199 uint32_t xid;
1200 uint16_t command;
1201 uint16_t flags;
1202 uint32_t meter_id;
1203 list(of_meter_band_t) meters;
1204};
1205
Rich Lanee9c37db2013-06-21 18:30:24 -07001206struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001207 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001208 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001209 uint16_t length;
1210 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001211 uint16_t err_type == ?;
1212};
1213
1214struct of_hello_failed_error_msg : of_error_msg {
1215 uint8_t version;
1216 uint8_t type == 1;
1217 uint16_t length;
1218 uint32_t xid;
1219 uint16_t err_type == 0;
1220 enum ofp_hello_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001221 of_octets_t data;
1222};
1223
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001224struct of_bad_request_error_msg : of_error_msg {
1225 uint8_t version;
1226 uint8_t type == 1;
1227 uint16_t length;
1228 uint32_t xid;
1229 uint16_t err_type == 1;
1230 enum ofp_bad_request_code code;
1231 of_octets_t data;
1232};
1233
1234struct of_bad_action_error_msg : of_error_msg {
1235 uint8_t version;
1236 uint8_t type == 1;
1237 uint16_t length;
1238 uint32_t xid;
1239 uint16_t err_type == 2;
1240 enum ofp_bad_action_code code;
1241 of_octets_t data;
1242};
1243
1244struct of_bad_instruction_error_msg : of_error_msg {
1245 uint8_t version;
1246 uint8_t type == 1;
1247 uint16_t length;
1248 uint32_t xid;
1249 uint16_t err_type == 3;
1250 enum ofp_bad_instruction_code code;
1251 of_octets_t data;
1252};
1253
1254struct of_bad_match_error_msg : of_error_msg {
1255 uint8_t version;
1256 uint8_t type == 1;
1257 uint16_t length;
1258 uint32_t xid;
1259 uint16_t err_type == 4;
1260 enum ofp_bad_match_code code;
1261 of_octets_t data;
1262};
1263
1264struct of_flow_mod_failed_error_msg : of_error_msg {
1265 uint8_t version;
1266 uint8_t type == 1;
1267 uint16_t length;
1268 uint32_t xid;
1269 uint16_t err_type == 5;
1270 enum ofp_flow_mod_failed_code code;
1271 of_octets_t data;
1272};
1273
1274struct of_group_mod_failed_error_msg : of_error_msg {
1275 uint8_t version;
1276 uint8_t type == 1;
1277 uint16_t length;
1278 uint32_t xid;
1279 uint16_t err_type == 6;
1280 enum ofp_group_mod_failed_code code;
1281 of_octets_t data;
1282};
1283
1284struct of_port_mod_failed_error_msg : of_error_msg {
1285 uint8_t version;
1286 uint8_t type == 1;
1287 uint16_t length;
1288 uint32_t xid;
1289 uint16_t err_type == 7;
1290 enum ofp_port_mod_failed_code code;
1291 of_octets_t data;
1292};
1293
1294struct of_table_mod_failed_error_msg : of_error_msg {
1295 uint8_t version;
1296 uint8_t type == 1;
1297 uint16_t length;
1298 uint32_t xid;
1299 uint16_t err_type == 8;
1300 enum ofp_table_mod_failed_code code;
1301 of_octets_t data;
1302};
1303
1304struct of_queue_op_failed_error_msg : of_error_msg {
1305 uint8_t version;
1306 uint8_t type == 1;
1307 uint16_t length;
1308 uint32_t xid;
1309 uint16_t err_type == 9;
1310 enum ofp_queue_op_failed_code code;
1311 of_octets_t data;
1312};
1313
1314struct of_switch_config_failed_error_msg : of_error_msg {
1315 uint8_t version;
1316 uint8_t type == 1;
1317 uint16_t length;
1318 uint32_t xid;
1319 uint16_t err_type == 10;
1320 enum ofp_switch_config_failed_code code;
1321 of_octets_t data;
1322};
1323
1324struct of_role_request_failed_error_msg : of_error_msg {
1325 uint8_t version;
1326 uint8_t type == 1;
1327 uint16_t length;
1328 uint32_t xid;
1329 uint16_t err_type == 11;
1330 enum ofp_role_request_failed_code code;
1331 of_octets_t data;
1332};
1333
1334struct of_meter_mod_failed_error_msg : of_error_msg {
1335 uint8_t version;
1336 uint8_t type == 1;
1337 uint16_t length;
1338 uint32_t xid;
1339 uint16_t err_type == 12;
1340 enum ofp_meter_mod_failed_code code;
1341 of_octets_t data;
1342};
1343
1344struct of_table_features_failed_error_msg : of_error_msg {
1345 uint8_t version;
1346 uint8_t type == 1;
1347 uint16_t length;
1348 uint32_t xid;
1349 uint16_t err_type == 13;
1350 enum ofp_table_features_failed_code code;
1351 of_octets_t data;
1352};
1353
Andreas Wundsamcc8cd662013-11-15 13:52:06 -08001354struct of_experimenter_error_msg : of_error_msg {
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001355 uint8_t version;
1356 uint8_t type == 1;
1357 uint16_t length;
1358 uint32_t xid;
1359 uint16_t err_type == 0xffff;
1360 uint16_t subtype;
1361 uint32_t experimenter;
1362 of_octets_t data;
1363};
Rich Lanea06d0c32013-03-25 08:52:03 -07001364
1365// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1366
Rich Lane68ae4d72013-05-09 10:55:19 -07001367struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001368 uint16_t length;
1369 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001370 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001371 uint32_t duration_sec;
1372 uint32_t duration_nsec;
1373 uint16_t priority;
1374 uint16_t idle_timeout;
1375 uint16_t hard_timeout;
Rich Lane1a47c1c2013-08-28 15:27:00 -07001376 uint16_t flags;
1377 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001378 uint64_t cookie;
1379 uint64_t packet_count;
1380 uint64_t byte_count;
1381 of_match_t match;
1382 list(of_instruction_t) instructions;
1383};
1384
1385
Rich Lane68ae4d72013-05-09 10:55:19 -07001386struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001387 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001388 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001389 uint32_t active_count;
1390 uint64_t lookup_count;
1391 uint64_t matched_count;
1392};
1393
Rich Lane68ae4d72013-05-09 10:55:19 -07001394struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001395 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001396 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001397 uint64_t rx_packets;
1398 uint64_t tx_packets;
1399 uint64_t rx_bytes;
1400 uint64_t tx_bytes;
1401 uint64_t rx_dropped;
1402 uint64_t tx_dropped;
1403 uint64_t rx_errors;
1404 uint64_t tx_errors;
1405 uint64_t rx_frame_err;
1406 uint64_t rx_over_err;
1407 uint64_t rx_crc_err;
1408 uint64_t collisions;
1409 uint32_t duration_sec;
1410 uint32_t duration_nsec;
1411};
1412
Rich Lane68ae4d72013-05-09 10:55:19 -07001413struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001414 of_port_no_t port_no;
1415 uint32_t queue_id;
1416 uint64_t tx_bytes;
1417 uint64_t tx_packets;
1418 uint64_t tx_errors;
1419 uint32_t duration_sec;
1420 uint32_t duration_nsec;
1421};
1422
Rich Lane68ae4d72013-05-09 10:55:19 -07001423struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001424 uint64_t packet_count;
1425 uint64_t byte_count;
1426};
1427
Rich Lane68ae4d72013-05-09 10:55:19 -07001428struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001429 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001430 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001431 uint32_t group_id;
1432 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001433 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001434 uint64_t packet_count;
1435 uint64_t byte_count;
1436 uint32_t duration_sec;
1437 uint32_t duration_nsec;
1438 list(of_bucket_counter_t) bucket_stats;
1439};
1440
Rich Lane68ae4d72013-05-09 10:55:19 -07001441struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001442 uint16_t length;
Andreas Wundsam84603f02013-11-18 18:45:30 -08001443 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001444 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001445 uint32_t group_id;
1446 list(of_bucket_t) buckets;
1447};
1448
1449// STATS:
1450// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1451
Rich Lanee9c37db2013-06-21 18:30:24 -07001452struct of_stats_request : of_header {
1453 uint8_t version;
1454 uint8_t type == 18;
1455 uint16_t length;
1456 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001457 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001458 enum ofp_stats_request_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001459 pad(4);
1460};
1461
1462struct of_stats_reply : of_header {
1463 uint8_t version;
1464 uint8_t type == 19;
1465 uint16_t length;
1466 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001467 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001468 enum ofp_stats_reply_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001469 pad(4);
1470};
1471
1472struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001473 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001474 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001475 uint16_t length;
1476 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001477 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001478 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001479 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001480};
1481
Rich Lanee9c37db2013-06-21 18:30:24 -07001482struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001483 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001484 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001485 uint16_t length;
1486 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001487 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001488 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001489 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001490 of_desc_str_t mfr_desc;
1491 of_desc_str_t hw_desc;
1492 of_desc_str_t sw_desc;
1493 of_serial_num_t serial_num;
1494 of_desc_str_t dp_desc;
1495};
1496
Rich Lanee9c37db2013-06-21 18:30:24 -07001497struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001498 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001499 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001500 uint16_t length;
1501 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001502 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001503 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001504 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001505 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001506 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001507 of_port_no_t out_port;
1508 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001509 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001510 uint64_t cookie;
1511 uint64_t cookie_mask;
1512 of_match_t match;
1513};
1514
Rich Lanee9c37db2013-06-21 18:30:24 -07001515struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001516 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001517 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001518 uint16_t length;
1519 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001520 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001521 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001522 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001523 list(of_flow_stats_entry_t) entries;
1524};
1525
Rich Lanee9c37db2013-06-21 18:30:24 -07001526struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001527 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001528 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001529 uint16_t length;
1530 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001531 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001532 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001533 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001534 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001535 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001536 of_port_no_t out_port;
1537 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001538 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001539 uint64_t cookie;
1540 uint64_t cookie_mask;
1541 of_match_t match;
1542};
1543
Rich Lanee9c37db2013-06-21 18:30:24 -07001544struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001545 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001546 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001547 uint16_t length;
1548 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001549 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001550 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001551 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001552 uint64_t packet_count;
1553 uint64_t byte_count;
1554 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001555 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001556};
1557
Rich Lanee9c37db2013-06-21 18:30:24 -07001558struct of_table_stats_request : of_stats_request {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001559 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001560 uint8_t type == 18;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001561 uint16_t length;
1562 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001563 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001564 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001565 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001566};
1567
Rich Lanee9c37db2013-06-21 18:30:24 -07001568struct of_table_stats_reply : of_stats_reply {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001569 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001570 uint8_t type == 19;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001571 uint16_t length;
1572 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001573 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001574 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001575 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001576 list(of_table_stats_entry_t) entries;
1577};
1578
Rich Lane6d434332013-11-13 09:23:10 -08001579struct of_experimenter_stats_request : of_stats_request {
1580 uint8_t version;
1581 uint8_t type == 18;
1582 uint16_t length;
1583 uint32_t xid;
1584 uint16_t stats_type == 0xffff;
1585 enum ofp_stats_request_flags flags;
1586 pad(4);
1587 uint32_t experimenter == ?;
1588 uint32_t subtype;
1589};
1590
1591struct of_experimenter_stats_reply : of_stats_reply {
1592 uint8_t version;
1593 uint8_t type == 19;
1594 uint16_t length;
1595 uint32_t xid;
1596 uint16_t stats_type == 0xffff;
1597 enum ofp_stats_reply_flags flags;
1598 pad(4);
1599 uint32_t experimenter == ?;
1600 uint32_t subtype;
1601};
1602
Rich Lanea06d0c32013-03-25 08:52:03 -07001603// FIXME: These are padded to 8 byte align beyond the length indicated
1604
Rich Lane68ae4d72013-05-09 10:55:19 -07001605struct of_table_feature_prop {
Rich Lanea1b8f442013-10-01 22:05:22 -07001606 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001607 uint16_t length;
1608};
1609
Rich Lanee9c37db2013-06-21 18:30:24 -07001610struct of_table_feature_prop_instructions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001611 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001612 uint16_t length;
1613 // FIXME Check if instruction_t is right for ids here
1614 list(of_instruction_t) instruction_ids;
1615};
1616
Rich Lanee9c37db2013-06-21 18:30:24 -07001617struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001618 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001619 uint16_t length;
1620 list(of_instruction_t) instruction_ids;
1621};
1622
Rich Lanee9c37db2013-06-21 18:30:24 -07001623struct of_table_feature_prop_next_tables : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001624 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001625 uint16_t length;
1626 list(of_uint8_t) next_table_ids;
1627};
1628
Rich Lanee9c37db2013-06-21 18:30:24 -07001629struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001630 uint16_t type == 3;
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_write_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001636 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001637 uint16_t length;
1638 list(of_action_id_t) action_ids;
1639};
1640
Rich Lanee9c37db2013-06-21 18:30:24 -07001641struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001642 uint16_t type == 5;
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_apply_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001648 uint16_t type == 6;
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_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001654 uint16_t type == 7;
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_match : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001660 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001661 uint16_t length;
1662 list(of_uint32_t) oxm_ids;
1663};
1664
Rich Lanee9c37db2013-06-21 18:30:24 -07001665struct of_table_feature_prop_wildcards : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001666 uint16_t type == 10;
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_write_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001672 uint16_t type == 12;
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_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001678 uint16_t type == 13;
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_apply_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001684 uint16_t type == 14;
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_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001690 uint16_t type == 15;
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_experimenter : of_table_feature_prop {
Jonathan Stoutacb3e322014-02-13 13:23:16 -05001696 uint16_t type == 65534;
Rich Lanea06d0c32013-03-25 08:52:03 -07001697 uint16_t length;
1698 uint32_t experimenter;
1699 uint32_t subtype;
1700 of_octets_t experimenter_data;
1701};
1702
Jonathan Stoutaf15dee2014-02-13 14:22:26 -05001703struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
1704 uint16_t type == 65535;
1705 uint16_t length;
1706 uint32_t experimenter;
1707 uint32_t subtype;
1708 of_octets_t experimenter_data;
1709};
Rich Lanea06d0c32013-03-25 08:52:03 -07001710
Rich Lane68ae4d72013-05-09 10:55:19 -07001711struct of_table_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001712 uint16_t length;
1713 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001714 pad(5);
Rich Lanea06d0c32013-03-25 08:52:03 -07001715 of_table_name_t name;
1716 uint64_t metadata_match;
1717 uint64_t metadata_write;
1718 uint32_t config;
1719 uint32_t max_entries;
1720 list(of_table_feature_prop_t) properties;
1721};
1722
Rich Lane68ae4d72013-05-09 10:55:19 -07001723struct of_meter_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001724 uint32_t max_meter;
1725 uint32_t band_types;
1726 uint32_t capabilities;
1727 uint8_t max_bands;
1728 uint8_t max_color;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001729 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001730};
1731
Rich Lanee9c37db2013-06-21 18:30:24 -07001732struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001733 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001734 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001735 uint16_t length;
1736 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001737 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001738 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001739 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001740 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001741 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001742};
1743
Rich Lanee9c37db2013-06-21 18:30:24 -07001744struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001745 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001746 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001747 uint16_t length;
1748 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001749 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001750 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001751 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001752 list(of_port_stats_entry_t) entries;
1753};
1754
Rich Lanee9c37db2013-06-21 18:30:24 -07001755struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001756 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001757 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001758 uint16_t length;
1759 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001760 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001761 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001762 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001763 of_port_no_t port_no;
1764 uint32_t queue_id;
1765};
1766
Rich Lanee9c37db2013-06-21 18:30:24 -07001767struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001768 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001769 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001770 uint16_t length;
1771 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001772 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001773 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001774 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001775 list(of_queue_stats_entry_t) entries;
1776};
1777
Rich Lanee9c37db2013-06-21 18:30:24 -07001778struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001779 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001780 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001781 uint16_t length;
1782 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001783 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001784 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001785 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001786 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001787 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001788};
1789
Rich Lanee9c37db2013-06-21 18:30:24 -07001790struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001791 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001792 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001793 uint16_t length;
1794 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001795 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001796 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001797 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001798 list(of_group_stats_entry_t) entries;
1799};
1800
Rich Lanee9c37db2013-06-21 18:30:24 -07001801struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001802 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001803 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001804 uint16_t length;
1805 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001806 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001807 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001808 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001809};
1810
Rich Lanee9c37db2013-06-21 18:30:24 -07001811struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001812 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001813 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001814 uint16_t length;
1815 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001816 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001817 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001818 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001819 list(of_group_desc_stats_entry_t) entries;
1820};
1821
Rich Lanee9c37db2013-06-21 18:30:24 -07001822struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001823 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001824 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001825 uint16_t length;
1826 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001827 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001828 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001829 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001830};
1831
Rich Lanee9c37db2013-06-21 18:30:24 -07001832struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001833 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001834 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001835 uint16_t length;
1836 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001837 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001838 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001839 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001840 uint32_t types;
1841 uint32_t capabilities;
1842 uint32_t max_groups_all;
1843 uint32_t max_groups_select;
1844 uint32_t max_groups_indirect;
1845 uint32_t max_groups_ff;
1846 uint32_t actions_all;
1847 uint32_t actions_select;
1848 uint32_t actions_indirect;
1849 uint32_t actions_ff;
1850};
1851
Rich Lanee9c37db2013-06-21 18:30:24 -07001852struct of_meter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001853 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001854 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001855 uint16_t length;
1856 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001857 uint16_t stats_type == 9;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001858 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001859 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001860 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001861 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001862};
1863
Rich Lanee9c37db2013-06-21 18:30:24 -07001864struct of_meter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001865 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001866 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001867 uint16_t length;
1868 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001869 uint16_t stats_type == 9;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001870 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001871 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001872 list(of_meter_stats_t) entries;
1873};
1874
Rich Lanee9c37db2013-06-21 18:30:24 -07001875struct of_meter_config_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001876 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001877 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001878 uint16_t length;
1879 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001880 uint16_t stats_type == 10;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001881 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001882 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001883 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001884 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001885};
1886
Rich Lanee9c37db2013-06-21 18:30:24 -07001887struct of_meter_config_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001888 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001889 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001890 uint16_t length;
1891 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001892 uint16_t stats_type == 10;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001893 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001894 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001895 list(of_meter_band_t) entries;
1896};
1897
1898// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001899struct of_meter_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001900 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001901 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001902 uint16_t length;
1903 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001904 uint16_t stats_type == 11;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001905 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001906 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001907};
1908
1909// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001910struct of_meter_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001911 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001912 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001913 uint16_t length;
1914 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001915 uint16_t stats_type == 11;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001916 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001917 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001918 of_meter_features_t features;
1919};
1920
1921// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001922struct of_table_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001923 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001924 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001925 uint16_t length;
1926 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001927 uint16_t stats_type == 12;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001928 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001929 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001930 list(of_table_features_t) entries;
1931};
1932
1933// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001934struct of_table_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001935 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001936 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001937 uint16_t length;
1938 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001939 uint16_t stats_type == 12;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001940 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001941 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001942 list(of_table_features_t) entries;
1943};
1944
1945// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001946struct of_port_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001947 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001948 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001949 uint16_t length;
1950 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001951 uint16_t stats_type == 13;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001952 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001953 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001954};
1955
1956// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001957struct of_port_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001958 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001959 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001960 uint16_t length;
1961 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001962 uint16_t stats_type == 13;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001963 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001964 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001965 list(of_port_desc_t) entries;
1966};
1967
Rich Lane68ae4d72013-05-09 10:55:19 -07001968struct of_meter_band_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001969 uint64_t packet_band_count;
1970 uint64_t byte_band_count;
1971};
1972
Rich Lane68ae4d72013-05-09 10:55:19 -07001973struct of_meter_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001974 uint32_t meter_id;
1975 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001976 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001977 uint32_t flow_count;
1978 uint64_t packet_in_count;
1979 uint64_t byte_in_count;
1980 uint32_t duration_sec;
1981 uint32_t duration_nsec;
1982 list(of_meter_band_stats_t) band_stats;
1983};
1984
Rich Lane68ae4d72013-05-09 10:55:19 -07001985struct of_meter_config {
Rich Lanea06d0c32013-03-25 08:52:03 -07001986 uint16_t length;
1987 uint16_t flags;
1988 uint32_t meter_id;
1989 list(of_meter_band_t) entries;
1990};
1991
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001992struct of_experimenter_stats_header {
Rich Laneb25d07c2013-08-22 17:22:43 -07001993 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001994 uint32_t subtype;
1995};
1996
1997// END OF STATS OBJECTS
1998
Rich Lane68ae4d72013-05-09 10:55:19 -07001999struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07002000 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07002001 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002002 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002003};
2004
Rich Lanee9c37db2013-06-21 18:30:24 -07002005struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002006 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07002007 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002008 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002009 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002010 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002011};
2012
Rich Lanee9c37db2013-06-21 18:30:24 -07002013struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002014 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07002015 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002016 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002017 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002018 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002019};
2020
Rich Lanee9c37db2013-06-21 18:30:24 -07002021struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002022 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07002023 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002024 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07002025 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002026 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002027 of_octets_t data;
2028};
2029
Rich Lane68ae4d72013-05-09 10:55:19 -07002030struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07002031 uint32_t queue_id;
2032 of_port_no_t port;
2033 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002034 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002035 list(of_queue_prop_t) properties;
2036};
2037
Rich Lanee9c37db2013-06-21 18:30:24 -07002038struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002039 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002040 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07002041 uint16_t length;
2042 uint32_t xid;
2043 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002044 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002045};
2046
Rich Lanee9c37db2013-06-21 18:30:24 -07002047struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002048 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002049 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07002050 uint16_t length;
2051 uint32_t xid;
2052 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002053 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002054 list(of_packet_queue_t) queues;
2055};
2056
Rich Lanee9c37db2013-06-21 18:30:24 -07002057struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002058 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002059 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07002060 uint16_t length;
2061 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07002062 enum ofp_controller_role role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002063 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002064 uint64_t generation_id;
2065};
2066
Rich Lanee9c37db2013-06-21 18:30:24 -07002067struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002068 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002069 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07002070 uint16_t length;
2071 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07002072 enum ofp_controller_role role;
2073 pad(4);
2074 uint64_t generation_id;
Rich Lanea06d0c32013-03-25 08:52:03 -07002075};
2076
2077////////////////////////////////////////////////////////////////
2078// FIXME understand async; where do bitmasks live?
2079// Determine bitmap type for masks below.
2080// DOCUMENT masks where uint32_t[0] is interest for equal/master
2081// while uint32_t[1] is interest for slave
2082////////////////////////////////////////////////////////////////
2083
Rich Lanee9c37db2013-06-21 18:30:24 -07002084struct of_async_get_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002085 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002086 uint8_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -07002087 uint16_t length;
2088 uint32_t xid;
2089 uint32_t packet_in_mask_equal_master;
2090 uint32_t packet_in_mask_slave;
2091 uint32_t port_status_mask_equal_master;
2092 uint32_t port_status_mask_slave;
2093 uint32_t flow_removed_mask_equal_master;
2094 uint32_t flow_removed_mask_slave;
2095};
2096
Rich Lanee9c37db2013-06-21 18:30:24 -07002097struct of_async_get_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002098 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002099 uint8_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -07002100 uint16_t length;
2101 uint32_t xid;
2102 uint32_t packet_in_mask_equal_master;
2103 uint32_t packet_in_mask_slave;
2104 uint32_t port_status_mask_equal_master;
2105 uint32_t port_status_mask_slave;
2106 uint32_t flow_removed_mask_equal_master;
2107 uint32_t flow_removed_mask_slave;
2108};
2109
Rich Lanee9c37db2013-06-21 18:30:24 -07002110struct of_async_set : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002111 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002112 uint8_t type == 28;
Rich Lanea06d0c32013-03-25 08:52:03 -07002113 uint16_t length;
2114 uint32_t xid;
2115 uint32_t packet_in_mask_equal_master;
2116 uint32_t packet_in_mask_slave;
2117 uint32_t port_status_mask_equal_master;
2118 uint32_t port_status_mask_slave;
2119 uint32_t flow_removed_mask_equal_master;
2120 uint32_t flow_removed_mask_slave;
2121};