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