Fix BUG 4281
[openflowjava.git] / openflow-protocol-api / src / main / yang / openflow-types.yang
1 /*
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9  module openflow-types {
10     namespace "urn:opendaylight:openflow:common:types";
11     prefix "oft";
12
13     revision "2013-07-31" {
14         description "#NOT_PUBLISHED# OpenFlow 1.3 - common types model";
15     }
16
17     typedef port-number {
18         description "Port numbering. Ports are numbered starting from 1 -
19          supports special / reserved values (in OF v1.3)";
20         type uint32;
21     }
22
23     typedef port-number-values {
24         description "Reserved OpenFlow Port (fake output \"ports\") (OF v1.3).";
25         type enumeration {
26             enum MAX {
27                 description "Maximum number of physical and logical switch ports.";
28                 value -256; // 0xffffff00
29             }
30             enum IN_PORT {
31                 description "Send the packet out the input port. This
32                             reserved port must be explicitly used
33                             in order to send back out of the input
34                             port.";
35                 value -8; // 0xfffffff8
36             }
37             enum TABLE {
38                 description "Submit the packet to the first flow table
39                             NB: This destination port can only be
40                             used in packet-out messages.";
41                 value -7; // 0xfffffff9
42             }
43             enum NORMAL {
44                 description "Process with normal L2/L3 switching.";
45                 value -6; // 0xfffffffa
46             }
47             enum FLOOD {
48                 description "All physical ports in VLAN, except input
49                             port and those blocked or link down.";
50                 value -5; // 0xfffffffb
51             }
52             enum ALL {
53                 description "All physical ports except input port.";
54                 value -4; // 0xfffffffc
55             }
56             enum CONTROLLER {
57                 description "Send to controller.";
58                 value -3; // 0xfffffffd
59             }
60             enum LOCAL {
61                 description "Local openflow \"port\".";
62                 value -2; // 0xfffffffe
63             }
64             enum ANY {
65                 description "Wildcard port used only for flow mod
66                             (delete) and flow stats requests. Selects
67                             all flows regardless of output port
68                             (including flows with no output port).";
69                 value -1; // 0xffffffff
70             }
71         }
72     }
73
74     typedef port-features {
75         description "Features of ports available in datapath.";
76         type bits {
77             bit _10mb_hd {
78                 position 0;
79                 description "10 Mb half-duplex rate support.";
80             }
81             bit _10mb-fd {
82                 position 1;
83                 description "10 Mb full-duplex rate support.";
84             }
85             bit _100mb-hd {
86                 position 2;
87                 description "100 Mb half-duplex rate support.";
88             }
89             bit _100mb-fd {
90                 position 3;
91                 description "100 Mb full-duplex rate support.";
92             }
93             bit _1gb-hd {
94                 position 4;
95                 description "1 Gb half-duplex rate support.";
96             }
97             bit _1gb-fd {
98                 position 5;
99                 description "1 Gb full-duplex rate support.";
100             }
101             bit _10gb-fd {
102                 position 6;
103                 description "10 Gb full-duplex rate support.";
104             }
105             bit _40gb-fd {
106                 position 7;
107                 description "40 Gb full-duplex rate support.";
108             }
109             bit _100gb-fd {
110                 position 8;
111                 description "100 Gb full-duplex rate support.";
112             }
113             bit _1tb-fd {
114                 position 9;
115                 description "1 Tb full-duplex rate support.";
116             }
117             bit other {
118                 position 10;
119                 description "Other rate, not in the list.";
120             }
121             bit copper {
122                 position 11;
123                 description "Copper medium.";
124             }
125             bit fiber {
126                 position 12;
127                 description "Fiber medium.";
128             }
129             bit autoneg {
130                 position 13;
131                 description "Auto-negotiation.";
132             }
133             bit pause {
134                 position 14;
135                 description "Pause.";
136             }
137             bit pause-asym {
138                 position 15;
139                 description "Asymmetric pause.";
140             }
141         }
142     }
143
144     typedef port-config {
145         description
146            "Flags to indicate behavior of the physical port. These flags are
147             describe the current configuration and used port_mod message
148             to configure the port's behavior.";
149         type bits {
150             bit port-down {
151                 //description " Port is administratively down.";
152                 position 0;
153             }
154             bit no-recv {
155                 //description " Drop all packets received by port.";
156                 position 2;
157             }
158             bit no-fwd {
159                 //description " Drop packets forwarded to port.";
160                 position 5;
161             }
162             bit no-packet-in {
163                 //description "Do not send packet-in msgs for port.";
164                 position 6;
165             }
166         }
167     }
168
169     typedef port-state {
170         description
171             "Current state of the physical port. These are not configurable from
172             the controller.";
173         type bits {
174             bit link_down {
175                 //description "No physical link present.";
176                 position 0;
177             }
178             bit blocked {
179                 //description "Port is blocked";
180                 position 1;
181             }
182             bit live {
183                 //description "Live for Fast Failover Group.";
184                 position 2;
185             }
186         }
187     }
188
189     identity match-type-base {
190         description
191            "The match type indicates the match structure (set of fields that compose the
192             match) in use. The match type is placed in the type field at the beginning
193             of all match structures.Extensions that define match types may be
194             published on the ONF wiki. Support for extensions is optional.";
195     }
196
197     identity standard-match-type {
198         base oft:match-type-base;
199     }
200
201     identity instruction-base {
202         description "Base identity for instruction types";
203     }
204
205     identity action-base {
206         description "Base identity for action types";
207     }
208
209     typedef metadata {
210         type binary;
211     }
212
213     typedef table-id {
214         type uint32;
215     }
216     typedef meter-id {
217         type uint32;
218     }
219     typedef queue-id {
220         type uint32;
221     }
222     typedef group-id {
223         type uint32;
224     }
225
226     typedef ether-type {
227         type uint16;
228     }
229     typedef experimenter-id {
230         description "This type represents experimenter ID used in experimenter messages.
231                      It also represents vendor ID - as it is the same for OF version 1.3+.
232                      (VENDOR naming convention has been changed in OF v1.3 specification
233                       to EXPERIMENTER)";
234         type uint32;
235     }
236     typedef error-type {
237         type enumeration {
238             enum HELLO_FAILED {
239                 value 0;
240                 description "Hello Protocol failed.";
241             }
242             enum BAD_REQUEST {
243                 value 1;
244                 description "Request was not understood.";
245             }
246             enum BAD_ACTION {
247                 value 2;
248                 description "Error in action description.";
249             }
250             enum BAD_INSTRUCTION {
251                 value 3;
252                 description "Error in instruction list.";
253             }
254             enum BAD_MATCH {
255                 value 4;
256                 description "Error in match.";
257             }
258             enum FLOW_MOD_FAILED {
259                 value 5;
260                 description "Problem modifying flow entry.";
261             }
262             enum GROUP_MOD_FAILED {
263                 value 6;
264                 description "Problem modifying group entry.";
265             }
266             enum PORT_MOD_FAILED {
267                 value 7;
268                 description "Port mod request failed.";
269             }
270             enum TABLE_MOD_FAILED {
271                 value 8;
272                 description "Table mod request failed.";
273             }
274             enum QUEUE_OP_FAILED {
275                 value 9;
276                 description "Queue operation failed.";
277             }
278             enum SWITCH_CONFIG_FAILED {
279                 value 10;
280                 description "Switch config request failed.";
281             }
282             enum ROLE_REQUEST_FAILED {
283                 value 11;
284                 description "Controller Role request failed.";
285             }
286             enum METER_MOD_FAILED {
287                 value 12;
288                 description "Error in meter.";
289             }
290             enum TABLE_FEATURES_FAILED {
291                 value 13;
292                 description "Setting table features failed.";
293             }
294             enum EXPERIMENTER {
295                 value 65535; //0xffff
296                 description "Experimenter error messages.";
297             }
298         }
299     }
300
301     typedef hello-failed-code {
302         type enumeration {
303             enum INCOMPATIBLE {
304                 value 0;
305                 description "Hello Protocol failed.";
306             }
307             enum EPERM {
308                 value 1;
309                 description "Request was not understood.";
310             }
311         }
312     }
313
314     typedef bad-request-code {
315         type enumeration {
316             enum BAD_VERSION {
317                 value 0;
318             }
319             enum BAD_TYPE {
320                 value 1;
321             }
322             enum BAD_MULTIPART {
323                 value 2;
324             }
325             enum BAD_EXPERIMENTER {
326                 value 3;
327             }
328             enum BAD_EXP_TYPE {
329                 value 4;
330             }
331             enum EPERM {
332                 value 5;
333             }
334             enum BAD_LEN {
335                 value 6;
336             }
337             enum BUFFER_EMPTY {
338                 value 7;
339             }
340             enum BUFFER_UNKNOWN {
341                 value 8;
342             }
343             enum BAD_TABLE_ID {
344                 value 9;
345             }
346             enum IS_SLAVE {
347                 value 10;
348             }
349             enum BAD_PORT {
350                 value 11;
351             }
352             enum BAD_PACKET {
353                 value 12;
354             }
355             enum MULTIPART_BUFFER_OVERFLOW {
356                 value 13;
357             }
358         }
359     }
360
361     typedef bad-action-code {
362         type enumeration {
363             enum BAD_TYPE {
364                 value 0;
365             }
366             enum BAD_LEN {
367                 value 1;
368             }
369             enum BAD_EXPERIMENTER {
370                 value 2;
371             }
372             enum BAD_EXP_TYPE {
373                 value 3;
374             }
375             enum BAD_OUT_PORT {
376                 value 4;
377             }
378             enum BAD_ARGUMENT {
379                 value 5;
380             }
381             enum EPERM {
382                 value 6;
383             }
384             enum TOO_MANY {
385                 value 7;
386             }
387             enum BAD_QUEUE {
388                 value 8;
389             }
390             enum BAD_OUT_GROUP {
391                 value 9;
392             }
393             enum MATCH_INCONSISTENT {
394                 value 10;
395             }
396             enum UNSUPPORTED_ORDER {
397                 value 11;
398             }
399             enum BAD_TAG {
400                 value 12;
401             }
402             enum BAD_SET_TYPE {
403                 value 13;
404             }
405             enum BAD_SET_LEN {
406                 value 14;
407             }
408             enum BAD_SET_ARGUMENT {
409                 value 15;
410             }
411         }
412     }
413
414     typedef bad-instruction-code {
415         type enumeration {
416             enum UNKNOWN_INST {
417                 value 0;
418             }
419             enum UNSUP_INST {
420                 value 1;
421             }
422             enum BAD_TABLE_ID {
423                 value 2;
424             }
425             enum UNSUP_METADATA {
426                 value 3;
427             }
428             enum UNSUP_METADATA_MASK {
429                 value 4;
430             }
431             enum BAD_EXPERIMENTER {
432                 value 5;
433             }
434             enum BAD_EXP_TYPE {
435                 value 6;
436             }
437             enum BAD_LEN {
438                 value 7;
439             }
440             enum EPERM {
441                 value 8;
442             }
443         }
444     }
445
446     typedef bad-match-code {
447         type enumeration {
448             enum BAD_TYPE {
449                 value 0;
450             }
451             enum BAD_LEN {
452                 value 1;
453             }
454             enum BAD_TAG {
455                 value 2;
456             }
457             enum BAD_DL_ADDR_MASK {
458                 value 3;
459             }
460             enum BAD_NW_ADDR_MASK {
461                 value 4;
462             }
463             enum BAD_WILDCARDS {
464                 value 5;
465             }
466             enum BAD_FIELD {
467                 value 6;
468             }
469             enum BAD_VALUE {
470                 value 7;
471             }
472             enum BAD_MASK {
473                 value 8;
474             }
475             enum BAD_PREREQ {
476                 value 9;
477             }
478             enum DUP_FIELD {
479                 value 10;
480             }
481             enum EPERM {
482                 value 11;
483             }
484         }
485     }
486
487     typedef flow-mod-failed-code {
488         type enumeration {
489             enum UNKNOWN {
490                 value 0;
491             }
492             enum TABLE_FULL {
493                 value 1;
494             }
495             enum BAD_TABLE_ID {
496                 value 2;
497             }
498             enum OVERLAP {
499                 value 3;
500             }
501             enum EPERM {
502                 value 4;
503             }
504             enum BAD_TIMEOUT {
505                 value 5;
506             }
507             enum BAD_COMMAND {
508                 value 6;
509             }
510             enum BAD_FLAGS {
511                 value 7;
512             }
513         }
514     }
515
516     typedef group-mod-failed-code {
517         type enumeration {
518             enum GROUP_EXISTS {
519                 value 0;
520             }
521             enum INVALID_GROUP {
522                 value 1;
523             }
524             enum WEIGHT_UNSUPPORTED {
525                 value 2;
526             }
527             enum OUT_OF_GROUPS {
528                 value 3;
529             }
530             enum OUT_OF_BUCKETS {
531                 value 4;
532             }
533             enum CHAINING_UNSUPPORTED {
534                 value 5;
535             }
536             enum WATCH_UNSUPPORTED {
537                 value 6;
538             }
539             enum LOOP {
540                 value 7;
541             }
542             enum UNKNOWN_GROUP {
543                 value 8;
544             }
545             enum CHAINED_GROUP {
546                 value 9;
547             }
548             enum BAD_TYPE {
549                 value 10;
550             }
551             enum BAD_COMMAND {
552                 value 11;
553             }
554             enum BAD_BUCKET {
555                 value 12;
556             }
557             enum BAD_WATCH {
558                 value 13;
559             }
560             enum EPERM {
561                 value 14;
562             }
563         }
564     }
565
566     typedef port-mod-failed-code {
567         type enumeration {
568             enum BAD_PORT {
569                 value 0;
570             }
571             enum BAD_HW_ADDR {
572                 value 1;
573             }
574             enum BAD_CONFIG {
575                 value 2;
576             }
577             enum BAD_ADVERTISE {
578                 value 3;
579             }
580             enum EPERM {
581                 value 4;
582             }
583         }
584     }
585
586     typedef table-mod-failed-code {
587         type enumeration {
588             enum BAD_TABLE {
589                 value 0;
590             }
591             enum BAD_CONFIG {
592                 value 1;
593             }
594             enum EPERM {
595                 value 2;
596             }
597         }
598     }
599
600     typedef queue-op-failed-code {
601         type enumeration {
602             enum BAD_PORT {
603                 value 0;
604             }
605             enum BAD_QUEUE {
606                 value 1;
607             }
608             enum EPERM {
609                 value 2;
610             }
611         }
612     }
613
614     typedef switch-config-failed-code {
615         type enumeration {
616             enum BAD_FLAGS {
617                 value 0;
618             }
619             enum BAD_LEN {
620                 value 1;
621             }
622             enum EPERM {
623                 value 2;
624             }
625         }
626     }
627
628     typedef role-request-failed-code {
629         type enumeration {
630             enum STALE {
631                 value 0;
632             }
633             enum UNSUP {
634                 value 1;
635             }
636             enum BAD_ROLE {
637                 value 2;
638             }
639         }
640     }
641
642     typedef meter-mod-failed-code {
643         type enumeration {
644             enum UNKNOWN {
645                 value 0;
646             }
647             enum METER_EXISTS {
648                 value 1;
649             }
650             enum INVALID_METER {
651                 value 2;
652             }
653             enum UNKNOWN_METER {
654                 value 3;
655             }
656             enum BAD_COMMAND {
657                 value 4;
658             }
659             enum BAD_FLAGS {
660                 value 5;
661             }
662             enum BAD_RATE {
663                 value 6;
664             }
665             enum BAD_BURST {
666                 value 7;
667             }
668             enum BAD_BAND {
669                 value 8;
670             }
671             enum BAD_BAND_VALUE {
672                 value 9;
673             }
674             enum OUT_OF_METERS {
675                 value 10;
676             }
677             enum OUT_OF_BANDS {
678                 value 11;
679             }
680         }
681     }
682
683     typedef table-features-failed-code {
684         type enumeration {
685             enum BAD_TABLE {
686                 value 0;
687             }
688             enum BAD_METADATA {
689                 value 1;
690             }
691             enum BAD_TYPE {
692                 value 2;
693             }
694             enum BAD_LEN {
695                 value 3;
696             }
697             enum BAD_ARGUMENT {
698                 value 4;
699             }
700             enum EPERM {
701                 value 5;
702             }
703         }
704     }
705
706     typedef hello-element-type {
707         type enumeration {
708             enum VERSIONBITMAP {
709                 value 1;
710                 description "Bitmap of version supported.";
711             }
712         }
713     }
714
715     typedef capabilities {
716         description "Capabilities supported by the datapath.";
717         type bits {
718             bit OFPC_FLOW_STATS {
719                 position 0;
720                 /* Flow statistics. */
721             }
722             bit OFPC_TABLE_STATS {
723                 position 1;
724                 /* Table statistics. */
725             }
726             bit OFPC_PORT_STATS {
727                 position 2;
728                 /* Port statistics. */
729             }
730             bit OFPC_GROUP_STATS {
731                 position 3;
732                 /* Group statistics. */
733             }
734             bit OFPC_IP_REASM {
735                 position 5;
736                 /* Can reassemble IP fragments. */
737             }
738             bit OFPC_QUEUE_STATS {
739                 position 6;
740                 /* Queue statistics. */
741             }
742             bit OFPC_PORT_BLOCKED {
743                 position 8;
744                 /* Switch will block looping ports. */
745             }
746         }
747     }
748
749     typedef switch-config-flag {
750         description " Handling of IP fragments. ";
751         type enumeration {
752             enum FRAG_NORMAL {
753                 value 0;
754                 description "No special handling for fragments.";
755             }
756             enum OFPC_FRAG_DROP {
757                 value 1;
758                 description "Drop fragments.";
759             }
760             enum OFPC_FRAG_REASM {
761                 value 2;
762                 description "Reassemble (only if OFPC_IP_REASM set).";
763             }
764             enum OFPC_FRAG_MASK {
765                 value 3;
766             }
767         }
768     }
769
770     typedef flow-removed-reason {
771         description "Why was this flow removed?";
772         type enumeration {
773             enum OFPRR_IDLE_TIMEOUT {
774                 value 0;
775                 description "Flow idle time exceeded idle_timeout.";
776             }
777             enum OFPRR_HARD_TIMEOUT {
778                 value 1;
779                 description "Time exceeded hard_timeout.";
780             }
781             enum OFPRR_DELETE {
782                 value 2;
783                 description "Evicted by a DELETE flow mod.";
784             }
785             enum OFPRR_GROUP_DELETE {
786                 value 3;
787                 description "Group was removed.";
788             }
789         }
790     }
791
792     typedef port-reason {
793         description "What changed about the physical port";
794         type enumeration {
795             enum OFPPR_ADD {
796                 value 0;
797                 description "The port was added.";
798             }
799             enum OFPPR_DELETE {
800                 value 1;
801                 description "he port was removed.";
802             }
803             enum OFPPR_MODIFY {
804                 value 2;
805                 description "Some attribute of the port has changed.";
806             }
807         }
808     }
809
810     typedef flow-mod-command {
811         /* ofp_flow_mod_command */
812         type enumeration {
813             enum OFPFC_ADD {
814                 value 0;
815                 description "New flow.";
816             }
817             enum OFPFC_MODIFY {
818                 value 1;
819                 description "Modify all matching flows.";
820             }
821             enum OFPFC_MODIFY_STRICT {
822                 value 2;
823                 description "Modify entry strictly matching wildcards and priority.";
824             }
825             enum OFPFC_DELETE {
826                 value 3;
827                 description "Delete all matching flows.";
828             }
829             enum OFPFC_DELETE_STRICT {
830                 value 4;
831                 description "Delete entry strictly matching wildcards and priority.";
832             }
833         }
834     }
835
836     typedef flow-mod-flags {
837         /* ofp_flow_mod_flags */
838         type bits {
839             bit OFPFF_SEND_FLOW_REM {
840                 position 0;
841                 description "Send flow removed message when flow expires or is deleted.";
842             }
843             bit OFPFF_CHECK_OVERLAP {
844                 position 1;
845                 description "Check for overlapping entries first.";
846             }
847             bit OFPFF_RESET_COUNTS {
848                 position 2;
849                 description "Reset flow packet and byte counts.";
850             }
851             bit OFPFF_NO_PKT_COUNTS {
852                 position 3;
853                 description "Don't keep track of packet count.";
854             }
855             bit OFPFF_NO_BYT_COUNTS {
856                 position 4;
857                 description "Don't keep track of byte count.";
858             }
859         }
860     }
861
862     typedef group-mod-command {
863         /* ofp_group_mod_command */
864         type enumeration {
865             enum OFPGC_ADD {
866               value 0;
867               description "New group.";
868             }
869             enum OFPGC_MODIFY {
870               value 1;
871               description "Modify all matching groups.";
872             }
873             enum OFPGC_DELETE {
874               value 2;
875               description "Delete all matching groups.";
876             }
877         }
878     }
879
880     typedef group-type {
881         /* ofp_group_type */
882         type enumeration {
883             enum OFPGT_ALL {
884               value 0;
885               description "All (multicast/broadcast) group.";
886             }
887             enum OFPGT_SELECT {
888               value 1;
889               description "Select group.";
890             }
891             enum OFPGT_INDIRECT {
892               value 2;
893               description "Indirect group.";
894             }
895             enum OFPGT_FF {
896               value 3;
897               description "Fast failover group.";
898             }
899         }
900     }
901
902     typedef table-values {
903         /* ofp_table */
904         type enumeration {
905             enum OFPTT_MAX {
906               value 254; // 0xfe
907               description "Last usable table number.";
908             }
909             enum OFPTT_ALL {
910               value 255; // 0xff
911               description "Wildcard table used for table config,
912                            flow stats and flow deletes.";
913             }
914         }
915     }
916
917     typedef group {
918         /* ofp_group - Group numbering. Groups can use any number up to OFPG_MAX.*/
919         type enumeration {
920             enum OFPG_MAX {
921                 value -256; //0xffffff00
922                 description "Last usable group number";
923             }
924             /* Fake groups. */
925             enum OFPG_ALL {
926                 value -4; //0xfffffffc
927                 description "Represents all groups for group delete commands";
928             }
929             enum OFPG_ANY {
930                 value -1; //0xffffffff
931                 description "Wildcard group used only for flow stats requests.
932                             Selects all flows regardless of group (including flows with no group)";
933             }
934         }
935     }
936
937     typedef multipart-request-flags {
938         description "enum ofp_multipart_request_flags ";
939         type bits {
940             bit OFPMPF_REQ_MORE {
941                 description "More requests to follow.";
942                 position 0;
943             }
944         }
945     }
946
947     typedef multipart-type {
948         type enumeration {
949             enum OFPMP_DESC {
950               value 0;
951               description "Description of this OpenFlow switch.
952                  The request body is empty.
953                  The reply body is struct ofp_desc.";
954             }
955             enum OFPMP_FLOW {
956               value 1;
957               description "Individual flow statistics.
958                  The request body is struct ofp_flow_stats_request.
959                  The reply body is an array of struct ofp_flow_stats.";
960             }
961             enum OFPMP_AGGREGATE {
962               value 2;
963               description "Aggregate flow statistics.
964                  The request body is struct ofp_aggregate_stats_request.
965                  The reply body is struct ofp_aggregate_stats_reply.";
966             }
967             enum OFPMP_TABLE {
968               value 3;
969               description "Flow table statistics.
970                  The request body is empty.
971                  The reply body is an array of struct ofp_table_stats.";
972             }
973             enum OFPMP_PORT_STATS {
974               value 4;
975               description "Port statistics.
976                  The request body is struct ofp_port_stats_request.
977                  The reply body is an array of struct ofp_port_stats.";
978             }
979             enum OFPMP_QUEUE {
980               value 5;
981               description "Queue statistics for a port
982                  The request body is struct ofp_queue_stats_request.
983                  The reply body is an array of struct ofp_queue_stats";
984             }
985             enum OFPMP_GROUP {
986               value 6;
987               description "Group counter statistics.
988                  The request body is struct ofp_group_stats_request.
989                  The reply is an array of struct ofp_group_stats.";
990             }
991             enum OFPMP_GROUP_DESC {
992               value 7;
993               description "Group description.
994                  The request body is empty.
995                  The reply body is an array of struct ofp_group_desc.";
996             }
997             enum OFPMP_GROUP_FEATURES {
998               value 8;
999               description "Group features.
1000                  The request body is empty.
1001                  The reply body is struct ofp_group_features.";
1002             }
1003             enum OFPMP_METER {
1004               value 9;
1005               description "Meter statistics.
1006                  The request body is struct ofp_meter_multipart_requests.
1007                  The reply body is an array of struct ofp_meter_stats.";
1008             }
1009             enum OFPMP_METER_CONFIG {
1010               value 10;
1011               description "Meter configuration.
1012                  The request body is struct ofp_meter_multipart_requests.
1013                  The reply body is an array of struct ofp_meter_config.";
1014             }
1015             enum OFPMP_METER_FEATURES {
1016               value 11;
1017               description "Meter features.
1018                  The request body is empty.
1019                  The reply body is struct ofp_meter_features.";
1020             }
1021             enum OFPMP_TABLE_FEATURES {
1022               value 12;
1023               description "Table features.
1024                  The request body is either empty or contains an array of
1025                  struct ofp_table_features containing the controller’s
1026                  desired view of the switch. If the switch is unable to
1027                  set the specified view an error is returned.
1028                  The reply body is an array of struct ofp_table_features.";
1029             }
1030             enum OFPMP_PORT_DESC {
1031               value 13;
1032               description "Port description.
1033                  The request body is empty.
1034                  The reply body is an array of struct ofp_port.";
1035             }
1036             enum OFPMP_EXPERIMENTER {
1037               value 65535; //0xffff
1038               description "Experimenter extension.
1039                  The request and reply bodies begin with
1040                  struct ofp_experimenter_multipart_header.
1041                  The request and reply bodies are otherwise experimenter-defined.";
1042             }
1043         }
1044     }
1045
1046     typedef queue-properties {
1047         /* ofp_queue_properties */
1048         type enumeration {
1049             enum OFPQT_NONE {
1050               value 0;
1051               description "No property defined for queue (default).";
1052             }
1053             enum OFPQT_MIN_RATE {
1054                 value 1;
1055                 description "Minimum datarate guaranteed.";
1056             }
1057             enum OFPQT_MAX_RATE {
1058                 value 2;
1059                 description "Maximum datarate.";
1060             }
1061             enum OFPQT_EXPERIMENTER {
1062                 value 65535; // 0xffff
1063                 description "Experimenter defined property.";
1064             }
1065         }
1066     }
1067
1068     typedef controller-role {
1069         /* ofp_controller_role */
1070         type enumeration {
1071             enum OFPCR_ROLE_NOCHANGE {
1072               value 0;
1073               description "Don’t change current role.";
1074             }
1075             enum OFPCR_ROLE_EQUAL {
1076               value 1;
1077               description "Default role, full access.";
1078             }
1079             enum OFPCR_ROLE_MASTER {
1080               value 2;
1081               description "Full access, at most one master.";
1082             }
1083             enum OFPCR_ROLE_SLAVE {
1084               value 3;
1085               description "Read-only access.";
1086             }
1087         }
1088     }
1089
1090     typedef packet-in-reason {
1091         /* ofp_packet_in_reason */
1092         type enumeration {
1093             enum OFPR_NO_MATCH {
1094               value 0;
1095               description "No matching flow (table-miss flow entry). ";
1096             }
1097             enum OFPR_ACTION {
1098               value 1;
1099               description "Action explicitly output to controller. ";
1100             }
1101             enum OFPR_INVALID_TTL {
1102               value 2;
1103               description "Packet has invalid TTL ";
1104             }
1105         }
1106     }
1107
1108     typedef action-type {
1109         /* ofp_action_type */
1110         type bits {
1111             bit OFPAT_OUTPUT {
1112                 position 0;
1113                 /* Output to switch port. */
1114             }
1115             bit OFPAT_COPY_TTL_OUT {
1116                 position 1;
1117                 /* Copy TTL "outwards" -- from next-to-outermost to outermost */
1118             }
1119             bit OFPAT_COPY_TTL_IN {
1120                 position 2;
1121                 /* Copy TTL "inwards" -- from outermost to next-to-outermost */
1122             }
1123             bit OFPAT_SET_MPLS_TTL {
1124                 position 3;
1125                 /* MPLS TTL */
1126             }
1127             bit OFPAT_DEC_MPLS_TTL {
1128                 position 4;
1129                 /* Decrement MPLS TTL */
1130             }
1131             bit OFPAT_PUSH_VLAN {
1132                 position 5;
1133                 /* Push a new VLAN tag */
1134             }
1135             bit OFPAT_POP_VLAN {
1136                 position 6;
1137                 /* Pop the outer VLAN tag */
1138             }
1139             bit OFPAT_PUSH_MPLS {
1140                 position 7;
1141                 /* Push a new MPLS tag */
1142             }
1143             bit OFPAT_POP_MPLS {
1144                 position 8;
1145                 /* Pop the outer MPLS tag */
1146             }
1147             bit OFPAT_SET_QUEUE {
1148                 position 9;
1149                 /* Set queue id when outputting to a port */
1150             }
1151             bit OFPAT_GROUP {
1152                 position 10;
1153                 /* Apply group. */
1154             }
1155             bit OFPAT_SET_NW_TTL {
1156                 position 11;
1157                 /* IP TTL. */
1158             }
1159             bit OFPAT_DEC_NW_TTL {
1160                 position 12;
1161                 /* Decrement IP TTL. */
1162             }
1163             bit OFPAT_SET_FIELD {
1164                 position 13;
1165                 /* Set a header field using OXM TLV format. */
1166             }
1167             bit OFPAT_PUSH_PBB {
1168                 position 14;
1169                 /* Push a new PBB service tag (I-TAG) */
1170             }
1171             bit OFPAT_POP_PBB {
1172                 position 15;
1173                 /* Pop the outer PBB service tag (I-TAG) */
1174             }
1175             bit OFPAT_EXPERIMENTER {
1176                 position 16;
1177             }
1178         }
1179     }
1180
1181     typedef meter-mod-command {
1182         /* ofp_meter_mod_command */
1183         type enumeration {
1184             enum OFPMC_ADD {
1185               description "New meter. ";
1186             }
1187             enum OFPMC_MODIFY {
1188               description "Modify specified meter. ";
1189             }
1190             enum OFPMC_DELETE {
1191               description "Delete specified meter. ";
1192             }
1193         }
1194     }
1195
1196     typedef meter-flags {
1197         /* ofp_meter_flags */
1198         type bits {
1199             bit OFPMF_KBPS {
1200                 position 0;
1201                 /* Rate value in kb/s (kilo-bit per second). */
1202             }
1203             bit OFPMF_PKTPS {
1204                 position 1;
1205                 /* Rate value in packet/sec. */
1206             }
1207             bit OFPMF_BURST {
1208                 position 2;
1209                 /* Do burst size. */
1210             }
1211             bit OFPMF_STATS {
1212                 position 3;
1213                 /* Collect statistics. */
1214             }
1215         }
1216     }
1217
1218     typedef meter-band-type {
1219         /* ofp_meter_band_type */
1220         type enumeration {
1221             enum OFPMBT_DROP {
1222               value 1;
1223               description "Drop packet. ";
1224             }
1225             enum OFPMBT_DSCP_REMARK {
1226               value 2;
1227               description "Remark DSCP in the IP header. ";
1228             }
1229             enum OFPMBT_EXPERIMENTER {
1230               value 65535; //0xFFFF
1231               description "Experimenter meter band. ";
1232             }
1233         }
1234     }
1235
1236     typedef meter-band-type-bitmap {
1237         /* ofp_meter_band_type */
1238         type bits {
1239             bit OFPMBT_DROP {
1240               position 1;
1241               description "Drop packet. ";
1242             }
1243             bit OFPMBT_DSCP_REMARK {
1244               position 2;
1245               description "Remark DSCP in the IP header. ";
1246             }
1247         }
1248     }
1249
1250     typedef meter {
1251         description "Meter numbering. Flow meters can use any number up to OFPM_MAX";
1252         type enumeration {
1253             enum OFPM_MAX {
1254                 value -65536; //0xffff0000
1255                 description "Last usable meter number";
1256             }
1257             /* Virtual meters. */
1258             enum OFPM_SLOWPATH {
1259                 value -3; //0xfffffffd
1260                 description "Meter for slow datapath";
1261             }
1262             enum OFPM_CONTROLLER {
1263                 value -2; //0xfffffffe
1264                 description "Meter for controller connection";
1265             }
1266             enum OFPM_ALL {
1267                 value -1; //0xffffffff
1268                 description "Represents all meters for stat requests commands";
1269             }
1270         }
1271     }
1272
1273     typedef table-config {
1274         /* ofp_table_config */
1275         type bits {
1276             bit OFPTC_DEPRECATED_MASK {
1277                 /* Deprecated bits */
1278                 position 3;
1279             }
1280         }
1281     }
1282
1283     typedef table-features-prop-type {
1284         type enumeration {
1285             enum OFPTFPT_INSTRUCTIONS {
1286                 value 0;
1287                 description "Instructions property.";
1288             }
1289             enum OFPTFPT_INSTRUCTIONS_MISS {
1290                 value 1;
1291                 description "Instructions for table-miss.";
1292             }
1293             enum OFPTFPT_NEXT_TABLES {
1294                 value 2;
1295                 description "Next Table property.";
1296             }
1297             enum OFPTFPT_NEXT_TABLES_MISS {
1298                 value 3;
1299                 description "Next Table for table-miss.";
1300             }
1301             enum OFPTFPT_WRITE_ACTIONS {
1302                 value 4;
1303                 description "Write Actions property.";
1304             }
1305             enum OFPTFPT_WRITE_ACTIONS_MISS {
1306                 value 5;
1307                 description "Write Actions for table-miss.";
1308             }
1309             enum OFPTFPT_APPLY_ACTIONS {
1310                 value 6;
1311                 description "Apply Actions property.";
1312             }
1313             enum OFPTFPT_APPLY_ACTIONS_MISS {
1314                 value 7;
1315                 description "Apply Actions for table-miss.";
1316             }
1317             enum OFPTFPT_MATCH {
1318                 value 8;
1319                 description "Match property.";
1320             }
1321             enum OFPTFPT_WILDCARDS {
1322                 value 10;
1323                 description "Wildcards property.";
1324             }
1325             enum OFPTFPT_WRITE_SETFIELD {
1326                 value 12;
1327                 description "Write Set-Field property.";
1328             }
1329             enum OFPTFPT_WRITE_SETFIELD_MISS {
1330                 value 13;
1331                 description "Write Set-Field for table-miss.";
1332             }
1333             enum OFPTFPT_APPLY_SETFIELD {
1334                 value 14;
1335                 description "Apply Set-Field property.";
1336             }
1337             enum OFPTFPT_APPLY_SETFIELD_MISS {
1338                 value 15;
1339                 description "Apply Set-Field for table-miss.";
1340             }
1341             enum OFPTFPT_EXPERIMENTER {
1342                 value 65534;
1343                 description "Experimenter property.";
1344             }
1345             enum OFPTFPT_EXPERIMENTER_MISS {
1346                 value 65535; //0xffff
1347                 description "Experimenter for table-miss.";
1348             }
1349         }
1350     }
1351
1352     typedef group-types {
1353         /* ofp_group_type */
1354         type bits {
1355             bit OFPGT_ALL {
1356                 description "All (multicast/broadcast) group.";
1357                 position 0;
1358             }
1359             bit OFPGT_SELECT {
1360                 description "Select group.";
1361                 position 1;
1362             }
1363             bit OFPGT_INDIRECT {
1364                 description "Indirect group.";
1365                 position 2;
1366             }
1367             bit OFPGT_FF {
1368                 description "Fast failover group.";
1369                 position 3;
1370             }
1371         }
1372     }
1373
1374     typedef group-capabilities {
1375         /* ofp_group_capabilities */
1376         type bits {
1377             bit OFPGFC_SELECT_WEIGHT {
1378                 description "Support weight for select groups";
1379                 position 0;
1380             }
1381             bit OFPGFC_SELECT_LIVENESS {
1382                 description "Support liveness for select groups";
1383                 position 1;
1384             }
1385             bit OFPGFC_CHAINING {
1386                 description "Support chaining group";
1387                 position 2;
1388             }
1389             bit OFPGFC_CHAINING_CHECKS {
1390                 description "Check chaining for loops and delete";
1391                 position 3;
1392             }
1393         }
1394     }
1395
1396     typedef ipv6-exthdr-flags {
1397         description "Bit definitions for IPv6 Extension Header pseudo-field.";
1398         type bits {
1399             bit nonext {
1400                 description "<No next header> encountered.";
1401                 position 0;
1402             }
1403             bit esp {
1404                 description "Encrypted Sec Payload header present.";
1405                 position 1;
1406             }
1407             bit auth {
1408                 description "Authentication header present.";
1409                 position 2;
1410             }
1411             bit dest {
1412                 description "1 or 2 dest headers present.";
1413                 position 3;
1414             }
1415             bit frag {
1416                 description "Fragment header present.";
1417                 position 4;
1418             }
1419             bit router {
1420                 description "Router header present.";
1421                 position 5;
1422             }
1423             bit hop {
1424                 description "Hop-by-hop header present.";
1425                 position 6;
1426             }
1427             bit unrep {
1428                 description "Unexpected repeats encountered.";
1429                 position 7;
1430             }
1431             bit unseq {
1432                 description "Unexpected sequencing encountered.";
1433                 position 8;
1434             }
1435         }
1436     }
1437
1438 // OPENFLOW v1.0 STRUCTURES
1439     // Structures under this line are needed to support OpenFlow version 1.0
1440     // wire protocol 0x01;
1441
1442     typedef error-type-v10 {
1443         type enumeration {
1444             enum HELLO_FAILED {
1445                 value 0;
1446                 description "Hello Protocol failed.";
1447             }
1448             enum BAD_REQUEST {
1449                 value 1;
1450                 description "Request was not understood.";
1451             }
1452             enum BAD_ACTION {
1453                 value 2;
1454                 description "Error in action description.";
1455             }
1456             enum FLOW_MOD_FAILED {
1457                 value 3;
1458                 description "Problem modifying flow entry.";
1459             }
1460             enum PORT_MOD_FAILED {
1461                 value 4;
1462                 description "Port mod request failed.";
1463             }
1464             enum QUEUE_OP_FAILED {
1465                 value 5;
1466                 description "Queue operation failed.";
1467             }
1468         }
1469     }
1470
1471     typedef hello-failed-code-v10 {
1472         type enumeration {
1473             enum INCOMPATIBLE {
1474                 value 0;
1475                 description "Hello Protocol failed.";
1476             }
1477             enum EPERM {
1478                 value 1;
1479                 description "Request was not understood.";
1480             }
1481         }
1482     }
1483
1484     typedef bad-request-code-v10 {
1485         type enumeration {
1486             enum BAD_VERSION {
1487                 value 0;
1488             }
1489             enum BAD_TYPE {
1490                 value 1;
1491             }
1492             enum BAD_STAT {
1493                 value 2;
1494             }
1495             enum BAD_VENDOR {
1496                 value 3;
1497             }
1498             enum BAD_SUBTYPE {
1499                 value 4;
1500             }
1501             enum EPERM {
1502                 value 5;
1503             }
1504             enum BAD_LEN {
1505                 value 6;
1506             }
1507             enum BUFFER_EMPTY {
1508                 value 7;
1509             }
1510             enum BUFFER_UNKNOWN {
1511                 value 8;
1512             }
1513         }
1514     }
1515
1516     typedef bad-action-code-v10 {
1517         type enumeration {
1518             enum BAD_TYPE {
1519                 value 0;
1520             }
1521             enum BAD_LEN {
1522                 value 1;
1523             }
1524             enum VENDOR {
1525                 value 2;
1526             }
1527             enum BAD_VENDOR_TYPE {
1528                 value 3;
1529             }
1530             enum BAD_OUT_PORT {
1531                 value 4;
1532             }
1533             enum BAD_ARGUMENT {
1534                 value 5;
1535             }
1536             enum EPERM {
1537                 value 6;
1538             }
1539             enum TOO_MANY {
1540                 value 7;
1541             }
1542             enum BAD_QUEUE {
1543                 value 8;
1544             }
1545         }
1546     }
1547
1548     typedef flow-mod-failed-code-v10 {
1549         type enumeration {
1550             enum ALL_TABLES_FULL {
1551                 value 0;
1552             }
1553             enum OVERLAP {
1554                 value 1;
1555             }
1556             enum EPERM {
1557                 value 2;
1558             }
1559             enum BAD_EMERG_TIMEOUT {
1560                 value 3;
1561             }
1562             enum BAD_COMMAND {
1563                 value 4;
1564             }
1565             enum UNSUPPORTED {
1566                 value 5;
1567             }
1568         }
1569     }
1570
1571     typedef port-mod-failed-code-v10 {
1572         type enumeration {
1573             enum BAD_PORT {
1574                 value 0;
1575             }
1576             enum BAD_HW_ADDR {
1577                 value 1;
1578             }
1579         }
1580     }
1581
1582     typedef queue-op-failed-code-v10 {
1583         type enumeration {
1584             enum BAD_PORT {
1585                 value 0;
1586             }
1587             enum BAD_QUEUE {
1588                 value 1;
1589             }
1590             enum EPERM {
1591                 value 2;
1592             }
1593         }
1594     }
1595
1596     typedef port-number-values-v10 {
1597         description "Port numbering. Physical ports are numbered starting from 1.";
1598         type enumeration {
1599             enum MAX {
1600                 value 65280; // 0xff00
1601             }
1602             enum IN_PORT {
1603                 description "Send the packet out the input port. This
1604                             virtual port must be explicitly used
1605                             in order to send back out of the input
1606                             port.";
1607                 value 65528; // 0xfff8
1608             }
1609             enum TABLE {
1610                 description "Perform actions in flow table.
1611                             NB: This can only be the destination
1612                             port for packet-out messages.";
1613                 value 65529; // 0xfff9
1614             }
1615             enum NORMAL {
1616                 description "Process with normal L2/L3 switching.";
1617                 value 65530; // 0xfffa
1618             }
1619             enum FLOOD {
1620                 description "All physical ports except input port and
1621                             those disabled by STP.";
1622                 value 65531; // 0xfffb
1623             }
1624             enum ALL {
1625                 description "All physical ports except input port.";
1626                 value 65532; // 0xfffc
1627             }
1628             enum CONTROLLER {
1629                 description "Send to controller.";
1630                 value 65533; // 0xfffd
1631             }
1632             enum LOCAL {
1633                 description "Local openflow \"port\".";
1634                 value 65534; // 0xfffe
1635             }
1636             enum NONE {
1637                 description "Not associated with a physical port.";
1638                 value 65535; // 0xffff
1639             }
1640         }
1641     }
1642
1643     typedef port-config-v10 {
1644         description
1645            "Flags to indicate behavior of the physical port. These flags are
1646             describe the current configuration and used port_mod message
1647             to configure the port's behavior.";
1648         type bits {
1649             bit port-down {
1650                 description " Port is administratively down.";
1651                 position 0;
1652             }
1653             bit no-stp {
1654                 description "Disable 802.1D spanning tree on port.";
1655                 position 1;
1656             }
1657             bit no-recv {
1658                 description " Drop all packets received by port.";
1659                 position 2;
1660             }
1661             bit no-recv-stp {
1662                 description " Drop received 802.1D STP packets.";
1663                 position 3;
1664             }
1665             bit no-flood {
1666                 description " Do not include this port when flooding.";
1667                 position 4;
1668             }
1669             bit no-fwd {
1670                 description " Drop packets forwarded to port.";
1671                 position 5;
1672             }
1673             bit no-packet-in {
1674                 description "Do not send packet-in msgs for port.";
1675                 position 6;
1676             }
1677         }
1678     }
1679
1680     typedef port-state-v10 {
1681         description "Current state of the physical port. These are not configurable from
1682                     the controller.";
1683         type bits {
1684             bit link_down {
1685                 description "No physical link present.";
1686                 position 0;
1687             }
1688             bit blocked {
1689                 description "Port is blocked";
1690                 position 1;
1691             }
1692             bit live {
1693                 description "Live for Fast Failover Group.";
1694                 position 2;
1695             }
1696             bit stp_listen {
1697                 description "Not learning or relaying frames.";
1698             }
1699             bit stp_learn {
1700                 description "Learning but not relaying frames.";
1701             }
1702             bit stp_forward {
1703                 description "Learning and relaying frames.";
1704             }
1705             bit stp_block {
1706                 description "Not part of spanning tree.";
1707             }
1708             bit stp_mask {
1709                 description "Bit mask for OFPPS_STP_* values.";
1710             }
1711         }
1712     }
1713
1714     typedef port-features-v10 {
1715         description "Features of ports available in datapath.";
1716         reference "ofp_port_features";
1717         type bits {
1718             bit _10mb-hd {
1719                 position 0;
1720                 description "10 Mb half-duplex rate support.";
1721             }
1722             bit _10mb-fd {
1723                 position 1;
1724                 description "10 Mb full-duplex rate support.";
1725             }
1726             bit _100mb-hd {
1727                 position 2;
1728                 description "100 Mb half-duplex rate support.";
1729             }
1730             bit _100mb-fd {
1731                 position 3;
1732                 description "100 Mb full-duplex rate support.";
1733             }
1734             bit _1gb-hd {
1735                 position 4;
1736                 description "1 Gb half-duplex rate support.";
1737             }
1738             bit _1gb-fd {
1739                 position 5;
1740                 description "1 Gb full-duplex rate support.";
1741             }
1742             bit _10gb-fd {
1743                 position 6;
1744                 description "10 Gb full-duplex rate support.";
1745             }
1746             bit copper {
1747                 position 7;
1748                 description "Copper medium.";
1749             }
1750             bit fiber {
1751                 position 8;
1752                 description "Fiber medium.";
1753             }
1754             bit autoneg {
1755                 position 9;
1756                 description "Auto-negotiation.";
1757             }
1758             bit pause {
1759                 position 10;
1760                 description "Pause.";
1761             }
1762             bit pause-asym {
1763                 position 11;
1764                 description "Asymmetric pause.";
1765             }
1766         }
1767     }
1768
1769     typedef capabilities-v10 {
1770         type bits {
1771             bit OFPC_FLOW_STATS {
1772                 position 0;
1773                 description "Flow statistics.";
1774             }
1775             bit OFPC_TABLE_STATS {
1776                 position 1;
1777                 description "Table statistics.";
1778             }
1779             bit OFPC_PORT_STATS {
1780                 position 2;
1781                 description "Port statistics.";
1782             }
1783             bit OFPC_STP {
1784                 position 3;
1785                 description "802.1d spanning tree.";
1786             }
1787             bit OFPC_RESERVED {
1788                 position 4;
1789                 description "Reserved, must be zero.";
1790             }
1791             bit OFPC_IP_REASM {
1792                 position 5;
1793                 description "Can reassemble IP fragments.";
1794             }
1795             bit OFPC_QUEUE_STATS {
1796                 position 6;
1797                 description "Queue statistics.";
1798             }
1799             bit OFPC_ARP_MATCH_IP {
1800                 position 8;
1801                 description "Match IP addresses in ARP pkts.";
1802             }
1803         }
1804     }
1805
1806     typedef flow-mod-flags-v10 {
1807         /* ofp_flow_mod_flags */
1808         type bits {
1809             bit OFPFF_SEND_FLOW_REM {
1810                 position 0;
1811                 description "Send flow removed message when flow expires or is deleted.";
1812             }
1813             bit OFPFF_CHECK_OVERLAP {
1814                 position 1;
1815                 description "Check for overlapping entries first.";
1816             }
1817             bit OFPFF_EMERG {
1818                 position 2;
1819                 description "Reset flow packet and byte counts.";
1820             }
1821         }
1822     }
1823
1824     typedef action-type-v10 {
1825         /* ofp_action_type */
1826         type bits {
1827             bit OFPAT_OUTPUT {
1828                 position 0;
1829                 description "Output to switch port.";
1830             }
1831             bit OFPAT_SET_VLAN_VID {
1832                 position 1;
1833                 description "Set the 802.1q VLAN id.";
1834             }
1835             bit OFPAT_SET_VLAN_PCP {
1836                 position 2;
1837                 description "Set the 802.1q priority.";
1838             }
1839             bit OFPAT_STRIP_VLAN {
1840                 position 3;
1841                 description "Strip the 802.1q header.";
1842             }
1843             bit OFPAT_SET_DL_SRC {
1844                 position 4;
1845                 description "Ethernet source address.";
1846             }
1847             bit OFPAT_SET_DL_DST {
1848                 position 5;
1849                 description "Ethernet destination address.";
1850             }
1851             bit OFPAT_SET_NW_SRC {
1852                 position 6;
1853                 description "IP source address.";
1854             }
1855             bit OFPAT_SET_NW_DST {
1856                 position 7;
1857                 description "IP destination address.";
1858             }
1859             bit OFPAT_SET_NW_TOS {
1860                 position 8;
1861                 description "IP ToS (DSCP field, 6 bits).";
1862             }
1863             bit OFPAT_SET_TP_SRC {
1864                 position 9;
1865                 description "TCP/UDP source port.";
1866             }
1867             bit OFPAT_SET_TP_DST {
1868                 position 10;
1869                 description "TCP/UDP destination port.";
1870             }
1871             bit OFPAT_ENQUEUE {
1872                 position 11;
1873                 description "Output to queue.";
1874             }
1875             bit OFPAT_VENDOR {
1876                 position 12;
1877                 description "Experimenter in later versions.";
1878             }
1879         }
1880     }
1881
1882     typedef flow-wildcards-v10 {
1883         /* ofp_flow_wildcards */
1884         description "Flow wildcards - NW_SRC_MASK & NW_DST_MASK are handled separately";
1885         type bits {
1886             bit IN_PORT {
1887                 description "Switch input port.";
1888                 position 0;
1889             }
1890             bit DL_VLAN {
1891                 description "VLAN id.";
1892                 position 1;
1893             }
1894             bit DL_SRC {
1895                 description "Ethernet source address.";
1896                 position 2;
1897             }
1898             bit DL_DST {
1899                 description "Ethernet destination address.";
1900                 position 3;
1901             }
1902             bit DL_TYPE {
1903                 description "Ethernet frame type.";
1904                 position 4;
1905             }
1906             bit NW_PROTO {
1907                 description "IP protocol.";
1908                 position 5;
1909             }
1910             bit TP_SRC {
1911                 description "TCP/UDP source port.";
1912                 position 6;
1913             }
1914             bit TP_DST {
1915                 description "TCP/UDP destination port.";
1916                 position 7;
1917             }
1918             bit DL_VLAN_PCP {
1919                 description "VLAN priority.";
1920                 position 20;
1921             }
1922             bit NW_TOS {
1923                 description "IP ToS (DSCP field, 6 bits).";
1924                 position 21;
1925             }
1926         }
1927     }
1928
1929 }