blob: 54fce4a76a2ca041358cdf16806c87a1741b1168 [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
Rich Lane1f2162d2014-10-31 16:25:02 -07001579struct of_bad_property_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 == 14;
1585 enum ofp_bad_property_code code;
1586 of_octets_t data;
1587};
1588
1589struct of_async_config_failed_error_msg : of_error_msg {
1590 uint8_t version;
1591 uint8_t type == 1;
1592 uint16_t length;
1593 uint32_t xid;
1594 uint16_t err_type == 15;
1595 enum ofp_async_config_failed_code code;
1596 of_octets_t data;
1597};
1598
1599struct of_flow_monitor_failed_error_msg : of_error_msg {
1600 uint8_t version;
1601 uint8_t type == 1;
1602 uint16_t length;
1603 uint32_t xid;
1604 uint16_t err_type == 16;
1605 enum ofp_flow_monitor_failed_code code;
1606 of_octets_t data;
1607};
1608
1609struct of_bundle_failed_error_msg : of_error_msg {
1610 uint8_t version;
1611 uint8_t type == 1;
1612 uint16_t length;
1613 uint32_t xid;
1614 uint16_t err_type == 17;
1615 enum ofp_bundle_failed_code code;
1616 of_octets_t data;
1617};
1618
alshabib9f50e482014-08-23 17:10:57 -05001619struct of_experimenter_error_msg : of_error_msg {
1620 uint8_t version;
1621 uint8_t type == 1;
1622 uint16_t length;
1623 uint32_t xid;
1624 uint16_t err_type == 0xffff;
1625 uint16_t subtype;
1626 uint32_t experimenter;
1627 of_octets_t data;
1628};
1629
1630// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1631
1632struct of_flow_stats_entry {
1633 uint16_t length;
1634 uint8_t table_id;
1635 pad(1);
1636 uint32_t duration_sec;
1637 uint32_t duration_nsec;
1638 uint16_t priority;
1639 uint16_t idle_timeout;
1640 uint16_t hard_timeout;
1641 enum ofp_flow_mod_flags flags;
1642 uint16_t importance;
1643 pad(2);
1644 uint64_t cookie;
1645 uint64_t packet_count;
1646 uint64_t byte_count;
1647 of_match_t match;
1648 list(of_instruction_t) instructions;
1649};
1650
1651
1652struct of_table_stats_entry {
1653 uint8_t table_id;
1654 pad(3);
1655 uint32_t active_count;
1656 uint64_t lookup_count;
1657 uint64_t matched_count;
1658};
1659
1660/* Common header for all port stats properties. */
Rich Lane7f503ee2014-09-26 14:18:58 -07001661struct of_port_stats_prop {
1662 uint16_t type == ?; /* One of OFPPSPT_*. */
alshabib9f50e482014-08-23 17:10:57 -05001663 uint16_t length; /* Length in bytes of this property. */
1664};
1665
1666/* Ethernet port stats property. */
Rich Lane7f503ee2014-09-26 14:18:58 -07001667struct of_port_stats_prop_ethernet : of_port_stats_prop {
1668 uint16_t type == 0; /* OFPPSPT_ETHERNET. */
alshabib9f50e482014-08-23 17:10:57 -05001669 uint16_t length; /* Length in bytes of this property. */
1670 pad(4);
1671
1672 uint64_t rx_frame_err; /* Number of frame alignment errors. */
1673 uint64_t rx_over_err; /* Number of packets with RX overrun. */
1674 uint64_t rx_crc_err; /* Number of CRC errors. */
1675 uint64_t collisions; /* Number of collisions. */
1676};
1677
1678/* Optical port stats property. */
Rich Lane7f503ee2014-09-26 14:18:58 -07001679struct of_port_stats_prop_optical : of_port_stats_prop {
1680 uint16_t type == 1;
alshabib9f50e482014-08-23 17:10:57 -05001681 uint16_t length;
1682 pad(4);
1683
1684 uint32_t flags;
1685 uint32_t tx_freq_lmda;
Rich Lane457bc452014-10-17 18:04:56 -07001686 uint32_t tx_offset;
alshabib9f50e482014-08-23 17:10:57 -05001687 uint32_t tx_grid_span;
1688 uint32_t rx_freq_lmda;
1689 uint32_t rx_offset;
1690 uint32_t rx_grid_span;
Rich Lane457bc452014-10-17 18:04:56 -07001691 uint16_t tx_pwr;
alshabib9f50e482014-08-23 17:10:57 -05001692 uint16_t rx_pwr;
1693 uint16_t bias_current;
1694 uint16_t temperature;
1695};
1696
1697/* Experimenter port stats property. */
Rich Lane7f503ee2014-09-26 14:18:58 -07001698struct of_port_stats_prop_experimenter : of_port_stats_prop {
1699 uint16_t type == 0xffff;
Rich Lane457bc452014-10-17 18:04:56 -07001700 uint16_t length;
Rich Lane7f503ee2014-09-26 14:18:58 -07001701 uint32_t experimenter == ?;
alshabib9f50e482014-08-23 17:10:57 -05001702 uint32_t exp_type;
Rich Lane7f503ee2014-09-26 14:18:58 -07001703 of_octets_t experimenter_data;
alshabib9f50e482014-08-23 17:10:57 -05001704};
1705
1706struct of_port_stats_entry {
1707 uint16_t length;
1708 pad(2);
1709 of_port_no_t port_no;
Rich Lane90651c42014-10-10 16:19:30 -07001710 uint32_t duration_sec;
1711 uint32_t duration_nsec;
alshabib9f50e482014-08-23 17:10:57 -05001712 uint64_t rx_packets;
1713 uint64_t tx_packets;
1714 uint64_t rx_bytes;
1715 uint64_t tx_bytes;
1716 uint64_t rx_dropped;
1717 uint64_t tx_dropped;
1718 uint64_t rx_errors;
1719 uint64_t tx_errors;
Rich Lane7f503ee2014-09-26 14:18:58 -07001720 list(of_port_stats_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -05001721};
1722
Rich Lane7f503ee2014-09-26 14:18:58 -07001723struct of_queue_stats_prop {
1724 uint16_t type == ?;
alshabib9f50e482014-08-23 17:10:57 -05001725 uint16_t length;
1726};
1727
Rich Lane888d58d2014-10-17 18:04:07 -07001728struct of_queue_stats_prop_experimenter : of_queue_stats_prop {
1729 uint16_t type == 0xffff;
1730 uint16_t length;
1731 uint32_t experimenter == ?;
1732 uint32_t exp_type;
1733};
1734
alshabib9f50e482014-08-23 17:10:57 -05001735struct of_queue_stats_entry {
Rich Lane457bc452014-10-17 18:04:56 -07001736 uint16_t length;
1737 pad(6);
alshabib9f50e482014-08-23 17:10:57 -05001738 of_port_no_t port_no;
Rich Lane457bc452014-10-17 18:04:56 -07001739 uint32_t queue_id;
1740 uint64_t tx_bytes;
alshabib9f50e482014-08-23 17:10:57 -05001741 uint64_t tx_packets;
1742 uint64_t tx_errors;
1743 uint32_t duration_sec;
1744 uint32_t duration_nsec;
Rich Lane7f503ee2014-09-26 14:18:58 -07001745 list(of_queue_stats_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -05001746};
1747
1748struct of_bucket_counter {
1749 uint64_t packet_count;
1750 uint64_t byte_count;
1751};
1752
1753struct of_group_stats_entry {
1754 uint16_t length;
1755 pad(2);
1756 uint32_t group_id;
1757 uint32_t ref_count;
1758 pad(4);
1759 uint64_t packet_count;
1760 uint64_t byte_count;
1761 uint32_t duration_sec;
1762 uint32_t duration_nsec;
1763 list(of_bucket_counter_t) bucket_stats;
1764};
1765
1766struct of_group_desc_stats_entry {
1767 uint16_t length;
1768 enum ofp_group_type group_type;
1769 pad(1);
1770 uint32_t group_id;
1771 list(of_bucket_t) buckets;
1772};
1773
Rich Lane457bc452014-10-17 18:04:56 -07001774// STATS:
alshabib9f50e482014-08-23 17:10:57 -05001775// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1776
1777struct of_stats_request : of_header {
1778 uint8_t version;
1779 uint8_t type == 18;
1780 uint16_t length;
1781 uint32_t xid;
1782 uint16_t stats_type == ?;
1783 enum ofp_stats_request_flags flags;
1784 pad(4);
1785};
1786
1787struct of_stats_reply : of_header {
1788 uint8_t version;
1789 uint8_t type == 19;
1790 uint16_t length;
1791 uint32_t xid;
1792 uint16_t stats_type == ?;
1793 enum ofp_stats_reply_flags flags;
1794 pad(4);
1795};
1796
1797struct of_desc_stats_request : of_stats_request {
1798 uint8_t version;
1799 uint8_t type == 18;
1800 uint16_t length;
1801 uint32_t xid;
1802 uint16_t stats_type == 0;
1803 enum ofp_stats_request_flags flags;
1804 pad(4);
1805};
1806
1807struct of_desc_stats_reply : of_stats_reply {
1808 uint8_t version;
1809 uint8_t type == 19;
1810 uint16_t length;
1811 uint32_t xid;
1812 uint16_t stats_type == 0;
1813 enum ofp_stats_reply_flags flags;
1814 pad(4);
1815 of_desc_str_t mfr_desc;
1816 of_desc_str_t hw_desc;
1817 of_desc_str_t sw_desc;
1818 of_serial_num_t serial_num;
1819 of_desc_str_t dp_desc;
1820};
1821
1822struct of_flow_stats_request : of_stats_request {
1823 uint8_t version;
1824 uint8_t type == 18;
1825 uint16_t length;
1826 uint32_t xid;
1827 uint16_t stats_type == 1;
1828 enum ofp_stats_request_flags flags;
1829 pad(4);
1830 uint8_t table_id;
1831 pad(3);
1832 of_port_no_t out_port;
1833 uint32_t out_group;
1834 pad(4);
1835 uint64_t cookie;
1836 uint64_t cookie_mask;
1837 of_match_t match;
1838};
1839
1840struct of_flow_stats_reply : of_stats_reply {
1841 uint8_t version;
1842 uint8_t type == 19;
1843 uint16_t length;
1844 uint32_t xid;
1845 uint16_t stats_type == 1;
1846 enum ofp_stats_reply_flags flags;
1847 pad(4);
1848 list(of_flow_stats_entry_t) entries;
1849};
1850
1851struct of_aggregate_stats_request : of_stats_request {
1852 uint8_t version;
1853 uint8_t type == 18;
1854 uint16_t length;
1855 uint32_t xid;
1856 uint16_t stats_type == 2;
1857 enum ofp_stats_request_flags flags;
1858 pad(4);
1859 uint8_t table_id;
1860 pad(3);
1861 of_port_no_t out_port;
1862 uint32_t out_group;
1863 pad(4);
1864 uint64_t cookie;
1865 uint64_t cookie_mask;
1866 of_match_t match;
1867};
1868
1869struct of_aggregate_stats_reply : of_stats_reply {
1870 uint8_t version;
1871 uint8_t type == 19;
1872 uint16_t length;
1873 uint32_t xid;
1874 uint16_t stats_type == 2;
1875 enum ofp_stats_reply_flags flags;
1876 pad(4);
1877 uint64_t packet_count;
1878 uint64_t byte_count;
1879 uint32_t flow_count;
1880 pad(4);
1881};
1882
1883struct of_table_stats_request : of_stats_request {
1884 uint8_t version;
1885 uint8_t type == 18;
1886 uint16_t length;
1887 uint32_t xid;
1888 uint16_t stats_type == 3;
1889 enum ofp_stats_request_flags flags;
1890 pad(4);
1891};
1892
1893struct of_table_stats_reply : of_stats_reply {
1894 uint8_t version;
1895 uint8_t type == 19;
1896 uint16_t length;
1897 uint32_t xid;
1898 uint16_t stats_type == 3;
1899 enum ofp_stats_reply_flags flags;
1900 pad(4);
1901 list(of_table_stats_entry_t) entries;
1902};
1903
1904struct of_experimenter_stats_request : of_stats_request {
1905 uint8_t version;
1906 uint8_t type == 18;
1907 uint16_t length;
1908 uint32_t xid;
1909 uint16_t stats_type == 0xffff;
1910 enum ofp_stats_request_flags flags;
1911 pad(4);
1912 uint32_t experimenter == ?;
1913 uint32_t subtype;
1914};
1915
1916struct of_experimenter_stats_reply : of_stats_reply {
1917 uint8_t version;
1918 uint8_t type == 19;
1919 uint16_t length;
1920 uint32_t xid;
1921 uint16_t stats_type == 0xffff;
1922 enum ofp_stats_reply_flags flags;
1923 pad(4);
1924 uint32_t experimenter == ?;
1925 uint32_t subtype;
1926};
1927
1928// FIXME: These are padded to 8 byte align beyond the length indicated
1929
1930struct of_table_feature_prop {
1931 uint16_t type == ?;
1932 uint16_t length;
1933};
1934
1935struct of_table_feature_prop_instructions : of_table_feature_prop {
1936 uint16_t type == 0;
1937 uint16_t length;
1938 // FIXME Check if instruction_t is right for ids here
1939 list(of_instruction_id_t) instruction_ids;
1940};
1941
1942struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
1943 uint16_t type == 1;
1944 uint16_t length;
1945 list(of_instruction_id_t) instruction_ids;
1946};
1947
1948struct of_table_feature_prop_next_tables : of_table_feature_prop {
1949 uint16_t type == 2;
1950 uint16_t length;
1951 list(of_uint8_t) next_table_ids;
1952};
1953
1954struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
1955 uint16_t type == 3;
1956 uint16_t length;
1957 list(of_uint8_t) next_table_ids;
1958};
1959
1960struct of_table_feature_prop_write_actions : of_table_feature_prop {
1961 uint16_t type == 4;
1962 uint16_t length;
1963 list(of_action_id_t) action_ids;
1964};
1965
1966struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
1967 uint16_t type == 5;
1968 uint16_t length;
1969 list(of_action_id_t) action_ids;
1970};
1971
1972struct of_table_feature_prop_apply_actions : of_table_feature_prop {
1973 uint16_t type == 6;
1974 uint16_t length;
1975 list(of_action_id_t) action_ids;
1976};
1977
1978struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop {
1979 uint16_t type == 7;
1980 uint16_t length;
1981 list(of_action_id_t) action_ids;
1982};
1983
1984struct of_table_feature_prop_match : of_table_feature_prop {
1985 uint16_t type == 8;
1986 uint16_t length;
1987 list(of_uint32_t) oxm_ids;
1988};
1989
1990struct of_table_feature_prop_wildcards : of_table_feature_prop {
1991 uint16_t type == 10;
1992 uint16_t length;
1993 list(of_uint32_t) oxm_ids;
1994};
1995
1996struct of_table_feature_prop_write_setfield : of_table_feature_prop {
1997 uint16_t type == 12;
1998 uint16_t length;
1999 list(of_uint32_t) oxm_ids;
2000};
2001
2002struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop {
2003 uint16_t type == 13;
2004 uint16_t length;
2005 list(of_uint32_t) oxm_ids;
2006};
2007
2008struct of_table_feature_prop_apply_setfield : of_table_feature_prop {
2009 uint16_t type == 14;
2010 uint16_t length;
2011 list(of_uint32_t) oxm_ids;
2012};
2013
2014struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop {
2015 uint16_t type == 15;
2016 uint16_t length;
2017 list(of_uint32_t) oxm_ids;
2018};
2019
Rich Lane888d58d2014-10-17 18:04:07 -07002020struct of_table_feature_prop_table_sync_from : of_table_feature_prop {
2021 uint16_t type == 16;
2022 uint16_t length;
2023 list(of_uint8_t) table_ids;
2024};
2025
alshabib9f50e482014-08-23 17:10:57 -05002026struct of_table_feature_prop_experimenter : of_table_feature_prop {
2027 uint16_t type == 65534;
2028 uint16_t length;
Rich Lane7f503ee2014-09-26 14:18:58 -07002029 uint32_t experimenter == ?;
alshabib9f50e482014-08-23 17:10:57 -05002030 uint32_t subtype;
2031 of_octets_t experimenter_data;
2032};
2033
2034struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
2035 uint16_t type == 65535;
2036 uint16_t length;
Rich Lane7f503ee2014-09-26 14:18:58 -07002037 uint32_t experimenter == ?;
alshabib9f50e482014-08-23 17:10:57 -05002038 uint32_t subtype;
2039 of_octets_t experimenter_data;
2040};
2041
2042struct of_table_features {
2043 uint16_t length;
2044 uint8_t table_id;
2045 pad(5);
2046 of_table_name_t name;
2047 uint64_t metadata_match;
2048 uint64_t metadata_write;
2049 uint32_t config;
2050 uint32_t max_entries;
2051 list(of_table_feature_prop_t) properties;
2052};
2053
2054struct of_meter_features {
2055 uint32_t max_meter;
2056 uint32_t band_types;
2057 uint32_t capabilities;
2058 uint8_t max_bands;
2059 uint8_t max_color;
2060 pad(2);
2061};
2062
2063struct of_port_stats_request : of_stats_request {
2064 uint8_t version;
2065 uint8_t type == 18;
2066 uint16_t length;
2067 uint32_t xid;
2068 uint16_t stats_type == 4;
2069 enum ofp_stats_request_flags flags;
2070 pad(4);
2071 of_port_no_t port_no;
2072 pad(4);
2073};
2074
2075struct of_port_stats_reply : of_stats_reply {
2076 uint8_t version;
2077 uint8_t type == 19;
2078 uint16_t length;
2079 uint32_t xid;
2080 uint16_t stats_type == 4;
2081 enum ofp_stats_reply_flags flags;
2082 pad(4);
2083 list(of_port_stats_entry_t) entries;
2084};
2085
2086struct of_queue_stats_request : of_stats_request {
2087 uint8_t version;
2088 uint8_t type == 18;
2089 uint16_t length;
2090 uint32_t xid;
2091 uint16_t stats_type == 5;
2092 enum ofp_stats_request_flags flags;
2093 pad(4);
2094 of_port_no_t port_no;
2095 uint32_t queue_id;
2096};
2097
2098struct of_queue_stats_reply : of_stats_reply {
2099 uint8_t version;
2100 uint8_t type == 19;
2101 uint16_t length;
2102 uint32_t xid;
2103 uint16_t stats_type == 5;
2104 enum ofp_stats_reply_flags flags;
2105 pad(4);
2106 list(of_queue_stats_entry_t) entries;
2107};
2108
2109struct of_group_stats_request : of_stats_request {
2110 uint8_t version;
2111 uint8_t type == 18;
2112 uint16_t length;
2113 uint32_t xid;
2114 uint16_t stats_type == 6;
2115 enum ofp_stats_request_flags flags;
2116 pad(4);
2117 uint32_t group_id;
2118 pad(4);
2119};
2120
2121struct of_group_stats_reply : of_stats_reply {
2122 uint8_t version;
2123 uint8_t type == 19;
2124 uint16_t length;
2125 uint32_t xid;
2126 uint16_t stats_type == 6;
2127 enum ofp_stats_reply_flags flags;
2128 pad(4);
2129 list(of_group_stats_entry_t) entries;
2130};
2131
2132struct of_group_desc_stats_request : of_stats_request {
2133 uint8_t version;
2134 uint8_t type == 18;
2135 uint16_t length;
2136 uint32_t xid;
2137 uint16_t stats_type == 7;
2138 enum ofp_stats_request_flags flags;
2139 pad(4);
2140};
2141
2142struct of_group_desc_stats_reply : of_stats_reply {
2143 uint8_t version;
2144 uint8_t type == 19;
2145 uint16_t length;
2146 uint32_t xid;
2147 uint16_t stats_type == 7;
2148 enum ofp_stats_reply_flags flags;
2149 pad(4);
2150 list(of_group_desc_stats_entry_t) entries;
2151};
2152
2153struct of_group_features_stats_request : of_stats_request {
2154 uint8_t version;
2155 uint8_t type == 18;
2156 uint16_t length;
2157 uint32_t xid;
2158 uint16_t stats_type == 8;
2159 enum ofp_stats_request_flags flags;
2160 pad(4);
2161};
2162
2163struct of_group_features_stats_reply : of_stats_reply {
2164 uint8_t version;
2165 uint8_t type == 19;
2166 uint16_t length;
2167 uint32_t xid;
2168 uint16_t stats_type == 8;
2169 enum ofp_stats_reply_flags flags;
2170 pad(4);
2171 uint32_t types;
2172 uint32_t capabilities;
2173 uint32_t max_groups_all;
2174 uint32_t max_groups_select;
2175 uint32_t max_groups_indirect;
2176 uint32_t max_groups_ff;
2177 uint32_t actions_all;
2178 uint32_t actions_select;
2179 uint32_t actions_indirect;
2180 uint32_t actions_ff;
2181};
2182
2183struct of_meter_stats_request : of_stats_request {
2184 uint8_t version;
2185 uint8_t type == 18;
2186 uint16_t length;
2187 uint32_t xid;
2188 uint16_t stats_type == 9;
2189 enum ofp_stats_request_flags flags;
2190 pad(4);
2191 uint32_t meter_id;
2192 pad(4);
2193};
2194
2195struct of_meter_stats_reply : of_stats_reply {
2196 uint8_t version;
2197 uint8_t type == 19;
2198 uint16_t length;
2199 uint32_t xid;
2200 uint16_t stats_type == 9;
2201 enum ofp_stats_reply_flags flags;
2202 pad(4);
2203 list(of_meter_stats_t) entries;
2204};
2205
2206struct of_meter_config_stats_request : of_stats_request {
2207 uint8_t version;
2208 uint8_t type == 18;
2209 uint16_t length;
2210 uint32_t xid;
2211 uint16_t stats_type == 10;
2212 enum ofp_stats_request_flags flags;
2213 pad(4);
2214 uint32_t meter_id;
2215 pad(4);
2216};
2217
2218struct of_meter_config_stats_reply : of_stats_reply {
2219 uint8_t version;
2220 uint8_t type == 19;
2221 uint16_t length;
2222 uint32_t xid;
2223 uint16_t stats_type == 10;
2224 enum ofp_stats_reply_flags flags;
2225 pad(4);
2226 list(of_meter_band_t) entries;
2227};
2228
2229// FIXME stats added to get things working
2230struct of_meter_features_stats_request : of_stats_request {
2231 uint8_t version;
2232 uint8_t type == 18;
2233 uint16_t length;
2234 uint32_t xid;
2235 uint16_t stats_type == 11;
2236 enum ofp_stats_request_flags flags;
2237 pad(4);
2238};
2239
2240// FIXME stats added to get things working
2241struct of_meter_features_stats_reply : of_stats_reply {
2242 uint8_t version;
2243 uint8_t type == 19;
2244 uint16_t length;
2245 uint32_t xid;
2246 uint16_t stats_type == 11;
2247 enum ofp_stats_reply_flags flags;
2248 pad(4);
2249 of_meter_features_t features;
2250};
2251
2252// FIXME stats added to get things working
2253struct of_table_features_stats_request : of_stats_request {
2254 uint8_t version;
2255 uint8_t type == 18;
2256 uint16_t length;
2257 uint32_t xid;
2258 uint16_t stats_type == 12;
2259 enum ofp_stats_request_flags flags;
2260 pad(4);
2261 list(of_table_features_t) entries;
2262};
2263
2264// FIXME stats added to get things working
2265struct of_table_features_stats_reply : of_stats_reply {
2266 uint8_t version;
2267 uint8_t type == 19;
2268 uint16_t length;
2269 uint32_t xid;
2270 uint16_t stats_type == 12;
2271 enum ofp_stats_reply_flags flags;
2272 pad(4);
2273 list(of_table_features_t) entries;
2274};
2275
2276// FIXME stats added to get things working
2277struct of_port_desc_stats_request : of_stats_request {
2278 uint8_t version;
2279 uint8_t type == 18;
2280 uint16_t length;
2281 uint32_t xid;
2282 uint16_t stats_type == 13;
2283 enum ofp_stats_request_flags flags;
2284 pad(4);
2285};
2286
2287// FIXME stats added to get things working
2288struct of_port_desc_stats_reply : of_stats_reply {
2289 uint8_t version;
2290 uint8_t type == 19;
2291 uint16_t length;
2292 uint32_t xid;
2293 uint16_t stats_type == 13;
2294 enum ofp_stats_reply_flags flags;
2295 pad(4);
2296 list(of_port_desc_t) entries;
2297};
2298
Rich Lane888d58d2014-10-17 18:04:07 -07002299struct of_table_desc_stats_request : of_stats_request {
2300 uint8_t version;
2301 uint8_t type == 18;
2302 uint16_t length;
2303 uint32_t xid;
2304 uint16_t stats_type == 14;
2305 enum ofp_stats_request_flags flags;
2306 pad(4);
2307};
2308
2309struct of_table_desc {
2310 uint16_t length;
2311 uint8_t table_id;
2312 pad(1);
2313 enum ofp_table_config config;
2314};
2315
2316struct of_table_desc_stats_reply : of_stats_reply {
2317 uint8_t version;
2318 uint8_t type == 19;
2319 uint16_t length;
2320 uint32_t xid;
2321 uint16_t stats_type == 14;
2322 enum ofp_stats_reply_flags flags;
2323 pad(4);
2324 list(of_table_desc_t) entries;
2325};
2326
2327struct of_queue_desc_stats_request : of_stats_request {
2328 uint8_t version;
2329 uint8_t type == 18;
2330 uint16_t length;
2331 uint32_t xid;
2332 uint16_t stats_type == 15;
2333 enum ofp_stats_request_flags flags;
2334 pad(4);
2335};
2336
2337struct of_queue_desc_prop {
2338 uint16_t type == ?;
2339 uint16_t length;
2340};
2341
2342struct of_queue_desc_prop_min_rate : of_queue_desc_prop {
2343 uint16_t type == 1;
2344 uint16_t length;
2345 uint16_t rate;
2346 pad(2);
2347};
2348
2349struct of_queue_desc_prop_max_rate : of_queue_desc_prop {
2350 uint16_t type == 2;
2351 uint16_t length;
2352 uint16_t rate;
2353 pad(2);
2354};
2355
2356struct of_queue_desc_prop_experimenter : of_queue_desc_prop {
2357 uint16_t type == 0xffff;
2358 uint16_t length;
2359 uint32_t experimenter == ?;
2360 uint32_t exp_type;
2361};
2362
2363struct of_queue_desc {
2364 uint32_t port_no;
2365 uint32_t queue_id;
2366 uint16_t length;
2367 pad(6);
2368 list(of_queue_desc_prop_t) properties;
2369};
2370
2371struct of_queue_desc_stats_reply : of_stats_reply {
2372 uint8_t version;
2373 uint8_t type == 19;
2374 uint16_t length;
2375 uint32_t xid;
2376 uint16_t stats_type == 15;
2377 enum ofp_stats_reply_flags flags;
2378 pad(4);
2379 list(of_queue_desc_t) entries;
2380};
2381
2382/*
2383 * Not supporting the flow monitor multipart messages. This message is
2384 * poorly designed because it includes a variable length match inside a
2385 * struct (ofp_flow_monitor_request) with no explicit length member.
2386 * I'm not writing the special case code to figure out the total length.
2387 */
2388
alshabib9f50e482014-08-23 17:10:57 -05002389struct of_meter_band_stats {
2390 uint64_t packet_band_count;
2391 uint64_t byte_band_count;
2392};
2393
2394struct of_meter_stats {
2395 uint32_t meter_id;
2396 uint16_t len;
2397 pad(6);
2398 uint32_t flow_count;
2399 uint64_t packet_in_count;
2400 uint64_t byte_in_count;
2401 uint32_t duration_sec;
2402 uint32_t duration_nsec;
2403 list(of_meter_band_stats_t) band_stats;
2404};
2405
2406struct of_meter_config {
2407 uint16_t length;
2408 uint16_t flags;
2409 uint32_t meter_id;
2410 list(of_meter_band_t) entries;
2411};
2412
2413// END OF STATS OBJECTS
2414
2415struct of_queue_prop {
2416 uint16_t type == ?;
2417 uint16_t len;
2418 pad(4);
2419};
2420
2421struct of_queue_prop_min_rate : of_queue_prop {
2422 uint16_t type == 1;
2423 uint16_t len;
2424 pad(4);
2425 uint16_t rate;
2426 pad(6);
2427};
2428
2429struct of_queue_prop_max_rate : of_queue_prop {
2430 uint16_t type == 2;
2431 uint16_t len;
2432 pad(4);
2433 uint16_t rate;
2434 pad(6);
2435};
2436
2437struct of_queue_prop_experimenter : of_queue_prop {
2438 uint16_t type == 65535;
2439 uint16_t len;
2440 pad(4);
2441 uint32_t experimenter == ?;
2442 pad(4);
2443 of_octets_t data;
2444};
2445
2446struct of_packet_queue {
2447 uint32_t queue_id;
2448 of_port_no_t port;
2449 uint16_t len;
2450 pad(6);
2451 list(of_queue_prop_t) properties;
2452};
2453
alshabib9f50e482014-08-23 17:10:57 -05002454struct of_role_request : of_header {
2455 uint8_t version;
2456 uint8_t type == 24;
2457 uint16_t length;
2458 uint32_t xid;
2459 enum ofp_controller_role role;
2460 pad(4);
2461 uint64_t generation_id;
2462};
2463
2464struct of_role_reply : of_header {
2465 uint8_t version;
2466 uint8_t type == 25;
2467 uint16_t length;
2468 uint32_t xid;
2469 enum ofp_controller_role role;
2470 pad(4);
2471 uint64_t generation_id;
2472};
2473
Rich Lane888d58d2014-10-17 18:04:07 -07002474/* Bundle messages */
2475
2476struct of_bundle_prop {
2477 uint16_t type == ?;
2478 uint16_t length;
2479};
2480
2481struct of_bundle_prop_experimenter : of_bundle_prop {
2482 uint16_t type == 0xffff;
2483 uint16_t length;
2484 uint32_t experimenter == ?;
2485 uint32_t exp_type;
2486};
2487
2488struct of_bundle_ctrl_msg : of_header {
2489 uint8_t version;
2490 uint8_t type == 33;
2491 uint16_t length;
2492 uint32_t xid;
2493 uint32_t bundle_id;
2494 enum ofp_bundle_ctrl_type bundle_ctrl_type;
2495 enum ofp_bundle_flags flags;
2496 list(of_bundle_prop_t) properties;
2497};
2498
2499struct of_bundle_add_msg : of_header {
2500 uint8_t version;
2501 uint8_t type == 34;
2502 uint16_t length;
2503 uint32_t xid;
2504 uint32_t bundle_id;
2505 pad(2);
2506 enum ofp_bundle_flags flags;
2507 // TODO support embedding of_header
2508 of_octets_t data;
2509 // TODO support trailing properties
2510};
2511
2512/* Async config messages */
2513
2514struct of_async_config_prop {
2515 uint16_t type == ?;
2516 uint16_t length;
2517};
2518
2519struct of_async_config_prop_packet_in_slave : of_async_config_prop {
2520 uint16_t type == 0;
2521 uint16_t length;
2522 uint32_t mask;
2523};
2524
2525struct of_async_config_prop_packet_in_master : of_async_config_prop {
2526 uint16_t type == 1;
2527 uint16_t length;
2528 uint32_t mask;
2529};
2530
2531struct of_async_config_prop_port_status_slave : of_async_config_prop {
2532 uint16_t type == 2;
2533 uint16_t length;
2534 uint32_t mask;
2535};
2536
2537struct of_async_config_prop_port_status_master : of_async_config_prop {
2538 uint16_t type == 3;
2539 uint16_t length;
2540 uint32_t mask;
2541};
2542
2543struct of_async_config_prop_flow_removed_slave : of_async_config_prop {
2544 uint16_t type == 4;
2545 uint16_t length;
2546 uint32_t mask;
2547};
2548
2549struct of_async_config_prop_flow_removed_master : of_async_config_prop {
2550 uint16_t type == 5;
2551 uint16_t length;
2552 uint32_t mask;
2553};
2554
2555struct of_async_config_prop_role_status_slave : of_async_config_prop {
2556 uint16_t type == 6;
2557 uint16_t length;
2558 uint32_t mask;
2559};
2560
2561struct of_async_config_prop_role_status_master : of_async_config_prop {
2562 uint16_t type == 7;
2563 uint16_t length;
2564 uint32_t mask;
2565};
2566
2567struct of_async_config_prop_table_status_slave : of_async_config_prop {
2568 uint16_t type == 8;
2569 uint16_t length;
2570 uint32_t mask;
2571};
2572
2573struct of_async_config_prop_table_status_master : of_async_config_prop {
2574 uint16_t type == 9;
2575 uint16_t length;
2576 uint32_t mask;
2577};
2578
2579struct of_async_config_prop_requestforward_slave : of_async_config_prop {
2580 uint16_t type == 10;
2581 uint16_t length;
2582 uint32_t mask;
2583};
2584
2585struct of_async_config_prop_requestforward_master : of_async_config_prop {
2586 uint16_t type == 11;
2587 uint16_t length;
2588 uint32_t mask;
2589};
2590
2591struct of_async_config_prop_experimenter_slave : of_async_config_prop {
2592 uint16_t type == 0xfffe;
2593 uint16_t length;
2594};
2595
2596struct of_async_config_prop_experimenter_master : of_async_config_prop {
2597 uint16_t type == 0xffff;
2598 uint16_t length;
2599};
alshabib9f50e482014-08-23 17:10:57 -05002600
2601struct of_async_get_request : of_header {
2602 uint8_t version;
2603 uint8_t type == 26;
2604 uint16_t length;
2605 uint32_t xid;
Rich Lane888d58d2014-10-17 18:04:07 -07002606 list(of_async_config_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -05002607};
2608
2609struct of_async_get_reply : of_header {
2610 uint8_t version;
2611 uint8_t type == 27;
2612 uint16_t length;
2613 uint32_t xid;
Rich Lane888d58d2014-10-17 18:04:07 -07002614 list(of_async_config_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -05002615};
2616
2617struct of_async_set : of_header {
2618 uint8_t version;
2619 uint8_t type == 28;
2620 uint16_t length;
2621 uint32_t xid;
Rich Lane888d58d2014-10-17 18:04:07 -07002622 list(of_async_config_prop_t) properties;
2623};
2624
2625/* Role status message */
2626
2627struct of_role_prop {
2628 uint16_t type == ?;
2629 uint16_t length;
2630};
2631
2632struct of_role_prop_experimenter : of_role_prop {
2633 uint16_t type == 0xffff;
2634 uint16_t length;
2635 uint32_t experimenter == ?;
2636 uint32_t exp_type;
2637};
2638
2639struct of_role_status : of_header {
2640 uint8_t version;
2641 uint8_t type == 30;
2642 uint16_t length;
2643 uint32_t xid;
2644 uint32_t role;
2645 enum ofp_controller_role_reason reason;
2646 pad(3);
2647 uint64_t generation_id;
2648 list(of_role_prop_t) properties;
2649};
2650
2651/* Table status messages */
2652
2653struct of_table_status : of_header {
2654 uint8_t version;
2655 uint8_t type == 31;
2656 uint16_t length;
2657 uint32_t xid;
2658 uint32_t role;
2659 enum ofp_table_reason reason;
2660 pad(7);
2661 of_table_desc_t table;
2662};
2663
2664/* Request forward message */
2665
2666struct of_requestforward : of_header {
2667 uint8_t version;
2668 uint8_t type == 32;
2669 uint16_t length;
2670 uint32_t xid;
2671 uint32_t role;
2672 // TODO support embedding of_header
2673 of_octets_t data;
alshabib9f50e482014-08-23 17:10:57 -05002674};