blob: 9d53f1191a676dba3055e8e3f9d2ad887b8f7538 [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 Wundsam7933beb2013-08-02 22:36:42 -070061enum ofp_port_no(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -070062 OFPP_ANY = 0xffffffff,
63};
64
Andreas Wundsam4ee51462013-07-30 11:00:37 -070065enum ofp_port(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070066 OFPP_MAX = 0xffffff00,
67 OFPP_IN_PORT = 0xfffffff8,
68 OFPP_TABLE = 0xfffffff9,
69 OFPP_NORMAL = 0xfffffffa,
70 OFPP_FLOOD = 0xfffffffb,
71 OFPP_ALL = 0xfffffffc,
72 OFPP_CONTROLLER = 0xfffffffd,
73 OFPP_LOCAL = 0xfffffffe,
74};
75
Andreas Wundsam4ee51462013-07-30 11:00:37 -070076enum ofp_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -070077 OFPT_HELLO = 0,
78 OFPT_ERROR = 1,
79 OFPT_ECHO_REQUEST = 2,
80 OFPT_ECHO_REPLY = 3,
81 OFPT_EXPERIMENTER = 4,
82 OFPT_FEATURES_REQUEST = 5,
83 OFPT_FEATURES_REPLY = 6,
84 OFPT_GET_CONFIG_REQUEST = 7,
85 OFPT_GET_CONFIG_REPLY = 8,
86 OFPT_SET_CONFIG = 9,
87 OFPT_PACKET_IN = 10,
88 OFPT_FLOW_REMOVED = 11,
89 OFPT_PORT_STATUS = 12,
90 OFPT_PACKET_OUT = 13,
91 OFPT_FLOW_MOD = 14,
92 OFPT_GROUP_MOD = 15,
93 OFPT_PORT_MOD = 16,
94 OFPT_TABLE_MOD = 17,
Rob Vaterlausfeee3712013-09-30 11:24:19 -070095 OFPT_STATS_REQUEST = 18,
96 OFPT_STATS_REPLY = 19,
Rich Lane5d33a622013-04-08 17:33:11 -070097 OFPT_BARRIER_REQUEST = 20,
98 OFPT_BARRIER_REPLY = 21,
99 OFPT_QUEUE_GET_CONFIG_REQUEST = 22,
100 OFPT_QUEUE_GET_CONFIG_REPLY = 23,
101 OFPT_ROLE_REQUEST = 24,
102 OFPT_ROLE_REPLY = 25,
103 OFPT_GET_ASYNC_REQUEST = 26,
104 OFPT_GET_ASYNC_REPLY = 27,
105 OFPT_SET_ASYNC = 28,
106 OFPT_METER_MOD = 29,
107};
108
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700109enum ofp_config_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700110 OFPC_FRAG_NORMAL = 0,
111 OFPC_FRAG_DROP = 1,
112 OFPC_FRAG_REASM = 2,
113 OFPC_FRAG_MASK = 3,
114};
115
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700116enum ofp_table_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700117 OFPTC_DEPRECATED_MASK = 0x3,
118};
119
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700120enum ofp_table(wire_type=uint8_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700121 OFPTT_MAX = 0xfe,
122 OFPTT_ALL = 0xff,
123};
124
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700125enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700126 OFPC_FLOW_STATS = 0x1,
127 OFPC_TABLE_STATS = 0x2,
128 OFPC_PORT_STATS = 0x4,
129 OFPC_GROUP_STATS = 0x8,
130 OFPC_IP_REASM = 0x20,
131 OFPC_QUEUE_STATS = 0x40,
132 OFPC_PORT_BLOCKED = 0x100,
133};
134
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700135enum ofp_port_config(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700136 OFPPC_PORT_DOWN = 0x1,
137 OFPPC_NO_RECV = 0x4,
138 OFPPC_NO_FWD = 0x20,
139 OFPPC_NO_PACKET_IN = 0x40,
Rob Vaterlaus0a8ec142013-10-10 13:27:14 -0700140 OFPPC_BSN_MIRROR_DEST = 0x80000000,
Rich Lane5d33a622013-04-08 17:33:11 -0700141};
142
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700143enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700144 OFPPS_LINK_DOWN = 0x1,
145 OFPPS_BLOCKED = 0x2,
146 OFPPS_LIVE = 0x4,
147};
148
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700149enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700150 OFPPF_10MB_HD = 0x1,
151 OFPPF_10MB_FD = 0x2,
152 OFPPF_100MB_HD = 0x4,
153 OFPPF_100MB_FD = 0x8,
154 OFPPF_1GB_HD = 0x10,
155 OFPPF_1GB_FD = 0x20,
156 OFPPF_10GB_FD = 0x40,
157 OFPPF_40GB_FD = 0x80,
158 OFPPF_100GB_FD = 0x100,
159 OFPPF_1TB_FD = 0x200,
160 OFPPF_OTHER = 0x400,
161 OFPPF_COPPER = 0x800,
162 OFPPF_FIBER = 0x1000,
163 OFPPF_AUTONEG = 0x2000,
164 OFPPF_PAUSE = 0x4000,
165 OFPPF_PAUSE_ASYM = 0x8000,
166};
167
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700168enum ofp_port_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700169 OFPPR_ADD = 0,
170 OFPPR_DELETE = 1,
171 OFPPR_MODIFY = 2,
172};
173
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700174enum ofp_match_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700175 OFPMT_STANDARD = 0,
176 OFPMT_OXM = 1,
177};
178
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700179enum ofp_oxm_class(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700180 OFPXMC_NXM_0 = 0,
181 OFPXMC_NXM_1 = 1,
182 OFPXMC_OPENFLOW_BASIC = 0x8000,
183 OFPXMC_EXPERIMENTER = 0xffff,
184};
185
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700186enum ofp_vlan_id(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700187 OFPVID_NONE = 0,
188 OFPVID_PRESENT = 0x1000,
189};
190
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700191// FIXME: OF spec specified this as '9' bits, implicitly adding
192// to full byte
193enum ofp_ipv6exthdr_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700194 OFPIEH_NONEXT = 0x1,
195 OFPIEH_ESP = 0x2,
196 OFPIEH_AUTH = 0x4,
197 OFPIEH_DEST = 0x8,
198 OFPIEH_FRAG = 0x10,
199 OFPIEH_ROUTER = 0x20,
200 OFPIEH_HOP = 0x40,
201 OFPIEH_UNREP = 0x80,
202 OFPIEH_UNSEQ = 0x100,
203};
204
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700205enum ofp_action_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700206 OFPAT_OUTPUT = 0,
207 OFPAT_COPY_TTL_OUT = 0xb,
208 OFPAT_COPY_TTL_IN = 0xc,
209 OFPAT_SET_MPLS_TTL = 0xf,
210 OFPAT_DEC_MPLS_TTL = 0x10,
211 OFPAT_PUSH_VLAN = 0x11,
212 OFPAT_POP_VLAN = 0x12,
213 OFPAT_PUSH_MPLS = 0x13,
214 OFPAT_POP_MPLS = 0x14,
215 OFPAT_SET_QUEUE = 0x15,
216 OFPAT_GROUP = 0x16,
217 OFPAT_SET_NW_TTL = 0x17,
218 OFPAT_DEC_NW_TTL = 0x18,
219 OFPAT_SET_FIELD = 0x19,
220 OFPAT_PUSH_PBB = 0x1a,
221 OFPAT_POP_PBB = 0x1b,
222 OFPAT_EXPERIMENTER = 0xffff,
223};
224
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700225enum ofp_controller_max_len(wire_type=uint16_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700226 OFPCML_MAX = 0xffe5,
227 OFPCML_NO_BUFFER = 0xffff,
228};
229
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700230enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700231 OFPIT_GOTO_TABLE = 0x1,
232 OFPIT_WRITE_METADATA = 0x2,
233 OFPIT_WRITE_ACTIONS = 0x3,
234 OFPIT_APPLY_ACTIONS = 0x4,
235 OFPIT_CLEAR_ACTIONS = 0x5,
236 OFPIT_METER = 0x6,
237 OFPIT_EXPERIMENTER = 0xffff,
238};
239
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700240enum ofp_flow_mod_command(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700241 OFPFC_ADD = 0,
242 OFPFC_MODIFY = 1,
243 OFPFC_MODIFY_STRICT = 2,
244 OFPFC_DELETE = 3,
245 OFPFC_DELETE_STRICT = 4,
246};
247
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700248enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700249 OFPFF_SEND_FLOW_REM = 0x1,
250 OFPFF_CHECK_OVERLAP = 0x2,
251 OFPFF_RESET_COUNTS = 0x4,
252 OFPFF_NO_PKT_COUNTS = 0x8,
253 OFPFF_NO_BYT_COUNTS = 0x10,
Rich Lanef86f39a2013-10-07 18:04:11 -0700254
255 /* Non-standard, enabled by an experimenter message */
256 /* See the bsn_flow_idle input file */
257 OFPFF_BSN_SEND_IDLE = 0x80,
Rich Lane5d33a622013-04-08 17:33:11 -0700258};
259
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700260enum ofp_group(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700261 OFPG_MAX = 0xffffff00,
262 OFPG_ALL = 0xfffffffc,
263 OFPG_ANY = 0xffffffff,
264};
265
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700266enum ofp_group_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700267 OFPGC_ADD = 0,
268 OFPGC_MODIFY = 1,
269 OFPGC_DELETE = 2,
270};
271
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700272enum ofp_group_type(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700273 OFPGT_ALL = 0,
274 OFPGT_SELECT = 1,
275 OFPGT_INDIRECT = 2,
276 OFPGT_FF = 3,
277};
278
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700279enum ofp_packet_in_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700280 OFPR_NO_MATCH = 0,
281 OFPR_ACTION = 1,
282 OFPR_INVALID_TTL = 2,
283};
284
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700285enum ofp_flow_removed_reason(wire_type=uint8_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700286 OFPRR_IDLE_TIMEOUT = 0,
287 OFPRR_HARD_TIMEOUT = 1,
288 OFPRR_DELETE = 2,
289 OFPRR_GROUP_DELETE = 3,
290};
291
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700292enum ofp_meter(wire_type=uint32_t, complete=False) {
Rich Lane5d33a622013-04-08 17:33:11 -0700293 OFPM_MAX = 0xffff0000,
294 OFPM_SLOWPATH = 0xfffffffd,
295 OFPM_CONTROLLER = 0xfffffffe,
296 OFPM_ALL = 0xffffffff,
297};
298
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700299enum ofp_meter_band_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700300 OFPMBT_DROP = 0x1,
301 OFPMBT_DSCP_REMARK = 0x2,
302 OFPMBT_EXPERIMENTER = 0xffff,
303};
304
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700305enum ofp_meter_mod_command(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700306 OFPMC_ADD = 0,
307 OFPMC_MODIFY = 1,
308 OFPMC_DELETE = 2,
309};
310
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700311enum ofp_meter_flags(wire_type=uint16_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700312 OFPMF_KBPS = 0x1,
313 OFPMF_PKTPS = 0x2,
314 OFPMF_BURST = 0x4,
315 OFPMF_STATS = 0x8,
316};
317
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700318enum ofp_error_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700319 OFPET_HELLO_FAILED = 0,
320 OFPET_BAD_REQUEST = 1,
321 OFPET_BAD_ACTION = 2,
322 OFPET_BAD_INSTRUCTION = 3,
323 OFPET_BAD_MATCH = 4,
324 OFPET_FLOW_MOD_FAILED = 5,
325 OFPET_GROUP_MOD_FAILED = 6,
326 OFPET_PORT_MOD_FAILED = 7,
327 OFPET_TABLE_MOD_FAILED = 8,
328 OFPET_QUEUE_OP_FAILED = 9,
329 OFPET_SWITCH_CONFIG_FAILED = 10,
330 OFPET_ROLE_REQUEST_FAILED = 11,
331 OFPET_METER_MOD_FAILED = 12,
332 OFPET_TABLE_FEATURES_FAILED = 13,
333 OFPET_EXPERIMENTER = 0xffff,
334};
335
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700336enum ofp_hello_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700337 OFPHFC_INCOMPATIBLE = 0,
338 OFPHFC_EPERM = 1,
339};
340
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700341enum ofp_bad_request_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700342 OFPBRC_BAD_VERSION = 0,
343 OFPBRC_BAD_TYPE = 1,
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700344 OFPBRC_BAD_STAT = 2,
Rich Lane5d33a622013-04-08 17:33:11 -0700345 OFPBRC_BAD_EXPERIMENTER = 3,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700346 OFPBRC_BAD_EXPERIMENTER_TYPE = 4,
Rich Lane5d33a622013-04-08 17:33:11 -0700347 OFPBRC_EPERM = 5,
348 OFPBRC_BAD_LEN = 6,
349 OFPBRC_BUFFER_EMPTY = 7,
350 OFPBRC_BUFFER_UNKNOWN = 8,
351 OFPBRC_BAD_TABLE_ID = 9,
352 OFPBRC_IS_SLAVE = 10,
353 OFPBRC_BAD_PORT = 11,
354 OFPBRC_BAD_PACKET = 12,
355 OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13,
356};
357
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700358enum ofp_bad_action_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700359 OFPBAC_BAD_TYPE = 0,
360 OFPBAC_BAD_LEN = 1,
361 OFPBAC_BAD_EXPERIMENTER = 2,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700362 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
Rich Lane5d33a622013-04-08 17:33:11 -0700363 OFPBAC_BAD_OUT_PORT = 4,
364 OFPBAC_BAD_ARGUMENT = 5,
365 OFPBAC_EPERM = 6,
366 OFPBAC_TOO_MANY = 7,
367 OFPBAC_BAD_QUEUE = 8,
368 OFPBAC_BAD_OUT_GROUP = 9,
369 OFPBAC_MATCH_INCONSISTENT = 10,
370 OFPBAC_UNSUPPORTED_ORDER = 11,
371 OFPBAC_BAD_TAG = 12,
372 OFPBAC_BAD_SET_TYPE = 13,
373 OFPBAC_BAD_SET_LEN = 14,
374 OFPBAC_BAD_SET_ARGUMENT = 15,
375};
376
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700377enum ofp_bad_instruction_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700378 OFPBIC_UNKNOWN_INST = 0,
379 OFPBIC_UNSUP_INST = 1,
380 OFPBIC_BAD_TABLE_ID = 2,
381 OFPBIC_UNSUP_METADATA = 3,
382 OFPBIC_UNSUP_METADATA_MASK = 4,
383 OFPBIC_BAD_EXPERIMENTER = 5,
Rob Vaterlausb3f49d92013-10-01 17:57:31 -0700384 OFPBIC_BAD_EXPERIMENTER_TYPE = 6,
Rich Lane5d33a622013-04-08 17:33:11 -0700385 OFPBIC_BAD_LEN = 7,
386 OFPBIC_EPERM = 8,
387};
388
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700389enum ofp_bad_match_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700390 OFPBMC_BAD_TYPE = 0,
391 OFPBMC_BAD_LEN = 1,
392 OFPBMC_BAD_TAG = 2,
393 OFPBMC_BAD_DL_ADDR_MASK = 3,
394 OFPBMC_BAD_NW_ADDR_MASK = 4,
395 OFPBMC_BAD_WILDCARDS = 5,
396 OFPBMC_BAD_FIELD = 6,
397 OFPBMC_BAD_VALUE = 7,
398 OFPBMC_BAD_MASK = 8,
399 OFPBMC_BAD_PREREQ = 9,
400 OFPBMC_DUP_FIELD = 10,
401 OFPBMC_EPERM = 11,
402};
403
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700404enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700405 OFPFMFC_UNKNOWN = 0,
406 OFPFMFC_TABLE_FULL = 1,
407 OFPFMFC_BAD_TABLE_ID = 2,
408 OFPFMFC_OVERLAP = 3,
409 OFPFMFC_EPERM = 4,
410 OFPFMFC_BAD_TIMEOUT = 5,
411 OFPFMFC_BAD_COMMAND = 6,
412 OFPFMFC_BAD_FLAGS = 7,
413};
414
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700415enum ofp_group_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700416 OFPGMFC_GROUP_EXISTS = 0,
417 OFPGMFC_INVALID_GROUP = 1,
418 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
419 OFPGMFC_OUT_OF_GROUPS = 3,
420 OFPGMFC_OUT_OF_BUCKETS = 4,
421 OFPGMFC_CHAINING_UNSUPPORTED = 5,
422 OFPGMFC_WATCH_UNSUPPORTED = 6,
423 OFPGMFC_LOOP = 7,
424 OFPGMFC_UNKNOWN_GROUP = 8,
425 OFPGMFC_CHAINED_GROUP = 9,
426 OFPGMFC_BAD_TYPE = 10,
427 OFPGMFC_BAD_COMMAND = 11,
428 OFPGMFC_BAD_BUCKET = 12,
429 OFPGMFC_BAD_WATCH = 13,
430 OFPGMFC_EPERM = 14,
431};
432
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700433enum ofp_port_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700434 OFPPMFC_BAD_PORT = 0,
435 OFPPMFC_BAD_HW_ADDR = 1,
436 OFPPMFC_BAD_CONFIG = 2,
437 OFPPMFC_BAD_ADVERTISE = 3,
438 OFPPMFC_EPERM = 4,
439};
440
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700441enum ofp_table_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700442 OFPTMFC_BAD_TABLE = 0,
443 OFPTMFC_BAD_CONFIG = 1,
444 OFPTMFC_EPERM = 2,
445};
446
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700447enum ofp_queue_op_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700448 OFPQOFC_BAD_PORT = 0,
449 OFPQOFC_BAD_QUEUE = 1,
450 OFPQOFC_EPERM = 2,
451};
452
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700453enum ofp_switch_config_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700454 OFPSCFC_BAD_FLAGS = 0,
455 OFPSCFC_BAD_LEN = 1,
456 OFPSCFC_EPERM = 2,
457};
458
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700459enum ofp_role_request_failed_code(wire_type=uint16_t){
Rich Lane5d33a622013-04-08 17:33:11 -0700460 OFPRRFC_STALE = 0,
461 OFPRRFC_UNSUP = 1,
462 OFPRRFC_BAD_ROLE = 2,
463};
464
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700465enum ofp_meter_mod_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700466 OFPMMFC_UNKNOWN = 0,
467 OFPMMFC_METER_EXISTS = 1,
468 OFPMMFC_INVALID_METER = 2,
469 OFPMMFC_UNKNOWN_METER = 3,
470 OFPMMFC_BAD_COMMAND = 4,
471 OFPMMFC_BAD_FLAGS = 5,
472 OFPMMFC_BAD_RATE = 6,
473 OFPMMFC_BAD_BURST = 7,
474 OFPMMFC_BAD_BAND = 8,
475 OFPMMFC_BAD_BAND_VALUE = 9,
476 OFPMMFC_OUT_OF_METERS = 10,
477 OFPMMFC_OUT_OF_BANDS = 11,
478};
479
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700480enum ofp_table_features_failed_code(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700481 OFPTFFC_BAD_TABLE = 0,
482 OFPTFFC_BAD_METADATA = 1,
483 OFPTFFC_BAD_TYPE = 2,
484 OFPTFFC_BAD_LEN = 3,
485 OFPTFFC_BAD_ARGUMENT = 4,
486 OFPTFFC_EPERM = 5,
487};
488
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700489enum ofp_stats_type(wire_type=uint16_t) {
490 OFPST_DESC = 0,
491 OFPST_FLOW = 1,
492 OFPST_AGGREGATE = 2,
493 OFPST_TABLE = 3,
494 OFPST_PORT = 4,
495 OFPST_QUEUE = 5,
496 OFPST_GROUP = 6,
497 OFPST_GROUP_DESC = 7,
498 OFPST_GROUP_FEATURES = 8,
499 OFPST_METER = 9,
500 OFPST_METER_CONFIG = 10,
501 OFPST_METER_FEATURES = 11,
502 OFPST_TABLE_FEATURES = 12,
503 OFPST_PORT_DESC = 13,
504 OFPST_EXPERIMENTER = 0xffff,
Rich Lane5d33a622013-04-08 17:33:11 -0700505};
506
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700507enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) {
508 OFPSF_REQ_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700509};
510
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700511enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
512 OFPSF_REPLY_MORE = 0x1,
Rich Lane5d33a622013-04-08 17:33:11 -0700513};
514
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700515enum ofp_table_feature_prop_type(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700516 OFPTFPT_INSTRUCTIONS = 0,
517 OFPTFPT_INSTRUCTIONS_MISS = 1,
518 OFPTFPT_NEXT_TABLES = 2,
519 OFPTFPT_NEXT_TABLES_MISS = 3,
520 OFPTFPT_WRITE_ACTIONS = 4,
521 OFPTFPT_WRITE_ACTIONS_MISS = 5,
522 OFPTFPT_APPLY_ACTIONS = 6,
523 OFPTFPT_APPLY_ACTIONS_MISS = 7,
524 OFPTFPT_MATCH = 8,
525 OFPTFPT_WILDCARDS = 0xa,
526 OFPTFPT_WRITE_SETFIELD = 0xc,
527 OFPTFPT_WRITE_SETFIELD_MISS = 0xd,
528 OFPTFPT_APPLY_SETFIELD = 0xe,
529 OFPTFPT_APPLY_SETFIELD_MISS = 0xf,
530 OFPTFPT_EXPERIMENTER = 0xfffe,
531 OFPTFPT_EXPERIMENTER_MISS = 0xffff,
532};
533
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700534enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
Rich Lane5d33a622013-04-08 17:33:11 -0700535 OFPGFC_SELECT_WEIGHT = 0x1,
536 OFPGFC_SELECT_LIVENESS = 0x2,
537 OFPGFC_CHAINING = 0x4,
538 OFPGFC_CHAINING_CHECKS = 0x8,
539};
540
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700541enum ofp_queue_properties(wire_type=uint16_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700542 OFPQT_MIN_RATE = 0x1,
543 OFPQT_MAX_RATE = 0x2,
544 OFPQT_EXPERIMENTER = 0xffff,
545};
546
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700547enum ofp_controller_role(wire_type=uint32_t) {
Rich Lane5d33a622013-04-08 17:33:11 -0700548 OFPCR_ROLE_NOCHANGE = 0,
549 OFPCR_ROLE_EQUAL = 1,
550 OFPCR_ROLE_MASTER = 2,
551 OFPCR_ROLE_SLAVE = 3,
552};
553
Andreas Wundsam4ee51462013-07-30 11:00:37 -0700554enum ofp_hello_elem_type(wire_type=uint16_t) {
Rich Lane0733cd62013-04-18 21:14:42 -0700555 OFPHET_VERSIONBITMAP = 1,
556};
557
Rich Lanee9c37db2013-06-21 18:30:24 -0700558/* XXX rename to of_message */
Rich Lane68ae4d72013-05-09 10:55:19 -0700559struct of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700560 uint8_t version;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700561 uint8_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700562 uint16_t length;
563 uint32_t xid;
564};
565
566// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700567struct of_uint32 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700568 uint32_t value;
569};
570
571// Special structures used for managing scalar list elements
Rich Lane68ae4d72013-05-09 10:55:19 -0700572struct of_uint8 {
Rich Lanea06d0c32013-03-25 08:52:03 -0700573 uint8_t value;
574};
575
Rich Lane68ae4d72013-05-09 10:55:19 -0700576struct of_hello_elem {
Andreas Wundsam70411bf2013-08-02 22:26:38 -0700577 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700578 uint16_t length;
579};
580
Rich Lanee9c37db2013-06-21 18:30:24 -0700581struct of_hello_elem_versionbitmap : of_hello_elem {
Rich Lane31b87142013-05-09 22:05:42 -0700582 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700583 uint16_t length;
584 list(of_uint32_t) bitmaps;
585};
586
Rich Lanee9c37db2013-06-21 18:30:24 -0700587struct of_hello : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700588 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700589 uint8_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700590 uint16_t length;
591 uint32_t xid;
592 list(of_hello_elem_t) elements;
593};
594
Rich Lanee9c37db2013-06-21 18:30:24 -0700595struct of_echo_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700596 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700597 uint8_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700598 uint16_t length;
599 uint32_t xid;
600 of_octets_t data;
601};
602
Rich Lanee9c37db2013-06-21 18:30:24 -0700603struct of_echo_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700604 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700605 uint8_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700606 uint16_t length;
607 uint32_t xid;
608 of_octets_t data;
609};
610
Rich Lanee9c37db2013-06-21 18:30:24 -0700611struct of_experimenter : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700612 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700613 uint8_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -0700614 uint16_t length;
615 uint32_t xid;
Rich Laneb25d07c2013-08-22 17:22:43 -0700616 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700617 uint32_t subtype;
618 of_octets_t data;
619};
620
Rich Lanee9c37db2013-06-21 18:30:24 -0700621struct of_barrier_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700622 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700623 uint8_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700624 uint16_t length;
625 uint32_t xid;
626};
627
Rich Lanee9c37db2013-06-21 18:30:24 -0700628struct of_barrier_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700629 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700630 uint8_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700631 uint16_t length;
632 uint32_t xid;
633};
634
Rich Lanee9c37db2013-06-21 18:30:24 -0700635struct of_get_config_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 == 7;
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_get_config_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 == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -0700645 uint16_t length;
646 uint32_t xid;
647 uint16_t flags;
648 uint16_t miss_send_len;
649};
650
Rich Lanee9c37db2013-06-21 18:30:24 -0700651struct of_set_config : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700652 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700653 uint8_t type == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -0700654 uint16_t length;
655 uint32_t xid;
656 uint16_t flags;
657 uint16_t miss_send_len;
658};
659
Rich Lanee9c37db2013-06-21 18:30:24 -0700660struct of_table_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700661 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700662 uint8_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700663 uint16_t length;
664 uint32_t xid;
665 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700666 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700667 uint32_t config;
668};
669
Rich Lane68ae4d72013-05-09 10:55:19 -0700670struct of_port_desc {
Rich Lanea06d0c32013-03-25 08:52:03 -0700671 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700672 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700673 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700674 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700675 of_port_name_t name;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700676 enum ofp_port_config config;
677 enum ofp_port_state state;
678 enum ofp_port_features curr;
679 enum ofp_port_features advertised;
680 enum ofp_port_features supported;
681 enum ofp_port_features peer;
Rich Lanea06d0c32013-03-25 08:52:03 -0700682 uint32_t curr_speed;
683 uint32_t max_speed;
684};
685
Rich Lanee9c37db2013-06-21 18:30:24 -0700686struct of_features_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700687 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700688 uint8_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -0700689 uint16_t length;
690 uint32_t xid;
691};
692
Rich Lanee9c37db2013-06-21 18:30:24 -0700693struct of_features_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700694 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700695 uint8_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700696 uint16_t length;
697 uint32_t xid;
698 uint64_t datapath_id;
699 uint32_t n_buffers;
700 uint8_t n_tables;
701 uint8_t auxiliary_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700702 pad(2);
Rob Vaterlausfeee3712013-09-30 11:24:19 -0700703 enum ofp_capabilities capabilities;
Rich Lanea06d0c32013-03-25 08:52:03 -0700704 uint32_t reserved;
705};
706
Rich Lanee9c37db2013-06-21 18:30:24 -0700707struct of_port_status : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700708 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700709 uint8_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700710 uint16_t length;
711 uint32_t xid;
Rob Vaterlausd9d72d22013-09-23 14:50:52 -0700712 enum ofp_port_reason reason;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700713 pad(7);
Rich Lanea06d0c32013-03-25 08:52:03 -0700714 of_port_desc_t desc;
715};
716
Rich Lanee9c37db2013-06-21 18:30:24 -0700717struct of_port_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -0700718 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700719 uint8_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700720 uint16_t length;
721 uint32_t xid;
722 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700723 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700724 of_mac_addr_t hw_addr;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700725 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700726 uint32_t config;
727 uint32_t mask;
728 uint32_t advertise;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700729 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700730};
731
732// FIXME Does this need to be v4?
Andreas Wundsamfef7d5f2013-08-01 22:15:44 -0700733struct of_match_v3(align=8) {
Rich Lane31b87142013-05-09 22:05:42 -0700734 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700735 uint16_t length;
736 list(of_oxm_t) oxm_list;
737};
738
Rich Lanea06d0c32013-03-25 08:52:03 -0700739// This looks like an action header, but is standalone. See
740// ofp_table_features_prop_actions
Rich Lane68ae4d72013-05-09 10:55:19 -0700741struct of_action_id {
Rich Lanea06d0c32013-03-25 08:52:03 -0700742 uint16_t type;
743 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700744 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700745};
746
Rich Lanee9c37db2013-06-21 18:30:24 -0700747struct of_action_output : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700748 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700749 uint16_t len;
750 of_port_no_t port;
751 uint16_t max_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700752 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -0700753};
754
Rich Lanee9c37db2013-06-21 18:30:24 -0700755struct of_action_copy_ttl_out : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700756 uint16_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -0700757 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_copy_ttl_in : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700762 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -0700763 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700764 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700765};
766
Rich Lanee9c37db2013-06-21 18:30:24 -0700767struct of_action_set_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700768 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -0700769 uint16_t len;
770 uint8_t mpls_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700771 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700772};
773
Rich Lanee9c37db2013-06-21 18:30:24 -0700774struct of_action_dec_mpls_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700775 uint16_t type == 16;
Rich Lanea06d0c32013-03-25 08:52:03 -0700776 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700777 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700778};
779
Rich Lanee9c37db2013-06-21 18:30:24 -0700780struct of_action_push_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700781 uint16_t type == 17;
Rich Lanea06d0c32013-03-25 08:52:03 -0700782 uint16_t len;
783 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700784 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700785};
786
Rich Lanee9c37db2013-06-21 18:30:24 -0700787struct of_action_pop_vlan : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700788 uint16_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -0700789 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700790 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700791};
792
Rich Lanee9c37db2013-06-21 18:30:24 -0700793struct of_action_push_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700794 uint16_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -0700795 uint16_t len;
796 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700797 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700798};
799
Rich Lanee9c37db2013-06-21 18:30:24 -0700800struct of_action_pop_mpls : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700801 uint16_t type == 20;
Rich Lanea06d0c32013-03-25 08:52:03 -0700802 uint16_t len;
803 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700804 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700805};
806
Rich Lanee9c37db2013-06-21 18:30:24 -0700807struct of_action_set_queue : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700808 uint16_t type == 21;
Rich Lanea06d0c32013-03-25 08:52:03 -0700809 uint16_t len;
810 uint32_t queue_id;
811};
812
Rich Lanee9c37db2013-06-21 18:30:24 -0700813struct of_action_group : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700814 uint16_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -0700815 uint16_t len;
816 uint32_t group_id;
817};
818
Rich Lanee9c37db2013-06-21 18:30:24 -0700819struct of_action_set_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700820 uint16_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -0700821 uint16_t len;
822 uint8_t nw_ttl;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700823 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700824};
825
Rich Lanee9c37db2013-06-21 18:30:24 -0700826struct of_action_dec_nw_ttl : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700827 uint16_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -0700828 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700829 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700830};
831
Rich Lanee9c37db2013-06-21 18:30:24 -0700832struct of_action_set_field : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700833 uint16_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -0700834 uint16_t len;
Rich Lanebe90eae2013-07-22 16:44:26 -0700835 of_oxm_t field;
Rich Lanea06d0c32013-03-25 08:52:03 -0700836};
837
Rich Lanee9c37db2013-06-21 18:30:24 -0700838struct of_action_experimenter : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700839 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700840 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700841 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700842 of_octets_t data;
843};
844
Rich Lanee9c37db2013-06-21 18:30:24 -0700845struct of_action_pop_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700846 uint16_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -0700847 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700848 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700849};
850
Rich Lanee9c37db2013-06-21 18:30:24 -0700851struct of_action_push_pbb : of_action {
Rich Lane31b87142013-05-09 22:05:42 -0700852 uint16_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -0700853 uint16_t len;
854 uint16_t ethertype;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700855 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700856};
857
Rich Lane68ae4d72013-05-09 10:55:19 -0700858struct of_action {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700859 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700860 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700861 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700862};
863
Rich Lane68ae4d72013-05-09 10:55:19 -0700864struct of_instruction {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700865 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700866 uint16_t len;
867};
868
Rich Lanee9c37db2013-06-21 18:30:24 -0700869struct of_instruction_goto_table : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700870 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700871 uint16_t len;
872 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700873 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -0700874};
875
Rich Lanee9c37db2013-06-21 18:30:24 -0700876struct of_instruction_write_metadata : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700877 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700878 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700879 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700880 uint64_t metadata;
881 uint64_t metadata_mask;
882};
883
Rich Lanee9c37db2013-06-21 18:30:24 -0700884struct of_instruction_write_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700885 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -0700886 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700887 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -0700888 list(of_action_t) actions;
889};
890
Rich Lanee9c37db2013-06-21 18:30:24 -0700891struct of_instruction_apply_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700892 uint16_t type == 4;
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 list(of_action_t) actions;
896};
897
Rich Lanee9c37db2013-06-21 18:30:24 -0700898struct of_instruction_clear_actions : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700899 uint16_t type == 5;
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};
903
Rich Lanee9c37db2013-06-21 18:30:24 -0700904struct of_instruction_meter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700905 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -0700906 uint16_t len;
907 uint32_t meter_id;
908};
909
Rich Lanee9c37db2013-06-21 18:30:24 -0700910struct of_instruction_experimenter : of_instruction {
Rich Lane31b87142013-05-09 22:05:42 -0700911 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -0700912 uint16_t len;
Rich Laneb25d07c2013-08-22 17:22:43 -0700913 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -0700914 of_octets_t data;
915};
916
Rich Lanee9c37db2013-06-21 18:30:24 -0700917struct of_flow_mod : of_header {
918 uint8_t version;
919 uint8_t type == 14;
920 uint16_t length;
921 uint32_t xid;
922 uint64_t cookie;
923 uint64_t cookie_mask;
924 uint8_t table_id;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -0700925 of_fm_cmd_t _command == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -0700926 uint16_t idle_timeout;
927 uint16_t hard_timeout;
928 uint16_t priority;
929 uint32_t buffer_id;
930 of_port_no_t out_port;
931 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700932 enum ofp_flow_mod_flags flags;
Rich Lanee9c37db2013-06-21 18:30:24 -0700933 pad(2);
934 of_match_t match;
935 list(of_instruction_t) instructions;
936};
937
938struct of_flow_add : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700939 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700940 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700941 uint16_t length;
942 uint32_t xid;
943 uint64_t cookie;
944 uint64_t cookie_mask;
945 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700946 of_fm_cmd_t _command == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -0700947 uint16_t idle_timeout;
948 uint16_t hard_timeout;
949 uint16_t priority;
950 uint32_t buffer_id;
951 of_port_no_t out_port;
952 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700953 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700954 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700955 of_match_t match;
956 list(of_instruction_t) instructions;
957};
958
Rich Lanee9c37db2013-06-21 18:30:24 -0700959struct of_flow_modify : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700960 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700961 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700962 uint16_t length;
963 uint32_t xid;
964 uint64_t cookie;
965 uint64_t cookie_mask;
966 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700967 of_fm_cmd_t _command == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -0700968 uint16_t idle_timeout;
969 uint16_t hard_timeout;
970 uint16_t priority;
971 uint32_t buffer_id;
972 of_port_no_t out_port;
973 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700974 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700975 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700976 of_match_t match;
977 list(of_instruction_t) instructions;
978};
979
Rich Lanee9c37db2013-06-21 18:30:24 -0700980struct of_flow_modify_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -0700981 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -0700982 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -0700983 uint16_t length;
984 uint32_t xid;
985 uint64_t cookie;
986 uint64_t cookie_mask;
987 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -0700988 of_fm_cmd_t _command == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -0700989 uint16_t idle_timeout;
990 uint16_t hard_timeout;
991 uint16_t priority;
992 uint32_t buffer_id;
993 of_port_no_t out_port;
994 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -0700995 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -0700996 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -0700997 of_match_t match;
998 list(of_instruction_t) instructions;
999};
1000
Rich Lanee9c37db2013-06-21 18:30:24 -07001001struct of_flow_delete : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001002 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001003 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001004 uint16_t length;
1005 uint32_t xid;
1006 uint64_t cookie;
1007 uint64_t cookie_mask;
1008 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001009 of_fm_cmd_t _command == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001010 uint16_t idle_timeout;
1011 uint16_t hard_timeout;
1012 uint16_t priority;
1013 uint32_t buffer_id;
1014 of_port_no_t out_port;
1015 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001016 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001017 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001018 of_match_t match;
1019 list(of_instruction_t) instructions;
1020};
1021
Rich Lanee9c37db2013-06-21 18:30:24 -07001022struct of_flow_delete_strict : of_flow_mod {
Rich Lanea06d0c32013-03-25 08:52:03 -07001023 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001024 uint8_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001025 uint16_t length;
1026 uint32_t xid;
1027 uint64_t cookie;
1028 uint64_t cookie_mask;
1029 uint8_t table_id;
Rich Lane31b87142013-05-09 22:05:42 -07001030 of_fm_cmd_t _command == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001031 uint16_t idle_timeout;
1032 uint16_t hard_timeout;
1033 uint16_t priority;
1034 uint32_t buffer_id;
1035 of_port_no_t out_port;
1036 uint32_t out_group;
Andreas Wundsamdfeb5942013-09-19 13:07:49 -07001037 enum ofp_flow_mod_flags flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001038 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001039 of_match_t match;
1040 list(of_instruction_t) instructions;
1041};
1042
Rich Lane68ae4d72013-05-09 10:55:19 -07001043struct of_bucket {
Rich Lanea06d0c32013-03-25 08:52:03 -07001044 uint16_t len;
1045 uint16_t weight;
1046 of_port_no_t watch_port;
1047 uint32_t watch_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001048 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001049 list(of_action_t) actions;
1050};
1051
Rich Lanee9c37db2013-06-21 18:30:24 -07001052struct of_group_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001053 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001054 uint8_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001055 uint16_t length;
1056 uint32_t xid;
1057 uint16_t command;
1058 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001059 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001060 uint32_t group_id;
1061 list(of_bucket_t) buckets;
1062};
1063
Rich Lanee9c37db2013-06-21 18:30:24 -07001064struct of_packet_out : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001065 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001066 uint8_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001067 uint16_t length;
1068 uint32_t xid;
1069 uint32_t buffer_id;
1070 of_port_no_t in_port;
1071 uint16_t actions_len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001072 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001073 list(of_action_t) actions;
1074 of_octets_t data;
1075};
1076
Rich Lanee9c37db2013-06-21 18:30:24 -07001077struct of_packet_in : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001078 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001079 uint8_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001080 uint16_t length;
1081 uint32_t xid;
1082 uint32_t buffer_id;
1083 uint16_t total_len;
1084 uint8_t reason;
1085 uint8_t table_id;
1086 uint64_t cookie;
1087 of_match_t match;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001088 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001089 of_octets_t data; /* FIXME: Ensure total_len gets updated */
1090};
1091
Rich Lanee9c37db2013-06-21 18:30:24 -07001092struct of_flow_removed : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001093 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001094 uint8_t type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001095 uint16_t length;
1096 uint32_t xid;
1097 uint64_t cookie;
1098 uint16_t priority;
1099 uint8_t reason;
1100 uint8_t table_id;
1101 uint32_t duration_sec;
1102 uint32_t duration_nsec;
1103 uint16_t idle_timeout;
1104 uint16_t hard_timeout;
1105 uint64_t packet_count;
1106 uint64_t byte_count;
1107 of_match_t match;
1108};
1109
Rich Lane68ae4d72013-05-09 10:55:19 -07001110struct of_meter_band {
Andreas Wundsam9ba65362013-08-02 19:14:42 -07001111 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001112 uint16_t len;
1113// uint32_t rate; // These are excluded b/c this is the header
1114// uint32_t burst_size; // These are excluded b/c this is the header
1115};
1116
Rich Lanee9c37db2013-06-21 18:30:24 -07001117struct of_meter_band_drop : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001118 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001119 uint16_t len;
1120 uint32_t rate;
1121 uint32_t burst_size;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001122 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001123};
1124
Rich Lanee9c37db2013-06-21 18:30:24 -07001125struct of_meter_band_dscp_remark : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001126 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001127 uint16_t len;
1128 uint32_t rate;
1129 uint32_t burst_size;
1130 uint8_t prec_level;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001131 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001132};
1133
Rich Lanee9c37db2013-06-21 18:30:24 -07001134struct of_meter_band_experimenter : of_meter_band {
Rich Lane31b87142013-05-09 22:05:42 -07001135 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001136 uint16_t len;
1137 uint32_t rate;
1138 uint32_t burst_size;
1139 uint32_t experimenter;
1140};
1141
Rich Lanee9c37db2013-06-21 18:30:24 -07001142struct of_meter_mod : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001143 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001144 uint8_t type == 29;
Rich Lanea06d0c32013-03-25 08:52:03 -07001145 uint16_t length;
1146 uint32_t xid;
1147 uint16_t command;
1148 uint16_t flags;
1149 uint32_t meter_id;
1150 list(of_meter_band_t) meters;
1151};
1152
Rich Lanee9c37db2013-06-21 18:30:24 -07001153struct of_error_msg : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001154 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001155 uint8_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001156 uint16_t length;
1157 uint32_t xid;
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001158 uint16_t err_type == ?;
1159};
1160
1161struct of_hello_failed_error_msg : of_error_msg {
1162 uint8_t version;
1163 uint8_t type == 1;
1164 uint16_t length;
1165 uint32_t xid;
1166 uint16_t err_type == 0;
1167 enum ofp_hello_failed_code code;
Rich Lanea06d0c32013-03-25 08:52:03 -07001168 of_octets_t data;
1169};
1170
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001171struct of_bad_request_error_msg : of_error_msg {
1172 uint8_t version;
1173 uint8_t type == 1;
1174 uint16_t length;
1175 uint32_t xid;
1176 uint16_t err_type == 1;
1177 enum ofp_bad_request_code code;
1178 of_octets_t data;
1179};
1180
1181struct of_bad_action_error_msg : of_error_msg {
1182 uint8_t version;
1183 uint8_t type == 1;
1184 uint16_t length;
1185 uint32_t xid;
1186 uint16_t err_type == 2;
1187 enum ofp_bad_action_code code;
1188 of_octets_t data;
1189};
1190
1191struct of_bad_instruction_error_msg : of_error_msg {
1192 uint8_t version;
1193 uint8_t type == 1;
1194 uint16_t length;
1195 uint32_t xid;
1196 uint16_t err_type == 3;
1197 enum ofp_bad_instruction_code code;
1198 of_octets_t data;
1199};
1200
1201struct of_bad_match_error_msg : of_error_msg {
1202 uint8_t version;
1203 uint8_t type == 1;
1204 uint16_t length;
1205 uint32_t xid;
1206 uint16_t err_type == 4;
1207 enum ofp_bad_match_code code;
1208 of_octets_t data;
1209};
1210
1211struct of_flow_mod_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 == 5;
1217 enum ofp_flow_mod_failed_code code;
1218 of_octets_t data;
1219};
1220
1221struct of_group_mod_failed_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 == 6;
1227 enum ofp_group_mod_failed_code code;
1228 of_octets_t data;
1229};
1230
1231struct of_port_mod_failed_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 == 7;
1237 enum ofp_port_mod_failed_code code;
1238 of_octets_t data;
1239};
1240
1241struct of_table_mod_failed_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 == 8;
1247 enum ofp_table_mod_failed_code code;
1248 of_octets_t data;
1249};
1250
1251struct of_queue_op_failed_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 == 9;
1257 enum ofp_queue_op_failed_code code;
1258 of_octets_t data;
1259};
1260
1261struct of_switch_config_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 == 10;
1267 enum ofp_switch_config_failed_code code;
1268 of_octets_t data;
1269};
1270
1271struct of_role_request_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 == 11;
1277 enum ofp_role_request_failed_code code;
1278 of_octets_t data;
1279};
1280
1281struct of_meter_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 == 12;
1287 enum ofp_meter_mod_failed_code code;
1288 of_octets_t data;
1289};
1290
1291struct of_table_features_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 == 13;
1297 enum ofp_table_features_failed_code code;
1298 of_octets_t data;
1299};
1300
1301struct of_experimenter_error_msg {
1302 uint8_t version;
1303 uint8_t type == 1;
1304 uint16_t length;
1305 uint32_t xid;
1306 uint16_t err_type == 0xffff;
1307 uint16_t subtype;
1308 uint32_t experimenter;
1309 of_octets_t data;
1310};
Rich Lanea06d0c32013-03-25 08:52:03 -07001311
1312// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1313
Rich Lane68ae4d72013-05-09 10:55:19 -07001314struct of_flow_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001315 uint16_t length;
1316 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001317 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001318 uint32_t duration_sec;
1319 uint32_t duration_nsec;
1320 uint16_t priority;
1321 uint16_t idle_timeout;
1322 uint16_t hard_timeout;
Rich Lane1a47c1c2013-08-28 15:27:00 -07001323 uint16_t flags;
1324 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001325 uint64_t cookie;
1326 uint64_t packet_count;
1327 uint64_t byte_count;
1328 of_match_t match;
1329 list(of_instruction_t) instructions;
1330};
1331
1332
Rich Lane68ae4d72013-05-09 10:55:19 -07001333struct of_table_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001334 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001335 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001336 uint32_t active_count;
1337 uint64_t lookup_count;
1338 uint64_t matched_count;
1339};
1340
Rich Lane68ae4d72013-05-09 10:55:19 -07001341struct of_port_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001342 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001343 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001344 uint64_t rx_packets;
1345 uint64_t tx_packets;
1346 uint64_t rx_bytes;
1347 uint64_t tx_bytes;
1348 uint64_t rx_dropped;
1349 uint64_t tx_dropped;
1350 uint64_t rx_errors;
1351 uint64_t tx_errors;
1352 uint64_t rx_frame_err;
1353 uint64_t rx_over_err;
1354 uint64_t rx_crc_err;
1355 uint64_t collisions;
1356 uint32_t duration_sec;
1357 uint32_t duration_nsec;
1358};
1359
Rich Lane68ae4d72013-05-09 10:55:19 -07001360struct of_queue_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001361 of_port_no_t port_no;
1362 uint32_t queue_id;
1363 uint64_t tx_bytes;
1364 uint64_t tx_packets;
1365 uint64_t tx_errors;
1366 uint32_t duration_sec;
1367 uint32_t duration_nsec;
1368};
1369
Rich Lane68ae4d72013-05-09 10:55:19 -07001370struct of_bucket_counter {
Rich Lanea06d0c32013-03-25 08:52:03 -07001371 uint64_t packet_count;
1372 uint64_t byte_count;
1373};
1374
Rich Lane68ae4d72013-05-09 10:55:19 -07001375struct of_group_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001376 uint16_t length;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001377 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001378 uint32_t group_id;
1379 uint32_t ref_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001380 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001381 uint64_t packet_count;
1382 uint64_t byte_count;
1383 uint32_t duration_sec;
1384 uint32_t duration_nsec;
1385 list(of_bucket_counter_t) bucket_stats;
1386};
1387
Rich Lane68ae4d72013-05-09 10:55:19 -07001388struct of_group_desc_stats_entry {
Rich Lanea06d0c32013-03-25 08:52:03 -07001389 uint16_t length;
Rich Lane35e7ac72013-10-15 10:36:10 -07001390 uint8_t group_type;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001391 pad(1);
Rich Lanea06d0c32013-03-25 08:52:03 -07001392 uint32_t group_id;
1393 list(of_bucket_t) buckets;
1394};
1395
1396// STATS:
1397// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1398
Rich Lanee9c37db2013-06-21 18:30:24 -07001399struct of_stats_request : of_header {
1400 uint8_t version;
1401 uint8_t type == 18;
1402 uint16_t length;
1403 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001404 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001405 uint16_t flags;
1406 pad(4);
1407};
1408
1409struct of_stats_reply : of_header {
1410 uint8_t version;
1411 uint8_t type == 19;
1412 uint16_t length;
1413 uint32_t xid;
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001414 uint16_t stats_type == ?;
Rich Lanee9c37db2013-06-21 18:30:24 -07001415 uint16_t flags;
1416 pad(4);
1417};
1418
1419struct of_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001420 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001421 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001422 uint16_t length;
1423 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001424 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001425 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001426 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001427};
1428
Rich Lanee9c37db2013-06-21 18:30:24 -07001429struct of_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001430 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001431 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001432 uint16_t length;
1433 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001434 uint16_t stats_type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001435 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001436 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001437 of_desc_str_t mfr_desc;
1438 of_desc_str_t hw_desc;
1439 of_desc_str_t sw_desc;
1440 of_serial_num_t serial_num;
1441 of_desc_str_t dp_desc;
1442};
1443
Rich Lanee9c37db2013-06-21 18:30:24 -07001444struct of_flow_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001445 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001446 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001447 uint16_t length;
1448 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001449 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001450 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001451 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001452 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001453 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001454 of_port_no_t out_port;
1455 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001456 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001457 uint64_t cookie;
1458 uint64_t cookie_mask;
1459 of_match_t match;
1460};
1461
Rich Lanee9c37db2013-06-21 18:30:24 -07001462struct of_flow_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001463 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001464 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001465 uint16_t length;
1466 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001467 uint16_t stats_type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001468 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001469 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001470 list(of_flow_stats_entry_t) entries;
1471};
1472
Rich Lanee9c37db2013-06-21 18:30:24 -07001473struct of_aggregate_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001474 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001475 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001476 uint16_t length;
1477 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001478 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001479 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001480 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001481 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001482 pad(3);
Rich Lanea06d0c32013-03-25 08:52:03 -07001483 of_port_no_t out_port;
1484 uint32_t out_group;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001485 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001486 uint64_t cookie;
1487 uint64_t cookie_mask;
1488 of_match_t match;
1489};
1490
Rich Lanee9c37db2013-06-21 18:30:24 -07001491struct of_aggregate_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001492 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001493 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001494 uint16_t length;
1495 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001496 uint16_t stats_type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001497 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001498 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001499 uint64_t packet_count;
1500 uint64_t byte_count;
1501 uint32_t flow_count;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001502 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001503};
1504
Rich Lanee9c37db2013-06-21 18:30:24 -07001505struct of_table_stats_request : of_stats_request {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001506 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001507 uint8_t type == 18;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001508 uint16_t length;
1509 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001510 uint16_t stats_type == 3;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001511 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001512 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001513};
1514
Rich Lanee9c37db2013-06-21 18:30:24 -07001515struct of_table_stats_reply : of_stats_reply {
Rich Lane8bfdafc2013-05-02 14:54:42 -07001516 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001517 uint8_t type == 19;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001518 uint16_t length;
1519 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001520 uint16_t stats_type == 3;
Rich Lane8bfdafc2013-05-02 14:54:42 -07001521 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001522 pad(4);
Rich Lane8bfdafc2013-05-02 14:54:42 -07001523 list(of_table_stats_entry_t) entries;
1524};
1525
Rich Lanea06d0c32013-03-25 08:52:03 -07001526// FIXME: These are padded to 8 byte align beyond the length indicated
1527
Rich Lane68ae4d72013-05-09 10:55:19 -07001528struct of_table_feature_prop {
Rich Lanea1b8f442013-10-01 22:05:22 -07001529 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001530 uint16_t length;
1531};
1532
Rich Lanee9c37db2013-06-21 18:30:24 -07001533struct of_table_feature_prop_instructions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001534 uint16_t type == 0;
Rich Lanea06d0c32013-03-25 08:52:03 -07001535 uint16_t length;
1536 // FIXME Check if instruction_t is right for ids here
1537 list(of_instruction_t) instruction_ids;
1538};
1539
Rich Lanee9c37db2013-06-21 18:30:24 -07001540struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001541 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001542 uint16_t length;
1543 list(of_instruction_t) instruction_ids;
1544};
1545
Rich Lanee9c37db2013-06-21 18:30:24 -07001546struct of_table_feature_prop_next_tables : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001547 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001548 uint16_t length;
1549 list(of_uint8_t) next_table_ids;
1550};
1551
Rich Lanee9c37db2013-06-21 18:30:24 -07001552struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001553 uint16_t type == 3;
Rich Lanea06d0c32013-03-25 08:52:03 -07001554 uint16_t length;
1555 list(of_uint8_t) next_table_ids;
1556};
1557
Rich Lanee9c37db2013-06-21 18:30:24 -07001558struct of_table_feature_prop_write_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001559 uint16_t type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001560 uint16_t length;
1561 list(of_action_id_t) action_ids;
1562};
1563
Rich Lanee9c37db2013-06-21 18:30:24 -07001564struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001565 uint16_t type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001566 uint16_t length;
1567 list(of_action_id_t) action_ids;
1568};
1569
Rich Lanee9c37db2013-06-21 18:30:24 -07001570struct of_table_feature_prop_apply_actions : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001571 uint16_t type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001572 uint16_t length;
1573 list(of_action_id_t) action_ids;
1574};
1575
Rich Lanee9c37db2013-06-21 18:30:24 -07001576struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001577 uint16_t type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001578 uint16_t length;
1579 list(of_action_id_t) action_ids;
1580};
1581
Rich Lanee9c37db2013-06-21 18:30:24 -07001582struct of_table_feature_prop_match : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001583 uint16_t type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001584 uint16_t length;
1585 list(of_uint32_t) oxm_ids;
1586};
1587
Rich Lanee9c37db2013-06-21 18:30:24 -07001588struct of_table_feature_prop_wildcards : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001589 uint16_t type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001590 uint16_t length;
1591 list(of_uint32_t) oxm_ids;
1592};
1593
Rich Lanee9c37db2013-06-21 18:30:24 -07001594struct of_table_feature_prop_write_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001595 uint16_t type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001596 uint16_t length;
1597 list(of_uint32_t) oxm_ids;
1598};
1599
Rich Lanee9c37db2013-06-21 18:30:24 -07001600struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001601 uint16_t type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001602 uint16_t length;
1603 list(of_uint32_t) oxm_ids;
1604};
1605
Rich Lanee9c37db2013-06-21 18:30:24 -07001606struct of_table_feature_prop_apply_setfield : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001607 uint16_t type == 14;
Rich Lanea06d0c32013-03-25 08:52:03 -07001608 uint16_t length;
1609 list(of_uint32_t) oxm_ids;
1610};
1611
Rich Lanee9c37db2013-06-21 18:30:24 -07001612struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001613 uint16_t type == 15;
Rich Lanea06d0c32013-03-25 08:52:03 -07001614 uint16_t length;
1615 list(of_uint32_t) oxm_ids;
1616};
1617
Rich Lanee9c37db2013-06-21 18:30:24 -07001618struct of_table_feature_prop_experimenter : of_table_feature_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001619 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001620 uint16_t length;
1621 uint32_t experimenter;
1622 uint32_t subtype;
1623 of_octets_t experimenter_data;
1624};
1625
1626// Not yet supported
Rich Lanee9c37db2013-06-21 18:30:24 -07001627// struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
Rich Lanea06d0c32013-03-25 08:52:03 -07001628// uint16_t type;
1629// uint16_t length;
1630// uint32_t experimenter;
1631// uint32_t subtype;
1632// of_octets_t experimenter_data;
1633// };
1634
Rich Lane68ae4d72013-05-09 10:55:19 -07001635struct of_table_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001636 uint16_t length;
1637 uint8_t table_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001638 pad(5);
Rich Lanea06d0c32013-03-25 08:52:03 -07001639 of_table_name_t name;
1640 uint64_t metadata_match;
1641 uint64_t metadata_write;
1642 uint32_t config;
1643 uint32_t max_entries;
1644 list(of_table_feature_prop_t) properties;
1645};
1646
Rich Lane68ae4d72013-05-09 10:55:19 -07001647struct of_meter_features {
Rich Lanea06d0c32013-03-25 08:52:03 -07001648 uint32_t max_meter;
1649 uint32_t band_types;
1650 uint32_t capabilities;
1651 uint8_t max_bands;
1652 uint8_t max_color;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001653 pad(2);
Rich Lanea06d0c32013-03-25 08:52:03 -07001654};
1655
Rich Lanee9c37db2013-06-21 18:30:24 -07001656struct of_port_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001657 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001658 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001659 uint16_t length;
1660 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001661 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001662 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001663 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001664 of_port_no_t port_no;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001665 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001666};
1667
Rich Lanee9c37db2013-06-21 18:30:24 -07001668struct of_port_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001669 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001670 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001671 uint16_t length;
1672 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001673 uint16_t stats_type == 4;
Rich Lanea06d0c32013-03-25 08:52:03 -07001674 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001675 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001676 list(of_port_stats_entry_t) entries;
1677};
1678
Rich Lanee9c37db2013-06-21 18:30:24 -07001679struct of_queue_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001680 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001681 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001682 uint16_t length;
1683 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001684 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001685 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001686 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001687 of_port_no_t port_no;
1688 uint32_t queue_id;
1689};
1690
Rich Lanee9c37db2013-06-21 18:30:24 -07001691struct of_queue_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001692 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001693 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001694 uint16_t length;
1695 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001696 uint16_t stats_type == 5;
Rich Lanea06d0c32013-03-25 08:52:03 -07001697 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001698 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001699 list(of_queue_stats_entry_t) entries;
1700};
1701
Rich Lanee9c37db2013-06-21 18:30:24 -07001702struct of_group_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001703 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001704 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001705 uint16_t length;
1706 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001707 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001708 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001709 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001710 uint32_t group_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001711 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001712};
1713
Rich Lanee9c37db2013-06-21 18:30:24 -07001714struct of_group_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001715 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001716 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001717 uint16_t length;
1718 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001719 uint16_t stats_type == 6;
Rich Lanea06d0c32013-03-25 08:52:03 -07001720 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001721 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001722 list(of_group_stats_entry_t) entries;
1723};
1724
Rich Lanee9c37db2013-06-21 18:30:24 -07001725struct of_group_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001726 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001727 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001728 uint16_t length;
1729 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001730 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001731 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001732 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001733};
1734
Rich Lanee9c37db2013-06-21 18:30:24 -07001735struct of_group_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001736 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001737 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001738 uint16_t length;
1739 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001740 uint16_t stats_type == 7;
Rich Lanea06d0c32013-03-25 08:52:03 -07001741 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001742 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001743 list(of_group_desc_stats_entry_t) entries;
1744};
1745
Rich Lanee9c37db2013-06-21 18:30:24 -07001746struct of_group_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001747 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001748 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001749 uint16_t length;
1750 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001751 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001752 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001753 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001754};
1755
Rich Lanee9c37db2013-06-21 18:30:24 -07001756struct of_group_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001757 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001758 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001759 uint16_t length;
1760 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001761 uint16_t stats_type == 8;
Rich Lanea06d0c32013-03-25 08:52:03 -07001762 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001763 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001764 uint32_t types;
1765 uint32_t capabilities;
1766 uint32_t max_groups_all;
1767 uint32_t max_groups_select;
1768 uint32_t max_groups_indirect;
1769 uint32_t max_groups_ff;
1770 uint32_t actions_all;
1771 uint32_t actions_select;
1772 uint32_t actions_indirect;
1773 uint32_t actions_ff;
1774};
1775
Rich Lanee9c37db2013-06-21 18:30:24 -07001776struct of_meter_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 == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -07001782 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001783 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001784 uint32_t meter_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_meter_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 == 9;
Rich Lanea06d0c32013-03-25 08:52:03 -07001794 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001795 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001796 list(of_meter_stats_t) entries;
1797};
1798
Rich Lanee9c37db2013-06-21 18:30:24 -07001799struct of_meter_config_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 == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001805 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001806 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001807 uint32_t meter_id;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001808 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001809};
1810
Rich Lanee9c37db2013-06-21 18:30:24 -07001811struct of_meter_config_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001812 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001813 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001814 uint16_t length;
1815 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001816 uint16_t stats_type == 10;
Rich Lanea06d0c32013-03-25 08:52:03 -07001817 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001818 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001819 list(of_meter_band_t) entries;
1820};
1821
1822// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001823struct of_meter_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001824 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001825 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001826 uint16_t length;
1827 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001828 uint16_t stats_type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001829 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001830 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001831};
1832
1833// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001834struct of_meter_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001835 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001836 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001837 uint16_t length;
1838 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001839 uint16_t stats_type == 11;
Rich Lanea06d0c32013-03-25 08:52:03 -07001840 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001841 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001842 of_meter_features_t features;
1843};
1844
1845// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001846struct of_table_features_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001847 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001848 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001849 uint16_t length;
1850 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001851 uint16_t stats_type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001852 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001853 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001854 list(of_table_features_t) entries;
1855};
1856
1857// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001858struct of_table_features_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001859 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001860 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001861 uint16_t length;
1862 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001863 uint16_t stats_type == 12;
Rich Lanea06d0c32013-03-25 08:52:03 -07001864 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001865 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001866 list(of_table_features_t) entries;
1867};
1868
1869// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001870struct of_port_desc_stats_request : of_stats_request {
Rich Lanea06d0c32013-03-25 08:52:03 -07001871 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001872 uint8_t type == 18;
Rich Lanea06d0c32013-03-25 08:52:03 -07001873 uint16_t length;
1874 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001875 uint16_t stats_type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001876 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001877 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001878};
1879
1880// FIXME stats added to get things working
Rich Lanee9c37db2013-06-21 18:30:24 -07001881struct of_port_desc_stats_reply : of_stats_reply {
Rich Lanea06d0c32013-03-25 08:52:03 -07001882 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001883 uint8_t type == 19;
Rich Lanea06d0c32013-03-25 08:52:03 -07001884 uint16_t length;
1885 uint32_t xid;
Rich Lane31b87142013-05-09 22:05:42 -07001886 uint16_t stats_type == 13;
Rich Lanea06d0c32013-03-25 08:52:03 -07001887 uint16_t flags;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001888 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001889 list(of_port_desc_t) entries;
1890};
1891
Rich Lane68ae4d72013-05-09 10:55:19 -07001892struct of_meter_band_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001893 uint64_t packet_band_count;
1894 uint64_t byte_band_count;
1895};
1896
Rich Lane68ae4d72013-05-09 10:55:19 -07001897struct of_meter_stats {
Rich Lanea06d0c32013-03-25 08:52:03 -07001898 uint32_t meter_id;
1899 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001900 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001901 uint32_t flow_count;
1902 uint64_t packet_in_count;
1903 uint64_t byte_in_count;
1904 uint32_t duration_sec;
1905 uint32_t duration_nsec;
1906 list(of_meter_band_stats_t) band_stats;
1907};
1908
Rich Lane68ae4d72013-05-09 10:55:19 -07001909struct of_meter_config {
Rich Lanea06d0c32013-03-25 08:52:03 -07001910 uint16_t length;
1911 uint16_t flags;
1912 uint32_t meter_id;
1913 list(of_meter_band_t) entries;
1914};
1915
Rob Vaterlausfeee3712013-09-30 11:24:19 -07001916struct of_experimenter_stats_header {
Rich Laneb25d07c2013-08-22 17:22:43 -07001917 uint32_t experimenter == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001918 uint32_t subtype;
1919};
1920
1921// END OF STATS OBJECTS
1922
Rich Lane68ae4d72013-05-09 10:55:19 -07001923struct of_queue_prop {
Andreas Wundsamc37ba3d2013-08-02 17:51:51 -07001924 uint16_t type == ?;
Rich Lanea06d0c32013-03-25 08:52:03 -07001925 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001926 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001927};
1928
Rich Lanee9c37db2013-06-21 18:30:24 -07001929struct of_queue_prop_min_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001930 uint16_t type == 1;
Rich Lanea06d0c32013-03-25 08:52:03 -07001931 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001932 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001933 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001934 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001935};
1936
Rich Lanee9c37db2013-06-21 18:30:24 -07001937struct of_queue_prop_max_rate : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001938 uint16_t type == 2;
Rich Lanea06d0c32013-03-25 08:52:03 -07001939 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001940 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001941 uint16_t rate;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001942 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001943};
1944
Rich Lanee9c37db2013-06-21 18:30:24 -07001945struct of_queue_prop_experimenter : of_queue_prop {
Rich Lane31b87142013-05-09 22:05:42 -07001946 uint16_t type == 65535;
Rich Lanea06d0c32013-03-25 08:52:03 -07001947 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001948 pad(4);
Rich Laneb25d07c2013-08-22 17:22:43 -07001949 uint32_t experimenter == ?;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001950 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001951 of_octets_t data;
1952};
1953
Rich Lane68ae4d72013-05-09 10:55:19 -07001954struct of_packet_queue {
Rich Lanea06d0c32013-03-25 08:52:03 -07001955 uint32_t queue_id;
1956 of_port_no_t port;
1957 uint16_t len;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001958 pad(6);
Rich Lanea06d0c32013-03-25 08:52:03 -07001959 list(of_queue_prop_t) properties;
1960};
1961
Rich Lanee9c37db2013-06-21 18:30:24 -07001962struct of_queue_get_config_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001963 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001964 uint8_t type == 22;
Rich Lanea06d0c32013-03-25 08:52:03 -07001965 uint16_t length;
1966 uint32_t xid;
1967 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001968 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001969};
1970
Rich Lanee9c37db2013-06-21 18:30:24 -07001971struct of_queue_get_config_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001972 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001973 uint8_t type == 23;
Rich Lanea06d0c32013-03-25 08:52:03 -07001974 uint16_t length;
1975 uint32_t xid;
1976 of_port_no_t port;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001977 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001978 list(of_packet_queue_t) queues;
1979};
1980
Rich Lanee9c37db2013-06-21 18:30:24 -07001981struct of_role_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001982 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001983 uint8_t type == 24;
Rich Lanea06d0c32013-03-25 08:52:03 -07001984 uint16_t length;
1985 uint32_t xid;
1986 uint32_t role;
Rich Lanee2af4ee2013-05-09 11:04:06 -07001987 pad(4);
Rich Lanea06d0c32013-03-25 08:52:03 -07001988 uint64_t generation_id;
1989};
1990
Rich Lanee9c37db2013-06-21 18:30:24 -07001991struct of_role_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07001992 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07001993 uint8_t type == 25;
Rich Lanea06d0c32013-03-25 08:52:03 -07001994 uint16_t length;
1995 uint32_t xid;
1996 of_octets_t data;
1997};
1998
1999////////////////////////////////////////////////////////////////
2000// FIXME understand async; where do bitmasks live?
2001// Determine bitmap type for masks below.
2002// DOCUMENT masks where uint32_t[0] is interest for equal/master
2003// while uint32_t[1] is interest for slave
2004////////////////////////////////////////////////////////////////
2005
Rich Lanee9c37db2013-06-21 18:30:24 -07002006struct of_async_get_request : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002007 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002008 uint8_t type == 26;
Rich Lanea06d0c32013-03-25 08:52:03 -07002009 uint16_t length;
2010 uint32_t xid;
2011 uint32_t packet_in_mask_equal_master;
2012 uint32_t packet_in_mask_slave;
2013 uint32_t port_status_mask_equal_master;
2014 uint32_t port_status_mask_slave;
2015 uint32_t flow_removed_mask_equal_master;
2016 uint32_t flow_removed_mask_slave;
2017};
2018
Rich Lanee9c37db2013-06-21 18:30:24 -07002019struct of_async_get_reply : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002020 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002021 uint8_t type == 27;
Rich Lanea06d0c32013-03-25 08:52:03 -07002022 uint16_t length;
2023 uint32_t xid;
2024 uint32_t packet_in_mask_equal_master;
2025 uint32_t packet_in_mask_slave;
2026 uint32_t port_status_mask_equal_master;
2027 uint32_t port_status_mask_slave;
2028 uint32_t flow_removed_mask_equal_master;
2029 uint32_t flow_removed_mask_slave;
2030};
2031
Rich Lanee9c37db2013-06-21 18:30:24 -07002032struct of_async_set : of_header {
Rich Lanea06d0c32013-03-25 08:52:03 -07002033 uint8_t version;
Rich Lane31b87142013-05-09 22:05:42 -07002034 uint8_t type == 28;
Rich Lanea06d0c32013-03-25 08:52:03 -07002035 uint16_t length;
2036 uint32_t xid;
2037 uint32_t packet_in_mask_equal_master;
2038 uint32_t packet_in_mask_slave;
2039 uint32_t port_status_mask_equal_master;
2040 uint32_t port_status_mask_slave;
2041 uint32_t flow_removed_mask_equal_master;
2042 uint32_t flow_removed_mask_slave;
2043};