From b4581d183065af6b82026003959b96fbe6850dd1 Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Fri, 16 Jun 2017 14:36:52 +0200 Subject: Rename yang files to match model revision Also order of revisions was sorted starting from most current. Change-Id: I21fd35cfdb1cc5601b3fb40c9f3755bd3b995b14 Signed-off-by: Marek Gradzki --- .../api/src/main/yang/interface-policer.yang | 63 ----- .../main/yang/interface-policer@2017-03-15.yang | 63 +++++ vpp-classifier/api/src/main/yang/policer.yang | 287 --------------------- .../api/src/main/yang/policer@2017-03-15.yang | 287 +++++++++++++++++++++ .../api/src/main/yang/vpp-classifier-acl.yang | 68 ----- .../main/yang/vpp-classifier-acl@2017-05-03.yang | 68 +++++ .../api/src/main/yang/vpp-classifier-context.yang | 72 ------ .../yang/vpp-classifier-context@2017-05-02.yang | 72 ++++++ .../api/src/main/yang/vpp-classifier.yang | 250 ------------------ .../src/main/yang/vpp-classifier@2017-03-27.yang | 250 ++++++++++++++++++ .../api/src/main/yang/vpp-interface-acl.yang | 32 --- .../main/yang/vpp-interface-acl@2017-03-15.yang | 32 +++ .../api/src/main/yang/vpp-subinterface-acl.yang | 36 --- .../main/yang/vpp-subinterface-acl@2017-03-15.yang | 36 +++ 14 files changed, 808 insertions(+), 808 deletions(-) delete mode 100644 vpp-classifier/api/src/main/yang/interface-policer.yang create mode 100644 vpp-classifier/api/src/main/yang/interface-policer@2017-03-15.yang delete mode 100644 vpp-classifier/api/src/main/yang/policer.yang create mode 100644 vpp-classifier/api/src/main/yang/policer@2017-03-15.yang delete mode 100644 vpp-classifier/api/src/main/yang/vpp-classifier-acl.yang create mode 100644 vpp-classifier/api/src/main/yang/vpp-classifier-acl@2017-05-03.yang delete mode 100644 vpp-classifier/api/src/main/yang/vpp-classifier-context.yang create mode 100644 vpp-classifier/api/src/main/yang/vpp-classifier-context@2017-05-02.yang delete mode 100644 vpp-classifier/api/src/main/yang/vpp-classifier.yang create mode 100644 vpp-classifier/api/src/main/yang/vpp-classifier@2017-03-27.yang delete mode 100644 vpp-classifier/api/src/main/yang/vpp-interface-acl.yang create mode 100644 vpp-classifier/api/src/main/yang/vpp-interface-acl@2017-03-15.yang delete mode 100644 vpp-classifier/api/src/main/yang/vpp-subinterface-acl.yang create mode 100644 vpp-classifier/api/src/main/yang/vpp-subinterface-acl@2017-03-15.yang (limited to 'vpp-classifier') diff --git a/vpp-classifier/api/src/main/yang/interface-policer.yang b/vpp-classifier/api/src/main/yang/interface-policer.yang deleted file mode 100644 index 2fd7b6b83..000000000 --- a/vpp-classifier/api/src/main/yang/interface-policer.yang +++ /dev/null @@ -1,63 +0,0 @@ -module interface-policer { - - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:interface:policer"; - prefix "ifc-policer"; - - description - "This YANG module defines policer configuration and - operational data for interfaces in VPP. - Mapped to policer_classify_set_interface: - https://git.fd.io/vpp/tree/src/vnet/classify/classify.api#n119"; - - revision "2017-03-15" { - description "Initial revision of policer model"; - } - - import vpp-classifier { - prefix "vpp-classifier"; - } - - import ietf-interfaces { - prefix "if"; - } - - import yang-ext { - prefix "ext"; - } - - grouping interface-policer-attributes { - container policer { - description - "Defines references to policer classify tables. - At least one table reference should be specified."; - leaf l2-table { - type vpp-classifier:classify-table-ref; - description - "An L2 policer table"; - } - leaf ip4-table { - type vpp-classifier:classify-table-ref; - description - "An IPv4 policer table"; - } - leaf ip6-table { - type vpp-classifier:classify-table-ref; - description - "An IPv6 policer table"; - } - } - } - - augment /if:interfaces/if:interface { - ext:augment-identifier "policer-interface-augmentation"; - - uses interface-policer-attributes; - } - - augment /if:interfaces-state/if:interface { - ext:augment-identifier "policer-interface-state-augmentation"; - - uses interface-policer-attributes; - } -} \ No newline at end of file diff --git a/vpp-classifier/api/src/main/yang/interface-policer@2017-03-15.yang b/vpp-classifier/api/src/main/yang/interface-policer@2017-03-15.yang new file mode 100644 index 000000000..2fd7b6b83 --- /dev/null +++ b/vpp-classifier/api/src/main/yang/interface-policer@2017-03-15.yang @@ -0,0 +1,63 @@ +module interface-policer { + + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:interface:policer"; + prefix "ifc-policer"; + + description + "This YANG module defines policer configuration and + operational data for interfaces in VPP. + Mapped to policer_classify_set_interface: + https://git.fd.io/vpp/tree/src/vnet/classify/classify.api#n119"; + + revision "2017-03-15" { + description "Initial revision of policer model"; + } + + import vpp-classifier { + prefix "vpp-classifier"; + } + + import ietf-interfaces { + prefix "if"; + } + + import yang-ext { + prefix "ext"; + } + + grouping interface-policer-attributes { + container policer { + description + "Defines references to policer classify tables. + At least one table reference should be specified."; + leaf l2-table { + type vpp-classifier:classify-table-ref; + description + "An L2 policer table"; + } + leaf ip4-table { + type vpp-classifier:classify-table-ref; + description + "An IPv4 policer table"; + } + leaf ip6-table { + type vpp-classifier:classify-table-ref; + description + "An IPv6 policer table"; + } + } + } + + augment /if:interfaces/if:interface { + ext:augment-identifier "policer-interface-augmentation"; + + uses interface-policer-attributes; + } + + augment /if:interfaces-state/if:interface { + ext:augment-identifier "policer-interface-state-augmentation"; + + uses interface-policer-attributes; + } +} \ No newline at end of file diff --git a/vpp-classifier/api/src/main/yang/policer.yang b/vpp-classifier/api/src/main/yang/policer.yang deleted file mode 100644 index 637967128..000000000 --- a/vpp-classifier/api/src/main/yang/policer.yang +++ /dev/null @@ -1,287 +0,0 @@ -module policer { - - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:policer"; - prefix "policer"; - - description - "VPP specific configuration of policer messages. Mapped to policer API: - https://git.fd.io/vpp/tree/src/vnet/policer/policer.api - - Partially based on - https://tools.ietf.org/html/draft-asechoud-netmod-qos-model-02"; - - reference - "https://docs.fd.io/vpp/17.04/clicmd_src_vnet_policer.html"; - - revision "2017-03-15" { - description "Initial revision of policer model"; - } - - import ietf-inet-types { - prefix inet; - } - - typedef policer-ref { - type leafref { - path "/policers/policer/name"; - } - description - "This type is used by data models that need to reference - configured policer."; - } - - typedef color-classfier { - type enumeration { - enum conform-color; - enum exceed-color; - } - default conform-color; - } - - typedef meter-type { - type enumeration { - enum 1r2c; - enum 1r3c; - enum 2r3c-2698; - enum 2r3c-4115; - enum 2r3c-mef5cf1; - } - default 1r2c; - } - - typedef policer-round-type { - type enumeration { - enum closest; - enum up; - enum down; - } - default closest; - } - - typedef policer-rate-type { - type enumeration { - enum kbps; - enum pps; - } - default kbps; - } - - // adapted from draft-asechoud-netmod-qos-model-02 - identity meter-action-type { - description - "action type in a meter"; - } - - identity meter-action-drop { - base meter-action-type; - description - "drop action type in a meter"; - } - - identity meter-action-mark-dscp { - base meter-action-type; - description - "dscp mark and transmit action type in a meter"; - } - - identity meter-action-transmit { - base meter-action-type; - description - "transmit action type in a meter"; - } - - typedef vpp-dscp-type { - description - "DSCP field values supported by VPP"; - type enumeration { - enum CS0 { - value 0; - } - enum CS1 { - value 8; - } - enum AF11 { - value 10; - } - enum AF12 { - value 12; - } - enum AF13 { - value 14; - } - enum CS2 { - value 16; - } - enum AF21 { - value 18; - } - enum AF22 { - value 20; - } - enum AF23 { - value 22; - } - enum CS3 { - value 24; - } - enum AF31 { - value 26; - } - enum AF32 { - value 28; - } - enum AF33 { - value 30; - } - enum CS4 { - value 32; - } - enum AF41 { - value 34; - } - enum AF42 { - value 36; - } - enum AF43 { - value 38; - } - enum CS5 { - value 40; - } - enum EF { - value 46; - } - enum CS6 { - value 48; - } - enum CS7 { - value 50; - } - } - default CS0; - } - - typedef dscp-type { - type union { - type vpp-dscp-type; - type inet:dscp; - } - } - - grouping meter-action-params { - description - "meter action parameters"; - leaf meter-action-type { - mandatory true; - type identityref { - base meter-action-type; - } - description - "meter action type"; - } - leaf dscp { - when "../meter-action-type = meter-action-mark-dscp"; - type dscp-type; - description - "dscp marking"; - } - } - - grouping policer-base-attributes { - leaf cir { - type uint32; - } - leaf eir { - type uint32; - } - leaf cb { - type uint64; - description "Committed Burst"; - } - leaf eb { - type uint64; - description "Excess or Peak Bursnatt"; - } - leaf rate-type { - type policer-rate-type; - } - leaf round-type { - type policer-round-type; - } - leaf type { - type meter-type; - description "policer algorithm"; - } - leaf color-aware { - type boolean; - } - container conform-action { - presence "Defines conform action"; - uses meter-action-params; - } - container exceed-action { - presence "Defines exceed action"; - uses meter-action-params; - } - container violate-action { - presence "Defines violate action"; - uses meter-action-params; - } - } - - grouping policer-operational-attributes { - leaf single-rate { - type boolean; - } - leaf scale { - type uint32; - } - leaf cir-tokens-per-period { - type uint32; - } - leaf pir_tokens-per-period { - type uint32; - } - leaf current-limit { - type uint32; - } - leaf current-bucket { - type uint32; - } - leaf extended-limit { - type uint32; - } - leaf extended-bucket { - type uint32; - } - leaf last-update-time { - type uint64; - } - } - - container policers { - list policer { - key name; - leaf name { - type string { - length 1..63; - } - } - uses policer-base-attributes; - } - } - - container policers-state { - list policer { - key name; - leaf name { - type string { - length 1..63; - } - } - uses policer-base-attributes; - uses policer-operational-attributes; - } - } -} diff --git a/vpp-classifier/api/src/main/yang/policer@2017-03-15.yang b/vpp-classifier/api/src/main/yang/policer@2017-03-15.yang new file mode 100644 index 000000000..637967128 --- /dev/null +++ b/vpp-classifier/api/src/main/yang/policer@2017-03-15.yang @@ -0,0 +1,287 @@ +module policer { + + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:policer"; + prefix "policer"; + + description + "VPP specific configuration of policer messages. Mapped to policer API: + https://git.fd.io/vpp/tree/src/vnet/policer/policer.api + + Partially based on + https://tools.ietf.org/html/draft-asechoud-netmod-qos-model-02"; + + reference + "https://docs.fd.io/vpp/17.04/clicmd_src_vnet_policer.html"; + + revision "2017-03-15" { + description "Initial revision of policer model"; + } + + import ietf-inet-types { + prefix inet; + } + + typedef policer-ref { + type leafref { + path "/policers/policer/name"; + } + description + "This type is used by data models that need to reference + configured policer."; + } + + typedef color-classfier { + type enumeration { + enum conform-color; + enum exceed-color; + } + default conform-color; + } + + typedef meter-type { + type enumeration { + enum 1r2c; + enum 1r3c; + enum 2r3c-2698; + enum 2r3c-4115; + enum 2r3c-mef5cf1; + } + default 1r2c; + } + + typedef policer-round-type { + type enumeration { + enum closest; + enum up; + enum down; + } + default closest; + } + + typedef policer-rate-type { + type enumeration { + enum kbps; + enum pps; + } + default kbps; + } + + // adapted from draft-asechoud-netmod-qos-model-02 + identity meter-action-type { + description + "action type in a meter"; + } + + identity meter-action-drop { + base meter-action-type; + description + "drop action type in a meter"; + } + + identity meter-action-mark-dscp { + base meter-action-type; + description + "dscp mark and transmit action type in a meter"; + } + + identity meter-action-transmit { + base meter-action-type; + description + "transmit action type in a meter"; + } + + typedef vpp-dscp-type { + description + "DSCP field values supported by VPP"; + type enumeration { + enum CS0 { + value 0; + } + enum CS1 { + value 8; + } + enum AF11 { + value 10; + } + enum AF12 { + value 12; + } + enum AF13 { + value 14; + } + enum CS2 { + value 16; + } + enum AF21 { + value 18; + } + enum AF22 { + value 20; + } + enum AF23 { + value 22; + } + enum CS3 { + value 24; + } + enum AF31 { + value 26; + } + enum AF32 { + value 28; + } + enum AF33 { + value 30; + } + enum CS4 { + value 32; + } + enum AF41 { + value 34; + } + enum AF42 { + value 36; + } + enum AF43 { + value 38; + } + enum CS5 { + value 40; + } + enum EF { + value 46; + } + enum CS6 { + value 48; + } + enum CS7 { + value 50; + } + } + default CS0; + } + + typedef dscp-type { + type union { + type vpp-dscp-type; + type inet:dscp; + } + } + + grouping meter-action-params { + description + "meter action parameters"; + leaf meter-action-type { + mandatory true; + type identityref { + base meter-action-type; + } + description + "meter action type"; + } + leaf dscp { + when "../meter-action-type = meter-action-mark-dscp"; + type dscp-type; + description + "dscp marking"; + } + } + + grouping policer-base-attributes { + leaf cir { + type uint32; + } + leaf eir { + type uint32; + } + leaf cb { + type uint64; + description "Committed Burst"; + } + leaf eb { + type uint64; + description "Excess or Peak Bursnatt"; + } + leaf rate-type { + type policer-rate-type; + } + leaf round-type { + type policer-round-type; + } + leaf type { + type meter-type; + description "policer algorithm"; + } + leaf color-aware { + type boolean; + } + container conform-action { + presence "Defines conform action"; + uses meter-action-params; + } + container exceed-action { + presence "Defines exceed action"; + uses meter-action-params; + } + container violate-action { + presence "Defines violate action"; + uses meter-action-params; + } + } + + grouping policer-operational-attributes { + leaf single-rate { + type boolean; + } + leaf scale { + type uint32; + } + leaf cir-tokens-per-period { + type uint32; + } + leaf pir_tokens-per-period { + type uint32; + } + leaf current-limit { + type uint32; + } + leaf current-bucket { + type uint32; + } + leaf extended-limit { + type uint32; + } + leaf extended-bucket { + type uint32; + } + leaf last-update-time { + type uint64; + } + } + + container policers { + list policer { + key name; + leaf name { + type string { + length 1..63; + } + } + uses policer-base-attributes; + } + } + + container policers-state { + list policer { + key name; + leaf name { + type string { + length 1..63; + } + } + uses policer-base-attributes; + uses policer-operational-attributes; + } + } +} diff --git a/vpp-classifier/api/src/main/yang/vpp-classifier-acl.yang b/vpp-classifier/api/src/main/yang/vpp-classifier-acl.yang deleted file mode 100644 index 6dc028e16..000000000 --- a/vpp-classifier/api/src/main/yang/vpp-classifier-acl.yang +++ /dev/null @@ -1,68 +0,0 @@ -module vpp-classifier-acl { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:vpp:classifier:acl"; - prefix "vpp-classifier-acl"; - - revision "2017-05-03" { - description - "Removed support for ietf based acls."; - } - - revision "2017-03-15" { - description - "Initial revision of vpp-classifier-acl model."; - } - - import vpp-classifier { - prefix "vpp-classifier"; - } - - import yang-ext { - prefix "ext"; - } - - typedef interface-mode { - type enumeration { - enum "l2"; - enum "l3"; - } - } - - grouping acl-base-attributes { - description - "Defines references to classify tables. - At least one table reference should be specified."; - container l2-acl { - leaf classify-table { - type vpp-classifier:classify-table-ref; - description - "An L2 ACL table"; - } - } - container ip4-acl { - leaf classify-table { - type vpp-classifier:classify-table-ref; - description - "An IPv4 ACL table"; - } - } - container ip6-acl { - leaf classify-table { - type vpp-classifier:classify-table-ref; - description - "An IPv6 ACL table"; - } - } - } - - grouping vpp-acl-attributes { - container acl { - container ingress { - uses vpp-classifier-acl:acl-base-attributes; - } - container egress { - uses vpp-classifier-acl:acl-base-attributes; - } - } - } -} \ No newline at end of file diff --git a/vpp-classifier/api/src/main/yang/vpp-classifier-acl@2017-05-03.yang b/vpp-classifier/api/src/main/yang/vpp-classifier-acl@2017-05-03.yang new file mode 100644 index 000000000..6dc028e16 --- /dev/null +++ b/vpp-classifier/api/src/main/yang/vpp-classifier-acl@2017-05-03.yang @@ -0,0 +1,68 @@ +module vpp-classifier-acl { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:vpp:classifier:acl"; + prefix "vpp-classifier-acl"; + + revision "2017-05-03" { + description + "Removed support for ietf based acls."; + } + + revision "2017-03-15" { + description + "Initial revision of vpp-classifier-acl model."; + } + + import vpp-classifier { + prefix "vpp-classifier"; + } + + import yang-ext { + prefix "ext"; + } + + typedef interface-mode { + type enumeration { + enum "l2"; + enum "l3"; + } + } + + grouping acl-base-attributes { + description + "Defines references to classify tables. + At least one table reference should be specified."; + container l2-acl { + leaf classify-table { + type vpp-classifier:classify-table-ref; + description + "An L2 ACL table"; + } + } + container ip4-acl { + leaf classify-table { + type vpp-classifier:classify-table-ref; + description + "An IPv4 ACL table"; + } + } + container ip6-acl { + leaf classify-table { + type vpp-classifier:classify-table-ref; + description + "An IPv6 ACL table"; + } + } + } + + grouping vpp-acl-attributes { + container acl { + container ingress { + uses vpp-classifier-acl:acl-base-attributes; + } + container egress { + uses vpp-classifier-acl:acl-base-attributes; + } + } + } +} \ No newline at end of file diff --git a/vpp-classifier/api/src/main/yang/vpp-classifier-context.yang b/vpp-classifier/api/src/main/yang/vpp-classifier-context.yang deleted file mode 100644 index 38f096cf3..000000000 --- a/vpp-classifier/api/src/main/yang/vpp-classifier-context.yang +++ /dev/null @@ -1,72 +0,0 @@ -module vpp-classifier-context { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:vpp:classifier:context"; - prefix "vpp-classifier-context"; - - description - "This module contains vpp classfier metadata definition"; - - revision "2017-05-02" { - description "Changed namespace"; - } - - revision "2016-09-09" { - description - "Initial revision."; - } - - container vpp-classifier-context { - - config "false"; - - description - "Classify tables and sessions contain relative node indexes. Management agent like Honeycomb, - needs to use node names instead (indexes might change after vpp restart). - VPP does not provide relative index to node name conversion (https://jira.fd.io/browse/VPP-219), - also finding base node that is needed to perform the conversion - is not allways possible (https://jira.fd.io/browse/VPP-220). - - Therefore Honeycomb needs to provide relative node to index mapping. - "; - - list classify-table-context { - key "name"; - unique "index"; - - leaf name { - type string; - description - "Name of the classify table."; - } - - leaf index { - type int32; - description - "Classify table index used by VPP."; - } - - leaf classifier-node-name { - type string; - description - "Name of VPP node the table is defined for."; - } - - list node-context { - key "name"; - unique "index"; - - leaf name { - type string; - description - "Name of vpp node (neighbour of classifier-node-name)"; - } - - leaf index { - type int32; - description - "Inted of the vpp node relative to classifier-node-name"; - } - } - } - } -} \ No newline at end of file diff --git a/vpp-classifier/api/src/main/yang/vpp-classifier-context@2017-05-02.yang b/vpp-classifier/api/src/main/yang/vpp-classifier-context@2017-05-02.yang new file mode 100644 index 000000000..38f096cf3 --- /dev/null +++ b/vpp-classifier/api/src/main/yang/vpp-classifier-context@2017-05-02.yang @@ -0,0 +1,72 @@ +module vpp-classifier-context { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:vpp:classifier:context"; + prefix "vpp-classifier-context"; + + description + "This module contains vpp classfier metadata definition"; + + revision "2017-05-02" { + description "Changed namespace"; + } + + revision "2016-09-09" { + description + "Initial revision."; + } + + container vpp-classifier-context { + + config "false"; + + description + "Classify tables and sessions contain relative node indexes. Management agent like Honeycomb, + needs to use node names instead (indexes might change after vpp restart). + VPP does not provide relative index to node name conversion (https://jira.fd.io/browse/VPP-219), + also finding base node that is needed to perform the conversion + is not allways possible (https://jira.fd.io/browse/VPP-220). + + Therefore Honeycomb needs to provide relative node to index mapping. + "; + + list classify-table-context { + key "name"; + unique "index"; + + leaf name { + type string; + description + "Name of the classify table."; + } + + leaf index { + type int32; + description + "Classify table index used by VPP."; + } + + leaf classifier-node-name { + type string; + description + "Name of VPP node the table is defined for."; + } + + list node-context { + key "name"; + unique "index"; + + leaf name { + type string; + description + "Name of vpp node (neighbour of classifier-node-name)"; + } + + leaf index { + type int32; + description + "Inted of the vpp node relative to classifier-node-name"; + } + } + } + } +} \ No newline at end of file diff --git a/vpp-classifier/api/src/main/yang/vpp-classifier.yang b/vpp-classifier/api/src/main/yang/vpp-classifier.yang deleted file mode 100644 index 574ed942a..000000000 --- a/vpp-classifier/api/src/main/yang/vpp-classifier.yang +++ /dev/null @@ -1,250 +0,0 @@ -module vpp-classifier { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:vpp:classifier"; - prefix "vpp-classifier"; - - revision "2017-03-27" { - description - "This revision updates classify table ref to be compatible with LeafRefContext - (ODL tool for checking leafrefs in runtime)"; - } - - revision "2016-03-15" { - description - "This revision adds policer support"; - } - - revision "2016-12-14" { - description - "This revision adds the following new features: - - updates order of union types for opaque-index"; - } - - revision "2015-06-03" { - description - "Initial revision of model for VPP packet classifier. - The model can be used ony to implement ACLs. - Other classify table usages are not supported yet, - see https://jira.fd.io/browse/VPP-203 for details."; - reference - "https://wiki.fd.io/view/VPP/Introduction_To_N-tuple_Classifiers"; - } - - // TODO add revision (policer inclusion) - - import ietf-yang-types { - prefix "yang"; - } - - import policer { - prefix "policer"; - } - - typedef classify-table-ref { - type leafref { - path "/vpp-classifier/classify-table/name"; - } - description - "This type is used by data models that need to reference - configured classify tables."; - } - - typedef packet-handling-action { - type enumeration { - enum "deny" { - // by VPP convention, first neighbour node (at index 0) is a drop node - value 0; - } - enum "permit" { - value -1; // indicates that the next node not set - } - } - } - - typedef vpp-node-name { - type string; - } - - typedef vpp-node { - type union { - type packet-handling-action; - type vpp-node-name; - } - description - "Defines VPP node reference using packet handling action or relative node name - (if definition in terms of packet handling action is not possible)."; - } - - typedef opaque-index { - type union { - type uint32; - type vpp-node; - } - description - "Defines opaque-index type - metadata that can be attached to session-hit packets. - Vpp nodes can't be referenced by index, because node indexes might change after vpp restart."; - } - - grouping classify-session-attributes { - description - "Defines classify session attributes that are mapped to classify_add_del_session - and classify_session_details messages parameters. - Either hit_next or policer_hit_next should be defined."; - - choice next_node { - mandatory true; - description - "Options for expressing the next node on classify hit and associated metadata to be passed"; - case standard { - leaf hit_next { - mandatory true; - type vpp-node; - description - "Vpp node to which packet will be send when it produces a match."; - } - leaf opaque_index { - type opaque-index; - } - } - case policer { - leaf policer_hit_next { - mandatory true; - type policer:policer-ref; - } - leaf color_classfier { - type policer:color-classfier; - } - } - } - - leaf advance { - type int32; - default 0; - description - "Nodes like ip4/6-classify use the parameter to \"consume\" networking layer. - Example: tunnel decapsulation."; - } - } - - grouping classify-table-base-attributes { - description - "Defines classify table attributes that are mapped to classify_add_del_table message parameters."; - - leaf classifier-node { - type vpp-node-name; - description - "Name of VPP node the table is defined for."; - } - leaf nbuckets { - mandatory true; - type uint32; - description - "Used by classifier hashing algorithm. It is not possible to resize the bucket array, - therefore suggested value is approximate number of expected entries."; - } - leaf skip_n_vectors { - type uint32; - default 0; - description - "Number of 16 byte vectors to be skipped before applying mask."; - } - leaf next_table { - type classify-table-ref; - description - "Reference to the next classify table. Required when multiple table chaining is used."; - } - leaf miss_next { - mandatory true; - type vpp-node; - description - "Vpp node to which packet will be send when it falis to produce a match"; - } - leaf mask { - type yang:hex-string; - mandatory true; - description - "Defines match mask (multiple of 16 bytes)"; - } - - list classify-session { - key "match"; - - leaf match { - type yang:hex-string; - description - "Defines actual value to be matched that is - a byte vector, which length is multiple of 16 bytes"; - - must "string-length(match) = string-length(../../mask)" { - error-message - "Match length is not equal to classify table mask length."; - description - "Match length must be equal to classify table mask length."; - } - } - - uses classify-session-attributes; - } - } - - grouping classify-table-config-attributes { - description - "Defines classify table config only attributes (present in classify_add_del_table message - but not in classify_table_info_reply)."; - - // TODO(HC2VPP-10): move to classify-table-base-attributes - // after https://jira.fd.io/browse/VPP-208 is fixed - leaf memory_size { - type uint32; - // mandatory true; // TODO(HC2VPP-10): uncomment - description - "Memory size for classify table and its entries."; - } - } - - grouping classify-table-operational-attributes { - description - "Defines classify table operational attributes (present in classify_table_info_reply message - but not in classify_add_del_table)."; - - leaf active_sessions { - type uint32; - config false; - description - "Number of sessions defined for the classify table."; - } - } - - container vpp-classifier { - list classify-table { - key "name"; - - leaf name { - type string; - description - "Hides classify table identifier managed by vpp."; - } - - uses classify-table-base-attributes; - uses classify-table-config-attributes; - } - } - - container vpp-classifier-state { - config false; - - list classify-table { - key "name"; - - leaf name { - type string; - description - "Hides classify table identifier managed by vpp."; - } - - uses classify-table-base-attributes; - uses classify-table-operational-attributes; - } - } - -} diff --git a/vpp-classifier/api/src/main/yang/vpp-classifier@2017-03-27.yang b/vpp-classifier/api/src/main/yang/vpp-classifier@2017-03-27.yang new file mode 100644 index 000000000..574ed942a --- /dev/null +++ b/vpp-classifier/api/src/main/yang/vpp-classifier@2017-03-27.yang @@ -0,0 +1,250 @@ +module vpp-classifier { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:vpp:classifier"; + prefix "vpp-classifier"; + + revision "2017-03-27" { + description + "This revision updates classify table ref to be compatible with LeafRefContext + (ODL tool for checking leafrefs in runtime)"; + } + + revision "2016-03-15" { + description + "This revision adds policer support"; + } + + revision "2016-12-14" { + description + "This revision adds the following new features: + - updates order of union types for opaque-index"; + } + + revision "2015-06-03" { + description + "Initial revision of model for VPP packet classifier. + The model can be used ony to implement ACLs. + Other classify table usages are not supported yet, + see https://jira.fd.io/browse/VPP-203 for details."; + reference + "https://wiki.fd.io/view/VPP/Introduction_To_N-tuple_Classifiers"; + } + + // TODO add revision (policer inclusion) + + import ietf-yang-types { + prefix "yang"; + } + + import policer { + prefix "policer"; + } + + typedef classify-table-ref { + type leafref { + path "/vpp-classifier/classify-table/name"; + } + description + "This type is used by data models that need to reference + configured classify tables."; + } + + typedef packet-handling-action { + type enumeration { + enum "deny" { + // by VPP convention, first neighbour node (at index 0) is a drop node + value 0; + } + enum "permit" { + value -1; // indicates that the next node not set + } + } + } + + typedef vpp-node-name { + type string; + } + + typedef vpp-node { + type union { + type packet-handling-action; + type vpp-node-name; + } + description + "Defines VPP node reference using packet handling action or relative node name + (if definition in terms of packet handling action is not possible)."; + } + + typedef opaque-index { + type union { + type uint32; + type vpp-node; + } + description + "Defines opaque-index type - metadata that can be attached to session-hit packets. + Vpp nodes can't be referenced by index, because node indexes might change after vpp restart."; + } + + grouping classify-session-attributes { + description + "Defines classify session attributes that are mapped to classify_add_del_session + and classify_session_details messages parameters. + Either hit_next or policer_hit_next should be defined."; + + choice next_node { + mandatory true; + description + "Options for expressing the next node on classify hit and associated metadata to be passed"; + case standard { + leaf hit_next { + mandatory true; + type vpp-node; + description + "Vpp node to which packet will be send when it produces a match."; + } + leaf opaque_index { + type opaque-index; + } + } + case policer { + leaf policer_hit_next { + mandatory true; + type policer:policer-ref; + } + leaf color_classfier { + type policer:color-classfier; + } + } + } + + leaf advance { + type int32; + default 0; + description + "Nodes like ip4/6-classify use the parameter to \"consume\" networking layer. + Example: tunnel decapsulation."; + } + } + + grouping classify-table-base-attributes { + description + "Defines classify table attributes that are mapped to classify_add_del_table message parameters."; + + leaf classifier-node { + type vpp-node-name; + description + "Name of VPP node the table is defined for."; + } + leaf nbuckets { + mandatory true; + type uint32; + description + "Used by classifier hashing algorithm. It is not possible to resize the bucket array, + therefore suggested value is approximate number of expected entries."; + } + leaf skip_n_vectors { + type uint32; + default 0; + description + "Number of 16 byte vectors to be skipped before applying mask."; + } + leaf next_table { + type classify-table-ref; + description + "Reference to the next classify table. Required when multiple table chaining is used."; + } + leaf miss_next { + mandatory true; + type vpp-node; + description + "Vpp node to which packet will be send when it falis to produce a match"; + } + leaf mask { + type yang:hex-string; + mandatory true; + description + "Defines match mask (multiple of 16 bytes)"; + } + + list classify-session { + key "match"; + + leaf match { + type yang:hex-string; + description + "Defines actual value to be matched that is + a byte vector, which length is multiple of 16 bytes"; + + must "string-length(match) = string-length(../../mask)" { + error-message + "Match length is not equal to classify table mask length."; + description + "Match length must be equal to classify table mask length."; + } + } + + uses classify-session-attributes; + } + } + + grouping classify-table-config-attributes { + description + "Defines classify table config only attributes (present in classify_add_del_table message + but not in classify_table_info_reply)."; + + // TODO(HC2VPP-10): move to classify-table-base-attributes + // after https://jira.fd.io/browse/VPP-208 is fixed + leaf memory_size { + type uint32; + // mandatory true; // TODO(HC2VPP-10): uncomment + description + "Memory size for classify table and its entries."; + } + } + + grouping classify-table-operational-attributes { + description + "Defines classify table operational attributes (present in classify_table_info_reply message + but not in classify_add_del_table)."; + + leaf active_sessions { + type uint32; + config false; + description + "Number of sessions defined for the classify table."; + } + } + + container vpp-classifier { + list classify-table { + key "name"; + + leaf name { + type string; + description + "Hides classify table identifier managed by vpp."; + } + + uses classify-table-base-attributes; + uses classify-table-config-attributes; + } + } + + container vpp-classifier-state { + config false; + + list classify-table { + key "name"; + + leaf name { + type string; + description + "Hides classify table identifier managed by vpp."; + } + + uses classify-table-base-attributes; + uses classify-table-operational-attributes; + } + } + +} diff --git a/vpp-classifier/api/src/main/yang/vpp-interface-acl.yang b/vpp-classifier/api/src/main/yang/vpp-interface-acl.yang deleted file mode 100644 index 94bb2eda2..000000000 --- a/vpp-classifier/api/src/main/yang/vpp-interface-acl.yang +++ /dev/null @@ -1,32 +0,0 @@ -module vpp-interface-acl { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:vpp:interface:acl"; - prefix "vpp-ifc-acl"; - - revision "2017-03-15" { - description - "Initial revision of vpp-interface-acl model."; - } - - import ietf-interfaces { - prefix "if"; - } - - import vpp-classifier-acl { - prefix "vpp-classifier-acl"; - } - - import yang-ext { - prefix "ext"; - } - - augment /if:interfaces/if:interface { - ext:augment-identifier "vpp-interface-acl-augmentation"; - uses vpp-classifier-acl:vpp-acl-attributes; - } - - augment /if:interfaces-state/if:interface { - ext:augment-identifier "vpp-interface-acl-state-augmentation"; - uses vpp-classifier-acl:vpp-acl-attributes; - } -} \ No newline at end of file diff --git a/vpp-classifier/api/src/main/yang/vpp-interface-acl@2017-03-15.yang b/vpp-classifier/api/src/main/yang/vpp-interface-acl@2017-03-15.yang new file mode 100644 index 000000000..94bb2eda2 --- /dev/null +++ b/vpp-classifier/api/src/main/yang/vpp-interface-acl@2017-03-15.yang @@ -0,0 +1,32 @@ +module vpp-interface-acl { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:vpp:interface:acl"; + prefix "vpp-ifc-acl"; + + revision "2017-03-15" { + description + "Initial revision of vpp-interface-acl model."; + } + + import ietf-interfaces { + prefix "if"; + } + + import vpp-classifier-acl { + prefix "vpp-classifier-acl"; + } + + import yang-ext { + prefix "ext"; + } + + augment /if:interfaces/if:interface { + ext:augment-identifier "vpp-interface-acl-augmentation"; + uses vpp-classifier-acl:vpp-acl-attributes; + } + + augment /if:interfaces-state/if:interface { + ext:augment-identifier "vpp-interface-acl-state-augmentation"; + uses vpp-classifier-acl:vpp-acl-attributes; + } +} \ No newline at end of file diff --git a/vpp-classifier/api/src/main/yang/vpp-subinterface-acl.yang b/vpp-classifier/api/src/main/yang/vpp-subinterface-acl.yang deleted file mode 100644 index 2f83adb45..000000000 --- a/vpp-classifier/api/src/main/yang/vpp-subinterface-acl.yang +++ /dev/null @@ -1,36 +0,0 @@ -module vpp-subinterface-acl { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:vpp:subinterface:acl"; - prefix "vpp-subifc-acl"; - - revision "2017-03-15" { - description - "Initial revision of vpp-subinterface-acl model."; - } - - import ietf-interfaces { - prefix "if"; - } - - import vpp-vlan { - prefix "vpp-vlan"; - } - - import vpp-classifier-acl { - prefix "vpp-classifier-acl"; - } - - import yang-ext { - prefix "ext"; - } - - augment /if:interfaces/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { - ext:augment-identifier "vpp-subinterface-acl-augmentation"; - uses vpp-classifier-acl:vpp-acl-attributes; - } - - augment /if:interfaces-state/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { - ext:augment-identifier "vpp-subinterface-acl-state-augmentation"; - uses vpp-classifier-acl:vpp-acl-attributes; - } -} \ No newline at end of file diff --git a/vpp-classifier/api/src/main/yang/vpp-subinterface-acl@2017-03-15.yang b/vpp-classifier/api/src/main/yang/vpp-subinterface-acl@2017-03-15.yang new file mode 100644 index 000000000..2f83adb45 --- /dev/null +++ b/vpp-classifier/api/src/main/yang/vpp-subinterface-acl@2017-03-15.yang @@ -0,0 +1,36 @@ +module vpp-subinterface-acl { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:vpp:subinterface:acl"; + prefix "vpp-subifc-acl"; + + revision "2017-03-15" { + description + "Initial revision of vpp-subinterface-acl model."; + } + + import ietf-interfaces { + prefix "if"; + } + + import vpp-vlan { + prefix "vpp-vlan"; + } + + import vpp-classifier-acl { + prefix "vpp-classifier-acl"; + } + + import yang-ext { + prefix "ext"; + } + + augment /if:interfaces/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { + ext:augment-identifier "vpp-subinterface-acl-augmentation"; + uses vpp-classifier-acl:vpp-acl-attributes; + } + + augment /if:interfaces-state/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { + ext:augment-identifier "vpp-subinterface-acl-state-augmentation"; + uses vpp-classifier-acl:vpp-acl-attributes; + } +} \ No newline at end of file -- cgit 1.2.3-korg