blob: 0d48c431e6056dcc5a84e4de6a1ec2f9aa128560 [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 3
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
58 OFPQ_MIN_RATE_UNCFG = 0xffff,
59 OFPQ_MAX_RATE_UNCFG = 0xffff,
60};
61
62enum ofp_port {
63 OFPP_MAX = 0xffffff00,
64 OFPP_IN_PORT = 0xfffffff8,
65 OFPP_TABLE = 0xfffffff9,
66 OFPP_NORMAL = 0xfffffffa,
67 OFPP_FLOOD = 0xfffffffb,
68 OFPP_ALL = 0xfffffffc,
69 OFPP_CONTROLLER = 0xfffffffd,
70 OFPP_LOCAL = 0xfffffffe,
71};
72
73enum ofp_port_no {
74 OFPP_ANY = 0xffffffff,
75};
76
77enum ofp_type {
78 OFPT_HELLO = 0,
79 OFPT_ERROR = 1,
80 OFPT_ECHO_REQUEST = 2,
81 OFPT_ECHO_REPLY = 3,
82 OFPT_EXPERIMENTER = 4,
83 OFPT_FEATURES_REQUEST = 5,
84 OFPT_FEATURES_REPLY = 6,
85 OFPT_GET_CONFIG_REQUEST = 7,
86 OFPT_GET_CONFIG_REPLY = 8,
87 OFPT_SET_CONFIG = 9,
88 OFPT_PACKET_IN = 10,
89 OFPT_FLOW_REMOVED = 11,
90 OFPT_PORT_STATUS = 12,
91 OFPT_PACKET_OUT = 13,
92 OFPT_FLOW_MOD = 14,
93 OFPT_GROUP_MOD = 15,
94 OFPT_PORT_MOD = 16,
95 OFPT_TABLE_MOD = 17,
96 OFPT_STATS_REQUEST = 18,
97 OFPT_STATS_REPLY = 19,
98 OFPT_BARRIER_REQUEST = 20,
99 OFPT_BARRIER_REPLY = 21,
100 OFPT_QUEUE_GET_CONFIG_REQUEST = 22,
101 OFPT_QUEUE_GET_CONFIG_REPLY = 23,
102 OFPT_ROLE_REQUEST = 24,
103 OFPT_ROLE_REPLY = 25,
104};
105
106enum ofp_config_flags {
107 OFPC_FRAG_NORMAL = 0,
108 OFPC_FRAG_DROP = 1,
109 OFPC_FRAG_REASM = 2,
110 OFPC_FRAG_MASK = 3,
111 OFPC_INVALID_TTL_TO_CONTROLLER = 4,
112};
113
114enum ofp_table_config {
115 OFPTC_TABLE_MISS_CONTROLLER = 0,
116 OFPTC_TABLE_MISS_CONTINUE = 1,
117 OFPTC_TABLE_MISS_DROP = 2,
118 OFPTC_TABLE_MISS_MASK = 3,
119};
120
121enum ofp_table {
122 OFPTT_MAX = 0xfe,
123 OFPTT_ALL = 0xff,
124};
125
126enum ofp_capabilities {
127 OFPC_FLOW_STATS = 0x1,
128 OFPC_TABLE_STATS = 0x2,
129 OFPC_PORT_STATS = 0x4,
130 OFPC_GROUP_STATS = 0x8,
131 OFPC_IP_REASM = 0x20,
132 OFPC_QUEUE_STATS = 0x40,
133 OFPC_PORT_BLOCKED = 0x100,
134};
135
136enum ofp_port_config {
137 OFPPC_PORT_DOWN = 0x1,
138 OFPPC_NO_RECV = 0x4,
139 OFPPC_NO_FWD = 0x20,
140 OFPPC_NO_PACKET_IN = 0x40,
141};
142
143enum ofp_port_state {
144 OFPPS_LINK_DOWN = 0x1,
145 OFPPS_BLOCKED = 0x2,
146 OFPPS_LIVE = 0x4,
147};
148
149enum ofp_port_features {
150 OFPPF_10MB_HD = 0x1,
151 OFPPF_10MB_FD = 0x2,
152 OFPPF_100MB_HD = 0x4,
153 OFPPF_100MB_FD = 0x8,
154 OFPPF_1GB_HD = 0x10,
155 OFPPF_1GB_FD = 0x20,
156 OFPPF_10GB_FD = 0x40,
157 OFPPF_40GB_FD = 0x80,
158 OFPPF_100GB_FD = 0x100,
159 OFPPF_1TB_FD = 0x200,
160 OFPPF_OTHER = 0x400,
161 OFPPF_COPPER = 0x800,
162 OFPPF_FIBER = 0x1000,
163 OFPPF_AUTONEG = 0x2000,
164 OFPPF_PAUSE = 0x4000,
165 OFPPF_PAUSE_ASYM = 0x8000,
166};
167
168enum ofp_port_reason {
169 OFPPR_ADD = 0,
170 OFPPR_DELETE = 1,
171 OFPPR_MODIFY = 2,
172};
173
174enum ofp_match_type {
175 OFPMT_STANDARD = 0,
176 OFPMT_OXM = 1,
177};
178
179enum ofp_oxm_class {
180 OFPXMC_NXM_0 = 0,
181 OFPXMC_NXM_1 = 1,
182 OFPXMC_OPENFLOW_BASIC = 0x8000,
183 OFPXMC_EXPERIMENTER = 0xffff,
184};
185
186enum ofp_vlan_id {
187 OFPVID_NONE = 0,
188 OFPVID_PRESENT = 0x1000,
189};
190
191enum ofp_action_type {
192 OFPAT_OUTPUT = 0,
193 OFPAT_COPY_TTL_OUT = 0xb,
194 OFPAT_COPY_TTL_IN = 0xc,
195 OFPAT_SET_MPLS_TTL = 0xf,
196 OFPAT_DEC_MPLS_TTL = 0x10,
197 OFPAT_PUSH_VLAN = 0x11,
198 OFPAT_POP_VLAN = 0x12,
199 OFPAT_PUSH_MPLS = 0x13,
200 OFPAT_POP_MPLS = 0x14,
201 OFPAT_SET_QUEUE = 0x15,
202 OFPAT_GROUP = 0x16,
203 OFPAT_SET_NW_TTL = 0x17,
204 OFPAT_DEC_NW_TTL = 0x18,
205 OFPAT_SET_FIELD = 0x19,
206 OFPAT_EXPERIMENTER = 0xffff,
207};
208
209enum ofp_controller_max_len {
210 OFPCML_MAX = 0xffe5,
211 OFPCML_NO_BUFFER = 0xffff,
212};
213
214enum ofp_instruction_type {
215 OFPIT_GOTO_TABLE = 0x1,
216 OFPIT_WRITE_METADATA = 0x2,
217 OFPIT_WRITE_ACTIONS = 0x3,
218 OFPIT_APPLY_ACTIONS = 0x4,
219 OFPIT_CLEAR_ACTIONS = 0x5,
220 OFPIT_EXPERIMENTER = 0xffff,
221};
222
223enum ofp_flow_mod_command {
224 OFPFC_ADD = 0,
225 OFPFC_MODIFY = 1,
226 OFPFC_MODIFY_STRICT = 2,
227 OFPFC_DELETE = 3,
228 OFPFC_DELETE_STRICT = 4,
229};
230
231enum ofp_flow_mod_flags {
232 OFPFF_SEND_FLOW_REM = 0x1,
233 OFPFF_CHECK_OVERLAP = 0x2,
234 OFPFF_RESET_COUNTS = 0x4,
235};
236
237enum ofp_group {
238 OFPG_MAX = 0xffffff00,
239 OFPG_ALL = 0xfffffffc,
240 OFPG_ANY = 0xffffffff,
241};
242
243enum ofp_group_mod_command {
244 OFPGC_ADD = 0,
245 OFPGC_MODIFY = 1,
246 OFPGC_DELETE = 2,
247};
248
249enum ofp_group_type {
250 OFPGT_ALL = 0,
251 OFPGT_SELECT = 1,
252 OFPGT_INDIRECT = 2,
253 OFPGT_FF = 3,
254};
255
256enum ofp_packet_in_reason {
257 OFPR_NO_MATCH = 0,
258 OFPR_ACTION = 1,
259 OFPR_INVALID_TTL = 2,
260};
261
262enum ofp_flow_removed_reason {
263 OFPRR_IDLE_TIMEOUT = 0,
264 OFPRR_HARD_TIMEOUT = 1,
265 OFPRR_DELETE = 2,
266 OFPRR_GROUP_DELETE = 3,
267};
268
269enum ofp_error_type {
270 OFPET_HELLO_FAILED = 0,
271 OFPET_BAD_REQUEST = 1,
272 OFPET_BAD_ACTION = 2,
273 OFPET_BAD_INSTRUCTION = 3,
274 OFPET_BAD_MATCH = 4,
275 OFPET_FLOW_MOD_FAILED = 5,
276 OFPET_GROUP_MOD_FAILED = 6,
277 OFPET_PORT_MOD_FAILED = 7,
278 OFPET_TABLE_MOD_FAILED = 8,
279 OFPET_QUEUE_OP_FAILED = 9,
280 OFPET_SWITCH_CONFIG_FAILED = 10,
281 OFPET_ROLE_REQUEST_FAILED = 11,
282 OFPET_EXPERIMENTER = 0xffff,
283};
284
285enum ofp_hello_failed_code {
286 OFPHFC_INCOMPATIBLE = 0,
287 OFPHFC_EPERM = 1,
288};
289
290enum ofp_bad_request_code {
291 OFPBRC_BAD_VERSION = 0,
292 OFPBRC_BAD_TYPE = 1,
293 OFPBRC_BAD_STAT = 2,
294 OFPBRC_BAD_EXPERIMENTER = 3,
295 OFPBRC_BAD_EXP_TYPE = 4,
296 OFPBRC_EPERM = 5,
297 OFPBRC_BAD_LEN = 6,
298 OFPBRC_BUFFER_EMPTY = 7,
299 OFPBRC_BUFFER_UNKNOWN = 8,
300 OFPBRC_BAD_TABLE_ID = 9,
301 OFPBRC_IS_SLAVE = 10,
302 OFPBRC_BAD_PORT = 11,
303 OFPBRC_BAD_PACKET = 12,
304};
305
306enum ofp_bad_action_code {
307 OFPBAC_BAD_TYPE = 0,
308 OFPBAC_BAD_LEN = 1,
309 OFPBAC_BAD_EXPERIMENTER = 2,
310 OFPBAC_BAD_EXP_TYPE = 3,
311 OFPBAC_BAD_OUT_PORT = 4,
312 OFPBAC_BAD_ARGUMENT = 5,
313 OFPBAC_EPERM = 6,
314 OFPBAC_TOO_MANY = 7,
315 OFPBAC_BAD_QUEUE = 8,
316 OFPBAC_BAD_OUT_GROUP = 9,
317 OFPBAC_MATCH_INCONSISTENT = 10,
318 OFPBAC_UNSUPPORTED_ORDER = 11,
319 OFPBAC_BAD_TAG = 12,
320 OFPBAC_BAD_SET_TYPE = 13,
321 OFPBAC_BAD_SET_LEN = 14,
322 OFPBAC_BAD_SET_ARGUMENT = 15,
323};
324
325enum ofp_bad_instruction_code {
326 OFPBIC_UNKNOWN_INST = 0,
327 OFPBIC_UNSUP_INST = 1,
328 OFPBIC_BAD_TABLE_ID = 2,
329 OFPBIC_UNSUP_METADATA = 3,
330 OFPBIC_UNSUP_METADATA_MASK = 4,
331 OFPBIC_BAD_EXPERIMENTER = 5,
332 OFPBIC_BAD_EXP_TYPE = 6,
333 OFPBIC_BAD_LEN = 7,
334 OFPBIC_EPERM = 8,
335};
336
337enum ofp_bad_match_code {
338 OFPBMC_BAD_TYPE = 0,
339 OFPBMC_BAD_LEN = 1,
340 OFPBMC_BAD_TAG = 2,
341 OFPBMC_BAD_DL_ADDR_MASK = 3,
342 OFPBMC_BAD_NW_ADDR_MASK = 4,
343 OFPBMC_BAD_WILDCARDS = 5,
344 OFPBMC_BAD_FIELD = 6,
345 OFPBMC_BAD_VALUE = 7,
346 OFPBMC_BAD_MASK = 8,
347 OFPBMC_BAD_PREREQ = 9,
348 OFPBMC_DUP_FIELD = 10,
349 OFPBMC_EPERM = 11,
350};
351
352enum ofp_flow_mod_failed_code {
353 OFPFMFC_UNKNOWN = 0,
354 OFPFMFC_TABLE_FULL = 1,
355 OFPFMFC_BAD_TABLE_ID = 2,
356 OFPFMFC_OVERLAP = 3,
357 OFPFMFC_EPERM = 4,
358 OFPFMFC_BAD_TIMEOUT = 5,
359 OFPFMFC_BAD_COMMAND = 6,
360 OFPFMFC_BAD_FLAGS = 7,
361};
362
363enum ofp_group_mod_failed_code {
364 OFPGMFC_GROUP_EXISTS = 0,
365 OFPGMFC_INVALID_GROUP = 1,
366 OFPGMFC_WEIGHT_UNSUPPORTED = 2,
367 OFPGMFC_OUT_OF_GROUPS = 3,
368 OFPGMFC_OUT_OF_BUCKETS = 4,
369 OFPGMFC_CHAINING_UNSUPPORTED = 5,
370 OFPGMFC_WATCH_UNSUPPORTED = 6,
371 OFPGMFC_LOOP = 7,
372 OFPGMFC_UNKNOWN_GROUP = 8,
373 OFPGMFC_CHAINED_GROUP = 9,
374 OFPGMFC_BAD_TYPE = 10,
375 OFPGMFC_BAD_COMMAND = 11,
376 OFPGMFC_BAD_BUCKET = 12,
377 OFPGMFC_BAD_WATCH = 13,
378 OFPGMFC_EPERM = 14,
379};
380
381enum ofp_port_mod_failed_code {
382 OFPPMFC_BAD_PORT = 0,
383 OFPPMFC_BAD_HW_ADDR = 1,
384 OFPPMFC_BAD_CONFIG = 2,
385 OFPPMFC_BAD_ADVERTISE = 3,
386 OFPPMFC_EPERM = 4,
387};
388
389enum ofp_table_mod_failed_code {
390 OFPTMFC_BAD_TABLE = 0,
391 OFPTMFC_BAD_CONFIG = 1,
392 OFPTMFC_EPERM = 2,
393};
394
395enum ofp_queue_op_failed_code {
396 OFPQOFC_BAD_PORT = 0,
397 OFPQOFC_BAD_QUEUE = 1,
398 OFPQOFC_EPERM = 2,
399};
400
401enum ofp_switch_config_failed_code {
402 OFPSCFC_BAD_FLAGS = 0,
403 OFPSCFC_BAD_LEN = 1,
404 OFPSCFC_EPERM = 2,
405};
406
407enum ofp_role_request_failed_code {
408 OFPRRFC_STALE = 0,
409 OFPRRFC_UNSUP = 1,
410 OFPRRFC_BAD_ROLE = 2,
411};
412
413enum ofp_stats_types {
414 OFPST_DESC = 0,
415 OFPST_FLOW = 1,
416 OFPST_AGGREGATE = 2,
417 OFPST_TABLE = 3,
418 OFPST_PORT = 4,
419 OFPST_QUEUE = 5,
420 OFPST_GROUP = 6,
421 OFPST_GROUP_DESC = 7,
422 OFPST_GROUP_FEATURES = 8,
423 OFPST_EXPERIMENTER = 0xffff,
424};
425
426enum ofp_stats_reply_flags {
427 OFPSF_REPLY_MORE = 0x1,
428};
429
430enum ofp_group_capabilities {
431 OFPGFC_SELECT_WEIGHT = 0x1,
432 OFPGFC_SELECT_LIVENESS = 0x2,
433 OFPGFC_CHAINING = 0x4,
434 OFPGFC_CHAINING_CHECKS = 0x8,
435};
436
437enum ofp_queue_properties {
438 OFPQT_MIN_RATE = 0x1,
439 OFPQT_MAX_RATE = 0x2,
440 OFPQT_EXPERIMENTER = 0xffff,
441};
442
443enum ofp_controller_role {
444 OFPCR_ROLE_NOCHANGE = 0,
445 OFPCR_ROLE_EQUAL = 1,
446 OFPCR_ROLE_MASTER = 2,
447 OFPCR_ROLE_SLAVE = 3,
448};
449
Rich Lanea06d0c32013-03-25 08:52:03 -0700450struct ofp_header {
451 uint8_t version;
452 uint8_t type;
453 uint16_t length;
454 uint32_t xid;
455};
456
457struct ofp_hello {
458 uint8_t version;
459 uint8_t type;
460 uint16_t length;
461 uint32_t xid;
462};
463
464struct ofp_echo_request {
465 uint8_t version;
466 uint8_t type;
467 uint16_t length;
468 uint32_t xid;
469 of_octets_t data;
470};
471
472struct ofp_echo_reply {
473 uint8_t version;
474 uint8_t type;
475 uint16_t length;
476 uint32_t xid;
477 of_octets_t data;
478};
479
480struct ofp_experimenter {
481 uint8_t version;
482 uint8_t type;
483 uint16_t length;
484 uint32_t xid;
485 uint32_t experimenter;
486 uint32_t subtype;
487 of_octets_t data;
488};
489
490struct ofp_barrier_request {
491 uint8_t version;
492 uint8_t type;
493 uint16_t length;
494 uint32_t xid;
495};
496
497struct ofp_barrier_reply {
498 uint8_t version;
499 uint8_t type;
500 uint16_t length;
501 uint32_t xid;
502};
503
504struct ofp_get_config_request {
505 uint8_t version;
506 uint8_t type;
507 uint16_t length;
508 uint32_t xid;
509};
510
511struct ofp_get_config_reply {
512 uint8_t version;
513 uint8_t type;
514 uint16_t length;
515 uint32_t xid;
516 uint16_t flags;
517 uint16_t miss_send_len;
518};
519
520struct ofp_set_config {
521 uint8_t version;
522 uint8_t type;
523 uint16_t length;
524 uint32_t xid;
525 uint16_t flags;
526 uint16_t miss_send_len;
527};
528
529struct ofp_table_mod {
530 uint8_t version;
531 uint8_t type;
532 uint16_t length;
533 uint32_t xid;
534 uint8_t table_id;
535 uint8_t[3] pad;
536 uint32_t config;
537};
538
539struct ofp_port_desc {
540 of_port_no_t port_no;
541 uint8_t[4] pad;
542 of_mac_addr_t hw_addr;
543 uint8_t[2] pad2;
544 of_port_name_t name;
545 uint32_t config;
546 uint32_t state;
547 uint32_t curr;
548 uint32_t advertised;
549 uint32_t supported;
550 uint32_t peer;
551 uint32_t curr_speed;
552 uint32_t max_speed;
553};
554
555struct ofp_features_request {
556 uint8_t version;
557 uint8_t type;
558 uint16_t length;
559 uint32_t xid;
560};
561
562struct ofp_features_reply {
563 uint8_t version;
564 uint8_t type;
565 uint16_t length;
566 uint32_t xid;
567 uint64_t datapath_id;
568 uint32_t n_buffers;
569 uint8_t n_tables;
570 uint8_t[3] pad;
571 uint32_t capabilities;
572 uint32_t reserved;
573 list(of_port_desc_t) ports;
574};
575
576struct ofp_port_status {
577 uint8_t version;
578 uint8_t type;
579 uint16_t length;
580 uint32_t xid;
581 uint8_t reason;
582 uint8_t[7] pad;
583 of_port_desc_t desc;
584};
585
586struct ofp_port_mod {
587 uint8_t version;
588 uint8_t type;
589 uint16_t length;
590 uint32_t xid;
591 of_port_no_t port_no;
592 uint8_t[4] pad;
593 of_mac_addr_t hw_addr;
594 uint8_t[2] pad2;
595 uint32_t config;
596 uint32_t mask;
597 uint32_t advertise;
598 uint8_t[4] pad3;
599};
600
601struct ofp_match_v3 {
602 uint16_t type;
603 uint16_t length;
604 list(of_oxm_t) oxm_list;
605};
606
607struct ofp_oxm_experimenter_header {
608 uint32_t oxm_header;
609 uint32_t experimenter;
610 of_octets_t data;
611};
612
613struct ofp_action_output {
614 uint16_t type;
615 uint16_t len;
616 of_port_no_t port;
617 uint16_t max_len;
618 uint8_t[6] pad;
619};
620
621struct ofp_action_copy_ttl_out {
622 uint16_t type;
623 uint16_t len;
624 uint8_t[4] pad;
625};
626
627struct ofp_action_copy_ttl_in {
628 uint16_t type;
629 uint16_t len;
630 uint8_t[4] pad;
631};
632
633struct ofp_action_set_mpls_ttl {
634 uint16_t type;
635 uint16_t len;
636 uint8_t mpls_ttl;
637 uint8_t[3] pad;
638};
639
640struct ofp_action_dec_mpls_ttl {
641 uint16_t type;
642 uint16_t len;
643 uint8_t[4] pad;
644};
645
646struct ofp_action_push_vlan {
647 uint16_t type;
648 uint16_t len;
649 uint16_t ethertype;
650 uint8_t[2] pad;
651};
652
653struct ofp_action_pop_vlan {
654 uint16_t type;
655 uint16_t len;
656 uint8_t[4] pad;
657};
658
659struct ofp_action_push_mpls {
660 uint16_t type;
661 uint16_t len;
662 uint16_t ethertype;
663 uint8_t[2] pad;
664};
665
666struct ofp_action_pop_mpls {
667 uint16_t type;
668 uint16_t len;
669 uint16_t ethertype;
670 uint8_t[2] pad;
671};
672
673struct ofp_action_set_queue {
674 uint16_t type;
675 uint16_t len;
676 uint32_t queue_id;
677};
678
679struct ofp_action_group {
680 uint16_t type;
681 uint16_t len;
682 uint32_t group_id;
683};
684
685struct ofp_action_set_nw_ttl {
686 uint16_t type;
687 uint16_t len;
688 uint8_t nw_ttl;
689 uint8_t[3] pad;
690};
691
692struct ofp_action_dec_nw_ttl {
693 uint16_t type;
694 uint16_t len;
695 uint8_t[4] pad;
696};
697
698struct ofp_action_set_field {
699 uint16_t type;
700 uint16_t len;
701 of_octets_t field;
702};
703
704struct ofp_action_experimenter {
705 uint16_t type;
706 uint16_t len;
707 uint32_t experimenter;
708 of_octets_t data;
709};
710
711struct ofp_action {
712 uint16_t type;
713 uint16_t len;
714 uint8_t[4] pad;
715};
716
717struct ofp_instruction {
718 uint16_t type;
719 uint16_t len;
720 uint8_t[4] pad;
721};
722
723struct ofp_instruction_goto_table {
724 uint16_t type;
725 uint16_t len;
726 uint8_t table_id;
727 uint8_t[3] pad;
728};
729
730struct ofp_instruction_write_metadata {
731 uint16_t type;
732 uint16_t len;
733 uint8_t[4] pad;
734 uint64_t metadata;
735 uint64_t metadata_mask;
736};
737
738struct ofp_instruction_write_actions {
739 uint16_t type;
740 uint16_t len;
741 uint8_t[4] pad;
742 list(of_action_t) actions;
743};
744
745struct ofp_instruction_apply_actions {
746 uint16_t type;
747 uint16_t len;
748 uint8_t[4] pad;
749 list(of_action_t) actions;
750};
751
752struct ofp_instruction_clear_actions {
753 uint16_t type;
754 uint16_t len;
755 uint8_t[4] pad;
756};
757
758struct ofp_instruction_experimenter {
759 uint16_t type;
760 uint16_t len;
761 uint32_t experimenter;
762 of_octets_t data;
763};
764
765struct ofp_flow_add {
766 uint8_t version;
767 uint8_t type;
768 uint16_t length;
769 uint32_t xid;
770 uint64_t cookie;
771 uint64_t cookie_mask;
772 uint8_t table_id;
773 of_fm_cmd_t _command;
774 uint16_t idle_timeout;
775 uint16_t hard_timeout;
776 uint16_t priority;
777 uint32_t buffer_id;
778 of_port_no_t out_port;
779 uint32_t out_group;
780 uint16_t flags;
781 uint8_t[2] pad;
782 of_match_t match;
783 list(of_instruction_t) instructions;
784};
785
786struct ofp_flow_modify {
787 uint8_t version;
788 uint8_t type;
789 uint16_t length;
790 uint32_t xid;
791 uint64_t cookie;
792 uint64_t cookie_mask;
793 uint8_t table_id;
794 of_fm_cmd_t _command;
795 uint16_t idle_timeout;
796 uint16_t hard_timeout;
797 uint16_t priority;
798 uint32_t buffer_id;
799 of_port_no_t out_port;
800 uint32_t out_group;
801 uint16_t flags;
802 uint8_t[2] pad;
803 of_match_t match;
804 list(of_instruction_t) instructions;
805};
806
807struct ofp_flow_modify_strict {
808 uint8_t version;
809 uint8_t type;
810 uint16_t length;
811 uint32_t xid;
812 uint64_t cookie;
813 uint64_t cookie_mask;
814 uint8_t table_id;
815 of_fm_cmd_t _command;
816 uint16_t idle_timeout;
817 uint16_t hard_timeout;
818 uint16_t priority;
819 uint32_t buffer_id;
820 of_port_no_t out_port;
821 uint32_t out_group;
822 uint16_t flags;
823 uint8_t[2] pad;
824 of_match_t match;
825 list(of_instruction_t) instructions;
826};
827
828struct ofp_flow_delete {
829 uint8_t version;
830 uint8_t type;
831 uint16_t length;
832 uint32_t xid;
833 uint64_t cookie;
834 uint64_t cookie_mask;
835 uint8_t table_id;
836 of_fm_cmd_t _command;
837 uint16_t idle_timeout;
838 uint16_t hard_timeout;
839 uint16_t priority;
840 uint32_t buffer_id;
841 of_port_no_t out_port;
842 uint32_t out_group;
843 uint16_t flags;
844 uint8_t[2] pad;
845 of_match_t match;
846 list(of_instruction_t) instructions;
847};
848
849struct ofp_flow_delete_strict {
850 uint8_t version;
851 uint8_t type;
852 uint16_t length;
853 uint32_t xid;
854 uint64_t cookie;
855 uint64_t cookie_mask;
856 uint8_t table_id;
857 of_fm_cmd_t _command;
858 uint16_t idle_timeout;
859 uint16_t hard_timeout;
860 uint16_t priority;
861 uint32_t buffer_id;
862 of_port_no_t out_port;
863 uint32_t out_group;
864 uint16_t flags;
865 uint8_t[2] pad;
866 of_match_t match;
867 list(of_instruction_t) instructions;
868};
869
870struct ofp_bucket {
871 uint16_t len;
872 uint16_t weight;
873 of_port_no_t watch_port;
874 uint32_t watch_group;
875 uint8_t[4] pad;
876 list(of_action_t) actions;
877};
878
879struct ofp_group_mod {
880 uint8_t version;
881 uint8_t type;
882 uint16_t length;
883 uint32_t xid;
884 uint16_t command;
885 uint8_t group_type;
886 uint8_t pad;
887 uint32_t group_id;
888 list(of_bucket_t) buckets;
889};
890
891struct ofp_packet_out {
892 uint8_t version;
893 uint8_t type;
894 uint16_t length;
895 uint32_t xid;
896 uint32_t buffer_id;
897 of_port_no_t in_port;
898 uint16_t actions_len;
899 uint8_t[6] pad;
900 list(of_action_t) actions;
901 of_octets_t data;
902};
903
904struct ofp_packet_in {
905 uint8_t version;
906 uint8_t type;
907 uint16_t length;
908 uint32_t xid;
909 uint32_t buffer_id;
910 uint16_t total_len;
911 uint8_t reason;
912 uint8_t table_id;
913 of_match_t match;
914 uint8_t[2] pad;
915 of_octets_t data; /* FIXME: Ensure total_len gets updated */
916};
917
918struct ofp_flow_removed {
919 uint8_t version;
920 uint8_t type;
921 uint16_t length;
922 uint32_t xid;
923 uint64_t cookie;
924 uint16_t priority;
925 uint8_t reason;
926 uint8_t table_id;
927 uint32_t duration_sec;
928 uint32_t duration_nsec;
929 uint16_t idle_timeout;
930 uint16_t hard_timeout;
931 uint64_t packet_count;
932 uint64_t byte_count;
933 of_match_t match;
934};
935
936struct ofp_error_msg {
937 uint8_t version;
938 uint8_t type;
939 uint16_t length;
940 uint32_t xid;
941 uint16_t err_type;
942 uint16_t code;
943 of_octets_t data;
944};
945
946// struct ofp_error_experimenter_msg {
947// uint8_t version;
948// uint8_t type;
949// uint16_t length;
950// uint32_t xid;
951// uint16_t err_type;
952// uint16_t subtype;
953// uint32_t experimenter;
954// of_octets_t data;
955//};
956
957// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
958// FIXME: Verify disambiguation w/ length in object and entry
959
960struct ofp_flow_stats_entry {
961 uint16_t length;
962 uint8_t table_id;
963 uint8_t pad;
964 uint32_t duration_sec;
965 uint32_t duration_nsec;
966 uint16_t priority;
967 uint16_t idle_timeout;
968 uint16_t hard_timeout;
969 uint8_t[6] pad2;
970 uint64_t cookie;
971 uint64_t packet_count;
972 uint64_t byte_count;
973 of_match_t match;
974 list(of_instruction_t) instructions;
975};
976
977struct ofp_table_stats_entry {
978 uint8_t table_id;
979 uint8_t[7] pad;
980 of_table_name_t name;
981 of_match_bmap_t match;
982 of_wc_bmap_t wildcards;
983 uint32_t write_actions;
984 uint32_t apply_actions;
985 uint64_t write_setfields;
986 uint64_t apply_setfields;
987 uint64_t metadata_match;
988 uint64_t metadata_write;
989 uint32_t instructions;
990 uint32_t config;
991 uint32_t max_entries;
992 uint32_t active_count;
993 uint64_t lookup_count;
994 uint64_t matched_count;
995};
996
997struct ofp_port_stats_entry {
998 of_port_no_t port_no;
999 uint8_t[4] pad;
1000 uint64_t rx_packets;
1001 uint64_t tx_packets;
1002 uint64_t rx_bytes;
1003 uint64_t tx_bytes;
1004 uint64_t rx_dropped;
1005 uint64_t tx_dropped;
1006 uint64_t rx_errors;
1007 uint64_t tx_errors;
1008 uint64_t rx_frame_err;
1009 uint64_t rx_over_err;
1010 uint64_t rx_crc_err;
1011 uint64_t collisions;
1012};
1013
1014struct ofp_queue_stats_entry {
1015 of_port_no_t port_no;
1016 uint32_t queue_id;
1017 uint64_t tx_bytes;
1018 uint64_t tx_packets;
1019 uint64_t tx_errors;
1020};
1021
1022struct ofp_bucket_counter {
1023 uint64_t packet_count;
1024 uint64_t byte_count;
1025};
1026
1027struct ofp_group_stats_entry {
1028 uint16_t length;
1029 uint8_t[2] pad;
1030 uint32_t group_id;
1031 uint32_t ref_count;
1032 uint8_t[4] pad2;
1033 uint64_t packet_count;
1034 uint64_t byte_count;
1035 list(of_bucket_counter_t) bucket_stats;
1036};
1037
1038struct ofp_group_desc_stats_entry {
1039 uint16_t length;
1040 uint8_t type;
1041 uint8_t pad;
1042 uint32_t group_id;
1043 list(of_bucket_t) buckets;
1044};
1045
1046// STATS:
1047// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
1048
1049struct ofp_desc_stats_request {
1050 uint8_t version;
1051 uint8_t type;
1052 uint16_t length;
1053 uint32_t xid;
1054 uint16_t stats_type;
1055 uint16_t flags;
1056 uint8_t[4] pad;
1057};
1058
1059struct ofp_desc_stats_reply {
1060 uint8_t version;
1061 uint8_t type;
1062 uint16_t length;
1063 uint32_t xid;
1064 uint16_t stats_type;
1065 uint16_t flags;
1066 uint8_t[4] pad;
1067 of_desc_str_t mfr_desc;
1068 of_desc_str_t hw_desc;
1069 of_desc_str_t sw_desc;
1070 of_serial_num_t serial_num;
1071 of_desc_str_t dp_desc;
1072};
1073
1074struct ofp_flow_stats_request {
1075 uint8_t version;
1076 uint8_t type;
1077 uint16_t length;
1078 uint32_t xid;
1079 uint16_t stats_type;
1080 uint16_t flags;
1081 uint8_t[4] pad;
1082 uint8_t table_id;
1083 uint8_t[3] pad;
1084 of_port_no_t out_port;
1085 uint32_t out_group;
1086 uint8_t[4] pad2;
1087 uint64_t cookie;
1088 uint64_t cookie_mask;
1089 of_match_t match;
1090};
1091
1092struct ofp_flow_stats_reply {
1093 uint8_t version;
1094 uint8_t type;
1095 uint16_t length;
1096 uint32_t xid;
1097 uint16_t stats_type;
1098 uint16_t flags;
1099 uint8_t[4] pad;
1100 list(of_flow_stats_entry_t) entries;
1101};
1102
1103struct ofp_aggregate_stats_request {
1104 uint8_t version;
1105 uint8_t type;
1106 uint16_t length;
1107 uint32_t xid;
1108 uint16_t stats_type;
1109 uint16_t flags;
1110 uint8_t[4] pad;
1111 uint8_t table_id;
1112 uint8_t[3] pad;
1113 of_port_no_t out_port;
1114 uint32_t out_group;
1115 uint8_t[4] pad2;
1116 uint64_t cookie;
1117 uint64_t cookie_mask;
1118 of_match_t match;
1119};
1120
1121struct ofp_aggregate_stats_reply {
1122 uint8_t version;
1123 uint8_t type;
1124 uint16_t length;
1125 uint32_t xid;
1126 uint16_t stats_type;
1127 uint16_t flags;
1128 uint8_t[4] pad;
1129 uint64_t packet_count;
1130 uint64_t byte_count;
1131 uint32_t flow_count;
1132 uint8_t[4] pad;
1133};
1134
1135struct ofp_table_stats_request {
1136 uint8_t version;
1137 uint8_t type;
1138 uint16_t length;
1139 uint32_t xid;
1140 uint16_t stats_type;
1141 uint16_t flags;
1142 uint8_t[4] pad;
1143};
1144
1145struct ofp_table_stats_reply {
1146 uint8_t version;
1147 uint8_t type;
1148 uint16_t length;
1149 uint32_t xid;
1150 uint16_t stats_type;
1151 uint16_t flags;
1152 uint8_t[4] pad;
1153 list(of_table_stats_entry_t) entries;
1154};
1155
1156struct ofp_port_stats_request {
1157 uint8_t version;
1158 uint8_t type;
1159 uint16_t length;
1160 uint32_t xid;
1161 uint16_t stats_type;
1162 uint16_t flags;
1163 uint8_t[4] pad;
1164 of_port_no_t port_no;
1165 uint8_t[4] pad;
1166};
1167
1168struct ofp_port_stats_reply {
1169 uint8_t version;
1170 uint8_t type;
1171 uint16_t length;
1172 uint32_t xid;
1173 uint16_t stats_type;
1174 uint16_t flags;
1175 uint8_t[4] pad;
1176 list(of_port_stats_entry_t) entries;
1177};
1178
1179struct ofp_queue_stats_request {
1180 uint8_t version;
1181 uint8_t type;
1182 uint16_t length;
1183 uint32_t xid;
1184 uint16_t stats_type;
1185 uint16_t flags;
1186 uint8_t[4] pad;
1187 of_port_no_t port_no;
1188 uint32_t queue_id;
1189};
1190
1191struct ofp_queue_stats_reply {
1192 uint8_t version;
1193 uint8_t type;
1194 uint16_t length;
1195 uint32_t xid;
1196 uint16_t stats_type;
1197 uint16_t flags;
1198 uint8_t[4] pad;
1199 list(of_queue_stats_entry_t) entries;
1200};
1201
1202struct ofp_group_stats_request {
1203 uint8_t version;
1204 uint8_t type;
1205 uint16_t length;
1206 uint32_t xid;
1207 uint16_t stats_type;
1208 uint16_t flags;
1209 uint8_t[4] pad;
1210 uint32_t group_id;
1211 uint8_t[4] pad;
1212};
1213
1214struct ofp_group_stats_reply {
1215 uint8_t version;
1216 uint8_t type;
1217 uint16_t length;
1218 uint32_t xid;
1219 uint16_t stats_type;
1220 uint16_t flags;
1221 uint8_t[4] pad;
1222 list(of_group_stats_entry_t) entries;
1223};
1224
1225struct ofp_group_desc_stats_request {
1226 uint8_t version;
1227 uint8_t type;
1228 uint16_t length;
1229 uint32_t xid;
1230 uint16_t stats_type;
1231 uint16_t flags;
1232 uint8_t[4] pad;
1233};
1234
1235struct ofp_group_desc_stats_reply {
1236 uint8_t version;
1237 uint8_t type;
1238 uint16_t length;
1239 uint32_t xid;
1240 uint16_t stats_type;
1241 uint16_t flags;
1242 uint8_t[4] pad;
1243 list(of_group_desc_stats_entry_t) entries;
1244};
1245
1246struct ofp_group_features_stats_request {
1247 uint8_t version;
1248 uint8_t type;
1249 uint16_t length;
1250 uint32_t xid;
1251 uint16_t stats_type;
1252 uint16_t flags;
1253 uint8_t[4] pad;
1254};
1255
1256struct ofp_group_features_stats_reply {
1257 uint8_t version;
1258 uint8_t type;
1259 uint16_t length;
1260 uint32_t xid;
1261 uint16_t stats_type;
1262 uint16_t flags;
1263 uint8_t[4] pad;
1264 uint32_t types;
1265 uint32_t capabilities;
1266 uint32_t max_groups_all;
1267 uint32_t max_groups_select;
1268 uint32_t max_groups_indirect;
1269 uint32_t max_groups_ff;
1270 uint32_t actions_all;
1271 uint32_t actions_select;
1272 uint32_t actions_indirect;
1273 uint32_t actions_ff;
1274};
1275
1276struct ofp_experimenter_stats_request {
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 uint32_t experimenter;
1285 uint32_t subtype;
1286 of_octets_t data;
1287};
1288
1289struct ofp_experimenter_stats_reply {
1290 uint8_t version;
1291 uint8_t type;
1292 uint16_t length;
1293 uint32_t xid;
1294 uint16_t stats_type;
1295 uint16_t flags;
1296 uint8_t[4] pad;
1297 uint32_t experimenter;
1298 uint32_t subtype;
1299 of_octets_t data;
1300};
1301
1302// END OF STATS OBJECTS
1303
1304struct ofp_queue_prop {
1305 uint16_t type;
1306 uint16_t len;
1307 uint8_t[4] pad;
1308};
1309
1310struct ofp_queue_prop_min_rate {
1311 uint16_t type;
1312 uint16_t len;
1313 uint8_t[4] pad;
1314 uint16_t rate;
1315 uint8_t[6] pad;
1316};
1317
1318struct ofp_queue_prop_max_rate {
1319 uint16_t type;
1320 uint16_t len;
1321 uint8_t[4] pad;
1322 uint16_t rate;
1323 uint8_t[6] pad;
1324};
1325
1326struct ofp_queue_prop_experimenter {
1327 uint16_t type;
1328 uint16_t len;
1329 uint8_t[4] pad;
1330 uint32_t experimenter;
1331 uint8_t[4] pad;
1332 of_octets_t data;
1333};
1334
1335struct ofp_packet_queue {
1336 uint32_t queue_id;
1337 of_port_no_t port;
1338 uint16_t len;
1339 uint8_t[6] pad;
1340 list(of_queue_prop_t) properties;
1341};
1342
1343struct ofp_queue_get_config_request {
1344 uint8_t version;
1345 uint8_t type;
1346 uint16_t length;
1347 uint32_t xid;
1348 of_port_no_t port;
1349 uint8_t[4] pad;
1350};
1351
1352struct ofp_queue_get_config_reply {
1353 uint8_t version;
1354 uint8_t type;
1355 uint16_t length;
1356 uint32_t xid;
1357 of_port_no_t port;
1358 uint8_t[4] pad;
1359 list(of_packet_queue_t) queues;
1360};
1361
1362struct ofp_role_request {
1363 uint8_t version;
1364 uint8_t type;
1365 uint16_t length;
1366 uint32_t xid;
1367 uint32_t role;
1368 uint8_t[4] pad;
1369 uint64_t generation_id;
1370};
1371
1372struct ofp_role_reply {
1373 uint8_t version;
1374 uint8_t type;
1375 uint16_t length;
1376 uint32_t xid;
1377 of_octets_t data;
1378};