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