1 module openflow-types {
2 namespace "urn:opendaylight:openflow:common:types";
5 revision "2013-07-31" {
6 //description "OpenFlow 1.3 - common types model";
13 typedef port-number-values {
16 value -256; // 0xffffff00
17 description "Hello Protocol failed.";
20 value -8; // 0xfffffff8
21 description "Request was not understood.";
24 value -7; // 0xfffffff9
25 description "Error in action description.";
28 value -6; // 0xfffffffa
29 description "Error in instruction list.";
32 value -5; // 0xfffffffb
33 description "Error in match.";
36 value -4; // 0xfffffffc
37 description "Problem modifying flow entry.";
40 value -3; // 0xfffffffd
41 description "Problem modifying group entry.";
44 value -2; // 0xfffffffe
45 description "Port mod request failed.";
48 value -1; // 0xffffffff
49 description "Table mod request failed.";
54 typedef port-features {
55 ////description "Features of ports available in datapath.";
56 //reference "ofp_port_features";
60 //description "10 Mb half-duplex rate support.";
64 //description "10 Mb full-duplex rate support.";
68 //description "100 Mb half-duplex rate support.";
72 //description "100 Mb full-duplex rate support.";
76 //description "1 Gb half-duplex rate support.";
80 //description "1 Gb full-duplex rate support.";
84 //description "10 Gb full-duplex rate support.";
88 //description "40 Gb full-duplex rate support.";
92 //description "100 Gb full-duplex rate support.";
96 //description "1 Tb full-duplex rate support.";
100 //description "Other rate, not in the list.";
104 //description "Copper medium.";
108 //description "Fiber medium.";
112 //description "Auto-negotiation.";
116 //description "Pause.";
120 //description "Asymmetric pause.";
125 typedef port-config {
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.";
132 //description " Port is administratively down.";
136 //description " Drop all packets received by port.";
140 //description " Drop packets forwarded to port.";
144 //description "Do not send packet-in msgs for port.";
152 "Current state of the physical port. These are not configurable from
156 //description "No physical link present.";
160 //description "Port is blocked";
164 //description "Live for Fast Failover Group.";
170 identity match-type-base {
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.";
178 identity standard-match-type {
180 base oft:match-type-base;
183 typedef oxm-match-type {
185 base oft:match-type-base;
189 identity instruction {
220 description "Hello Protocol failed.";
224 description "Request was not understood.";
228 description "Error in action description.";
230 enum BAD_INSTRUCTION {
232 description "Error in instruction list.";
236 description "Error in match.";
238 enum FLOW_MOD_FAILED {
240 description "Problem modifying flow entry.";
242 enum GROUP_MOD_FAILED {
244 description "Problem modifying group entry.";
246 enum PORT_MOD_FAILED {
248 description "Port mod request failed.";
250 enum TABLE_MOD_FAILED {
252 description "Table mod request failed.";
254 enum QUEUE_OP_FAILED {
256 description "Queue operation failed.";
258 enum SWITCH_CONFIG_FAILED {
260 description "Switch config request failed.";
262 enum ROLE_REQUEST_FAILED {
264 description "Controller Role request failed.";
266 enum METER_MOD_FAILED {
268 description "Error in meter.";
270 enum TABLE_FEATURES_FAILED {
272 description "Setting table features failed.";
275 value 65535; //0xffff
276 description "Experimenter error messages.";
281 typedef hello-element-type {
285 description "Bitmap of version supported.";
290 typedef capabilities {
292 bit OFPC_FLOW_STATS {
294 /* Flow statistics. */
296 bit OFPC_TABLE_STATS {
298 /* Table statistics. */
300 bit OFPC_PORT_STATS {
302 /* Port statistics. */
304 bit OFPC_GROUP_STATS {
306 /* Group statistics. */
310 /* Can reassemble IP fragments. */
312 bit OFPC_QUEUE_STATS {
314 /* Queue statistics. */
316 bit OFPC_PORT_BLOCKED {
318 /* Switch will block looping ports. */
323 typedef switch-config-flag {
324 /* Handling of IP fragments. */
328 description "No special handling for fragments.";
330 enum OFPC_FRAG_DROP {
332 description "Drop fragments.";
334 enum OFPC_FRAG_REASM {
336 description "Reassemble (only if OFPC_IP_REASM set).";
338 enum OFPC_FRAG_MASK {
344 typedef flow-removed-reason {
347 enum OFPRR_IDLE_TIMEOUT {
349 description "Flow idle time exceeded idle_timeout.";
351 enum OFPRR_HARD_TIMEOUT {
353 description "Time exceeded hard_timeout.";
357 description "Evicted by a DELETE flow mod.";
359 enum OFPRR_GROUP_DELETE {
361 description "Group was removed.";
366 typedef port-reason {
371 description "The port was added.";
375 description "he port was removed.";
379 description "Some attribute of the port has changed.";
384 typedef flow-mod-command {
385 /* ofp_flow_mod_command */
389 description "New flow.";
393 description "Modify all matching flows.";
395 enum OFPFC_MODIFY_STRICT {
397 description "Modify entry strictly matching wildcards and priority.";
401 description "Delete all matching flows.";
403 enum OFPFC_DELETE_STRICT {
405 description "Delete entry strictly matching wildcards and priority.";
410 typedef flow-mod-flags {
411 /* ofp_flow_mod_flags */
413 bit OFPFF_SEND_FLOW_REM {
415 /* Send flow removed message when flow expires or is deleted. */
417 bit OFPFF_CHECK_OVERLAP {
419 /* Check for overlapping entries first. */
421 bit OFPFF_RESET_COUNTS {
423 /* Reset flow packet and byte counts. */
425 bit OFPFF_NO_PKT_COUNTS {
427 /* Don't keep track of packet count. */
429 bit OFPFF_NO_BYT_COUNTS {
431 /* Don't keep track of byte count. */
436 typedef group-mod-command {
437 /* ofp_group_mod_command */
441 description "New group.";
445 description "Modify all matching groups.";
449 description "Delete all matching groups.";
460 description "All (multicast/broadcast) group.";
464 description "Select group.";
466 enum OFPGT_INDIRECT {
468 description "Indirect group.";
472 description "Fast failover group.";
478 /* ofp_group - Group numbering. Groups can use any number up to OFPG_MAX.*/
481 value -256; //0xffffff00
482 description "Last usable group number";
487 value -4; //0xfffffffc
488 description "Represents all groups for group delete commands";
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)";
500 typedef multipart-request-flags {
502 "enum ofp_multipart_request_flags ";
504 bit OFPMPF_REQ_MORE {
505 //description "More requests to follow.";
511 typedef multipart-type {
512 /* ofp_multipart_type */
516 description "Description of this OpenFlow switch.
517 The request body is empty.
518 The reply body is struct ofp_desc.";
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.";
526 enum OFPMP_AGGREGATE {
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.";
534 description "Flow table statistics.
535 The request body is empty.
536 The reply body is an array of struct ofp_table_stats.";
538 enum OFPMP_PORT_STATS {
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.";
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";
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.";
556 enum OFPMP_GROUP_DESC {
558 description "Group description.
559 The request body is empty.
560 The reply body is an array of struct ofp_group_desc.";
562 enum OFPMP_GROUP_FEATURES {
564 description "Group features.
565 The request body is empty.
566 The reply body is struct ofp_group_features.";
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.";
574 enum OFPMP_METER_CONFIG {
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.";
580 enum OFPMP_METER_FEATURES {
582 description "Meter features.
583 The request body is empty.
584 The reply body is struct ofp_meter_features.";
586 enum OFPMP_TABLE_FEATURES {
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.";
595 enum OFPMP_PORT_DESC {
597 description "Port description.
598 The request body is empty.
599 The reply body is an array of struct ofp_port.";
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.";
611 typedef queue-properties {
612 /* ofp_queue_properties */
616 description "No property defined for queue (default).";
618 enum OFPQT_MIN_RATE {
620 description "Minimum datarate guaranteed.";
622 enum OFPQT_MAX_RATE {
624 description "Maximum datarate.";
626 enum OFPQT_EXPERIMENTER {
627 value 65535; // 0xffff
628 description "Experimenter defined property.";
633 typedef controller-role {
634 /* ofp_controller_role */
636 enum OFPCR_ROLE_NOCHANGE {
638 description "Don’t change current role.";
640 enum OFPCR_ROLE_EQUAL {
642 description "Default role, full access.";
644 enum OFPCR_ROLE_MASTER {
646 description "Full access, at most one master.";
648 enum OFPCR_ROLE_SLAVE {
650 description "Read-only access.";
655 typedef packet-in-reason {
656 /* ofp_packet_in_reason */
660 description "No matching flow (table-miss flow entry). ";
664 description "Action explicitly output to controller. ";
666 enum OFPR_INVALID_TTL {
668 description "Packet has invalid TTL ";
673 typedef action-type {
674 /* ofp_action_type */
678 /* Output to switch port. */
680 bit OFPAT_COPY_TTL_OUT {
682 /* Copy TTL "outwards" -- from next-to-outermost to outermost */
684 bit OFPAT_COPY_TTL_IN {
686 /* Copy TTL "inwards" -- from outermost to next-to-outermost */
688 bit OFPAT_SET_MPLS_TTL {
692 bit OFPAT_DEC_MPLS_TTL {
694 /* Decrement MPLS TTL */
696 bit OFPAT_PUSH_VLAN {
698 /* Push a new VLAN tag */
702 /* Pop the outer VLAN tag */
704 bit OFPAT_PUSH_MPLS {
706 /* Push a new MPLS tag */
710 /* Pop the outer MPLS tag */
712 bit OFPAT_SET_QUEUE {
714 /* Set queue id when outputting to a port */
720 bit OFPAT_SET_NW_TTL {
724 bit OFPAT_DEC_NW_TTL {
726 /* Decrement IP TTL. */
728 bit OFPAT_SET_FIELD {
730 /* Set a header field using OXM TLV format. */
734 /* Push a new PBB service tag (I-TAG) */
738 /* Pop the outer PBB service tag (I-TAG) */
740 bit OFPAT_EXPERIMENTER {
746 typedef meter-mod-command {
747 /* ofp_meter_mod_command */
750 description "New meter. ";
753 description "Modify specified meter. ";
756 description "Delete specified meter. ";
761 typedef meter-flags {
762 /* ofp_meter_flags */
766 /* Rate value in kb/s (kilo-bit per second). */
770 /* Rate value in packet/sec. */
778 /* Collect statistics. */
783 typedef meter-band-type {
784 /* ofp_meter_band_type */
788 description "Drop packet. ";
790 enum OFPMBT_DSCP_REMARK {
792 description "Remark DSCP in the IP header. ";
794 enum OFPMBT_EXPERIMENTER {
795 value 65535; //0xFFFF
796 description "Experimenter meter band. ";
802 /* ofp_meter - Meter numbering. Flow meters can use any number up to OFPM_MAX*/
805 value -65536; //0xffff0000
806 description "Last usable meter number";
809 /* Virtual meters. */
811 value -3; //0xfffffffd
812 description "Meter for slow datapath";
814 enum OFPM_CONTROLLER {
815 value -2; //0xfffffffe
816 description "Meter for controller connection";
819 value -1; //0xffffffff
820 description "Represents all meters for stat requests commands";
826 typedef table-config {
827 /* ofp_table_config */
829 bit OFPTC_DEPRECATED_MASK {
830 /* Deprecated bits */
836 typedef table-features-prop-type {
838 enum OFPTFPT_INSTRUCTIONS {
840 description "Instructions property.";
842 enum OFPTFPT_INSTRUCTIONS_MISS {
844 description "Instructions for table-miss.";
846 enum OFPTFPT_NEXT_TABLES {
848 description "Next Table property.";
850 enum OFPTFPT_NEXT_TABLES_MISS {
852 description "Next Table for table-miss.";
854 enum OFPTFPT_WRITE_ACTIONS {
856 description "Write Actions property.";
858 enum OFPTFPT_WRITE_ACTIONS_MISS {
860 description "Write Actions for table-miss.";
862 enum OFPTFPT_APPLY_ACTIONS {
864 description "Apply Actions property.";
866 enum OFPTFPT_APPLY_ACTIONS_MISS {
868 description "Apply Actions for table-miss.";
872 description "Match property.";
874 enum OFPTFPT_WILDCARDS {
876 description "Wildcards property.";
878 enum OFPTFPT_WRITE_SETFIELD {
880 description "Write Set-Field property.";
882 enum OFPTFPT_WRITE_SETFIELD_MISS {
884 description "Write Set-Field for table-miss.";
886 enum OFPTFPT_APPLY_SETFIELD {
888 description "Apply Set-Field property.";
890 enum OFPTFPT_APPLY_SETFIELD_MISS {
892 description "Apply Set-Field for table-miss.";
894 enum OFPTFPT_EXPERIMENTER {
896 description "Experimenter property.";
898 enum OFPTFPT_EXPERIMENTER_MISS {
899 value 65535; //0xffff
900 description "Experimenter for table-miss.";
905 typedef group-types {
909 /* All (multicast/broadcast) group. */
917 /* Indirect group. */
921 /* Fast failover group. */
927 typedef group-capabilities {
928 /* ofp_group_capabilities */
930 bit OFPGFC_SELECT_WEIGHT {
931 /* Support weight for select groups */
934 bit OFPGFC_SELECT_LIVENESS {
935 /* Support liveness for select groups */
938 bit OFPGFC_CHAINING {
939 /* Support chaining groups */
942 bit OFPGFC_CHAINING_CHECKS {
943 /* Check chaining for loops and delete */
949 // OPENFLOW v1.0 STRUCTURES
950 // Structures under this line are needed to support OpenFlow version 1.0
951 // wire protocol 0x01;
953 typedef port-number-values-v10 {
956 value 65280; // 0xff00
957 description "Hello Protocol failed.";
960 value 65528; // 0xfff8
961 description "Request was not understood.";
964 value 65529; // 0xfff9
965 description "Error in action description.";
968 value 65530; // 0xfffa
969 description "Error in instruction list.";
972 value 65531; // 0xfffb
973 description "Error in match.";
976 value 65532; // 0xfffc
977 description "Problem modifying flow entry.";
980 value 65533; // 0xfffd
981 description "Problem modifying group entry.";
984 value 65534; // 0xfffe
985 description "Port mod request failed.";
988 value 65535; // 0xffff
989 description "Table mod request failed.";
994 typedef port-config-v10 {
996 "Flags to indicate behavior of the physical port. These flags are
997 describe the current configuration and used port_mod message
998 to configure the port's behavior.";
1001 //description " Port is administratively down.";
1005 //description" Disable 802.1D spanning tree on port.";
1009 //description " Drop all packets received by port.";
1013 //description " Drop received 802.1D STP packets.";
1017 //description " Do not include this port when flooding.";
1021 //description " Drop packets forwarded to port.";
1025 //description "Do not send packet-in msgs for port.";
1031 typedef port-state-v10 {
1033 "Current state of the physical port. These are not configurable from
1037 //description "No physical link present.";
1041 //description "Port is blocked";
1045 //description "Live for Fast Failover Group.";
1049 //description "Live for Fast Failover Group.";
1053 //description "Live for Fast Failover Group.";
1057 //description "Live for Fast Failover Group.";
1061 //description "Live for Fast Failover Group.";
1065 //description "Live for Fast Failover Group.";
1071 typedef port-features-v10 {
1072 ////description "Features of ports available in datapath.";
1073 //reference "ofp_port_features";
1077 //description "10 Mb half-duplex rate support.";
1081 //description "10 Mb full-duplex rate support.";
1085 //description "100 Mb half-duplex rate support.";
1089 //description "100 Mb full-duplex rate support.";
1093 //description "1 Gb half-duplex rate support.";
1097 //description "1 Gb full-duplex rate support.";
1101 //description "10 Gb full-duplex rate support.";
1105 //description "Copper medium.";
1109 //description "Fiber medium.";
1113 //description "Auto-negotiation.";
1117 //description "Pause.";
1121 //description "Asymmetric pause.";
1126 typedef capabilities-v10 {
1128 bit OFPC_FLOW_STATS {
1130 /* Flow statistics. */
1132 bit OFPC_TABLE_STATS {
1134 /* Table statistics. */
1136 bit OFPC_PORT_STATS {
1138 /* Port statistics. */
1142 /* 802.1d spanning tree. */
1146 /* Reserved, must be zero. */
1150 /* Can reassemble IP fragments. */
1152 bit OFPC_QUEUE_STATS {
1154 /* Queue statistics. */
1156 bit OFPC_ARP_MATCH_IP {
1158 /* Match IP addresses in ARP pkts. */
1163 typedef flow-mod-flags-v10 {
1164 /* ofp_flow_mod_flags */
1166 bit OFPFF_SEND_FLOW_REM {
1168 /* Send flow removed message when flow expires or is deleted. */
1170 bit OFPFF_CHECK_OVERLAP {
1172 /* Check for overlapping entries first. */
1176 /* Reset flow packet and byte counts. */
1181 typedef action-type-v10 {
1182 /* ofp_action_type */
1186 /* Output to switch port. */
1188 bit OFPAT_SET_VLAN_VID {
1190 /* Set the 802.1q VLAN id. */
1192 bit OFPAT_SET_VLAN_PCP {
1194 /* Set the 802.1q priority. */
1196 bit OFPAT_STRIP_VLAN {
1198 /* Strip the 802.1q header. */
1200 bit OFPAT_SET_DL_SRC {
1202 /* Ethernet source address. */
1204 bit OFPAT_SET_DL_DST {
1206 /* Ethernet destination address. */
1208 bit OFPAT_SET_NW_SRC {
1210 /* IP source address. */
1212 bit OFPAT_SET_NW_DST {
1214 /* IP destination address. */
1216 bit OFPAT_SET_NW_TOS {
1218 /* IP ToS (DSCP field, 6 bits). */
1220 bit OFPAT_SET_TP_SRC {
1222 /* TCP/UDP source port. */
1224 bit OFPAT_SET_TP_DST {
1226 /* TCP/UDP destination port. */
1230 /* Output to queue. */
1234 /* Experimenter in later versions */
1239 typedef error-type-v10 {
1243 description "Hello Protocol failed.";
1247 description "Request was not understood.";
1251 description "Error in action description.";
1253 enum FLOW_MOD_FAILED {
1255 description "Problem modifying flow entry.";
1257 enum PORT_MOD_FAILED {
1259 description "Port mod request failed.";
1261 enum QUEUE_OP_FAILED {
1263 description "Queue operation failed.";