Fixed MultipartReply MeterFeatures
[openflowjava.git] / openflow-protocol-api / src / main / yang / openflow-types.yang
1 module openflow-types {
2     namespace "urn:opendaylight:openflow:common:types";
3     prefix "oft";
4
5     revision "2013-07-31" {
6         //description "OpenFlow 1.3 - common types model";
7     }
8
9     typedef port-number {
10         type uint32;
11     }
12     
13     typedef port-number-values {
14         type enumeration {
15             enum MAX {
16                 value -256; // 0xffffff00 
17                 description "Hello Protocol failed.";
18             }
19             enum IN_PORT {
20                 value -8; // 0xfffffff8
21                 description "Request was not understood.";
22             }
23             enum TABLE {
24                 value -7; // 0xfffffff9 
25                 description "Error in action description.";
26             }
27             enum NORMAL {
28                 value -6; // 0xfffffffa 
29                 description "Error in instruction list.";
30             }
31             enum FLOOD {
32                 value -5; // 0xfffffffb 
33                 description "Error in match.";
34             }
35             enum ALL {
36                 value -4; // 0xfffffffc 
37                 description "Problem modifying flow entry.";
38             }
39             enum CONTROLLER {
40                 value -3; // 0xfffffffd
41                 description "Problem modifying group entry.";
42             }
43             enum LOCAL {
44                 value -2; // 0xfffffffe
45                 description "Port mod request failed.";
46             }
47             enum ANY {
48                 value -1; // 0xffffffff
49                 description "Table mod request failed.";
50             }
51         }
52     }
53
54     typedef port-features {
55         ////description "Features of ports available in datapath.";
56         //reference "ofp_port_features";
57         type bits {
58             bit 10mb_hd { 
59                 position 0;
60                 //description "10 Mb half-duplex rate support.";
61             }
62             bit 10mb-fd { 
63                 position 1;
64                 //description "10 Mb full-duplex rate support.";
65             }
66             bit 100mb-hd { 
67                 position 2;
68                 //description "100 Mb half-duplex rate support.";
69             }
70             bit 100mb-fd { 
71                 position 3;
72                 //description "100 Mb full-duplex rate support.";
73             }
74             bit 1gb-hd { 
75                 position 4;
76                 //description "1 Gb half-duplex rate support.";
77             }
78             bit 1gb-fd { 
79                 position 5;
80                 //description "1 Gb full-duplex rate support.";
81             }
82             bit 10gb-fd { 
83                 position 6;
84                 //description "10 Gb full-duplex rate support.";
85             }
86             bit 40gb-fd { 
87                 position 7;
88                 //description "40 Gb full-duplex rate support.";
89             }
90             bit 100gb-fd { 
91                 position 8;
92                 //description "100 Gb full-duplex rate support.";
93             }
94             bit 1tb-fd { 
95                 position 9;
96                 //description "1 Tb full-duplex rate support.";
97             }
98             bit other { 
99                 position 10;
100                 //description "Other rate, not in the list.";
101             }
102             bit copper { 
103                 position 11;
104                 //description "Copper medium.";
105             }
106             bit fiber { 
107                 position 12;
108                 //description "Fiber medium.";
109             }
110             bit autoneg { 
111                 position 13;
112                 //description "Auto-negotiation.";
113             }
114             bit pause { 
115                 position 14;
116                 //description "Pause.";
117             }
118             bit pause-asym { 
119                 position 15;
120                 //description "Asymmetric pause.";
121             }
122         }
123     }
124
125     typedef port-config {
126         description 
127            "Flags to indicate behavior of the physical port. These flags are
128             describe the current configuration and used port_mod message 
129             to configure the port's behavior.";
130         type bits {
131             bit port-down { 
132                 //description " Port is administratively down.";
133                 position 0;
134             }
135             bit no-recv { 
136                 //description " Drop all packets received by port.";
137                 position 2;
138             }
139             bit no-fwd { 
140                 //description " Drop packets forwarded to port.";
141                 position 5;
142             }
143             bit no-packet-in { 
144                 //description "Do not send packet-in msgs for port.";
145                 position 6;
146             }
147         }
148     }
149
150     typedef port-state {
151         description 
152             "Current state of the physical port. These are not configurable from
153             the controller.";
154         type bits {
155             bit link_down {
156                 //description "No physical link present.";
157                 position 0;
158             }
159             bit blocked {
160                 //description "Port is blocked";
161                 position 1;
162             }
163             bit live {
164                 //description "Live for Fast Failover Group.";
165                 position 2;
166             }
167         }
168     }
169
170     identity match-type-base {
171         description 
172            "The match type indicates the match structure (set of fields that compose the
173             match) in use. The match type is placed in the type field at the beginning
174             of all match structures.Extensions that define match types may be 
175             published on the ONF wiki. Support for extensions is optional.";
176     }
177
178     identity standard-match-type {
179         deprecated true;
180         base oft:match-type-base;
181     }
182
183     typedef oxm-match-type {
184         type identityref {
185             base oft:match-type-base;
186         }
187     }
188
189     identity instruction {
190     }
191
192     identity action {
193     }
194
195     typedef metadata {
196         type binary;
197     }
198
199     typedef table-id {
200         type uint32;
201     }
202     typedef meter-id {
203         type uint32;
204     }
205     typedef queue-id {
206         type uint32;
207     }
208     typedef group-id {
209         type uint32;
210     }
211
212     typedef ether-type {
213         type uint16;
214     }
215
216     typedef error-type {
217         type enumeration {
218             enum HELLO_FAILED {
219                 value 0; 
220                 description "Hello Protocol failed.";
221             }
222             enum BAD_REQUEST {
223                 value 1; 
224                 description "Request was not understood.";
225             }
226             enum BAD_ACTION {
227                 value 2; 
228                 description "Error in action description.";
229             }
230             enum BAD_INSTRUCTION {
231                 value 3; 
232                 description "Error in instruction list.";
233             }
234             enum BAD_MATCH {
235                 value 4; 
236                 description "Error in match.";
237             }
238             enum FLOW_MOD_FAILED {
239                 value 5; 
240                 description "Problem modifying flow entry.";
241             }
242             enum GROUP_MOD_FAILED {
243                 value 6; 
244                 description "Problem modifying group entry.";
245             }
246             enum PORT_MOD_FAILED {
247                 value 7; 
248                 description "Port mod request failed.";
249             }
250             enum TABLE_MOD_FAILED {
251                 value 8; 
252                 description "Table mod request failed.";
253             }
254             enum QUEUE_OP_FAILED {
255                 value 9; 
256                 description "Queue operation failed.";
257             }
258             enum SWITCH_CONFIG_FAILED {
259                 value 10; 
260                 description "Switch config request failed.";
261             }
262             enum ROLE_REQUEST_FAILED {
263                 value 11; 
264                 description "Controller Role request failed.";
265             }
266             enum METER_MOD_FAILED {
267                 value 12; 
268                 description "Error in meter.";
269             }
270             enum TABLE_FEATURES_FAILED {
271                 value 13; 
272                 description "Setting table features failed.";
273             }
274             enum EXPERIMENTER {
275                 value 65535; //0xffff 
276                 description "Experimenter error messages.";
277             }
278         }
279     }
280
281     typedef hello-element-type {
282         type enumeration {
283             enum VERSIONBITMAP {
284                 value 1; 
285                 description "Bitmap of version supported.";
286             }
287         }
288     }
289     
290     typedef capabilities {
291         type bits {
292             bit OFPC_FLOW_STATS {
293                 position 0;
294                 /* Flow statistics. */
295             } 
296             bit OFPC_TABLE_STATS {
297                 position 1;
298                 /* Table statistics. */
299             }
300             bit OFPC_PORT_STATS {
301                 position 2;
302                 /* Port statistics. */
303             }
304             bit OFPC_GROUP_STATS {
305                 position 3;
306                 /* Group statistics. */
307             }
308             bit OFPC_IP_REASM {
309                 position 5;
310                 /* Can reassemble IP fragments. */
311             }
312             bit OFPC_QUEUE_STATS {
313                 position 6;
314                 /* Queue statistics. */
315             }
316             bit OFPC_PORT_BLOCKED {
317                 position 8;
318                 /* Switch will block looping ports. */
319             }
320         }
321     }
322
323     typedef switch-config-flag {
324         /* Handling of IP fragments. */
325         type enumeration {
326             enum FRAG_NORMAL {
327                 value 0; 
328                 description "No special handling for fragments.";
329             }
330             enum OFPC_FRAG_DROP {
331                 value 1; 
332                 description "Drop fragments.";
333             }
334             enum OFPC_FRAG_REASM {
335                 value 2; 
336                 description "Reassemble (only if OFPC_IP_REASM set).";
337             }
338             enum OFPC_FRAG_MASK {
339                 value 3; 
340             }
341         }
342     }
343
344     typedef flow-removed-reason {
345         /* flow removed */
346         type enumeration {
347             enum OFPRR_IDLE_TIMEOUT {
348                 value 0;
349                 description "Flow idle time exceeded idle_timeout.";
350             }
351             enum OFPRR_HARD_TIMEOUT {
352                 value 1;
353                 description "Time exceeded hard_timeout.";
354             }
355             enum OFPRR_DELETE {
356                 value 2;
357                 description "Evicted by a DELETE flow mod.";
358             }
359             enum OFPRR_GROUP_DELETE {
360                 value 3;
361                 description "Group was removed.";
362             }
363         }
364     }
365
366     typedef port-reason {
367         /* port status */
368         type enumeration {
369             enum OFPPR_ADD {
370                 value 0;
371                 description "The port was added.";
372             }
373             enum OFPPR_DELETE {
374                 value 1;
375                 description "he port was removed.";
376             }
377             enum OFPPR_MODIFY {
378                 value 2;
379                 description "Some attribute of the port has changed.";
380             }
381         }
382     }
383
384     typedef flow-mod-command {
385         /* ofp_flow_mod_command */
386         type enumeration {
387             enum OFPFC_ADD {      
388                 value 0;      
389                 description "New flow.";    
390             }
391             enum OFPFC_MODIFY {
392                 value 1;
393                 description "Modify all matching flows.";
394             }
395             enum OFPFC_MODIFY_STRICT {
396                 value 2;
397                 description "Modify entry strictly matching wildcards and priority.";
398             }
399             enum OFPFC_DELETE {
400                 value 3;
401                 description "Delete all matching flows.";
402             }
403             enum OFPFC_DELETE_STRICT {
404                 value 4;
405                 description "Delete entry strictly matching wildcards and priority.";
406             }
407         }
408     }
409
410     typedef flow-mod-flags {
411         /* ofp_flow_mod_flags */
412         type bits {
413             bit OFPFF_SEND_FLOW_REM {
414                 position 0;
415                 /* Send flow removed message when flow expires or is deleted. */
416             }
417             bit OFPFF_CHECK_OVERLAP {
418                 position 1;
419                 /* Check for overlapping entries first. */
420             }
421             bit OFPFF_RESET_COUNTS {
422                 position 2;
423                 /* Reset flow packet and byte counts. */
424             }
425             bit OFPFF_NO_PKT_COUNTS {
426                 position 3;
427                 /* Don't keep track of packet count. */
428             }
429             bit OFPFF_NO_BYT_COUNTS {
430                 position 4;
431                 /* Don't keep track of byte count. */
432             }
433         }
434     }
435
436     typedef group-mod-command {
437         /* ofp_group_mod_command */
438         type enumeration {
439             enum OFPGC_ADD {            
440               value 0;            
441               description "New group.";            
442             }
443             enum OFPGC_MODIFY {
444               value 1;
445               description "Modify all matching groups.";
446             }
447             enum OFPGC_DELETE {
448               value 2;
449               description "Delete all matching groups.";
450             }
451             
452         }
453     }
454
455     typedef group-type {
456         /* ofp_group_type */
457         type enumeration {
458             enum OFPGT_ALL {            
459               value 0;            
460               description "All (multicast/broadcast) group.";            
461             }
462             enum OFPGT_SELECT {
463               value 1;
464               description "Select group.";
465             }
466             enum OFPGT_INDIRECT {
467               value 2;
468               description "Indirect group.";
469             }
470             enum OFPGT_FF {
471               value 3;
472               description "Fast failover group.";
473             }
474         }
475     }
476
477         typedef group {
478                 /* ofp_group - Group numbering. Groups can use any number up to OFPG_MAX.*/
479                 type enumeration {
480                         enum OFPG_MAX {
481                                 value -256; //0xffffff00
482                                 description "Last usable group number";
483                         }
484                         
485                         /* Fake groups. */
486                         enum OFPG_ALL {
487                                 value -4; //0xfffffffc
488                                 description "Represents all groups for group delete commands";
489                         }
490                         enum OFPG_ANY {
491                                 value -1; //0xffffffff
492                                 description "Wildcard group used only for flow stats requests. 
493                                                                 Selects all flows regardless of group (including flows with no group)";
494                                 
495                         }
496                 }
497                 
498         }
499         
500     typedef multipart-request-flags {
501         description
502             "enum ofp_multipart_request_flags ";
503         type bits {
504             bit OFPMPF_REQ_MORE {
505                 //description "More requests to follow.";
506                 position 0;
507             }
508         }
509     }
510
511     typedef multipart-type {
512         /* ofp_multipart_type */
513         type enumeration {
514             enum OFPMP_DESC {
515               value 0;
516               description "Description of this OpenFlow switch.
517                  The request body is empty.
518                  The reply body is struct ofp_desc.";
519             }
520             enum OFPMP_FLOW {
521               value 1;
522               description "Individual flow statistics.
523                  The request body is struct ofp_flow_stats_request.
524                  The reply body is an array of struct ofp_flow_stats.";
525             }
526             enum OFPMP_AGGREGATE {
527               value 2;
528               description "Aggregate flow statistics.
529                  The request body is struct ofp_aggregate_stats_request.
530                  The reply body is struct ofp_aggregate_stats_reply.";
531             }
532             enum OFPMP_TABLE {
533               value 3;
534               description "Flow table statistics.
535                  The request body is empty.
536                  The reply body is an array of struct ofp_table_stats.";
537             }
538             enum OFPMP_PORT_STATS {
539               value 4;
540               description "Port statistics.
541                  The request body is struct ofp_port_stats_request.
542                  The reply body is an array of struct ofp_port_stats.";
543             }
544             enum OFPMP_QUEUE {
545               value 5;
546               description "Queue statistics for a port
547                  The request body is struct ofp_queue_stats_request.
548                  The reply body is an array of struct ofp_queue_stats";
549             }
550             enum OFPMP_GROUP {
551               value 6;
552               description "Group counter statistics.
553                  The request body is struct ofp_group_stats_request.
554                  The reply is an array of struct ofp_group_stats.";
555             }
556             enum OFPMP_GROUP_DESC {
557               value 7;
558               description "Group description.
559                  The request body is empty.
560                  The reply body is an array of struct ofp_group_desc.";
561             }
562             enum OFPMP_GROUP_FEATURES {
563               value 8;
564               description "Group features.
565                  The request body is empty.
566                  The reply body is struct ofp_group_features.";
567             }
568             enum OFPMP_METER {
569               value 9;
570               description "Meter statistics.
571                  The request body is struct ofp_meter_multipart_requests.
572                  The reply body is an array of struct ofp_meter_stats.";
573             }
574             enum OFPMP_METER_CONFIG {
575               value 10;
576               description "Meter configuration.
577                  The request body is struct ofp_meter_multipart_requests.
578                  The reply body is an array of struct ofp_meter_config.";
579             }
580             enum OFPMP_METER_FEATURES {
581               value 11;
582               description "Meter features.
583                  The request body is empty.
584                  The reply body is struct ofp_meter_features.";
585             }
586             enum OFPMP_TABLE_FEATURES {
587               value 12;
588               description "Table features.
589                  The request body is either empty or contains an array of
590                  struct ofp_table_features containing the controller’s
591                  desired view of the switch. If the switch is unable to
592                  set the specified view an error is returned.
593                  The reply body is an array of struct ofp_table_features.";
594             }
595             enum OFPMP_PORT_DESC {
596               value 13;
597               description "Port description.
598                  The request body is empty.
599                  The reply body is an array of struct ofp_port.";
600             }
601             enum OFPMP_EXPERIMENTER {
602               value 65535; //0xffff
603               description "Experimenter extension.
604                  The request and reply bodies begin with
605                  struct ofp_experimenter_multipart_header.
606                  The request and reply bodies are otherwise experimenter-defined.";
607             }
608         }
609     }
610
611     typedef queue-properties {
612         /* ofp_queue_properties */
613         type enumeration {
614             enum OFPQT_NONE {
615               value 0;
616               description "No property defined for queue (default).";
617             }
618             enum OFPQT_MIN_RATE {
619                 value 1;
620                 description "Minimum datarate guaranteed.";
621             }
622             enum OFPQT_MAX_RATE {
623                 value 2;
624                 description "Maximum datarate.";
625             }
626             enum OFPQT_EXPERIMENTER {
627                 value 65535; // 0xffff 
628                 description "Experimenter defined property.";
629             }
630         }
631     }
632
633     typedef controller-role {
634         /* ofp_controller_role */
635         type enumeration {
636             enum OFPCR_ROLE_NOCHANGE {
637               value 0;
638               description "Don’t change current role.";
639             }
640             enum OFPCR_ROLE_EQUAL {
641               value 1;
642               description "Default role, full access.";
643             }
644             enum OFPCR_ROLE_MASTER {
645               value 2;
646               description "Full access, at most one master.";
647             }
648             enum OFPCR_ROLE_SLAVE {
649               value 3;
650               description "Read-only access.";
651             }
652         }
653     }
654
655     typedef packet-in-reason {
656         /* ofp_packet_in_reason */
657         type enumeration {
658             enum OFPR_NO_MATCH {
659               value 0;
660               description "No matching flow (table-miss flow entry). ";
661             }
662             enum OFPR_ACTION {
663               value 1;
664               description "Action explicitly output to controller. ";
665             }
666             enum OFPR_INVALID_TTL {
667               value 2;
668               description "Packet has invalid TTL ";
669             }
670         }
671     }
672     
673     typedef action-type {
674         /* ofp_action_type */
675         type bits {
676             bit OFPAT_OUTPUT {
677                 position 0;
678                 /* Output to switch port. */
679             }
680             bit OFPAT_COPY_TTL_OUT {
681                 position 1;
682                 /* Copy TTL "outwards" -- from next-to-outermost to outermost */
683             }
684             bit OFPAT_COPY_TTL_IN {
685                 position 2;
686                 /* Copy TTL "inwards" -- from outermost to next-to-outermost */
687             }
688             bit OFPAT_SET_MPLS_TTL {
689                 position 3;
690                 /* MPLS TTL */
691             }
692             bit OFPAT_DEC_MPLS_TTL {
693                 position 4;
694                 /* Decrement MPLS TTL */
695             }
696             bit OFPAT_PUSH_VLAN {
697                 position 5;
698                 /* Push a new VLAN tag */
699             }
700             bit OFPAT_POP_VLAN {
701                 position 6;
702                 /* Pop the outer VLAN tag */
703             }
704             bit OFPAT_PUSH_MPLS {
705                 position 7;
706                 /* Push a new MPLS tag */
707             }
708             bit OFPAT_POP_MPLS {
709                 position 8;
710                 /* Pop the outer MPLS tag */
711             }
712             bit OFPAT_SET_QUEUE {
713                 position 9;
714                 /* Set queue id when outputting to a port */
715             }
716             bit OFPAT_GROUP {
717                 position 10;
718                 /* Apply group. */
719             }
720             bit OFPAT_SET_NW_TTL {
721                 position 11;
722                 /* IP TTL. */
723             }
724             bit OFPAT_DEC_NW_TTL {
725                 position 12;
726                 /* Decrement IP TTL. */
727             }
728             bit OFPAT_SET_FIELD {
729                 position 13;
730                 /* Set a header field using OXM TLV format. */
731             }
732             bit OFPAT_PUSH_PBB {
733                 position 14;
734                 /* Push a new PBB service tag (I-TAG) */
735             }
736             bit OFPAT_POP_PBB {
737                 position 15;
738                 /* Pop the outer PBB service tag (I-TAG) */
739             }
740             bit OFPAT_EXPERIMENTER {
741                 position 16;
742             }
743         }
744     }
745
746     typedef meter-mod-command {
747         /* ofp_meter_mod_command */
748         type enumeration {
749             enum OFPMC_ADD {
750               description "New meter. ";
751             }
752             enum OFPMC_MODIFY {
753               description "Modify specified meter. ";
754             }
755             enum OFPMC_DELETE {
756               description "Delete specified meter. ";
757             }
758         }
759     }
760
761     typedef meter-flags {
762         /* ofp_meter_flags */
763         type bits {
764             bit OFPMF_KBPS {
765                 position 0;
766                 /* Rate value in kb/s (kilo-bit per second). */
767             }
768             bit OFPMF_PKTPS {
769                 position 1;
770                 /* Rate value in packet/sec. */
771             }
772             bit OFPMF_BURST {
773                 position 2;
774                 /* Do burst size. */
775             }
776             bit OFPMF_STATS {
777                 position 3;
778                 /* Collect statistics. */
779             }
780         }
781     }
782
783     typedef meter-band-type {
784         /* ofp_meter_band_type */
785         type enumeration {
786             enum OFPMBT_DROP {
787               value 1;
788               description "Drop packet. ";
789             }
790             enum OFPMBT_DSCP_REMARK {
791               value 2;
792               description "Remark DSCP in the IP header. ";
793             }
794             enum OFPMBT_EXPERIMENTER {
795               value 65535; //0xFFFF
796               description "Experimenter meter band. ";
797             }
798         }
799     }
800     
801     typedef meter-band-type-bitmap {
802         /* ofp_meter_band_type */
803         type bits {
804             bit OFPMBT_DROP {
805               position 1;
806               description "Drop packet. ";
807             }
808             bit OFPMBT_DSCP_REMARK {
809               position 2;
810               description "Remark DSCP in the IP header. ";
811             }
812         }
813     }
814
815         typedef meter {
816                 /* ofp_meter - Meter numbering. Flow meters can use any number up to OFPM_MAX*/
817                 type enumeration {
818                         enum OFPM_MAX {
819                                 value -65536; //0xffff0000
820                                 description "Last usable meter number";
821                         }
822                         
823                         /* Virtual meters. */
824                         enum OFPM_SLOWPATH {
825                                 value -3; //0xfffffffd
826                                 description "Meter for slow datapath";
827                         }
828                         enum OFPM_CONTROLLER {
829                                 value -2; //0xfffffffe
830                                 description "Meter for controller connection";
831                         }
832                         enum OFPM_ALL {
833                                 value -1; //0xffffffff
834                                 description "Represents all meters for stat requests commands";
835                         }
836                 }
837                 
838         }
839
840     typedef table-config {
841         /* ofp_table_config */
842         type bits {
843             bit OFPTC_DEPRECATED_MASK {
844                 /* Deprecated bits */
845                 position 3;
846             }
847         }
848     }
849
850     typedef table-features-prop-type {
851         type enumeration {
852             enum OFPTFPT_INSTRUCTIONS {
853                 value 0; 
854                 description "Instructions property.";
855             }
856             enum OFPTFPT_INSTRUCTIONS_MISS {
857                 value 1; 
858                 description "Instructions for table-miss.";
859             }
860             enum OFPTFPT_NEXT_TABLES {
861                 value 2; 
862                 description "Next Table property.";
863             }
864             enum OFPTFPT_NEXT_TABLES_MISS {
865                 value 3; 
866                 description "Next Table for table-miss.";
867             }
868             enum OFPTFPT_WRITE_ACTIONS {
869                 value 4; 
870                 description "Write Actions property.";
871             }
872             enum OFPTFPT_WRITE_ACTIONS_MISS {
873                 value 5; 
874                 description "Write Actions for table-miss.";
875             }
876             enum OFPTFPT_APPLY_ACTIONS {
877                 value 6; 
878                 description "Apply Actions property.";
879             }
880             enum OFPTFPT_APPLY_ACTIONS_MISS {
881                 value 7; 
882                 description "Apply Actions for table-miss.";
883             }
884             enum OFPTFPT_MATCH {
885                 value 8; 
886                 description "Match property.";
887             }
888             enum OFPTFPT_WILDCARDS {
889                 value 10; 
890                 description "Wildcards property.";
891             }
892             enum OFPTFPT_WRITE_SETFIELD {
893                 value 12; 
894                 description "Write Set-Field property.";
895             }
896             enum OFPTFPT_WRITE_SETFIELD_MISS {
897                 value 13; 
898                 description "Write Set-Field for table-miss.";
899             }
900             enum OFPTFPT_APPLY_SETFIELD {
901                 value 14; 
902                 description "Apply Set-Field property.";
903             }
904             enum OFPTFPT_APPLY_SETFIELD_MISS {
905                 value 15; 
906                 description "Apply Set-Field for table-miss.";
907             }
908             enum OFPTFPT_EXPERIMENTER {
909                 value 65534; 
910                 description "Experimenter property.";
911             }
912             enum OFPTFPT_EXPERIMENTER_MISS {
913                 value 65535; //0xffff 
914                 description "Experimenter for table-miss.";
915             }
916         }
917     }
918
919     typedef group-types {
920         /* ofp_group_type */
921         type bits {
922             bit OFPGT_ALL {
923                 /* All (multicast/broadcast) group. */
924                 position 0;
925             }
926             bit OFPGT_SELECT {
927                 /* Select group. */
928                 position 1;
929             }
930             bit OFPGT_INDIRECT {
931                 /* Indirect group. */
932                 position 2;
933             }
934             bit OFPGT_FF {
935                 /* Fast failover group. */
936                 position 3;
937             }
938         }
939     }
940
941     typedef group-capabilities {
942         /* ofp_group_capabilities */
943         type bits {
944             bit OFPGFC_SELECT_WEIGHT {
945                 /* Support weight for select groups */
946                 position 0;
947             }
948             bit OFPGFC_SELECT_LIVENESS {
949                 /* Support liveness for select groups */
950                 position 1;
951             }
952             bit OFPGFC_CHAINING {
953                 /* Support chaining groups */
954                 position 2;
955             }
956             bit OFPGFC_CHAINING_CHECKS {
957                 /* Check chaining for loops and delete */
958                 position 3;
959             }
960         }
961     }
962     
963 // OPENFLOW v1.0 STRUCTURES
964     // Structures under this line are needed to support OpenFlow version 1.0 
965     // wire protocol 0x01; 
966     
967     typedef port-number-values-v10 {
968         type enumeration {
969             enum MAX {
970                 value 65280; // 0xff00 
971                 description "Hello Protocol failed.";
972             }
973             enum IN_PORT {
974                 value 65528; // 0xfff8
975                 description "Request was not understood.";
976             }
977             enum TABLE {
978                 value 65529; // 0xfff9 
979                 description "Error in action description.";
980             }
981             enum NORMAL {
982                 value 65530; // 0xfffa 
983                 description "Error in instruction list.";
984             }
985             enum FLOOD {
986                 value 65531; // 0xfffb 
987                 description "Error in match.";
988             }
989             enum ALL {
990                 value 65532; // 0xfffc 
991                 description "Problem modifying flow entry.";
992             }
993             enum CONTROLLER {
994                 value 65533; // 0xfffd
995                 description "Problem modifying group entry.";
996             }
997             enum LOCAL {
998                 value 65534; // 0xfffe
999                 description "Port mod request failed.";
1000             }
1001             enum ANY {
1002                 value 65535; // 0xffff
1003                 description "Table mod request failed.";
1004             }
1005         }
1006     }
1007     
1008     typedef port-config-v10 {
1009         description 
1010            "Flags to indicate behavior of the physical port. These flags are
1011             describe the current configuration and used port_mod message 
1012             to configure the port's behavior.";
1013         type bits {
1014             bit port-down { 
1015                 //description " Port is administratively down.";
1016                 position 0;
1017             }
1018             bit no-stp {
1019                 //description" Disable 802.1D spanning tree on port.";
1020                 position 1;
1021             }
1022             bit no-recv { 
1023                 //description " Drop all packets received by port.";
1024                 position 2;
1025             }
1026             bit no-recv-stp { 
1027                 //description " Drop received 802.1D STP packets.";
1028                 position 3;
1029             }
1030             bit no-flood { 
1031                 //description " Do not include this port when flooding.";
1032                 position 4;
1033             }
1034             bit no-fwd { 
1035                 //description " Drop packets forwarded to port.";
1036                 position 5;
1037             }
1038             bit no-packet-in { 
1039                 //description "Do not send packet-in msgs for port.";
1040                 position 6;
1041             }
1042         }
1043     }
1044     
1045     typedef port-state-v10 {
1046         description 
1047             "Current state of the physical port. These are not configurable from
1048             the controller.";
1049         type bits {
1050             bit link_down {
1051                 //description "No physical link present.";
1052                 position 0;
1053             }
1054             bit blocked {
1055                 //description "Port is blocked";
1056                 position 1;
1057             }
1058             bit live {
1059                 //description "Live for Fast Failover Group.";
1060                 position 2;
1061             }
1062             bit stp_listen {
1063                 //description "Live for Fast Failover Group.";
1064                 position 8;
1065             }
1066             bit stp_learn {
1067                 //description "Live for Fast Failover Group.";
1068                 position 8;
1069             }
1070             bit stp_forward {
1071                 //description "Live for Fast Failover Group.";
1072                 position 8;
1073             }
1074             bit stp_block {
1075                 //description "Live for Fast Failover Group.";
1076                 position 8;
1077             }
1078             bit stp_mask {
1079                 //description "Live for Fast Failover Group.";
1080                 position 8;
1081             }
1082         }
1083     }
1084     
1085     typedef port-features-v10 {
1086         ////description "Features of ports available in datapath.";
1087         //reference "ofp_port_features";
1088         type bits {
1089             bit 10mb-hd { 
1090                 position 0;
1091                 //description "10 Mb half-duplex rate support.";
1092             }
1093             bit 10mb-fd { 
1094                 position 1;
1095                 //description "10 Mb full-duplex rate support.";
1096             }
1097             bit 100mb-hd { 
1098                 position 2;
1099                 //description "100 Mb half-duplex rate support.";
1100             }
1101             bit 100mb-fd { 
1102                 position 3;
1103                 //description "100 Mb full-duplex rate support.";
1104             }
1105             bit 1gb-hd { 
1106                 position 4;
1107                 //description "1 Gb half-duplex rate support.";
1108             }
1109             bit 1gb-fd { 
1110                 position 5;
1111                 //description "1 Gb full-duplex rate support.";
1112             }
1113             bit 10gb-fd { 
1114                 position 6;
1115                 //description "10 Gb full-duplex rate support.";
1116             }
1117             bit copper { 
1118                 position 7;
1119                 //description "Copper medium.";
1120             }
1121             bit fiber { 
1122                 position 8;
1123                 //description "Fiber medium.";
1124             }
1125             bit autoneg { 
1126                 position 9;
1127                 //description "Auto-negotiation.";
1128             }
1129             bit pause { 
1130                 position 10;
1131                 //description "Pause.";
1132             }
1133             bit pause-asym { 
1134                 position 11;
1135                 //description "Asymmetric pause.";
1136             }
1137         }
1138     }
1139     
1140     typedef capabilities-v10 {
1141         type bits {
1142             bit OFPC_FLOW_STATS {
1143                 position 0;
1144                 /* Flow statistics. */
1145             } 
1146             bit OFPC_TABLE_STATS {
1147                 position 1;
1148                 /* Table statistics. */
1149             }
1150             bit OFPC_PORT_STATS {
1151                 position 2;
1152                 /* Port statistics. */
1153             }
1154             bit OFPC_STP {
1155                 position 3;
1156                 /* 802.1d spanning tree. */
1157             }
1158             bit OFPC_RESERVED {
1159                 position 4;
1160                 /* Reserved, must be zero. */
1161             }
1162             bit OFPC_IP_REASM {
1163                 position 5;
1164                 /* Can reassemble IP fragments. */
1165             }
1166             bit OFPC_QUEUE_STATS {
1167                 position 6;
1168                 /* Queue statistics. */
1169             }
1170             bit OFPC_ARP_MATCH_IP {
1171                 position 8;
1172                 /* Match IP addresses in ARP pkts. */
1173             }
1174         }
1175     }
1176     
1177     typedef flow-mod-flags-v10 {
1178         /* ofp_flow_mod_flags */
1179         type bits {
1180             bit OFPFF_SEND_FLOW_REM {
1181                 position 0;
1182                 /* Send flow removed message when flow expires or is deleted. */
1183             }
1184             bit OFPFF_CHECK_OVERLAP {
1185                 position 1;
1186                 /* Check for overlapping entries first. */
1187             }
1188             bit OFPFF_EMERG {
1189                 position 2;
1190                 /* Reset flow packet and byte counts. */
1191             }
1192         }
1193     }
1194     
1195     typedef action-type-v10 {
1196         /* ofp_action_type */
1197         type bits {
1198             bit OFPAT_OUTPUT {
1199                 position 0;
1200                 /* Output to switch port. */
1201             }
1202             bit OFPAT_SET_VLAN_VID {
1203                 position 1;
1204                 /* Set the 802.1q VLAN id. */
1205             }
1206             bit OFPAT_SET_VLAN_PCP {
1207                 position 2;
1208                 /* Set the 802.1q priority. */
1209             }
1210             bit OFPAT_STRIP_VLAN {
1211                 position 3;
1212                 /* Strip the 802.1q header. */
1213             }
1214             bit OFPAT_SET_DL_SRC {
1215                 position 4;
1216                 /* Ethernet source address. */
1217             }
1218             bit OFPAT_SET_DL_DST {
1219                 position 5;
1220                 /* Ethernet destination address. */
1221             }
1222             bit OFPAT_SET_NW_SRC {
1223                 position 6;
1224                 /* IP source address. */
1225             }
1226             bit OFPAT_SET_NW_DST {
1227                 position 7;
1228                 /* IP destination address. */
1229             }
1230             bit OFPAT_SET_NW_TOS {
1231                 position 8;
1232                 /* IP ToS (DSCP field, 6 bits). */
1233             }
1234             bit OFPAT_SET_TP_SRC {
1235                 position 9;
1236                 /* TCP/UDP source port. */
1237             }
1238             bit OFPAT_SET_TP_DST {
1239                 position 10;
1240                 /* TCP/UDP destination port. */
1241             }
1242             bit OFPAT_ENQUEUE {
1243                 position 11;
1244                 /* Output to queue. */
1245             }
1246             bit OFPAT_VENDOR {
1247                 position 12;
1248                 /* Experimenter in later versions */
1249             }
1250         }
1251     }
1252     
1253     typedef error-type-v10 {
1254         type enumeration {
1255             enum HELLO_FAILED {
1256                 value 0; 
1257                 description "Hello Protocol failed.";
1258             }
1259             enum BAD_REQUEST {
1260                 value 1; 
1261                 description "Request was not understood.";
1262             }
1263             enum BAD_ACTION {
1264                 value 2; 
1265                 description "Error in action description.";
1266             }
1267             enum FLOW_MOD_FAILED {
1268                 value 3; 
1269                 description "Problem modifying flow entry.";
1270             }
1271             enum PORT_MOD_FAILED {
1272                 value 4; 
1273                 description "Port mod request failed.";
1274             }
1275             enum QUEUE_OP_FAILED {
1276                 value 5; 
1277                 description "Queue operation failed.";
1278             }
1279         }
1280     }
1281 }