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