X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-api%2Fsrc%2Fmain%2Fyang%2Fopenflow-types.yang;h=7750229cd2f2ca0854462bba778be462722ca64b;hb=8d785e650476b80189b86f6ad44c5a24d5ccbf6d;hp=6ccbd386e2616e79fa97385dd43355e510a4f847;hpb=3c8c1e026f04efbca0a8e1bb8a5c87acbac379be;p=openflowjava.git diff --git a/openflow-protocol-api/src/main/yang/openflow-types.yang b/openflow-protocol-api/src/main/yang/openflow-types.yang index 6ccbd386..7750229c 100644 --- a/openflow-protocol-api/src/main/yang/openflow-types.yang +++ b/openflow-protocol-api/src/main/yang/openflow-types.yang @@ -7,8 +7,38 @@ module openflow-types { } typedef port-number { - type uint32 { - range "0..4294967040"; // 0xffffff00 See for actual value + type uint32; + } + + typedef port-number-values { + type enumeration { + enum MAX { + value -256; // 0xffffff00 + } + enum IN_PORT { + value -8; // 0xfffffff8 + } + enum TABLE { + value -7; // 0xfffffff9 + } + enum NORMAL { + value -6; // 0xfffffffa + } + enum FLOOD { + value -5; // 0xfffffffb + } + enum ALL { + value -4; // 0xfffffffc + } + enum CONTROLLER { + value -3; // 0xfffffffd + } + enum LOCAL { + value -2; // 0xfffffffe + } + enum ANY { + value -1; // 0xffffffff + } } } @@ -16,43 +46,43 @@ module openflow-types { ////description "Features of ports available in datapath."; //reference "ofp_port_features"; type bits { - bit 10mb_hd { + bit _10mb_hd { position 0; //description "10 Mb half-duplex rate support."; } - bit 10mb-fd { + bit _10mb-fd { position 1; //description "10 Mb full-duplex rate support."; } - bit 100mb-hd { + bit _100mb-hd { position 2; //description "100 Mb half-duplex rate support."; } - bit 100mb-fd { + bit _100mb-fd { position 3; //description "100 Mb full-duplex rate support."; } - bit 1gb-hd { + bit _1gb-hd { position 4; //description "1 Gb half-duplex rate support."; } - bit 1gb-fd { + bit _1gb-fd { position 5; //description "1 Gb full-duplex rate support."; } - bit 10gb-fd { + bit _10gb-fd { position 6; //description "10 Gb full-duplex rate support."; } - bit 40gb-fd { + bit _40gb-fd { position 7; //description "40 Gb full-duplex rate support."; } - bit 100gb-fd { + bit _100gb-fd { position 8; //description "100 Gb full-duplex rate support."; } - bit 1tb-fd { + bit _1tb-fd { position 9; //description "1 Tb full-duplex rate support."; } @@ -137,16 +167,9 @@ module openflow-types { } identity standard-match-type { - deprecated true; base oft:match-type-base; } - typedef oxm-match-type { - type identityref { - base oft:match-type-base; - } - } - identity instruction { } @@ -238,7 +261,412 @@ module openflow-types { } } } + + typedef hello-failed-code { + type enumeration { + enum INCOMPATIBLE { + value 0; + description "Hello Protocol failed."; + } + enum EPERM { + value 1; + description "Request was not understood."; + } + } + } + + typedef bad-request-code { + type enumeration { + enum BAD_VERSION { + value 0; + } + enum BAD_TYPE { + value 1; + } + enum BAD_MULTIPART { + value 2; + } + enum BAD_EXPERIMENTER { + value 3; + } + enum BAD_EXP_TYPE { + value 4; + } + enum EPERM { + value 5; + } + enum BAD_LEN { + value 6; + } + enum BUFFER_EMPTY { + value 7; + } + enum BUFFER_UNKNOWN { + value 8; + } + enum BAD_TABLE_ID { + value 9; + } + enum IS_SLAVE { + value 10; + } + enum BAD_PORT { + value 11; + } + enum BAD_PACKET { + value 12; + } + enum MULTIPART_BUFFER_OVERFLOW { + value 13; + } + } + } + + typedef bad-action-code { + type enumeration { + enum BAD_TYPE { + value 0; + } + enum BAD_LEN { + value 1; + } + enum BAD_EXPERIMENTER { + value 2; + } + enum BAD_EXP_TYPE { + value 3; + } + enum BAD_OUT_PORT { + value 4; + } + enum BAD_ARGUMENT { + value 5; + } + enum EPERM { + value 6; + } + enum TOO_MANY { + value 7; + } + enum BAD_QUEUE { + value 8; + } + enum BAD_OUT_GROUP { + value 9; + } + enum MATCH_INCONSISTENT { + value 10; + } + enum UNSUPPORTED_ORDER { + value 11; + } + enum BAD_TAG { + value 12; + } + enum BAD_SET_TYPE { + value 13; + } + enum BAD_SET_LEN { + value 14; + } + enum BAD_SET_ARGUMENT { + value 15; + } + } + } + + typedef bad-instruction-code { + type enumeration { + enum UNKNOWN_INST { + value 0; + } + enum UNSUP_INST { + value 1; + } + enum BAD_TABLE_ID { + value 2; + } + enum UNSUP_METADATA { + value 3; + } + enum UNSUP_METADATA_MASK { + value 4; + } + enum BAD_EXPERIMENTER { + value 5; + } + enum BAD_EXP_TYPE { + value 6; + } + enum BAD_LEN { + value 7; + } + enum EPERM { + value 8; + } + } + } + + typedef bad-match-code { + type enumeration { + enum BAD_TYPE { + value 0; + } + enum BAD_LEN { + value 1; + } + enum BAD_TAG { + value 2; + } + enum BAD_DL_ADDR_MASK { + value 3; + } + enum BAD_NW_ADDR_MASK { + value 4; + } + enum BAD_WILDCARDS { + value 5; + } + enum BAD_FIELD { + value 6; + } + enum BAD_VALUE { + value 7; + } + enum BAD_MASK { + value 8; + } + enum BAD_PREREQ { + value 9; + } + enum DUP_FIELD { + value 10; + } + enum EPERM { + value 11; + } + } + } + + typedef flow-mod-failed-code { + type enumeration { + enum UNKNOWN { + value 0; + } + enum TABLE_FULL { + value 1; + } + enum BAD_TABLE_ID { + value 2; + } + enum OVERLAP { + value 3; + } + enum EPERM { + value 4; + } + enum BAD_TIMEOUT { + value 5; + } + enum BAD_COMMAND { + value 6; + } + enum BAD_FLAGS { + value 7; + } + } + } + + typedef group-mod-failed-code { + type enumeration { + enum GROUP_EXISTS { + value 0; + } + enum INVALID_GROUP { + value 1; + } + enum WEIGHT_UNSUPPORTED { + value 2; + } + enum OUT_OF_GROUPS { + value 3; + } + enum OUT_OF_BUCKETS { + value 4; + } + enum CHAINING_UNSUPPORTED { + value 5; + } + enum WATCH_UNSUPPORTED { + value 6; + } + enum LOOP { + value 7; + } + enum UNKNOWN_GROUP { + value 8; + } + enum CHAINED_GROUP { + value 9; + } + enum BAD_TYPE { + value 10; + } + enum BAD_COMMAND { + value 11; + } + enum BAD_BUCKET { + value 12; + } + enum BAD_WATCH { + value 13; + } + enum EPERM { + value 14; + } + } + } + + typedef port-mod-failed-code { + type enumeration { + enum BAD_PORT { + value 0; + } + enum BAD_HW_ADDR { + value 1; + } + enum BAD_CONFIG { + value 2; + } + enum BAD_ADVERTISE { + value 3; + } + enum EPERM { + value 4; + } + } + } + + typedef table-mod-failed-code { + type enumeration { + enum BAD_TABLE { + value 0; + } + enum BAD_CONFIG { + value 1; + } + enum EPERM { + value 2; + } + } + } + typedef queue-op-failed-code { + type enumeration { + enum BAD_PORT { + value 0; + } + enum BAD_QUEUE { + value 1; + } + enum EPERM { + value 2; + } + } + } + + typedef switch-config-failed-code { + type enumeration { + enum BAD_FLAGS { + value 0; + } + enum BAD_LEN { + value 1; + } + enum EPERM { + value 2; + } + } + } + + typedef role-request-failed-code { + type enumeration { + enum STALE { + value 0; + } + enum UNSUP { + value 1; + } + enum BAD_ROLE { + value 2; + } + } + } + + typedef meter-mod-failed-code { + type enumeration { + enum UNKNOWN { + value 0; + } + enum METER_EXISTS { + value 1; + } + enum INVALID_METER { + value 2; + } + enum UNKNOWN_METER { + value 3; + } + enum BAD_COMMAND { + value 4; + } + enum BAD_FLAGS { + value 5; + } + enum BAD_RATE { + value 6; + } + enum BAD_BURST { + value 7; + } + enum BAD_BAND { + value 8; + } + enum BAD_BAND_VALUE { + value 9; + } + enum OUT_OF_METERS { + value 10; + } + enum OUT_OF_BANDS { + value 11; + } + } + } + + typedef table-features-failed-code { + type enumeration { + enum BAD_TABLE { + value 0; + } + enum BAD_METADATA { + value 1; + } + enum BAD_TYPE { + value 2; + } + enum BAD_LEN { + value 3; + } + enum BAD_ARGUMENT { + value 4; + } + enum EPERM { + value 5; + } + } + } + typedef hello-element-type { type enumeration { enum VERSIONBITMAP { @@ -435,6 +863,29 @@ module openflow-types { } } + typedef group { + /* ofp_group - Group numbering. Groups can use any number up to OFPG_MAX.*/ + type enumeration { + enum OFPG_MAX { + value -256; //0xffffff00 + description "Last usable group number"; + } + + /* Fake groups. */ + enum OFPG_ALL { + value -4; //0xfffffffc + description "Represents all groups for group delete commands"; + } + enum OFPG_ANY { + value -1; //0xffffffff + description "Wildcard group used only for flow stats requests. + Selects all flows regardless of group (including flows with no group)"; + + } + } + + } + typedef multipart-request-flags { description "enum ofp_multipart_request_flags "; @@ -735,6 +1186,45 @@ module openflow-types { } } } + + typedef meter-band-type-bitmap { + /* ofp_meter_band_type */ + type bits { + bit OFPMBT_DROP { + position 1; + description "Drop packet. "; + } + bit OFPMBT_DSCP_REMARK { + position 2; + description "Remark DSCP in the IP header. "; + } + } + } + + typedef meter { + /* ofp_meter - Meter numbering. Flow meters can use any number up to OFPM_MAX*/ + type enumeration { + enum OFPM_MAX { + value -65536; //0xffff0000 + description "Last usable meter number"; + } + + /* Virtual meters. */ + enum OFPM_SLOWPATH { + value -3; //0xfffffffd + description "Meter for slow datapath"; + } + enum OFPM_CONTROLLER { + value -2; //0xfffffffe + description "Meter for controller connection"; + } + enum OFPM_ALL { + value -1; //0xffffffff + description "Represents all meters for stat requests commands"; + } + } + + } typedef table-config { /* ofp_table_config */ @@ -861,7 +1351,193 @@ module openflow-types { // OPENFLOW v1.0 STRUCTURES // Structures under this line are needed to support OpenFlow version 1.0 - // wire protocol 0x01; + // wire protocol 0x01; + + typedef error-type-v10 { + type enumeration { + enum HELLO_FAILED { + value 0; + description "Hello Protocol failed."; + } + enum BAD_REQUEST { + value 1; + description "Request was not understood."; + } + enum BAD_ACTION { + value 2; + description "Error in action description."; + } + enum FLOW_MOD_FAILED { + value 3; + description "Problem modifying flow entry."; + } + enum PORT_MOD_FAILED { + value 4; + description "Port mod request failed."; + } + enum QUEUE_OP_FAILED { + value 5; + description "Queue operation failed."; + } + } + } + + typedef hello-failed-code-v10 { + type enumeration { + enum INCOMPATIBLE { + value 0; + description "Hello Protocol failed."; + } + enum EPERM { + value 1; + description "Request was not understood."; + } + } + } + + typedef bad-request-code-v10 { + type enumeration { + enum BAD_VERSION { + value 0; + } + enum BAD_TYPE { + value 1; + } + enum BAD_STAT { + value 2; + } + enum BAD_VENDOR { + value 3; + } + enum BAD_SUBTYPE { + value 4; + } + enum EPERM { + value 5; + } + enum BAD_LEN { + value 6; + } + enum BUFFER_EMPTY { + value 7; + } + enum BUFFER_UNKNOWN { + value 8; + } + } + } + + typedef bad-action-code-v10 { + type enumeration { + enum BAD_TYPE { + value 0; + } + enum BAD_LEN { + value 1; + } + enum VENDOR { + value 2; + } + enum BAD_VENDOR_TYPE { + value 3; + } + enum BAD_OUT_PORT { + value 4; + } + enum BAD_ARGUMENT { + value 5; + } + enum EPERM { + value 6; + } + enum TOO_MANY { + value 7; + } + enum BAD_QUEUE { + value 8; + } + } + } + + typedef flow-mod-failed-code-v10 { + type enumeration { + enum ALL_TABLES_FULL { + value 0; + } + enum OVERLAP { + value 1; + } + enum EPERM { + value 2; + } + enum BAD_EMERG_TIMEOUT { + value 3; + } + enum BAD_COMMAND { + value 4; + } + enum UNSUPPORTED { + value 5; + } + } + } + + typedef port-mod-failed-code-v10 { + type enumeration { + enum BAD_PORT { + value 0; + } + enum BAD_HW_ADDR { + value 1; + } + } + } + + typedef queue-op-failed-code-v10 { + type enumeration { + enum BAD_PORT { + value 0; + } + enum BAD_QUEUE { + value 1; + } + enum EPERM { + value 2; + } + } + } + + typedef port-number-values-v10 { + type enumeration { + enum MAX { + value 65280; // 0xff00 + } + enum IN_PORT { + value 65528; // 0xfff8 + } + enum TABLE { + value 65529; // 0xfff9 + } + enum NORMAL { + value 65530; // 0xfffa + } + enum FLOOD { + value 65531; // 0xfffb + } + enum ALL { + value 65532; // 0xfffc + } + enum CONTROLLER { + value 65533; // 0xfffd + } + enum LOCAL { + value 65534; // 0xfffe + } + enum NONE { + value 65535; // 0xffff + } + } + } typedef port-config-v10 { description @@ -918,24 +1594,19 @@ module openflow-types { position 2; } bit stp_listen { - //description "Live for Fast Failover Group."; - position 8; + //description "Not learning or relaying frames."; } bit stp_learn { - //description "Live for Fast Failover Group."; - position 8; + //description "Learning but not relaying frames."; } bit stp_forward { - //description "Live for Fast Failover Group."; - position 8; + //description "Learning and relaying frames."; } bit stp_block { - //description "Live for Fast Failover Group."; - position 8; + //description "Not part of spanning tree."; } bit stp_mask { - //description "Live for Fast Failover Group."; - position 8; + //description "Bit mask for OFPPS_STP_* values."; } } } @@ -944,31 +1615,31 @@ module openflow-types { ////description "Features of ports available in datapath."; //reference "ofp_port_features"; type bits { - bit 10mb-hd { + bit _10mb-hd { position 0; //description "10 Mb half-duplex rate support."; } - bit 10mb-fd { + bit _10mb-fd { position 1; //description "10 Mb full-duplex rate support."; } - bit 100mb-hd { + bit _100mb-hd { position 2; //description "100 Mb half-duplex rate support."; } - bit 100mb-fd { + bit _100mb-fd { position 3; //description "100 Mb full-duplex rate support."; } - bit 1gb-hd { + bit _1gb-hd { position 4; //description "1 Gb half-duplex rate support."; } - bit 1gb-fd { + bit _1gb-fd { position 5; //description "1 Gb full-duplex rate support."; } - bit 10gb-fd { + bit _10gb-fd { position 6; //description "10 Gb full-duplex rate support."; } @@ -1108,32 +1779,54 @@ module openflow-types { } } - typedef error-type-v10 { - type enumeration { - enum HELLO_FAILED { - value 0; - description "Hello Protocol failed."; + typedef flow-wildcards-v10 { + /* ofp_flow_wildcards */ + type bits { + bit IN_PORT { + position 0; + /* Switch input port. */ } - enum BAD_REQUEST { - value 1; - description "Request was not understood."; + bit DL_VLAN { + position 1; + /* Switch input port. */ } - enum BAD_ACTION { - value 2; - description "Error in action description."; + bit DL_SRC { + position 2; + /* Switch input port. */ } - enum FLOW_MOD_FAILED { - value 3; - description "Problem modifying flow entry."; + bit DL_DST { + position 3; + /* Switch input port. */ } - enum PORT_MOD_FAILED { - value 4; - description "Port mod request failed."; + bit DL_TYPE { + position 4; + /* Switch input port. */ } - enum QUEUE_OP_FAILED { - value 5; - description "Queue operation failed."; + bit NW_PROTO { + position 5; + /* Switch input port. */ + } + bit TP_SRC { + position 6; + /* Switch input port. */ + } + bit TP_DST { + position 7; + /* Switch input port. */ + } + bit DL_VLAN_PCP { + position 20; + /* Switch input port. */ + } + bit NW_TOS { + position 21; + /* Switch input port. */ + } + bit ALL { + position 22; + /* Switch input port. */ } } } + }