blob: 23e96ed47dacac57a6abb70ef06f44d2fdc99e4d [file] [log] [blame]
alshabib9f50e482014-08-23 17:10:57 -05001// 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.
27//
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
31
32#version 5
33
34enum macro_definitions {
35 OFP_MAX_TABLE_NAME_LEN = 32,
36 OFP_MAX_PORT_NAME_LEN = 16,
37
38 OFP_TCP_PORT = 6653,
39 OFP_SSL_PORT = 6653,
40
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
61enum ofp_port(wire_type=uint32_t) {
62 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,
70 OFPP_ANY = 0xffffffff,
71};
72
73enum ofp_type(wire_type=uint8_t) {
74 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,
92 OFPT_STATS_REQUEST = 18,
93 OFPT_STATS_REPLY = 19,
94 OFPT_BARRIER_REQUEST = 20,
95 OFPT_BARRIER_REPLY = 21,
96 OFPT_ROLE_REQUEST = 24,
97 OFPT_ROLE_REPLY = 25,
98 OFPT_GET_ASYNC_REQUEST = 26,
99 OFPT_GET_ASYNC_REPLY = 27,
100 OFPT_SET_ASYNC = 28,
101 OFPT_METER_MOD = 29,
102 OFPT_ROLE_STATUS = 30,
103 OFPT_TABLE_STATUS = 31,
Rich Lane457bc452014-10-17 18:04:56 -0700104 OFPT_REQUESTFORWARD = 32,
alshabib9f50e482014-08-23 17:10:57 -0500105 OFPT_BUNDLE_CONTROL = 33,
106 OFPT_BUNDLE_ADD_MESSAGE = 34,
107};
108
109enum ofp_config_flags(wire_type=uint16_t, bitmask=True) {
110 OFPC_FRAG_NORMAL = 0,
111 OFPC_FRAG_DROP = 1,
112 OFPC_FRAG_REASM = 2,
113 OFPC_FRAG_MASK = 3,
114};
115
116enum ofp_table_config(wire_type=uint32_t, bitmask=True) {
117 OFPTC_DEPRECATED_MASK = 0x3,
118 OFPTC_EVICTION = 0x4,
119 OFPTC_VACANCY_EVENTS = 0x8,
120};
121
122enum ofp_table(wire_type=uint8_t, complete=False) {
123 OFPTT_MAX = 0xfe,
124 OFPTT_ALL = 0xff,
125};
126
127enum ofp_capabilities(wire_type=uint32_t, bitmask=True) {
128 OFPC_FLOW_STATS = 0x1,
129 OFPC_TABLE_STATS = 0x2,
130 OFPC_PORT_STATS = 0x4,
131 OFPC_GROUP_STATS = 0x8,
132 OFPC_IP_REASM = 0x20,
133 OFPC_QUEUE_STATS = 0x40,
134 OFPC_PORT_BLOCKED = 0x100,
135};
136
137enum ofp_port_config(wire_type=uint32_t, bitmask=True) {
138 OFPPC_PORT_DOWN = 0x1,
139 OFPPC_NO_RECV = 0x4,
140 OFPPC_NO_FWD = 0x20,
141 OFPPC_NO_PACKET_IN = 0x40,
142 OFPPC_BSN_MIRROR_DEST = 0x80000000,
143};
144
145enum ofp_port_state(wire_type=uint32_t, bitmask=True) {
146 OFPPS_LINK_DOWN = 0x1,
147 OFPPS_BLOCKED = 0x2,
148 OFPPS_LIVE = 0x4,
149};
150
151enum ofp_port_features(wire_type=uint32_t, bitmask=True) {
152 OFPPF_10MB_HD = 0x1,
153 OFPPF_10MB_FD = 0x2,
154 OFPPF_100MB_HD = 0x4,
155 OFPPF_100MB_FD = 0x8,
156 OFPPF_1GB_HD = 0x10,
157 OFPPF_1GB_FD = 0x20,
158 OFPPF_10GB_FD = 0x40,
159 OFPPF_40GB_FD = 0x80,
160 OFPPF_100GB_FD = 0x100,
161 OFPPF_1TB_FD = 0x200,
162 OFPPF_OTHER = 0x400,
163 OFPPF_COPPER = 0x800,
164 OFPPF_FIBER = 0x1000,
165 OFPPF_AUTONEG = 0x2000,
166 OFPPF_PAUSE = 0x4000,
167 OFPPF_PAUSE_ASYM = 0x8000,
168};
169
170enum ofp_port_reason(wire_type=uint8_t) {
171 OFPPR_ADD = 0,
172 OFPPR_DELETE = 1,
173 OFPPR_MODIFY = 2,
174};
175
176enum ofp_match_type(wire_type=uint16_t) {
177 OFPMT_STANDARD = 0,
178 OFPMT_OXM = 1,
179};
180
181enum ofp_oxm_class(wire_type=uint16_t) {
182 OFPXMC_NXM_0 = 0,
183 OFPXMC_NXM_1 = 1,
184 OFPXMC_OPENFLOW_BASIC = 0x8000,
185 OFPXMC_EXPERIMENTER = 0xffff,
186};
187
188enum ofp_vlan_id(wire_type=uint16_t) {
189 OFPVID_NONE = 0,
190 OFPVID_PRESENT = 0x1000,
191};
192
193// FIXME: OF spec specified this as '9' bits, implicitly adding
194// to full byte
195enum ofp_ipv6exthdr_flags(wire_type=uint16_t, bitmask=True) {
196 OFPIEH_NONEXT = 0x1,
197 OFPIEH_ESP = 0x2,
198 OFPIEH_AUTH = 0x4,
199 OFPIEH_DEST = 0x8,
200 OFPIEH_FRAG = 0x10,
201 OFPIEH_ROUTER = 0x20,
202 OFPIEH_HOP = 0x40,
203 OFPIEH_UNREP = 0x80,
204 OFPIEH_UNSEQ = 0x100,
205};
206
207enum ofp_action_type(wire_type=uint16_t) {
208 OFPAT_OUTPUT = 0,
209 OFPAT_COPY_TTL_OUT = 0xb,
210 OFPAT_COPY_TTL_IN = 0xc,
211 OFPAT_SET_MPLS_TTL = 0xf,
212 OFPAT_DEC_MPLS_TTL = 0x10,
213 OFPAT_PUSH_VLAN = 0x11,
214 OFPAT_POP_VLAN = 0x12,
215 OFPAT_PUSH_MPLS = 0x13,
216 OFPAT_POP_MPLS = 0x14,
217 OFPAT_SET_QUEUE = 0x15,
218 OFPAT_GROUP = 0x16,
219 OFPAT_SET_NW_TTL = 0x17,
220 OFPAT_DEC_NW_TTL = 0x18,
221 OFPAT_SET_FIELD = 0x19,
222 OFPAT_PUSH_PBB = 0x1a,
223 OFPAT_POP_PBB = 0x1b,
224 OFPAT_EXPERIMENTER = 0xffff,
225};
226
227enum ofp_controller_max_len(wire_type=uint16_t, complete=False) {
228 OFPCML_MAX = 0xffe5,
229 OFPCML_NO_BUFFER = 0xffff,
230};
231
232enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
233 OFPIT_GOTO_TABLE = 0x1,
234 OFPIT_WRITE_METADATA = 0x2,
235 OFPIT_WRITE_ACTIONS = 0x3,
236 OFPIT_APPLY_ACTIONS = 0x4,
237 OFPIT_CLEAR_ACTIONS = 0x5,
238 OFPIT_METER = 0x6,
239 OFPIT_EXPERIMENTER = 0xffff,
240};
241
242enum ofp_flow_mod_command(wire_type=uint8_t) {
243 OFPFC_ADD = 0,
244 OFPFC_MODIFY = 1,
245 OFPFC_MODIFY_STRICT = 2,
246 OFPFC_DELETE = 3,
247 OFPFC_DELETE_STRICT = 4,
248};
249
250enum ofp_flow_mod_flags(wire_type=uint16_t, bitmask=True) {
251 OFPFF_SEND_FLOW_REM = 0x1,
252 OFPFF_CHECK_OVERLAP = 0x2,
253 OFPFF_RESET_COUNTS = 0x4,
254 OFPFF_NO_PKT_COUNTS = 0x8,
255 OFPFF_NO_BYT_COUNTS = 0x10,
256
257 /* Non-standard, enabled by an experimenter message */
258 /* See the bsn_flow_idle input file */
259 OFPFF_BSN_SEND_IDLE = 0x80,
260};
261
262enum ofp_group(wire_type=uint32_t, complete=False) {
263 OFPG_MAX = 0xffffff00,
264 OFPG_ALL = 0xfffffffc,
265 OFPG_ANY = 0xffffffff,
266};
267
268enum ofp_group_mod_command(wire_type=uint16_t) {
269 OFPGC_ADD = 0,
270 OFPGC_MODIFY = 1,
271 OFPGC_DELETE = 2,
272};
273
274enum ofp_group_type(wire_type=uint8_t) {
275 OFPGT_ALL = 0,
276 OFPGT_SELECT = 1,
277 OFPGT_INDIRECT = 2,
278 OFPGT_FF = 3,
279};
280
281enum ofp_packet_in_reason(wire_type=uint8_t) {
282 OFPR_NO_MATCH = 0,
283 OFPR_ACTION = 1,
284 OFPR_INVALID_TTL = 2,
285 OFPR_ACTION_SET = 3,
286 OFPR_GROUP = 4,
287 OFPR_PACKET_OUT = 5,
288
289 // non-standard BSN extensions. OF does not have a standard-conformant
290 // way to extend the set of packet_in reasons
291 OFPR_BSN_NEW_HOST = 128,
292 OFPR_BSN_STATION_MOVE = 129,
293 OFPR_BSN_BAD_VLAN = 130,
294 OFPR_BSN_DESTINATION_LOOKUP_FAILURE = 131,
295 OFPR_BSN_NO_ROUTE = 132,
296 OFPR_BSN_ICMP_ECHO_REQUEST = 133,
297 OFPR_BSN_DEST_NETWORK_UNREACHABLE = 134,
298 OFPR_BSN_DEST_HOST_UNREACHABLE = 135,
299 OFPR_BSN_DEST_PORT_UNREACHABLE = 136,
300 OFPR_BSN_FRAGMENTATION_REQUIRED = 137,
301 OFPR_BSN_ARP = 139,
302 OFPR_BSN_DHCP = 140,
303 OFPR_BSN_DEBUG = 141,
304 OFPR_BSN_PACKET_OF_DEATH = 142,
305};
306
307enum ofp_flow_removed_reason(wire_type=uint8_t) {
308 OFPRR_IDLE_TIMEOUT = 0,
309 OFPRR_HARD_TIMEOUT = 1,
310 OFPRR_DELETE = 2,
311 OFPRR_GROUP_DELETE = 3,
312 OFPRR_METER_DELETE = 4,
313 OFPRR_EVICTION = 5,
314};
315
316enum ofp_meter(wire_type=uint32_t, complete=False) {
317 OFPM_MAX = 0xffff0000,
318 OFPM_SLOWPATH = 0xfffffffd,
319 OFPM_CONTROLLER = 0xfffffffe,
320 OFPM_ALL = 0xffffffff,
321};
322
323enum ofp_meter_band_type(wire_type=uint16_t) {
324 OFPMBT_DROP = 0x1,
325 OFPMBT_DSCP_REMARK = 0x2,
326 OFPMBT_EXPERIMENTER = 0xffff,
327};
328
329enum ofp_meter_mod_command(wire_type=uint16_t) {
330 OFPMC_ADD = 0,
331 OFPMC_MODIFY = 1,
332 OFPMC_DELETE = 2,
333};
334
335enum ofp_meter_flags(wire_type=uint16_t, bitmask=True) {
336 OFPMF_KBPS = 0x1,
337 OFPMF_PKTPS = 0x2,
338 OFPMF_BURST = 0x4,
339 OFPMF_STATS = 0x8,
340};
341
342enum ofp_error_type(wire_type=uint16_t) {
343 OFPET_HELLO_FAILED = 0,
344 OFPET_BAD_REQUEST = 1,
345 OFPET_BAD_ACTION = 2,
346 OFPET_BAD_INSTRUCTION = 3,
347 OFPET_BAD_MATCH = 4,
348 OFPET_FLOW_MOD_FAILED = 5,
349 OFPET_GROUP_MOD_FAILED = 6,
350 OFPET_PORT_MOD_FAILED = 7,
351 OFPET_TABLE_MOD_FAILED = 8,
352 OFPET_QUEUE_OP_FAILED = 9,
353 OFPET_SWITCH_CONFIG_FAILED = 10,
354 OFPET_ROLE_REQUEST_FAILED = 11,
355 OFPET_METER_MOD_FAILED = 12,
356 OFPET_TABLE_FEATURES_FAILED = 13,
357 OFPET_BAD_PROPERTY = 14,
358 OFPET_ASYNC_CONFIG_FAILED = 15,
359 OFPET_FLOW_MONITOR_FAILED = 16,
360 OFPET_BUNDLE_FAILED = 17,
361 OFPET_EXPERIMENTER = 0xffff,
362};
363
364enum ofp_hello_failed_code(wire_type=uint16_t) {
365 OFPHFC_INCOMPATIBLE = 0,
366 OFPHFC_EPERM = 1,
367};
368
369enum ofp_bad_request_code(wire_type=uint16_t) {
370 OFPBRC_BAD_VERSION = 0,
371 OFPBRC_BAD_TYPE = 1,
372 OFPBRC_BAD_STAT = 2,
373 OFPBRC_BAD_EXPERIMENTER = 3,
374 OFPBRC_BAD_EXPERIMENTER_TYPE = 4,
375 OFPBRC_EPERM = 5,
376 OFPBRC_BAD_LEN = 6,
377 OFPBRC_BUFFER_EMPTY = 7,
378 OFPBRC_BUFFER_UNKNOWN = 8,
379 OFPBRC_BAD_TABLE_ID = 9,
380 OFPBRC_IS_SLAVE = 10,
381 OFPBRC_BAD_PORT = 11,
382 OFPBRC_BAD_PACKET = 12,
383 OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13,
384 OFPBRC_MULTIPART_REQUEST_TIMEOUT = 14,
385 OFPBRC_MULTIPART_REPLY_TIMEOUT = 15,
386};
387
388enum ofp_bad_action_code(wire_type=uint16_t) {
389 OFPBAC_BAD_TYPE = 0,
390 OFPBAC_BAD_LEN = 1,
391 OFPBAC_BAD_EXPERIMENTER = 2,
392 OFPBAC_BAD_EXPERIMENTER_TYPE = 3,
393 OFPBAC_BAD_OUT_PORT = 4,
394 OFPBAC_BAD_ARGUMENT = 5,
395 OFPBAC_EPERM = 6,
396 OFPBAC_TOO_MANY = 7,
397 OFPBAC_BAD_QUEUE = 8,
398 OFPBAC_BAD_OUT_GROUP = 9,
399 OFPBAC_MATCH_INCONSISTENT = 10,
400 OFPBAC_UNSUPPORTED_ORDER = 11,
401 OFPBAC_BAD_TAG = 12,
402 OFPBAC_BAD_SET_TYPE = 13,
403 OFPBAC_BAD_SET_LEN = 14,
404 OFPBAC_BAD_SET_ARGUMENT = 15,
405};
406
407enum ofp_bad_instruction_code(wire_type=uint16_t) {
408 OFPBIC_UNKNOWN_INST = 0,
409 OFPBIC_UNSUP_INST = 1,
410 OFPBIC_BAD_TABLE_ID = 2,
411 OFPBIC_UNSUP_METADATA = 3,
412 OFPBIC_UNSUP_METADATA_MASK = 4,
413 OFPBIC_BAD_EXPERIMENTER = 5,
414 OFPBIC_BAD_EXPERIMENTER_TYPE = 6,
415 OFPBIC_BAD_LEN = 7,
416 OFPBIC_EPERM = 8,
417 OFPBIC_DUP_INST = 9,
418};
419
420enum ofp_bad_match_code(wire_type=uint16_t) {
421 OFPBMC_BAD_TYPE = 0,
422 OFPBMC_BAD_LEN = 1,
423 OFPBMC_BAD_TAG = 2,
424 OFPBMC_BAD_DL_ADDR_MASK = 3,
425 OFPBMC_BAD_NW_ADDR_MASK = 4,
426 OFPBMC_BAD_WILDCARDS = 5,
427 OFPBMC_BAD_FIELD = 6,
428 OFPBMC_BAD_VALUE = 7,
429 OFPBMC_BAD_MASK = 8,
430 OFPBMC_BAD_PREREQ = 9,
431 OFPBMC_DUP_FIELD = 10,
432 OFPBMC_EPERM = 11,
433};
434
435enum ofp_flow_mod_failed_code(wire_type=uint16_t) {
436 OFPFMFC_UNKNOWN = 0,
437 OFPFMFC_TABLE_FULL = 1,
438 OFPFMFC_BAD_TABLE_ID = 2,
439 OFPFMFC_OVERLAP = 3,
440 OFPFMFC_EPERM = 4,
441 OFPFMFC_BAD_TIMEOUT = 5,
442 OFPFMFC_BAD_COMMAND = 6,
443 OFPFMFC_BAD_FLAGS = 7,
444 OFPFMFC_CANT_SYNC = 8,
445 OFPFMFC_BAD_PRIORITY = 9,
446};
447
448enum ofp_group_mod_failed_code(wire_type=uint16_t) {
449 OFPGMFC_GROUP_EXISTS = 0,
450 OFPGMFC_INVALID_GROUP = 1,
451 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
452 OFPGMFC_OUT_OF_GROUPS = 3,
453 OFPGMFC_OUT_OF_BUCKETS = 4,
454 OFPGMFC_CHAINING_UNSUPPORTED = 5,
455 OFPGMFC_WATCH_UNSUPPORTED = 6,
456 OFPGMFC_LOOP = 7,
457 OFPGMFC_UNKNOWN_GROUP = 8,
458 OFPGMFC_CHAINED_GROUP = 9,
459 OFPGMFC_BAD_TYPE = 10,
460 OFPGMFC_BAD_COMMAND = 11,
461 OFPGMFC_BAD_BUCKET = 12,
462 OFPGMFC_BAD_WATCH = 13,
463 OFPGMFC_EPERM = 14,
464};
465
466enum ofp_port_mod_failed_code(wire_type=uint16_t) {
467 OFPPMFC_BAD_PORT = 0,
468 OFPPMFC_BAD_HW_ADDR = 1,
469 OFPPMFC_BAD_CONFIG = 2,
470 OFPPMFC_BAD_ADVERTISE = 3,
471 OFPPMFC_EPERM = 4,
472};
473
474enum ofp_table_mod_failed_code(wire_type=uint16_t) {
475 OFPTMFC_BAD_TABLE = 0,
476 OFPTMFC_BAD_CONFIG = 1,
477 OFPTMFC_EPERM = 2,
478};
479
480enum ofp_queue_op_failed_code(wire_type=uint16_t) {
481 OFPQOFC_BAD_PORT = 0,
482 OFPQOFC_BAD_QUEUE = 1,
483 OFPQOFC_EPERM = 2,
484};
485
486enum ofp_switch_config_failed_code(wire_type=uint16_t) {
487 OFPSCFC_BAD_FLAGS = 0,
488 OFPSCFC_BAD_LEN = 1,
489 OFPSCFC_EPERM = 2,
490};
491
492enum ofp_role_request_failed_code(wire_type=uint16_t){
493 OFPRRFC_STALE = 0,
494 OFPRRFC_UNSUP = 1,
495 OFPRRFC_BAD_ROLE = 2,
496};
497
498enum ofp_meter_mod_failed_code(wire_type=uint16_t) {
499 OFPMMFC_UNKNOWN = 0,
500 OFPMMFC_METER_EXISTS = 1,
501 OFPMMFC_INVALID_METER = 2,
502 OFPMMFC_UNKNOWN_METER = 3,
503 OFPMMFC_BAD_COMMAND = 4,
504 OFPMMFC_BAD_FLAGS = 5,
505 OFPMMFC_BAD_RATE = 6,
506 OFPMMFC_BAD_BURST = 7,
507 OFPMMFC_BAD_BAND = 8,
508 OFPMMFC_BAD_BAND_VALUE = 9,
509 OFPMMFC_OUT_OF_METERS = 10,
510 OFPMMFC_OUT_OF_BANDS = 11,
511};
512
513enum ofp_table_features_failed_code(wire_type=uint16_t) {
514 OFPTFFC_BAD_TABLE = 0,
515 OFPTFFC_BAD_METADATA = 1,
516 OFPTFFC_EPERM = 5,
517};
518
519enum ofp_bad_property_code(wire_type=uint16_t) {
520 OFPBPC_BAD_TYPE = 0, /* Unknown property type. */
521 OFPBPC_BAD_LEN = 1, /* Length problem in property. */
522 OFPBPC_BAD_VALUE = 2, /* Unsupported property value. */
523 OFPBPC_TOO_MANY = 3, /* Can’t handle this many properties. */
524 OFPBPC_DUP_TYPE = 4, /* A property type was duplicated. */
525 OFPBPC_BAD_EXPERIMENTER = 5, /* Unknown experimenter id specified. */
526 OFPBPC_BAD_EXP_TYPE = 6, /* Unknown exp_type for experimenter id. */
527 OFPBPC_BAD_EXP_VALUE = 7, /* Unknown value for experimenter id. */
528 OFPBPC_EPERM = 8, /* Permissions error. */
529};
530
531
532enum ofp_async_config_failed_code(wire_type=uint16_t) {
533 OFPACFC_INVALID = 0, /* One mask is invalid. */
534 OFPACFC_UNSUPPORTED = 1, /* Requested configuration not supported. */
535 OFPACFC_EPERM = 2, /* Permissions error. */
536};
537
538enum ofp_flow_monitor_failed_code(wire_type=uint16_t) {
539 OFPMOFC_UNKNOWN = 0, /* Unspecified error. */
540 OFPMOFC_MONITOR_EXISTS = 1, /* Monitor not added because a Monitor ADD
541 * attempted to replace an existing Monitor. */
542 OFPMOFC_INVALID_MONITOR = 2, /* Monitor not added because Monitor specified
543 * is invalid. */
544 OFPMOFC_UNKNOWN_MONITOR = 3, /* Monitor not modified because a Monitor
545 MODIFY attempted to modify a non-existent
546 Monitor. */
547 OFPMOFC_BAD_COMMAND = 4, /* Unsupported or unknown command. */
548 OFPMOFC_BAD_FLAGS = 5, /* Flag configuration unsupported. */
549 OFPMOFC_BAD_TABLE_ID = 6, /* Specified table does not exist. */
550 OFPMOFC_BAD_OUT = 7, /* Error in output port/group. */
551};
552
553enum ofp_bundle_failed_code(wire_type=uint16_t) {
554 OFPBFC_UNKNOWN = 0, /* Unspecified error. */
555 OFPBFC_EPERM = 1, /* Permissions error. */
556 OFPBFC_BAD_ID = 2, /* Bundle ID doesn’t exist. */
557 OFPBFC_BUNDLE_EXIST = 3, /* Bundle ID already exist. */
558 OFPBFC_BUNDLE_CLOSED = 4, /* Bundle ID is closed. */
559 OFPBFC_OUT_OF_BUNDLES = 5, /* Too many bundles IDs. */
560 OFPBFC_BAD_TYPE = 6, /* Unsupported or unknown message control type. */
561 OFPBFC_BAD_FLAGS = 7, /* Unsupported, unknown, or inconsistent flags. */
562 OFPBFC_MSG_BAD_LEN = 8, /* Length problem in included message. */
563 OFPBFC_MSG_BAD_XID = 9, /* Inconsistent or duplicate XID. */
564 OFPBFC_MSG_UNSUP = 10, /* Unsupported message in this bundle. */
565 OFPBFC_MSG_CONFLICT = 11, /* Unsupported message combination in this bundle. */
566 OFPBFC_MSG_TOO_MANY = 12, /* Cant handle this many messages in bundle. */
567 OFPBFC_MSG_FAILED = 13, /* One message in bundle failed. */
568 OFPBFC_TIMEOUT = 14, /* Bundle is taking too long. */
569 OFPBFC_BUNDLE_IN_PROGRESS = 15, /* Bundle is locking the resource. */
570};
571
572/* Port stats property types.
573 */
574enum ofp_port_stats_prop_type(wire_type=uint16_t) {
575 OFPPSPT_ETHERNET = 0, /* Ethernet property. */
576 OFPPSPT_OPTICAL = 1, /* Optical property. */
577 OFPPSPT_EXPERIMENTER = 0xFFFF, /* Experimenter property. */
578};
579
580
581enum ofp_stats_type(wire_type=uint16_t) {
582 OFPST_DESC = 0,
583 OFPST_FLOW = 1,
584 OFPST_AGGREGATE = 2,
585 OFPST_TABLE = 3,
586 OFPST_PORT = 4,
587 OFPST_QUEUE = 5,
588 OFPST_GROUP = 6,
589 OFPST_GROUP_DESC = 7,
590 OFPST_GROUP_FEATURES = 8,
591 OFPST_METER = 9,
592 OFPST_METER_CONFIG = 10,
593 OFPST_METER_FEATURES = 11,
594 OFPST_TABLE_FEATURES = 12,
595 OFPST_PORT_DESC = 13,
596 OFPMP_TABLE_DESC = 14,
597 OFPMP_QUEUE_DESC = 15,
598 OFPMP_FLOW_MONITOR = 16,
599 OFPST_EXPERIMENTER = 0xffff,
600};
601
602enum ofp_stats_request_flags(wire_type=uint16_t, bitmask=True) {
603 OFPSF_REQ_MORE = 0x1,
604};
605
606enum ofp_stats_reply_flags(wire_type=uint16_t, bitmask=True) {
607 OFPSF_REPLY_MORE = 0x1,
608};
609
610enum ofp_table_feature_prop_type(wire_type=uint16_t) {
611 OFPTFPT_INSTRUCTIONS = 0,
612 OFPTFPT_INSTRUCTIONS_MISS = 1,
613 OFPTFPT_NEXT_TABLES = 2,
614 OFPTFPT_NEXT_TABLES_MISS = 3,
615 OFPTFPT_WRITE_ACTIONS = 4,
616 OFPTFPT_WRITE_ACTIONS_MISS = 5,
617 OFPTFPT_APPLY_ACTIONS = 6,
618 OFPTFPT_APPLY_ACTIONS_MISS = 7,
619 OFPTFPT_MATCH = 8,
620 OFPTFPT_WILDCARDS = 0xa,
621 OFPTFPT_WRITE_SETFIELD = 0xc,
622 OFPTFPT_WRITE_SETFIELD_MISS = 0xd,
623 OFPTFPT_APPLY_SETFIELD = 0xe,
624 OFPTFPT_APPLY_SETFIELD_MISS = 0xf,
625 OFPTFPT_TABLE_SYNC_FROM = 0x10,
626 OFPTFPT_EXPERIMENTER = 0xfffe,
627 OFPTFPT_EXPERIMENTER_MISS = 0xffff,
628};
629
630enum ofp_group_capabilities(wire_type=uint32_t, bitmask=True) {
631 OFPGFC_SELECT_WEIGHT = 0x1,
632 OFPGFC_SELECT_LIVENESS = 0x2,
633 OFPGFC_CHAINING = 0x4,
634 OFPGFC_CHAINING_CHECKS = 0x8,
635};
636
637enum ofp_controller_role(wire_type=uint32_t) {
638 OFPCR_ROLE_NOCHANGE = 0,
639 OFPCR_ROLE_EQUAL = 1,
640 OFPCR_ROLE_MASTER = 2,
641 OFPCR_ROLE_SLAVE = 3,
642};
643
644enum ofp_hello_elem_type(wire_type=uint16_t) {
645 OFPHET_VERSIONBITMAP = 1,
646};
647
Rich Lane888d58d2014-10-17 18:04:07 -0700648enum ofp_optical_port_features(wire_type=uint32_t, bitmask=True) {
649 OFPOPF_RX_TUNE = 0x1,
650 OFPOPF_TX_TUNE = 0x2,
651 OFPOPF_TX_PWR = 0x4,
652 OFPOPF_USE_FREQ = 0x8,
653};
654
655enum ofp_table_mod_prop_eviction_flag(wire_type=uint32_t, bitmask=True) {
656 OFPTMPEF_OTHER = 0x1,
657 OFPTMPEF_IMPORTANCE = 0x2,
658 OFPTMPEF_LIFETIME = 0x4,
659};
660
661enum ofp_port_stats_optical_flags(wire_type=uint32_t, bitmask=True) {
662 OFPOSF_RX_TUNE = 0x1,
663 OFPOSF_TX_TUNE = 0x2,
664 OFPOSF_TX_PWR = 0x4,
665 OFPOSF_RX_PWR = 0x10,
666 OFPOSF_TX_BIAS = 0x20,
667 OFPOSF_TX_TEMP = 0x40,
668};
669
670enum ofp_bundle_ctrl_type(wire_type=uint16_t) {
671 OFPBCT_OPEN_REQUEST = 0,
672 OFPBCT_OPEN_REPLY = 1,
673 OFPBCT_CLOSE_REQUEST = 2,
674 OFPBCT_CLOSE_REPLY = 3,
675 OFPBCT_COMMIT_REQUEST = 4,
676 OFPBCT_COMMIT_REPLY = 5,
677 OFPBCT_DISCARD_REQUEST = 6,
678 OFPBCT_DISCARD_REPLY = 7,
679};
680
681enum ofp_bundle_flags(wire_type=uint16_t, bitmask=True) {
682 OFPBF_ATOMIC = 1,
683 OFPBF_ORDERED = 2,
684};
685
686enum ofp_controller_role_reason(wire_type=uint8_t) {
687 OFPCRR_MASTER_REQUEST = 0,
688 OFPCRR_CONFIG = 1,
689 OFPCRR_EXPERIMENTER = 2,
690};
691
692enum ofp_table_reason(wire_type=uint8_t) {
693 OFPTR_VACANCY_DOWN = 3,
694 OFPTR_VACANCY_UP = 4,
695};
696
697enum ofp_requestforward_reason {
698 OFPRFR_GROUP_MOD = 0,
699 OFPRFR_METER_MOD = 1,
700};
701
alshabib9f50e482014-08-23 17:10:57 -0500702/* XXX rename to of_message */
703struct of_header {
704 uint8_t version;
705 uint8_t type == ?;
706 uint16_t length;
707 uint32_t xid;
708};
709
710struct of_uint64 {
711 uint64_t value;
712};
713
714// Special structures used for managing scalar list elements
715struct of_uint32 {
716 uint32_t value;
717};
718
719// Special structures used for managing scalar list elements
720struct of_uint8 {
721 uint8_t value;
722};
723
724struct of_hello_elem {
725 uint16_t type == ?;
726 uint16_t length;
727};
728
729struct of_hello_elem_versionbitmap : of_hello_elem {
730 uint16_t type == 1;
731 uint16_t length;
732 list(of_uint32_t) bitmaps;
733};
734
735struct of_hello : of_header {
736 uint8_t version;
737 uint8_t type == 0;
738 uint16_t length;
739 uint32_t xid;
740 list(of_hello_elem_t) elements;
741};
742
743struct of_echo_request : of_header {
744 uint8_t version;
745 uint8_t type == 2;
746 uint16_t length;
747 uint32_t xid;
748 of_octets_t data;
749};
750
751struct of_echo_reply : of_header {
752 uint8_t version;
753 uint8_t type == 3;
754 uint16_t length;
755 uint32_t xid;
756 of_octets_t data;
757};
758
759struct of_experimenter : of_header {
760 uint8_t version;
761 uint8_t type == 4;
762 uint16_t length;
763 uint32_t xid;
764 uint32_t experimenter == ?;
765 uint32_t subtype;
766 of_octets_t data;
767};
768
769struct of_barrier_request : of_header {
770 uint8_t version;
771 uint8_t type == 20;
772 uint16_t length;
773 uint32_t xid;
774};
775
776struct of_barrier_reply : of_header {
777 uint8_t version;
778 uint8_t type == 21;
779 uint16_t length;
780 uint32_t xid;
781};
782
783struct of_get_config_request : of_header {
784 uint8_t version;
785 uint8_t type == 7;
786 uint16_t length;
787 uint32_t xid;
788};
789
790struct of_get_config_reply : of_header {
791 uint8_t version;
792 uint8_t type == 8;
793 uint16_t length;
794 uint32_t xid;
795 enum ofp_config_flags flags;
796 uint16_t miss_send_len;
797};
798
799struct of_set_config : of_header {
800 uint8_t version;
801 uint8_t type == 9;
802 uint16_t length;
803 uint32_t xid;
804 enum ofp_config_flags flags;
805 uint16_t miss_send_len;
806};
807
Rich Lane7f503ee2014-09-26 14:18:58 -0700808struct of_table_mod_prop {
809 uint16_t type == ?; /* One of OFPTMPT_*. */
alshabib9f50e482014-08-23 17:10:57 -0500810 uint16_t length; /* Length in bytes of this property. */
811};
812
Rich Lane888d58d2014-10-17 18:04:07 -0700813struct of_table_mod_prop_eviction {
814 uint16_t type == 2;
815 uint16_t length;
816 enum ofp_table_mod_prop_eviction_flag flags;
817};
818
819struct of_table_mod_prop_vacancy {
820 uint16_t type == 3;
821 uint16_t length;
822 uint8_t vacancy_down;
823 uint8_t vacancy_up;
824 uint8_t vacancy;
825 pad(1);
826};
827
828struct of_table_mod_prop_experimenter {
829 uint16_t type == 0xffff;
830 uint16_t length;
831 uint32_t experimenter == ?;
832 uint32_t exp_type;
833};
834
alshabib9f50e482014-08-23 17:10:57 -0500835struct of_table_mod : of_header {
836 uint8_t version;
837 uint8_t type == 17;
838 uint16_t length;
839 uint32_t xid;
840 uint8_t table_id;
841 pad(3);
842 uint32_t config;
Rich Lane7f503ee2014-09-26 14:18:58 -0700843 list(of_table_mod_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -0500844};
845
Rich Lane7f503ee2014-09-26 14:18:58 -0700846struct of_port_desc_prop {
847 uint16_t type == ?; /* One of OFPPDPT_*. */
alshabib9f50e482014-08-23 17:10:57 -0500848 uint16_t length; /* Length in bytes of this property. */
849};
850
Rich Lanec6463c32014-10-10 17:13:27 -0700851struct of_port_desc_prop_ethernet : of_port_desc_prop {
852 uint16_t type == 0;
853 uint16_t length;
854 pad(4);
855 uint32_t curr;
856 uint32_t advertised;
857 uint32_t supported;
858 uint32_t peer;
859 uint32_t curr_speed;
860 uint32_t max_speed;
861};
862
Rich Lane888d58d2014-10-17 18:04:07 -0700863struct of_port_desc_prop_optical : of_port_desc_prop {
864 uint16_t type == 1;
865 uint16_t length;
866 pad(4);
867 uint32_t supported;
868 uint32_t tx_min_freq_lmda;
869 uint32_t tx_max_freq_lmda;
870 uint32_t tx_grid_freq_lmda;
871 uint32_t rx_min_freq_lmda;
872 uint32_t rx_max_freq_lmda;
873 uint32_t rx_grid_freq_lmda;
874 uint32_t tx_pwr_min;
875 uint32_t tx_pwr_max;
876};
877
878struct of_port_desc_prop_experimenter : of_port_desc_prop {
879 uint16_t type == 0xffff;
880 uint16_t length;
881 uint32_t experimenter == ?;
882 uint32_t exp_type;
883};
884
alshabib9f50e482014-08-23 17:10:57 -0500885struct of_port_desc {
886 of_port_no_t port_no;
887 uint16_t length;
888 pad(2);
Rich Lane457bc452014-10-17 18:04:56 -0700889 of_mac_addr_t hw_addr;
alshabib9f50e482014-08-23 17:10:57 -0500890 pad(2);
891 of_port_name_t name;
892 enum ofp_port_config config; /* Bitmap of OFPPC_* flags. */
893 enum ofp_port_state state; /* Bitmap of OFPPS_* flags. */
Rich Lane7f503ee2014-09-26 14:18:58 -0700894 list(of_port_desc_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -0500895};
896
897struct of_features_request : of_header {
898 uint8_t version;
899 uint8_t type == 5;
900 uint16_t length;
901 uint32_t xid;
902};
903
904struct of_features_reply : of_header {
905 uint8_t version;
906 uint8_t type == 6;
907 uint16_t length;
908 uint32_t xid;
909 uint64_t datapath_id;
910 uint32_t n_buffers;
911 uint8_t n_tables;
912 uint8_t auxiliary_id;
913 pad(2);
914 enum ofp_capabilities capabilities;
915 uint32_t reserved;
916};
917
918struct of_port_status : of_header {
919 uint8_t version;
920 uint8_t type == 12;
921 uint16_t length;
922 uint32_t xid;
923 enum ofp_port_reason reason;
924 pad(7);
925 of_port_desc_t desc;
926};
927
Rich Lane7f503ee2014-09-26 14:18:58 -0700928struct of_port_mod_prop {
929 uint16_t type == ?; /* One of OFPPMPT_*. */
alshabib9f50e482014-08-23 17:10:57 -0500930 uint16_t length; /* Length in bytes of this property. */
931};
932
Rich Lane23e5c822014-10-14 10:47:29 -0700933struct of_port_mod_prop_ethernet : of_port_mod_prop {
934 uint16_t type == 0;
935 uint16_t length;
936 uint32_t advertise;
937};
938
939struct of_port_mod_prop_optical : of_port_mod_prop {
940 uint16_t type == 1;
941 uint16_t length;
942 uint32_t configure;
943 uint32_t freq_ldma;
944 uint32_t fl_offset; /* TODO signed */
945 uint32_t grid_span;
946 uint32_t tx_pwr;
947};
948
Rich Lane888d58d2014-10-17 18:04:07 -0700949struct of_port_mod_prop_experimenter : of_port_mod_prop {
950 uint16_t type == 0xffff;
951 uint16_t length;
952 uint32_t experimenter == ?;
953 uint32_t exp_type;
954};
955
alshabib9f50e482014-08-23 17:10:57 -0500956struct of_port_mod : of_header {
957 uint8_t version;
958 uint8_t type == 16;
959 uint16_t length;
960 uint32_t xid;
961 of_port_no_t port_no;
962 pad(4);
963 of_mac_addr_t hw_addr;
964 pad(2);
965 uint32_t config;
966 uint32_t mask;
Rich Lane7f503ee2014-09-26 14:18:58 -0700967 list(of_port_mod_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -0500968};
969
Rich Laneb4d24df2014-10-10 15:58:03 -0700970struct of_match_v3(align=8, length_includes_align=False) {
alshabib9f50e482014-08-23 17:10:57 -0500971 uint16_t type == 1;
972 uint16_t length;
973 list(of_oxm_t) oxm_list;
974};
975
Rich Lane457bc452014-10-17 18:04:56 -0700976// This looks like an action header, but is standalone. See
alshabib9f50e482014-08-23 17:10:57 -0500977// ofp_table_features_prop_actions
978struct of_action_id {
979 uint16_t type;
980 uint16_t len;
Rich Lane7f503ee2014-09-26 14:18:58 -0700981 of_octets_t exp_data;
alshabib9f50e482014-08-23 17:10:57 -0500982};
983
984struct of_action_output : of_action {
985 uint16_t type == 0;
986 uint16_t len;
987 of_port_no_t port;
988 uint16_t max_len;
989 pad(6);
990};
991
992struct of_action_copy_ttl_out : of_action {
993 uint16_t type == 11;
994 uint16_t len;
995 pad(4);
996};
997
998struct of_action_copy_ttl_in : of_action {
999 uint16_t type == 12;
1000 uint16_t len;
1001 pad(4);
1002};
1003
1004struct of_action_set_mpls_ttl : of_action {
1005 uint16_t type == 15;
1006 uint16_t len;
1007 uint8_t mpls_ttl;
1008 pad(3);
1009};
1010
1011struct of_action_dec_mpls_ttl : of_action {
1012 uint16_t type == 16;
1013 uint16_t len;
1014 pad(4);
1015};
1016
1017struct of_action_push_vlan : of_action {
1018 uint16_t type == 17;
1019 uint16_t len;
1020 uint16_t ethertype;
1021 pad(2);
1022};
1023
1024struct of_action_pop_vlan : of_action {
1025 uint16_t type == 18;
1026 uint16_t len;
1027 pad(4);
1028};
1029
1030struct of_action_push_mpls : of_action {
1031 uint16_t type == 19;
1032 uint16_t len;
1033 uint16_t ethertype;
1034 pad(2);
1035};
1036
1037struct of_action_pop_mpls : of_action {
1038 uint16_t type == 20;
1039 uint16_t len;
1040 uint16_t ethertype;
1041 pad(2);
1042};
1043
1044struct of_action_set_queue : of_action {
1045 uint16_t type == 21;
1046 uint16_t len;
1047 uint32_t queue_id;
1048};
1049
1050struct of_action_group : of_action {
1051 uint16_t type == 22;
1052 uint16_t len;
1053 uint32_t group_id;
1054};
1055
1056struct of_action_set_nw_ttl : of_action {
1057 uint16_t type == 23;
1058 uint16_t len;
1059 uint8_t nw_ttl;
1060 pad(3);
1061};
1062
1063struct of_action_dec_nw_ttl : of_action {
1064 uint16_t type == 24;
1065 uint16_t len;
1066 pad(4);
1067};
1068
1069struct of_action_set_field(align=8, length_includes_align=True) : of_action {
1070 uint16_t type == 25;
1071 uint16_t len;
1072 of_oxm_t field;
1073};
1074
1075struct of_action_experimenter(align=8, length_includes_align=True): of_action {
1076 uint16_t type == 65535;
1077 uint16_t len;
1078 uint32_t experimenter == ?;
1079 of_octets_t data;
1080};
1081
1082struct of_action_pop_pbb : of_action {
1083 uint16_t type == 27;
1084 uint16_t len;
1085 pad(4);
1086};
1087
1088struct of_action_push_pbb : of_action {
1089 uint16_t type == 26;
1090 uint16_t len;
1091 uint16_t ethertype;
1092 pad(2);
1093};
1094
1095struct of_action {
1096 uint16_t type == ?;
1097 uint16_t len;
1098 pad(4);
1099};
1100
1101struct of_instruction_id {
1102 uint16_t type;
1103 uint16_t len;
1104};
1105
1106struct of_instruction {
1107 uint16_t type == ?;
1108 uint16_t len;
1109};
1110
1111struct of_instruction_goto_table : of_instruction {
1112 uint16_t type == 1;
1113 uint16_t len;
Rich Lane94af3782014-10-10 15:59:36 -07001114 uint8_t table_id;
1115 pad(3);
alshabib9f50e482014-08-23 17:10:57 -05001116};
1117
1118struct of_instruction_write_metadata : of_instruction {
1119 uint16_t type == 2;
1120 uint16_t len;
1121 pad(4);
1122 uint64_t metadata;
1123 uint64_t metadata_mask;
1124};
1125
1126struct of_instruction_write_actions : of_instruction {
1127 uint16_t type == 3;
1128 uint16_t len;
1129 pad(4);
1130 list(of_action_t) actions;
1131};
1132
1133struct of_instruction_apply_actions : of_instruction {
1134 uint16_t type == 4;
1135 uint16_t len;
1136 pad(4);
1137 list(of_action_t) actions;
1138};
1139
1140struct of_instruction_clear_actions : of_instruction {
1141 uint16_t type == 5;
1142 uint16_t len;
1143 pad(4);
1144};
1145
1146struct of_instruction_meter : of_instruction {
1147 uint16_t type == 6;
1148 uint16_t len;
1149 uint32_t meter_id;
1150};
1151
1152struct of_instruction_experimenter : of_instruction {
1153 uint16_t type == 65535;
1154 uint16_t len;
1155 uint32_t experimenter == ?;
1156 of_octets_t data;
1157};
1158
1159struct of_flow_mod : of_header {
1160 uint8_t version;
1161 uint8_t type == 14;
1162 uint16_t length;
1163 uint32_t xid;
1164 uint64_t cookie;
1165 uint64_t cookie_mask;
1166 uint8_t table_id;
1167 of_fm_cmd_t _command == ?;
1168 uint16_t idle_timeout;
1169 uint16_t hard_timeout;
1170 uint16_t priority;
1171 uint32_t buffer_id;
1172 of_port_no_t out_port;
1173 uint32_t out_group;
1174 enum ofp_flow_mod_flags flags;
1175 pad(2);
1176 of_match_t match;
1177 list(of_instruction_t) instructions;
1178};
1179
1180struct of_flow_add : of_flow_mod {
1181 uint8_t version;
1182 uint8_t type == 14;
1183 uint16_t length;
1184 uint32_t xid;
1185 uint64_t cookie;
1186 uint64_t cookie_mask;
1187 uint8_t table_id;
1188 of_fm_cmd_t _command == 0;
1189 uint16_t idle_timeout;
1190 uint16_t hard_timeout;
1191 uint16_t priority;
1192 uint32_t buffer_id;
1193 of_port_no_t out_port;
1194 uint32_t out_group;
1195 enum ofp_flow_mod_flags flags;
1196 uint16_t importance;
1197 of_match_t match;
1198 list(of_instruction_t) instructions;
1199};
1200
1201struct of_flow_modify : of_flow_mod {
1202 uint8_t version;
1203 uint8_t type == 14;
1204 uint16_t length;
1205 uint32_t xid;
1206 uint64_t cookie;
1207 uint64_t cookie_mask;
1208 uint8_t table_id;
1209 of_fm_cmd_t _command == 1;
1210 uint16_t idle_timeout;
1211 uint16_t hard_timeout;
1212 uint16_t priority;
1213 uint32_t buffer_id;
1214 of_port_no_t out_port;
1215 uint32_t out_group;
1216 enum ofp_flow_mod_flags flags;
1217 uint16_t importance;
1218 of_match_t match;
1219 list(of_instruction_t) instructions;
1220};
1221
1222struct of_flow_modify_strict : of_flow_mod {
1223 uint8_t version;
1224 uint8_t type == 14;
1225 uint16_t length;
1226 uint32_t xid;
1227 uint64_t cookie;
1228 uint64_t cookie_mask;
1229 uint8_t table_id;
1230 of_fm_cmd_t _command == 2;
1231 uint16_t idle_timeout;
1232 uint16_t hard_timeout;
1233 uint16_t priority;
1234 uint32_t buffer_id;
1235 of_port_no_t out_port;
1236 uint32_t out_group;
1237 enum ofp_flow_mod_flags flags;
Rich Lane457bc452014-10-17 18:04:56 -07001238 uint16_t importance;
alshabib9f50e482014-08-23 17:10:57 -05001239 of_match_t match;
1240 list(of_instruction_t) instructions;
1241};
1242
1243struct of_flow_delete : of_flow_mod {
1244 uint8_t version;
1245 uint8_t type == 14;
1246 uint16_t length;
1247 uint32_t xid;
1248 uint64_t cookie;
1249 uint64_t cookie_mask;
1250 uint8_t table_id;
1251 of_fm_cmd_t _command == 3;
1252 uint16_t idle_timeout;
1253 uint16_t hard_timeout;
1254 uint16_t priority;
1255 uint32_t buffer_id;
1256 of_port_no_t out_port;
1257 uint32_t out_group;
1258 enum ofp_flow_mod_flags flags;
1259 uint16_t importance;
1260 of_match_t match;
1261 list(of_instruction_t) instructions;
1262};
1263
1264struct of_flow_delete_strict : of_flow_mod {
1265 uint8_t version;
1266 uint8_t type == 14;
1267 uint16_t length;
1268 uint32_t xid;
1269 uint64_t cookie;
1270 uint64_t cookie_mask;
1271 uint8_t table_id;
1272 of_fm_cmd_t _command == 4;
1273 uint16_t idle_timeout;
1274 uint16_t hard_timeout;
1275 uint16_t priority;
1276 uint32_t buffer_id;
1277 of_port_no_t out_port;
1278 uint32_t out_group;
1279 enum ofp_flow_mod_flags flags;
1280 uint16_t importance;
1281 of_match_t match;
1282 list(of_instruction_t) instructions;
1283};
1284
1285struct of_bucket {
1286 uint16_t len;
1287 uint16_t weight;
1288 of_port_no_t watch_port;
1289 uint32_t watch_group;
1290 pad(4);
1291 list(of_action_t) actions;
1292};
1293
1294struct of_group_mod : of_header {
1295 uint8_t version;
1296 uint8_t type == 15;
1297 uint16_t length;
1298 uint32_t xid;
1299 enum ofp_group_mod_command command == ?;
1300 enum ofp_group_type group_type;
1301 pad(1);
1302 uint32_t group_id;
1303 list(of_bucket_t) buckets;
1304};
1305
1306struct of_group_add : of_group_mod {
1307 uint8_t version;
1308 uint8_t type == 15;
1309 uint16_t length;
1310 uint32_t xid;
1311 enum ofp_group_mod_command command == 0;
1312 enum ofp_group_type group_type;
1313 pad(1);
1314 uint32_t group_id;
1315 list(of_bucket_t) buckets;
1316};
1317
1318struct of_group_modify : of_group_mod {
1319 uint8_t version;
1320 uint8_t type == 15;
1321 uint16_t length;
1322 uint32_t xid;
1323 enum ofp_group_mod_command command == 1;
1324 enum ofp_group_type group_type;
1325 pad(1);
1326 uint32_t group_id;
1327 list(of_bucket_t) buckets;
1328};
1329
1330struct of_group_delete : of_group_mod {
1331 uint8_t version;
1332 uint8_t type == 15;
1333 uint16_t length;
1334 uint32_t xid;
1335 enum ofp_group_mod_command command == 2;
1336 enum ofp_group_type group_type;
1337 pad(1);
1338 uint32_t group_id;
1339 list(of_bucket_t) buckets;
1340};
1341
1342struct of_packet_out : of_header {
1343 uint8_t version;
1344 uint8_t type == 13;
1345 uint16_t length;
1346 uint32_t xid;
1347 uint32_t buffer_id;
1348 of_port_no_t in_port;
1349 uint16_t actions_len;
1350 pad(6);
1351 list(of_action_t) actions;
1352 of_octets_t data;
1353};
1354
1355struct of_packet_in : of_header {
1356 uint8_t version;
1357 uint8_t type == 10;
1358 uint16_t length;
1359 uint32_t xid;
1360 uint32_t buffer_id;
1361 uint16_t total_len;
1362 uint8_t reason;
1363 uint8_t table_id;
1364 uint64_t cookie;
1365 of_match_t match;
1366 pad(2);
Rich Lane457bc452014-10-17 18:04:56 -07001367 of_octets_t data;
alshabib9f50e482014-08-23 17:10:57 -05001368};
1369
1370struct of_flow_removed : of_header {
1371 uint8_t version;
1372 uint8_t type == 11;
1373 uint16_t length;
1374 uint32_t xid;
1375 uint64_t cookie;
1376 uint16_t priority;
1377 uint8_t reason;
1378 uint8_t table_id;
1379 uint32_t duration_sec;
1380 uint32_t duration_nsec;
1381 uint16_t idle_timeout;
1382 uint16_t hard_timeout;
1383 uint64_t packet_count;
1384 uint64_t byte_count;
1385 of_match_t match;
1386};
1387
1388struct of_meter_band {
1389 uint16_t type == ?;
1390 uint16_t len;
1391// uint32_t rate; // These are excluded b/c this is the header
1392// uint32_t burst_size; // These are excluded b/c this is the header
1393};
1394
1395struct of_meter_band_drop : of_meter_band {
1396 uint16_t type == 1;
1397 uint16_t len;
1398 uint32_t rate;
1399 uint32_t burst_size;
1400 pad(4);
1401};
1402
1403struct of_meter_band_dscp_remark : of_meter_band {
1404 uint16_t type == 2;
1405 uint16_t len;
1406 uint32_t rate;
1407 uint32_t burst_size;
1408 uint8_t prec_level;
1409 pad(3);
1410};
1411
1412struct of_meter_band_experimenter : of_meter_band {
1413 uint16_t type == 65535;
1414 uint16_t len;
1415 uint32_t rate;
1416 uint32_t burst_size;
1417 uint32_t experimenter;
1418};
1419
1420struct of_meter_mod : of_header {
1421 uint8_t version;
1422 uint8_t type == 29;
1423 uint16_t length;
1424 uint32_t xid;
1425 uint16_t command;
1426 uint16_t flags;
1427 uint32_t meter_id;
1428 list(of_meter_band_t) bands;
1429};
1430
1431struct of_error_msg : of_header {
1432 uint8_t version;
1433 uint8_t type == 1;
1434 uint16_t length;
1435 uint32_t xid;
1436 uint16_t err_type == ?;
1437};
1438
1439struct of_hello_failed_error_msg : of_error_msg {
1440 uint8_t version;
1441 uint8_t type == 1;
1442 uint16_t length;
1443 uint32_t xid;
1444 uint16_t err_type == 0;
1445 enum ofp_hello_failed_code code;
1446 of_octets_t data;
1447};
1448
1449struct of_bad_request_error_msg : of_error_msg {
1450 uint8_t version;
1451 uint8_t type == 1;
1452 uint16_t length;
1453 uint32_t xid;
1454 uint16_t err_type == 1;
1455 enum ofp_bad_request_code code;
1456 of_octets_t data;
1457};
1458
1459struct of_bad_action_error_msg : of_error_msg {
1460 uint8_t version;
1461 uint8_t type == 1;
1462 uint16_t length;
1463 uint32_t xid;
1464 uint16_t err_type == 2;
1465 enum ofp_bad_action_code code;
1466 of_octets_t data;
1467};
1468
1469struct of_bad_instruction_error_msg : of_error_msg {
1470 uint8_t version;
1471 uint8_t type == 1;
1472 uint16_t length;
1473 uint32_t xid;
1474 uint16_t err_type == 3;
1475 enum ofp_bad_instruction_code code;
1476 of_octets_t data;
1477};
1478
1479struct of_bad_match_error_msg : of_error_msg {
1480 uint8_t version;
1481 uint8_t type == 1;
1482 uint16_t length;
1483 uint32_t xid;
1484 uint16_t err_type == 4;
1485 enum ofp_bad_match_code code;
1486 of_octets_t data;
1487};
1488
1489struct of_flow_mod_failed_error_msg : of_error_msg {
1490 uint8_t version;
1491 uint8_t type == 1;
1492 uint16_t length;
1493 uint32_t xid;
1494 uint16_t err_type == 5;
1495 enum ofp_flow_mod_failed_code code;
1496 of_octets_t data;
1497};
1498
1499struct of_group_mod_failed_error_msg : of_error_msg {
1500 uint8_t version;
1501 uint8_t type == 1;
1502 uint16_t length;
1503 uint32_t xid;
1504 uint16_t err_type == 6;
1505 enum ofp_group_mod_failed_code code;
1506 of_octets_t data;
1507};
1508
1509struct of_port_mod_failed_error_msg : of_error_msg {
1510 uint8_t version;
1511 uint8_t type == 1;
1512 uint16_t length;
1513 uint32_t xid;
1514 uint16_t err_type == 7;
1515 enum ofp_port_mod_failed_code code;
1516 of_octets_t data;
1517};
1518
1519struct of_table_mod_failed_error_msg : of_error_msg {
1520 uint8_t version;
1521 uint8_t type == 1;
1522 uint16_t length;
1523 uint32_t xid;
1524 uint16_t err_type == 8;
1525 enum ofp_table_mod_failed_code code;
1526 of_octets_t data;
1527};
1528
1529struct of_queue_op_failed_error_msg : of_error_msg {
1530 uint8_t version;
1531 uint8_t type == 1;
1532 uint16_t length;
1533 uint32_t xid;
1534 uint16_t err_type == 9;
1535 enum ofp_queue_op_failed_code code;
1536 of_octets_t data;
1537};
1538
1539struct of_switch_config_failed_error_msg : of_error_msg {
1540 uint8_t version;
1541 uint8_t type == 1;
1542 uint16_t length;
1543 uint32_t xid;
1544 uint16_t err_type == 10;
1545 enum ofp_switch_config_failed_code code;
1546 of_octets_t data;
1547};
1548
1549struct of_role_request_failed_error_msg : of_error_msg {
1550 uint8_t version;
1551 uint8_t type == 1;
1552 uint16_t length;
1553 uint32_t xid;
1554 uint16_t err_type == 11;
1555 enum ofp_role_request_failed_code code;
1556 of_octets_t data;
1557};
1558
1559struct of_meter_mod_failed_error_msg : of_error_msg {
1560 uint8_t version;
1561 uint8_t type == 1;
1562 uint16_t length;
1563 uint32_t xid;
1564 uint16_t err_type == 12;
1565 enum ofp_meter_mod_failed_code code;
1566 of_octets_t data;
1567};
1568
1569struct of_table_features_failed_error_msg : of_error_msg {
1570 uint8_t version;
1571 uint8_t type == 1;
1572 uint16_t length;
1573 uint32_t xid;
1574 uint16_t err_type == 13;
1575 enum ofp_table_features_failed_code code;
1576 of_octets_t data;
1577};
1578
1579struct of_experimenter_error_msg : of_error_msg {
1580 uint8_t version;
1581 uint8_t type == 1;
1582 uint16_t length;
1583 uint32_t xid;
1584 uint16_t err_type == 0xffff;
1585 uint16_t subtype;
1586 uint32_t experimenter;
1587 of_octets_t data;
1588};
1589
1590// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1591
1592struct of_flow_stats_entry {
1593 uint16_t length;
1594 uint8_t table_id;
1595 pad(1);
1596 uint32_t duration_sec;
1597 uint32_t duration_nsec;
1598 uint16_t priority;
1599 uint16_t idle_timeout;
1600 uint16_t hard_timeout;
1601 enum ofp_flow_mod_flags flags;
1602 uint16_t importance;
1603 pad(2);
1604 uint64_t cookie;
1605 uint64_t packet_count;
1606 uint64_t byte_count;
1607 of_match_t match;
1608 list(of_instruction_t) instructions;
1609};
1610
1611
1612struct of_table_stats_entry {
1613 uint8_t table_id;
1614 pad(3);
1615 uint32_t active_count;
1616 uint64_t lookup_count;
1617 uint64_t matched_count;
1618};
1619
1620/* Common header for all port stats properties. */
Rich Lane7f503ee2014-09-26 14:18:58 -07001621struct of_port_stats_prop {
1622 uint16_t type == ?; /* One of OFPPSPT_*. */
alshabib9f50e482014-08-23 17:10:57 -05001623 uint16_t length; /* Length in bytes of this property. */
1624};
1625
1626/* Ethernet port stats property. */
Rich Lane7f503ee2014-09-26 14:18:58 -07001627struct of_port_stats_prop_ethernet : of_port_stats_prop {
1628 uint16_t type == 0; /* OFPPSPT_ETHERNET. */
alshabib9f50e482014-08-23 17:10:57 -05001629 uint16_t length; /* Length in bytes of this property. */
1630 pad(4);
1631
1632 uint64_t rx_frame_err; /* Number of frame alignment errors. */
1633 uint64_t rx_over_err; /* Number of packets with RX overrun. */
1634 uint64_t rx_crc_err; /* Number of CRC errors. */
1635 uint64_t collisions; /* Number of collisions. */
1636};
1637
1638/* Optical port stats property. */
Rich Lane7f503ee2014-09-26 14:18:58 -07001639struct of_port_stats_prop_optical : of_port_stats_prop {
1640 uint16_t type == 1;
alshabib9f50e482014-08-23 17:10:57 -05001641 uint16_t length;
1642 pad(4);
1643
1644 uint32_t flags;
1645 uint32_t tx_freq_lmda;
Rich Lane457bc452014-10-17 18:04:56 -07001646 uint32_t tx_offset;
alshabib9f50e482014-08-23 17:10:57 -05001647 uint32_t tx_grid_span;
1648 uint32_t rx_freq_lmda;
1649 uint32_t rx_offset;
1650 uint32_t rx_grid_span;
Rich Lane457bc452014-10-17 18:04:56 -07001651 uint16_t tx_pwr;
alshabib9f50e482014-08-23 17:10:57 -05001652 uint16_t rx_pwr;
1653 uint16_t bias_current;
1654 uint16_t temperature;
1655};
1656
1657/* Experimenter port stats property. */
Rich Lane7f503ee2014-09-26 14:18:58 -07001658struct of_port_stats_prop_experimenter : of_port_stats_prop {
1659 uint16_t type == 0xffff;
Rich Lane457bc452014-10-17 18:04:56 -07001660 uint16_t length;
Rich Lane7f503ee2014-09-26 14:18:58 -07001661 uint32_t experimenter == ?;
alshabib9f50e482014-08-23 17:10:57 -05001662 uint32_t exp_type;
Rich Lane7f503ee2014-09-26 14:18:58 -07001663 of_octets_t experimenter_data;
alshabib9f50e482014-08-23 17:10:57 -05001664};
1665
1666struct of_port_stats_entry {
1667 uint16_t length;
1668 pad(2);
1669 of_port_no_t port_no;
Rich Lane90651c42014-10-10 16:19:30 -07001670 uint32_t duration_sec;
1671 uint32_t duration_nsec;
alshabib9f50e482014-08-23 17:10:57 -05001672 uint64_t rx_packets;
1673 uint64_t tx_packets;
1674 uint64_t rx_bytes;
1675 uint64_t tx_bytes;
1676 uint64_t rx_dropped;
1677 uint64_t tx_dropped;
1678 uint64_t rx_errors;
1679 uint64_t tx_errors;
Rich Lane7f503ee2014-09-26 14:18:58 -07001680 list(of_port_stats_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -05001681};
1682
Rich Lane7f503ee2014-09-26 14:18:58 -07001683struct of_queue_stats_prop {
1684 uint16_t type == ?;
alshabib9f50e482014-08-23 17:10:57 -05001685 uint16_t length;
1686};
1687
Rich Lane888d58d2014-10-17 18:04:07 -07001688struct of_queue_stats_prop_experimenter : of_queue_stats_prop {
1689 uint16_t type == 0xffff;
1690 uint16_t length;
1691 uint32_t experimenter == ?;
1692 uint32_t exp_type;
1693};
1694
alshabib9f50e482014-08-23 17:10:57 -05001695struct of_queue_stats_entry {
Rich Lane457bc452014-10-17 18:04:56 -07001696 uint16_t length;
1697 pad(6);
alshabib9f50e482014-08-23 17:10:57 -05001698 of_port_no_t port_no;
Rich Lane457bc452014-10-17 18:04:56 -07001699 uint32_t queue_id;
1700 uint64_t tx_bytes;
alshabib9f50e482014-08-23 17:10:57 -05001701 uint64_t tx_packets;
1702 uint64_t tx_errors;
1703 uint32_t duration_sec;
1704 uint32_t duration_nsec;
Rich Lane7f503ee2014-09-26 14:18:58 -07001705 list(of_queue_stats_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -05001706};
1707
1708struct of_bucket_counter {
1709 uint64_t packet_count;
1710 uint64_t byte_count;
1711};
1712
1713struct of_group_stats_entry {
1714 uint16_t length;
1715 pad(2);
1716 uint32_t group_id;
1717 uint32_t ref_count;
1718 pad(4);
1719 uint64_t packet_count;
1720 uint64_t byte_count;
1721 uint32_t duration_sec;
1722 uint32_t duration_nsec;
1723 list(of_bucket_counter_t) bucket_stats;
1724};
1725
1726struct of_group_desc_stats_entry {
1727 uint16_t length;
1728 enum ofp_group_type group_type;
1729 pad(1);
1730 uint32_t group_id;
1731 list(of_bucket_t) buckets;
1732};
1733
Rich Lane457bc452014-10-17 18:04:56 -07001734// STATS:
alshabib9f50e482014-08-23 17:10:57 -05001735// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1736
1737struct of_stats_request : of_header {
1738 uint8_t version;
1739 uint8_t type == 18;
1740 uint16_t length;
1741 uint32_t xid;
1742 uint16_t stats_type == ?;
1743 enum ofp_stats_request_flags flags;
1744 pad(4);
1745};
1746
1747struct of_stats_reply : of_header {
1748 uint8_t version;
1749 uint8_t type == 19;
1750 uint16_t length;
1751 uint32_t xid;
1752 uint16_t stats_type == ?;
1753 enum ofp_stats_reply_flags flags;
1754 pad(4);
1755};
1756
1757struct of_desc_stats_request : of_stats_request {
1758 uint8_t version;
1759 uint8_t type == 18;
1760 uint16_t length;
1761 uint32_t xid;
1762 uint16_t stats_type == 0;
1763 enum ofp_stats_request_flags flags;
1764 pad(4);
1765};
1766
1767struct of_desc_stats_reply : of_stats_reply {
1768 uint8_t version;
1769 uint8_t type == 19;
1770 uint16_t length;
1771 uint32_t xid;
1772 uint16_t stats_type == 0;
1773 enum ofp_stats_reply_flags flags;
1774 pad(4);
1775 of_desc_str_t mfr_desc;
1776 of_desc_str_t hw_desc;
1777 of_desc_str_t sw_desc;
1778 of_serial_num_t serial_num;
1779 of_desc_str_t dp_desc;
1780};
1781
1782struct of_flow_stats_request : of_stats_request {
1783 uint8_t version;
1784 uint8_t type == 18;
1785 uint16_t length;
1786 uint32_t xid;
1787 uint16_t stats_type == 1;
1788 enum ofp_stats_request_flags flags;
1789 pad(4);
1790 uint8_t table_id;
1791 pad(3);
1792 of_port_no_t out_port;
1793 uint32_t out_group;
1794 pad(4);
1795 uint64_t cookie;
1796 uint64_t cookie_mask;
1797 of_match_t match;
1798};
1799
1800struct of_flow_stats_reply : of_stats_reply {
1801 uint8_t version;
1802 uint8_t type == 19;
1803 uint16_t length;
1804 uint32_t xid;
1805 uint16_t stats_type == 1;
1806 enum ofp_stats_reply_flags flags;
1807 pad(4);
1808 list(of_flow_stats_entry_t) entries;
1809};
1810
1811struct of_aggregate_stats_request : of_stats_request {
1812 uint8_t version;
1813 uint8_t type == 18;
1814 uint16_t length;
1815 uint32_t xid;
1816 uint16_t stats_type == 2;
1817 enum ofp_stats_request_flags flags;
1818 pad(4);
1819 uint8_t table_id;
1820 pad(3);
1821 of_port_no_t out_port;
1822 uint32_t out_group;
1823 pad(4);
1824 uint64_t cookie;
1825 uint64_t cookie_mask;
1826 of_match_t match;
1827};
1828
1829struct of_aggregate_stats_reply : of_stats_reply {
1830 uint8_t version;
1831 uint8_t type == 19;
1832 uint16_t length;
1833 uint32_t xid;
1834 uint16_t stats_type == 2;
1835 enum ofp_stats_reply_flags flags;
1836 pad(4);
1837 uint64_t packet_count;
1838 uint64_t byte_count;
1839 uint32_t flow_count;
1840 pad(4);
1841};
1842
1843struct of_table_stats_request : of_stats_request {
1844 uint8_t version;
1845 uint8_t type == 18;
1846 uint16_t length;
1847 uint32_t xid;
1848 uint16_t stats_type == 3;
1849 enum ofp_stats_request_flags flags;
1850 pad(4);
1851};
1852
1853struct of_table_stats_reply : of_stats_reply {
1854 uint8_t version;
1855 uint8_t type == 19;
1856 uint16_t length;
1857 uint32_t xid;
1858 uint16_t stats_type == 3;
1859 enum ofp_stats_reply_flags flags;
1860 pad(4);
1861 list(of_table_stats_entry_t) entries;
1862};
1863
1864struct of_experimenter_stats_request : of_stats_request {
1865 uint8_t version;
1866 uint8_t type == 18;
1867 uint16_t length;
1868 uint32_t xid;
1869 uint16_t stats_type == 0xffff;
1870 enum ofp_stats_request_flags flags;
1871 pad(4);
1872 uint32_t experimenter == ?;
1873 uint32_t subtype;
1874};
1875
1876struct of_experimenter_stats_reply : of_stats_reply {
1877 uint8_t version;
1878 uint8_t type == 19;
1879 uint16_t length;
1880 uint32_t xid;
1881 uint16_t stats_type == 0xffff;
1882 enum ofp_stats_reply_flags flags;
1883 pad(4);
1884 uint32_t experimenter == ?;
1885 uint32_t subtype;
1886};
1887
1888// FIXME: These are padded to 8 byte align beyond the length indicated
1889
1890struct of_table_feature_prop {
1891 uint16_t type == ?;
1892 uint16_t length;
1893};
1894
1895struct of_table_feature_prop_instructions : of_table_feature_prop {
1896 uint16_t type == 0;
1897 uint16_t length;
1898 // FIXME Check if instruction_t is right for ids here
1899 list(of_instruction_id_t) instruction_ids;
1900};
1901
1902struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
1903 uint16_t type == 1;
1904 uint16_t length;
1905 list(of_instruction_id_t) instruction_ids;
1906};
1907
1908struct of_table_feature_prop_next_tables : of_table_feature_prop {
1909 uint16_t type == 2;
1910 uint16_t length;
1911 list(of_uint8_t) next_table_ids;
1912};
1913
1914struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
1915 uint16_t type == 3;
1916 uint16_t length;
1917 list(of_uint8_t) next_table_ids;
1918};
1919
1920struct of_table_feature_prop_write_actions : of_table_feature_prop {
1921 uint16_t type == 4;
1922 uint16_t length;
1923 list(of_action_id_t) action_ids;
1924};
1925
1926struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
1927 uint16_t type == 5;
1928 uint16_t length;
1929 list(of_action_id_t) action_ids;
1930};
1931
1932struct of_table_feature_prop_apply_actions : of_table_feature_prop {
1933 uint16_t type == 6;
1934 uint16_t length;
1935 list(of_action_id_t) action_ids;
1936};
1937
1938struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop {
1939 uint16_t type == 7;
1940 uint16_t length;
1941 list(of_action_id_t) action_ids;
1942};
1943
1944struct of_table_feature_prop_match : of_table_feature_prop {
1945 uint16_t type == 8;
1946 uint16_t length;
1947 list(of_uint32_t) oxm_ids;
1948};
1949
1950struct of_table_feature_prop_wildcards : of_table_feature_prop {
1951 uint16_t type == 10;
1952 uint16_t length;
1953 list(of_uint32_t) oxm_ids;
1954};
1955
1956struct of_table_feature_prop_write_setfield : of_table_feature_prop {
1957 uint16_t type == 12;
1958 uint16_t length;
1959 list(of_uint32_t) oxm_ids;
1960};
1961
1962struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop {
1963 uint16_t type == 13;
1964 uint16_t length;
1965 list(of_uint32_t) oxm_ids;
1966};
1967
1968struct of_table_feature_prop_apply_setfield : of_table_feature_prop {
1969 uint16_t type == 14;
1970 uint16_t length;
1971 list(of_uint32_t) oxm_ids;
1972};
1973
1974struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop {
1975 uint16_t type == 15;
1976 uint16_t length;
1977 list(of_uint32_t) oxm_ids;
1978};
1979
Rich Lane888d58d2014-10-17 18:04:07 -07001980struct of_table_feature_prop_table_sync_from : of_table_feature_prop {
1981 uint16_t type == 16;
1982 uint16_t length;
1983 list(of_uint8_t) table_ids;
1984};
1985
alshabib9f50e482014-08-23 17:10:57 -05001986struct of_table_feature_prop_experimenter : of_table_feature_prop {
1987 uint16_t type == 65534;
1988 uint16_t length;
Rich Lane7f503ee2014-09-26 14:18:58 -07001989 uint32_t experimenter == ?;
alshabib9f50e482014-08-23 17:10:57 -05001990 uint32_t subtype;
1991 of_octets_t experimenter_data;
1992};
1993
1994struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
1995 uint16_t type == 65535;
1996 uint16_t length;
Rich Lane7f503ee2014-09-26 14:18:58 -07001997 uint32_t experimenter == ?;
alshabib9f50e482014-08-23 17:10:57 -05001998 uint32_t subtype;
1999 of_octets_t experimenter_data;
2000};
2001
2002struct of_table_features {
2003 uint16_t length;
2004 uint8_t table_id;
2005 pad(5);
2006 of_table_name_t name;
2007 uint64_t metadata_match;
2008 uint64_t metadata_write;
2009 uint32_t config;
2010 uint32_t max_entries;
2011 list(of_table_feature_prop_t) properties;
2012};
2013
2014struct of_meter_features {
2015 uint32_t max_meter;
2016 uint32_t band_types;
2017 uint32_t capabilities;
2018 uint8_t max_bands;
2019 uint8_t max_color;
2020 pad(2);
2021};
2022
2023struct of_port_stats_request : of_stats_request {
2024 uint8_t version;
2025 uint8_t type == 18;
2026 uint16_t length;
2027 uint32_t xid;
2028 uint16_t stats_type == 4;
2029 enum ofp_stats_request_flags flags;
2030 pad(4);
2031 of_port_no_t port_no;
2032 pad(4);
2033};
2034
2035struct of_port_stats_reply : of_stats_reply {
2036 uint8_t version;
2037 uint8_t type == 19;
2038 uint16_t length;
2039 uint32_t xid;
2040 uint16_t stats_type == 4;
2041 enum ofp_stats_reply_flags flags;
2042 pad(4);
2043 list(of_port_stats_entry_t) entries;
2044};
2045
2046struct of_queue_stats_request : of_stats_request {
2047 uint8_t version;
2048 uint8_t type == 18;
2049 uint16_t length;
2050 uint32_t xid;
2051 uint16_t stats_type == 5;
2052 enum ofp_stats_request_flags flags;
2053 pad(4);
2054 of_port_no_t port_no;
2055 uint32_t queue_id;
2056};
2057
2058struct of_queue_stats_reply : of_stats_reply {
2059 uint8_t version;
2060 uint8_t type == 19;
2061 uint16_t length;
2062 uint32_t xid;
2063 uint16_t stats_type == 5;
2064 enum ofp_stats_reply_flags flags;
2065 pad(4);
2066 list(of_queue_stats_entry_t) entries;
2067};
2068
2069struct of_group_stats_request : of_stats_request {
2070 uint8_t version;
2071 uint8_t type == 18;
2072 uint16_t length;
2073 uint32_t xid;
2074 uint16_t stats_type == 6;
2075 enum ofp_stats_request_flags flags;
2076 pad(4);
2077 uint32_t group_id;
2078 pad(4);
2079};
2080
2081struct of_group_stats_reply : of_stats_reply {
2082 uint8_t version;
2083 uint8_t type == 19;
2084 uint16_t length;
2085 uint32_t xid;
2086 uint16_t stats_type == 6;
2087 enum ofp_stats_reply_flags flags;
2088 pad(4);
2089 list(of_group_stats_entry_t) entries;
2090};
2091
2092struct of_group_desc_stats_request : of_stats_request {
2093 uint8_t version;
2094 uint8_t type == 18;
2095 uint16_t length;
2096 uint32_t xid;
2097 uint16_t stats_type == 7;
2098 enum ofp_stats_request_flags flags;
2099 pad(4);
2100};
2101
2102struct of_group_desc_stats_reply : of_stats_reply {
2103 uint8_t version;
2104 uint8_t type == 19;
2105 uint16_t length;
2106 uint32_t xid;
2107 uint16_t stats_type == 7;
2108 enum ofp_stats_reply_flags flags;
2109 pad(4);
2110 list(of_group_desc_stats_entry_t) entries;
2111};
2112
2113struct of_group_features_stats_request : of_stats_request {
2114 uint8_t version;
2115 uint8_t type == 18;
2116 uint16_t length;
2117 uint32_t xid;
2118 uint16_t stats_type == 8;
2119 enum ofp_stats_request_flags flags;
2120 pad(4);
2121};
2122
2123struct of_group_features_stats_reply : of_stats_reply {
2124 uint8_t version;
2125 uint8_t type == 19;
2126 uint16_t length;
2127 uint32_t xid;
2128 uint16_t stats_type == 8;
2129 enum ofp_stats_reply_flags flags;
2130 pad(4);
2131 uint32_t types;
2132 uint32_t capabilities;
2133 uint32_t max_groups_all;
2134 uint32_t max_groups_select;
2135 uint32_t max_groups_indirect;
2136 uint32_t max_groups_ff;
2137 uint32_t actions_all;
2138 uint32_t actions_select;
2139 uint32_t actions_indirect;
2140 uint32_t actions_ff;
2141};
2142
2143struct of_meter_stats_request : of_stats_request {
2144 uint8_t version;
2145 uint8_t type == 18;
2146 uint16_t length;
2147 uint32_t xid;
2148 uint16_t stats_type == 9;
2149 enum ofp_stats_request_flags flags;
2150 pad(4);
2151 uint32_t meter_id;
2152 pad(4);
2153};
2154
2155struct of_meter_stats_reply : of_stats_reply {
2156 uint8_t version;
2157 uint8_t type == 19;
2158 uint16_t length;
2159 uint32_t xid;
2160 uint16_t stats_type == 9;
2161 enum ofp_stats_reply_flags flags;
2162 pad(4);
2163 list(of_meter_stats_t) entries;
2164};
2165
2166struct of_meter_config_stats_request : of_stats_request {
2167 uint8_t version;
2168 uint8_t type == 18;
2169 uint16_t length;
2170 uint32_t xid;
2171 uint16_t stats_type == 10;
2172 enum ofp_stats_request_flags flags;
2173 pad(4);
2174 uint32_t meter_id;
2175 pad(4);
2176};
2177
2178struct of_meter_config_stats_reply : of_stats_reply {
2179 uint8_t version;
2180 uint8_t type == 19;
2181 uint16_t length;
2182 uint32_t xid;
2183 uint16_t stats_type == 10;
2184 enum ofp_stats_reply_flags flags;
2185 pad(4);
2186 list(of_meter_band_t) entries;
2187};
2188
2189// FIXME stats added to get things working
2190struct of_meter_features_stats_request : of_stats_request {
2191 uint8_t version;
2192 uint8_t type == 18;
2193 uint16_t length;
2194 uint32_t xid;
2195 uint16_t stats_type == 11;
2196 enum ofp_stats_request_flags flags;
2197 pad(4);
2198};
2199
2200// FIXME stats added to get things working
2201struct of_meter_features_stats_reply : of_stats_reply {
2202 uint8_t version;
2203 uint8_t type == 19;
2204 uint16_t length;
2205 uint32_t xid;
2206 uint16_t stats_type == 11;
2207 enum ofp_stats_reply_flags flags;
2208 pad(4);
2209 of_meter_features_t features;
2210};
2211
2212// FIXME stats added to get things working
2213struct of_table_features_stats_request : of_stats_request {
2214 uint8_t version;
2215 uint8_t type == 18;
2216 uint16_t length;
2217 uint32_t xid;
2218 uint16_t stats_type == 12;
2219 enum ofp_stats_request_flags flags;
2220 pad(4);
2221 list(of_table_features_t) entries;
2222};
2223
2224// FIXME stats added to get things working
2225struct of_table_features_stats_reply : of_stats_reply {
2226 uint8_t version;
2227 uint8_t type == 19;
2228 uint16_t length;
2229 uint32_t xid;
2230 uint16_t stats_type == 12;
2231 enum ofp_stats_reply_flags flags;
2232 pad(4);
2233 list(of_table_features_t) entries;
2234};
2235
2236// FIXME stats added to get things working
2237struct of_port_desc_stats_request : of_stats_request {
2238 uint8_t version;
2239 uint8_t type == 18;
2240 uint16_t length;
2241 uint32_t xid;
2242 uint16_t stats_type == 13;
2243 enum ofp_stats_request_flags flags;
2244 pad(4);
2245};
2246
2247// FIXME stats added to get things working
2248struct of_port_desc_stats_reply : of_stats_reply {
2249 uint8_t version;
2250 uint8_t type == 19;
2251 uint16_t length;
2252 uint32_t xid;
2253 uint16_t stats_type == 13;
2254 enum ofp_stats_reply_flags flags;
2255 pad(4);
2256 list(of_port_desc_t) entries;
2257};
2258
Rich Lane888d58d2014-10-17 18:04:07 -07002259struct of_table_desc_stats_request : of_stats_request {
2260 uint8_t version;
2261 uint8_t type == 18;
2262 uint16_t length;
2263 uint32_t xid;
2264 uint16_t stats_type == 14;
2265 enum ofp_stats_request_flags flags;
2266 pad(4);
2267};
2268
2269struct of_table_desc {
2270 uint16_t length;
2271 uint8_t table_id;
2272 pad(1);
2273 enum ofp_table_config config;
2274};
2275
2276struct of_table_desc_stats_reply : of_stats_reply {
2277 uint8_t version;
2278 uint8_t type == 19;
2279 uint16_t length;
2280 uint32_t xid;
2281 uint16_t stats_type == 14;
2282 enum ofp_stats_reply_flags flags;
2283 pad(4);
2284 list(of_table_desc_t) entries;
2285};
2286
2287struct of_queue_desc_stats_request : of_stats_request {
2288 uint8_t version;
2289 uint8_t type == 18;
2290 uint16_t length;
2291 uint32_t xid;
2292 uint16_t stats_type == 15;
2293 enum ofp_stats_request_flags flags;
2294 pad(4);
2295};
2296
2297struct of_queue_desc_prop {
2298 uint16_t type == ?;
2299 uint16_t length;
2300};
2301
2302struct of_queue_desc_prop_min_rate : of_queue_desc_prop {
2303 uint16_t type == 1;
2304 uint16_t length;
2305 uint16_t rate;
2306 pad(2);
2307};
2308
2309struct of_queue_desc_prop_max_rate : of_queue_desc_prop {
2310 uint16_t type == 2;
2311 uint16_t length;
2312 uint16_t rate;
2313 pad(2);
2314};
2315
2316struct of_queue_desc_prop_experimenter : of_queue_desc_prop {
2317 uint16_t type == 0xffff;
2318 uint16_t length;
2319 uint32_t experimenter == ?;
2320 uint32_t exp_type;
2321};
2322
2323struct of_queue_desc {
2324 uint32_t port_no;
2325 uint32_t queue_id;
2326 uint16_t length;
2327 pad(6);
2328 list(of_queue_desc_prop_t) properties;
2329};
2330
2331struct of_queue_desc_stats_reply : of_stats_reply {
2332 uint8_t version;
2333 uint8_t type == 19;
2334 uint16_t length;
2335 uint32_t xid;
2336 uint16_t stats_type == 15;
2337 enum ofp_stats_reply_flags flags;
2338 pad(4);
2339 list(of_queue_desc_t) entries;
2340};
2341
2342/*
2343 * Not supporting the flow monitor multipart messages. This message is
2344 * poorly designed because it includes a variable length match inside a
2345 * struct (ofp_flow_monitor_request) with no explicit length member.
2346 * I'm not writing the special case code to figure out the total length.
2347 */
2348
alshabib9f50e482014-08-23 17:10:57 -05002349struct of_meter_band_stats {
2350 uint64_t packet_band_count;
2351 uint64_t byte_band_count;
2352};
2353
2354struct of_meter_stats {
2355 uint32_t meter_id;
2356 uint16_t len;
2357 pad(6);
2358 uint32_t flow_count;
2359 uint64_t packet_in_count;
2360 uint64_t byte_in_count;
2361 uint32_t duration_sec;
2362 uint32_t duration_nsec;
2363 list(of_meter_band_stats_t) band_stats;
2364};
2365
2366struct of_meter_config {
2367 uint16_t length;
2368 uint16_t flags;
2369 uint32_t meter_id;
2370 list(of_meter_band_t) entries;
2371};
2372
2373// END OF STATS OBJECTS
2374
2375struct of_queue_prop {
2376 uint16_t type == ?;
2377 uint16_t len;
2378 pad(4);
2379};
2380
2381struct of_queue_prop_min_rate : of_queue_prop {
2382 uint16_t type == 1;
2383 uint16_t len;
2384 pad(4);
2385 uint16_t rate;
2386 pad(6);
2387};
2388
2389struct of_queue_prop_max_rate : of_queue_prop {
2390 uint16_t type == 2;
2391 uint16_t len;
2392 pad(4);
2393 uint16_t rate;
2394 pad(6);
2395};
2396
2397struct of_queue_prop_experimenter : of_queue_prop {
2398 uint16_t type == 65535;
2399 uint16_t len;
2400 pad(4);
2401 uint32_t experimenter == ?;
2402 pad(4);
2403 of_octets_t data;
2404};
2405
2406struct of_packet_queue {
2407 uint32_t queue_id;
2408 of_port_no_t port;
2409 uint16_t len;
2410 pad(6);
2411 list(of_queue_prop_t) properties;
2412};
2413
alshabib9f50e482014-08-23 17:10:57 -05002414struct of_role_request : of_header {
2415 uint8_t version;
2416 uint8_t type == 24;
2417 uint16_t length;
2418 uint32_t xid;
2419 enum ofp_controller_role role;
2420 pad(4);
2421 uint64_t generation_id;
2422};
2423
2424struct of_role_reply : of_header {
2425 uint8_t version;
2426 uint8_t type == 25;
2427 uint16_t length;
2428 uint32_t xid;
2429 enum ofp_controller_role role;
2430 pad(4);
2431 uint64_t generation_id;
2432};
2433
Rich Lane888d58d2014-10-17 18:04:07 -07002434/* Bundle messages */
2435
2436struct of_bundle_prop {
2437 uint16_t type == ?;
2438 uint16_t length;
2439};
2440
2441struct of_bundle_prop_experimenter : of_bundle_prop {
2442 uint16_t type == 0xffff;
2443 uint16_t length;
2444 uint32_t experimenter == ?;
2445 uint32_t exp_type;
2446};
2447
2448struct of_bundle_ctrl_msg : of_header {
2449 uint8_t version;
2450 uint8_t type == 33;
2451 uint16_t length;
2452 uint32_t xid;
2453 uint32_t bundle_id;
2454 enum ofp_bundle_ctrl_type bundle_ctrl_type;
2455 enum ofp_bundle_flags flags;
2456 list(of_bundle_prop_t) properties;
2457};
2458
2459struct of_bundle_add_msg : of_header {
2460 uint8_t version;
2461 uint8_t type == 34;
2462 uint16_t length;
2463 uint32_t xid;
2464 uint32_t bundle_id;
2465 pad(2);
2466 enum ofp_bundle_flags flags;
2467 // TODO support embedding of_header
2468 of_octets_t data;
2469 // TODO support trailing properties
2470};
2471
2472/* Async config messages */
2473
2474struct of_async_config_prop {
2475 uint16_t type == ?;
2476 uint16_t length;
2477};
2478
2479struct of_async_config_prop_packet_in_slave : of_async_config_prop {
2480 uint16_t type == 0;
2481 uint16_t length;
2482 uint32_t mask;
2483};
2484
2485struct of_async_config_prop_packet_in_master : of_async_config_prop {
2486 uint16_t type == 1;
2487 uint16_t length;
2488 uint32_t mask;
2489};
2490
2491struct of_async_config_prop_port_status_slave : of_async_config_prop {
2492 uint16_t type == 2;
2493 uint16_t length;
2494 uint32_t mask;
2495};
2496
2497struct of_async_config_prop_port_status_master : of_async_config_prop {
2498 uint16_t type == 3;
2499 uint16_t length;
2500 uint32_t mask;
2501};
2502
2503struct of_async_config_prop_flow_removed_slave : of_async_config_prop {
2504 uint16_t type == 4;
2505 uint16_t length;
2506 uint32_t mask;
2507};
2508
2509struct of_async_config_prop_flow_removed_master : of_async_config_prop {
2510 uint16_t type == 5;
2511 uint16_t length;
2512 uint32_t mask;
2513};
2514
2515struct of_async_config_prop_role_status_slave : of_async_config_prop {
2516 uint16_t type == 6;
2517 uint16_t length;
2518 uint32_t mask;
2519};
2520
2521struct of_async_config_prop_role_status_master : of_async_config_prop {
2522 uint16_t type == 7;
2523 uint16_t length;
2524 uint32_t mask;
2525};
2526
2527struct of_async_config_prop_table_status_slave : of_async_config_prop {
2528 uint16_t type == 8;
2529 uint16_t length;
2530 uint32_t mask;
2531};
2532
2533struct of_async_config_prop_table_status_master : of_async_config_prop {
2534 uint16_t type == 9;
2535 uint16_t length;
2536 uint32_t mask;
2537};
2538
2539struct of_async_config_prop_requestforward_slave : of_async_config_prop {
2540 uint16_t type == 10;
2541 uint16_t length;
2542 uint32_t mask;
2543};
2544
2545struct of_async_config_prop_requestforward_master : of_async_config_prop {
2546 uint16_t type == 11;
2547 uint16_t length;
2548 uint32_t mask;
2549};
2550
2551struct of_async_config_prop_experimenter_slave : of_async_config_prop {
2552 uint16_t type == 0xfffe;
2553 uint16_t length;
2554};
2555
2556struct of_async_config_prop_experimenter_master : of_async_config_prop {
2557 uint16_t type == 0xffff;
2558 uint16_t length;
2559};
alshabib9f50e482014-08-23 17:10:57 -05002560
2561struct of_async_get_request : of_header {
2562 uint8_t version;
2563 uint8_t type == 26;
2564 uint16_t length;
2565 uint32_t xid;
Rich Lane888d58d2014-10-17 18:04:07 -07002566 list(of_async_config_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -05002567};
2568
2569struct of_async_get_reply : of_header {
2570 uint8_t version;
2571 uint8_t type == 27;
2572 uint16_t length;
2573 uint32_t xid;
Rich Lane888d58d2014-10-17 18:04:07 -07002574 list(of_async_config_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -05002575};
2576
2577struct of_async_set : of_header {
2578 uint8_t version;
2579 uint8_t type == 28;
2580 uint16_t length;
2581 uint32_t xid;
Rich Lane888d58d2014-10-17 18:04:07 -07002582 list(of_async_config_prop_t) properties;
2583};
2584
2585/* Role status message */
2586
2587struct of_role_prop {
2588 uint16_t type == ?;
2589 uint16_t length;
2590};
2591
2592struct of_role_prop_experimenter : of_role_prop {
2593 uint16_t type == 0xffff;
2594 uint16_t length;
2595 uint32_t experimenter == ?;
2596 uint32_t exp_type;
2597};
2598
2599struct of_role_status : of_header {
2600 uint8_t version;
2601 uint8_t type == 30;
2602 uint16_t length;
2603 uint32_t xid;
2604 uint32_t role;
2605 enum ofp_controller_role_reason reason;
2606 pad(3);
2607 uint64_t generation_id;
2608 list(of_role_prop_t) properties;
2609};
2610
2611/* Table status messages */
2612
2613struct of_table_status : of_header {
2614 uint8_t version;
2615 uint8_t type == 31;
2616 uint16_t length;
2617 uint32_t xid;
2618 uint32_t role;
2619 enum ofp_table_reason reason;
2620 pad(7);
2621 of_table_desc_t table;
2622};
2623
2624/* Request forward message */
2625
2626struct of_requestforward : of_header {
2627 uint8_t version;
2628 uint8_t type == 32;
2629 uint16_t length;
2630 uint32_t xid;
2631 uint32_t role;
2632 // TODO support embedding of_header
2633 of_octets_t data;
alshabib9f50e482014-08-23 17:10:57 -05002634};