blob: bb85231c4b33b9fa853998888c269cb1d205d535 [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,
Rich Lane5d33a622013-04-08 17:33:11 -0700294};
295
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700296enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700297 OFPRR_IDLE_TIMEOUT = 0,
298 OFPRR_HARD_TIMEOUT = 1,
299 OFPRR_DELETE = 2,
300 OFPRR_GROUP_DELETE = 3,
301};
302
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700303enum ofp_meter(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700304 OFPM_MAX = 0xffff0000,
305 OFPM_SLOWPATH = 0xfffffffd,
306 OFPM_CONTROLLER = 0xfffffffe,
307 OFPM_ALL = 0xffffffff,
308};
309
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700310enum ofp_meter_band_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700311 OFPMBT_DROP = 0x1,
312 OFPMBT_DSCP_REMARK = 0x2,
313 OFPMBT_EXPERIMENTER = 0xffff,
314};
315
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700316enum ofp_meter_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700317 OFPMC_ADD = 0,
318 OFPMC_MODIFY = 1,
319 OFPMC_DELETE = 2,
320};
321
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700322enum ofp_meter_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700323 OFPMF_KBPS = 0x1,
324 OFPMF_PKTPS = 0x2,
325 OFPMF_BURST = 0x4,
326 OFPMF_STATS = 0x8,
327};
328
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700329enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700330 OFPET_HELLO_FAILED = 0,
331 OFPET_BAD_REQUEST = 1,
332 OFPET_BAD_ACTION = 2,
333 OFPET_BAD_INSTRUCTION = 3,
334 OFPET_BAD_MATCH = 4,
335 OFPET_FLOW_MOD_FAILED = 5,
336 OFPET_GROUP_MOD_FAILED = 6,
337 OFPET_PORT_MOD_FAILED = 7,
338 OFPET_TABLE_MOD_FAILED = 8,
339 OFPET_QUEUE_OP_FAILED = 9,
340 OFPET_SWITCH_CONFIG_FAILED = 10,
341 OFPET_ROLE_REQUEST_FAILED = 11,
342 OFPET_METER_MOD_FAILED = 12,
343 OFPET_TABLE_FEATURES_FAILED = 13,
344 OFPET_EXPERIMENTER = 0xffff,
345};
346
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700347enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700348 OFPHFC_INCOMPATIBLE = 0,
349 OFPHFC_EPERM = 1,
350};
351
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700352enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700353 OFPBRC_BAD_VERSION = 0,
354 OFPBRC_BAD_TYPE = 1,
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700355 OFPBRC_BAD_STAT = 2,
Rich Lane5d33a622013-04-08 17:33:11 -0700356 OFPBRC_BAD_EXPERIMENTER = 3,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700357 OFPBRC_BAD_EXPERIMENTER_TYPE = 4,
Rich Lane5d33a622013-04-08 17:33:11 -0700358 OFPBRC_EPERM = 5,
359 OFPBRC_BAD_LEN = 6,
360 OFPBRC_BUFFER_EMPTY = 7,
361 OFPBRC_BUFFER_UNKNOWN = 8,
362 OFPBRC_BAD_TABLE_ID = 9,
363 OFPBRC_IS_SLAVE = 10,
364 OFPBRC_BAD_PORT = 11,
365 OFPBRC_BAD_PACKET = 12,
366 OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13,
367};
368
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700369enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700370 OFPBAC_BAD_TYPE = 0,
371 OFPBAC_BAD_LEN = 1,
372 OFPBAC_BAD_EXPERIMENTER = 2,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700373 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700374 OFPBAC_BAD_OUT_PORT = 4,
375 OFPBAC_BAD_ARGUMENT = 5,
376 OFPBAC_EPERM = 6,
377 OFPBAC_TOO_MANY = 7,
378 OFPBAC_BAD_QUEUE = 8,
379 OFPBAC_BAD_OUT_GROUP = 9,
380 OFPBAC_MATCH_INCONSISTENT = 10,
381 OFPBAC_UNSUPPORTED_ORDER = 11,
382 OFPBAC_BAD_TAG = 12,
383 OFPBAC_BAD_SET_TYPE = 13,
384 OFPBAC_BAD_SET_LEN = 14,
385 OFPBAC_BAD_SET_ARGUMENT = 15,
386};
387
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700388enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700389 OFPBIC_UNKNOWN_INST = 0,
390 OFPBIC_UNSUP_INST = 1,
391 OFPBIC_BAD_TABLE_ID = 2,
392 OFPBIC_UNSUP_METADATA = 3,
393 OFPBIC_UNSUP_METADATA_MASK = 4,
394 OFPBIC_BAD_EXPERIMENTER = 5,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700395 OFPBIC_BAD_EXPERIMENTER_TYPE = 6,
Rich Lane5d33a622013-04-08 17:33:11 -0700396 OFPBIC_BAD_LEN = 7,
397 OFPBIC_EPERM = 8,
398};
399
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700400enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700401 OFPBMC_BAD_TYPE = 0,
402 OFPBMC_BAD_LEN = 1,
403 OFPBMC_BAD_TAG = 2,
404 OFPBMC_BAD_DL_ADDR_MASK = 3,
405 OFPBMC_BAD_NW_ADDR_MASK = 4,
406 OFPBMC_BAD_WILDCARDS = 5,
407 OFPBMC_BAD_FIELD = 6,
408 OFPBMC_BAD_VALUE = 7,
409 OFPBMC_BAD_MASK = 8,
410 OFPBMC_BAD_PREREQ = 9,
411 OFPBMC_DUP_FIELD = 10,
412 OFPBMC_EPERM = 11,
413};
414
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700415enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700416 OFPFMFC_UNKNOWN = 0,
417 OFPFMFC_TABLE_FULL = 1,
418 OFPFMFC_BAD_TABLE_ID = 2,
419 OFPFMFC_OVERLAP = 3,
420 OFPFMFC_EPERM = 4,
421 OFPFMFC_BAD_TIMEOUT = 5,
422 OFPFMFC_BAD_COMMAND = 6,
423 OFPFMFC_BAD_FLAGS = 7,
424};
425
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700426enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700427 OFPGMFC_GROUP_EXISTS = 0,
428 OFPGMFC_INVALID_GROUP = 1,
429 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
430 OFPGMFC_OUT_OF_GROUPS = 3,
431 OFPGMFC_OUT_OF_BUCKETS = 4,
432 OFPGMFC_CHAINING_UNSUPPORTED = 5,
433 OFPGMFC_WATCH_UNSUPPORTED = 6,
434 OFPGMFC_LOOP = 7,
435 OFPGMFC_UNKNOWN_GROUP = 8,
436 OFPGMFC_CHAINED_GROUP = 9,
437 OFPGMFC_BAD_TYPE = 10,
438 OFPGMFC_BAD_COMMAND = 11,
439 OFPGMFC_BAD_BUCKET = 12,
440 OFPGMFC_BAD_WATCH = 13,
441 OFPGMFC_EPERM = 14,
442};
443
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700444enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700445 OFPPMFC_BAD_PORT = 0,
446 OFPPMFC_BAD_HW_ADDR = 1,
447 OFPPMFC_BAD_CONFIG = 2,
448 OFPPMFC_BAD_ADVERTISE = 3,
449 OFPPMFC_EPERM = 4,
450};
451
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700452enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700453 OFPTMFC_BAD_TABLE = 0,
454 OFPTMFC_BAD_CONFIG = 1,
455 OFPTMFC_EPERM = 2,
456};
457
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700458enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700459 OFPQOFC_BAD_PORT = 0,
460 OFPQOFC_BAD_QUEUE = 1,
461 OFPQOFC_EPERM = 2,
462};
463
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700464enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700465 OFPSCFC_BAD_FLAGS = 0,
466 OFPSCFC_BAD_LEN = 1,
467 OFPSCFC_EPERM = 2,
468};
469
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700470enum ofp_role_request_failed_code(wire_type=uint16_t){
Rich Lane5d33a622013-04-08 17:33:11 -0700471 OFPRRFC_STALE = 0,
472 OFPRRFC_UNSUP = 1,
473 OFPRRFC_BAD_ROLE = 2,
474};
475
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700476enum ofp_meter_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700477 OFPMMFC_UNKNOWN = 0,
478 OFPMMFC_METER_EXISTS = 1,
479 OFPMMFC_INVALID_METER = 2,
480 OFPMMFC_UNKNOWN_METER = 3,
481 OFPMMFC_BAD_COMMAND = 4,
482 OFPMMFC_BAD_FLAGS = 5,
483 OFPMMFC_BAD_RATE = 6,
484 OFPMMFC_BAD_BURST = 7,
485 OFPMMFC_BAD_BAND = 8,
486 OFPMMFC_BAD_BAND_VALUE = 9,
487 OFPMMFC_OUT_OF_METERS = 10,
488 OFPMMFC_OUT_OF_BANDS = 11,
489};
490
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700491enum ofp_table_features_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700492 OFPTFFC_BAD_TABLE = 0,
493 OFPTFFC_BAD_METADATA = 1,
494 OFPTFFC_BAD_TYPE = 2,
495 OFPTFFC_BAD_LEN = 3,
496 OFPTFFC_BAD_ARGUMENT = 4,
497 OFPTFFC_EPERM = 5,
498};
499
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700500enum ofp_stats_type(wire_type=uint16_t) {
501 OFPST_DESC = 0,
502 OFPST_FLOW = 1,
503 OFPST_AGGREGATE = 2,
504 OFPST_TABLE = 3,
505 OFPST_PORT = 4,
506 OFPST_QUEUE = 5,
507 OFPST_GROUP = 6,
508 OFPST_GROUP_DESC = 7,
509 OFPST_GROUP_FEATURES = 8,
510 OFPST_METER = 9,
511 OFPST_METER_CONFIG = 10,
512 OFPST_METER_FEATURES = 11,
513 OFPST_TABLE_FEATURES = 12,
514 OFPST_PORT_DESC = 13,
515 OFPST_EXPERIMENTER = 0xffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700516};
517
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700518enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) {
519 OFPSF_REQ_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700520};
521
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700522enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
523 OFPSF_REPLY_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700524};
525
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700526enum ofp_table_feature_prop_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700527 OFPTFPT_INSTRUCTIONS = 0,
528 OFPTFPT_INSTRUCTIONS_MISS = 1,
529 OFPTFPT_NEXT_TABLES = 2,
530 OFPTFPT_NEXT_TABLES_MISS = 3,
531 OFPTFPT_WRITE_ACTIONS = 4,
532 OFPTFPT_WRITE_ACTIONS_MISS = 5,
533 OFPTFPT_APPLY_ACTIONS = 6,
534 OFPTFPT_APPLY_ACTIONS_MISS = 7,
535 OFPTFPT_MATCH = 8,
536 OFPTFPT_WILDCARDS = 0xa,
537 OFPTFPT_WRITE_SETFIELD = 0xc,
538 OFPTFPT_WRITE_SETFIELD_MISS = 0xd,
539 OFPTFPT_APPLY_SETFIELD = 0xe,
540 OFPTFPT_APPLY_SETFIELD_MISS = 0xf,
541 OFPTFPT_EXPERIMENTER = 0xfffe,
542 OFPTFPT_EXPERIMENTER_MISS = 0xffff,
543};
544
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700545enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700546 OFPGFC_SELECT_WEIGHT = 0x1,
547 OFPGFC_SELECT_LIVENESS = 0x2,
548 OFPGFC_CHAINING = 0x4,
549 OFPGFC_CHAINING_CHECKS = 0x8,
550};
551
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700552enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700553 OFPQT_MIN_RATE = 0x1,
554 OFPQT_MAX_RATE = 0x2,
555 OFPQT_EXPERIMENTER = 0xffff,
556};
557
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700558enum ofp_controller_role(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700559 OFPCR_ROLE_NOCHANGE = 0,
560 OFPCR_ROLE_EQUAL = 1,
561 OFPCR_ROLE_MASTER = 2,
562 OFPCR_ROLE_SLAVE = 3,
563};
564
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700565enum ofp_hello_elem_type(wire_type=uint16_t) {
Rich Lane0733cd62013-04-18 21:14:42 -0700566 OFPHET_VERSIONBITMAP = 1,
567};
568
Rich Lanee9c37db2013-06-21 18:30:24 -0700569/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700570struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700571 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700572 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700573 uint16_t length;
574 uint32_t xid;
575};
576
xinwuf08ef682013-12-05 18:29:20 -0800577struct of_uint64 {
578 uint64_t value;
579};
580
Rich Lanea06d0c32013-03-25 08:52:03 -0700581// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700582struct of_uint32 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700583 uint32_t value;
584};
585
586// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700587struct of_uint8 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700588 uint8_t value;
589};
590
Rich Lane68ae4d72013-05-09 10:55:19 -0700591struct of_hello_elem {
Andreas Wundsam70411bf2013-08-02 22:26:38 -0700592 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700593 uint16_t length;
594};
595
Rich Lanee9c37db2013-06-21 18:30:24 -0700596struct of_hello_elem_versionbitmap : of_hello_elem {
Rich Lane31b87142013-05-09 22:05:42 -0700597 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700598 uint16_t length;
599 list(of_uint32_t) bitmaps;
600};
601
Rich Lanee9c37db2013-06-21 18:30:24 -0700602struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700603 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700604 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700605 uint16_t length;
606 uint32_t xid;
607 list(of_hello_elem_t) elements;
608};
609
Rich Lanee9c37db2013-06-21 18:30:24 -0700610struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700611 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700612 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700613 uint16_t length;
614 uint32_t xid;
615 of_octets_t data;
616};
617
Rich Lanee9c37db2013-06-21 18:30:24 -0700618struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700619 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700620 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700621 uint16_t length;
622 uint32_t xid;
623 of_octets_t data;
624};
625
Rich Lanee9c37db2013-06-21 18:30:24 -0700626struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700627 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700628 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700629 uint16_t length;
630 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700631 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700632 uint32_t subtype;
633 of_octets_t data;
634};
635
Rich Lanee9c37db2013-06-21 18:30:24 -0700636struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700637 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700638 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700639 uint16_t length;
640 uint32_t xid;
641};
642
Rich Lanee9c37db2013-06-21 18:30:24 -0700643struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700644 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700645 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700646 uint16_t length;
647 uint32_t xid;
648};
649
Rich Lanee9c37db2013-06-21 18:30:24 -0700650struct of_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700651 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700652 uint8_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -0700653 uint16_t length;
654 uint32_t xid;
655};
656
Rich Lanee9c37db2013-06-21 18:30:24 -0700657struct of_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700658 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700659 uint8_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700660 uint16_t length;
661 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800662 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700663 uint16_t miss_send_len;
664};
665
Rich Lanee9c37db2013-06-21 18:30:24 -0700666struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700667 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700668 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700669 uint16_t length;
670 uint32_t xid;
Andreas Wundsam057540b2013-11-19 16:51:36 -0800671 enum ofp_config_flags flags;
Rich Lanea06d0c32013-03-25 08:52:03 -0700672 uint16_t miss_send_len;
673};
674
Rich Lanee9c37db2013-06-21 18:30:24 -0700675struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700676 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700677 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700678 uint16_t length;
679 uint32_t xid;
680 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700681 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700682 uint32_t config;
683};
684
Rich Lane68ae4d72013-05-09 10:55:19 -0700685struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700686 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700687 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700688 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700689 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700690 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700691 enum ofp_port_config config;
692 enum ofp_port_state state;
693 enum ofp_port_features curr;
694 enum ofp_port_features advertised;
695 enum ofp_port_features supported;
696 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700697 uint32_t curr_speed;
698 uint32_t max_speed;
699};
700
Rich Lanee9c37db2013-06-21 18:30:24 -0700701struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700702 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700703 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700704 uint16_t length;
705 uint32_t xid;
706};
707
Rich Lanee9c37db2013-06-21 18:30:24 -0700708struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700709 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700710 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700711 uint16_t length;
712 uint32_t xid;
713 uint64_t datapath_id;
714 uint32_t n_buffers;
715 uint8_t n_tables;
716 uint8_t auxiliary_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700717 pad(2);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700718 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700719 uint32_t reserved;
720};
721
Rich Lanee9c37db2013-06-21 18:30:24 -0700722struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700723 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700724 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700725 uint16_t length;
726 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700727 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700728 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700729 of_port_desc_t desc;
730};
731
Rich Lanee9c37db2013-06-21 18:30:24 -0700732struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700733 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700734 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700735 uint16_t length;
736 uint32_t xid;
737 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700738 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700739 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700740 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700741 uint32_t config;
742 uint32_t mask;
743 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700744 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700745};
746
747// FIXME Does this need to be v4?
Andreas Wundsam5da68512013-10-22 22:18:00 -0700748struct of_match_v3(align=8, length_includes_align=False) {
Rich Lane31b87142013-05-09 22:05:42 -0700749 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700750 uint16_t length;
751 list(of_oxm_t) oxm_list;
752};
753
Rich Lanea06d0c32013-03-25 08:52:03 -0700754// This looks like an action header, but is standalone. See
755// ofp_table_features_prop_actions
Rich Lane68ae4d72013-05-09 10:55:19 -0700756struct of_action_id {
Rich Lanea06d0c32013-03-25 08:52:03 -0700757 uint16_t type;
758 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700759 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700760};
761
Rich Lanee9c37db2013-06-21 18:30:24 -0700762struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700763 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700764 uint16_t len;
765 of_port_no_t port;
766 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700767 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700768};
769
Rich Lanee9c37db2013-06-21 18:30:24 -0700770struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700771 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700772 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700773 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700774};
775
Rich Lanee9c37db2013-06-21 18:30:24 -0700776struct of_action_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700777 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700778 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700779 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700780};
781
Rich Lanee9c37db2013-06-21 18:30:24 -0700782struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700783 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700784 uint16_t len;
785 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700786 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700787};
788
Rich Lanee9c37db2013-06-21 18:30:24 -0700789struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700790 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700791 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700792 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700793};
794
Rich Lanee9c37db2013-06-21 18:30:24 -0700795struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700796 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700797 uint16_t len;
798 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700799 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700800};
801
Rich Lanee9c37db2013-06-21 18:30:24 -0700802struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700803 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700804 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700805 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700806};
807
Rich Lanee9c37db2013-06-21 18:30:24 -0700808struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700809 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700810 uint16_t len;
811 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700812 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700813};
814
Rich Lanee9c37db2013-06-21 18:30:24 -0700815struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700816 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700817 uint16_t len;
818 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700819 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700820};
821
Rich Lanee9c37db2013-06-21 18:30:24 -0700822struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700823 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700824 uint16_t len;
825 uint32_t queue_id;
826};
827
Rich Lanee9c37db2013-06-21 18:30:24 -0700828struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700829 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700830 uint16_t len;
831 uint32_t group_id;
832};
833
Rich Lanee9c37db2013-06-21 18:30:24 -0700834struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700835 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700836 uint16_t len;
837 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700838 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700839};
840
Rich Lanee9c37db2013-06-21 18:30:24 -0700841struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700842 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700843 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700844 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700845};
846
Andreas Wundsam5da68512013-10-22 22:18:00 -0700847struct of_action_set_field(align=8, length_includes_align=True) : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700848 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700849 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700850 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700851};
852
Andreas Wundsam5da68512013-10-22 22:18:00 -0700853struct of_action_experimenter(align=8, length_includes_align=True): of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700854 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700855 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700856 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700857 of_octets_t data;
858};
859
Rich Lanee9c37db2013-06-21 18:30:24 -0700860struct of_action_pop_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700861 uint16_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -0700862 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700863 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700864};
865
Rich Lanee9c37db2013-06-21 18:30:24 -0700866struct of_action_push_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700867 uint16_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -0700868 uint16_t len;
869 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700870 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700871};
872
Rich Lane68ae4d72013-05-09 10:55:19 -0700873struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700874 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700875 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700876 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700877};
878
Rich Lane68ae4d72013-05-09 10:55:19 -0700879struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700880 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700881 uint16_t len;
882};
883
Rich Lanee9c37db2013-06-21 18:30:24 -0700884struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700885 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700886 uint16_t len;
887 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700888 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700889};
890
Rich Lanee9c37db2013-06-21 18:30:24 -0700891struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700892 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700893 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700894 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700895 uint64_t metadata;
896 uint64_t metadata_mask;
897};
898
Rich Lanee9c37db2013-06-21 18:30:24 -0700899struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700900 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700901 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700902 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700903 list(of_action_t) actions;
904};
905
Rich Lanee9c37db2013-06-21 18:30:24 -0700906struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700907 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700908 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700909 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700910 list(of_action_t) actions;
911};
912
Rich Lanee9c37db2013-06-21 18:30:24 -0700913struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700914 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700915 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700916 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700917};
918
Rich Lanee9c37db2013-06-21 18:30:24 -0700919struct of_instruction_meter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700920 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700921 uint16_t len;
922 uint32_t meter_id;
923};
924
Rich Lanee9c37db2013-06-21 18:30:24 -0700925struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700926 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700927 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700928 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700929 of_octets_t data;
930};
931
Rich Lanee9c37db2013-06-21 18:30:24 -0700932struct of_flow_mod : of_header {
933 uint8_t version;
934 uint8_t type == 14;
935 uint16_t length;
936 uint32_t xid;
937 uint64_t cookie;
938 uint64_t cookie_mask;
939 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700940 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700941 uint16_t idle_timeout;
942 uint16_t hard_timeout;
943 uint16_t priority;
944 uint32_t buffer_id;
945 of_port_no_t out_port;
946 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700947 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700948 pad(2);
949 of_match_t match;
950 list(of_instruction_t) instructions;
951};
952
953struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700954 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700955 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700956 uint16_t length;
957 uint32_t xid;
958 uint64_t cookie;
959 uint64_t cookie_mask;
960 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700961 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700962 uint16_t idle_timeout;
963 uint16_t hard_timeout;
964 uint16_t priority;
965 uint32_t buffer_id;
966 of_port_no_t out_port;
967 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700968 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700969 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700970 of_match_t match;
971 list(of_instruction_t) instructions;
972};
973
Rich Lanee9c37db2013-06-21 18:30:24 -0700974struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700975 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700976 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700977 uint16_t length;
978 uint32_t xid;
979 uint64_t cookie;
980 uint64_t cookie_mask;
981 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700982 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700983 uint16_t idle_timeout;
984 uint16_t hard_timeout;
985 uint16_t priority;
986 uint32_t buffer_id;
987 of_port_no_t out_port;
988 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700989 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700990 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700991 of_match_t match;
992 list(of_instruction_t) instructions;
993};
994
Rich Lanee9c37db2013-06-21 18:30:24 -0700995struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700996 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700997 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700998 uint16_t length;
999 uint32_t xid;
1000 uint64_t cookie;
1001 uint64_t cookie_mask;
1002 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001003 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001004 uint16_t idle_timeout;
1005 uint16_t hard_timeout;
1006 uint16_t priority;
1007 uint32_t buffer_id;
1008 of_port_no_t out_port;
1009 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001010 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001011 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001012 of_match_t match;
1013 list(of_instruction_t) instructions;
1014};
1015
Rich Lanee9c37db2013-06-21 18:30:24 -07001016struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001017 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001018 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001019 uint16_t length;
1020 uint32_t xid;
1021 uint64_t cookie;
1022 uint64_t cookie_mask;
1023 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001024 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001025 uint16_t idle_timeout;
1026 uint16_t hard_timeout;
1027 uint16_t priority;
1028 uint32_t buffer_id;
1029 of_port_no_t out_port;
1030 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001031 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001032 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001033 of_match_t match;
1034 list(of_instruction_t) instructions;
1035};
1036
Rich Lanee9c37db2013-06-21 18:30:24 -07001037struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001038 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001039 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001040 uint16_t length;
1041 uint32_t xid;
1042 uint64_t cookie;
1043 uint64_t cookie_mask;
1044 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001045 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001046 uint16_t idle_timeout;
1047 uint16_t hard_timeout;
1048 uint16_t priority;
1049 uint32_t buffer_id;
1050 of_port_no_t out_port;
1051 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001052 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001053 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001054 of_match_t match;
1055 list(of_instruction_t) instructions;
1056};
1057
Rich Lane68ae4d72013-05-09 10:55:19 -07001058struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -07001059 uint16_t len;
1060 uint16_t weight;
1061 of_port_no_t watch_port;
1062 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001063 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001064 list(of_action_t) actions;
1065};
1066
Rich Lanee9c37db2013-06-21 18:30:24 -07001067struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001068 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001069 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001070 uint16_t length;
1071 uint32_t xid;
Andreas Wundsam5812cf32013-11-15 13:51:24 -08001072 enum ofp_group_mod_command command == ?;
1073 enum ofp_group_type group_type;
1074 pad(1);
1075 uint32_t group_id;
1076 list(of_bucket_t) buckets;
1077};
1078
1079struct of_group_add : of_group_mod {
1080 uint8_t version;
1081 uint8_t type == 15;
1082 uint16_t length;
1083 uint32_t xid;
1084 enum ofp_group_mod_command command == 0;
1085 enum ofp_group_type group_type;
1086 pad(1);
1087 uint32_t group_id;
1088 list(of_bucket_t) buckets;
1089};
1090
1091struct of_group_modify : of_group_mod {
1092 uint8_t version;
1093 uint8_t type == 15;
1094 uint16_t length;
1095 uint32_t xid;
1096 enum ofp_group_mod_command command == 1;
1097 enum ofp_group_type group_type;
1098 pad(1);
1099 uint32_t group_id;
1100 list(of_bucket_t) buckets;
1101};
1102
1103struct of_group_delete : of_group_mod {
1104 uint8_t version;
1105 uint8_t type == 15;
1106 uint16_t length;
1107 uint32_t xid;
1108 enum ofp_group_mod_command command == 2;
1109 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001110 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001111 uint32_t group_id;
1112 list(of_bucket_t) buckets;
1113};
1114
Rich Lanee9c37db2013-06-21 18:30:24 -07001115struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001116 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001117 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001118 uint16_t length;
1119 uint32_t xid;
1120 uint32_t buffer_id;
1121 of_port_no_t in_port;
1122 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001123 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001124 list(of_action_t) actions;
1125 of_octets_t data;
1126};
1127
Rich Lanee9c37db2013-06-21 18:30:24 -07001128struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001129 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001130 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001131 uint16_t length;
1132 uint32_t xid;
1133 uint32_t buffer_id;
1134 uint16_t total_len;
1135 uint8_t reason;
1136 uint8_t table_id;
1137 uint64_t cookie;
1138 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001139 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001140 of_octets_t data; /* FIXME: Ensure total_len gets updated */
1141};
1142
Rich Lanee9c37db2013-06-21 18:30:24 -07001143struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001144 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001145 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001146 uint16_t length;
1147 uint32_t xid;
1148 uint64_t cookie;
1149 uint16_t priority;
1150 uint8_t reason;
1151 uint8_t table_id;
1152 uint32_t duration_sec;
1153 uint32_t duration_nsec;
1154 uint16_t idle_timeout;
1155 uint16_t hard_timeout;
1156 uint64_t packet_count;
1157 uint64_t byte_count;
1158 of_match_t match;
1159};
1160
Rich Lane68ae4d72013-05-09 10:55:19 -07001161struct of_meter_band {
Andreas Wundsam9ba65362013-08-02 19:14:42 -07001162 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001163 uint16_t len;
1164// uint32_t rate; // These are excluded b/c this is the header
1165// uint32_t burst_size; // These are excluded b/c this is the header
1166};
1167
Rich Lanee9c37db2013-06-21 18:30:24 -07001168struct of_meter_band_drop : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001169 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001170 uint16_t len;
1171 uint32_t rate;
1172 uint32_t burst_size;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001173 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001174};
1175
Rich Lanee9c37db2013-06-21 18:30:24 -07001176struct of_meter_band_dscp_remark : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001177 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001178 uint16_t len;
1179 uint32_t rate;
1180 uint32_t burst_size;
1181 uint8_t prec_level;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001182 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001183};
1184
Rich Lanee9c37db2013-06-21 18:30:24 -07001185struct of_meter_band_experimenter : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001186 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001187 uint16_t len;
1188 uint32_t rate;
1189 uint32_t burst_size;
1190 uint32_t experimenter;
1191};
1192
Rich Lanee9c37db2013-06-21 18:30:24 -07001193struct of_meter_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001194 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001195 uint8_t type == 29;
Rich Lanea06d0c32013-03-25 08:52:03 -07001196 uint16_t length;
1197 uint32_t xid;
1198 uint16_t command;
1199 uint16_t flags;
1200 uint32_t meter_id;
1201 list(of_meter_band_t) meters;
1202};
1203
Rich Lanee9c37db2013-06-21 18:30:24 -07001204struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001205 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001206 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001207 uint16_t length;
1208 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001209 uint16_t err_type == ?;
1210};
1211
1212struct of_hello_failed_error_msg : of_error_msg {
1213 uint8_t version;
1214 uint8_t type == 1;
1215 uint16_t length;
1216 uint32_t xid;
1217 uint16_t err_type == 0;
1218 enum ofp_hello_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001219 of_octets_t data;
1220};
1221
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001222struct of_bad_request_error_msg : of_error_msg {
1223 uint8_t version;
1224 uint8_t type == 1;
1225 uint16_t length;
1226 uint32_t xid;
1227 uint16_t err_type == 1;
1228 enum ofp_bad_request_code code;
1229 of_octets_t data;
1230};
1231
1232struct of_bad_action_error_msg : of_error_msg {
1233 uint8_t version;
1234 uint8_t type == 1;
1235 uint16_t length;
1236 uint32_t xid;
1237 uint16_t err_type == 2;
1238 enum ofp_bad_action_code code;
1239 of_octets_t data;
1240};
1241
1242struct of_bad_instruction_error_msg : of_error_msg {
1243 uint8_t version;
1244 uint8_t type == 1;
1245 uint16_t length;
1246 uint32_t xid;
1247 uint16_t err_type == 3;
1248 enum ofp_bad_instruction_code code;
1249 of_octets_t data;
1250};
1251
1252struct of_bad_match_error_msg : of_error_msg {
1253 uint8_t version;
1254 uint8_t type == 1;
1255 uint16_t length;
1256 uint32_t xid;
1257 uint16_t err_type == 4;
1258 enum ofp_bad_match_code code;
1259 of_octets_t data;
1260};
1261
1262struct of_flow_mod_failed_error_msg : of_error_msg {
1263 uint8_t version;
1264 uint8_t type == 1;
1265 uint16_t length;
1266 uint32_t xid;
1267 uint16_t err_type == 5;
1268 enum ofp_flow_mod_failed_code code;
1269 of_octets_t data;
1270};
1271
1272struct of_group_mod_failed_error_msg : of_error_msg {
1273 uint8_t version;
1274 uint8_t type == 1;
1275 uint16_t length;
1276 uint32_t xid;
1277 uint16_t err_type == 6;
1278 enum ofp_group_mod_failed_code code;
1279 of_octets_t data;
1280};
1281
1282struct of_port_mod_failed_error_msg : of_error_msg {
1283 uint8_t version;
1284 uint8_t type == 1;
1285 uint16_t length;
1286 uint32_t xid;
1287 uint16_t err_type == 7;
1288 enum ofp_port_mod_failed_code code;
1289 of_octets_t data;
1290};
1291
1292struct of_table_mod_failed_error_msg : of_error_msg {
1293 uint8_t version;
1294 uint8_t type == 1;
1295 uint16_t length;
1296 uint32_t xid;
1297 uint16_t err_type == 8;
1298 enum ofp_table_mod_failed_code code;
1299 of_octets_t data;
1300};
1301
1302struct of_queue_op_failed_error_msg : of_error_msg {
1303 uint8_t version;
1304 uint8_t type == 1;
1305 uint16_t length;
1306 uint32_t xid;
1307 uint16_t err_type == 9;
1308 enum ofp_queue_op_failed_code code;
1309 of_octets_t data;
1310};
1311
1312struct of_switch_config_failed_error_msg : of_error_msg {
1313 uint8_t version;
1314 uint8_t type == 1;
1315 uint16_t length;
1316 uint32_t xid;
1317 uint16_t err_type == 10;
1318 enum ofp_switch_config_failed_code code;
1319 of_octets_t data;
1320};
1321
1322struct of_role_request_failed_error_msg : of_error_msg {
1323 uint8_t version;
1324 uint8_t type == 1;
1325 uint16_t length;
1326 uint32_t xid;
1327 uint16_t err_type == 11;
1328 enum ofp_role_request_failed_code code;
1329 of_octets_t data;
1330};
1331
1332struct of_meter_mod_failed_error_msg : of_error_msg {
1333 uint8_t version;
1334 uint8_t type == 1;
1335 uint16_t length;
1336 uint32_t xid;
1337 uint16_t err_type == 12;
1338 enum ofp_meter_mod_failed_code code;
1339 of_octets_t data;
1340};
1341
1342struct of_table_features_failed_error_msg : of_error_msg {
1343 uint8_t version;
1344 uint8_t type == 1;
1345 uint16_t length;
1346 uint32_t xid;
1347 uint16_t err_type == 13;
1348 enum ofp_table_features_failed_code code;
1349 of_octets_t data;
1350};
1351
Andreas Wundsamcc8cd662013-11-15 13:52:06 -08001352struct of_experimenter_error_msg : of_error_msg {
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001353 uint8_t version;
1354 uint8_t type == 1;
1355 uint16_t length;
1356 uint32_t xid;
1357 uint16_t err_type == 0xffff;
1358 uint16_t subtype;
1359 uint32_t experimenter;
1360 of_octets_t data;
1361};
Rich Lanea06d0c32013-03-25 08:52:03 -07001362
1363// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1364
Rich Lane68ae4d72013-05-09 10:55:19 -07001365struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001366 uint16_t length;
1367 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001368 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001369 uint32_t duration_sec;
1370 uint32_t duration_nsec;
1371 uint16_t priority;
1372 uint16_t idle_timeout;
1373 uint16_t hard_timeout;
Rich Lane1a47c1c2013-08-28 15:27:00 -07001374 uint16_t flags;
1375 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001376 uint64_t cookie;
1377 uint64_t packet_count;
1378 uint64_t byte_count;
1379 of_match_t match;
1380 list(of_instruction_t) instructions;
1381};
1382
1383
Rich Lane68ae4d72013-05-09 10:55:19 -07001384struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001385 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001386 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001387 uint32_t active_count;
1388 uint64_t lookup_count;
1389 uint64_t matched_count;
1390};
1391
Rich Lane68ae4d72013-05-09 10:55:19 -07001392struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001393 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001394 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001395 uint64_t rx_packets;
1396 uint64_t tx_packets;
1397 uint64_t rx_bytes;
1398 uint64_t tx_bytes;
1399 uint64_t rx_dropped;
1400 uint64_t tx_dropped;
1401 uint64_t rx_errors;
1402 uint64_t tx_errors;
1403 uint64_t rx_frame_err;
1404 uint64_t rx_over_err;
1405 uint64_t rx_crc_err;
1406 uint64_t collisions;
1407 uint32_t duration_sec;
1408 uint32_t duration_nsec;
1409};
1410
Rich Lane68ae4d72013-05-09 10:55:19 -07001411struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001412 of_port_no_t port_no;
1413 uint32_t queue_id;
1414 uint64_t tx_bytes;
1415 uint64_t tx_packets;
1416 uint64_t tx_errors;
1417 uint32_t duration_sec;
1418 uint32_t duration_nsec;
1419};
1420
Rich Lane68ae4d72013-05-09 10:55:19 -07001421struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001422 uint64_t packet_count;
1423 uint64_t byte_count;
1424};
1425
Rich Lane68ae4d72013-05-09 10:55:19 -07001426struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001427 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001428 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001429 uint32_t group_id;
1430 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001431 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001432 uint64_t packet_count;
1433 uint64_t byte_count;
1434 uint32_t duration_sec;
1435 uint32_t duration_nsec;
1436 list(of_bucket_counter_t) bucket_stats;
1437};
1438
Rich Lane68ae4d72013-05-09 10:55:19 -07001439struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001440 uint16_t length;
Andreas Wundsam84603f02013-11-18 18:45:30 -08001441 enum ofp_group_type group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001442 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001443 uint32_t group_id;
1444 list(of_bucket_t) buckets;
1445};
1446
1447// STATS:
1448// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1449
Rich Lanee9c37db2013-06-21 18:30:24 -07001450struct of_stats_request : of_header {
1451 uint8_t version;
1452 uint8_t type == 18;
1453 uint16_t length;
1454 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001455 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001456 enum ofp_stats_request_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001457 pad(4);
1458};
1459
1460struct of_stats_reply : of_header {
1461 uint8_t version;
1462 uint8_t type == 19;
1463 uint16_t length;
1464 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001465 uint16_t stats_type == ?;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001466 enum ofp_stats_reply_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -07001467 pad(4);
1468};
1469
1470struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001471 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001472 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001473 uint16_t length;
1474 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001475 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001476 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001477 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001478};
1479
Rich Lanee9c37db2013-06-21 18:30:24 -07001480struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001481 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001482 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001483 uint16_t length;
1484 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001485 uint16_t stats_type == 0;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001486 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001487 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001488 of_desc_str_t mfr_desc;
1489 of_desc_str_t hw_desc;
1490 of_desc_str_t sw_desc;
1491 of_serial_num_t serial_num;
1492 of_desc_str_t dp_desc;
1493};
1494
Rich Lanee9c37db2013-06-21 18:30:24 -07001495struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001496 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001497 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001498 uint16_t length;
1499 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001500 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001501 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001502 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001503 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001504 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001505 of_port_no_t out_port;
1506 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001507 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001508 uint64_t cookie;
1509 uint64_t cookie_mask;
1510 of_match_t match;
1511};
1512
Rich Lanee9c37db2013-06-21 18:30:24 -07001513struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001514 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001515 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001516 uint16_t length;
1517 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001518 uint16_t stats_type == 1;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001519 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001520 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001521 list(of_flow_stats_entry_t) entries;
1522};
1523
Rich Lanee9c37db2013-06-21 18:30:24 -07001524struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001525 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001526 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001527 uint16_t length;
1528 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001529 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001530 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001531 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001532 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001533 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001534 of_port_no_t out_port;
1535 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001536 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001537 uint64_t cookie;
1538 uint64_t cookie_mask;
1539 of_match_t match;
1540};
1541
Rich Lanee9c37db2013-06-21 18:30:24 -07001542struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001543 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001544 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001545 uint16_t length;
1546 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001547 uint16_t stats_type == 2;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001548 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001549 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001550 uint64_t packet_count;
1551 uint64_t byte_count;
1552 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001553 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001554};
1555
Rich Lanee9c37db2013-06-21 18:30:24 -07001556struct of_table_stats_request : of_stats_request {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001557 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001558 uint8_t type == 18;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001559 uint16_t length;
1560 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001561 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001562 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001563 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001564};
1565
Rich Lanee9c37db2013-06-21 18:30:24 -07001566struct of_table_stats_reply : of_stats_reply {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001567 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001568 uint8_t type == 19;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001569 uint16_t length;
1570 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001571 uint16_t stats_type == 3;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001572 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001573 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001574 list(of_table_stats_entry_t) entries;
1575};
1576
Rich Lane6d434332013-11-13 09:23:10 -08001577struct of_experimenter_stats_request : of_stats_request {
1578 uint8_t version;
1579 uint8_t type == 18;
1580 uint16_t length;
1581 uint32_t xid;
1582 uint16_t stats_type == 0xffff;
1583 enum ofp_stats_request_flags flags;
1584 pad(4);
1585 uint32_t experimenter == ?;
1586 uint32_t subtype;
1587};
1588
1589struct of_experimenter_stats_reply : of_stats_reply {
1590 uint8_t version;
1591 uint8_t type == 19;
1592 uint16_t length;
1593 uint32_t xid;
1594 uint16_t stats_type == 0xffff;
1595 enum ofp_stats_reply_flags flags;
1596 pad(4);
1597 uint32_t experimenter == ?;
1598 uint32_t subtype;
1599};
1600
Rich Lanea06d0c32013-03-25 08:52:03 -07001601// FIXME: These are padded to 8 byte align beyond the length indicated
1602
Rich Lane68ae4d72013-05-09 10:55:19 -07001603struct of_table_feature_prop {
Rich Lanea1b8f442013-10-01 22:05:22 -07001604 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001605 uint16_t length;
1606};
1607
Rich Lanee9c37db2013-06-21 18:30:24 -07001608struct of_table_feature_prop_instructions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001609 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001610 uint16_t length;
1611 // FIXME Check if instruction_t is right for ids here
1612 list(of_instruction_t) instruction_ids;
1613};
1614
Rich Lanee9c37db2013-06-21 18:30:24 -07001615struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001616 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001617 uint16_t length;
1618 list(of_instruction_t) instruction_ids;
1619};
1620
Rich Lanee9c37db2013-06-21 18:30:24 -07001621struct of_table_feature_prop_next_tables : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001622 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001623 uint16_t length;
1624 list(of_uint8_t) next_table_ids;
1625};
1626
Rich Lanee9c37db2013-06-21 18:30:24 -07001627struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001628 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001629 uint16_t length;
1630 list(of_uint8_t) next_table_ids;
1631};
1632
Rich Lanee9c37db2013-06-21 18:30:24 -07001633struct of_table_feature_prop_write_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001634 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001635 uint16_t length;
1636 list(of_action_id_t) action_ids;
1637};
1638
Rich Lanee9c37db2013-06-21 18:30:24 -07001639struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001640 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001641 uint16_t length;
1642 list(of_action_id_t) action_ids;
1643};
1644
Rich Lanee9c37db2013-06-21 18:30:24 -07001645struct of_table_feature_prop_apply_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001646 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001647 uint16_t length;
1648 list(of_action_id_t) action_ids;
1649};
1650
Rich Lanee9c37db2013-06-21 18:30:24 -07001651struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001652 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001653 uint16_t length;
1654 list(of_action_id_t) action_ids;
1655};
1656
Rich Lanee9c37db2013-06-21 18:30:24 -07001657struct of_table_feature_prop_match : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001658 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001659 uint16_t length;
1660 list(of_uint32_t) oxm_ids;
1661};
1662
Rich Lanee9c37db2013-06-21 18:30:24 -07001663struct of_table_feature_prop_wildcards : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001664 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001665 uint16_t length;
1666 list(of_uint32_t) oxm_ids;
1667};
1668
Rich Lanee9c37db2013-06-21 18:30:24 -07001669struct of_table_feature_prop_write_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001670 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001671 uint16_t length;
1672 list(of_uint32_t) oxm_ids;
1673};
1674
Rich Lanee9c37db2013-06-21 18:30:24 -07001675struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001676 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001677 uint16_t length;
1678 list(of_uint32_t) oxm_ids;
1679};
1680
Rich Lanee9c37db2013-06-21 18:30:24 -07001681struct of_table_feature_prop_apply_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001682 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001683 uint16_t length;
1684 list(of_uint32_t) oxm_ids;
1685};
1686
Rich Lanee9c37db2013-06-21 18:30:24 -07001687struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001688 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001689 uint16_t length;
1690 list(of_uint32_t) oxm_ids;
1691};
1692
Rich Lanee9c37db2013-06-21 18:30:24 -07001693struct of_table_feature_prop_experimenter : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001694 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001695 uint16_t length;
1696 uint32_t experimenter;
1697 uint32_t subtype;
1698 of_octets_t experimenter_data;
1699};
1700
1701// Not yet supported
Rich Lanee9c37db2013-06-21 18:30:24 -07001702// struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
Rich Lanea06d0c32013-03-25 08:52:03 -07001703// uint16_t type;
1704// uint16_t length;
1705// uint32_t experimenter;
1706// uint32_t subtype;
1707// of_octets_t experimenter_data;
1708// };
1709
Rich Lane68ae4d72013-05-09 10:55:19 -07001710struct of_table_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001711 uint16_t length;
1712 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001713 pad(5);
Rich Lanea06d0c32013-03-25 08:52:03 -07001714 of_table_name_t name;
1715 uint64_t metadata_match;
1716 uint64_t metadata_write;
1717 uint32_t config;
1718 uint32_t max_entries;
1719 list(of_table_feature_prop_t) properties;
1720};
1721
Rich Lane68ae4d72013-05-09 10:55:19 -07001722struct of_meter_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001723 uint32_t max_meter;
1724 uint32_t band_types;
1725 uint32_t capabilities;
1726 uint8_t max_bands;
1727 uint8_t max_color;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001728 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001729};
1730
Rich Lanee9c37db2013-06-21 18:30:24 -07001731struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001732 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001733 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001734 uint16_t length;
1735 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001736 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001737 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001738 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001739 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001740 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001741};
1742
Rich Lanee9c37db2013-06-21 18:30:24 -07001743struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001744 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001745 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001746 uint16_t length;
1747 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001748 uint16_t stats_type == 4;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001749 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001750 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001751 list(of_port_stats_entry_t) entries;
1752};
1753
Rich Lanee9c37db2013-06-21 18:30:24 -07001754struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001755 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001756 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001757 uint16_t length;
1758 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001759 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001760 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001761 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001762 of_port_no_t port_no;
1763 uint32_t queue_id;
1764};
1765
Rich Lanee9c37db2013-06-21 18:30:24 -07001766struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001767 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001768 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001769 uint16_t length;
1770 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001771 uint16_t stats_type == 5;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001772 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001773 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001774 list(of_queue_stats_entry_t) entries;
1775};
1776
Rich Lanee9c37db2013-06-21 18:30:24 -07001777struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001778 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001779 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001780 uint16_t length;
1781 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001782 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001783 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001784 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001785 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001786 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001787};
1788
Rich Lanee9c37db2013-06-21 18:30:24 -07001789struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001790 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001791 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001792 uint16_t length;
1793 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001794 uint16_t stats_type == 6;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001795 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001796 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001797 list(of_group_stats_entry_t) entries;
1798};
1799
Rich Lanee9c37db2013-06-21 18:30:24 -07001800struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001801 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001802 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001803 uint16_t length;
1804 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001805 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001806 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001807 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001808};
1809
Rich Lanee9c37db2013-06-21 18:30:24 -07001810struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001811 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001812 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001813 uint16_t length;
1814 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001815 uint16_t stats_type == 7;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001816 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001817 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001818 list(of_group_desc_stats_entry_t) entries;
1819};
1820
Rich Lanee9c37db2013-06-21 18:30:24 -07001821struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001822 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001823 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001824 uint16_t length;
1825 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001826 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001827 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001828 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001829};
1830
Rich Lanee9c37db2013-06-21 18:30:24 -07001831struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001832 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001833 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001834 uint16_t length;
1835 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001836 uint16_t stats_type == 8;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001837 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001838 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001839 uint32_t types;
1840 uint32_t capabilities;
1841 uint32_t max_groups_all;
1842 uint32_t max_groups_select;
1843 uint32_t max_groups_indirect;
1844 uint32_t max_groups_ff;
1845 uint32_t actions_all;
1846 uint32_t actions_select;
1847 uint32_t actions_indirect;
1848 uint32_t actions_ff;
1849};
1850
Rich Lanee9c37db2013-06-21 18:30:24 -07001851struct of_meter_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001852 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001853 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001854 uint16_t length;
1855 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001856 uint16_t stats_type == 9;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001857 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001858 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001859 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001860 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001861};
1862
Rich Lanee9c37db2013-06-21 18:30:24 -07001863struct of_meter_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001864 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001865 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001866 uint16_t length;
1867 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001868 uint16_t stats_type == 9;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001869 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001870 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001871 list(of_meter_stats_t) entries;
1872};
1873
Rich Lanee9c37db2013-06-21 18:30:24 -07001874struct of_meter_config_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001875 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001876 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001877 uint16_t length;
1878 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001879 uint16_t stats_type == 10;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001880 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001881 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001882 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001883 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001884};
1885
Rich Lanee9c37db2013-06-21 18:30:24 -07001886struct of_meter_config_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001887 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001888 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001889 uint16_t length;
1890 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001891 uint16_t stats_type == 10;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001892 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001893 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001894 list(of_meter_band_t) entries;
1895};
1896
1897// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001898struct of_meter_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001899 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001900 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001901 uint16_t length;
1902 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001903 uint16_t stats_type == 11;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001904 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001905 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001906};
1907
1908// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001909struct of_meter_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001910 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001911 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001912 uint16_t length;
1913 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001914 uint16_t stats_type == 11;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001915 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001916 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001917 of_meter_features_t features;
1918};
1919
1920// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001921struct of_table_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001922 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001923 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001924 uint16_t length;
1925 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001926 uint16_t stats_type == 12;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001927 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001928 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001929 list(of_table_features_t) entries;
1930};
1931
1932// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001933struct of_table_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001934 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001935 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001936 uint16_t length;
1937 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001938 uint16_t stats_type == 12;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001939 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001940 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001941 list(of_table_features_t) entries;
1942};
1943
1944// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001945struct of_port_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001946 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001947 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001948 uint16_t length;
1949 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001950 uint16_t stats_type == 13;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001951 enum ofp_stats_request_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001952 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001953};
1954
1955// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001956struct of_port_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001957 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001958 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001959 uint16_t length;
1960 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001961 uint16_t stats_type == 13;
Andreas Wundsamb47d7e82013-10-18 17:43:00 -07001962 enum ofp_stats_reply_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001963 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001964 list(of_port_desc_t) entries;
1965};
1966
Rich Lane68ae4d72013-05-09 10:55:19 -07001967struct of_meter_band_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001968 uint64_t packet_band_count;
1969 uint64_t byte_band_count;
1970};
1971
Rich Lane68ae4d72013-05-09 10:55:19 -07001972struct of_meter_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001973 uint32_t meter_id;
1974 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001975 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001976 uint32_t flow_count;
1977 uint64_t packet_in_count;
1978 uint64_t byte_in_count;
1979 uint32_t duration_sec;
1980 uint32_t duration_nsec;
1981 list(of_meter_band_stats_t) band_stats;
1982};
1983
Rich Lane68ae4d72013-05-09 10:55:19 -07001984struct of_meter_config {
Rich Lanea06d0c32013-03-25 08:52:03 -07001985 uint16_t length;
1986 uint16_t flags;
1987 uint32_t meter_id;
1988 list(of_meter_band_t) entries;
1989};
1990
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001991struct of_experimenter_stats_header {
Rich Laneb25d07c2013-08-22 17:22:43 -07001992 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001993 uint32_t subtype;
1994};
1995
1996// END OF STATS OBJECTS
1997
Rich Lane68ae4d72013-05-09 10:55:19 -07001998struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001999 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07002000 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002001 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002002};
2003
Rich Lanee9c37db2013-06-21 18:30:24 -07002004struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002005 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07002006 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002007 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002008 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002009 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002010};
2011
Rich Lanee9c37db2013-06-21 18:30:24 -07002012struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002013 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07002014 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002015 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002016 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002017 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002018};
2019
Rich Lanee9c37db2013-06-21 18:30:24 -07002020struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07002021 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07002022 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002023 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07002024 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002025 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002026 of_octets_t data;
2027};
2028
Rich Lane68ae4d72013-05-09 10:55:19 -07002029struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07002030 uint32_t queue_id;
2031 of_port_no_t port;
2032 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002033 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07002034 list(of_queue_prop_t) properties;
2035};
2036
Rich Lanee9c37db2013-06-21 18:30:24 -07002037struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002038 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002039 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07002040 uint16_t length;
2041 uint32_t xid;
2042 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002043 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002044};
2045
Rich Lanee9c37db2013-06-21 18:30:24 -07002046struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002047 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002048 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07002049 uint16_t length;
2050 uint32_t xid;
2051 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002052 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002053 list(of_packet_queue_t) queues;
2054};
2055
Rich Lanee9c37db2013-06-21 18:30:24 -07002056struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002057 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002058 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07002059 uint16_t length;
2060 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07002061 enum ofp_controller_role role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07002062 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07002063 uint64_t generation_id;
2064};
2065
Rich Lanee9c37db2013-06-21 18:30:24 -07002066struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002067 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002068 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07002069 uint16_t length;
2070 uint32_t xid;
Andreas Wundsam4f796b72013-10-18 17:33:23 -07002071 enum ofp_controller_role role;
2072 pad(4);
2073 uint64_t generation_id;
Rich Lanea06d0c32013-03-25 08:52:03 -07002074};
2075
2076////////////////////////////////////////////////////////////////
2077// FIXME understand async; where do bitmasks live?
2078// Determine bitmap type for masks below.
2079// DOCUMENT masks where uint32_t[0] is interest for equal/master
2080// while uint32_t[1] is interest for slave
2081////////////////////////////////////////////////////////////////
2082
Rich Lanee9c37db2013-06-21 18:30:24 -07002083struct of_async_get_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002084 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002085 uint8_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -07002086 uint16_t length;
2087 uint32_t xid;
2088 uint32_t packet_in_mask_equal_master;
2089 uint32_t packet_in_mask_slave;
2090 uint32_t port_status_mask_equal_master;
2091 uint32_t port_status_mask_slave;
2092 uint32_t flow_removed_mask_equal_master;
2093 uint32_t flow_removed_mask_slave;
2094};
2095
Rich Lanee9c37db2013-06-21 18:30:24 -07002096struct of_async_get_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002097 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002098 uint8_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -07002099 uint16_t length;
2100 uint32_t xid;
2101 uint32_t packet_in_mask_equal_master;
2102 uint32_t packet_in_mask_slave;
2103 uint32_t port_status_mask_equal_master;
2104 uint32_t port_status_mask_slave;
2105 uint32_t flow_removed_mask_equal_master;
2106 uint32_t flow_removed_mask_slave;
2107};
2108
Rich Lanee9c37db2013-06-21 18:30:24 -07002109struct of_async_set : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002110 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002111 uint8_t type == 28;
Rich Lanea06d0c32013-03-25 08:52:03 -07002112 uint16_t length;
2113 uint32_t xid;
2114 uint32_t packet_in_mask_equal_master;
2115 uint32_t packet_in_mask_slave;
2116 uint32_t port_status_mask_equal_master;
2117 uint32_t port_status_mask_slave;
2118 uint32_t flow_removed_mask_equal_master;
2119 uint32_t flow_removed_mask_slave;
2120};