blob: bf7503b7a7fd05f6be69ae054974ddba845a261f [file] [log] [blame]
Rich Lanea06d0c32013-03-25 08:52:03 -07001// Copyright 2013, Big Switch Networks, Inc.
2//
3// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
4// the following special exception:
5//
6// LOXI Exception
7//
8// As a special exception to the terms of the EPL, you may distribute libraries
9// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
10// that copyright and licensing notices generated by LoxiGen are not altered or removed
11// from the LoxiGen Libraries and the notice provided below is (i) included in
12// the LoxiGen Libraries, if distributed in source code form and (ii) included in any
13// documentation for the LoxiGen Libraries, if distributed in binary form.
14//
15// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
16//
17// You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
18// a copy of the EPL at:
19//
20// http://www.eclipse.org/legal/epl-v10.html
21//
22// Unless required by applicable law or agreed to in writing, software
23// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
24// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
25// EPL for the specific language governing permissions and limitations
26// under the EPL.
Rich Lane5d33a622013-04-08 17:33:11 -070027//
28// Also derived from the OpenFlow header files which have these copyrights:
29// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
30// Copyright (c) 2011, 2012 Open Networking Foundation
Rich Lanea06d0c32013-03-25 08:52:03 -070031
32#version 4
33
Rich Lane5d33a622013-04-08 17:33:11 -070034enum macro_definitions {
35 OFP_MAX_TABLE_NAME_LEN = 32,
36 OFP_MAX_PORT_NAME_LEN = 16,
37
38 OFP_TCP_PORT = 6633,
39 OFP_SSL_PORT = 6633,
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_no {
62 OFPP_ANY = 0xffffffff,
63};
64
65enum ofp_port {
66 OFPP_MAX = 0xffffff00,
67 OFPP_IN_PORT = 0xfffffff8,
68 OFPP_TABLE = 0xfffffff9,
69 OFPP_NORMAL = 0xfffffffa,
70 OFPP_FLOOD = 0xfffffffb,
71 OFPP_ALL = 0xfffffffc,
72 OFPP_CONTROLLER = 0xfffffffd,
73 OFPP_LOCAL = 0xfffffffe,
74};
75
76enum ofp_type {
77 OFPT_HELLO = 0,
78 OFPT_ERROR = 1,
79 OFPT_ECHO_REQUEST = 2,
80 OFPT_ECHO_REPLY = 3,
81 OFPT_EXPERIMENTER = 4,
82 OFPT_FEATURES_REQUEST = 5,
83 OFPT_FEATURES_REPLY = 6,
84 OFPT_GET_CONFIG_REQUEST = 7,
85 OFPT_GET_CONFIG_REPLY = 8,
86 OFPT_SET_CONFIG = 9,
87 OFPT_PACKET_IN = 10,
88 OFPT_FLOW_REMOVED = 11,
89 OFPT_PORT_STATUS = 12,
90 OFPT_PACKET_OUT = 13,
91 OFPT_FLOW_MOD = 14,
92 OFPT_GROUP_MOD = 15,
93 OFPT_PORT_MOD = 16,
94 OFPT_TABLE_MOD = 17,
95 OFPT_MULTIPART_REQUEST = 18,
96 OFPT_MULTIPART_REPLY = 19,
97 OFPT_BARRIER_REQUEST = 20,
98 OFPT_BARRIER_REPLY = 21,
99 OFPT_QUEUE_GET_CONFIG_REQUEST = 22,
100 OFPT_QUEUE_GET_CONFIG_REPLY = 23,
101 OFPT_ROLE_REQUEST = 24,
102 OFPT_ROLE_REPLY = 25,
103 OFPT_GET_ASYNC_REQUEST = 26,
104 OFPT_GET_ASYNC_REPLY = 27,
105 OFPT_SET_ASYNC = 28,
106 OFPT_METER_MOD = 29,
107};
108
109enum ofp_config_flags {
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 {
117 OFPTC_DEPRECATED_MASK = 0x3,
118};
119
120enum ofp_table {
121 OFPTT_MAX = 0xfe,
122 OFPTT_ALL = 0xff,
123};
124
125enum ofp_capabilities {
126 OFPC_FLOW_STATS = 0x1,
127 OFPC_TABLE_STATS = 0x2,
128 OFPC_PORT_STATS = 0x4,
129 OFPC_GROUP_STATS = 0x8,
130 OFPC_IP_REASM = 0x20,
131 OFPC_QUEUE_STATS = 0x40,
132 OFPC_PORT_BLOCKED = 0x100,
133};
134
135enum ofp_port_config {
136 OFPPC_PORT_DOWN = 0x1,
137 OFPPC_NO_RECV = 0x4,
138 OFPPC_NO_FWD = 0x20,
139 OFPPC_NO_PACKET_IN = 0x40,
140};
141
142enum ofp_port_state {
143 OFPPS_LINK_DOWN = 0x1,
144 OFPPS_BLOCKED = 0x2,
145 OFPPS_LIVE = 0x4,
146};
147
148enum ofp_port_features {
149 OFPPF_10MB_HD = 0x1,
150 OFPPF_10MB_FD = 0x2,
151 OFPPF_100MB_HD = 0x4,
152 OFPPF_100MB_FD = 0x8,
153 OFPPF_1GB_HD = 0x10,
154 OFPPF_1GB_FD = 0x20,
155 OFPPF_10GB_FD = 0x40,
156 OFPPF_40GB_FD = 0x80,
157 OFPPF_100GB_FD = 0x100,
158 OFPPF_1TB_FD = 0x200,
159 OFPPF_OTHER = 0x400,
160 OFPPF_COPPER = 0x800,
161 OFPPF_FIBER = 0x1000,
162 OFPPF_AUTONEG = 0x2000,
163 OFPPF_PAUSE = 0x4000,
164 OFPPF_PAUSE_ASYM = 0x8000,
165};
166
167enum ofp_port_reason {
168 OFPPR_ADD = 0,
169 OFPPR_DELETE = 1,
170 OFPPR_MODIFY = 2,
171};
172
173enum ofp_match_type {
174 OFPMT_STANDARD = 0,
175 OFPMT_OXM = 1,
176};
177
178enum ofp_oxm_class {
179 OFPXMC_NXM_0 = 0,
180 OFPXMC_NXM_1 = 1,
181 OFPXMC_OPENFLOW_BASIC = 0x8000,
182 OFPXMC_EXPERIMENTER = 0xffff,
183};
184
185enum ofp_vlan_id {
186 OFPVID_NONE = 0,
187 OFPVID_PRESENT = 0x1000,
188};
189
190enum ofp_ipv6exthdr_flags {
191 OFPIEH_NONEXT = 0x1,
192 OFPIEH_ESP = 0x2,
193 OFPIEH_AUTH = 0x4,
194 OFPIEH_DEST = 0x8,
195 OFPIEH_FRAG = 0x10,
196 OFPIEH_ROUTER = 0x20,
197 OFPIEH_HOP = 0x40,
198 OFPIEH_UNREP = 0x80,
199 OFPIEH_UNSEQ = 0x100,
200};
201
202enum ofp_action_type {
203 OFPAT_OUTPUT = 0,
204 OFPAT_COPY_TTL_OUT = 0xb,
205 OFPAT_COPY_TTL_IN = 0xc,
206 OFPAT_SET_MPLS_TTL = 0xf,
207 OFPAT_DEC_MPLS_TTL = 0x10,
208 OFPAT_PUSH_VLAN = 0x11,
209 OFPAT_POP_VLAN = 0x12,
210 OFPAT_PUSH_MPLS = 0x13,
211 OFPAT_POP_MPLS = 0x14,
212 OFPAT_SET_QUEUE = 0x15,
213 OFPAT_GROUP = 0x16,
214 OFPAT_SET_NW_TTL = 0x17,
215 OFPAT_DEC_NW_TTL = 0x18,
216 OFPAT_SET_FIELD = 0x19,
217 OFPAT_PUSH_PBB = 0x1a,
218 OFPAT_POP_PBB = 0x1b,
219 OFPAT_EXPERIMENTER = 0xffff,
220};
221
222enum ofp_controller_max_len {
223 OFPCML_MAX = 0xffe5,
224 OFPCML_NO_BUFFER = 0xffff,
225};
226
227enum ofp_instruction_type {
228 OFPIT_GOTO_TABLE = 0x1,
229 OFPIT_WRITE_METADATA = 0x2,
230 OFPIT_WRITE_ACTIONS = 0x3,
231 OFPIT_APPLY_ACTIONS = 0x4,
232 OFPIT_CLEAR_ACTIONS = 0x5,
233 OFPIT_METER = 0x6,
234 OFPIT_EXPERIMENTER = 0xffff,
235};
236
237enum ofp_flow_mod_command {
238 OFPFC_ADD = 0,
239 OFPFC_MODIFY = 1,
240 OFPFC_MODIFY_STRICT = 2,
241 OFPFC_DELETE = 3,
242 OFPFC_DELETE_STRICT = 4,
243};
244
245enum ofp_flow_mod_flags {
246 OFPFF_SEND_FLOW_REM = 0x1,
247 OFPFF_CHECK_OVERLAP = 0x2,
248 OFPFF_RESET_COUNTS = 0x4,
249 OFPFF_NO_PKT_COUNTS = 0x8,
250 OFPFF_NO_BYT_COUNTS = 0x10,
251};
252
253enum ofp_group {
254 OFPG_MAX = 0xffffff00,
255 OFPG_ALL = 0xfffffffc,
256 OFPG_ANY = 0xffffffff,
257};
258
259enum ofp_group_mod_command {
260 OFPGC_ADD = 0,
261 OFPGC_MODIFY = 1,
262 OFPGC_DELETE = 2,
263};
264
265enum ofp_group_type {
266 OFPGT_ALL = 0,
267 OFPGT_SELECT = 1,
268 OFPGT_INDIRECT = 2,
269 OFPGT_FF = 3,
270};
271
272enum ofp_packet_in_reason {
273 OFPR_NO_MATCH = 0,
274 OFPR_ACTION = 1,
275 OFPR_INVALID_TTL = 2,
276};
277
278enum ofp_flow_removed_reason {
279 OFPRR_IDLE_TIMEOUT = 0,
280 OFPRR_HARD_TIMEOUT = 1,
281 OFPRR_DELETE = 2,
282 OFPRR_GROUP_DELETE = 3,
283};
284
285enum ofp_meter {
286 OFPM_MAX = 0xffff0000,
287 OFPM_SLOWPATH = 0xfffffffd,
288 OFPM_CONTROLLER = 0xfffffffe,
289 OFPM_ALL = 0xffffffff,
290};
291
292enum ofp_meter_band_type {
293 OFPMBT_DROP = 0x1,
294 OFPMBT_DSCP_REMARK = 0x2,
295 OFPMBT_EXPERIMENTER = 0xffff,
296};
297
298enum ofp_meter_mod_command {
299 OFPMC_ADD = 0,
300 OFPMC_MODIFY = 1,
301 OFPMC_DELETE = 2,
302};
303
304enum ofp_meter_flags {
305 OFPMF_KBPS = 0x1,
306 OFPMF_PKTPS = 0x2,
307 OFPMF_BURST = 0x4,
308 OFPMF_STATS = 0x8,
309};
310
311enum ofp_error_type {
312 OFPET_HELLO_FAILED = 0,
313 OFPET_BAD_REQUEST = 1,
314 OFPET_BAD_ACTION = 2,
315 OFPET_BAD_INSTRUCTION = 3,
316 OFPET_BAD_MATCH = 4,
317 OFPET_FLOW_MOD_FAILED = 5,
318 OFPET_GROUP_MOD_FAILED = 6,
319 OFPET_PORT_MOD_FAILED = 7,
320 OFPET_TABLE_MOD_FAILED = 8,
321 OFPET_QUEUE_OP_FAILED = 9,
322 OFPET_SWITCH_CONFIG_FAILED = 10,
323 OFPET_ROLE_REQUEST_FAILED = 11,
324 OFPET_METER_MOD_FAILED = 12,
325 OFPET_TABLE_FEATURES_FAILED = 13,
326 OFPET_EXPERIMENTER = 0xffff,
327};
328
329enum ofp_hello_failed_code {
330 OFPHFC_INCOMPATIBLE = 0,
331 OFPHFC_EPERM = 1,
332};
333
334enum ofp_bad_request_code {
335 OFPBRC_BAD_VERSION = 0,
336 OFPBRC_BAD_TYPE = 1,
337 OFPBRC_BAD_MULTIPART = 2,
338 OFPBRC_BAD_EXPERIMENTER = 3,
339 OFPBRC_BAD_EXP_TYPE = 4,
340 OFPBRC_EPERM = 5,
341 OFPBRC_BAD_LEN = 6,
342 OFPBRC_BUFFER_EMPTY = 7,
343 OFPBRC_BUFFER_UNKNOWN = 8,
344 OFPBRC_BAD_TABLE_ID = 9,
345 OFPBRC_IS_SLAVE = 10,
346 OFPBRC_BAD_PORT = 11,
347 OFPBRC_BAD_PACKET = 12,
348 OFPBRC_MULTIPART_BUFFER_OVERFLOW = 13,
349};
350
351enum ofp_bad_action_code {
352 OFPBAC_BAD_TYPE = 0,
353 OFPBAC_BAD_LEN = 1,
354 OFPBAC_BAD_EXPERIMENTER = 2,
355 OFPBAC_BAD_EXP_TYPE = 3,
356 OFPBAC_BAD_OUT_PORT = 4,
357 OFPBAC_BAD_ARGUMENT = 5,
358 OFPBAC_EPERM = 6,
359 OFPBAC_TOO_MANY = 7,
360 OFPBAC_BAD_QUEUE = 8,
361 OFPBAC_BAD_OUT_GROUP = 9,
362 OFPBAC_MATCH_INCONSISTENT = 10,
363 OFPBAC_UNSUPPORTED_ORDER = 11,
364 OFPBAC_BAD_TAG = 12,
365 OFPBAC_BAD_SET_TYPE = 13,
366 OFPBAC_BAD_SET_LEN = 14,
367 OFPBAC_BAD_SET_ARGUMENT = 15,
368};
369
370enum ofp_bad_instruction_code {
371 OFPBIC_UNKNOWN_INST = 0,
372 OFPBIC_UNSUP_INST = 1,
373 OFPBIC_BAD_TABLE_ID = 2,
374 OFPBIC_UNSUP_METADATA = 3,
375 OFPBIC_UNSUP_METADATA_MASK = 4,
376 OFPBIC_BAD_EXPERIMENTER = 5,
377 OFPBIC_BAD_EXP_TYPE = 6,
378 OFPBIC_BAD_LEN = 7,
379 OFPBIC_EPERM = 8,
380};
381
382enum ofp_bad_match_code {
383 OFPBMC_BAD_TYPE = 0,
384 OFPBMC_BAD_LEN = 1,
385 OFPBMC_BAD_TAG = 2,
386 OFPBMC_BAD_DL_ADDR_MASK = 3,
387 OFPBMC_BAD_NW_ADDR_MASK = 4,
388 OFPBMC_BAD_WILDCARDS = 5,
389 OFPBMC_BAD_FIELD = 6,
390 OFPBMC_BAD_VALUE = 7,
391 OFPBMC_BAD_MASK = 8,
392 OFPBMC_BAD_PREREQ = 9,
393 OFPBMC_DUP_FIELD = 10,
394 OFPBMC_EPERM = 11,
395};
396
397enum ofp_flow_mod_failed_code {
398 OFPFMFC_UNKNOWN = 0,
399 OFPFMFC_TABLE_FULL = 1,
400 OFPFMFC_BAD_TABLE_ID = 2,
401 OFPFMFC_OVERLAP = 3,
402 OFPFMFC_EPERM = 4,
403 OFPFMFC_BAD_TIMEOUT = 5,
404 OFPFMFC_BAD_COMMAND = 6,
405 OFPFMFC_BAD_FLAGS = 7,
406};
407
408enum ofp_group_mod_failed_code {
409 OFPGMFC_GROUP_EXISTS = 0,
410 OFPGMFC_INVALID_GROUP = 1,
411 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
412 OFPGMFC_OUT_OF_GROUPS = 3,
413 OFPGMFC_OUT_OF_BUCKETS = 4,
414 OFPGMFC_CHAINING_UNSUPPORTED = 5,
415 OFPGMFC_WATCH_UNSUPPORTED = 6,
416 OFPGMFC_LOOP = 7,
417 OFPGMFC_UNKNOWN_GROUP = 8,
418 OFPGMFC_CHAINED_GROUP = 9,
419 OFPGMFC_BAD_TYPE = 10,
420 OFPGMFC_BAD_COMMAND = 11,
421 OFPGMFC_BAD_BUCKET = 12,
422 OFPGMFC_BAD_WATCH = 13,
423 OFPGMFC_EPERM = 14,
424};
425
426enum ofp_port_mod_failed_code {
427 OFPPMFC_BAD_PORT = 0,
428 OFPPMFC_BAD_HW_ADDR = 1,
429 OFPPMFC_BAD_CONFIG = 2,
430 OFPPMFC_BAD_ADVERTISE = 3,
431 OFPPMFC_EPERM = 4,
432};
433
434enum ofp_table_mod_failed_code {
435 OFPTMFC_BAD_TABLE = 0,
436 OFPTMFC_BAD_CONFIG = 1,
437 OFPTMFC_EPERM = 2,
438};
439
440enum ofp_queue_op_failed_code {
441 OFPQOFC_BAD_PORT = 0,
442 OFPQOFC_BAD_QUEUE = 1,
443 OFPQOFC_EPERM = 2,
444};
445
446enum ofp_switch_config_failed_code {
447 OFPSCFC_BAD_FLAGS = 0,
448 OFPSCFC_BAD_LEN = 1,
449 OFPSCFC_EPERM = 2,
450};
451
452enum ofp_role_request_failed_code {
453 OFPRRFC_STALE = 0,
454 OFPRRFC_UNSUP = 1,
455 OFPRRFC_BAD_ROLE = 2,
456};
457
458enum ofp_meter_mod_failed_code {
459 OFPMMFC_UNKNOWN = 0,
460 OFPMMFC_METER_EXISTS = 1,
461 OFPMMFC_INVALID_METER = 2,
462 OFPMMFC_UNKNOWN_METER = 3,
463 OFPMMFC_BAD_COMMAND = 4,
464 OFPMMFC_BAD_FLAGS = 5,
465 OFPMMFC_BAD_RATE = 6,
466 OFPMMFC_BAD_BURST = 7,
467 OFPMMFC_BAD_BAND = 8,
468 OFPMMFC_BAD_BAND_VALUE = 9,
469 OFPMMFC_OUT_OF_METERS = 10,
470 OFPMMFC_OUT_OF_BANDS = 11,
471};
472
473enum ofp_table_features_failed_code {
474 OFPTFFC_BAD_TABLE = 0,
475 OFPTFFC_BAD_METADATA = 1,
476 OFPTFFC_BAD_TYPE = 2,
477 OFPTFFC_BAD_LEN = 3,
478 OFPTFFC_BAD_ARGUMENT = 4,
479 OFPTFFC_EPERM = 5,
480};
481
482enum ofp_multipart_types {
483 OFPMP_DESC = 0,
484 OFPMP_FLOW = 1,
485 OFPMP_AGGREGATE = 2,
486 OFPMP_TABLE = 3,
487 OFPMP_PORT_STATS = 4,
488 OFPMP_QUEUE = 5,
489 OFPMP_GROUP = 6,
490 OFPMP_GROUP_DESC = 7,
491 OFPMP_GROUP_FEATURES = 8,
492 OFPMP_METER = 9,
493 OFPMP_METER_CONFIG = 10,
494 OFPMP_METER_FEATURES = 11,
495 OFPMP_TABLE_FEATURES = 12,
496 OFPMP_PORT_DESC = 13,
497 OFPMP_EXPERIMENTER = 0xffff,
498};
499
500enum ofp_multipart_request_flags {
501 OFPMPF_REQ_MORE = 0x1,
502};
503
504enum ofp_multipart_reply_flags {
505 OFPMPF_REPLY_MORE = 0x1,
506};
507
508enum ofp_table_feature_prop_type {
509 OFPTFPT_INSTRUCTIONS = 0,
510 OFPTFPT_INSTRUCTIONS_MISS = 1,
511 OFPTFPT_NEXT_TABLES = 2,
512 OFPTFPT_NEXT_TABLES_MISS = 3,
513 OFPTFPT_WRITE_ACTIONS = 4,
514 OFPTFPT_WRITE_ACTIONS_MISS = 5,
515 OFPTFPT_APPLY_ACTIONS = 6,
516 OFPTFPT_APPLY_ACTIONS_MISS = 7,
517 OFPTFPT_MATCH = 8,
518 OFPTFPT_WILDCARDS = 0xa,
519 OFPTFPT_WRITE_SETFIELD = 0xc,
520 OFPTFPT_WRITE_SETFIELD_MISS = 0xd,
521 OFPTFPT_APPLY_SETFIELD = 0xe,
522 OFPTFPT_APPLY_SETFIELD_MISS = 0xf,
523 OFPTFPT_EXPERIMENTER = 0xfffe,
524 OFPTFPT_EXPERIMENTER_MISS = 0xffff,
525};
526
527enum ofp_group_capabilities {
528 OFPGFC_SELECT_WEIGHT = 0x1,
529 OFPGFC_SELECT_LIVENESS = 0x2,
530 OFPGFC_CHAINING = 0x4,
531 OFPGFC_CHAINING_CHECKS = 0x8,
532};
533
534enum ofp_queue_properties {
535 OFPQT_MIN_RATE = 0x1,
536 OFPQT_MAX_RATE = 0x2,
537 OFPQT_EXPERIMENTER = 0xffff,
538};
539
540enum ofp_controller_role {
541 OFPCR_ROLE_NOCHANGE = 0,
542 OFPCR_ROLE_EQUAL = 1,
543 OFPCR_ROLE_MASTER = 2,
544 OFPCR_ROLE_SLAVE = 3,
545};
546
Rich Lanea06d0c32013-03-25 08:52:03 -0700547struct ofp_header {
548 uint8_t version;
549 uint8_t type;
550 uint16_t length;
551 uint32_t xid;
552};
553
554// Special structures used for managing scalar list elements
555struct ofp_uint32 {
556 uint32_t value;
557};
558
559// Special structures used for managing scalar list elements
560struct ofp_uint8 {
561 uint8_t value;
562};
563
564struct ofp_hello_elem {
565 uint16_t type;
566 uint16_t length;
567};
568
569struct ofp_hello_elem_versionbitmap {
570 uint16_t type;
571 uint16_t length;
572 list(of_uint32_t) bitmaps;
573};
574
575struct ofp_hello {
576 uint8_t version;
577 uint8_t type;
578 uint16_t length;
579 uint32_t xid;
580 list(of_hello_elem_t) elements;
581};
582
583struct ofp_echo_request {
584 uint8_t version;
585 uint8_t type;
586 uint16_t length;
587 uint32_t xid;
588 of_octets_t data;
589};
590
591struct ofp_echo_reply {
592 uint8_t version;
593 uint8_t type;
594 uint16_t length;
595 uint32_t xid;
596 of_octets_t data;
597};
598
599struct ofp_experimenter {
600 uint8_t version;
601 uint8_t type;
602 uint16_t length;
603 uint32_t xid;
604 uint32_t experimenter;
605 uint32_t subtype;
606 of_octets_t data;
607};
608
609struct ofp_barrier_request {
610 uint8_t version;
611 uint8_t type;
612 uint16_t length;
613 uint32_t xid;
614};
615
616struct ofp_barrier_reply {
617 uint8_t version;
618 uint8_t type;
619 uint16_t length;
620 uint32_t xid;
621};
622
623struct ofp_get_config_request {
624 uint8_t version;
625 uint8_t type;
626 uint16_t length;
627 uint32_t xid;
628};
629
630struct ofp_get_config_reply {
631 uint8_t version;
632 uint8_t type;
633 uint16_t length;
634 uint32_t xid;
635 uint16_t flags;
636 uint16_t miss_send_len;
637};
638
639struct ofp_set_config {
640 uint8_t version;
641 uint8_t type;
642 uint16_t length;
643 uint32_t xid;
644 uint16_t flags;
645 uint16_t miss_send_len;
646};
647
648struct ofp_table_mod {
649 uint8_t version;
650 uint8_t type;
651 uint16_t length;
652 uint32_t xid;
653 uint8_t table_id;
654 uint8_t[3] pad;
655 uint32_t config;
656};
657
658struct ofp_port_desc {
659 of_port_no_t port_no;
660 uint8_t[4] pad;
661 of_mac_addr_t hw_addr;
662 uint8_t[2] pad2;
663 of_port_name_t name;
664 uint32_t config;
665 uint32_t state;
666 uint32_t curr;
667 uint32_t advertised;
668 uint32_t supported;
669 uint32_t peer;
670 uint32_t curr_speed;
671 uint32_t max_speed;
672};
673
674struct ofp_features_request {
675 uint8_t version;
676 uint8_t type;
677 uint16_t length;
678 uint32_t xid;
679};
680
681struct ofp_features_reply {
682 uint8_t version;
683 uint8_t type;
684 uint16_t length;
685 uint32_t xid;
686 uint64_t datapath_id;
687 uint32_t n_buffers;
688 uint8_t n_tables;
689 uint8_t auxiliary_id;
690 uint8_t[2] pad;
691 uint32_t capabilities;
692 uint32_t reserved;
693};
694
695struct ofp_port_status {
696 uint8_t version;
697 uint8_t type;
698 uint16_t length;
699 uint32_t xid;
700 uint8_t reason;
701 uint8_t[7] pad;
702 of_port_desc_t desc;
703};
704
705struct ofp_port_mod {
706 uint8_t version;
707 uint8_t type;
708 uint16_t length;
709 uint32_t xid;
710 of_port_no_t port_no;
711 uint8_t[4] pad;
712 of_mac_addr_t hw_addr;
713 uint8_t[2] pad2;
714 uint32_t config;
715 uint32_t mask;
716 uint32_t advertise;
717 uint8_t[4] pad3;
718};
719
720// FIXME Does this need to be v4?
721struct ofp_match_v3 {
722 uint16_t type;
723 uint16_t length;
724 list(of_oxm_t) oxm_list;
725};
726
727struct ofp_oxm_experimenter_header {
728 uint32_t oxm_header;
729 uint32_t experimenter;
730 of_octets_t data;
731};
732
733// This looks like an action header, but is standalone. See
734// ofp_table_features_prop_actions
735struct ofp_action_id {
736 uint16_t type;
737 uint16_t len;
738 uint8_t[4] pad;
739};
740
741struct ofp_action_output {
742 uint16_t type;
743 uint16_t len;
744 of_port_no_t port;
745 uint16_t max_len;
746 uint8_t[6] pad;
747};
748
749struct ofp_action_copy_ttl_out {
750 uint16_t type;
751 uint16_t len;
752 uint8_t[4] pad;
753};
754
755struct ofp_action_copy_ttl_in {
756 uint16_t type;
757 uint16_t len;
758 uint8_t[4] pad;
759};
760
761struct ofp_action_set_mpls_ttl {
762 uint16_t type;
763 uint16_t len;
764 uint8_t mpls_ttl;
765 uint8_t[3] pad;
766};
767
768struct ofp_action_dec_mpls_ttl {
769 uint16_t type;
770 uint16_t len;
771 uint8_t[4] pad;
772};
773
774struct ofp_action_push_vlan {
775 uint16_t type;
776 uint16_t len;
777 uint16_t ethertype;
778 uint8_t[2] pad;
779};
780
781struct ofp_action_pop_vlan {
782 uint16_t type;
783 uint16_t len;
784 uint8_t[4] pad;
785};
786
787struct ofp_action_push_mpls {
788 uint16_t type;
789 uint16_t len;
790 uint16_t ethertype;
791 uint8_t[2] pad;
792};
793
794struct ofp_action_pop_mpls {
795 uint16_t type;
796 uint16_t len;
797 uint16_t ethertype;
798 uint8_t[2] pad;
799};
800
801struct ofp_action_set_queue {
802 uint16_t type;
803 uint16_t len;
804 uint32_t queue_id;
805};
806
807struct ofp_action_group {
808 uint16_t type;
809 uint16_t len;
810 uint32_t group_id;
811};
812
813struct ofp_action_set_nw_ttl {
814 uint16_t type;
815 uint16_t len;
816 uint8_t nw_ttl;
817 uint8_t[3] pad;
818};
819
820struct ofp_action_dec_nw_ttl {
821 uint16_t type;
822 uint16_t len;
823 uint8_t[4] pad;
824};
825
826struct ofp_action_set_field {
827 uint16_t type;
828 uint16_t len;
829 of_octets_t field;
830};
831
832struct ofp_action_experimenter {
833 uint16_t type;
834 uint16_t len;
835 uint32_t experimenter;
836 of_octets_t data;
837};
838
839struct ofp_action_pop_pbb {
840 uint16_t type;
841 uint16_t len;
842 uint8_t[4] pad;
843};
844
845struct ofp_action_push_pbb {
846 uint16_t type;
847 uint16_t len;
848 uint16_t ethertype;
849 uint8_t[2] pad;
850};
851
852struct ofp_action {
853 uint16_t type;
854 uint16_t len;
855 uint8_t[4] pad;
856};
857
858struct ofp_instruction {
859 uint16_t type;
860 uint16_t len;
861};
862
863struct ofp_instruction_goto_table {
864 uint16_t type;
865 uint16_t len;
866 uint8_t table_id;
867 uint8_t[3] pad;
868};
869
870struct ofp_instruction_write_metadata {
871 uint16_t type;
872 uint16_t len;
873 uint8_t[4] pad;
874 uint64_t metadata;
875 uint64_t metadata_mask;
876};
877
878struct ofp_instruction_write_actions {
879 uint16_t type;
880 uint16_t len;
881 uint8_t[4] pad;
882 list(of_action_t) actions;
883};
884
885struct ofp_instruction_apply_actions {
886 uint16_t type;
887 uint16_t len;
888 uint8_t[4] pad;
889 list(of_action_t) actions;
890};
891
892struct ofp_instruction_clear_actions {
893 uint16_t type;
894 uint16_t len;
895 uint8_t[4] pad;
896};
897
898struct ofp_instruction_meter {
899 uint16_t type;
900 uint16_t len;
901 uint32_t meter_id;
902};
903
904struct ofp_instruction_experimenter {
905 uint16_t type;
906 uint16_t len;
907 uint32_t experimenter;
908 of_octets_t data;
909};
910
911struct ofp_flow_add {
912 uint8_t version;
913 uint8_t type;
914 uint16_t length;
915 uint32_t xid;
916 uint64_t cookie;
917 uint64_t cookie_mask;
918 uint8_t table_id;
919 of_fm_cmd_t _command;
920 uint16_t idle_timeout;
921 uint16_t hard_timeout;
922 uint16_t priority;
923 uint32_t buffer_id;
924 of_port_no_t out_port;
925 uint32_t out_group;
926 uint16_t flags;
927 uint8_t[2] pad;
928 of_match_t match;
929 list(of_instruction_t) instructions;
930};
931
932struct ofp_flow_modify {
933 uint8_t version;
934 uint8_t type;
935 uint16_t length;
936 uint32_t xid;
937 uint64_t cookie;
938 uint64_t cookie_mask;
939 uint8_t table_id;
940 of_fm_cmd_t _command;
941 uint16_t idle_timeout;
942 uint16_t hard_timeout;
943 uint16_t priority;
944 uint32_t buffer_id;
945 of_port_no_t out_port;
946 uint32_t out_group;
947 uint16_t flags;
948 uint8_t[2] pad;
949 of_match_t match;
950 list(of_instruction_t) instructions;
951};
952
953struct ofp_flow_modify_strict {
954 uint8_t version;
955 uint8_t type;
956 uint16_t length;
957 uint32_t xid;
958 uint64_t cookie;
959 uint64_t cookie_mask;
960 uint8_t table_id;
961 of_fm_cmd_t _command;
962 uint16_t idle_timeout;
963 uint16_t hard_timeout;
964 uint16_t priority;
965 uint32_t buffer_id;
966 of_port_no_t out_port;
967 uint32_t out_group;
968 uint16_t flags;
969 uint8_t[2] pad;
970 of_match_t match;
971 list(of_instruction_t) instructions;
972};
973
974struct ofp_flow_delete {
975 uint8_t version;
976 uint8_t type;
977 uint16_t length;
978 uint32_t xid;
979 uint64_t cookie;
980 uint64_t cookie_mask;
981 uint8_t table_id;
982 of_fm_cmd_t _command;
983 uint16_t idle_timeout;
984 uint16_t hard_timeout;
985 uint16_t priority;
986 uint32_t buffer_id;
987 of_port_no_t out_port;
988 uint32_t out_group;
989 uint16_t flags;
990 uint8_t[2] pad;
991 of_match_t match;
992 list(of_instruction_t) instructions;
993};
994
995struct ofp_flow_delete_strict {
996 uint8_t version;
997 uint8_t type;
998 uint16_t length;
999 uint32_t xid;
1000 uint64_t cookie;
1001 uint64_t cookie_mask;
1002 uint8_t table_id;
1003 of_fm_cmd_t _command;
1004 uint16_t idle_timeout;
1005 uint16_t hard_timeout;
1006 uint16_t priority;
1007 uint32_t buffer_id;
1008 of_port_no_t out_port;
1009 uint32_t out_group;
1010 uint16_t flags;
1011 uint8_t[2] pad;
1012 of_match_t match;
1013 list(of_instruction_t) instructions;
1014};
1015
1016struct ofp_bucket {
1017 uint16_t len;
1018 uint16_t weight;
1019 of_port_no_t watch_port;
1020 uint32_t watch_group;
1021 uint8_t[4] pad;
1022 list(of_action_t) actions;
1023};
1024
1025struct ofp_group_mod {
1026 uint8_t version;
1027 uint8_t type;
1028 uint16_t length;
1029 uint32_t xid;
1030 uint16_t command;
1031 uint8_t group_type;
1032 uint8_t pad;
1033 uint32_t group_id;
1034 list(of_bucket_t) buckets;
1035};
1036
1037struct ofp_packet_out {
1038 uint8_t version;
1039 uint8_t type;
1040 uint16_t length;
1041 uint32_t xid;
1042 uint32_t buffer_id;
1043 of_port_no_t in_port;
1044 uint16_t actions_len;
1045 uint8_t[6] pad;
1046 list(of_action_t) actions;
1047 of_octets_t data;
1048};
1049
1050struct ofp_packet_in {
1051 uint8_t version;
1052 uint8_t type;
1053 uint16_t length;
1054 uint32_t xid;
1055 uint32_t buffer_id;
1056 uint16_t total_len;
1057 uint8_t reason;
1058 uint8_t table_id;
1059 uint64_t cookie;
1060 of_match_t match;
1061 uint8_t[2] pad;
1062 of_octets_t data; /* FIXME: Ensure total_len gets updated */
1063};
1064
1065struct ofp_flow_removed {
1066 uint8_t version;
1067 uint8_t type;
1068 uint16_t length;
1069 uint32_t xid;
1070 uint64_t cookie;
1071 uint16_t priority;
1072 uint8_t reason;
1073 uint8_t table_id;
1074 uint32_t duration_sec;
1075 uint32_t duration_nsec;
1076 uint16_t idle_timeout;
1077 uint16_t hard_timeout;
1078 uint64_t packet_count;
1079 uint64_t byte_count;
1080 of_match_t match;
1081};
1082
1083struct ofp_meter_band {
1084 uint16_t type;
1085 uint16_t len;
1086// uint32_t rate; // These are excluded b/c this is the header
1087// uint32_t burst_size; // These are excluded b/c this is the header
1088};
1089
1090struct ofp_meter_band_drop {
1091 uint16_t type;
1092 uint16_t len;
1093 uint32_t rate;
1094 uint32_t burst_size;
1095 uint8_t[4] pad;
1096};
1097
1098struct ofp_meter_band_dscp_remark {
1099 uint16_t type;
1100 uint16_t len;
1101 uint32_t rate;
1102 uint32_t burst_size;
1103 uint8_t prec_level;
1104 uint8_t[3] pad;
1105};
1106
1107struct ofp_meter_band_experimenter {
1108 uint16_t type;
1109 uint16_t len;
1110 uint32_t rate;
1111 uint32_t burst_size;
1112 uint32_t experimenter;
1113};
1114
1115struct ofp_meter_mod {
1116 uint8_t version;
1117 uint8_t type;
1118 uint16_t length;
1119 uint32_t xid;
1120 uint16_t command;
1121 uint16_t flags;
1122 uint32_t meter_id;
1123 list(of_meter_band_t) meters;
1124};
1125
1126struct ofp_error_msg {
1127 uint8_t version;
1128 uint8_t type;
1129 uint16_t length;
1130 uint32_t xid;
1131 uint16_t err_type;
1132 uint16_t code;
1133 of_octets_t data;
1134};
1135
1136//struct ofp_error_experimenter_msg {
1137// uint8_t version;
1138// uint8_t type;
1139// uint16_t length;
1140// uint32_t xid;
1141// uint16_t err_type;
1142// uint16_t subtype;
1143// uint32_t experimenter;
1144// of_octets_t data;
1145//};
1146
1147// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
1148
1149struct ofp_flow_stats_entry {
1150 uint16_t length;
1151 uint8_t table_id;
1152 uint8_t pad;
1153 uint32_t duration_sec;
1154 uint32_t duration_nsec;
1155 uint16_t priority;
1156 uint16_t idle_timeout;
1157 uint16_t hard_timeout;
1158 uint8_t[6] pad2;
1159 uint64_t cookie;
1160 uint64_t packet_count;
1161 uint64_t byte_count;
1162 of_match_t match;
1163 list(of_instruction_t) instructions;
1164};
1165
1166
1167struct ofp_table_stats_entry {
1168 uint8_t table_id;
1169 uint8_t[3] pad;
1170 uint32_t active_count;
1171 uint64_t lookup_count;
1172 uint64_t matched_count;
1173};
1174
1175struct ofp_port_stats_entry {
1176 of_port_no_t port_no;
1177 uint8_t[4] pad;
1178 uint64_t rx_packets;
1179 uint64_t tx_packets;
1180 uint64_t rx_bytes;
1181 uint64_t tx_bytes;
1182 uint64_t rx_dropped;
1183 uint64_t tx_dropped;
1184 uint64_t rx_errors;
1185 uint64_t tx_errors;
1186 uint64_t rx_frame_err;
1187 uint64_t rx_over_err;
1188 uint64_t rx_crc_err;
1189 uint64_t collisions;
1190 uint32_t duration_sec;
1191 uint32_t duration_nsec;
1192};
1193
1194struct ofp_queue_stats_entry {
1195 of_port_no_t port_no;
1196 uint32_t queue_id;
1197 uint64_t tx_bytes;
1198 uint64_t tx_packets;
1199 uint64_t tx_errors;
1200 uint32_t duration_sec;
1201 uint32_t duration_nsec;
1202};
1203
1204struct ofp_bucket_counter {
1205 uint64_t packet_count;
1206 uint64_t byte_count;
1207};
1208
1209struct ofp_group_stats_entry {
1210 uint16_t length;
1211 uint8_t[2] pad;
1212 uint32_t group_id;
1213 uint32_t ref_count;
1214 uint8_t[4] pad;
1215 uint64_t packet_count;
1216 uint64_t byte_count;
1217 uint32_t duration_sec;
1218 uint32_t duration_nsec;
1219 list(of_bucket_counter_t) bucket_stats;
1220};
1221
1222struct ofp_group_desc_stats_entry {
1223 uint16_t length;
1224 uint8_t type;
1225 uint8_t pad;
1226 uint32_t group_id;
1227 list(of_bucket_t) buckets;
1228};
1229
1230// STATS:
1231// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1232
1233struct ofp_desc_stats_request {
1234 uint8_t version;
1235 uint8_t type;
1236 uint16_t length;
1237 uint32_t xid;
1238 uint16_t stats_type;
1239 uint16_t flags;
1240 uint8_t[4] pad;
1241};
1242
1243struct ofp_desc_stats_reply {
1244 uint8_t version;
1245 uint8_t type;
1246 uint16_t length;
1247 uint32_t xid;
1248 uint16_t stats_type;
1249 uint16_t flags;
1250 uint8_t[4] pad;
1251 of_desc_str_t mfr_desc;
1252 of_desc_str_t hw_desc;
1253 of_desc_str_t sw_desc;
1254 of_serial_num_t serial_num;
1255 of_desc_str_t dp_desc;
1256};
1257
1258struct ofp_flow_stats_request {
1259 uint8_t version;
1260 uint8_t type;
1261 uint16_t length;
1262 uint32_t xid;
1263 uint16_t stats_type;
1264 uint16_t flags;
1265 uint8_t[4] pad;
1266 uint8_t table_id;
1267 uint8_t[3] pad;
1268 of_port_no_t out_port;
1269 uint32_t out_group;
1270 uint8_t[4] pad2;
1271 uint64_t cookie;
1272 uint64_t cookie_mask;
1273 of_match_t match;
1274};
1275
1276struct ofp_flow_stats_reply {
1277 uint8_t version;
1278 uint8_t type;
1279 uint16_t length;
1280 uint32_t xid;
1281 uint16_t stats_type;
1282 uint16_t flags;
1283 uint8_t[4] pad;
1284 list(of_flow_stats_entry_t) entries;
1285};
1286
1287struct ofp_aggregate_stats_request {
1288 uint8_t version;
1289 uint8_t type;
1290 uint16_t length;
1291 uint32_t xid;
1292 uint16_t stats_type;
1293 uint16_t flags;
1294 uint8_t[4] pad;
1295 uint8_t table_id;
1296 uint8_t[3] pad;
1297 of_port_no_t out_port;
1298 uint32_t out_group;
1299 uint8_t[4] pad2;
1300 uint64_t cookie;
1301 uint64_t cookie_mask;
1302 of_match_t match;
1303};
1304
1305struct ofp_aggregate_stats_reply {
1306 uint8_t version;
1307 uint8_t type;
1308 uint16_t length;
1309 uint32_t xid;
1310 uint16_t stats_type;
1311 uint16_t flags;
1312 uint8_t[4] pad;
1313 uint64_t packet_count;
1314 uint64_t byte_count;
1315 uint32_t flow_count;
1316 uint8_t[4] pad;
1317};
1318
1319// FIXME: These are padded to 8 byte align beyond the length indicated
1320
1321struct ofp_table_feature_prop {
1322 uint16_t type;
1323 uint16_t length;
1324};
1325
1326struct ofp_table_feature_prop_instructions {
1327 uint16_t type;
1328 uint16_t length;
1329 // FIXME Check if instruction_t is right for ids here
1330 list(of_instruction_t) instruction_ids;
1331};
1332
1333struct ofp_table_feature_prop_instructions_miss {
1334 uint16_t type;
1335 uint16_t length;
1336 list(of_instruction_t) instruction_ids;
1337};
1338
1339struct ofp_table_feature_prop_next_tables {
1340 uint16_t type;
1341 uint16_t length;
1342 list(of_uint8_t) next_table_ids;
1343};
1344
1345struct ofp_table_feature_prop_next_tables_miss {
1346 uint16_t type;
1347 uint16_t length;
1348 list(of_uint8_t) next_table_ids;
1349};
1350
1351struct ofp_table_feature_prop_write_actions {
1352 uint16_t type;
1353 uint16_t length;
1354 list(of_action_id_t) action_ids;
1355};
1356
1357struct ofp_table_feature_prop_write_actions_miss {
1358 uint16_t type;
1359 uint16_t length;
1360 list(of_action_id_t) action_ids;
1361};
1362
1363struct ofp_table_feature_prop_apply_actions {
1364 uint16_t type;
1365 uint16_t length;
1366 list(of_action_id_t) action_ids;
1367};
1368
1369struct ofp_table_feature_prop_apply_actions_miss {
1370 uint16_t type;
1371 uint16_t length;
1372 list(of_action_id_t) action_ids;
1373};
1374
1375struct ofp_table_feature_prop_match {
1376 uint16_t type;
1377 uint16_t length;
1378 list(of_uint32_t) oxm_ids;
1379};
1380
1381struct ofp_table_feature_prop_wildcards {
1382 uint16_t type;
1383 uint16_t length;
1384 list(of_uint32_t) oxm_ids;
1385};
1386
1387struct ofp_table_feature_prop_write_setfield {
1388 uint16_t type;
1389 uint16_t length;
1390 list(of_uint32_t) oxm_ids;
1391};
1392
1393struct ofp_table_feature_prop_write_setfield_miss {
1394 uint16_t type;
1395 uint16_t length;
1396 list(of_uint32_t) oxm_ids;
1397};
1398
1399struct ofp_table_feature_prop_apply_setfield {
1400 uint16_t type;
1401 uint16_t length;
1402 list(of_uint32_t) oxm_ids;
1403};
1404
1405struct ofp_table_feature_prop_apply_setfield_miss {
1406 uint16_t type;
1407 uint16_t length;
1408 list(of_uint32_t) oxm_ids;
1409};
1410
1411struct ofp_table_feature_prop_experimenter {
1412 uint16_t type;
1413 uint16_t length;
1414 uint32_t experimenter;
1415 uint32_t subtype;
1416 of_octets_t experimenter_data;
1417};
1418
1419// Not yet supported
1420// struct ofp_table_feature_prop_experimenter_miss {
1421// uint16_t type;
1422// uint16_t length;
1423// uint32_t experimenter;
1424// uint32_t subtype;
1425// of_octets_t experimenter_data;
1426// };
1427
1428struct ofp_table_features {
1429 uint16_t length;
1430 uint8_t table_id;
1431 uint8_t[5] pad;
1432 of_table_name_t name;
1433 uint64_t metadata_match;
1434 uint64_t metadata_write;
1435 uint32_t config;
1436 uint32_t max_entries;
1437 list(of_table_feature_prop_t) properties;
1438};
1439
1440struct ofp_meter_features {
1441 uint32_t max_meter;
1442 uint32_t band_types;
1443 uint32_t capabilities;
1444 uint8_t max_bands;
1445 uint8_t max_color;
1446 uint8_t[2] pad;
1447};
1448
1449struct ofp_port_stats_request {
1450 uint8_t version;
1451 uint8_t type;
1452 uint16_t length;
1453 uint32_t xid;
1454 uint16_t stats_type;
1455 uint16_t flags;
1456 uint8_t[4] pad;
1457 of_port_no_t port_no;
1458 uint8_t[4] pad;
1459};
1460
1461struct ofp_port_stats_reply {
1462 uint8_t version;
1463 uint8_t type;
1464 uint16_t length;
1465 uint32_t xid;
1466 uint16_t stats_type;
1467 uint16_t flags;
1468 uint8_t[4] pad;
1469 list(of_port_stats_entry_t) entries;
1470};
1471
1472struct ofp_queue_stats_request {
1473 uint8_t version;
1474 uint8_t type;
1475 uint16_t length;
1476 uint32_t xid;
1477 uint16_t stats_type;
1478 uint16_t flags;
1479 uint8_t[4] pad;
1480 of_port_no_t port_no;
1481 uint32_t queue_id;
1482};
1483
1484struct ofp_queue_stats_reply {
1485 uint8_t version;
1486 uint8_t type;
1487 uint16_t length;
1488 uint32_t xid;
1489 uint16_t stats_type;
1490 uint16_t flags;
1491 uint8_t[4] pad;
1492 list(of_queue_stats_entry_t) entries;
1493};
1494
1495struct ofp_group_stats_request {
1496 uint8_t version;
1497 uint8_t type;
1498 uint16_t length;
1499 uint32_t xid;
1500 uint16_t stats_type;
1501 uint16_t flags;
1502 uint8_t[4] pad;
1503 uint32_t group_id;
1504 uint8_t[4] pad;
1505};
1506
1507struct ofp_group_stats_reply {
1508 uint8_t version;
1509 uint8_t type;
1510 uint16_t length;
1511 uint32_t xid;
1512 uint16_t stats_type;
1513 uint16_t flags;
1514 uint8_t[4] pad;
1515 list(of_group_stats_entry_t) entries;
1516};
1517
1518struct ofp_group_desc_stats_request {
1519 uint8_t version;
1520 uint8_t type;
1521 uint16_t length;
1522 uint32_t xid;
1523 uint16_t stats_type;
1524 uint16_t flags;
1525 uint8_t[4] pad;
1526};
1527
1528struct ofp_group_desc_stats_reply {
1529 uint8_t version;
1530 uint8_t type;
1531 uint16_t length;
1532 uint32_t xid;
1533 uint16_t stats_type;
1534 uint16_t flags;
1535 uint8_t[4] pad;
1536 list(of_group_desc_stats_entry_t) entries;
1537};
1538
1539struct ofp_group_features_stats_request {
1540 uint8_t version;
1541 uint8_t type;
1542 uint16_t length;
1543 uint32_t xid;
1544 uint16_t stats_type;
1545 uint16_t flags;
1546 uint8_t[4] pad;
1547};
1548
1549struct ofp_group_features_stats_reply {
1550 uint8_t version;
1551 uint8_t type;
1552 uint16_t length;
1553 uint32_t xid;
1554 uint16_t stats_type;
1555 uint16_t flags;
1556 uint8_t[4] pad;
1557 uint32_t types;
1558 uint32_t capabilities;
1559 uint32_t max_groups_all;
1560 uint32_t max_groups_select;
1561 uint32_t max_groups_indirect;
1562 uint32_t max_groups_ff;
1563 uint32_t actions_all;
1564 uint32_t actions_select;
1565 uint32_t actions_indirect;
1566 uint32_t actions_ff;
1567};
1568
1569struct ofp_meter_stats_request {
1570 uint8_t version;
1571 uint8_t type;
1572 uint16_t length;
1573 uint32_t xid;
1574 uint16_t stats_type;
1575 uint16_t flags;
1576 uint8_t[4] pad;
1577 uint32_t meter_id;
1578 uint8_t[4] pad;
1579};
1580
1581struct ofp_meter_stats_reply {
1582 uint8_t version;
1583 uint8_t type;
1584 uint16_t length;
1585 uint32_t xid;
1586 uint16_t stats_type;
1587 uint16_t flags;
1588 uint8_t[4] pad;
1589 list(of_meter_stats_t) entries;
1590};
1591
1592struct ofp_meter_config_stats_request {
1593 uint8_t version;
1594 uint8_t type;
1595 uint16_t length;
1596 uint32_t xid;
1597 uint16_t stats_type;
1598 uint16_t flags;
1599 uint8_t[4] pad;
1600 uint32_t meter_id;
1601 uint8_t[4] pad;
1602};
1603
1604struct ofp_meter_config_stats_reply {
1605 uint8_t version;
1606 uint8_t type;
1607 uint16_t length;
1608 uint32_t xid;
1609 uint16_t stats_type;
1610 uint16_t flags;
1611 uint8_t[4] pad;
1612 list(of_meter_band_t) entries;
1613};
1614
1615// FIXME stats added to get things working
1616struct ofp_meter_features_stats_request {
1617 uint8_t version;
1618 uint8_t type;
1619 uint16_t length;
1620 uint32_t xid;
1621 uint16_t stats_type;
1622 uint16_t flags;
1623 uint8_t[4] pad;
1624};
1625
1626// FIXME stats added to get things working
1627struct ofp_meter_features_stats_reply {
1628 uint8_t version;
1629 uint8_t type;
1630 uint16_t length;
1631 uint32_t xid;
1632 uint16_t stats_type;
1633 uint16_t flags;
1634 uint8_t[4] pad;
1635 of_meter_features_t features;
1636};
1637
1638// FIXME stats added to get things working
1639struct ofp_table_features_stats_request {
1640 uint8_t version;
1641 uint8_t type;
1642 uint16_t length;
1643 uint32_t xid;
1644 uint16_t stats_type;
1645 uint16_t flags;
1646 uint8_t[4] pad;
1647 list(of_table_features_t) entries;
1648};
1649
1650// FIXME stats added to get things working
1651struct ofp_table_features_stats_reply {
1652 uint8_t version;
1653 uint8_t type;
1654 uint16_t length;
1655 uint32_t xid;
1656 uint16_t stats_type;
1657 uint16_t flags;
1658 uint8_t[4] pad;
1659 list(of_table_features_t) entries;
1660};
1661
1662// FIXME stats added to get things working
1663struct ofp_port_desc_stats_request {
1664 uint8_t version;
1665 uint8_t type;
1666 uint16_t length;
1667 uint32_t xid;
1668 uint16_t stats_type;
1669 uint16_t flags;
1670 uint8_t[4] pad;
1671};
1672
1673// FIXME stats added to get things working
1674struct ofp_port_desc_stats_reply {
1675 uint8_t version;
1676 uint8_t type;
1677 uint16_t length;
1678 uint32_t xid;
1679 uint16_t stats_type;
1680 uint16_t flags;
1681 uint8_t[4] pad;
1682 list(of_port_desc_t) entries;
1683};
1684
1685struct ofp_meter_band_stats {
1686 uint64_t packet_band_count;
1687 uint64_t byte_band_count;
1688};
1689
1690struct ofp_meter_stats {
1691 uint32_t meter_id;
1692 uint16_t len;
1693 uint8_t[6] pad;
1694 uint32_t flow_count;
1695 uint64_t packet_in_count;
1696 uint64_t byte_in_count;
1697 uint32_t duration_sec;
1698 uint32_t duration_nsec;
1699 list(of_meter_band_stats_t) band_stats;
1700};
1701
1702struct ofp_meter_config {
1703 uint16_t length;
1704 uint16_t flags;
1705 uint32_t meter_id;
1706 list(of_meter_band_t) entries;
1707};
1708
1709struct ofp_experimenter_multipart_header {
1710 uint32_t experimenter;
1711 uint32_t subtype;
1712};
1713
1714// END OF STATS OBJECTS
1715
1716struct ofp_queue_prop {
1717 uint16_t type;
1718 uint16_t len;
1719 uint8_t[4] pad;
1720};
1721
1722struct ofp_queue_prop_min_rate {
1723 uint16_t type;
1724 uint16_t len;
1725 uint8_t[4] pad;
1726 uint16_t rate;
1727 uint8_t[6] pad;
1728};
1729
1730struct ofp_queue_prop_max_rate {
1731 uint16_t type;
1732 uint16_t len;
1733 uint8_t[4] pad;
1734 uint16_t rate;
1735 uint8_t[6] pad;
1736};
1737
1738struct ofp_queue_prop_experimenter {
1739 uint16_t type;
1740 uint16_t len;
1741 uint8_t[4] pad;
1742 uint32_t experimenter;
1743 uint8_t[4] pad;
1744 of_octets_t data;
1745};
1746
1747struct ofp_packet_queue {
1748 uint32_t queue_id;
1749 of_port_no_t port;
1750 uint16_t len;
1751 uint8_t[6] pad;
1752 list(of_queue_prop_t) properties;
1753};
1754
1755struct ofp_queue_get_config_request {
1756 uint8_t version;
1757 uint8_t type;
1758 uint16_t length;
1759 uint32_t xid;
1760 of_port_no_t port;
1761 uint8_t[4] pad;
1762};
1763
1764struct ofp_queue_get_config_reply {
1765 uint8_t version;
1766 uint8_t type;
1767 uint16_t length;
1768 uint32_t xid;
1769 of_port_no_t port;
1770 uint8_t[4] pad;
1771 list(of_packet_queue_t) queues;
1772};
1773
1774struct ofp_role_request {
1775 uint8_t version;
1776 uint8_t type;
1777 uint16_t length;
1778 uint32_t xid;
1779 uint32_t role;
1780 uint8_t[4] pad;
1781 uint64_t generation_id;
1782};
1783
1784struct ofp_role_reply {
1785 uint8_t version;
1786 uint8_t type;
1787 uint16_t length;
1788 uint32_t xid;
1789 of_octets_t data;
1790};
1791
1792////////////////////////////////////////////////////////////////
1793// FIXME understand async; where do bitmasks live?
1794// Determine bitmap type for masks below.
1795// DOCUMENT masks where uint32_t[0] is interest for equal/master
1796// while uint32_t[1] is interest for slave
1797////////////////////////////////////////////////////////////////
1798
1799struct ofp_async_get_request {
1800 uint8_t version;
1801 uint8_t type;
1802 uint16_t length;
1803 uint32_t xid;
1804 uint32_t packet_in_mask_equal_master;
1805 uint32_t packet_in_mask_slave;
1806 uint32_t port_status_mask_equal_master;
1807 uint32_t port_status_mask_slave;
1808 uint32_t flow_removed_mask_equal_master;
1809 uint32_t flow_removed_mask_slave;
1810};
1811
1812struct ofp_async_get_reply {
1813 uint8_t version;
1814 uint8_t type;
1815 uint16_t length;
1816 uint32_t xid;
1817 uint32_t packet_in_mask_equal_master;
1818 uint32_t packet_in_mask_slave;
1819 uint32_t port_status_mask_equal_master;
1820 uint32_t port_status_mask_slave;
1821 uint32_t flow_removed_mask_equal_master;
1822 uint32_t flow_removed_mask_slave;
1823};
1824
1825struct ofp_async_set {
1826 uint8_t version;
1827 uint8_t type;
1828 uint16_t length;
1829 uint32_t xid;
1830 uint32_t packet_in_mask_equal_master;
1831 uint32_t packet_in_mask_slave;
1832 uint32_t port_status_mask_equal_master;
1833 uint32_t port_status_mask_slave;
1834 uint32_t flow_removed_mask_equal_master;
1835 uint32_t flow_removed_mask_slave;
1836};