blob: f697c42c19fe8bff735fb875e93514e719df3f20 [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 Lane5d33a622013-04-08 17:33:11 -0700293};
294
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700295enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700296 OFPRR_IDLE_TIMEOUT = 0,
297 OFPRR_HARD_TIMEOUT = 1,
298 OFPRR_DELETE = 2,
299 OFPRR_GROUP_DELETE = 3,
300};
301
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700302enum ofp_meter(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700303 OFPM_MAX = 0xffff0000,
304 OFPM_SLOWPATH = 0xfffffffd,
305 OFPM_CONTROLLER = 0xfffffffe,
306 OFPM_ALL = 0xffffffff,
307};
308
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700309enum ofp_meter_band_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700310 OFPMBT_DROP = 0x1,
311 OFPMBT_DSCP_REMARK = 0x2,
312 OFPMBT_EXPERIMENTER = 0xffff,
313};
314
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700315enum ofp_meter_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700316 OFPMC_ADD = 0,
317 OFPMC_MODIFY = 1,
318 OFPMC_DELETE = 2,
319};
320
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700321enum ofp_meter_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700322 OFPMF_KBPS = 0x1,
323 OFPMF_PKTPS = 0x2,
324 OFPMF_BURST = 0x4,
325 OFPMF_STATS = 0x8,
326};
327
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700328enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700329 OFPET_HELLO_FAILED = 0,
330 OFPET_BAD_REQUEST = 1,
331 OFPET_BAD_ACTION = 2,
332 OFPET_BAD_INSTRUCTION = 3,
333 OFPET_BAD_MATCH = 4,
334 OFPET_FLOW_MOD_FAILED = 5,
335 OFPET_GROUP_MOD_FAILED = 6,
336 OFPET_PORT_MOD_FAILED = 7,
337 OFPET_TABLE_MOD_FAILED = 8,
338 OFPET_QUEUE_OP_FAILED = 9,
339 OFPET_SWITCH_CONFIG_FAILED = 10,
340 OFPET_ROLE_REQUEST_FAILED = 11,
341 OFPET_METER_MOD_FAILED = 12,
342 OFPET_TABLE_FEATURES_FAILED = 13,
343 OFPET_EXPERIMENTER = 0xffff,
344};
345
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700346enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700347 OFPHFC_INCOMPATIBLE = 0,
348 OFPHFC_EPERM = 1,
349};
350
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700351enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700352 OFPBRC_BAD_VERSION = 0,
353 OFPBRC_BAD_TYPE = 1,
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700354 OFPBRC_BAD_STAT = 2,
Rich Lane5d33a622013-04-08 17:33:11 -0700355 OFPBRC_BAD_EXPERIMENTER = 3,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700356 OFPBRC_BAD_EXPERIMENTER_TYPE = 4,
Rich Lane5d33a622013-04-08 17:33:11 -0700357 OFPBRC_EPERM = 5,
358 OFPBRC_BAD_LEN = 6,
359 OFPBRC_BUFFER_EMPTY = 7,
360 OFPBRC_BUFFER_UNKNOWN = 8,
361 OFPBRC_BAD_TABLE_ID = 9,
362 OFPBRC_IS_SLAVE = 10,
363 OFPBRC_BAD_PORT = 11,
364 OFPBRC_BAD_PACKET = 12,
365 OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13,
366};
367
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700368enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700369 OFPBAC_BAD_TYPE = 0,
370 OFPBAC_BAD_LEN = 1,
371 OFPBAC_BAD_EXPERIMENTER = 2,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700372 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700373 OFPBAC_BAD_OUT_PORT = 4,
374 OFPBAC_BAD_ARGUMENT = 5,
375 OFPBAC_EPERM = 6,
376 OFPBAC_TOO_MANY = 7,
377 OFPBAC_BAD_QUEUE = 8,
378 OFPBAC_BAD_OUT_GROUP = 9,
379 OFPBAC_MATCH_INCONSISTENT = 10,
380 OFPBAC_UNSUPPORTED_ORDER = 11,
381 OFPBAC_BAD_TAG = 12,
382 OFPBAC_BAD_SET_TYPE = 13,
383 OFPBAC_BAD_SET_LEN = 14,
384 OFPBAC_BAD_SET_ARGUMENT = 15,
385};
386
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700387enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700388 OFPBIC_UNKNOWN_INST = 0,
389 OFPBIC_UNSUP_INST = 1,
390 OFPBIC_BAD_TABLE_ID = 2,
391 OFPBIC_UNSUP_METADATA = 3,
392 OFPBIC_UNSUP_METADATA_MASK = 4,
393 OFPBIC_BAD_EXPERIMENTER = 5,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700394 OFPBIC_BAD_EXPERIMENTER_TYPE = 6,
Rich Lane5d33a622013-04-08 17:33:11 -0700395 OFPBIC_BAD_LEN = 7,
396 OFPBIC_EPERM = 8,
397};
398
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700399enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700400 OFPBMC_BAD_TYPE = 0,
401 OFPBMC_BAD_LEN = 1,
402 OFPBMC_BAD_TAG = 2,
403 OFPBMC_BAD_DL_ADDR_MASK = 3,
404 OFPBMC_BAD_NW_ADDR_MASK = 4,
405 OFPBMC_BAD_WILDCARDS = 5,
406 OFPBMC_BAD_FIELD = 6,
407 OFPBMC_BAD_VALUE = 7,
408 OFPBMC_BAD_MASK = 8,
409 OFPBMC_BAD_PREREQ = 9,
410 OFPBMC_DUP_FIELD = 10,
411 OFPBMC_EPERM = 11,
412};
413
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700414enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700415 OFPFMFC_UNKNOWN = 0,
416 OFPFMFC_TABLE_FULL = 1,
417 OFPFMFC_BAD_TABLE_ID = 2,
418 OFPFMFC_OVERLAP = 3,
419 OFPFMFC_EPERM = 4,
420 OFPFMFC_BAD_TIMEOUT = 5,
421 OFPFMFC_BAD_COMMAND = 6,
422 OFPFMFC_BAD_FLAGS = 7,
423};
424
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700425enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700426 OFPGMFC_GROUP_EXISTS = 0,
427 OFPGMFC_INVALID_GROUP = 1,
428 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
429 OFPGMFC_OUT_OF_GROUPS = 3,
430 OFPGMFC_OUT_OF_BUCKETS = 4,
431 OFPGMFC_CHAINING_UNSUPPORTED = 5,
432 OFPGMFC_WATCH_UNSUPPORTED = 6,
433 OFPGMFC_LOOP = 7,
434 OFPGMFC_UNKNOWN_GROUP = 8,
435 OFPGMFC_CHAINED_GROUP = 9,
436 OFPGMFC_BAD_TYPE = 10,
437 OFPGMFC_BAD_COMMAND = 11,
438 OFPGMFC_BAD_BUCKET = 12,
439 OFPGMFC_BAD_WATCH = 13,
440 OFPGMFC_EPERM = 14,
441};
442
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700443enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700444 OFPPMFC_BAD_PORT = 0,
445 OFPPMFC_BAD_HW_ADDR = 1,
446 OFPPMFC_BAD_CONFIG = 2,
447 OFPPMFC_BAD_ADVERTISE = 3,
448 OFPPMFC_EPERM = 4,
449};
450
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700451enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700452 OFPTMFC_BAD_TABLE = 0,
453 OFPTMFC_BAD_CONFIG = 1,
454 OFPTMFC_EPERM = 2,
455};
456
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700457enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700458 OFPQOFC_BAD_PORT = 0,
459 OFPQOFC_BAD_QUEUE = 1,
460 OFPQOFC_EPERM = 2,
461};
462
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700463enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700464 OFPSCFC_BAD_FLAGS = 0,
465 OFPSCFC_BAD_LEN = 1,
466 OFPSCFC_EPERM = 2,
467};
468
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700469enum ofp_role_request_failed_code(wire_type=uint16_t){
Rich Lane5d33a622013-04-08 17:33:11 -0700470 OFPRRFC_STALE = 0,
471 OFPRRFC_UNSUP = 1,
472 OFPRRFC_BAD_ROLE = 2,
473};
474
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700475enum ofp_meter_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700476 OFPMMFC_UNKNOWN = 0,
477 OFPMMFC_METER_EXISTS = 1,
478 OFPMMFC_INVALID_METER = 2,
479 OFPMMFC_UNKNOWN_METER = 3,
480 OFPMMFC_BAD_COMMAND = 4,
481 OFPMMFC_BAD_FLAGS = 5,
482 OFPMMFC_BAD_RATE = 6,
483 OFPMMFC_BAD_BURST = 7,
484 OFPMMFC_BAD_BAND = 8,
485 OFPMMFC_BAD_BAND_VALUE = 9,
486 OFPMMFC_OUT_OF_METERS = 10,
487 OFPMMFC_OUT_OF_BANDS = 11,
488};
489
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700490enum ofp_table_features_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700491 OFPTFFC_BAD_TABLE = 0,
492 OFPTFFC_BAD_METADATA = 1,
493 OFPTFFC_BAD_TYPE = 2,
494 OFPTFFC_BAD_LEN = 3,
495 OFPTFFC_BAD_ARGUMENT = 4,
496 OFPTFFC_EPERM = 5,
497};
498
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700499enum ofp_stats_type(wire_type=uint16_t) {
500 OFPST_DESC = 0,
501 OFPST_FLOW = 1,
502 OFPST_AGGREGATE = 2,
503 OFPST_TABLE = 3,
504 OFPST_PORT = 4,
505 OFPST_QUEUE = 5,
506 OFPST_GROUP = 6,
507 OFPST_GROUP_DESC = 7,
508 OFPST_GROUP_FEATURES = 8,
509 OFPST_METER = 9,
510 OFPST_METER_CONFIG = 10,
511 OFPST_METER_FEATURES = 11,
512 OFPST_TABLE_FEATURES = 12,
513 OFPST_PORT_DESC = 13,
514 OFPST_EXPERIMENTER = 0xffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700515};
516
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700517enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) {
518 OFPSF_REQ_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700519};
520
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700521enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
522 OFPSF_REPLY_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700523};
524
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700525enum ofp_table_feature_prop_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700526 OFPTFPT_INSTRUCTIONS = 0,
527 OFPTFPT_INSTRUCTIONS_MISS = 1,
528 OFPTFPT_NEXT_TABLES = 2,
529 OFPTFPT_NEXT_TABLES_MISS = 3,
530 OFPTFPT_WRITE_ACTIONS = 4,
531 OFPTFPT_WRITE_ACTIONS_MISS = 5,
532 OFPTFPT_APPLY_ACTIONS = 6,
533 OFPTFPT_APPLY_ACTIONS_MISS = 7,
534 OFPTFPT_MATCH = 8,
535 OFPTFPT_WILDCARDS = 0xa,
536 OFPTFPT_WRITE_SETFIELD = 0xc,
537 OFPTFPT_WRITE_SETFIELD_MISS = 0xd,
538 OFPTFPT_APPLY_SETFIELD = 0xe,
539 OFPTFPT_APPLY_SETFIELD_MISS = 0xf,
540 OFPTFPT_EXPERIMENTER = 0xfffe,
541 OFPTFPT_EXPERIMENTER_MISS = 0xffff,
542};
543
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700544enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700545 OFPGFC_SELECT_WEIGHT = 0x1,
546 OFPGFC_SELECT_LIVENESS = 0x2,
547 OFPGFC_CHAINING = 0x4,
548 OFPGFC_CHAINING_CHECKS = 0x8,
549};
550
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700551enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700552 OFPQT_MIN_RATE = 0x1,
553 OFPQT_MAX_RATE = 0x2,
554 OFPQT_EXPERIMENTER = 0xffff,
555};
556
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700557enum ofp_controller_role(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700558 OFPCR_ROLE_NOCHANGE = 0,
559 OFPCR_ROLE_EQUAL = 1,
560 OFPCR_ROLE_MASTER = 2,
561 OFPCR_ROLE_SLAVE = 3,
562};
563
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700564enum ofp_hello_elem_type(wire_type=uint16_t) {
Rich Lane0733cd62013-04-18 21:14:42 -0700565 OFPHET_VERSIONBITMAP = 1,
566};
567
Rich Lanee9c37db2013-06-21 18:30:24 -0700568/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700569struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700570 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700571 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700572 uint16_t length;
573 uint32_t xid;
574};
575
xinwuf08ef682013-12-05 18:29:20 -0800576struct of_uint64 {
577 uint64_t value;
578};
579
Rich Lanea06d0c32013-03-25 08:52:03 -0700580// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700581struct of_uint32 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700582 uint32_t value;
583};
584
585// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700586struct of_uint8 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700587 uint8_t value;
588};
589
Rich Lane68ae4d72013-05-09 10:55:19 -0700590struct of_hello_elem {
Andreas Wundsam70411bf2013-08-02 22:26:38 -0700591 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700592 uint16_t length;
593};
594
Rich Lanee9c37db2013-06-21 18:30:24 -0700595struct of_hello_elem_versionbitmap : of_hello_elem {
Rich Lane31b87142013-05-09 22:05:42 -0700596 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700597 uint16_t length;
598 list(of_uint32_t) bitmaps;
599};
600
Rich Lanee9c37db2013-06-21 18:30:24 -0700601struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700602 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700603 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700604 uint16_t length;
605 uint32_t xid;
606 list(of_hello_elem_t) elements;
607};
608
Rich Lanee9c37db2013-06-21 18:30:24 -0700609struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700610 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700611 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700612 uint16_t length;
613 uint32_t xid;
614 of_octets_t data;
615};
616
Rich Lanee9c37db2013-06-21 18:30:24 -0700617struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700618 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700619 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700620 uint16_t length;
621 uint32_t xid;
622 of_octets_t data;
623};
624
Rich Lanee9c37db2013-06-21 18:30:24 -0700625struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700626 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700627 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700628 uint16_t length;
629 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700630 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700631 uint32_t subtype;
632 of_octets_t data;
633};
634
Rich Lanee9c37db2013-06-21 18:30:24 -0700635struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700636 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700637 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700638 uint16_t length;
639 uint32_t xid;
640};
641
Rich Lanee9c37db2013-06-21 18:30:24 -0700642struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700643 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700644 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700645 uint16_t length;
646 uint32_t xid;
647};
648
Rich Lanee9c37db2013-06-21 18:30:24 -0700649struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700650 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700651 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700652 uint16_t length;
653 uint32_t xid;
654};
655
Rich Lanee9c37db2013-06-21 18:30:24 -0700656struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700657 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700658 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700659 uint16_t length;
660 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800661 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700662 uint16_t miss_send_len;
663};
664
Rich Lanee9c37db2013-06-21 18:30:24 -0700665struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700666 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700667 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700668 uint16_t length;
669 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800670 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700671 uint16_t miss_send_len;
672};
673
Rich Lanee9c37db2013-06-21 18:30:24 -0700674struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700675 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700676 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700677 uint16_t length;
678 uint32_t xid;
679 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700680 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700681 uint32_t config;
682};
683
Rich Lane68ae4d72013-05-09 10:55:19 -0700684struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700685 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700686 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700687 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700688 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700689 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700690 enum ofp_port_config config;
691 enum ofp_port_state state;
692 enum ofp_port_features curr;
693 enum ofp_port_features advertised;
694 enum ofp_port_features supported;
695 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700696 uint32_t curr_speed;
697 uint32_t max_speed;
698};
699
Rich Lanee9c37db2013-06-21 18:30:24 -0700700struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700701 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700702 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700703 uint16_t length;
704 uint32_t xid;
705};
706
Rich Lanee9c37db2013-06-21 18:30:24 -0700707struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700708 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700709 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700710 uint16_t length;
711 uint32_t xid;
712 uint64_t datapath_id;
713 uint32_t n_buffers;
714 uint8_t n_tables;
715 uint8_t auxiliary_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700716 pad(2);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700717 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700718 uint32_t reserved;
719};
720
Rich Lanee9c37db2013-06-21 18:30:24 -0700721struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700722 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700723 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700724 uint16_t length;
725 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700726 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700727 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700728 of_port_desc_t desc;
729};
730
Rich Lanee9c37db2013-06-21 18:30:24 -0700731struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700732 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700733 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700734 uint16_t length;
735 uint32_t xid;
736 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700737 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700738 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700739 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700740 uint32_t config;
741 uint32_t mask;
742 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700743 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700744};
745
746// FIXME Does this need to be v4?
Andreas Wundsam5da68512013-10-22 22:18:00 -0700747struct of_match_v3(align=8, length_includes_align=False) {
Rich Lane31b87142013-05-09 22:05:42 -0700748 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700749 uint16_t length;
750 list(of_oxm_t) oxm_list;
751};
752
Rich Lanea06d0c32013-03-25 08:52:03 -0700753// This looks like an action header, but is standalone. See
754// ofp_table_features_prop_actions
Rich Lane68ae4d72013-05-09 10:55:19 -0700755struct of_action_id {
Rich Lanea06d0c32013-03-25 08:52:03 -0700756 uint16_t type;
757 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700758 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700759};
760
Rich Lanee9c37db2013-06-21 18:30:24 -0700761struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700762 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700763 uint16_t len;
764 of_port_no_t port;
765 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700766 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700767};
768
Rich Lanee9c37db2013-06-21 18:30:24 -0700769struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700770 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700771 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700772 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700773};
774
Rich Lanee9c37db2013-06-21 18:30:24 -0700775struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700776 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700777 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700778 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700779};
780
Rich Lanee9c37db2013-06-21 18:30:24 -0700781struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700782 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700783 uint16_t len;
784 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700785 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700786};
787
Rich Lanee9c37db2013-06-21 18:30:24 -0700788struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700789 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700790 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700791 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700792};
793
Rich Lanee9c37db2013-06-21 18:30:24 -0700794struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700795 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700796 uint16_t len;
797 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700798 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700799};
800
Rich Lanee9c37db2013-06-21 18:30:24 -0700801struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700802 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700803 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700804 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700805};
806
Rich Lanee9c37db2013-06-21 18:30:24 -0700807struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700808 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700809 uint16_t len;
810 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700811 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700812};
813
Rich Lanee9c37db2013-06-21 18:30:24 -0700814struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700815 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700816 uint16_t len;
817 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700818 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700819};
820
Rich Lanee9c37db2013-06-21 18:30:24 -0700821struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700822 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700823 uint16_t len;
824 uint32_t queue_id;
825};
826
Rich Lanee9c37db2013-06-21 18:30:24 -0700827struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700828 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700829 uint16_t len;
830 uint32_t group_id;
831};
832
Rich Lanee9c37db2013-06-21 18:30:24 -0700833struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700834 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700835 uint16_t len;
836 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700837 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700838};
839
Rich Lanee9c37db2013-06-21 18:30:24 -0700840struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700841 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700842 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700843 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700844};
845
Andreas Wundsam5da68512013-10-22 22:18:00 -0700846struct of_action_set_field(align=8, length_includes_align=True) : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700847 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700848 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700849 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700850};
851
Andreas Wundsam5da68512013-10-22 22:18:00 -0700852struct of_action_experimenter(align=8, length_includes_align=True): of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700853 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700854 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700855 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700856 of_octets_t data;
857};
858
Rich Lanee9c37db2013-06-21 18:30:24 -0700859struct of_action_pop_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700860 uint16_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -0700861 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700862 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700863};
864
Rich Lanee9c37db2013-06-21 18:30:24 -0700865struct of_action_push_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700866 uint16_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -0700867 uint16_t len;
868 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700869 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700870};
871
Rich Lane68ae4d72013-05-09 10:55:19 -0700872struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700873 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700874 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700875 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700876};
877
Rich Lane68ae4d72013-05-09 10:55:19 -0700878struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700879 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700880 uint16_t len;
881};
882
Rich Lanee9c37db2013-06-21 18:30:24 -0700883struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700884 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700885 uint16_t len;
886 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700887 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700888};
889
Rich Lanee9c37db2013-06-21 18:30:24 -0700890struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700891 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700892 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700893 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700894 uint64_t metadata;
895 uint64_t metadata_mask;
896};
897
Rich Lanee9c37db2013-06-21 18:30:24 -0700898struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700899 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700900 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700901 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700902 list(of_action_t) actions;
903};
904
Rich Lanee9c37db2013-06-21 18:30:24 -0700905struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700906 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700907 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700908 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700909 list(of_action_t) actions;
910};
911
Rich Lanee9c37db2013-06-21 18:30:24 -0700912struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700913 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700914 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700915 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700916};
917
Rich Lanee9c37db2013-06-21 18:30:24 -0700918struct of_instruction_meter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700919 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700920 uint16_t len;
921 uint32_t meter_id;
922};
923
Rich Lanee9c37db2013-06-21 18:30:24 -0700924struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700925 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700926 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700927 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700928 of_octets_t data;
929};
930
Rich Lanee9c37db2013-06-21 18:30:24 -0700931struct of_flow_mod : of_header {
932 uint8_t version;
933 uint8_t type == 14;
934 uint16_t length;
935 uint32_t xid;
936 uint64_t cookie;
937 uint64_t cookie_mask;
938 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700939 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700940 uint16_t idle_timeout;
941 uint16_t hard_timeout;
942 uint16_t priority;
943 uint32_t buffer_id;
944 of_port_no_t out_port;
945 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700946 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700947 pad(2);
948 of_match_t match;
949 list(of_instruction_t) instructions;
950};
951
952struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700953 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700954 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700955 uint16_t length;
956 uint32_t xid;
957 uint64_t cookie;
958 uint64_t cookie_mask;
959 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700960 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700961 uint16_t idle_timeout;
962 uint16_t hard_timeout;
963 uint16_t priority;
964 uint32_t buffer_id;
965 of_port_no_t out_port;
966 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700967 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700968 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700969 of_match_t match;
970 list(of_instruction_t) instructions;
971};
972
Rich Lanee9c37db2013-06-21 18:30:24 -0700973struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700974 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700975 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700976 uint16_t length;
977 uint32_t xid;
978 uint64_t cookie;
979 uint64_t cookie_mask;
980 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700981 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700982 uint16_t idle_timeout;
983 uint16_t hard_timeout;
984 uint16_t priority;
985 uint32_t buffer_id;
986 of_port_no_t out_port;
987 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700988 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700989 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700990 of_match_t match;
991 list(of_instruction_t) instructions;
992};
993
Rich Lanee9c37db2013-06-21 18:30:24 -0700994struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700995 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700996 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700997 uint16_t length;
998 uint32_t xid;
999 uint64_t cookie;
1000 uint64_t cookie_mask;
1001 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001002 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001003 uint16_t idle_timeout;
1004 uint16_t hard_timeout;
1005 uint16_t priority;
1006 uint32_t buffer_id;
1007 of_port_no_t out_port;
1008 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001009 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001010 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001011 of_match_t match;
1012 list(of_instruction_t) instructions;
1013};
1014
Rich Lanee9c37db2013-06-21 18:30:24 -07001015struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001016 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001017 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001018 uint16_t length;
1019 uint32_t xid;
1020 uint64_t cookie;
1021 uint64_t cookie_mask;
1022 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001023 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001024 uint16_t idle_timeout;
1025 uint16_t hard_timeout;
1026 uint16_t priority;
1027 uint32_t buffer_id;
1028 of_port_no_t out_port;
1029 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001030 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001031 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001032 of_match_t match;
1033 list(of_instruction_t) instructions;
1034};
1035
Rich Lanee9c37db2013-06-21 18:30:24 -07001036struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001037 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001038 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001039 uint16_t length;
1040 uint32_t xid;
1041 uint64_t cookie;
1042 uint64_t cookie_mask;
1043 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001044 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001045 uint16_t idle_timeout;
1046 uint16_t hard_timeout;
1047 uint16_t priority;
1048 uint32_t buffer_id;
1049 of_port_no_t out_port;
1050 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001051 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001052 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001053 of_match_t match;
1054 list(of_instruction_t) instructions;
1055};
1056
Rich Lane68ae4d72013-05-09 10:55:19 -07001057struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -07001058 uint16_t len;
1059 uint16_t weight;
1060 of_port_no_t watch_port;
1061 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001062 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001063 list(of_action_t) actions;
1064};
1065
Rich Lanee9c37db2013-06-21 18:30:24 -07001066struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001067 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001068 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001069 uint16_t length;
1070 uint32_t xid;
Andreas Wundsam5812cf32013-11-15 13:51:24 -08001071 enum ofp_group_mod_command command == ?;
1072 enum ofp_group_type group_type;
1073 pad(1);
1074 uint32_t group_id;
1075 list(of_bucket_t) buckets;
1076};
1077
1078struct of_group_add : of_group_mod {
1079 uint8_t version;
1080 uint8_t type == 15;
1081 uint16_t length;
1082 uint32_t xid;
1083 enum ofp_group_mod_command command == 0;
1084 enum ofp_group_type group_type;
1085 pad(1);
1086 uint32_t group_id;
1087 list(of_bucket_t) buckets;
1088};
1089
1090struct of_group_modify : of_group_mod {
1091 uint8_t version;
1092 uint8_t type == 15;
1093 uint16_t length;
1094 uint32_t xid;
1095 enum ofp_group_mod_command command == 1;
1096 enum ofp_group_type group_type;
1097 pad(1);
1098 uint32_t group_id;
1099 list(of_bucket_t) buckets;
1100};
1101
1102struct of_group_delete : of_group_mod {
1103 uint8_t version;
1104 uint8_t type == 15;
1105 uint16_t length;
1106 uint32_t xid;
1107 enum ofp_group_mod_command command == 2;
1108 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001109 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001110 uint32_t group_id;
1111 list(of_bucket_t) buckets;
1112};
1113
Rich Lanee9c37db2013-06-21 18:30:24 -07001114struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001115 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001116 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001117 uint16_t length;
1118 uint32_t xid;
1119 uint32_t buffer_id;
1120 of_port_no_t in_port;
1121 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001122 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001123 list(of_action_t) actions;
1124 of_octets_t data;
1125};
1126
Rich Lanee9c37db2013-06-21 18:30:24 -07001127struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001128 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001129 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001130 uint16_t length;
1131 uint32_t xid;
1132 uint32_t buffer_id;
1133 uint16_t total_len;
1134 uint8_t reason;
1135 uint8_t table_id;
1136 uint64_t cookie;
1137 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001138 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001139 of_octets_t data; /* FIXME: Ensure total_len gets updated */
1140};
1141
Rich Lanee9c37db2013-06-21 18:30:24 -07001142struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001143 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001144 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001145 uint16_t length;
1146 uint32_t xid;
1147 uint64_t cookie;
1148 uint16_t priority;
1149 uint8_t reason;
1150 uint8_t table_id;
1151 uint32_t duration_sec;
1152 uint32_t duration_nsec;
1153 uint16_t idle_timeout;
1154 uint16_t hard_timeout;
1155 uint64_t packet_count;
1156 uint64_t byte_count;
1157 of_match_t match;
1158};
1159
Rich Lane68ae4d72013-05-09 10:55:19 -07001160struct of_meter_band {
Andreas Wundsam9ba65362013-08-02 19:14:42 -07001161 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001162 uint16_t len;
1163// uint32_t rate; // These are excluded b/c this is the header
1164// uint32_t burst_size; // These are excluded b/c this is the header
1165};
1166
Rich Lanee9c37db2013-06-21 18:30:24 -07001167struct of_meter_band_drop : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001168 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001169 uint16_t len;
1170 uint32_t rate;
1171 uint32_t burst_size;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001172 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001173};
1174
Rich Lanee9c37db2013-06-21 18:30:24 -07001175struct of_meter_band_dscp_remark : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001176 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001177 uint16_t len;
1178 uint32_t rate;
1179 uint32_t burst_size;
1180 uint8_t prec_level;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001181 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001182};
1183
Rich Lanee9c37db2013-06-21 18:30:24 -07001184struct of_meter_band_experimenter : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001185 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001186 uint16_t len;
1187 uint32_t rate;
1188 uint32_t burst_size;
1189 uint32_t experimenter;
1190};
1191
Rich Lanee9c37db2013-06-21 18:30:24 -07001192struct of_meter_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001193 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001194 uint8_t type == 29;
Rich Lanea06d0c32013-03-25 08:52:03 -07001195 uint16_t length;
1196 uint32_t xid;
1197 uint16_t command;
1198 uint16_t flags;
1199 uint32_t meter_id;
1200 list(of_meter_band_t) meters;
1201};
1202
Rich Lanee9c37db2013-06-21 18:30:24 -07001203struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001204 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001205 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001206 uint16_t length;
1207 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001208 uint16_t err_type == ?;
1209};
1210
1211struct of_hello_failed_error_msg : of_error_msg {
1212 uint8_t version;
1213 uint8_t type == 1;
1214 uint16_t length;
1215 uint32_t xid;
1216 uint16_t err_type == 0;
1217 enum ofp_hello_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001218 of_octets_t data;
1219};
1220
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001221struct of_bad_request_error_msg : of_error_msg {
1222 uint8_t version;
1223 uint8_t type == 1;
1224 uint16_t length;
1225 uint32_t xid;
1226 uint16_t err_type == 1;
1227 enum ofp_bad_request_code code;
1228 of_octets_t data;
1229};
1230
1231struct of_bad_action_error_msg : of_error_msg {
1232 uint8_t version;
1233 uint8_t type == 1;
1234 uint16_t length;
1235 uint32_t xid;
1236 uint16_t err_type == 2;
1237 enum ofp_bad_action_code code;
1238 of_octets_t data;
1239};
1240
1241struct of_bad_instruction_error_msg : of_error_msg {
1242 uint8_t version;
1243 uint8_t type == 1;
1244 uint16_t length;
1245 uint32_t xid;
1246 uint16_t err_type == 3;
1247 enum ofp_bad_instruction_code code;
1248 of_octets_t data;
1249};
1250
1251struct of_bad_match_error_msg : of_error_msg {
1252 uint8_t version;
1253 uint8_t type == 1;
1254 uint16_t length;
1255 uint32_t xid;
1256 uint16_t err_type == 4;
1257 enum ofp_bad_match_code code;
1258 of_octets_t data;
1259};
1260
1261struct of_flow_mod_failed_error_msg : of_error_msg {
1262 uint8_t version;
1263 uint8_t type == 1;
1264 uint16_t length;
1265 uint32_t xid;
1266 uint16_t err_type == 5;
1267 enum ofp_flow_mod_failed_code code;
1268 of_octets_t data;
1269};
1270
1271struct of_group_mod_failed_error_msg : of_error_msg {
1272 uint8_t version;
1273 uint8_t type == 1;
1274 uint16_t length;
1275 uint32_t xid;
1276 uint16_t err_type == 6;
1277 enum ofp_group_mod_failed_code code;
1278 of_octets_t data;
1279};
1280
1281struct of_port_mod_failed_error_msg : of_error_msg {
1282 uint8_t version;
1283 uint8_t type == 1;
1284 uint16_t length;
1285 uint32_t xid;
1286 uint16_t err_type == 7;
1287 enum ofp_port_mod_failed_code code;
1288 of_octets_t data;
1289};
1290
1291struct of_table_mod_failed_error_msg : of_error_msg {
1292 uint8_t version;
1293 uint8_t type == 1;
1294 uint16_t length;
1295 uint32_t xid;
1296 uint16_t err_type == 8;
1297 enum ofp_table_mod_failed_code code;
1298 of_octets_t data;
1299};
1300
1301struct of_queue_op_failed_error_msg : of_error_msg {
1302 uint8_t version;
1303 uint8_t type == 1;
1304 uint16_t length;
1305 uint32_t xid;
1306 uint16_t err_type == 9;
1307 enum ofp_queue_op_failed_code code;
1308 of_octets_t data;
1309};
1310
1311struct of_switch_config_failed_error_msg : of_error_msg {
1312 uint8_t version;
1313 uint8_t type == 1;
1314 uint16_t length;
1315 uint32_t xid;
1316 uint16_t err_type == 10;
1317 enum ofp_switch_config_failed_code code;
1318 of_octets_t data;
1319};
1320
1321struct of_role_request_failed_error_msg : of_error_msg {
1322 uint8_t version;
1323 uint8_t type == 1;
1324 uint16_t length;
1325 uint32_t xid;
1326 uint16_t err_type == 11;
1327 enum ofp_role_request_failed_code code;
1328 of_octets_t data;
1329};
1330
1331struct of_meter_mod_failed_error_msg : of_error_msg {
1332 uint8_t version;
1333 uint8_t type == 1;
1334 uint16_t length;
1335 uint32_t xid;
1336 uint16_t err_type == 12;
1337 enum ofp_meter_mod_failed_code code;
1338 of_octets_t data;
1339};
1340
1341struct of_table_features_failed_error_msg : of_error_msg {
1342 uint8_t version;
1343 uint8_t type == 1;
1344 uint16_t length;
1345 uint32_t xid;
1346 uint16_t err_type == 13;
1347 enum ofp_table_features_failed_code code;
1348 of_octets_t data;
1349};
1350
Andreas Wundsamcc8cd662013-11-15 13:52:06 -08001351struct of_experimenter_error_msg : of_error_msg {
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001352 uint8_t version;
1353 uint8_t type == 1;
1354 uint16_t length;
1355 uint32_t xid;
1356 uint16_t err_type == 0xffff;
1357 uint16_t subtype;
1358 uint32_t experimenter;
1359 of_octets_t data;
1360};
Rich Lanea06d0c32013-03-25 08:52:03 -07001361
1362// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1363
Rich Lane68ae4d72013-05-09 10:55:19 -07001364struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001365 uint16_t length;
1366 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001367 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001368 uint32_t duration_sec;
1369 uint32_t duration_nsec;
1370 uint16_t priority;
1371 uint16_t idle_timeout;
1372 uint16_t hard_timeout;
Rich Lane1a47c1c2013-08-28 15:27:00 -07001373 uint16_t flags;
1374 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001375 uint64_t cookie;
1376 uint64_t packet_count;
1377 uint64_t byte_count;
1378 of_match_t match;
1379 list(of_instruction_t) instructions;
1380};
1381
1382
Rich Lane68ae4d72013-05-09 10:55:19 -07001383struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001384 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001385 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001386 uint32_t active_count;
1387 uint64_t lookup_count;
1388 uint64_t matched_count;
1389};
1390
Rich Lane68ae4d72013-05-09 10:55:19 -07001391struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001392 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001393 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001394 uint64_t rx_packets;
1395 uint64_t tx_packets;
1396 uint64_t rx_bytes;
1397 uint64_t tx_bytes;
1398 uint64_t rx_dropped;
1399 uint64_t tx_dropped;
1400 uint64_t rx_errors;
1401 uint64_t tx_errors;
1402 uint64_t rx_frame_err;
1403 uint64_t rx_over_err;
1404 uint64_t rx_crc_err;
1405 uint64_t collisions;
1406 uint32_t duration_sec;
1407 uint32_t duration_nsec;
1408};
1409
Rich Lane68ae4d72013-05-09 10:55:19 -07001410struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001411 of_port_no_t port_no;
1412 uint32_t queue_id;
1413 uint64_t tx_bytes;
1414 uint64_t tx_packets;
1415 uint64_t tx_errors;
1416 uint32_t duration_sec;
1417 uint32_t duration_nsec;
1418};
1419
Rich Lane68ae4d72013-05-09 10:55:19 -07001420struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001421 uint64_t packet_count;
1422 uint64_t byte_count;
1423};
1424
Rich Lane68ae4d72013-05-09 10:55:19 -07001425struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001426 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001427 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001428 uint32_t group_id;
1429 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001430 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001431 uint64_t packet_count;
1432 uint64_t byte_count;
1433 uint32_t duration_sec;
1434 uint32_t duration_nsec;
1435 list(of_bucket_counter_t) bucket_stats;
1436};
1437
Rich Lane68ae4d72013-05-09 10:55:19 -07001438struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001439 uint16_t length;
Andreas Wundsam84603f02013-11-18 18:45:30 -08001440 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001441 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001442 uint32_t group_id;
1443 list(of_bucket_t) buckets;
1444};
1445
1446// STATS:
1447// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1448
Rich Lanee9c37db2013-06-21 18:30:24 -07001449struct of_stats_request : of_header {
1450 uint8_t version;
1451 uint8_t type == 18;
1452 uint16_t length;
1453 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001454 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001455 enum ofp_stats_request_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001456 pad(4);
1457};
1458
1459struct of_stats_reply : of_header {
1460 uint8_t version;
1461 uint8_t type == 19;
1462 uint16_t length;
1463 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001464 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001465 enum ofp_stats_reply_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001466 pad(4);
1467};
1468
1469struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001470 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001471 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001472 uint16_t length;
1473 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001474 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001475 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001476 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001477};
1478
Rich Lanee9c37db2013-06-21 18:30:24 -07001479struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001480 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001481 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001482 uint16_t length;
1483 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001484 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001485 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001486 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001487 of_desc_str_t mfr_desc;
1488 of_desc_str_t hw_desc;
1489 of_desc_str_t sw_desc;
1490 of_serial_num_t serial_num;
1491 of_desc_str_t dp_desc;
1492};
1493
Rich Lanee9c37db2013-06-21 18:30:24 -07001494struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001495 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001496 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001497 uint16_t length;
1498 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001499 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001500 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001501 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001502 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001503 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001504 of_port_no_t out_port;
1505 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001506 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001507 uint64_t cookie;
1508 uint64_t cookie_mask;
1509 of_match_t match;
1510};
1511
Rich Lanee9c37db2013-06-21 18:30:24 -07001512struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001513 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001514 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001515 uint16_t length;
1516 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001517 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001518 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001519 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001520 list(of_flow_stats_entry_t) entries;
1521};
1522
Rich Lanee9c37db2013-06-21 18:30:24 -07001523struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001524 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001525 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001526 uint16_t length;
1527 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001528 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001529 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001530 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001531 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001532 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001533 of_port_no_t out_port;
1534 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001535 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001536 uint64_t cookie;
1537 uint64_t cookie_mask;
1538 of_match_t match;
1539};
1540
Rich Lanee9c37db2013-06-21 18:30:24 -07001541struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001542 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001543 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001544 uint16_t length;
1545 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001546 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001547 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001548 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001549 uint64_t packet_count;
1550 uint64_t byte_count;
1551 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001552 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001553};
1554
Rich Lanee9c37db2013-06-21 18:30:24 -07001555struct of_table_stats_request : of_stats_request {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001556 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001557 uint8_t type == 18;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001558 uint16_t length;
1559 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001560 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001561 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001562 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001563};
1564
Rich Lanee9c37db2013-06-21 18:30:24 -07001565struct of_table_stats_reply : of_stats_reply {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001566 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001567 uint8_t type == 19;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001568 uint16_t length;
1569 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001570 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001571 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001572 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001573 list(of_table_stats_entry_t) entries;
1574};
1575
Rich Lane6d434332013-11-13 09:23:10 -08001576struct of_experimenter_stats_request : of_stats_request {
1577 uint8_t version;
1578 uint8_t type == 18;
1579 uint16_t length;
1580 uint32_t xid;
1581 uint16_t stats_type == 0xffff;
1582 enum ofp_stats_request_flags flags;
1583 pad(4);
1584 uint32_t experimenter == ?;
1585 uint32_t subtype;
1586};
1587
1588struct of_experimenter_stats_reply : of_stats_reply {
1589 uint8_t version;
1590 uint8_t type == 19;
1591 uint16_t length;
1592 uint32_t xid;
1593 uint16_t stats_type == 0xffff;
1594 enum ofp_stats_reply_flags flags;
1595 pad(4);
1596 uint32_t experimenter == ?;
1597 uint32_t subtype;
1598};
1599
Rich Lanea06d0c32013-03-25 08:52:03 -07001600// FIXME: These are padded to 8 byte align beyond the length indicated
1601
Rich Lane68ae4d72013-05-09 10:55:19 -07001602struct of_table_feature_prop {
Rich Lanea1b8f442013-10-01 22:05:22 -07001603 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001604 uint16_t length;
1605};
1606
Rich Lanee9c37db2013-06-21 18:30:24 -07001607struct of_table_feature_prop_instructions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001608 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001609 uint16_t length;
1610 // FIXME Check if instruction_t is right for ids here
1611 list(of_instruction_t) instruction_ids;
1612};
1613
Rich Lanee9c37db2013-06-21 18:30:24 -07001614struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001615 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001616 uint16_t length;
1617 list(of_instruction_t) instruction_ids;
1618};
1619
Rich Lanee9c37db2013-06-21 18:30:24 -07001620struct of_table_feature_prop_next_tables : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001621 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001622 uint16_t length;
1623 list(of_uint8_t) next_table_ids;
1624};
1625
Rich Lanee9c37db2013-06-21 18:30:24 -07001626struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001627 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001628 uint16_t length;
1629 list(of_uint8_t) next_table_ids;
1630};
1631
Rich Lanee9c37db2013-06-21 18:30:24 -07001632struct of_table_feature_prop_write_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001633 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001634 uint16_t length;
1635 list(of_action_id_t) action_ids;
1636};
1637
Rich Lanee9c37db2013-06-21 18:30:24 -07001638struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001639 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001640 uint16_t length;
1641 list(of_action_id_t) action_ids;
1642};
1643
Rich Lanee9c37db2013-06-21 18:30:24 -07001644struct of_table_feature_prop_apply_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001645 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001646 uint16_t length;
1647 list(of_action_id_t) action_ids;
1648};
1649
Rich Lanee9c37db2013-06-21 18:30:24 -07001650struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001651 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001652 uint16_t length;
1653 list(of_action_id_t) action_ids;
1654};
1655
Rich Lanee9c37db2013-06-21 18:30:24 -07001656struct of_table_feature_prop_match : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001657 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001658 uint16_t length;
1659 list(of_uint32_t) oxm_ids;
1660};
1661
Rich Lanee9c37db2013-06-21 18:30:24 -07001662struct of_table_feature_prop_wildcards : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001663 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001664 uint16_t length;
1665 list(of_uint32_t) oxm_ids;
1666};
1667
Rich Lanee9c37db2013-06-21 18:30:24 -07001668struct of_table_feature_prop_write_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001669 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001670 uint16_t length;
1671 list(of_uint32_t) oxm_ids;
1672};
1673
Rich Lanee9c37db2013-06-21 18:30:24 -07001674struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001675 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001676 uint16_t length;
1677 list(of_uint32_t) oxm_ids;
1678};
1679
Rich Lanee9c37db2013-06-21 18:30:24 -07001680struct of_table_feature_prop_apply_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001681 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001682 uint16_t length;
1683 list(of_uint32_t) oxm_ids;
1684};
1685
Rich Lanee9c37db2013-06-21 18:30:24 -07001686struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001687 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001688 uint16_t length;
1689 list(of_uint32_t) oxm_ids;
1690};
1691
Rich Lanee9c37db2013-06-21 18:30:24 -07001692struct of_table_feature_prop_experimenter : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001693 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001694 uint16_t length;
1695 uint32_t experimenter;
1696 uint32_t subtype;
1697 of_octets_t experimenter_data;
1698};
1699
1700// Not yet supported
Rich Lanee9c37db2013-06-21 18:30:24 -07001701// struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
Rich Lanea06d0c32013-03-25 08:52:03 -07001702// uint16_t type;
1703// uint16_t length;
1704// uint32_t experimenter;
1705// uint32_t subtype;
1706// of_octets_t experimenter_data;
1707// };
1708
Rich Lane68ae4d72013-05-09 10:55:19 -07001709struct of_table_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001710 uint16_t length;
1711 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001712 pad(5);
Rich Lanea06d0c32013-03-25 08:52:03 -07001713 of_table_name_t name;
1714 uint64_t metadata_match;
1715 uint64_t metadata_write;
1716 uint32_t config;
1717 uint32_t max_entries;
1718 list(of_table_feature_prop_t) properties;
1719};
1720
Rich Lane68ae4d72013-05-09 10:55:19 -07001721struct of_meter_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001722 uint32_t max_meter;
1723 uint32_t band_types;
1724 uint32_t capabilities;
1725 uint8_t max_bands;
1726 uint8_t max_color;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001727 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001728};
1729
Rich Lanee9c37db2013-06-21 18:30:24 -07001730struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001731 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001732 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001733 uint16_t length;
1734 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001735 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001736 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001737 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001738 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001739 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001740};
1741
Rich Lanee9c37db2013-06-21 18:30:24 -07001742struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001743 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001744 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001745 uint16_t length;
1746 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001747 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001748 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001749 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001750 list(of_port_stats_entry_t) entries;
1751};
1752
Rich Lanee9c37db2013-06-21 18:30:24 -07001753struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001754 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001755 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001756 uint16_t length;
1757 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001758 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001759 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001760 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001761 of_port_no_t port_no;
1762 uint32_t queue_id;
1763};
1764
Rich Lanee9c37db2013-06-21 18:30:24 -07001765struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001766 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001767 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001768 uint16_t length;
1769 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001770 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001771 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001772 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001773 list(of_queue_stats_entry_t) entries;
1774};
1775
Rich Lanee9c37db2013-06-21 18:30:24 -07001776struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001777 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001778 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001779 uint16_t length;
1780 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001781 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001782 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001783 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001784 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001785 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001786};
1787
Rich Lanee9c37db2013-06-21 18:30:24 -07001788struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001789 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001790 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001791 uint16_t length;
1792 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001793 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001794 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001795 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001796 list(of_group_stats_entry_t) entries;
1797};
1798
Rich Lanee9c37db2013-06-21 18:30:24 -07001799struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001800 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001801 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001802 uint16_t length;
1803 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001804 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001805 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001806 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001807};
1808
Rich Lanee9c37db2013-06-21 18:30:24 -07001809struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001810 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001811 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001812 uint16_t length;
1813 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001814 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001815 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001816 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001817 list(of_group_desc_stats_entry_t) entries;
1818};
1819
Rich Lanee9c37db2013-06-21 18:30:24 -07001820struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001821 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001822 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001823 uint16_t length;
1824 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001825 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001826 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001827 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001828};
1829
Rich Lanee9c37db2013-06-21 18:30:24 -07001830struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001831 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001832 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001833 uint16_t length;
1834 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001835 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001836 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001837 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001838 uint32_t types;
1839 uint32_t capabilities;
1840 uint32_t max_groups_all;
1841 uint32_t max_groups_select;
1842 uint32_t max_groups_indirect;
1843 uint32_t max_groups_ff;
1844 uint32_t actions_all;
1845 uint32_t actions_select;
1846 uint32_t actions_indirect;
1847 uint32_t actions_ff;
1848};
1849
Rich Lanee9c37db2013-06-21 18:30:24 -07001850struct of_meter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001851 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001852 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001853 uint16_t length;
1854 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001855 uint16_t stats_type == 9;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001856 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001857 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001858 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001859 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001860};
1861
Rich Lanee9c37db2013-06-21 18:30:24 -07001862struct of_meter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001863 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001864 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001865 uint16_t length;
1866 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001867 uint16_t stats_type == 9;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001868 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001869 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001870 list(of_meter_stats_t) entries;
1871};
1872
Rich Lanee9c37db2013-06-21 18:30:24 -07001873struct of_meter_config_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001874 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001875 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001876 uint16_t length;
1877 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001878 uint16_t stats_type == 10;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001879 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001880 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001881 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001882 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001883};
1884
Rich Lanee9c37db2013-06-21 18:30:24 -07001885struct of_meter_config_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001886 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001887 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001888 uint16_t length;
1889 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001890 uint16_t stats_type == 10;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001891 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001892 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001893 list(of_meter_band_t) entries;
1894};
1895
1896// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001897struct of_meter_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001898 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001899 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001900 uint16_t length;
1901 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001902 uint16_t stats_type == 11;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001903 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001904 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001905};
1906
1907// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001908struct of_meter_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001909 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001910 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001911 uint16_t length;
1912 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001913 uint16_t stats_type == 11;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001914 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001915 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001916 of_meter_features_t features;
1917};
1918
1919// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001920struct of_table_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001921 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001922 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001923 uint16_t length;
1924 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001925 uint16_t stats_type == 12;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001926 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001927 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001928 list(of_table_features_t) entries;
1929};
1930
1931// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001932struct of_table_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001933 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001934 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001935 uint16_t length;
1936 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001937 uint16_t stats_type == 12;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001938 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001939 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001940 list(of_table_features_t) entries;
1941};
1942
1943// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001944struct of_port_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001945 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001946 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001947 uint16_t length;
1948 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001949 uint16_t stats_type == 13;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001950 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001951 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001952};
1953
1954// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001955struct of_port_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001956 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001957 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001958 uint16_t length;
1959 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001960 uint16_t stats_type == 13;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001961 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001962 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001963 list(of_port_desc_t) entries;
1964};
1965
Rich Lane68ae4d72013-05-09 10:55:19 -07001966struct of_meter_band_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001967 uint64_t packet_band_count;
1968 uint64_t byte_band_count;
1969};
1970
Rich Lane68ae4d72013-05-09 10:55:19 -07001971struct of_meter_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001972 uint32_t meter_id;
1973 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001974 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001975 uint32_t flow_count;
1976 uint64_t packet_in_count;
1977 uint64_t byte_in_count;
1978 uint32_t duration_sec;
1979 uint32_t duration_nsec;
1980 list(of_meter_band_stats_t) band_stats;
1981};
1982
Rich Lane68ae4d72013-05-09 10:55:19 -07001983struct of_meter_config {
Rich Lanea06d0c32013-03-25 08:52:03 -07001984 uint16_t length;
1985 uint16_t flags;
1986 uint32_t meter_id;
1987 list(of_meter_band_t) entries;
1988};
1989
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001990struct of_experimenter_stats_header {
Rich Laneb25d07c2013-08-22 17:22:43 -07001991 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001992 uint32_t subtype;
1993};
1994
1995// END OF STATS OBJECTS
1996
Rich Lane68ae4d72013-05-09 10:55:19 -07001997struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001998 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001999 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002000 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002001};
2002
Rich Lanee9c37db2013-06-21 18:30:24 -07002003struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002004 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07002005 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002006 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002007 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002008 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002009};
2010
Rich Lanee9c37db2013-06-21 18:30:24 -07002011struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002012 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07002013 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002014 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002015 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002016 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002017};
2018
Rich Lanee9c37db2013-06-21 18:30:24 -07002019struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002020 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07002021 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002022 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07002023 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002024 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002025 of_octets_t data;
2026};
2027
Rich Lane68ae4d72013-05-09 10:55:19 -07002028struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07002029 uint32_t queue_id;
2030 of_port_no_t port;
2031 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002032 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002033 list(of_queue_prop_t) properties;
2034};
2035
Rich Lanee9c37db2013-06-21 18:30:24 -07002036struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002037 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002038 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07002039 uint16_t length;
2040 uint32_t xid;
2041 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002042 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002043};
2044
Rich Lanee9c37db2013-06-21 18:30:24 -07002045struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002046 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002047 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07002048 uint16_t length;
2049 uint32_t xid;
2050 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002051 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002052 list(of_packet_queue_t) queues;
2053};
2054
Rich Lanee9c37db2013-06-21 18:30:24 -07002055struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002056 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002057 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07002058 uint16_t length;
2059 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07002060 enum ofp_controller_role role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002061 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002062 uint64_t generation_id;
2063};
2064
Rich Lanee9c37db2013-06-21 18:30:24 -07002065struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002066 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002067 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07002068 uint16_t length;
2069 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07002070 enum ofp_controller_role role;
2071 pad(4);
2072 uint64_t generation_id;
Rich Lanea06d0c32013-03-25 08:52:03 -07002073};
2074
2075////////////////////////////////////////////////////////////////
2076// FIXME understand async; where do bitmasks live?
2077// Determine bitmap type for masks below.
2078// DOCUMENT masks where uint32_t[0] is interest for equal/master
2079// while uint32_t[1] is interest for slave
2080////////////////////////////////////////////////////////////////
2081
Rich Lanee9c37db2013-06-21 18:30:24 -07002082struct of_async_get_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002083 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002084 uint8_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -07002085 uint16_t length;
2086 uint32_t xid;
2087 uint32_t packet_in_mask_equal_master;
2088 uint32_t packet_in_mask_slave;
2089 uint32_t port_status_mask_equal_master;
2090 uint32_t port_status_mask_slave;
2091 uint32_t flow_removed_mask_equal_master;
2092 uint32_t flow_removed_mask_slave;
2093};
2094
Rich Lanee9c37db2013-06-21 18:30:24 -07002095struct of_async_get_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002096 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002097 uint8_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -07002098 uint16_t length;
2099 uint32_t xid;
2100 uint32_t packet_in_mask_equal_master;
2101 uint32_t packet_in_mask_slave;
2102 uint32_t port_status_mask_equal_master;
2103 uint32_t port_status_mask_slave;
2104 uint32_t flow_removed_mask_equal_master;
2105 uint32_t flow_removed_mask_slave;
2106};
2107
Rich Lanee9c37db2013-06-21 18:30:24 -07002108struct of_async_set : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002109 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002110 uint8_t type == 28;
Rich Lanea06d0c32013-03-25 08:52:03 -07002111 uint16_t length;
2112 uint32_t xid;
2113 uint32_t packet_in_mask_equal_master;
2114 uint32_t packet_in_mask_slave;
2115 uint32_t port_status_mask_equal_master;
2116 uint32_t port_status_mask_slave;
2117 uint32_t flow_removed_mask_equal_master;
2118 uint32_t flow_removed_mask_slave;
2119};