ofp_packet_queue structure - implemented missing fields
[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             range "0..4294967040"; // 0xffffff00 See for actual value
12         }
13     }
14
15     typedef port-features {
16         ////description "Features of ports available in datapath.";
17         //reference "ofp_port_features";
18         type bits {
19             bit 10mb_hd { 
20                 position 0;
21                 //description "10 Mb half-duplex rate support.";
22             }
23             bit 10mb-fd { 
24                 position 1;
25                 //description "10 Mb full-duplex rate support.";
26             }
27             bit 100mb-hd { 
28                 position 2;
29                 //description "100 Mb half-duplex rate support.";
30             }
31             bit 100mb-fd { 
32                 position 3;
33                 //description "100 Mb full-duplex rate support.";
34             }
35             bit 1gb-hd { 
36                 position 4;
37                 //description "1 Gb half-duplex rate support.";
38             }
39             bit 1gb-fd { 
40                 position 5;
41                 //description "1 Gb full-duplex rate support.";
42             }
43             bit 10gb-fd { 
44                 position 6;
45                 //description "10 Gb full-duplex rate support.";
46             }
47             bit 40gb-fd { 
48                 position 7;
49                 //description "40 Gb full-duplex rate support.";
50             }
51             bit 100gb-fd { 
52                 position 8;
53                 //description "100 Gb full-duplex rate support.";
54             }
55             bit 1tb-fd { 
56                 position 9;
57                 //description "1 Tb full-duplex rate support.";
58             }
59             bit other { 
60                 position 10;
61                 //description "Other rate, not in the list.";
62             }
63             bit copper { 
64                 position 11;
65                 //description "Copper medium.";
66             }
67             bit fiber { 
68                 position 12;
69                 //description "Fiber medium.";
70             }
71             bit autoneg { 
72                 position 13;
73                 //description "Auto-negotiation.";
74             }
75             bit pause { 
76                 position 14;
77                 //description "Pause.";
78             }
79             bit pause-asym { 
80                 position 15;
81                 //description "Asymmetric pause.";
82             }
83         }
84     }
85
86     typedef port-config {
87         description 
88            "Flags to indicate behavior of the physical port. These flags are
89             describe the current configuration and used port_mod message 
90             to configure the port's behavior.";
91         type bits {
92             bit port-down { 
93                 //description " Port is administratively down.";
94                 position 0;
95             }
96             bit no-recv { 
97                 //description " Drop all packets received by port.";
98                 position 2;
99             }
100             bit no-fwd { 
101                 //description " Drop packets forwarded to port.";
102                 position 5;
103             }
104             bit no-packet-in { 
105                 //description "Do not send packet-in msgs for port.";
106                 position 6;
107             }
108         }
109     }
110
111     typedef port-state {
112         description 
113             "Current state of the physical port. These are not configurable from
114             the controller.";
115         type bits {
116             bit link_down {
117                 //description "No physical link present.";
118                 position 0;
119             }
120             bit blocked {
121                 //description "Port is blocked";
122                 position 1;
123             }
124             bit live {
125                 //description "Live for Fast Failover Group.";
126                 position 2;
127             }
128         }
129     }
130
131     identity match-type-base {
132         description 
133            "The match type indicates the match structure (set of fields that compose the
134             match) in use. The match type is placed in the type field at the beginning
135             of all match structures.Extensions that define match types may be 
136             published on the ONF wiki. Support for extensions is optional.";
137     }
138
139     identity standard-match-type {
140         deprecated true;
141         base oft:match-type-base;
142     }
143
144     typedef oxm-match-type {
145         type identityref {
146             base oft:match-type-base;
147         }
148     }
149
150     identity instruction {
151     }
152
153     identity action {
154     }
155
156     typedef metadata {
157         type binary;
158     }
159
160     typedef table-id {
161         type uint32;
162     }
163     typedef meter-id {
164         type uint32;
165     }
166     typedef queue-id {
167         type uint32;
168     }
169     typedef group-id {
170         type uint32;
171     }
172
173     typedef ether-type {
174         type uint16;
175     }
176
177     typedef error-type {
178         type enumeration {
179             enum HELLO_FAILED {
180                 value 0; 
181                 description "Hello Protocol failed.";
182             }
183             enum BAD_REQUEST {
184                 value 1; 
185                 description "Request was not understood.";
186             }
187             enum BAD_ACTION {
188                 value 2; 
189                 description "Error in action description.";
190             }
191             enum BAD_INSTRUCTION {
192                 value 3; 
193                 description "Error in instruction list.";
194             }
195             enum BAD_MATCH {
196                 value 4; 
197                 description "Error in match.";
198             }
199             enum FLOW_MOD_FAILED {
200                 value 5; 
201                 description "Problem modifying flow entry.";
202             }
203             enum GROUP_MOD_FAILED {
204                 value 6; 
205                 description "Problem modifying group entry.";
206             }
207             enum PORT_MOD_FAILED {
208                 value 7; 
209                 description "Port mod request failed.";
210             }
211             enum TABLE_MOD_FAILED {
212                 value 8; 
213                 description "Table mod request failed.";
214             }
215             enum QUEUE_OP_FAILED {
216                 value 9; 
217                 description "Queue operation failed.";
218             }
219             enum SWITCH_CONFIG_FAILED {
220                 value 10; 
221                 description "Switch config request failed.";
222             }
223             enum ROLE_REQUEST_FAILED {
224                 value 11; 
225                 description "Controller Role request failed.";
226             }
227             enum METER_MOD_FAILED {
228                 value 12; 
229                 description "Error in meter.";
230             }
231             enum TABLE_FEATURES_FAILED {
232                 value 13; 
233                 description "Setting table features failed.";
234             }
235             enum EXPERIMENTER {
236                 value 65535; //0xffff 
237                 description "Experimenter error messages.";
238             }
239         }
240     }
241
242     typedef hello-element-type {
243         type enumeration {
244             enum VERSIONBITMAP {
245                 value 1; 
246                 description "Bitmap of version supported.";
247             }
248         }
249     }
250
251     typedef switch-config-flag {
252         /* Handling of IP fragments. */
253         type enumeration {
254             enum FRAG_NORMAL {
255                 value 0; 
256                 description "No special handling for fragments.";
257             }
258             enum OFPC_FRAG_DROP {
259                 value 1; 
260                 description "Drop fragments.";
261             }
262             enum OFPC_FRAG_REASM {
263                 value 2; 
264                 description "Reassemble (only if OFPC_IP_REASM set).";
265             }
266             enum OFPC_FRAG_MASK {
267                 value 3; 
268             }
269         }
270     }
271
272     typedef flow-removed-reason {
273         /* flow removed */
274         type enumeration {
275             enum OFPRR_IDLE_TIMEOUT {
276                 value 0;
277                 description "Flow idle time exceeded idle_timeout.";
278             }
279             enum OFPRR_HARD_TIMEOUT {
280                 value 1;
281                 description "Time exceeded hard_timeout.";
282             }
283             enum OFPRR_DELETE {
284                 value 2;
285                 description "Evicted by a DELETE flow mod.";
286             }
287             enum OFPRR_GROUP_DELETE {
288                 value 3;
289                 description "Group was removed.";
290             }
291         }
292     }
293
294     typedef port-reason {
295         /* port status */
296         type enumeration {
297             enum OFPPR_ADD {
298                 value 0;
299                 description "The port was added.";
300             }
301             enum OFPPR_DELETE {
302                 value 1;
303                 description "he port was removed.";
304             }
305             enum OFPPR_MODIFY {
306                 value 2;
307                 description "Some attribute of the port has changed.";
308             }
309         }
310     }
311
312     typedef flow-mod-command {
313         /* ofp_flow_mod_command */
314         type enumeration {
315             enum OFPFC_ADD {      
316                 value 0;      
317                 description "New flow.";    
318             }
319             enum OFPFC_MODIFY {
320                 value 1;
321                 description "Modify all matching flows.";
322             }
323             enum OFPFC_MODIFY_STRICT {
324                 value 2;
325                 description "Modify entry strictly matching wildcards and priority.";
326             }
327             enum OFPFC_DELETE {
328                 value 3;
329                 description "Delete all matching flows.";
330             }
331             enum OFPFC_DELETE_STRICT {
332                 value 4;
333                 description "Delete entry strictly matching wildcards and priority.";
334             }
335         }
336     }
337
338     typedef flow-mod-flags {
339         /* ofp_flow_mod_flags */
340         type bits {
341             bit OFPFF_SEND_FLOW_REM {
342                 position 0;
343                 /* Send flow removed message when flow expires or is deleted. */
344             }
345             bit OFPFF_CHECK_OVERLAP {
346                 position 1;
347                 /* Check for overlapping entries first. */
348             }
349             bit OFPFF_RESET_COUNTS {
350                 position 2;
351                 /* Reset flow packet and byte counts. */
352             }
353             bit OFPFF_NO_PKT_COUNTS {
354                 position 3;
355                 /* Don't keep track of packet count. */
356             }
357             bit OFPFF_NO_BYT_COUNTS {
358                 position 4;
359                 /* Don't keep track of byte count. */
360             }
361         }
362     }
363
364     typedef group-mod-command {
365         /* ofp_group_mod_command */
366         type enumeration {
367             enum OFPGC_ADD {            
368               value 0;            
369               description "New group.";            
370             }
371             enum OFPGC_MODIFY {
372               value 1;
373               description "Modify all matching groups.";
374             }
375             enum OFPGC_DELETE {
376               value 2;
377               description "Delete all matching groups.";
378             }
379             
380         }
381     }
382
383     typedef group-type {
384         /* ofp_group_type */
385         type enumeration {
386             enum OFPGT_ALL {            
387               value 0;            
388               description "All (multicast/broadcast) group.";            
389             }
390             enum OFPGT_SELECT {
391               value 1;
392               description "Select group.";
393             }
394             enum OFPGT_INDIRECT {
395               value 2;
396               description "Indirect group.";
397             }
398             enum OFPGT_FF {
399               value 3;
400               description "Fast failover group.";
401             }
402         }
403     }
404
405     typedef multipart-request-flags {
406         description
407             "enum ofp_multipart_request_flags ";
408         type bits {
409             bit OFPMPF_REQ_MORE {
410                 //description "More requests to follow.";
411                 position 0;
412             }
413         }
414     }
415
416     typedef multipart-type {
417         /* ofp_multipart_type */
418         type enumeration {
419             enum OFPMP_DESC {
420               value 0;
421               description "Description of this OpenFlow switch.
422                  The request body is empty.
423                  The reply body is struct ofp_desc.";
424             }
425             enum OFPMP_FLOW {
426               value 1;
427               description "Individual flow statistics.
428                  The request body is struct ofp_flow_stats_request.
429                  The reply body is an array of struct ofp_flow_stats.";
430             }
431             enum OFPMP_AGGREGATE {
432               value 2;
433               description "Aggregate flow statistics.
434                  The request body is struct ofp_aggregate_stats_request.
435                  The reply body is struct ofp_aggregate_stats_reply.";
436             }
437             enum OFPMP_TABLE {
438               value 3;
439               description "Flow table statistics.
440                  The request body is empty.
441                  The reply body is an array of struct ofp_table_stats.";
442             }
443             enum OFPMP_PORT_STATS {
444               value 4;
445               description "Port statistics.
446                  The request body is struct ofp_port_stats_request.
447                  The reply body is an array of struct ofp_port_stats.";
448             }
449             enum OFPMP_QUEUE {
450               value 5;
451               description "Queue statistics for a port
452                  The request body is struct ofp_queue_stats_request.
453                  The reply body is an array of struct ofp_queue_stats";
454             }
455             enum OFPMP_GROUP {
456               value 6;
457               description "Group counter statistics.
458                  The request body is struct ofp_group_stats_request.
459                  The reply is an array of struct ofp_group_stats.";
460             }
461             enum OFPMP_GROUP_DESC {
462               value 7;
463               description "Group description.
464                  The request body is empty.
465                  The reply body is an array of struct ofp_group_desc.";
466             }
467             enum OFPMP_GROUP_FEATURES {
468               value 8;
469               description "Group features.
470                  The request body is empty.
471                  The reply body is struct ofp_group_features.";
472             }
473             enum OFPMP_METER {
474               value 9;
475               description "Meter statistics.
476                  The request body is struct ofp_meter_multipart_requests.
477                  The reply body is an array of struct ofp_meter_stats.";
478             }
479             enum OFPMP_METER_CONFIG {
480               value 10;
481               description "Meter configuration.
482                  The request body is struct ofp_meter_multipart_requests.
483                  The reply body is an array of struct ofp_meter_config.";
484             }
485             enum OFPMP_METER_FEATURES {
486               value 11;
487               description "Meter features.
488                  The request body is empty.
489                  The reply body is struct ofp_meter_features.";
490             }
491             enum OFPMP_TABLE_FEATURES {
492               value 12;
493               description "Table features.
494                  The request body is either empty or contains an array of
495                  struct ofp_table_features containing the controller’s
496                  desired view of the switch. If the switch is unable to
497                  set the specified view an error is returned.
498                  The reply body is an array of struct ofp_table_features.";
499             }
500             enum OFPMP_PORT_DESC {
501               value 13;
502               description "Port description.
503                  The request body is empty.
504                  The reply body is an array of struct ofp_port.";
505             }
506             enum OFPMP_EXPERIMENTER {
507               value 65535; //0xffff
508               description "Experimenter extension.
509                  The request and reply bodies begin with
510                  struct ofp_experimenter_multipart_header.
511                  The request and reply bodies are otherwise experimenter-defined.";
512             }
513         }
514     }
515
516     typedef queue-properties {
517         /* ofp_queue_properties */
518         type enumeration {
519             enum OFPGT_ALL {
520               value 0;
521               description "All (multicast/broadcast) group.";
522             }
523             enum OFPQT_MIN_RATE {
524                 value 1;
525                 description "Minimum datarate guaranteed.";
526             }
527             enum OFPQT_MAX_RATE {
528                 value 2;
529                 description "Maximum datarate.";
530             }
531             enum OFPQT_EXPERIMENTER {
532                 value 65535; // 0xffff 
533                 description "Experimenter defined property.";
534             }
535         }
536     }
537
538     typedef controller-role {
539         /* ofp_controller_role */
540         type enumeration {
541             enum OFPCR_ROLE_NOCHANGE {
542               value 0;
543               description "Don’t change current role.";
544             }
545             enum OFPCR_ROLE_EQUAL {
546               value 1;
547               description "Default role, full access.";
548             }
549             enum OFPCR_ROLE_MASTER {
550               value 2;
551               description "Full access, at most one master.";
552             }
553             enum OFPCR_ROLE_SLAVE {
554               value 3;
555               description "Read-only access.";
556             }
557         }
558     }
559
560     typedef packet-in-reason {
561         /* ofp_packet_in_reason */
562         type enumeration {
563             enum OFPR_NO_MATCH {
564               value 0;
565               description "No matching flow (table-miss flow entry). ";
566             }
567             enum OFPR_ACTION {
568               value 1;
569               description "Action explicitly output to controller. ";
570             }
571             enum OFPR_INVALID_TTL {
572               value 2;
573               description "Packet has invalid TTL ";
574             }
575         }
576     }
577     
578     typedef action-type {
579         /* ofp_action_type */
580         type bits {
581             bit OFPAT_OUTPUT {
582                 position 0;
583                 /* Output to switch port. */
584             }
585             bit OFPAT_COPY_TTL_OUT {
586                 position 1;
587                 /* Copy TTL "outwards" -- from next-to-outermost to outermost */
588             }
589             bit OFPAT_COPY_TTL_IN {
590                 position 2;
591                 /* Copy TTL "inwards" -- from outermost to next-to-outermost */
592             }
593             bit OFPAT_SET_MPLS_TTL {
594                 position 3;
595                 /* MPLS TTL */
596             }
597             bit OFPAT_DEC_MPLS_TTL {
598                 position 4;
599                 /* Decrement MPLS TTL */
600             }
601             bit OFPAT_PUSH_VLAN {
602                 position 5;
603                 /* Push a new VLAN tag */
604             }
605             bit OFPAT_POP_VLAN {
606                 position 6;
607                 /* Pop the outer VLAN tag */
608             }
609             bit OFPAT_PUSH_MPLS {
610                 position 7;
611                 /* Push a new MPLS tag */
612             }
613             bit OFPAT_POP_MPLS {
614                 position 8;
615                 /* Pop the outer MPLS tag */
616             }
617             bit OFPAT_SET_QUEUE {
618                 position 9;
619                 /* Set queue id when outputting to a port */
620             }
621             bit OFPAT_GROUP {
622                 position 10;
623                 /* Apply group. */
624             }
625             bit OFPAT_SET_NW_TTL {
626                 position 11;
627                 /* IP TTL. */
628             }
629             bit OFPAT_DEC_NW_TTL {
630                 position 12;
631                 /* Decrement IP TTL. */
632             }
633             bit OFPAT_SET_FIELD {
634                 position 13;
635                 /* Set a header field using OXM TLV format. */
636             }
637             bit OFPAT_PUSH_PBB {
638                 position 14;
639                 /* Push a new PBB service tag (I-TAG) */
640             }
641             bit OFPAT_POP_PBB {
642                 position 15;
643                 /* Pop the outer PBB service tag (I-TAG) */
644             }
645             bit OFPAT_EXPERIMENTER {
646                 position 16;
647             }
648         }
649     }
650
651     typedef meter-mod-command {
652         /* ofp_meter_mod_command */
653         type enumeration {
654             enum OFPMC_ADD {
655               description "New meter. ";
656             }
657             enum OFPMC_MODIFY {
658               description "Modify specified meter. ";
659             }
660             enum OFPMC_DELETE {
661               description "Delete specified meter. ";
662             }
663         }
664     }
665
666     typedef meter-flags {
667         /* ofp_meter_flags */
668         type bits {
669             bit OFPMF_KBPS {
670                 position 0;
671                 /* Rate value in kb/s (kilo-bit per second). */
672             }
673             bit OFPMF_PKTPS {
674                 position 1;
675                 /* Rate value in packet/sec. */
676             }
677             bit OFPMF_BURST {
678                 position 2;
679                 /* Do burst size. */
680             }
681             bit OFPMF_STATS {
682                 position 3;
683                 /* Collect statistics. */
684             }
685         }
686     }
687
688     typedef meter-band-type {
689         /* ofp_meter_band_type */
690         type enumeration {
691             enum OFPMBT_DROP {
692               value 1;
693               description "Drop packet. ";
694             }
695             enum OFPMBT_DSCP_REMARK {
696               value 2;
697               description "Remark DSCP in the IP header. ";
698             }
699             enum OFPMBT_EXPERIMENTER {
700               value 65535; //0xFFFF
701               description "Experimenter meter band. ";
702             }
703         }
704     }
705
706     typedef table-config {
707         /* ofp_table_config */
708         type bits {
709             bit OFPTC_DEPRECATED_MASK {
710                 /* Deprecated bits */
711                 position 3;
712             }
713         }
714     }
715
716     typedef table-features-prop-type {
717         type enumeration {
718             enum OFPTFPT_INSTRUCTIONS {
719                 value 0; 
720                 description "Instructions property.";
721             }
722             enum OFPTFPT_INSTRUCTIONS_MISS {
723                 value 1; 
724                 description "Instructions for table-miss.";
725             }
726             enum OFPTFPT_NEXT_TABLES {
727                 value 2; 
728                 description "Next Table property.";
729             }
730             enum OFPTFPT_NEXT_TABLES_MISS {
731                 value 3; 
732                 description "Next Table for table-miss.";
733             }
734             enum OFPTFPT_WRITE_ACTIONS {
735                 value 4; 
736                 description "Write Actions property.";
737             }
738             enum OFPTFPT_WRITE_ACTIONS_MISS {
739                 value 5; 
740                 description "Write Actions for table-miss.";
741             }
742             enum OFPTFPT_APPLY_ACTIONS {
743                 value 6; 
744                 description "Apply Actions property.";
745             }
746             enum OFPTFPT_APPLY_ACTIONS_MISS {
747                 value 7; 
748                 description "Apply Actions for table-miss.";
749             }
750             enum OFPTFPT_MATCH {
751                 value 8; 
752                 description "Match property.";
753             }
754             enum OFPTFPT_WILDCARDS {
755                 value 10; 
756                 description "Wildcards property.";
757             }
758             enum OFPTFPT_WRITE_SETFIELD {
759                 value 12; 
760                 description "Write Set-Field property.";
761             }
762             enum OFPTFPT_WRITE_SETFIELD_MISS {
763                 value 13; 
764                 description "Write Set-Field for table-miss.";
765             }
766             enum OFPTFPT_APPLY_SETFIELD {
767                 value 14; 
768                 description "Apply Set-Field property.";
769             }
770             enum OFPTFPT_APPLY_SETFIELD_MISS {
771                 value 15; 
772                 description "Apply Set-Field for table-miss.";
773             }
774             enum OFPTFPT_EXPERIMENTER {
775                 value 65534; 
776                 description "Experimenter property.";
777             }
778             enum OFPTFPT_EXPERIMENTER_MISS {
779                 value 65535; //0xffff 
780                 description "Experimenter for table-miss.";
781             }
782         }
783     }
784
785     typedef group-types {
786         /* ofp_group_type */
787         type bits {
788             bit OFPGT_ALL {
789                 /* All (multicast/broadcast) group. */
790                 position 0;
791             }
792             bit OFPGT_SELECT {
793                 /* Select group. */
794                 position 1;
795             }
796             bit OFPGT_INDIRECT {
797                 /* Indirect group. */
798                 position 2;
799             }
800             bit OFPGT_FF {
801                 /* Fast failover group. */
802                 position 3;
803             }
804         }
805     }
806
807     typedef group-capabilities {
808         /* ofp_group_capabilities */
809         type bits {
810             bit OFPGFC_SELECT_WEIGHT {
811                 /* Support weight for select groups */
812                 position 0;
813             }
814             bit OFPGFC_SELECT_LIVENESS {
815                 /* Support liveness for select groups */
816                 position 1;
817             }
818             bit OFPGFC_CHAINING {
819                 /* Support chaining groups */
820                 position 2;
821             }
822             bit OFPGFC_CHAINING_CHECKS {
823                 /* Check chaining for loops and delete */
824                 position 3;
825             }
826         }
827     }
828
829 }