blob: 2f495ed6b65a0a936f160e5c93342f42cf90b595 [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,
104 OFPT_REQUESTFORWARD = 32,
105 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
648/* XXX rename to of_message */
649struct of_header {
650 uint8_t version;
651 uint8_t type == ?;
652 uint16_t length;
653 uint32_t xid;
654};
655
656struct of_uint64 {
657 uint64_t value;
658};
659
660// Special structures used for managing scalar list elements
661struct of_uint32 {
662 uint32_t value;
663};
664
665// Special structures used for managing scalar list elements
666struct of_uint8 {
667 uint8_t value;
668};
669
670struct of_hello_elem {
671 uint16_t type == ?;
672 uint16_t length;
673};
674
675struct of_hello_elem_versionbitmap : of_hello_elem {
676 uint16_t type == 1;
677 uint16_t length;
678 list(of_uint32_t) bitmaps;
679};
680
681struct of_hello : of_header {
682 uint8_t version;
683 uint8_t type == 0;
684 uint16_t length;
685 uint32_t xid;
686 list(of_hello_elem_t) elements;
687};
688
689struct of_echo_request : of_header {
690 uint8_t version;
691 uint8_t type == 2;
692 uint16_t length;
693 uint32_t xid;
694 of_octets_t data;
695};
696
697struct of_echo_reply : of_header {
698 uint8_t version;
699 uint8_t type == 3;
700 uint16_t length;
701 uint32_t xid;
702 of_octets_t data;
703};
704
705struct of_experimenter : of_header {
706 uint8_t version;
707 uint8_t type == 4;
708 uint16_t length;
709 uint32_t xid;
710 uint32_t experimenter == ?;
711 uint32_t subtype;
712 of_octets_t data;
713};
714
715struct of_barrier_request : of_header {
716 uint8_t version;
717 uint8_t type == 20;
718 uint16_t length;
719 uint32_t xid;
720};
721
722struct of_barrier_reply : of_header {
723 uint8_t version;
724 uint8_t type == 21;
725 uint16_t length;
726 uint32_t xid;
727};
728
729struct of_get_config_request : of_header {
730 uint8_t version;
731 uint8_t type == 7;
732 uint16_t length;
733 uint32_t xid;
734};
735
736struct of_get_config_reply : of_header {
737 uint8_t version;
738 uint8_t type == 8;
739 uint16_t length;
740 uint32_t xid;
741 enum ofp_config_flags flags;
742 uint16_t miss_send_len;
743};
744
745struct of_set_config : of_header {
746 uint8_t version;
747 uint8_t type == 9;
748 uint16_t length;
749 uint32_t xid;
750 enum ofp_config_flags flags;
751 uint16_t miss_send_len;
752};
753
Rich Lane7f503ee2014-09-26 14:18:58 -0700754struct of_table_mod_prop {
755 uint16_t type == ?; /* One of OFPTMPT_*. */
alshabib9f50e482014-08-23 17:10:57 -0500756 uint16_t length; /* Length in bytes of this property. */
757};
758
759struct of_table_mod : of_header {
760 uint8_t version;
761 uint8_t type == 17;
762 uint16_t length;
763 uint32_t xid;
764 uint8_t table_id;
765 pad(3);
766 uint32_t config;
Rich Lane7f503ee2014-09-26 14:18:58 -0700767 list(of_table_mod_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -0500768};
769
Rich Lane7f503ee2014-09-26 14:18:58 -0700770struct of_port_desc_prop {
771 uint16_t type == ?; /* One of OFPPDPT_*. */
alshabib9f50e482014-08-23 17:10:57 -0500772 uint16_t length; /* Length in bytes of this property. */
773};
774
Rich Lanec6463c32014-10-10 17:13:27 -0700775struct of_port_desc_prop_ethernet : of_port_desc_prop {
776 uint16_t type == 0;
777 uint16_t length;
778 pad(4);
779 uint32_t curr;
780 uint32_t advertised;
781 uint32_t supported;
782 uint32_t peer;
783 uint32_t curr_speed;
784 uint32_t max_speed;
785};
786
alshabib9f50e482014-08-23 17:10:57 -0500787struct of_port_desc {
788 of_port_no_t port_no;
789 uint16_t length;
790 pad(2);
791 of_mac_addr_t hw_addr;
792 pad(2);
793 of_port_name_t name;
794 enum ofp_port_config config; /* Bitmap of OFPPC_* flags. */
795 enum ofp_port_state state; /* Bitmap of OFPPS_* flags. */
Rich Lane7f503ee2014-09-26 14:18:58 -0700796 list(of_port_desc_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -0500797};
798
799struct of_features_request : of_header {
800 uint8_t version;
801 uint8_t type == 5;
802 uint16_t length;
803 uint32_t xid;
804};
805
806struct of_features_reply : of_header {
807 uint8_t version;
808 uint8_t type == 6;
809 uint16_t length;
810 uint32_t xid;
811 uint64_t datapath_id;
812 uint32_t n_buffers;
813 uint8_t n_tables;
814 uint8_t auxiliary_id;
815 pad(2);
816 enum ofp_capabilities capabilities;
817 uint32_t reserved;
818};
819
820struct of_port_status : of_header {
821 uint8_t version;
822 uint8_t type == 12;
823 uint16_t length;
824 uint32_t xid;
825 enum ofp_port_reason reason;
826 pad(7);
827 of_port_desc_t desc;
828};
829
Rich Lane7f503ee2014-09-26 14:18:58 -0700830struct of_port_mod_prop {
831 uint16_t type == ?; /* One of OFPPMPT_*. */
alshabib9f50e482014-08-23 17:10:57 -0500832 uint16_t length; /* Length in bytes of this property. */
833};
834
835struct of_port_mod : of_header {
836 uint8_t version;
837 uint8_t type == 16;
838 uint16_t length;
839 uint32_t xid;
840 of_port_no_t port_no;
841 pad(4);
842 of_mac_addr_t hw_addr;
843 pad(2);
844 uint32_t config;
845 uint32_t mask;
Rich Lane7f503ee2014-09-26 14:18:58 -0700846 list(of_port_mod_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -0500847};
848
Rich Laneb4d24df2014-10-10 15:58:03 -0700849struct of_match_v3(align=8, length_includes_align=False) {
alshabib9f50e482014-08-23 17:10:57 -0500850 uint16_t type == 1;
851 uint16_t length;
852 list(of_oxm_t) oxm_list;
853};
854
855// This looks like an action header, but is standalone. See
856// ofp_table_features_prop_actions
857struct of_action_id {
858 uint16_t type;
859 uint16_t len;
Rich Lane7f503ee2014-09-26 14:18:58 -0700860 of_octets_t exp_data;
alshabib9f50e482014-08-23 17:10:57 -0500861};
862
863struct of_action_output : of_action {
864 uint16_t type == 0;
865 uint16_t len;
866 of_port_no_t port;
867 uint16_t max_len;
868 pad(6);
869};
870
871struct of_action_copy_ttl_out : of_action {
872 uint16_t type == 11;
873 uint16_t len;
874 pad(4);
875};
876
877struct of_action_copy_ttl_in : of_action {
878 uint16_t type == 12;
879 uint16_t len;
880 pad(4);
881};
882
883struct of_action_set_mpls_ttl : of_action {
884 uint16_t type == 15;
885 uint16_t len;
886 uint8_t mpls_ttl;
887 pad(3);
888};
889
890struct of_action_dec_mpls_ttl : of_action {
891 uint16_t type == 16;
892 uint16_t len;
893 pad(4);
894};
895
896struct of_action_push_vlan : of_action {
897 uint16_t type == 17;
898 uint16_t len;
899 uint16_t ethertype;
900 pad(2);
901};
902
903struct of_action_pop_vlan : of_action {
904 uint16_t type == 18;
905 uint16_t len;
906 pad(4);
907};
908
909struct of_action_push_mpls : of_action {
910 uint16_t type == 19;
911 uint16_t len;
912 uint16_t ethertype;
913 pad(2);
914};
915
916struct of_action_pop_mpls : of_action {
917 uint16_t type == 20;
918 uint16_t len;
919 uint16_t ethertype;
920 pad(2);
921};
922
923struct of_action_set_queue : of_action {
924 uint16_t type == 21;
925 uint16_t len;
926 uint32_t queue_id;
927};
928
929struct of_action_group : of_action {
930 uint16_t type == 22;
931 uint16_t len;
932 uint32_t group_id;
933};
934
935struct of_action_set_nw_ttl : of_action {
936 uint16_t type == 23;
937 uint16_t len;
938 uint8_t nw_ttl;
939 pad(3);
940};
941
942struct of_action_dec_nw_ttl : of_action {
943 uint16_t type == 24;
944 uint16_t len;
945 pad(4);
946};
947
948struct of_action_set_field(align=8, length_includes_align=True) : of_action {
949 uint16_t type == 25;
950 uint16_t len;
951 of_oxm_t field;
952};
953
954struct of_action_experimenter(align=8, length_includes_align=True): of_action {
955 uint16_t type == 65535;
956 uint16_t len;
957 uint32_t experimenter == ?;
958 of_octets_t data;
959};
960
961struct of_action_pop_pbb : of_action {
962 uint16_t type == 27;
963 uint16_t len;
964 pad(4);
965};
966
967struct of_action_push_pbb : of_action {
968 uint16_t type == 26;
969 uint16_t len;
970 uint16_t ethertype;
971 pad(2);
972};
973
974struct of_action {
975 uint16_t type == ?;
976 uint16_t len;
977 pad(4);
978};
979
980struct of_instruction_id {
981 uint16_t type;
982 uint16_t len;
983};
984
985struct of_instruction {
986 uint16_t type == ?;
987 uint16_t len;
988};
989
990struct of_instruction_goto_table : of_instruction {
991 uint16_t type == 1;
992 uint16_t len;
Rich Lane94af3782014-10-10 15:59:36 -0700993 uint8_t table_id;
994 pad(3);
alshabib9f50e482014-08-23 17:10:57 -0500995};
996
997struct of_instruction_write_metadata : of_instruction {
998 uint16_t type == 2;
999 uint16_t len;
1000 pad(4);
1001 uint64_t metadata;
1002 uint64_t metadata_mask;
1003};
1004
1005struct of_instruction_write_actions : of_instruction {
1006 uint16_t type == 3;
1007 uint16_t len;
1008 pad(4);
1009 list(of_action_t) actions;
1010};
1011
1012struct of_instruction_apply_actions : of_instruction {
1013 uint16_t type == 4;
1014 uint16_t len;
1015 pad(4);
1016 list(of_action_t) actions;
1017};
1018
1019struct of_instruction_clear_actions : of_instruction {
1020 uint16_t type == 5;
1021 uint16_t len;
1022 pad(4);
1023};
1024
1025struct of_instruction_meter : of_instruction {
1026 uint16_t type == 6;
1027 uint16_t len;
1028 uint32_t meter_id;
1029};
1030
1031struct of_instruction_experimenter : of_instruction {
1032 uint16_t type == 65535;
1033 uint16_t len;
1034 uint32_t experimenter == ?;
1035 of_octets_t data;
1036};
1037
1038struct of_flow_mod : of_header {
1039 uint8_t version;
1040 uint8_t type == 14;
1041 uint16_t length;
1042 uint32_t xid;
1043 uint64_t cookie;
1044 uint64_t cookie_mask;
1045 uint8_t table_id;
1046 of_fm_cmd_t _command == ?;
1047 uint16_t idle_timeout;
1048 uint16_t hard_timeout;
1049 uint16_t priority;
1050 uint32_t buffer_id;
1051 of_port_no_t out_port;
1052 uint32_t out_group;
1053 enum ofp_flow_mod_flags flags;
1054 pad(2);
1055 of_match_t match;
1056 list(of_instruction_t) instructions;
1057};
1058
1059struct of_flow_add : of_flow_mod {
1060 uint8_t version;
1061 uint8_t type == 14;
1062 uint16_t length;
1063 uint32_t xid;
1064 uint64_t cookie;
1065 uint64_t cookie_mask;
1066 uint8_t table_id;
1067 of_fm_cmd_t _command == 0;
1068 uint16_t idle_timeout;
1069 uint16_t hard_timeout;
1070 uint16_t priority;
1071 uint32_t buffer_id;
1072 of_port_no_t out_port;
1073 uint32_t out_group;
1074 enum ofp_flow_mod_flags flags;
1075 uint16_t importance;
1076 of_match_t match;
1077 list(of_instruction_t) instructions;
1078};
1079
1080struct of_flow_modify : of_flow_mod {
1081 uint8_t version;
1082 uint8_t type == 14;
1083 uint16_t length;
1084 uint32_t xid;
1085 uint64_t cookie;
1086 uint64_t cookie_mask;
1087 uint8_t table_id;
1088 of_fm_cmd_t _command == 1;
1089 uint16_t idle_timeout;
1090 uint16_t hard_timeout;
1091 uint16_t priority;
1092 uint32_t buffer_id;
1093 of_port_no_t out_port;
1094 uint32_t out_group;
1095 enum ofp_flow_mod_flags flags;
1096 uint16_t importance;
1097 of_match_t match;
1098 list(of_instruction_t) instructions;
1099};
1100
1101struct of_flow_modify_strict : of_flow_mod {
1102 uint8_t version;
1103 uint8_t type == 14;
1104 uint16_t length;
1105 uint32_t xid;
1106 uint64_t cookie;
1107 uint64_t cookie_mask;
1108 uint8_t table_id;
1109 of_fm_cmd_t _command == 2;
1110 uint16_t idle_timeout;
1111 uint16_t hard_timeout;
1112 uint16_t priority;
1113 uint32_t buffer_id;
1114 of_port_no_t out_port;
1115 uint32_t out_group;
1116 enum ofp_flow_mod_flags flags;
1117 uint16_t importance;
1118 of_match_t match;
1119 list(of_instruction_t) instructions;
1120};
1121
1122struct of_flow_delete : of_flow_mod {
1123 uint8_t version;
1124 uint8_t type == 14;
1125 uint16_t length;
1126 uint32_t xid;
1127 uint64_t cookie;
1128 uint64_t cookie_mask;
1129 uint8_t table_id;
1130 of_fm_cmd_t _command == 3;
1131 uint16_t idle_timeout;
1132 uint16_t hard_timeout;
1133 uint16_t priority;
1134 uint32_t buffer_id;
1135 of_port_no_t out_port;
1136 uint32_t out_group;
1137 enum ofp_flow_mod_flags flags;
1138 uint16_t importance;
1139 of_match_t match;
1140 list(of_instruction_t) instructions;
1141};
1142
1143struct of_flow_delete_strict : of_flow_mod {
1144 uint8_t version;
1145 uint8_t type == 14;
1146 uint16_t length;
1147 uint32_t xid;
1148 uint64_t cookie;
1149 uint64_t cookie_mask;
1150 uint8_t table_id;
1151 of_fm_cmd_t _command == 4;
1152 uint16_t idle_timeout;
1153 uint16_t hard_timeout;
1154 uint16_t priority;
1155 uint32_t buffer_id;
1156 of_port_no_t out_port;
1157 uint32_t out_group;
1158 enum ofp_flow_mod_flags flags;
1159 uint16_t importance;
1160 of_match_t match;
1161 list(of_instruction_t) instructions;
1162};
1163
1164struct of_bucket {
1165 uint16_t len;
1166 uint16_t weight;
1167 of_port_no_t watch_port;
1168 uint32_t watch_group;
1169 pad(4);
1170 list(of_action_t) actions;
1171};
1172
1173struct of_group_mod : of_header {
1174 uint8_t version;
1175 uint8_t type == 15;
1176 uint16_t length;
1177 uint32_t xid;
1178 enum ofp_group_mod_command command == ?;
1179 enum ofp_group_type group_type;
1180 pad(1);
1181 uint32_t group_id;
1182 list(of_bucket_t) buckets;
1183};
1184
1185struct of_group_add : of_group_mod {
1186 uint8_t version;
1187 uint8_t type == 15;
1188 uint16_t length;
1189 uint32_t xid;
1190 enum ofp_group_mod_command command == 0;
1191 enum ofp_group_type group_type;
1192 pad(1);
1193 uint32_t group_id;
1194 list(of_bucket_t) buckets;
1195};
1196
1197struct of_group_modify : of_group_mod {
1198 uint8_t version;
1199 uint8_t type == 15;
1200 uint16_t length;
1201 uint32_t xid;
1202 enum ofp_group_mod_command command == 1;
1203 enum ofp_group_type group_type;
1204 pad(1);
1205 uint32_t group_id;
1206 list(of_bucket_t) buckets;
1207};
1208
1209struct of_group_delete : of_group_mod {
1210 uint8_t version;
1211 uint8_t type == 15;
1212 uint16_t length;
1213 uint32_t xid;
1214 enum ofp_group_mod_command command == 2;
1215 enum ofp_group_type group_type;
1216 pad(1);
1217 uint32_t group_id;
1218 list(of_bucket_t) buckets;
1219};
1220
1221struct of_packet_out : of_header {
1222 uint8_t version;
1223 uint8_t type == 13;
1224 uint16_t length;
1225 uint32_t xid;
1226 uint32_t buffer_id;
1227 of_port_no_t in_port;
1228 uint16_t actions_len;
1229 pad(6);
1230 list(of_action_t) actions;
1231 of_octets_t data;
1232};
1233
1234struct of_packet_in : of_header {
1235 uint8_t version;
1236 uint8_t type == 10;
1237 uint16_t length;
1238 uint32_t xid;
1239 uint32_t buffer_id;
1240 uint16_t total_len;
1241 uint8_t reason;
1242 uint8_t table_id;
1243 uint64_t cookie;
1244 of_match_t match;
1245 pad(2);
1246 of_octets_t data; /* FIXME: Ensure total_len gets updated */
1247};
1248
1249struct of_flow_removed : of_header {
1250 uint8_t version;
1251 uint8_t type == 11;
1252 uint16_t length;
1253 uint32_t xid;
1254 uint64_t cookie;
1255 uint16_t priority;
1256 uint8_t reason;
1257 uint8_t table_id;
1258 uint32_t duration_sec;
1259 uint32_t duration_nsec;
1260 uint16_t idle_timeout;
1261 uint16_t hard_timeout;
1262 uint64_t packet_count;
1263 uint64_t byte_count;
1264 of_match_t match;
1265};
1266
1267struct of_meter_band {
1268 uint16_t type == ?;
1269 uint16_t len;
1270// uint32_t rate; // These are excluded b/c this is the header
1271// uint32_t burst_size; // These are excluded b/c this is the header
1272};
1273
1274struct of_meter_band_drop : of_meter_band {
1275 uint16_t type == 1;
1276 uint16_t len;
1277 uint32_t rate;
1278 uint32_t burst_size;
1279 pad(4);
1280};
1281
1282struct of_meter_band_dscp_remark : of_meter_band {
1283 uint16_t type == 2;
1284 uint16_t len;
1285 uint32_t rate;
1286 uint32_t burst_size;
1287 uint8_t prec_level;
1288 pad(3);
1289};
1290
1291struct of_meter_band_experimenter : of_meter_band {
1292 uint16_t type == 65535;
1293 uint16_t len;
1294 uint32_t rate;
1295 uint32_t burst_size;
1296 uint32_t experimenter;
1297};
1298
1299struct of_meter_mod : of_header {
1300 uint8_t version;
1301 uint8_t type == 29;
1302 uint16_t length;
1303 uint32_t xid;
1304 uint16_t command;
1305 uint16_t flags;
1306 uint32_t meter_id;
1307 list(of_meter_band_t) bands;
1308};
1309
1310struct of_error_msg : of_header {
1311 uint8_t version;
1312 uint8_t type == 1;
1313 uint16_t length;
1314 uint32_t xid;
1315 uint16_t err_type == ?;
1316};
1317
1318struct of_hello_failed_error_msg : of_error_msg {
1319 uint8_t version;
1320 uint8_t type == 1;
1321 uint16_t length;
1322 uint32_t xid;
1323 uint16_t err_type == 0;
1324 enum ofp_hello_failed_code code;
1325 of_octets_t data;
1326};
1327
1328struct of_bad_request_error_msg : of_error_msg {
1329 uint8_t version;
1330 uint8_t type == 1;
1331 uint16_t length;
1332 uint32_t xid;
1333 uint16_t err_type == 1;
1334 enum ofp_bad_request_code code;
1335 of_octets_t data;
1336};
1337
1338struct of_bad_action_error_msg : of_error_msg {
1339 uint8_t version;
1340 uint8_t type == 1;
1341 uint16_t length;
1342 uint32_t xid;
1343 uint16_t err_type == 2;
1344 enum ofp_bad_action_code code;
1345 of_octets_t data;
1346};
1347
1348struct of_bad_instruction_error_msg : of_error_msg {
1349 uint8_t version;
1350 uint8_t type == 1;
1351 uint16_t length;
1352 uint32_t xid;
1353 uint16_t err_type == 3;
1354 enum ofp_bad_instruction_code code;
1355 of_octets_t data;
1356};
1357
1358struct of_bad_match_error_msg : of_error_msg {
1359 uint8_t version;
1360 uint8_t type == 1;
1361 uint16_t length;
1362 uint32_t xid;
1363 uint16_t err_type == 4;
1364 enum ofp_bad_match_code code;
1365 of_octets_t data;
1366};
1367
1368struct of_flow_mod_failed_error_msg : of_error_msg {
1369 uint8_t version;
1370 uint8_t type == 1;
1371 uint16_t length;
1372 uint32_t xid;
1373 uint16_t err_type == 5;
1374 enum ofp_flow_mod_failed_code code;
1375 of_octets_t data;
1376};
1377
1378struct of_group_mod_failed_error_msg : of_error_msg {
1379 uint8_t version;
1380 uint8_t type == 1;
1381 uint16_t length;
1382 uint32_t xid;
1383 uint16_t err_type == 6;
1384 enum ofp_group_mod_failed_code code;
1385 of_octets_t data;
1386};
1387
1388struct of_port_mod_failed_error_msg : of_error_msg {
1389 uint8_t version;
1390 uint8_t type == 1;
1391 uint16_t length;
1392 uint32_t xid;
1393 uint16_t err_type == 7;
1394 enum ofp_port_mod_failed_code code;
1395 of_octets_t data;
1396};
1397
1398struct of_table_mod_failed_error_msg : of_error_msg {
1399 uint8_t version;
1400 uint8_t type == 1;
1401 uint16_t length;
1402 uint32_t xid;
1403 uint16_t err_type == 8;
1404 enum ofp_table_mod_failed_code code;
1405 of_octets_t data;
1406};
1407
1408struct of_queue_op_failed_error_msg : of_error_msg {
1409 uint8_t version;
1410 uint8_t type == 1;
1411 uint16_t length;
1412 uint32_t xid;
1413 uint16_t err_type == 9;
1414 enum ofp_queue_op_failed_code code;
1415 of_octets_t data;
1416};
1417
1418struct of_switch_config_failed_error_msg : of_error_msg {
1419 uint8_t version;
1420 uint8_t type == 1;
1421 uint16_t length;
1422 uint32_t xid;
1423 uint16_t err_type == 10;
1424 enum ofp_switch_config_failed_code code;
1425 of_octets_t data;
1426};
1427
1428struct of_role_request_failed_error_msg : of_error_msg {
1429 uint8_t version;
1430 uint8_t type == 1;
1431 uint16_t length;
1432 uint32_t xid;
1433 uint16_t err_type == 11;
1434 enum ofp_role_request_failed_code code;
1435 of_octets_t data;
1436};
1437
1438struct of_meter_mod_failed_error_msg : of_error_msg {
1439 uint8_t version;
1440 uint8_t type == 1;
1441 uint16_t length;
1442 uint32_t xid;
1443 uint16_t err_type == 12;
1444 enum ofp_meter_mod_failed_code code;
1445 of_octets_t data;
1446};
1447
1448struct of_table_features_failed_error_msg : of_error_msg {
1449 uint8_t version;
1450 uint8_t type == 1;
1451 uint16_t length;
1452 uint32_t xid;
1453 uint16_t err_type == 13;
1454 enum ofp_table_features_failed_code code;
1455 of_octets_t data;
1456};
1457
1458struct of_experimenter_error_msg : of_error_msg {
1459 uint8_t version;
1460 uint8_t type == 1;
1461 uint16_t length;
1462 uint32_t xid;
1463 uint16_t err_type == 0xffff;
1464 uint16_t subtype;
1465 uint32_t experimenter;
1466 of_octets_t data;
1467};
1468
1469// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1470
1471struct of_flow_stats_entry {
1472 uint16_t length;
1473 uint8_t table_id;
1474 pad(1);
1475 uint32_t duration_sec;
1476 uint32_t duration_nsec;
1477 uint16_t priority;
1478 uint16_t idle_timeout;
1479 uint16_t hard_timeout;
1480 enum ofp_flow_mod_flags flags;
1481 uint16_t importance;
1482 pad(2);
1483 uint64_t cookie;
1484 uint64_t packet_count;
1485 uint64_t byte_count;
1486 of_match_t match;
1487 list(of_instruction_t) instructions;
1488};
1489
1490
1491struct of_table_stats_entry {
1492 uint8_t table_id;
1493 pad(3);
1494 uint32_t active_count;
1495 uint64_t lookup_count;
1496 uint64_t matched_count;
1497};
1498
1499/* Common header for all port stats properties. */
Rich Lane7f503ee2014-09-26 14:18:58 -07001500struct of_port_stats_prop {
1501 uint16_t type == ?; /* One of OFPPSPT_*. */
alshabib9f50e482014-08-23 17:10:57 -05001502 uint16_t length; /* Length in bytes of this property. */
1503};
1504
1505/* Ethernet port stats property. */
Rich Lane7f503ee2014-09-26 14:18:58 -07001506struct of_port_stats_prop_ethernet : of_port_stats_prop {
1507 uint16_t type == 0; /* OFPPSPT_ETHERNET. */
alshabib9f50e482014-08-23 17:10:57 -05001508 uint16_t length; /* Length in bytes of this property. */
1509 pad(4);
1510
1511 uint64_t rx_frame_err; /* Number of frame alignment errors. */
1512 uint64_t rx_over_err; /* Number of packets with RX overrun. */
1513 uint64_t rx_crc_err; /* Number of CRC errors. */
1514 uint64_t collisions; /* Number of collisions. */
1515};
1516
1517/* Optical port stats property. */
Rich Lane7f503ee2014-09-26 14:18:58 -07001518struct of_port_stats_prop_optical : of_port_stats_prop {
1519 uint16_t type == 1;
alshabib9f50e482014-08-23 17:10:57 -05001520 uint16_t length;
1521 pad(4);
1522
1523 uint32_t flags;
1524 uint32_t tx_freq_lmda;
1525 uint32_t tx_offset;
1526 uint32_t tx_grid_span;
1527 uint32_t rx_freq_lmda;
1528 uint32_t rx_offset;
1529 uint32_t rx_grid_span;
1530 uint16_t tx_pwr;
1531 uint16_t rx_pwr;
1532 uint16_t bias_current;
1533 uint16_t temperature;
1534};
1535
1536/* Experimenter port stats property. */
Rich Lane7f503ee2014-09-26 14:18:58 -07001537struct of_port_stats_prop_experimenter : of_port_stats_prop {
1538 uint16_t type == 0xffff;
alshabib9f50e482014-08-23 17:10:57 -05001539 uint16_t length;
Rich Lane7f503ee2014-09-26 14:18:58 -07001540 uint32_t experimenter == ?;
alshabib9f50e482014-08-23 17:10:57 -05001541 uint32_t exp_type;
Rich Lane7f503ee2014-09-26 14:18:58 -07001542 of_octets_t experimenter_data;
alshabib9f50e482014-08-23 17:10:57 -05001543};
1544
1545struct of_port_stats_entry {
1546 uint16_t length;
1547 pad(2);
1548 of_port_no_t port_no;
Rich Lane90651c42014-10-10 16:19:30 -07001549 uint32_t duration_sec;
1550 uint32_t duration_nsec;
alshabib9f50e482014-08-23 17:10:57 -05001551 uint64_t rx_packets;
1552 uint64_t tx_packets;
1553 uint64_t rx_bytes;
1554 uint64_t tx_bytes;
1555 uint64_t rx_dropped;
1556 uint64_t tx_dropped;
1557 uint64_t rx_errors;
1558 uint64_t tx_errors;
Rich Lane7f503ee2014-09-26 14:18:58 -07001559 list(of_port_stats_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -05001560};
1561
Rich Lane7f503ee2014-09-26 14:18:58 -07001562struct of_queue_stats_prop {
1563 uint16_t type == ?;
alshabib9f50e482014-08-23 17:10:57 -05001564 uint16_t length;
1565};
1566
1567struct of_queue_stats_entry {
1568 uint16_t length;
1569 pad(6);
1570 of_port_no_t port_no;
1571 uint32_t queue_id;
1572 uint64_t tx_bytes;
1573 uint64_t tx_packets;
1574 uint64_t tx_errors;
1575 uint32_t duration_sec;
1576 uint32_t duration_nsec;
1577
1578
Rich Lane7f503ee2014-09-26 14:18:58 -07001579 list(of_queue_stats_prop_t) properties;
alshabib9f50e482014-08-23 17:10:57 -05001580};
1581
1582struct of_bucket_counter {
1583 uint64_t packet_count;
1584 uint64_t byte_count;
1585};
1586
1587struct of_group_stats_entry {
1588 uint16_t length;
1589 pad(2);
1590 uint32_t group_id;
1591 uint32_t ref_count;
1592 pad(4);
1593 uint64_t packet_count;
1594 uint64_t byte_count;
1595 uint32_t duration_sec;
1596 uint32_t duration_nsec;
1597 list(of_bucket_counter_t) bucket_stats;
1598};
1599
1600struct of_group_desc_stats_entry {
1601 uint16_t length;
1602 enum ofp_group_type group_type;
1603 pad(1);
1604 uint32_t group_id;
1605 list(of_bucket_t) buckets;
1606};
1607
1608// STATS:
1609// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1610
1611struct of_stats_request : of_header {
1612 uint8_t version;
1613 uint8_t type == 18;
1614 uint16_t length;
1615 uint32_t xid;
1616 uint16_t stats_type == ?;
1617 enum ofp_stats_request_flags flags;
1618 pad(4);
1619};
1620
1621struct of_stats_reply : of_header {
1622 uint8_t version;
1623 uint8_t type == 19;
1624 uint16_t length;
1625 uint32_t xid;
1626 uint16_t stats_type == ?;
1627 enum ofp_stats_reply_flags flags;
1628 pad(4);
1629};
1630
1631struct of_desc_stats_request : of_stats_request {
1632 uint8_t version;
1633 uint8_t type == 18;
1634 uint16_t length;
1635 uint32_t xid;
1636 uint16_t stats_type == 0;
1637 enum ofp_stats_request_flags flags;
1638 pad(4);
1639};
1640
1641struct of_desc_stats_reply : of_stats_reply {
1642 uint8_t version;
1643 uint8_t type == 19;
1644 uint16_t length;
1645 uint32_t xid;
1646 uint16_t stats_type == 0;
1647 enum ofp_stats_reply_flags flags;
1648 pad(4);
1649 of_desc_str_t mfr_desc;
1650 of_desc_str_t hw_desc;
1651 of_desc_str_t sw_desc;
1652 of_serial_num_t serial_num;
1653 of_desc_str_t dp_desc;
1654};
1655
1656struct of_flow_stats_request : of_stats_request {
1657 uint8_t version;
1658 uint8_t type == 18;
1659 uint16_t length;
1660 uint32_t xid;
1661 uint16_t stats_type == 1;
1662 enum ofp_stats_request_flags flags;
1663 pad(4);
1664 uint8_t table_id;
1665 pad(3);
1666 of_port_no_t out_port;
1667 uint32_t out_group;
1668 pad(4);
1669 uint64_t cookie;
1670 uint64_t cookie_mask;
1671 of_match_t match;
1672};
1673
1674struct of_flow_stats_reply : of_stats_reply {
1675 uint8_t version;
1676 uint8_t type == 19;
1677 uint16_t length;
1678 uint32_t xid;
1679 uint16_t stats_type == 1;
1680 enum ofp_stats_reply_flags flags;
1681 pad(4);
1682 list(of_flow_stats_entry_t) entries;
1683};
1684
1685struct of_aggregate_stats_request : of_stats_request {
1686 uint8_t version;
1687 uint8_t type == 18;
1688 uint16_t length;
1689 uint32_t xid;
1690 uint16_t stats_type == 2;
1691 enum ofp_stats_request_flags flags;
1692 pad(4);
1693 uint8_t table_id;
1694 pad(3);
1695 of_port_no_t out_port;
1696 uint32_t out_group;
1697 pad(4);
1698 uint64_t cookie;
1699 uint64_t cookie_mask;
1700 of_match_t match;
1701};
1702
1703struct of_aggregate_stats_reply : of_stats_reply {
1704 uint8_t version;
1705 uint8_t type == 19;
1706 uint16_t length;
1707 uint32_t xid;
1708 uint16_t stats_type == 2;
1709 enum ofp_stats_reply_flags flags;
1710 pad(4);
1711 uint64_t packet_count;
1712 uint64_t byte_count;
1713 uint32_t flow_count;
1714 pad(4);
1715};
1716
1717struct of_table_stats_request : of_stats_request {
1718 uint8_t version;
1719 uint8_t type == 18;
1720 uint16_t length;
1721 uint32_t xid;
1722 uint16_t stats_type == 3;
1723 enum ofp_stats_request_flags flags;
1724 pad(4);
1725};
1726
1727struct of_table_stats_reply : of_stats_reply {
1728 uint8_t version;
1729 uint8_t type == 19;
1730 uint16_t length;
1731 uint32_t xid;
1732 uint16_t stats_type == 3;
1733 enum ofp_stats_reply_flags flags;
1734 pad(4);
1735 list(of_table_stats_entry_t) entries;
1736};
1737
1738struct of_experimenter_stats_request : of_stats_request {
1739 uint8_t version;
1740 uint8_t type == 18;
1741 uint16_t length;
1742 uint32_t xid;
1743 uint16_t stats_type == 0xffff;
1744 enum ofp_stats_request_flags flags;
1745 pad(4);
1746 uint32_t experimenter == ?;
1747 uint32_t subtype;
1748};
1749
1750struct of_experimenter_stats_reply : of_stats_reply {
1751 uint8_t version;
1752 uint8_t type == 19;
1753 uint16_t length;
1754 uint32_t xid;
1755 uint16_t stats_type == 0xffff;
1756 enum ofp_stats_reply_flags flags;
1757 pad(4);
1758 uint32_t experimenter == ?;
1759 uint32_t subtype;
1760};
1761
1762// FIXME: These are padded to 8 byte align beyond the length indicated
1763
1764struct of_table_feature_prop {
1765 uint16_t type == ?;
1766 uint16_t length;
1767};
1768
1769struct of_table_feature_prop_instructions : of_table_feature_prop {
1770 uint16_t type == 0;
1771 uint16_t length;
1772 // FIXME Check if instruction_t is right for ids here
1773 list(of_instruction_id_t) instruction_ids;
1774};
1775
1776struct of_table_feature_prop_instructions_miss : of_table_feature_prop {
1777 uint16_t type == 1;
1778 uint16_t length;
1779 list(of_instruction_id_t) instruction_ids;
1780};
1781
1782struct of_table_feature_prop_next_tables : of_table_feature_prop {
1783 uint16_t type == 2;
1784 uint16_t length;
1785 list(of_uint8_t) next_table_ids;
1786};
1787
1788struct of_table_feature_prop_next_tables_miss : of_table_feature_prop {
1789 uint16_t type == 3;
1790 uint16_t length;
1791 list(of_uint8_t) next_table_ids;
1792};
1793
1794struct of_table_feature_prop_write_actions : of_table_feature_prop {
1795 uint16_t type == 4;
1796 uint16_t length;
1797 list(of_action_id_t) action_ids;
1798};
1799
1800struct of_table_feature_prop_write_actions_miss : of_table_feature_prop {
1801 uint16_t type == 5;
1802 uint16_t length;
1803 list(of_action_id_t) action_ids;
1804};
1805
1806struct of_table_feature_prop_apply_actions : of_table_feature_prop {
1807 uint16_t type == 6;
1808 uint16_t length;
1809 list(of_action_id_t) action_ids;
1810};
1811
1812struct of_table_feature_prop_apply_actions_miss : of_table_feature_prop {
1813 uint16_t type == 7;
1814 uint16_t length;
1815 list(of_action_id_t) action_ids;
1816};
1817
1818struct of_table_feature_prop_match : of_table_feature_prop {
1819 uint16_t type == 8;
1820 uint16_t length;
1821 list(of_uint32_t) oxm_ids;
1822};
1823
1824struct of_table_feature_prop_wildcards : of_table_feature_prop {
1825 uint16_t type == 10;
1826 uint16_t length;
1827 list(of_uint32_t) oxm_ids;
1828};
1829
1830struct of_table_feature_prop_write_setfield : of_table_feature_prop {
1831 uint16_t type == 12;
1832 uint16_t length;
1833 list(of_uint32_t) oxm_ids;
1834};
1835
1836struct of_table_feature_prop_write_setfield_miss : of_table_feature_prop {
1837 uint16_t type == 13;
1838 uint16_t length;
1839 list(of_uint32_t) oxm_ids;
1840};
1841
1842struct of_table_feature_prop_apply_setfield : of_table_feature_prop {
1843 uint16_t type == 14;
1844 uint16_t length;
1845 list(of_uint32_t) oxm_ids;
1846};
1847
1848struct of_table_feature_prop_apply_setfield_miss : of_table_feature_prop {
1849 uint16_t type == 15;
1850 uint16_t length;
1851 list(of_uint32_t) oxm_ids;
1852};
1853
1854struct of_table_feature_prop_experimenter : of_table_feature_prop {
1855 uint16_t type == 65534;
1856 uint16_t length;
Rich Lane7f503ee2014-09-26 14:18:58 -07001857 uint32_t experimenter == ?;
alshabib9f50e482014-08-23 17:10:57 -05001858 uint32_t subtype;
1859 of_octets_t experimenter_data;
1860};
1861
1862struct of_table_feature_prop_experimenter_miss : of_table_feature_prop {
1863 uint16_t type == 65535;
1864 uint16_t length;
Rich Lane7f503ee2014-09-26 14:18:58 -07001865 uint32_t experimenter == ?;
alshabib9f50e482014-08-23 17:10:57 -05001866 uint32_t subtype;
1867 of_octets_t experimenter_data;
1868};
1869
1870struct of_table_features {
1871 uint16_t length;
1872 uint8_t table_id;
1873 pad(5);
1874 of_table_name_t name;
1875 uint64_t metadata_match;
1876 uint64_t metadata_write;
1877 uint32_t config;
1878 uint32_t max_entries;
1879 list(of_table_feature_prop_t) properties;
1880};
1881
1882struct of_meter_features {
1883 uint32_t max_meter;
1884 uint32_t band_types;
1885 uint32_t capabilities;
1886 uint8_t max_bands;
1887 uint8_t max_color;
1888 pad(2);
1889};
1890
1891struct of_port_stats_request : of_stats_request {
1892 uint8_t version;
1893 uint8_t type == 18;
1894 uint16_t length;
1895 uint32_t xid;
1896 uint16_t stats_type == 4;
1897 enum ofp_stats_request_flags flags;
1898 pad(4);
1899 of_port_no_t port_no;
1900 pad(4);
1901};
1902
1903struct of_port_stats_reply : of_stats_reply {
1904 uint8_t version;
1905 uint8_t type == 19;
1906 uint16_t length;
1907 uint32_t xid;
1908 uint16_t stats_type == 4;
1909 enum ofp_stats_reply_flags flags;
1910 pad(4);
1911 list(of_port_stats_entry_t) entries;
1912};
1913
1914struct of_queue_stats_request : of_stats_request {
1915 uint8_t version;
1916 uint8_t type == 18;
1917 uint16_t length;
1918 uint32_t xid;
1919 uint16_t stats_type == 5;
1920 enum ofp_stats_request_flags flags;
1921 pad(4);
1922 of_port_no_t port_no;
1923 uint32_t queue_id;
1924};
1925
1926struct of_queue_stats_reply : of_stats_reply {
1927 uint8_t version;
1928 uint8_t type == 19;
1929 uint16_t length;
1930 uint32_t xid;
1931 uint16_t stats_type == 5;
1932 enum ofp_stats_reply_flags flags;
1933 pad(4);
1934 list(of_queue_stats_entry_t) entries;
1935};
1936
1937struct of_group_stats_request : of_stats_request {
1938 uint8_t version;
1939 uint8_t type == 18;
1940 uint16_t length;
1941 uint32_t xid;
1942 uint16_t stats_type == 6;
1943 enum ofp_stats_request_flags flags;
1944 pad(4);
1945 uint32_t group_id;
1946 pad(4);
1947};
1948
1949struct of_group_stats_reply : of_stats_reply {
1950 uint8_t version;
1951 uint8_t type == 19;
1952 uint16_t length;
1953 uint32_t xid;
1954 uint16_t stats_type == 6;
1955 enum ofp_stats_reply_flags flags;
1956 pad(4);
1957 list(of_group_stats_entry_t) entries;
1958};
1959
1960struct of_group_desc_stats_request : of_stats_request {
1961 uint8_t version;
1962 uint8_t type == 18;
1963 uint16_t length;
1964 uint32_t xid;
1965 uint16_t stats_type == 7;
1966 enum ofp_stats_request_flags flags;
1967 pad(4);
1968};
1969
1970struct of_group_desc_stats_reply : of_stats_reply {
1971 uint8_t version;
1972 uint8_t type == 19;
1973 uint16_t length;
1974 uint32_t xid;
1975 uint16_t stats_type == 7;
1976 enum ofp_stats_reply_flags flags;
1977 pad(4);
1978 list(of_group_desc_stats_entry_t) entries;
1979};
1980
1981struct of_group_features_stats_request : of_stats_request {
1982 uint8_t version;
1983 uint8_t type == 18;
1984 uint16_t length;
1985 uint32_t xid;
1986 uint16_t stats_type == 8;
1987 enum ofp_stats_request_flags flags;
1988 pad(4);
1989};
1990
1991struct of_group_features_stats_reply : of_stats_reply {
1992 uint8_t version;
1993 uint8_t type == 19;
1994 uint16_t length;
1995 uint32_t xid;
1996 uint16_t stats_type == 8;
1997 enum ofp_stats_reply_flags flags;
1998 pad(4);
1999 uint32_t types;
2000 uint32_t capabilities;
2001 uint32_t max_groups_all;
2002 uint32_t max_groups_select;
2003 uint32_t max_groups_indirect;
2004 uint32_t max_groups_ff;
2005 uint32_t actions_all;
2006 uint32_t actions_select;
2007 uint32_t actions_indirect;
2008 uint32_t actions_ff;
2009};
2010
2011struct of_meter_stats_request : of_stats_request {
2012 uint8_t version;
2013 uint8_t type == 18;
2014 uint16_t length;
2015 uint32_t xid;
2016 uint16_t stats_type == 9;
2017 enum ofp_stats_request_flags flags;
2018 pad(4);
2019 uint32_t meter_id;
2020 pad(4);
2021};
2022
2023struct of_meter_stats_reply : of_stats_reply {
2024 uint8_t version;
2025 uint8_t type == 19;
2026 uint16_t length;
2027 uint32_t xid;
2028 uint16_t stats_type == 9;
2029 enum ofp_stats_reply_flags flags;
2030 pad(4);
2031 list(of_meter_stats_t) entries;
2032};
2033
2034struct of_meter_config_stats_request : of_stats_request {
2035 uint8_t version;
2036 uint8_t type == 18;
2037 uint16_t length;
2038 uint32_t xid;
2039 uint16_t stats_type == 10;
2040 enum ofp_stats_request_flags flags;
2041 pad(4);
2042 uint32_t meter_id;
2043 pad(4);
2044};
2045
2046struct of_meter_config_stats_reply : of_stats_reply {
2047 uint8_t version;
2048 uint8_t type == 19;
2049 uint16_t length;
2050 uint32_t xid;
2051 uint16_t stats_type == 10;
2052 enum ofp_stats_reply_flags flags;
2053 pad(4);
2054 list(of_meter_band_t) entries;
2055};
2056
2057// FIXME stats added to get things working
2058struct of_meter_features_stats_request : of_stats_request {
2059 uint8_t version;
2060 uint8_t type == 18;
2061 uint16_t length;
2062 uint32_t xid;
2063 uint16_t stats_type == 11;
2064 enum ofp_stats_request_flags flags;
2065 pad(4);
2066};
2067
2068// FIXME stats added to get things working
2069struct of_meter_features_stats_reply : of_stats_reply {
2070 uint8_t version;
2071 uint8_t type == 19;
2072 uint16_t length;
2073 uint32_t xid;
2074 uint16_t stats_type == 11;
2075 enum ofp_stats_reply_flags flags;
2076 pad(4);
2077 of_meter_features_t features;
2078};
2079
2080// FIXME stats added to get things working
2081struct of_table_features_stats_request : of_stats_request {
2082 uint8_t version;
2083 uint8_t type == 18;
2084 uint16_t length;
2085 uint32_t xid;
2086 uint16_t stats_type == 12;
2087 enum ofp_stats_request_flags flags;
2088 pad(4);
2089 list(of_table_features_t) entries;
2090};
2091
2092// FIXME stats added to get things working
2093struct of_table_features_stats_reply : of_stats_reply {
2094 uint8_t version;
2095 uint8_t type == 19;
2096 uint16_t length;
2097 uint32_t xid;
2098 uint16_t stats_type == 12;
2099 enum ofp_stats_reply_flags flags;
2100 pad(4);
2101 list(of_table_features_t) entries;
2102};
2103
2104// FIXME stats added to get things working
2105struct of_port_desc_stats_request : of_stats_request {
2106 uint8_t version;
2107 uint8_t type == 18;
2108 uint16_t length;
2109 uint32_t xid;
2110 uint16_t stats_type == 13;
2111 enum ofp_stats_request_flags flags;
2112 pad(4);
2113};
2114
2115// FIXME stats added to get things working
2116struct of_port_desc_stats_reply : of_stats_reply {
2117 uint8_t version;
2118 uint8_t type == 19;
2119 uint16_t length;
2120 uint32_t xid;
2121 uint16_t stats_type == 13;
2122 enum ofp_stats_reply_flags flags;
2123 pad(4);
2124 list(of_port_desc_t) entries;
2125};
2126
2127struct of_meter_band_stats {
2128 uint64_t packet_band_count;
2129 uint64_t byte_band_count;
2130};
2131
2132struct of_meter_stats {
2133 uint32_t meter_id;
2134 uint16_t len;
2135 pad(6);
2136 uint32_t flow_count;
2137 uint64_t packet_in_count;
2138 uint64_t byte_in_count;
2139 uint32_t duration_sec;
2140 uint32_t duration_nsec;
2141 list(of_meter_band_stats_t) band_stats;
2142};
2143
2144struct of_meter_config {
2145 uint16_t length;
2146 uint16_t flags;
2147 uint32_t meter_id;
2148 list(of_meter_band_t) entries;
2149};
2150
2151// END OF STATS OBJECTS
2152
2153struct of_queue_prop {
2154 uint16_t type == ?;
2155 uint16_t len;
2156 pad(4);
2157};
2158
2159struct of_queue_prop_min_rate : of_queue_prop {
2160 uint16_t type == 1;
2161 uint16_t len;
2162 pad(4);
2163 uint16_t rate;
2164 pad(6);
2165};
2166
2167struct of_queue_prop_max_rate : of_queue_prop {
2168 uint16_t type == 2;
2169 uint16_t len;
2170 pad(4);
2171 uint16_t rate;
2172 pad(6);
2173};
2174
2175struct of_queue_prop_experimenter : of_queue_prop {
2176 uint16_t type == 65535;
2177 uint16_t len;
2178 pad(4);
2179 uint32_t experimenter == ?;
2180 pad(4);
2181 of_octets_t data;
2182};
2183
2184struct of_packet_queue {
2185 uint32_t queue_id;
2186 of_port_no_t port;
2187 uint16_t len;
2188 pad(6);
2189 list(of_queue_prop_t) properties;
2190};
2191
alshabib9f50e482014-08-23 17:10:57 -05002192struct of_role_request : of_header {
2193 uint8_t version;
2194 uint8_t type == 24;
2195 uint16_t length;
2196 uint32_t xid;
2197 enum ofp_controller_role role;
2198 pad(4);
2199 uint64_t generation_id;
2200};
2201
2202struct of_role_reply : of_header {
2203 uint8_t version;
2204 uint8_t type == 25;
2205 uint16_t length;
2206 uint32_t xid;
2207 enum ofp_controller_role role;
2208 pad(4);
2209 uint64_t generation_id;
2210};
2211
2212////////////////////////////////////////////////////////////////
2213// FIXME understand async; where do bitmasks live?
2214// Determine bitmap type for masks below.
2215// DOCUMENT masks where uint32_t[0] is interest for equal/master
2216// while uint32_t[1] is interest for slave
2217////////////////////////////////////////////////////////////////
2218
2219struct of_async_get_request : of_header {
2220 uint8_t version;
2221 uint8_t type == 26;
2222 uint16_t length;
2223 uint32_t xid;
2224 uint32_t packet_in_mask_equal_master;
2225 uint32_t packet_in_mask_slave;
2226 uint32_t port_status_mask_equal_master;
2227 uint32_t port_status_mask_slave;
2228 uint32_t flow_removed_mask_equal_master;
2229 uint32_t flow_removed_mask_slave;
2230};
2231
2232struct of_async_get_reply : of_header {
2233 uint8_t version;
2234 uint8_t type == 27;
2235 uint16_t length;
2236 uint32_t xid;
2237 uint32_t packet_in_mask_equal_master;
2238 uint32_t packet_in_mask_slave;
2239 uint32_t port_status_mask_equal_master;
2240 uint32_t port_status_mask_slave;
2241 uint32_t flow_removed_mask_equal_master;
2242 uint32_t flow_removed_mask_slave;
2243};
2244
2245struct of_async_set : of_header {
2246 uint8_t version;
2247 uint8_t type == 28;
2248 uint16_t length;
2249 uint32_t xid;
2250 uint32_t packet_in_mask_equal_master;
2251 uint32_t packet_in_mask_slave;
2252 uint32_t port_status_mask_equal_master;
2253 uint32_t port_status_mask_slave;
2254 uint32_t flow_removed_mask_equal_master;
2255 uint32_t flow_removed_mask_slave;
2256};