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