blob: 258ec01ea35dc9f742a8cf4f9ed379f8b06f3960 [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.
27
28#version 4
29
30struct ofp_header {
31 uint8_t version;
32 uint8_t type;
33 uint16_t length;
34 uint32_t xid;
35};
36
37// Special structures used for managing scalar list elements
38struct ofp_uint32 {
39 uint32_t value;
40};
41
42// Special structures used for managing scalar list elements
43struct ofp_uint8 {
44 uint8_t value;
45};
46
47struct ofp_hello_elem {
48 uint16_t type;
49 uint16_t length;
50};
51
52struct ofp_hello_elem_versionbitmap {
53 uint16_t type;
54 uint16_t length;
55 list(of_uint32_t) bitmaps;
56};
57
58struct ofp_hello {
59 uint8_t version;
60 uint8_t type;
61 uint16_t length;
62 uint32_t xid;
63 list(of_hello_elem_t) elements;
64};
65
66struct ofp_echo_request {
67 uint8_t version;
68 uint8_t type;
69 uint16_t length;
70 uint32_t xid;
71 of_octets_t data;
72};
73
74struct ofp_echo_reply {
75 uint8_t version;
76 uint8_t type;
77 uint16_t length;
78 uint32_t xid;
79 of_octets_t data;
80};
81
82struct ofp_experimenter {
83 uint8_t version;
84 uint8_t type;
85 uint16_t length;
86 uint32_t xid;
87 uint32_t experimenter;
88 uint32_t subtype;
89 of_octets_t data;
90};
91
92struct ofp_barrier_request {
93 uint8_t version;
94 uint8_t type;
95 uint16_t length;
96 uint32_t xid;
97};
98
99struct ofp_barrier_reply {
100 uint8_t version;
101 uint8_t type;
102 uint16_t length;
103 uint32_t xid;
104};
105
106struct ofp_get_config_request {
107 uint8_t version;
108 uint8_t type;
109 uint16_t length;
110 uint32_t xid;
111};
112
113struct ofp_get_config_reply {
114 uint8_t version;
115 uint8_t type;
116 uint16_t length;
117 uint32_t xid;
118 uint16_t flags;
119 uint16_t miss_send_len;
120};
121
122struct ofp_set_config {
123 uint8_t version;
124 uint8_t type;
125 uint16_t length;
126 uint32_t xid;
127 uint16_t flags;
128 uint16_t miss_send_len;
129};
130
131struct ofp_table_mod {
132 uint8_t version;
133 uint8_t type;
134 uint16_t length;
135 uint32_t xid;
136 uint8_t table_id;
137 uint8_t[3] pad;
138 uint32_t config;
139};
140
141struct ofp_port_desc {
142 of_port_no_t port_no;
143 uint8_t[4] pad;
144 of_mac_addr_t hw_addr;
145 uint8_t[2] pad2;
146 of_port_name_t name;
147 uint32_t config;
148 uint32_t state;
149 uint32_t curr;
150 uint32_t advertised;
151 uint32_t supported;
152 uint32_t peer;
153 uint32_t curr_speed;
154 uint32_t max_speed;
155};
156
157struct ofp_features_request {
158 uint8_t version;
159 uint8_t type;
160 uint16_t length;
161 uint32_t xid;
162};
163
164struct ofp_features_reply {
165 uint8_t version;
166 uint8_t type;
167 uint16_t length;
168 uint32_t xid;
169 uint64_t datapath_id;
170 uint32_t n_buffers;
171 uint8_t n_tables;
172 uint8_t auxiliary_id;
173 uint8_t[2] pad;
174 uint32_t capabilities;
175 uint32_t reserved;
176};
177
178struct ofp_port_status {
179 uint8_t version;
180 uint8_t type;
181 uint16_t length;
182 uint32_t xid;
183 uint8_t reason;
184 uint8_t[7] pad;
185 of_port_desc_t desc;
186};
187
188struct ofp_port_mod {
189 uint8_t version;
190 uint8_t type;
191 uint16_t length;
192 uint32_t xid;
193 of_port_no_t port_no;
194 uint8_t[4] pad;
195 of_mac_addr_t hw_addr;
196 uint8_t[2] pad2;
197 uint32_t config;
198 uint32_t mask;
199 uint32_t advertise;
200 uint8_t[4] pad3;
201};
202
203// FIXME Does this need to be v4?
204struct ofp_match_v3 {
205 uint16_t type;
206 uint16_t length;
207 list(of_oxm_t) oxm_list;
208};
209
210struct ofp_oxm_experimenter_header {
211 uint32_t oxm_header;
212 uint32_t experimenter;
213 of_octets_t data;
214};
215
216// This looks like an action header, but is standalone. See
217// ofp_table_features_prop_actions
218struct ofp_action_id {
219 uint16_t type;
220 uint16_t len;
221 uint8_t[4] pad;
222};
223
224struct ofp_action_output {
225 uint16_t type;
226 uint16_t len;
227 of_port_no_t port;
228 uint16_t max_len;
229 uint8_t[6] pad;
230};
231
232struct ofp_action_copy_ttl_out {
233 uint16_t type;
234 uint16_t len;
235 uint8_t[4] pad;
236};
237
238struct ofp_action_copy_ttl_in {
239 uint16_t type;
240 uint16_t len;
241 uint8_t[4] pad;
242};
243
244struct ofp_action_set_mpls_ttl {
245 uint16_t type;
246 uint16_t len;
247 uint8_t mpls_ttl;
248 uint8_t[3] pad;
249};
250
251struct ofp_action_dec_mpls_ttl {
252 uint16_t type;
253 uint16_t len;
254 uint8_t[4] pad;
255};
256
257struct ofp_action_push_vlan {
258 uint16_t type;
259 uint16_t len;
260 uint16_t ethertype;
261 uint8_t[2] pad;
262};
263
264struct ofp_action_pop_vlan {
265 uint16_t type;
266 uint16_t len;
267 uint8_t[4] pad;
268};
269
270struct ofp_action_push_mpls {
271 uint16_t type;
272 uint16_t len;
273 uint16_t ethertype;
274 uint8_t[2] pad;
275};
276
277struct ofp_action_pop_mpls {
278 uint16_t type;
279 uint16_t len;
280 uint16_t ethertype;
281 uint8_t[2] pad;
282};
283
284struct ofp_action_set_queue {
285 uint16_t type;
286 uint16_t len;
287 uint32_t queue_id;
288};
289
290struct ofp_action_group {
291 uint16_t type;
292 uint16_t len;
293 uint32_t group_id;
294};
295
296struct ofp_action_set_nw_ttl {
297 uint16_t type;
298 uint16_t len;
299 uint8_t nw_ttl;
300 uint8_t[3] pad;
301};
302
303struct ofp_action_dec_nw_ttl {
304 uint16_t type;
305 uint16_t len;
306 uint8_t[4] pad;
307};
308
309struct ofp_action_set_field {
310 uint16_t type;
311 uint16_t len;
312 of_octets_t field;
313};
314
315struct ofp_action_experimenter {
316 uint16_t type;
317 uint16_t len;
318 uint32_t experimenter;
319 of_octets_t data;
320};
321
322struct ofp_action_pop_pbb {
323 uint16_t type;
324 uint16_t len;
325 uint8_t[4] pad;
326};
327
328struct ofp_action_push_pbb {
329 uint16_t type;
330 uint16_t len;
331 uint16_t ethertype;
332 uint8_t[2] pad;
333};
334
335struct ofp_action {
336 uint16_t type;
337 uint16_t len;
338 uint8_t[4] pad;
339};
340
341struct ofp_instruction {
342 uint16_t type;
343 uint16_t len;
344};
345
346struct ofp_instruction_goto_table {
347 uint16_t type;
348 uint16_t len;
349 uint8_t table_id;
350 uint8_t[3] pad;
351};
352
353struct ofp_instruction_write_metadata {
354 uint16_t type;
355 uint16_t len;
356 uint8_t[4] pad;
357 uint64_t metadata;
358 uint64_t metadata_mask;
359};
360
361struct ofp_instruction_write_actions {
362 uint16_t type;
363 uint16_t len;
364 uint8_t[4] pad;
365 list(of_action_t) actions;
366};
367
368struct ofp_instruction_apply_actions {
369 uint16_t type;
370 uint16_t len;
371 uint8_t[4] pad;
372 list(of_action_t) actions;
373};
374
375struct ofp_instruction_clear_actions {
376 uint16_t type;
377 uint16_t len;
378 uint8_t[4] pad;
379};
380
381struct ofp_instruction_meter {
382 uint16_t type;
383 uint16_t len;
384 uint32_t meter_id;
385};
386
387struct ofp_instruction_experimenter {
388 uint16_t type;
389 uint16_t len;
390 uint32_t experimenter;
391 of_octets_t data;
392};
393
394struct ofp_flow_add {
395 uint8_t version;
396 uint8_t type;
397 uint16_t length;
398 uint32_t xid;
399 uint64_t cookie;
400 uint64_t cookie_mask;
401 uint8_t table_id;
402 of_fm_cmd_t _command;
403 uint16_t idle_timeout;
404 uint16_t hard_timeout;
405 uint16_t priority;
406 uint32_t buffer_id;
407 of_port_no_t out_port;
408 uint32_t out_group;
409 uint16_t flags;
410 uint8_t[2] pad;
411 of_match_t match;
412 list(of_instruction_t) instructions;
413};
414
415struct ofp_flow_modify {
416 uint8_t version;
417 uint8_t type;
418 uint16_t length;
419 uint32_t xid;
420 uint64_t cookie;
421 uint64_t cookie_mask;
422 uint8_t table_id;
423 of_fm_cmd_t _command;
424 uint16_t idle_timeout;
425 uint16_t hard_timeout;
426 uint16_t priority;
427 uint32_t buffer_id;
428 of_port_no_t out_port;
429 uint32_t out_group;
430 uint16_t flags;
431 uint8_t[2] pad;
432 of_match_t match;
433 list(of_instruction_t) instructions;
434};
435
436struct ofp_flow_modify_strict {
437 uint8_t version;
438 uint8_t type;
439 uint16_t length;
440 uint32_t xid;
441 uint64_t cookie;
442 uint64_t cookie_mask;
443 uint8_t table_id;
444 of_fm_cmd_t _command;
445 uint16_t idle_timeout;
446 uint16_t hard_timeout;
447 uint16_t priority;
448 uint32_t buffer_id;
449 of_port_no_t out_port;
450 uint32_t out_group;
451 uint16_t flags;
452 uint8_t[2] pad;
453 of_match_t match;
454 list(of_instruction_t) instructions;
455};
456
457struct ofp_flow_delete {
458 uint8_t version;
459 uint8_t type;
460 uint16_t length;
461 uint32_t xid;
462 uint64_t cookie;
463 uint64_t cookie_mask;
464 uint8_t table_id;
465 of_fm_cmd_t _command;
466 uint16_t idle_timeout;
467 uint16_t hard_timeout;
468 uint16_t priority;
469 uint32_t buffer_id;
470 of_port_no_t out_port;
471 uint32_t out_group;
472 uint16_t flags;
473 uint8_t[2] pad;
474 of_match_t match;
475 list(of_instruction_t) instructions;
476};
477
478struct ofp_flow_delete_strict {
479 uint8_t version;
480 uint8_t type;
481 uint16_t length;
482 uint32_t xid;
483 uint64_t cookie;
484 uint64_t cookie_mask;
485 uint8_t table_id;
486 of_fm_cmd_t _command;
487 uint16_t idle_timeout;
488 uint16_t hard_timeout;
489 uint16_t priority;
490 uint32_t buffer_id;
491 of_port_no_t out_port;
492 uint32_t out_group;
493 uint16_t flags;
494 uint8_t[2] pad;
495 of_match_t match;
496 list(of_instruction_t) instructions;
497};
498
499struct ofp_bucket {
500 uint16_t len;
501 uint16_t weight;
502 of_port_no_t watch_port;
503 uint32_t watch_group;
504 uint8_t[4] pad;
505 list(of_action_t) actions;
506};
507
508struct ofp_group_mod {
509 uint8_t version;
510 uint8_t type;
511 uint16_t length;
512 uint32_t xid;
513 uint16_t command;
514 uint8_t group_type;
515 uint8_t pad;
516 uint32_t group_id;
517 list(of_bucket_t) buckets;
518};
519
520struct ofp_packet_out {
521 uint8_t version;
522 uint8_t type;
523 uint16_t length;
524 uint32_t xid;
525 uint32_t buffer_id;
526 of_port_no_t in_port;
527 uint16_t actions_len;
528 uint8_t[6] pad;
529 list(of_action_t) actions;
530 of_octets_t data;
531};
532
533struct ofp_packet_in {
534 uint8_t version;
535 uint8_t type;
536 uint16_t length;
537 uint32_t xid;
538 uint32_t buffer_id;
539 uint16_t total_len;
540 uint8_t reason;
541 uint8_t table_id;
542 uint64_t cookie;
543 of_match_t match;
544 uint8_t[2] pad;
545 of_octets_t data; /* FIXME: Ensure total_len gets updated */
546};
547
548struct ofp_flow_removed {
549 uint8_t version;
550 uint8_t type;
551 uint16_t length;
552 uint32_t xid;
553 uint64_t cookie;
554 uint16_t priority;
555 uint8_t reason;
556 uint8_t table_id;
557 uint32_t duration_sec;
558 uint32_t duration_nsec;
559 uint16_t idle_timeout;
560 uint16_t hard_timeout;
561 uint64_t packet_count;
562 uint64_t byte_count;
563 of_match_t match;
564};
565
566struct ofp_meter_band {
567 uint16_t type;
568 uint16_t len;
569// uint32_t rate; // These are excluded b/c this is the header
570// uint32_t burst_size; // These are excluded b/c this is the header
571};
572
573struct ofp_meter_band_drop {
574 uint16_t type;
575 uint16_t len;
576 uint32_t rate;
577 uint32_t burst_size;
578 uint8_t[4] pad;
579};
580
581struct ofp_meter_band_dscp_remark {
582 uint16_t type;
583 uint16_t len;
584 uint32_t rate;
585 uint32_t burst_size;
586 uint8_t prec_level;
587 uint8_t[3] pad;
588};
589
590struct ofp_meter_band_experimenter {
591 uint16_t type;
592 uint16_t len;
593 uint32_t rate;
594 uint32_t burst_size;
595 uint32_t experimenter;
596};
597
598struct ofp_meter_mod {
599 uint8_t version;
600 uint8_t type;
601 uint16_t length;
602 uint32_t xid;
603 uint16_t command;
604 uint16_t flags;
605 uint32_t meter_id;
606 list(of_meter_band_t) meters;
607};
608
609struct ofp_error_msg {
610 uint8_t version;
611 uint8_t type;
612 uint16_t length;
613 uint32_t xid;
614 uint16_t err_type;
615 uint16_t code;
616 of_octets_t data;
617};
618
619//struct ofp_error_experimenter_msg {
620// uint8_t version;
621// uint8_t type;
622// uint16_t length;
623// uint32_t xid;
624// uint16_t err_type;
625// uint16_t subtype;
626// uint32_t experimenter;
627// of_octets_t data;
628//};
629
630// STATS ENTRIES: flow, table, port, queue, group stats, group desc stats
631
632struct ofp_flow_stats_entry {
633 uint16_t length;
634 uint8_t table_id;
635 uint8_t pad;
636 uint32_t duration_sec;
637 uint32_t duration_nsec;
638 uint16_t priority;
639 uint16_t idle_timeout;
640 uint16_t hard_timeout;
641 uint8_t[6] pad2;
642 uint64_t cookie;
643 uint64_t packet_count;
644 uint64_t byte_count;
645 of_match_t match;
646 list(of_instruction_t) instructions;
647};
648
649
650struct ofp_table_stats_entry {
651 uint8_t table_id;
652 uint8_t[3] pad;
653 uint32_t active_count;
654 uint64_t lookup_count;
655 uint64_t matched_count;
656};
657
658struct ofp_port_stats_entry {
659 of_port_no_t port_no;
660 uint8_t[4] pad;
661 uint64_t rx_packets;
662 uint64_t tx_packets;
663 uint64_t rx_bytes;
664 uint64_t tx_bytes;
665 uint64_t rx_dropped;
666 uint64_t tx_dropped;
667 uint64_t rx_errors;
668 uint64_t tx_errors;
669 uint64_t rx_frame_err;
670 uint64_t rx_over_err;
671 uint64_t rx_crc_err;
672 uint64_t collisions;
673 uint32_t duration_sec;
674 uint32_t duration_nsec;
675};
676
677struct ofp_queue_stats_entry {
678 of_port_no_t port_no;
679 uint32_t queue_id;
680 uint64_t tx_bytes;
681 uint64_t tx_packets;
682 uint64_t tx_errors;
683 uint32_t duration_sec;
684 uint32_t duration_nsec;
685};
686
687struct ofp_bucket_counter {
688 uint64_t packet_count;
689 uint64_t byte_count;
690};
691
692struct ofp_group_stats_entry {
693 uint16_t length;
694 uint8_t[2] pad;
695 uint32_t group_id;
696 uint32_t ref_count;
697 uint8_t[4] pad;
698 uint64_t packet_count;
699 uint64_t byte_count;
700 uint32_t duration_sec;
701 uint32_t duration_nsec;
702 list(of_bucket_counter_t) bucket_stats;
703};
704
705struct ofp_group_desc_stats_entry {
706 uint16_t length;
707 uint8_t type;
708 uint8_t pad;
709 uint32_t group_id;
710 list(of_bucket_t) buckets;
711};
712
713// STATS:
714// Desc, flow, agg, table, port, queue, group, group_desc, group_feat, experi
715
716struct ofp_desc_stats_request {
717 uint8_t version;
718 uint8_t type;
719 uint16_t length;
720 uint32_t xid;
721 uint16_t stats_type;
722 uint16_t flags;
723 uint8_t[4] pad;
724};
725
726struct ofp_desc_stats_reply {
727 uint8_t version;
728 uint8_t type;
729 uint16_t length;
730 uint32_t xid;
731 uint16_t stats_type;
732 uint16_t flags;
733 uint8_t[4] pad;
734 of_desc_str_t mfr_desc;
735 of_desc_str_t hw_desc;
736 of_desc_str_t sw_desc;
737 of_serial_num_t serial_num;
738 of_desc_str_t dp_desc;
739};
740
741struct ofp_flow_stats_request {
742 uint8_t version;
743 uint8_t type;
744 uint16_t length;
745 uint32_t xid;
746 uint16_t stats_type;
747 uint16_t flags;
748 uint8_t[4] pad;
749 uint8_t table_id;
750 uint8_t[3] pad;
751 of_port_no_t out_port;
752 uint32_t out_group;
753 uint8_t[4] pad2;
754 uint64_t cookie;
755 uint64_t cookie_mask;
756 of_match_t match;
757};
758
759struct ofp_flow_stats_reply {
760 uint8_t version;
761 uint8_t type;
762 uint16_t length;
763 uint32_t xid;
764 uint16_t stats_type;
765 uint16_t flags;
766 uint8_t[4] pad;
767 list(of_flow_stats_entry_t) entries;
768};
769
770struct ofp_aggregate_stats_request {
771 uint8_t version;
772 uint8_t type;
773 uint16_t length;
774 uint32_t xid;
775 uint16_t stats_type;
776 uint16_t flags;
777 uint8_t[4] pad;
778 uint8_t table_id;
779 uint8_t[3] pad;
780 of_port_no_t out_port;
781 uint32_t out_group;
782 uint8_t[4] pad2;
783 uint64_t cookie;
784 uint64_t cookie_mask;
785 of_match_t match;
786};
787
788struct ofp_aggregate_stats_reply {
789 uint8_t version;
790 uint8_t type;
791 uint16_t length;
792 uint32_t xid;
793 uint16_t stats_type;
794 uint16_t flags;
795 uint8_t[4] pad;
796 uint64_t packet_count;
797 uint64_t byte_count;
798 uint32_t flow_count;
799 uint8_t[4] pad;
800};
801
802// FIXME: These are padded to 8 byte align beyond the length indicated
803
804struct ofp_table_feature_prop {
805 uint16_t type;
806 uint16_t length;
807};
808
809struct ofp_table_feature_prop_instructions {
810 uint16_t type;
811 uint16_t length;
812 // FIXME Check if instruction_t is right for ids here
813 list(of_instruction_t) instruction_ids;
814};
815
816struct ofp_table_feature_prop_instructions_miss {
817 uint16_t type;
818 uint16_t length;
819 list(of_instruction_t) instruction_ids;
820};
821
822struct ofp_table_feature_prop_next_tables {
823 uint16_t type;
824 uint16_t length;
825 list(of_uint8_t) next_table_ids;
826};
827
828struct ofp_table_feature_prop_next_tables_miss {
829 uint16_t type;
830 uint16_t length;
831 list(of_uint8_t) next_table_ids;
832};
833
834struct ofp_table_feature_prop_write_actions {
835 uint16_t type;
836 uint16_t length;
837 list(of_action_id_t) action_ids;
838};
839
840struct ofp_table_feature_prop_write_actions_miss {
841 uint16_t type;
842 uint16_t length;
843 list(of_action_id_t) action_ids;
844};
845
846struct ofp_table_feature_prop_apply_actions {
847 uint16_t type;
848 uint16_t length;
849 list(of_action_id_t) action_ids;
850};
851
852struct ofp_table_feature_prop_apply_actions_miss {
853 uint16_t type;
854 uint16_t length;
855 list(of_action_id_t) action_ids;
856};
857
858struct ofp_table_feature_prop_match {
859 uint16_t type;
860 uint16_t length;
861 list(of_uint32_t) oxm_ids;
862};
863
864struct ofp_table_feature_prop_wildcards {
865 uint16_t type;
866 uint16_t length;
867 list(of_uint32_t) oxm_ids;
868};
869
870struct ofp_table_feature_prop_write_setfield {
871 uint16_t type;
872 uint16_t length;
873 list(of_uint32_t) oxm_ids;
874};
875
876struct ofp_table_feature_prop_write_setfield_miss {
877 uint16_t type;
878 uint16_t length;
879 list(of_uint32_t) oxm_ids;
880};
881
882struct ofp_table_feature_prop_apply_setfield {
883 uint16_t type;
884 uint16_t length;
885 list(of_uint32_t) oxm_ids;
886};
887
888struct ofp_table_feature_prop_apply_setfield_miss {
889 uint16_t type;
890 uint16_t length;
891 list(of_uint32_t) oxm_ids;
892};
893
894struct ofp_table_feature_prop_experimenter {
895 uint16_t type;
896 uint16_t length;
897 uint32_t experimenter;
898 uint32_t subtype;
899 of_octets_t experimenter_data;
900};
901
902// Not yet supported
903// struct ofp_table_feature_prop_experimenter_miss {
904// uint16_t type;
905// uint16_t length;
906// uint32_t experimenter;
907// uint32_t subtype;
908// of_octets_t experimenter_data;
909// };
910
911struct ofp_table_features {
912 uint16_t length;
913 uint8_t table_id;
914 uint8_t[5] pad;
915 of_table_name_t name;
916 uint64_t metadata_match;
917 uint64_t metadata_write;
918 uint32_t config;
919 uint32_t max_entries;
920 list(of_table_feature_prop_t) properties;
921};
922
923struct ofp_meter_features {
924 uint32_t max_meter;
925 uint32_t band_types;
926 uint32_t capabilities;
927 uint8_t max_bands;
928 uint8_t max_color;
929 uint8_t[2] pad;
930};
931
932struct ofp_port_stats_request {
933 uint8_t version;
934 uint8_t type;
935 uint16_t length;
936 uint32_t xid;
937 uint16_t stats_type;
938 uint16_t flags;
939 uint8_t[4] pad;
940 of_port_no_t port_no;
941 uint8_t[4] pad;
942};
943
944struct ofp_port_stats_reply {
945 uint8_t version;
946 uint8_t type;
947 uint16_t length;
948 uint32_t xid;
949 uint16_t stats_type;
950 uint16_t flags;
951 uint8_t[4] pad;
952 list(of_port_stats_entry_t) entries;
953};
954
955struct ofp_queue_stats_request {
956 uint8_t version;
957 uint8_t type;
958 uint16_t length;
959 uint32_t xid;
960 uint16_t stats_type;
961 uint16_t flags;
962 uint8_t[4] pad;
963 of_port_no_t port_no;
964 uint32_t queue_id;
965};
966
967struct ofp_queue_stats_reply {
968 uint8_t version;
969 uint8_t type;
970 uint16_t length;
971 uint32_t xid;
972 uint16_t stats_type;
973 uint16_t flags;
974 uint8_t[4] pad;
975 list(of_queue_stats_entry_t) entries;
976};
977
978struct ofp_group_stats_request {
979 uint8_t version;
980 uint8_t type;
981 uint16_t length;
982 uint32_t xid;
983 uint16_t stats_type;
984 uint16_t flags;
985 uint8_t[4] pad;
986 uint32_t group_id;
987 uint8_t[4] pad;
988};
989
990struct ofp_group_stats_reply {
991 uint8_t version;
992 uint8_t type;
993 uint16_t length;
994 uint32_t xid;
995 uint16_t stats_type;
996 uint16_t flags;
997 uint8_t[4] pad;
998 list(of_group_stats_entry_t) entries;
999};
1000
1001struct ofp_group_desc_stats_request {
1002 uint8_t version;
1003 uint8_t type;
1004 uint16_t length;
1005 uint32_t xid;
1006 uint16_t stats_type;
1007 uint16_t flags;
1008 uint8_t[4] pad;
1009};
1010
1011struct ofp_group_desc_stats_reply {
1012 uint8_t version;
1013 uint8_t type;
1014 uint16_t length;
1015 uint32_t xid;
1016 uint16_t stats_type;
1017 uint16_t flags;
1018 uint8_t[4] pad;
1019 list(of_group_desc_stats_entry_t) entries;
1020};
1021
1022struct ofp_group_features_stats_request {
1023 uint8_t version;
1024 uint8_t type;
1025 uint16_t length;
1026 uint32_t xid;
1027 uint16_t stats_type;
1028 uint16_t flags;
1029 uint8_t[4] pad;
1030};
1031
1032struct ofp_group_features_stats_reply {
1033 uint8_t version;
1034 uint8_t type;
1035 uint16_t length;
1036 uint32_t xid;
1037 uint16_t stats_type;
1038 uint16_t flags;
1039 uint8_t[4] pad;
1040 uint32_t types;
1041 uint32_t capabilities;
1042 uint32_t max_groups_all;
1043 uint32_t max_groups_select;
1044 uint32_t max_groups_indirect;
1045 uint32_t max_groups_ff;
1046 uint32_t actions_all;
1047 uint32_t actions_select;
1048 uint32_t actions_indirect;
1049 uint32_t actions_ff;
1050};
1051
1052struct ofp_meter_stats_request {
1053 uint8_t version;
1054 uint8_t type;
1055 uint16_t length;
1056 uint32_t xid;
1057 uint16_t stats_type;
1058 uint16_t flags;
1059 uint8_t[4] pad;
1060 uint32_t meter_id;
1061 uint8_t[4] pad;
1062};
1063
1064struct ofp_meter_stats_reply {
1065 uint8_t version;
1066 uint8_t type;
1067 uint16_t length;
1068 uint32_t xid;
1069 uint16_t stats_type;
1070 uint16_t flags;
1071 uint8_t[4] pad;
1072 list(of_meter_stats_t) entries;
1073};
1074
1075struct ofp_meter_config_stats_request {
1076 uint8_t version;
1077 uint8_t type;
1078 uint16_t length;
1079 uint32_t xid;
1080 uint16_t stats_type;
1081 uint16_t flags;
1082 uint8_t[4] pad;
1083 uint32_t meter_id;
1084 uint8_t[4] pad;
1085};
1086
1087struct ofp_meter_config_stats_reply {
1088 uint8_t version;
1089 uint8_t type;
1090 uint16_t length;
1091 uint32_t xid;
1092 uint16_t stats_type;
1093 uint16_t flags;
1094 uint8_t[4] pad;
1095 list(of_meter_band_t) entries;
1096};
1097
1098// FIXME stats added to get things working
1099struct ofp_meter_features_stats_request {
1100 uint8_t version;
1101 uint8_t type;
1102 uint16_t length;
1103 uint32_t xid;
1104 uint16_t stats_type;
1105 uint16_t flags;
1106 uint8_t[4] pad;
1107};
1108
1109// FIXME stats added to get things working
1110struct ofp_meter_features_stats_reply {
1111 uint8_t version;
1112 uint8_t type;
1113 uint16_t length;
1114 uint32_t xid;
1115 uint16_t stats_type;
1116 uint16_t flags;
1117 uint8_t[4] pad;
1118 of_meter_features_t features;
1119};
1120
1121// FIXME stats added to get things working
1122struct ofp_table_features_stats_request {
1123 uint8_t version;
1124 uint8_t type;
1125 uint16_t length;
1126 uint32_t xid;
1127 uint16_t stats_type;
1128 uint16_t flags;
1129 uint8_t[4] pad;
1130 list(of_table_features_t) entries;
1131};
1132
1133// FIXME stats added to get things working
1134struct ofp_table_features_stats_reply {
1135 uint8_t version;
1136 uint8_t type;
1137 uint16_t length;
1138 uint32_t xid;
1139 uint16_t stats_type;
1140 uint16_t flags;
1141 uint8_t[4] pad;
1142 list(of_table_features_t) entries;
1143};
1144
1145// FIXME stats added to get things working
1146struct ofp_port_desc_stats_request {
1147 uint8_t version;
1148 uint8_t type;
1149 uint16_t length;
1150 uint32_t xid;
1151 uint16_t stats_type;
1152 uint16_t flags;
1153 uint8_t[4] pad;
1154};
1155
1156// FIXME stats added to get things working
1157struct ofp_port_desc_stats_reply {
1158 uint8_t version;
1159 uint8_t type;
1160 uint16_t length;
1161 uint32_t xid;
1162 uint16_t stats_type;
1163 uint16_t flags;
1164 uint8_t[4] pad;
1165 list(of_port_desc_t) entries;
1166};
1167
1168struct ofp_meter_band_stats {
1169 uint64_t packet_band_count;
1170 uint64_t byte_band_count;
1171};
1172
1173struct ofp_meter_stats {
1174 uint32_t meter_id;
1175 uint16_t len;
1176 uint8_t[6] pad;
1177 uint32_t flow_count;
1178 uint64_t packet_in_count;
1179 uint64_t byte_in_count;
1180 uint32_t duration_sec;
1181 uint32_t duration_nsec;
1182 list(of_meter_band_stats_t) band_stats;
1183};
1184
1185struct ofp_meter_config {
1186 uint16_t length;
1187 uint16_t flags;
1188 uint32_t meter_id;
1189 list(of_meter_band_t) entries;
1190};
1191
1192struct ofp_experimenter_multipart_header {
1193 uint32_t experimenter;
1194 uint32_t subtype;
1195};
1196
1197// END OF STATS OBJECTS
1198
1199struct ofp_queue_prop {
1200 uint16_t type;
1201 uint16_t len;
1202 uint8_t[4] pad;
1203};
1204
1205struct ofp_queue_prop_min_rate {
1206 uint16_t type;
1207 uint16_t len;
1208 uint8_t[4] pad;
1209 uint16_t rate;
1210 uint8_t[6] pad;
1211};
1212
1213struct ofp_queue_prop_max_rate {
1214 uint16_t type;
1215 uint16_t len;
1216 uint8_t[4] pad;
1217 uint16_t rate;
1218 uint8_t[6] pad;
1219};
1220
1221struct ofp_queue_prop_experimenter {
1222 uint16_t type;
1223 uint16_t len;
1224 uint8_t[4] pad;
1225 uint32_t experimenter;
1226 uint8_t[4] pad;
1227 of_octets_t data;
1228};
1229
1230struct ofp_packet_queue {
1231 uint32_t queue_id;
1232 of_port_no_t port;
1233 uint16_t len;
1234 uint8_t[6] pad;
1235 list(of_queue_prop_t) properties;
1236};
1237
1238struct ofp_queue_get_config_request {
1239 uint8_t version;
1240 uint8_t type;
1241 uint16_t length;
1242 uint32_t xid;
1243 of_port_no_t port;
1244 uint8_t[4] pad;
1245};
1246
1247struct ofp_queue_get_config_reply {
1248 uint8_t version;
1249 uint8_t type;
1250 uint16_t length;
1251 uint32_t xid;
1252 of_port_no_t port;
1253 uint8_t[4] pad;
1254 list(of_packet_queue_t) queues;
1255};
1256
1257struct ofp_role_request {
1258 uint8_t version;
1259 uint8_t type;
1260 uint16_t length;
1261 uint32_t xid;
1262 uint32_t role;
1263 uint8_t[4] pad;
1264 uint64_t generation_id;
1265};
1266
1267struct ofp_role_reply {
1268 uint8_t version;
1269 uint8_t type;
1270 uint16_t length;
1271 uint32_t xid;
1272 of_octets_t data;
1273};
1274
1275////////////////////////////////////////////////////////////////
1276// FIXME understand async; where do bitmasks live?
1277// Determine bitmap type for masks below.
1278// DOCUMENT masks where uint32_t[0] is interest for equal/master
1279// while uint32_t[1] is interest for slave
1280////////////////////////////////////////////////////////////////
1281
1282struct ofp_async_get_request {
1283 uint8_t version;
1284 uint8_t type;
1285 uint16_t length;
1286 uint32_t xid;
1287 uint32_t packet_in_mask_equal_master;
1288 uint32_t packet_in_mask_slave;
1289 uint32_t port_status_mask_equal_master;
1290 uint32_t port_status_mask_slave;
1291 uint32_t flow_removed_mask_equal_master;
1292 uint32_t flow_removed_mask_slave;
1293};
1294
1295struct ofp_async_get_reply {
1296 uint8_t version;
1297 uint8_t type;
1298 uint16_t length;
1299 uint32_t xid;
1300 uint32_t packet_in_mask_equal_master;
1301 uint32_t packet_in_mask_slave;
1302 uint32_t port_status_mask_equal_master;
1303 uint32_t port_status_mask_slave;
1304 uint32_t flow_removed_mask_equal_master;
1305 uint32_t flow_removed_mask_slave;
1306};
1307
1308struct ofp_async_set {
1309 uint8_t version;
1310 uint8_t type;
1311 uint16_t length;
1312 uint32_t xid;
1313 uint32_t packet_in_mask_equal_master;
1314 uint32_t packet_in_mask_slave;
1315 uint32_t port_status_mask_equal_master;
1316 uint32_t port_status_mask_slave;
1317 uint32_t flow_removed_mask_equal_master;
1318 uint32_t flow_removed_mask_slave;
1319};