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 --- .../src/main/yang/ietf-access-control-list.yang | 208 ---- .../yang/ietf-access-control-list@2016-07-08.yang | 208 ++++ acl/acl-api/src/main/yang/ietf-packet-fields.yang | 180 ---- .../main/yang/ietf-packet-fields@2016-07-08.yang | 180 ++++ acl/acl-api/src/main/yang/interface-acl.yang | 84 -- .../src/main/yang/interface-acl@2016-12-14.yang | 84 ++ acl/acl-api/src/main/yang/vpp-acl-context.yang | 66 -- .../src/main/yang/vpp-acl-context@2017-01-04.yang | 66 ++ acl/acl-api/src/main/yang/vpp-acl.yang | 258 ----- acl/acl-api/src/main/yang/vpp-acl@2017-06-15.yang | 258 +++++ dhcp/dhcp-api/src/main/yang/dhcp.yang | 90 -- dhcp/dhcp-api/src/main/yang/dhcp@2017-03-15.yang | 90 ++ .../api/src/main/yang/interface-role.yang | 71 -- .../src/main/yang/interface-role@2017-06-15.yang | 71 ++ ioam/api/src/main/yang/ioam-sb-export.yang | 46 - .../src/main/yang/ioam-sb-export@2017-02-06.yang | 46 + ioam/api/src/main/yang/ioam-sb-trace.yang | 190 ---- .../src/main/yang/ioam-sb-trace@2017-03-27.yang | 190 ++++ ioam/api/src/main/yang/sfc-ioam-sb-pot.yang | 169 --- .../src/main/yang/sfc-ioam-sb-pot@2017-01-12.yang | 169 +++ l3/api/src/main/yang/ietf-ip.yang | 742 -------------- l3/api/src/main/yang/ietf-ip@2014-06-16.yang | 742 ++++++++++++++ l3/api/src/main/yang/nd-proxy.yang | 45 - l3/api/src/main/yang/nd-proxy@2017-03-15.yang | 45 + l3/api/src/main/yang/proxy-arp.yang | 46 - l3/api/src/main/yang/proxy-arp@2017-03-15.yang | 46 + .../yang/adjacencies-identification-context.yang | 65 -- ...acencies-identification-context@2016-08-01.yang | 65 ++ lisp/api/src/main/yang/eid-mapping-context.yang | 44 - .../main/yang/eid-mapping-context@2016-08-01.yang | 44 + .../yang/gpe-entry-identification-context.yang | 70 -- ...pe-entry-identification-context@2017-05-17.yang | 70 ++ .../gpe-locator-pair-identification-context.yang | 70 -- ...tor-pair-identification-context@2017-05-17.yang | 70 ++ lisp/api/src/main/yang/gpe.yang | 162 --- lisp/api/src/main/yang/gpe@2017-05-18.yang | 162 +++ .../api/src/main/yang/ietf-lisp-address-types.yang | 677 ------------ .../yang/ietf-lisp-address-types@2015-11-05.yang | 677 ++++++++++++ lisp/api/src/main/yang/lisp.yang | 476 --------- lisp/api/src/main/yang/lisp@2017-03-15.yang | 476 +++++++++ nat/nat-api/src/main/yang/ietf-nat.yang | 1074 -------------------- nat/nat-api/src/main/yang/ietf-nat@2015-09-08.yang | 1074 ++++++++++++++++++++ nat/nat-api/src/main/yang/interface-nat.yang | 44 - .../src/main/yang/interface-nat@2016-12-14.yang | 44 + nat/nat-api/src/main/yang/nat-context.yang | 64 -- .../src/main/yang/nat-context@2016-12-14.yang | 64 ++ nat/nat-api/src/main/yang/subinterface-nat.yang | 36 - .../src/main/yang/subinterface-nat@2017-06-15.yang | 36 + nsh/api/src/main/yang/vpp-nsh.yang | 344 ------- nsh/api/src/main/yang/vpp-nsh@2017-03-15.yang | 344 +++++++ .../routing-api/src/main/yang/vpp-routing-ra.yang | 107 -- .../src/main/yang/vpp-routing-ra@2017-05-02.yang | 107 ++ routing/routing-api/src/main/yang/vpp-routing.yang | 66 -- .../src/main/yang/vpp-routing@2016-12-14.yang | 66 ++ .../samples-api/src/main/yang/sample-plugin.yang | 42 - .../src/main/yang/sample-plugin@2016-12-14.yang | 42 + v3po/api/src/main/yang/dot1q-types.yang | 237 ----- v3po/api/src/main/yang/dot1q-types@2015-06-26.yang | 237 +++++ v3po/api/src/main/yang/pbb-types.yang | 81 -- v3po/api/src/main/yang/pbb-types@2016-12-14.yang | 81 ++ v3po/api/src/main/yang/subinterface-span.yang | 44 - .../main/yang/subinterface-span@2017-05-10.yang | 44 + v3po/api/src/main/yang/unnumbered-interfaces.yang | 44 - .../yang/unnumbered-interfaces@2017-05-10.yang | 44 + v3po/api/src/main/yang/v3po-context.yang | 29 - .../api/src/main/yang/v3po-context@2016-09-09.yang | 29 + v3po/api/src/main/yang/v3po.yang | 786 -------------- v3po/api/src/main/yang/v3po@2017-06-07.yang | 785 ++++++++++++++ v3po/api/src/main/yang/vpp-pbb.yang | 32 - v3po/api/src/main/yang/vpp-pbb@2016-12-14.yang | 32 + v3po/api/src/main/yang/vpp-vlan.yang | 461 --------- v3po/api/src/main/yang/vpp-vlan@2017-06-07.yang | 461 +++++++++ .../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 + .../src/main/yang/multi-naming-context.yang | 68 -- .../main/yang/multi-naming-context@2016-4-11.yang | 68 ++ .../src/main/yang/naming-context.yang | 44 - .../src/main/yang/naming-context@2016-05-13.yang | 44 + .../api/src/main/yang/vpp-management.yang | 54 - .../src/main/yang/vpp-management@2017-03-15.yang | 54 + 92 files changed, 8223 insertions(+), 8224 deletions(-) delete mode 100644 acl/acl-api/src/main/yang/ietf-access-control-list.yang create mode 100644 acl/acl-api/src/main/yang/ietf-access-control-list@2016-07-08.yang delete mode 100644 acl/acl-api/src/main/yang/ietf-packet-fields.yang create mode 100644 acl/acl-api/src/main/yang/ietf-packet-fields@2016-07-08.yang delete mode 100644 acl/acl-api/src/main/yang/interface-acl.yang create mode 100644 acl/acl-api/src/main/yang/interface-acl@2016-12-14.yang delete mode 100644 acl/acl-api/src/main/yang/vpp-acl-context.yang create mode 100644 acl/acl-api/src/main/yang/vpp-acl-context@2017-01-04.yang delete mode 100644 acl/acl-api/src/main/yang/vpp-acl.yang create mode 100644 acl/acl-api/src/main/yang/vpp-acl@2017-06-15.yang delete mode 100644 dhcp/dhcp-api/src/main/yang/dhcp.yang create mode 100644 dhcp/dhcp-api/src/main/yang/dhcp@2017-03-15.yang delete mode 100644 interface-role/api/src/main/yang/interface-role.yang create mode 100644 interface-role/api/src/main/yang/interface-role@2017-06-15.yang delete mode 100644 ioam/api/src/main/yang/ioam-sb-export.yang create mode 100644 ioam/api/src/main/yang/ioam-sb-export@2017-02-06.yang delete mode 100644 ioam/api/src/main/yang/ioam-sb-trace.yang create mode 100644 ioam/api/src/main/yang/ioam-sb-trace@2017-03-27.yang delete mode 100644 ioam/api/src/main/yang/sfc-ioam-sb-pot.yang create mode 100644 ioam/api/src/main/yang/sfc-ioam-sb-pot@2017-01-12.yang delete mode 100644 l3/api/src/main/yang/ietf-ip.yang create mode 100644 l3/api/src/main/yang/ietf-ip@2014-06-16.yang delete mode 100644 l3/api/src/main/yang/nd-proxy.yang create mode 100644 l3/api/src/main/yang/nd-proxy@2017-03-15.yang delete mode 100644 l3/api/src/main/yang/proxy-arp.yang create mode 100644 l3/api/src/main/yang/proxy-arp@2017-03-15.yang delete mode 100644 lisp/api/src/main/yang/adjacencies-identification-context.yang create mode 100644 lisp/api/src/main/yang/adjacencies-identification-context@2016-08-01.yang delete mode 100644 lisp/api/src/main/yang/eid-mapping-context.yang create mode 100644 lisp/api/src/main/yang/eid-mapping-context@2016-08-01.yang delete mode 100644 lisp/api/src/main/yang/gpe-entry-identification-context.yang create mode 100644 lisp/api/src/main/yang/gpe-entry-identification-context@2017-05-17.yang delete mode 100644 lisp/api/src/main/yang/gpe-locator-pair-identification-context.yang create mode 100644 lisp/api/src/main/yang/gpe-locator-pair-identification-context@2017-05-17.yang delete mode 100644 lisp/api/src/main/yang/gpe.yang create mode 100644 lisp/api/src/main/yang/gpe@2017-05-18.yang delete mode 100755 lisp/api/src/main/yang/ietf-lisp-address-types.yang create mode 100755 lisp/api/src/main/yang/ietf-lisp-address-types@2015-11-05.yang delete mode 100755 lisp/api/src/main/yang/lisp.yang create mode 100755 lisp/api/src/main/yang/lisp@2017-03-15.yang delete mode 100644 nat/nat-api/src/main/yang/ietf-nat.yang create mode 100644 nat/nat-api/src/main/yang/ietf-nat@2015-09-08.yang delete mode 100644 nat/nat-api/src/main/yang/interface-nat.yang create mode 100644 nat/nat-api/src/main/yang/interface-nat@2016-12-14.yang delete mode 100644 nat/nat-api/src/main/yang/nat-context.yang create mode 100644 nat/nat-api/src/main/yang/nat-context@2016-12-14.yang delete mode 100644 nat/nat-api/src/main/yang/subinterface-nat.yang create mode 100644 nat/nat-api/src/main/yang/subinterface-nat@2017-06-15.yang delete mode 100644 nsh/api/src/main/yang/vpp-nsh.yang create mode 100644 nsh/api/src/main/yang/vpp-nsh@2017-03-15.yang delete mode 100644 routing/routing-api/src/main/yang/vpp-routing-ra.yang create mode 100644 routing/routing-api/src/main/yang/vpp-routing-ra@2017-05-02.yang delete mode 100644 routing/routing-api/src/main/yang/vpp-routing.yang create mode 100644 routing/routing-api/src/main/yang/vpp-routing@2016-12-14.yang delete mode 100644 samples/samples-api/src/main/yang/sample-plugin.yang create mode 100644 samples/samples-api/src/main/yang/sample-plugin@2016-12-14.yang delete mode 100644 v3po/api/src/main/yang/dot1q-types.yang create mode 100644 v3po/api/src/main/yang/dot1q-types@2015-06-26.yang delete mode 100644 v3po/api/src/main/yang/pbb-types.yang create mode 100644 v3po/api/src/main/yang/pbb-types@2016-12-14.yang delete mode 100644 v3po/api/src/main/yang/subinterface-span.yang create mode 100644 v3po/api/src/main/yang/subinterface-span@2017-05-10.yang delete mode 100644 v3po/api/src/main/yang/unnumbered-interfaces.yang create mode 100644 v3po/api/src/main/yang/unnumbered-interfaces@2017-05-10.yang delete mode 100644 v3po/api/src/main/yang/v3po-context.yang create mode 100644 v3po/api/src/main/yang/v3po-context@2016-09-09.yang delete mode 100644 v3po/api/src/main/yang/v3po.yang create mode 100644 v3po/api/src/main/yang/v3po@2017-06-07.yang delete mode 100644 v3po/api/src/main/yang/vpp-pbb.yang create mode 100644 v3po/api/src/main/yang/vpp-pbb@2016-12-14.yang delete mode 100644 v3po/api/src/main/yang/vpp-vlan.yang create mode 100644 v3po/api/src/main/yang/vpp-vlan@2017-06-07.yang 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 delete mode 100644 vpp-common/naming-context-api/src/main/yang/multi-naming-context.yang create mode 100644 vpp-common/naming-context-api/src/main/yang/multi-naming-context@2016-4-11.yang delete mode 100644 vpp-common/naming-context-api/src/main/yang/naming-context.yang create mode 100644 vpp-common/naming-context-api/src/main/yang/naming-context@2016-05-13.yang delete mode 100644 vpp-management/api/src/main/yang/vpp-management.yang create mode 100644 vpp-management/api/src/main/yang/vpp-management@2017-03-15.yang diff --git a/acl/acl-api/src/main/yang/ietf-access-control-list.yang b/acl/acl-api/src/main/yang/ietf-access-control-list.yang deleted file mode 100644 index 3083ee2a0..000000000 --- a/acl/acl-api/src/main/yang/ietf-access-control-list.yang +++ /dev/null @@ -1,208 +0,0 @@ -module ietf-access-control-list { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:ietf-access-control-list"; - prefix acl; - import ietf-yang-types { - prefix yang; - } - import ietf-packet-fields { - prefix packet-fields; - } - organization "IETF NETMOD (NETCONF Data Modeling Language) - Working Group"; - contact - "WG Web: http://tools.ietf.org/wg/netmod/ - WG List: netmod@ietf.org - WG Chair: Juergen Schoenwaelder - j.schoenwaelder@jacobs-university.de - WG Chair: Tom Nadeau - tnadeau@lucidvision.com - Editor: Dean Bogdanovic - ivandean@gmail.com - Editor: Kiran Agrahara Sreenivasa - kkoushik@cisco.com - Editor: Lisa Huang - lyihuang16@gmail.com - Editor: Dana Blair - dblair@cisco.com"; - description - "This YANG module defines a component that describing the - configuration of Access Control Lists (ACLs). - Copyright (c) 2015 IETF Trust and the persons identified as - the document authors. All rights reserved. - Redistribution and use in source and binary forms, with or - without modification, is permitted pursuant to, and subject - to the license terms contained in, the Simplified BSD - License set forth in Section 4.c of the IETF Trust's Legal - Provisions Relating to IETF Documents - (http://trustee.ietf.org/license-info). - This version of this YANG module is part of RFC XXXX; see - the RFC itself for full legal notices."; - revision 2016-07-08 { - description - "Base model for Network Access Control List (ACL)."; - reference - "RFC XXXX: Network Access Control List (ACL) - YANG Data Model"; - } - identity acl-base { - description - "Base Access Control List type for all Access Control List type - identifiers."; - } - identity ipv4-acl { - base acl:acl-base; - description - "ACL that primarily matches on fields from the IPv4 header - (e.g. IPv4 destination address) and layer 4 headers (e.g. TCP - destination port). An acl of type ipv4-acl does not contain - matches on fields in the ethernet header or the IPv6 header."; - } - identity ipv6-acl { - base acl:acl-base; - description - "ACL that primarily matches on fields from the IPv6 header - (e.g. IPv6 destination address) and layer 4 headers (e.g. TCP - destination port). An acl of type ipv6-acl does not contain - matches on fields in the ethernet header or the IPv4 header."; - } - identity eth-acl { - base acl:acl-base; - description - "ACL that primarily matches on fields in the ethernet header, - like 10/100/1000baseT or WiFi Access Control List. An acl of - type eth-acl does not contain matches on fields in the IPv4 - header, IPv6 header or layer 4 headers."; - } - typedef acl-type { - type identityref { - base acl:acl-base; - } - description - "This type is used to refer to an Access Control List - (ACL) type"; - } - typedef access-control-list-ref { - type leafref { - path "/access-lists/acl/acl-name"; - } - description - "This type is used by data models that need to reference an - Access Control List"; - } - container access-lists { - description - "This is a top level container for Access Control Lists. - It can have one or more Access Control Lists."; - list acl { - key "acl-type acl-name"; - description - "An Access Control List(ACL) is an ordered list of - Access List Entries (ACE). Each Access Control Entry has a - list of match criteria and a list of actions. - Since there are several kinds of Access Control Lists - implemented with different attributes for - different vendors, this - model accommodates customizing Access Control Lists for - each kind and for each vendor."; - leaf acl-name { - type string; - description - "The name of access-list. A device MAY restrict the length - and value of this name, possibly space and special - characters are not allowed."; - } - leaf acl-type { - type acl-type; - description - "Type of access control list. Indicates the primary intended - type of match criteria (e.g. ethernet, IPv4, IPv6, mixed, etc) - used in the list instance."; - } - container acl-oper-data { - config false; - description - "Overall Access Control List operational data"; - } - container access-list-entries { - description - "The access-list-entries container contains - a list of access-list-entries(ACE)."; - list ace { - key "rule-name"; - ordered-by user; - description - "List of access list entries(ACE)"; - leaf rule-name { - type string; - description - "A unique name identifying this Access List - Entry(ACE)."; - } - container matches { - description - "Definitions for match criteria for this Access List - Entry."; - choice ace-type { - description - "Type of access list entry."; - case ace-ip { - description "IP Access List Entry."; - choice ace-ip-version { - description - "IP version used in this Access List Entry."; - case ace-ipv4 { - uses packet-fields:acl-ipv4-header-fields; - } - case ace-ipv6 { - uses packet-fields:acl-ipv6-header-fields; - } - } - uses packet-fields:acl-ip-header-fields; - } - case ace-eth { - description - "Ethernet Access List entry."; - uses packet-fields:acl-eth-header-fields; - } - } - } - container actions { - description - "Definitions of action criteria for this Access List - Entry."; - choice packet-handling { - default "deny"; - description - "Packet handling action."; - case deny { - leaf deny { - type empty; - description - "Deny action."; - } - } - case permit { - leaf permit { - type empty; - description - "Permit action."; - } - } - } - } - container ace-oper-data { - config false; - description - "Operational data for this Access List Entry."; - leaf match-counter { - type yang:counter64; - description - "Number of matches for this Access List Entry"; - } - } - } - } - } - } -} diff --git a/acl/acl-api/src/main/yang/ietf-access-control-list@2016-07-08.yang b/acl/acl-api/src/main/yang/ietf-access-control-list@2016-07-08.yang new file mode 100644 index 000000000..3083ee2a0 --- /dev/null +++ b/acl/acl-api/src/main/yang/ietf-access-control-list@2016-07-08.yang @@ -0,0 +1,208 @@ +module ietf-access-control-list { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-access-control-list"; + prefix acl; + import ietf-yang-types { + prefix yang; + } + import ietf-packet-fields { + prefix packet-fields; + } + organization "IETF NETMOD (NETCONF Data Modeling Language) + Working Group"; + contact + "WG Web: http://tools.ietf.org/wg/netmod/ + WG List: netmod@ietf.org + WG Chair: Juergen Schoenwaelder + j.schoenwaelder@jacobs-university.de + WG Chair: Tom Nadeau + tnadeau@lucidvision.com + Editor: Dean Bogdanovic + ivandean@gmail.com + Editor: Kiran Agrahara Sreenivasa + kkoushik@cisco.com + Editor: Lisa Huang + lyihuang16@gmail.com + Editor: Dana Blair + dblair@cisco.com"; + description + "This YANG module defines a component that describing the + configuration of Access Control Lists (ACLs). + Copyright (c) 2015 IETF Trust and the persons identified as + the document authors. All rights reserved. + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD + License set forth in Section 4.c of the IETF Trust's Legal + Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + revision 2016-07-08 { + description + "Base model for Network Access Control List (ACL)."; + reference + "RFC XXXX: Network Access Control List (ACL) + YANG Data Model"; + } + identity acl-base { + description + "Base Access Control List type for all Access Control List type + identifiers."; + } + identity ipv4-acl { + base acl:acl-base; + description + "ACL that primarily matches on fields from the IPv4 header + (e.g. IPv4 destination address) and layer 4 headers (e.g. TCP + destination port). An acl of type ipv4-acl does not contain + matches on fields in the ethernet header or the IPv6 header."; + } + identity ipv6-acl { + base acl:acl-base; + description + "ACL that primarily matches on fields from the IPv6 header + (e.g. IPv6 destination address) and layer 4 headers (e.g. TCP + destination port). An acl of type ipv6-acl does not contain + matches on fields in the ethernet header or the IPv4 header."; + } + identity eth-acl { + base acl:acl-base; + description + "ACL that primarily matches on fields in the ethernet header, + like 10/100/1000baseT or WiFi Access Control List. An acl of + type eth-acl does not contain matches on fields in the IPv4 + header, IPv6 header or layer 4 headers."; + } + typedef acl-type { + type identityref { + base acl:acl-base; + } + description + "This type is used to refer to an Access Control List + (ACL) type"; + } + typedef access-control-list-ref { + type leafref { + path "/access-lists/acl/acl-name"; + } + description + "This type is used by data models that need to reference an + Access Control List"; + } + container access-lists { + description + "This is a top level container for Access Control Lists. + It can have one or more Access Control Lists."; + list acl { + key "acl-type acl-name"; + description + "An Access Control List(ACL) is an ordered list of + Access List Entries (ACE). Each Access Control Entry has a + list of match criteria and a list of actions. + Since there are several kinds of Access Control Lists + implemented with different attributes for + different vendors, this + model accommodates customizing Access Control Lists for + each kind and for each vendor."; + leaf acl-name { + type string; + description + "The name of access-list. A device MAY restrict the length + and value of this name, possibly space and special + characters are not allowed."; + } + leaf acl-type { + type acl-type; + description + "Type of access control list. Indicates the primary intended + type of match criteria (e.g. ethernet, IPv4, IPv6, mixed, etc) + used in the list instance."; + } + container acl-oper-data { + config false; + description + "Overall Access Control List operational data"; + } + container access-list-entries { + description + "The access-list-entries container contains + a list of access-list-entries(ACE)."; + list ace { + key "rule-name"; + ordered-by user; + description + "List of access list entries(ACE)"; + leaf rule-name { + type string; + description + "A unique name identifying this Access List + Entry(ACE)."; + } + container matches { + description + "Definitions for match criteria for this Access List + Entry."; + choice ace-type { + description + "Type of access list entry."; + case ace-ip { + description "IP Access List Entry."; + choice ace-ip-version { + description + "IP version used in this Access List Entry."; + case ace-ipv4 { + uses packet-fields:acl-ipv4-header-fields; + } + case ace-ipv6 { + uses packet-fields:acl-ipv6-header-fields; + } + } + uses packet-fields:acl-ip-header-fields; + } + case ace-eth { + description + "Ethernet Access List entry."; + uses packet-fields:acl-eth-header-fields; + } + } + } + container actions { + description + "Definitions of action criteria for this Access List + Entry."; + choice packet-handling { + default "deny"; + description + "Packet handling action."; + case deny { + leaf deny { + type empty; + description + "Deny action."; + } + } + case permit { + leaf permit { + type empty; + description + "Permit action."; + } + } + } + } + container ace-oper-data { + config false; + description + "Operational data for this Access List Entry."; + leaf match-counter { + type yang:counter64; + description + "Number of matches for this Access List Entry"; + } + } + } + } + } + } +} diff --git a/acl/acl-api/src/main/yang/ietf-packet-fields.yang b/acl/acl-api/src/main/yang/ietf-packet-fields.yang deleted file mode 100644 index 0b1ce5cdd..000000000 --- a/acl/acl-api/src/main/yang/ietf-packet-fields.yang +++ /dev/null @@ -1,180 +0,0 @@ -module ietf-packet-fields { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:ietf-packet-fields"; - prefix packet-fields; - import ietf-inet-types { - prefix inet; - } - import ietf-yang-types { - prefix yang; - } - organization "IETF NETMOD (NETCONF Data Modeling Language) Working - Group"; - contact - "WG Web: http://tools.ietf.org/wg/netmod/ - WG List: netmod@ietf.org - WG Chair: Juergen Schoenwaelder - j.schoenwaelder@jacobs-university.de - WG Chair: Tom Nadeau - tnadeau@lucidvision.com - Editor: Dean Bogdanovic - deanb@juniper.net - Editor: Kiran Agrahara Sreenivasa - kkoushik@cisco.com - Editor: Lisa Huang - lyihuang16@gmail.com - Editor: Dana Blair - dblair@cisco.com"; - description - "This YANG module defines groupings that are used by - ietf-access-control-list YANG module. Their usage is not - limited to ietf-access-control-list and can be - used anywhere as applicable. - Copyright (c) 2015 IETF Trust and the persons identified as - the document authors. All rights reserved. - Redistribution and use in source and binary forms, with or - without modification, is permitted pursuant to, and subject - to the license terms contained in, the Simplified BSD - License set forth in Section 4.c of the IETF Trust's Legal - Provisions Relating to IETF Documents - (http://trustee.ietf.org/license-info). - This version of this YANG module is part of RFC XXXX; see - the RFC itself for full legal notices."; - revision 2016-07-08 { - description - "Initial version of packet fields used by - ietf-access-control-list"; - reference - "RFC XXXX: Network Access Control List (ACL) - YANG Data Model"; - } - grouping acl-transport-header-fields { - description - "Transport header fields"; - container source-port-range { - presence "Enables setting source port range"; - description - "Inclusive range representing source ports to be used. - When only lower-port is present, it represents a single port."; - leaf lower-port { - type inet:port-number; - mandatory true; - description - "Lower boundary for port."; - } - leaf upper-port { - type inet:port-number; - must ". >= ../lower-port" { - error-message - "The upper-port must be greater than or equal to lower-port"; - } - description - "Upper boundary for port . If existing, the upper port - must be greater or equal to lower-port."; - } - } - container destination-port-range { - presence "Enables setting destination port range"; - description - "Inclusive range representing destination ports to be used. When - only lower-port is present, it represents a single port."; - leaf lower-port { - type inet:port-number; - mandatory true; - description - "Lower boundary for port."; - } - leaf upper-port { - type inet:port-number; - must ". >= ../lower-port" { - error-message - "The upper-port must be greater than or equal to lower-port"; - } - - description - "Upper boundary for port. If existing, the upper port must - be greater or equal to lower-port"; - } - } - } - grouping acl-ip-header-fields { - description - "IP header fields common to ipv4 and ipv6"; - leaf dscp { - type inet:dscp; - description - "Value of dscp."; - } - leaf protocol { - type uint8; - description - "Internet Protocol number."; - } - uses acl-transport-header-fields; - } - grouping acl-ipv4-header-fields { - description - "Fields in IPv4 header."; - leaf destination-ipv4-network { - type inet:ipv4-prefix; - description - "Destination IPv4 address prefix."; - } - leaf source-ipv4-network { - type inet:ipv4-prefix; - description - "Source IPv4 address prefix."; - } - } - grouping acl-ipv6-header-fields { - description - "Fields in IPv6 header"; - leaf destination-ipv6-network { - type inet:ipv6-prefix; - description - "Destination IPv6 address prefix."; - } - leaf source-ipv6-network { - type inet:ipv6-prefix; - description - "Source IPv6 address prefix."; - } - leaf flow-label { - type inet:ipv6-flow-label; - description - "IPv6 Flow label."; - } - reference - "RFC 4291: IP Version 6 Addressing Architecture - RFC 4007: IPv6 Scoped Address Architecture - RFC 5952: A Recommendation for IPv6 Address Text Representation"; - } - grouping acl-eth-header-fields { - description - "Fields in Ethernet header."; - leaf destination-mac-address { - type yang:mac-address; - description - "Destination IEEE 802 MAC address."; - } - leaf destination-mac-address-mask { - type yang:mac-address; - description - "Destination IEEE 802 MAC address mask."; - } - leaf source-mac-address { - type yang:mac-address; - description - "Source IEEE 802 MAC address."; - } - leaf source-mac-address-mask { - type yang:mac-address; - description - "Source IEEE 802 MAC address mask."; - } - reference - "IEEE 802: IEEE Standard for Local and Metropolitan Area - Networks: Overview and Architecture."; - } - -} \ No newline at end of file diff --git a/acl/acl-api/src/main/yang/ietf-packet-fields@2016-07-08.yang b/acl/acl-api/src/main/yang/ietf-packet-fields@2016-07-08.yang new file mode 100644 index 000000000..0b1ce5cdd --- /dev/null +++ b/acl/acl-api/src/main/yang/ietf-packet-fields@2016-07-08.yang @@ -0,0 +1,180 @@ +module ietf-packet-fields { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-packet-fields"; + prefix packet-fields; + import ietf-inet-types { + prefix inet; + } + import ietf-yang-types { + prefix yang; + } + organization "IETF NETMOD (NETCONF Data Modeling Language) Working + Group"; + contact + "WG Web: http://tools.ietf.org/wg/netmod/ + WG List: netmod@ietf.org + WG Chair: Juergen Schoenwaelder + j.schoenwaelder@jacobs-university.de + WG Chair: Tom Nadeau + tnadeau@lucidvision.com + Editor: Dean Bogdanovic + deanb@juniper.net + Editor: Kiran Agrahara Sreenivasa + kkoushik@cisco.com + Editor: Lisa Huang + lyihuang16@gmail.com + Editor: Dana Blair + dblair@cisco.com"; + description + "This YANG module defines groupings that are used by + ietf-access-control-list YANG module. Their usage is not + limited to ietf-access-control-list and can be + used anywhere as applicable. + Copyright (c) 2015 IETF Trust and the persons identified as + the document authors. All rights reserved. + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD + License set forth in Section 4.c of the IETF Trust's Legal + Provisions Relating to IETF Documents + (http://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + revision 2016-07-08 { + description + "Initial version of packet fields used by + ietf-access-control-list"; + reference + "RFC XXXX: Network Access Control List (ACL) + YANG Data Model"; + } + grouping acl-transport-header-fields { + description + "Transport header fields"; + container source-port-range { + presence "Enables setting source port range"; + description + "Inclusive range representing source ports to be used. + When only lower-port is present, it represents a single port."; + leaf lower-port { + type inet:port-number; + mandatory true; + description + "Lower boundary for port."; + } + leaf upper-port { + type inet:port-number; + must ". >= ../lower-port" { + error-message + "The upper-port must be greater than or equal to lower-port"; + } + description + "Upper boundary for port . If existing, the upper port + must be greater or equal to lower-port."; + } + } + container destination-port-range { + presence "Enables setting destination port range"; + description + "Inclusive range representing destination ports to be used. When + only lower-port is present, it represents a single port."; + leaf lower-port { + type inet:port-number; + mandatory true; + description + "Lower boundary for port."; + } + leaf upper-port { + type inet:port-number; + must ". >= ../lower-port" { + error-message + "The upper-port must be greater than or equal to lower-port"; + } + + description + "Upper boundary for port. If existing, the upper port must + be greater or equal to lower-port"; + } + } + } + grouping acl-ip-header-fields { + description + "IP header fields common to ipv4 and ipv6"; + leaf dscp { + type inet:dscp; + description + "Value of dscp."; + } + leaf protocol { + type uint8; + description + "Internet Protocol number."; + } + uses acl-transport-header-fields; + } + grouping acl-ipv4-header-fields { + description + "Fields in IPv4 header."; + leaf destination-ipv4-network { + type inet:ipv4-prefix; + description + "Destination IPv4 address prefix."; + } + leaf source-ipv4-network { + type inet:ipv4-prefix; + description + "Source IPv4 address prefix."; + } + } + grouping acl-ipv6-header-fields { + description + "Fields in IPv6 header"; + leaf destination-ipv6-network { + type inet:ipv6-prefix; + description + "Destination IPv6 address prefix."; + } + leaf source-ipv6-network { + type inet:ipv6-prefix; + description + "Source IPv6 address prefix."; + } + leaf flow-label { + type inet:ipv6-flow-label; + description + "IPv6 Flow label."; + } + reference + "RFC 4291: IP Version 6 Addressing Architecture + RFC 4007: IPv6 Scoped Address Architecture + RFC 5952: A Recommendation for IPv6 Address Text Representation"; + } + grouping acl-eth-header-fields { + description + "Fields in Ethernet header."; + leaf destination-mac-address { + type yang:mac-address; + description + "Destination IEEE 802 MAC address."; + } + leaf destination-mac-address-mask { + type yang:mac-address; + description + "Destination IEEE 802 MAC address mask."; + } + leaf source-mac-address { + type yang:mac-address; + description + "Source IEEE 802 MAC address."; + } + leaf source-mac-address-mask { + type yang:mac-address; + description + "Source IEEE 802 MAC address mask."; + } + reference + "IEEE 802: IEEE Standard for Local and Metropolitan Area + Networks: Overview and Architecture."; + } + +} \ No newline at end of file diff --git a/acl/acl-api/src/main/yang/interface-acl.yang b/acl/acl-api/src/main/yang/interface-acl.yang deleted file mode 100644 index aab82e566..000000000 --- a/acl/acl-api/src/main/yang/interface-acl.yang +++ /dev/null @@ -1,84 +0,0 @@ -module interface-acl { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:interface:acl"; - prefix "ifc-acl"; - - revision "2016-12-14" { - description "Initial revision of interface-acl model"; - } - - import ietf-interfaces { - prefix "if"; - } - import yang-ext { - prefix "ext"; - } - import ietf-yang-types { - prefix "yang"; - } - - import vpp-acl { - prefix "vpp-acl"; - } - - import ietf-access-control-list { - prefix "acl"; - } - - description "Augmentations to interfaces model to apply acls exposed by acl plugin of vpp"; - - grouping vpp-acls-base-attributes { - description - "List of ACLs of vpp-acl type"; // TODO express constraint in the model if possible - list vpp-acls { - key "type name"; - ordered-by user; - - leaf type { - type acl:acl-type; - } - - leaf name { - type acl:access-control-list-ref; - } - } - } - - grouping vpp-macip-acls-base-attributes { - container vpp-macip-acl { - description - "ACL of vpp-macip-acl type"; // TODO express constraint in the model if possible - - leaf type { - type acl:acl-type; - } - - leaf name { - type acl:access-control-list-ref; - } - } - } - - grouping interface-acl-attributes { - container acl { - container ingress { - uses vpp-acls-base-attributes; - uses vpp-macip-acls-base-attributes; - } - container egress { - uses vpp-acls-base-attributes; - } - } - } - - augment /if:interfaces/if:interface { - ext:augment-identifier "vpp-acl-interface-augmentation"; - uses interface-acl-attributes; - } - - augment /if:interfaces-state/if:interface { - ext:augment-identifier "vpp-acl-interface-state-augmentation"; - uses interface-acl-attributes; - } - -} \ No newline at end of file diff --git a/acl/acl-api/src/main/yang/interface-acl@2016-12-14.yang b/acl/acl-api/src/main/yang/interface-acl@2016-12-14.yang new file mode 100644 index 000000000..aab82e566 --- /dev/null +++ b/acl/acl-api/src/main/yang/interface-acl@2016-12-14.yang @@ -0,0 +1,84 @@ +module interface-acl { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:interface:acl"; + prefix "ifc-acl"; + + revision "2016-12-14" { + description "Initial revision of interface-acl model"; + } + + import ietf-interfaces { + prefix "if"; + } + import yang-ext { + prefix "ext"; + } + import ietf-yang-types { + prefix "yang"; + } + + import vpp-acl { + prefix "vpp-acl"; + } + + import ietf-access-control-list { + prefix "acl"; + } + + description "Augmentations to interfaces model to apply acls exposed by acl plugin of vpp"; + + grouping vpp-acls-base-attributes { + description + "List of ACLs of vpp-acl type"; // TODO express constraint in the model if possible + list vpp-acls { + key "type name"; + ordered-by user; + + leaf type { + type acl:acl-type; + } + + leaf name { + type acl:access-control-list-ref; + } + } + } + + grouping vpp-macip-acls-base-attributes { + container vpp-macip-acl { + description + "ACL of vpp-macip-acl type"; // TODO express constraint in the model if possible + + leaf type { + type acl:acl-type; + } + + leaf name { + type acl:access-control-list-ref; + } + } + } + + grouping interface-acl-attributes { + container acl { + container ingress { + uses vpp-acls-base-attributes; + uses vpp-macip-acls-base-attributes; + } + container egress { + uses vpp-acls-base-attributes; + } + } + } + + augment /if:interfaces/if:interface { + ext:augment-identifier "vpp-acl-interface-augmentation"; + uses interface-acl-attributes; + } + + augment /if:interfaces-state/if:interface { + ext:augment-identifier "vpp-acl-interface-state-augmentation"; + uses interface-acl-attributes; + } + +} \ No newline at end of file diff --git a/acl/acl-api/src/main/yang/vpp-acl-context.yang b/acl/acl-api/src/main/yang/vpp-acl-context.yang deleted file mode 100644 index fde7f6346..000000000 --- a/acl/acl-api/src/main/yang/vpp-acl-context.yang +++ /dev/null @@ -1,66 +0,0 @@ -module vpp-acl-context { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:vpp:acl:context"; - prefix "nc"; - - description "Context for vpp-acl assignment mapping"; - - revision "2017-01-04" { - description "Initial revision."; - } - - import naming-context { - prefix "nc"; - } - - import yang-ext { - prefix "ext"; - } - - grouping vpp-acl-context-attributes { - container vpp-acl-mappings { - list vpp-acl-context { - - key "name"; - - leaf name { - type string; - description "vpp-acl context name"; - } - - list acl-mapping { - key "name"; - - leaf name { - type string; - description "ACL name"; - } - - leaf index { - type int32; - description "ACL index"; - } - - list ace-mapping { - key "name"; - - leaf name { - type string; - description "ACEs name"; - } - - leaf index { - type int32; - description "ACE index"; - } - } - } - } - } - } - - augment /nc:contexts { - ext:augment-identifier "vpp-acl-context-augmentation"; - uses vpp-acl-context-attributes; - } -} \ No newline at end of file diff --git a/acl/acl-api/src/main/yang/vpp-acl-context@2017-01-04.yang b/acl/acl-api/src/main/yang/vpp-acl-context@2017-01-04.yang new file mode 100644 index 000000000..fde7f6346 --- /dev/null +++ b/acl/acl-api/src/main/yang/vpp-acl-context@2017-01-04.yang @@ -0,0 +1,66 @@ +module vpp-acl-context { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:vpp:acl:context"; + prefix "nc"; + + description "Context for vpp-acl assignment mapping"; + + revision "2017-01-04" { + description "Initial revision."; + } + + import naming-context { + prefix "nc"; + } + + import yang-ext { + prefix "ext"; + } + + grouping vpp-acl-context-attributes { + container vpp-acl-mappings { + list vpp-acl-context { + + key "name"; + + leaf name { + type string; + description "vpp-acl context name"; + } + + list acl-mapping { + key "name"; + + leaf name { + type string; + description "ACL name"; + } + + leaf index { + type int32; + description "ACL index"; + } + + list ace-mapping { + key "name"; + + leaf name { + type string; + description "ACEs name"; + } + + leaf index { + type int32; + description "ACE index"; + } + } + } + } + } + } + + augment /nc:contexts { + ext:augment-identifier "vpp-acl-context-augmentation"; + uses vpp-acl-context-attributes; + } +} \ No newline at end of file diff --git a/acl/acl-api/src/main/yang/vpp-acl.yang b/acl/acl-api/src/main/yang/vpp-acl.yang deleted file mode 100644 index 0a800370d..000000000 --- a/acl/acl-api/src/main/yang/vpp-acl.yang +++ /dev/null @@ -1,258 +0,0 @@ -module vpp-acl { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:vpp:acl"; - prefix "vpp-acl"; - - revision "2016-12-14" { - description - "Initial revision of vpp-acl model."; - } - - revision "2017-06-15" { - description - "Renamed stateful/permit leaf to permit-and-reflect"; - } - - import ietf-access-control-list { - prefix "acl"; - } - - import yang-ext { - prefix "ext"; - } - - import ietf-packet-fields { - prefix packet-fields; - } - - import ietf-inet-types { - prefix inet; - } - - import ietf-yang-types { - prefix yang; - } - - augment /acl:access-lists/acl:acl/acl:access-list-entries/acl:ace/acl:actions/acl:packet-handling { - ext:augment-identifier "stateful-acl-action-augmentation"; - when "../acl:matches/acl:ace-type = 'vpp-acl:vpp-acl'"; - case stateful { - leaf permit-and-reflect { - type empty; - description - "Permits egress TCP/UDP traffic and ingress in reverse direction by creating reflexive ACEs."; - } - } - } - - identity vpp-acl { - base acl:acl-base; - description - "ACL that contains only aces of vpp-ace type."; - } - - identity vpp-macip-acl { - base acl:acl-base; - description - "ACL that contains only aces of vpp-macip-acl type."; - } - - grouping value-range { - description "Defines value range with first and last value defined"; - - leaf first { - type uint8; - mandatory true; - description "Lower boundary for range"; - } - - leaf last { - type uint8; - mandatory true; - description "Upper boundary for range"; - must "last >= first"; - } - } - - grouping acl-icmp-header-fields { - description - "ICMP header fields"; - container icmp-type-range { - presence "Enables setting icmp-type"; - description - "Inclusive range representing icmp types to be used."; - uses value-range; - } - - container icmp-code-range { - presence "Enables setting icmp-code"; - description - "Inclusive range representing icmp codes to be used."; - uses value-range; - } - } - - grouping acl-tcp-header-fields { - description - "TCP header fields"; - leaf tcp-flags-mask { - description - "Binary mask for tcp flags to match. MSB order (FIN at position 0). - Applied as logical AND to tcp flags field of the packet being matched, - before it is compared with tcp-flags-value."; - type uint8; - } - leaf tcp-flags-value { - description - "Binary value for tcp flags to match. MSB order (FIN at position 0). - Before tcp-flags-value is compared with tcp flags field of the packet being matched, - tcp-flags-mask is applied to packet field value."; - type uint8; - } - } - - grouping acl-other-protocol-fields { - description "Used for any other protocol than TCP/UDP/ICMP/ICMPv6"; - leaf protocol { - must "protocol != 1 and protocol != 6 and protocol != 17 and protocol != 58"; - type uint8; - description "Internet Protocol number."; - } - } - - grouping acl-ip-protocol-header-fields { - description - "Defines header fields for TCP/UDP or ICMP protocols"; - choice ip-protocol { - case icmp { - container icmp-nodes { - uses acl-icmp-header-fields; - } - } - case icmp-v6 { - container icmp-v6-nodes { - uses acl-icmp-header-fields; - } - } - case udp { - container udp-nodes { - uses packet-fields:acl-transport-header-fields; - } - } - case tcp { - container tcp-nodes { - uses packet-fields:acl-transport-header-fields; - uses acl-tcp-header-fields; - } - } - case other { - container other-nodes { - uses acl-other-protocol-fields; - } - } - } - } - - augment /acl:access-lists/acl:acl/acl:access-list-entries/acl:ace/acl:matches/acl:ace-type { - ext:augment-identifier "vpp-acl-type-augmentation"; - case vpp-ace { - description - "Access List entry that can define: - - IP4/IP6 src/dst ip prefix- Internet Protocol number - - Internet Protocol number - - selected L4 headers: - * ICMP (type range) - * UDP (port range) - * TCP (port range, flags mask, flags value)"; - container vpp-ace-nodes { - choice ace-ip-version { - description - "IP version used in this Access List Entry."; - case ace-ipv4 { - uses packet-fields:acl-ipv4-header-fields; - } - case ace-ipv6 { - uses packet-fields:acl-ipv6-header-fields; - } - } - uses acl-ip-protocol-header-fields; - } - } - } - - grouping vpp-macip-ace-eth-header-fields { - description - "Fields in Ethernet header supported by vpp-macip rule"; - leaf source-mac-address { - type yang:mac-address; - description - "Source IEEE 802 MAC address. - Before source-mac-address is compared with source mac address field of the packet being matched, - source-mac-address-mask is applied to packet field value."; - } - leaf source-mac-address-mask { - type yang:mac-address; - description - "Source IEEE 802 MAC address mask. - Applied as logical AND with source mac address field of the packet being matched, - before it is compared with source-mac-address."; - } - } - - grouping vpp-macip-ace-ipv4-header-fields { - description - "Fields in IPv4 header supported by vpp-macip rule"; - leaf source-ipv4-network { - type inet:ipv4-prefix; - description - "Source IPv4 address prefix."; - } - } - - grouping vpp-macip-ace-ipv6-header-fields { - description - "Fields in IPv6 header supported by vpp-macip rule"; - leaf source-ipv6-network { - type inet:ipv6-prefix; - description - "Source IPv6 address prefix."; - } - } - - augment /acl:access-lists/acl:acl/acl:access-list-entries/acl:ace/acl:matches/acl:ace-type { - ext:augment-identifier "vpp-macip-acl-type-augmentation"; - case vpp-macip-ace { - description - "Access List entry that can define: - - IP4/IP6 src ip prefix - - src MAC address mask - - src MAC address value - - can be used only for static ACLs."; - container vpp-macip-ace-nodes { - choice ace-ip-version { - description - "IP version used in this Access List Entry."; - case ace-ipv4 { - uses vpp-macip-ace-ipv4-header-fields; - } - case ace-ipv6 { - uses vpp-macip-ace-ipv6-header-fields; - } - } - uses vpp-macip-ace-eth-header-fields; - } - } - } - - augment /acl:access-lists/acl:acl { - ext:augment-identifier "vpp-acl-augmentation"; - leaf tag { - type string { - length 1..63; - } - description - "ASCII tag that can be used as a placeholder for ACL metadata. Value is stored in vpp, - and returned in read requests. No processing involved."; - } - } -} \ No newline at end of file diff --git a/acl/acl-api/src/main/yang/vpp-acl@2017-06-15.yang b/acl/acl-api/src/main/yang/vpp-acl@2017-06-15.yang new file mode 100644 index 000000000..dfc1d890b --- /dev/null +++ b/acl/acl-api/src/main/yang/vpp-acl@2017-06-15.yang @@ -0,0 +1,258 @@ +module vpp-acl { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:vpp:acl"; + prefix "vpp-acl"; + + revision "2017-06-15" { + description + "Renamed stateful/permit leaf to permit-and-reflect"; + } + + revision "2016-12-14" { + description + "Initial revision of vpp-acl model."; + } + + import ietf-access-control-list { + prefix "acl"; + } + + import yang-ext { + prefix "ext"; + } + + import ietf-packet-fields { + prefix packet-fields; + } + + import ietf-inet-types { + prefix inet; + } + + import ietf-yang-types { + prefix yang; + } + + augment /acl:access-lists/acl:acl/acl:access-list-entries/acl:ace/acl:actions/acl:packet-handling { + ext:augment-identifier "stateful-acl-action-augmentation"; + when "../acl:matches/acl:ace-type = 'vpp-acl:vpp-acl'"; + case stateful { + leaf permit-and-reflect { + type empty; + description + "Permits egress TCP/UDP traffic and ingress in reverse direction by creating reflexive ACEs."; + } + } + } + + identity vpp-acl { + base acl:acl-base; + description + "ACL that contains only aces of vpp-ace type."; + } + + identity vpp-macip-acl { + base acl:acl-base; + description + "ACL that contains only aces of vpp-macip-acl type."; + } + + grouping value-range { + description "Defines value range with first and last value defined"; + + leaf first { + type uint8; + mandatory true; + description "Lower boundary for range"; + } + + leaf last { + type uint8; + mandatory true; + description "Upper boundary for range"; + must "last >= first"; + } + } + + grouping acl-icmp-header-fields { + description + "ICMP header fields"; + container icmp-type-range { + presence "Enables setting icmp-type"; + description + "Inclusive range representing icmp types to be used."; + uses value-range; + } + + container icmp-code-range { + presence "Enables setting icmp-code"; + description + "Inclusive range representing icmp codes to be used."; + uses value-range; + } + } + + grouping acl-tcp-header-fields { + description + "TCP header fields"; + leaf tcp-flags-mask { + description + "Binary mask for tcp flags to match. MSB order (FIN at position 0). + Applied as logical AND to tcp flags field of the packet being matched, + before it is compared with tcp-flags-value."; + type uint8; + } + leaf tcp-flags-value { + description + "Binary value for tcp flags to match. MSB order (FIN at position 0). + Before tcp-flags-value is compared with tcp flags field of the packet being matched, + tcp-flags-mask is applied to packet field value."; + type uint8; + } + } + + grouping acl-other-protocol-fields { + description "Used for any other protocol than TCP/UDP/ICMP/ICMPv6"; + leaf protocol { + must "protocol != 1 and protocol != 6 and protocol != 17 and protocol != 58"; + type uint8; + description "Internet Protocol number."; + } + } + + grouping acl-ip-protocol-header-fields { + description + "Defines header fields for TCP/UDP or ICMP protocols"; + choice ip-protocol { + case icmp { + container icmp-nodes { + uses acl-icmp-header-fields; + } + } + case icmp-v6 { + container icmp-v6-nodes { + uses acl-icmp-header-fields; + } + } + case udp { + container udp-nodes { + uses packet-fields:acl-transport-header-fields; + } + } + case tcp { + container tcp-nodes { + uses packet-fields:acl-transport-header-fields; + uses acl-tcp-header-fields; + } + } + case other { + container other-nodes { + uses acl-other-protocol-fields; + } + } + } + } + + augment /acl:access-lists/acl:acl/acl:access-list-entries/acl:ace/acl:matches/acl:ace-type { + ext:augment-identifier "vpp-acl-type-augmentation"; + case vpp-ace { + description + "Access List entry that can define: + - IP4/IP6 src/dst ip prefix- Internet Protocol number + - Internet Protocol number + - selected L4 headers: + * ICMP (type range) + * UDP (port range) + * TCP (port range, flags mask, flags value)"; + container vpp-ace-nodes { + choice ace-ip-version { + description + "IP version used in this Access List Entry."; + case ace-ipv4 { + uses packet-fields:acl-ipv4-header-fields; + } + case ace-ipv6 { + uses packet-fields:acl-ipv6-header-fields; + } + } + uses acl-ip-protocol-header-fields; + } + } + } + + grouping vpp-macip-ace-eth-header-fields { + description + "Fields in Ethernet header supported by vpp-macip rule"; + leaf source-mac-address { + type yang:mac-address; + description + "Source IEEE 802 MAC address. + Before source-mac-address is compared with source mac address field of the packet being matched, + source-mac-address-mask is applied to packet field value."; + } + leaf source-mac-address-mask { + type yang:mac-address; + description + "Source IEEE 802 MAC address mask. + Applied as logical AND with source mac address field of the packet being matched, + before it is compared with source-mac-address."; + } + } + + grouping vpp-macip-ace-ipv4-header-fields { + description + "Fields in IPv4 header supported by vpp-macip rule"; + leaf source-ipv4-network { + type inet:ipv4-prefix; + description + "Source IPv4 address prefix."; + } + } + + grouping vpp-macip-ace-ipv6-header-fields { + description + "Fields in IPv6 header supported by vpp-macip rule"; + leaf source-ipv6-network { + type inet:ipv6-prefix; + description + "Source IPv6 address prefix."; + } + } + + augment /acl:access-lists/acl:acl/acl:access-list-entries/acl:ace/acl:matches/acl:ace-type { + ext:augment-identifier "vpp-macip-acl-type-augmentation"; + case vpp-macip-ace { + description + "Access List entry that can define: + - IP4/IP6 src ip prefix + - src MAC address mask + - src MAC address value + - can be used only for static ACLs."; + container vpp-macip-ace-nodes { + choice ace-ip-version { + description + "IP version used in this Access List Entry."; + case ace-ipv4 { + uses vpp-macip-ace-ipv4-header-fields; + } + case ace-ipv6 { + uses vpp-macip-ace-ipv6-header-fields; + } + } + uses vpp-macip-ace-eth-header-fields; + } + } + } + + augment /acl:access-lists/acl:acl { + ext:augment-identifier "vpp-acl-augmentation"; + leaf tag { + type string { + length 1..63; + } + description + "ASCII tag that can be used as a placeholder for ACL metadata. Value is stored in vpp, + and returned in read requests. No processing involved."; + } + } +} \ No newline at end of file diff --git a/dhcp/dhcp-api/src/main/yang/dhcp.yang b/dhcp/dhcp-api/src/main/yang/dhcp.yang deleted file mode 100644 index 4fa0a61f8..000000000 --- a/dhcp/dhcp-api/src/main/yang/dhcp.yang +++ /dev/null @@ -1,90 +0,0 @@ -module dhcp { - - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:vpp:dhcp"; - prefix "dhcp"; - - description - "This YANG module defines the generic configuration and - operational data for dhcp in VPP"; - - revision "2017-03-15" { - description - "Initial revision of dhcp model"; - } - - import ietf-inet-types { - prefix inet; - } - - identity address-family { - description - "Base identity from which identities describing address - families are derived."; - } - - identity ipv4 { - base address-family; - description - "This identity represents IPv4 address family."; - } - - identity ipv6 { - base address-family; - description - "This identity represents IPv6 address family."; - } - - typedef address-type { - type identityref { - base address-family; - } - } - - grouping relay-attributes { - list server { - key "vrf-id address"; - leaf address { - // FIXME(HC2VPP-79): change to ip-address-no-zone after https://bugs.opendaylight.org/show_bug.cgi?id=6413 is resolved - type inet:ip-address; - description - "IP address of the server DHCP packets will be forwarded to."; - } - leaf vrf-id { - type uint32; - description - "Used to send DHCP messages to the server"; - } - } - - leaf gateway-address { - // FIXME(HC2VPP-79): change to ip-address-no-zone after https://bugs.opendaylight.org/show_bug.cgi?id=6413 is resolved - type inet:ip-address; - mandatory true; - description - "IP address of the relay agent."; - } - // TODO(HC2VPP-44): add configurable circut-id (option-82/remote-id) - } - - grouping dhcp-attributes { - container relays { - list relay { - key "address-type rx-vrf-id"; - leaf address-type { - type address-type; - } - leaf rx-vrf-id { - type uint32; - description - "Used to receive DHCP messages from clients."; - } - uses relay-attributes; - } - } - } - - container dhcp { - uses dhcp-attributes; - } -} \ No newline at end of file diff --git a/dhcp/dhcp-api/src/main/yang/dhcp@2017-03-15.yang b/dhcp/dhcp-api/src/main/yang/dhcp@2017-03-15.yang new file mode 100644 index 000000000..4fa0a61f8 --- /dev/null +++ b/dhcp/dhcp-api/src/main/yang/dhcp@2017-03-15.yang @@ -0,0 +1,90 @@ +module dhcp { + + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:vpp:dhcp"; + prefix "dhcp"; + + description + "This YANG module defines the generic configuration and + operational data for dhcp in VPP"; + + revision "2017-03-15" { + description + "Initial revision of dhcp model"; + } + + import ietf-inet-types { + prefix inet; + } + + identity address-family { + description + "Base identity from which identities describing address + families are derived."; + } + + identity ipv4 { + base address-family; + description + "This identity represents IPv4 address family."; + } + + identity ipv6 { + base address-family; + description + "This identity represents IPv6 address family."; + } + + typedef address-type { + type identityref { + base address-family; + } + } + + grouping relay-attributes { + list server { + key "vrf-id address"; + leaf address { + // FIXME(HC2VPP-79): change to ip-address-no-zone after https://bugs.opendaylight.org/show_bug.cgi?id=6413 is resolved + type inet:ip-address; + description + "IP address of the server DHCP packets will be forwarded to."; + } + leaf vrf-id { + type uint32; + description + "Used to send DHCP messages to the server"; + } + } + + leaf gateway-address { + // FIXME(HC2VPP-79): change to ip-address-no-zone after https://bugs.opendaylight.org/show_bug.cgi?id=6413 is resolved + type inet:ip-address; + mandatory true; + description + "IP address of the relay agent."; + } + // TODO(HC2VPP-44): add configurable circut-id (option-82/remote-id) + } + + grouping dhcp-attributes { + container relays { + list relay { + key "address-type rx-vrf-id"; + leaf address-type { + type address-type; + } + leaf rx-vrf-id { + type uint32; + description + "Used to receive DHCP messages from clients."; + } + uses relay-attributes; + } + } + } + + container dhcp { + uses dhcp-attributes; + } +} \ No newline at end of file diff --git a/interface-role/api/src/main/yang/interface-role.yang b/interface-role/api/src/main/yang/interface-role.yang deleted file mode 100644 index a41544d0c..000000000 --- a/interface-role/api/src/main/yang/interface-role.yang +++ /dev/null @@ -1,71 +0,0 @@ -module interface-role { - - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:interface:role"; - prefix "if-role"; - - revision "2017-06-15" { - description "Basic specification of interface roles"; - } - - import ietf-interfaces { - prefix "if"; - } - - import yang-ext { - prefix "ext"; - } - - identity network-role-base { - description "Base identity for network interface roles"; - } - - identity virtual-domain-interface { - base network-role-base; - description "Tenant network interface. Interface must be enabled and have ip assigned"; - } - - identity public-interface { - base network-role-base; - description "Public interface for external access. Interface must be enabled and have ip assigned"; - } - - typedef network-role { - type identityref { - base network-role-base; - } - description "Base type for network interface roles"; - } - - grouping interface-role-grouping { - container roles { - list role { - key role-name; - - leaf role-name { - type string; - description "Unique name for role"; - mandatory true; - } - - leaf role-type { - type network-role; - description "Specifies type of network role"; - mandatory true; - } - - leaf description { - type string; - description "Any additional metadata for this assignment of network role"; - } - } - } - } - - augment /if:interfaces/if:interface { - ext:augment-identifier "interface-role-augmentation"; - - uses interface-role-grouping; - } -} - diff --git a/interface-role/api/src/main/yang/interface-role@2017-06-15.yang b/interface-role/api/src/main/yang/interface-role@2017-06-15.yang new file mode 100644 index 000000000..a41544d0c --- /dev/null +++ b/interface-role/api/src/main/yang/interface-role@2017-06-15.yang @@ -0,0 +1,71 @@ +module interface-role { + + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:interface:role"; + prefix "if-role"; + + revision "2017-06-15" { + description "Basic specification of interface roles"; + } + + import ietf-interfaces { + prefix "if"; + } + + import yang-ext { + prefix "ext"; + } + + identity network-role-base { + description "Base identity for network interface roles"; + } + + identity virtual-domain-interface { + base network-role-base; + description "Tenant network interface. Interface must be enabled and have ip assigned"; + } + + identity public-interface { + base network-role-base; + description "Public interface for external access. Interface must be enabled and have ip assigned"; + } + + typedef network-role { + type identityref { + base network-role-base; + } + description "Base type for network interface roles"; + } + + grouping interface-role-grouping { + container roles { + list role { + key role-name; + + leaf role-name { + type string; + description "Unique name for role"; + mandatory true; + } + + leaf role-type { + type network-role; + description "Specifies type of network role"; + mandatory true; + } + + leaf description { + type string; + description "Any additional metadata for this assignment of network role"; + } + } + } + } + + augment /if:interfaces/if:interface { + ext:augment-identifier "interface-role-augmentation"; + + uses interface-role-grouping; + } +} + diff --git a/ioam/api/src/main/yang/ioam-sb-export.yang b/ioam/api/src/main/yang/ioam-sb-export.yang deleted file mode 100644 index f04028a38..000000000 --- a/ioam/api/src/main/yang/ioam-sb-export.yang +++ /dev/null @@ -1,46 +0,0 @@ -module ioam-sb-export { - - yang-version 1; - - namespace "urn:cisco:params:xml:ns:yang:ioam-sb-export"; - - prefix ioam-sb-export; - - organization "Cisco Systems, Inc."; - contact - "Shwetha Bhandari - Sagar Srivastav "; - - description - "This module contains a collection of YANG definitions for - managing in-band OAM based export - parameters."; - - revision 2017-02-06 { - description - "set source and collector addresses as mandatory"; - reference - ""; - } - - import ietf-inet-types { - prefix inet; - } - - container ioam-export { - - leaf disable { - type boolean; - } - - leaf collector-address { - mandatory true; - type inet:ipv4-address; - } - - leaf source-address { - mandatory true; - type inet:ipv4-address; - } - } -} diff --git a/ioam/api/src/main/yang/ioam-sb-export@2017-02-06.yang b/ioam/api/src/main/yang/ioam-sb-export@2017-02-06.yang new file mode 100644 index 000000000..f04028a38 --- /dev/null +++ b/ioam/api/src/main/yang/ioam-sb-export@2017-02-06.yang @@ -0,0 +1,46 @@ +module ioam-sb-export { + + yang-version 1; + + namespace "urn:cisco:params:xml:ns:yang:ioam-sb-export"; + + prefix ioam-sb-export; + + organization "Cisco Systems, Inc."; + contact + "Shwetha Bhandari + Sagar Srivastav "; + + description + "This module contains a collection of YANG definitions for + managing in-band OAM based export + parameters."; + + revision 2017-02-06 { + description + "set source and collector addresses as mandatory"; + reference + ""; + } + + import ietf-inet-types { + prefix inet; + } + + container ioam-export { + + leaf disable { + type boolean; + } + + leaf collector-address { + mandatory true; + type inet:ipv4-address; + } + + leaf source-address { + mandatory true; + type inet:ipv4-address; + } + } +} diff --git a/ioam/api/src/main/yang/ioam-sb-trace.yang b/ioam/api/src/main/yang/ioam-sb-trace.yang deleted file mode 100644 index d950e9460..000000000 --- a/ioam/api/src/main/yang/ioam-sb-trace.yang +++ /dev/null @@ -1,190 +0,0 @@ -module ioam-sb-trace { - yang-version 1; - namespace "urn:cisco:params:xml:ns:yang:ioam-sb-trace"; - prefix ioam-sb-trace; - - import ietf-interfaces { prefix if; } - - organization "Cisco Systems, Inc."; - - contact - "Author: Srihari Raghavan - srihari@cisco.com"; - - description - "This YANG module defines a component that describing the - configuration of in-band OAM device configuration for - trace elements. - "; - - revision 2017-03-27 { - description - "ietf-interfaces prefix changed to default value to be compatible with LeafRefContext - (ODL tool for checking leafrefs in runtime)"; - } - - revision 2016-05-12 { - description - "Base model for in-band OAM trace device configuration."; - reference - ""; - } - - container ioam-trace-config { - description - "Device specific configuration for in-band OAM trace."; - - list trace-config { - key "trace-config-name"; - ordered-by system; - description - "Set of ioam trace configurations that group parameters - required to enable iOAM6 tracing at a service node"; - - leaf trace-config-name { - type string { - length "0..255"; - } - mandatory true; - description - "Unique identifier for each node tracing configuration"; - } - - leaf acl-name { - type string; - description - "The ACL name associated to classify and apply this - trace config"; - } - - leaf trace-type { - type uint8 { - range "3|7|9|17|25|31"; - } - - mandatory true; - description - "Trace type that defines the trace element variant. Moving - from LSB to MSB, each bit represents node_id, ingress_if_id, - egress_if_id, timestamp, app_data and others are undefined. - Currently, the supported values are 0x03, 0x07, 0x09, - 0x11, 0x19 and 0x1f."; - } - - leaf trace-num-elt { - type uint8; - - mandatory true; - description - "Number of trace elements to be inserted in the tracing - options."; - } - - leaf trace-tsp { - type enumeration { - enum seconds { - value 0; - description "Timestamp in seconds."; - } - enum milliseconds { - value 1; - description "Timestamp in milli seconds."; - } - enum microseconds { - value 2; - description "Timestamp in micro seconds."; - } - enum nanoseconds { - value 3; - description "Timestamp in nano seconds."; - } - } - - mandatory true; - description - "This field depicts the delay domain of the trace path, - whether it is in seconds, milliseconds, microseconds - or nanoseconds."; - } - - leaf trace-op { - type enumeration { - enum add { - value 0; - description "Add new and fill trace information."; - } - enum update { - value 1; - description "Update existing trace information."; - } - enum remove { - value 2; - description "Decap or remove existing trace information."; - } - } - - mandatory true; - description - "The type of trace element operation that the service node - handling this profile should do. The options are to add the - trace elements, update the trace elements or to remove the - trace elements."; - } - - leaf trace-app-data { - type uint32; - description - "Application specific data to be added by the node"; - } - - leaf node-id { - type uint32; - mandatory true; - description - "iOAM Service Node id assigned to this node"; - } - - list node-interfaces { - key "index"; - ordered-by system; - description - "List of node's interfaces on which the trace configuration - need to be applied. Typically this is to all interfaces - but can be filtered."; - - leaf index { - type uint32; - mandatory true; - description - "Index for the interfaces list"; - } - - leaf intf-name { - type if:interface-ref; - mandatory true; - description - "Instance of ietf-interfaces:interface-ref"; - } - } - - /*** links to ioam-sb-data-export ***/ - leaf data-export-profile-name { - type string; - description - "The data export profile name with server information to - send data to."; - } - - /*** Transport encap profiles. Not used currently ***/ - leaf transport-encap-profile-name { - type string; - description - "The transport encap profile name with sub configurations for - handling transport encap."; - } -/*** list: end ***/ - } -/*** container: end ***/ - } -/*** module: end ***/ -} diff --git a/ioam/api/src/main/yang/ioam-sb-trace@2017-03-27.yang b/ioam/api/src/main/yang/ioam-sb-trace@2017-03-27.yang new file mode 100644 index 000000000..d950e9460 --- /dev/null +++ b/ioam/api/src/main/yang/ioam-sb-trace@2017-03-27.yang @@ -0,0 +1,190 @@ +module ioam-sb-trace { + yang-version 1; + namespace "urn:cisco:params:xml:ns:yang:ioam-sb-trace"; + prefix ioam-sb-trace; + + import ietf-interfaces { prefix if; } + + organization "Cisco Systems, Inc."; + + contact + "Author: Srihari Raghavan + srihari@cisco.com"; + + description + "This YANG module defines a component that describing the + configuration of in-band OAM device configuration for + trace elements. + "; + + revision 2017-03-27 { + description + "ietf-interfaces prefix changed to default value to be compatible with LeafRefContext + (ODL tool for checking leafrefs in runtime)"; + } + + revision 2016-05-12 { + description + "Base model for in-band OAM trace device configuration."; + reference + ""; + } + + container ioam-trace-config { + description + "Device specific configuration for in-band OAM trace."; + + list trace-config { + key "trace-config-name"; + ordered-by system; + description + "Set of ioam trace configurations that group parameters + required to enable iOAM6 tracing at a service node"; + + leaf trace-config-name { + type string { + length "0..255"; + } + mandatory true; + description + "Unique identifier for each node tracing configuration"; + } + + leaf acl-name { + type string; + description + "The ACL name associated to classify and apply this + trace config"; + } + + leaf trace-type { + type uint8 { + range "3|7|9|17|25|31"; + } + + mandatory true; + description + "Trace type that defines the trace element variant. Moving + from LSB to MSB, each bit represents node_id, ingress_if_id, + egress_if_id, timestamp, app_data and others are undefined. + Currently, the supported values are 0x03, 0x07, 0x09, + 0x11, 0x19 and 0x1f."; + } + + leaf trace-num-elt { + type uint8; + + mandatory true; + description + "Number of trace elements to be inserted in the tracing + options."; + } + + leaf trace-tsp { + type enumeration { + enum seconds { + value 0; + description "Timestamp in seconds."; + } + enum milliseconds { + value 1; + description "Timestamp in milli seconds."; + } + enum microseconds { + value 2; + description "Timestamp in micro seconds."; + } + enum nanoseconds { + value 3; + description "Timestamp in nano seconds."; + } + } + + mandatory true; + description + "This field depicts the delay domain of the trace path, + whether it is in seconds, milliseconds, microseconds + or nanoseconds."; + } + + leaf trace-op { + type enumeration { + enum add { + value 0; + description "Add new and fill trace information."; + } + enum update { + value 1; + description "Update existing trace information."; + } + enum remove { + value 2; + description "Decap or remove existing trace information."; + } + } + + mandatory true; + description + "The type of trace element operation that the service node + handling this profile should do. The options are to add the + trace elements, update the trace elements or to remove the + trace elements."; + } + + leaf trace-app-data { + type uint32; + description + "Application specific data to be added by the node"; + } + + leaf node-id { + type uint32; + mandatory true; + description + "iOAM Service Node id assigned to this node"; + } + + list node-interfaces { + key "index"; + ordered-by system; + description + "List of node's interfaces on which the trace configuration + need to be applied. Typically this is to all interfaces + but can be filtered."; + + leaf index { + type uint32; + mandatory true; + description + "Index for the interfaces list"; + } + + leaf intf-name { + type if:interface-ref; + mandatory true; + description + "Instance of ietf-interfaces:interface-ref"; + } + } + + /*** links to ioam-sb-data-export ***/ + leaf data-export-profile-name { + type string; + description + "The data export profile name with server information to + send data to."; + } + + /*** Transport encap profiles. Not used currently ***/ + leaf transport-encap-profile-name { + type string; + description + "The transport encap profile name with sub configurations for + handling transport encap."; + } +/*** list: end ***/ + } +/*** container: end ***/ + } +/*** module: end ***/ +} diff --git a/ioam/api/src/main/yang/sfc-ioam-sb-pot.yang b/ioam/api/src/main/yang/sfc-ioam-sb-pot.yang deleted file mode 100644 index dc4ecedf2..000000000 --- a/ioam/api/src/main/yang/sfc-ioam-sb-pot.yang +++ /dev/null @@ -1,169 +0,0 @@ -module sfc-ioam-sb-pot { - - yang-version 1; - - namespace "urn:cisco:params:xml:ns:yang:sfc-ioam-sb-pot"; - - prefix sfc-ioam-sb-pot; - - organization "Cisco Systems, Inc."; - contact - "Shwetha Bhandari - Srihari Raghavan "; - - description - "This module contains a collection of YANG definitions for - managing in-band OAM based proof of transit configuration - parameters. (https://github.com/ciscodevnet/ioam). - - The model is meant for proof of transit - and is targetted for south-bound deployment nodes."; - - revision 2017-01-12 { - description - "Changes to field names and parameter ranges."; - reference - ""; - } - - typedef profile-index-range { - type int32 { - range "-1 .. 1"; - } - description - "Range used for the profile index. Currently restricted to - -1 to 1 to identify profiles."; - } - - identity path-identifier-identity { - description - "Base identity for path identifier type."; - } - - identity path-identifier-type-acl { - base "path-identifier-identity"; - description - "ACL path identifier type."; - } - - typedef path-identifier-type { - type identityref { - base path-identifier-identity; - } - description - "Path Identifier Identity type."; - } - - grouping pot-profile { - description "A grouping for proof of transit profiles."; - list pot-profile-list { - key "index"; - ordered-by user; - description "A set of pot profiles."; - - leaf index { - type profile-index-range; - mandatory true; - description - "Proof of transit profile index."; - } - - leaf prime-number { - type uint64; - mandatory true; - description - "Prime number used for module math computation"; - } - - leaf secret-share { - type uint64; - mandatory true; - description - "Share of the secret of polynomial 1 used in computation"; - } - - leaf public-polynomial { - type uint64; - mandatory true; - description - "Public polynomial"; - } - - leaf lpc { - type uint64; - mandatory true; - description - "Lagrange Polynomial Coefficient"; - } - - leaf validator { - type boolean; - default "false"; - description - "True if the node is a verifier node"; - } - - leaf validator-key { - type uint64; - description - "Secret key for validating the path, constant of poly 1"; - } - - leaf number-of-bits { - type uint8; - default 32; - description - "Number of bits as mask used in random value generation. - 32-bits of mask is default."; - } - } - } - - container pot-profiles { - description "A group of proof of transit profiles."; - - list pot-profile-set { - key "name"; - ordered-by user; - description - "Set of proof of transit profiles that group parameters - required to classify and compute proof of transit - metadata at a node"; - - leaf name { - type string; - mandatory true; - description - "Unique identifier for each proof of transit profile"; - } - - leaf path-identifier { - type string; - description - "The path identifier could be an ACL or others associated - to classify and apply this profile"; - } - - leaf path-identifier-type-value { - type path-identifier-type; - default path-identifier-type-acl; - description - "Defines how to interpret the path-identifier."; - } - - leaf active-profile-index { - type profile-index-range; - description - "Proof of transit profile index that is currently active. - Will be set in the first hop of the path or chain. - Other nodes will not use this field."; - } - - uses pot-profile; - - /*** list: end ***/ - } - /*** Container: end ***/ - } -/*** module: end ***/ -} diff --git a/ioam/api/src/main/yang/sfc-ioam-sb-pot@2017-01-12.yang b/ioam/api/src/main/yang/sfc-ioam-sb-pot@2017-01-12.yang new file mode 100644 index 000000000..dc4ecedf2 --- /dev/null +++ b/ioam/api/src/main/yang/sfc-ioam-sb-pot@2017-01-12.yang @@ -0,0 +1,169 @@ +module sfc-ioam-sb-pot { + + yang-version 1; + + namespace "urn:cisco:params:xml:ns:yang:sfc-ioam-sb-pot"; + + prefix sfc-ioam-sb-pot; + + organization "Cisco Systems, Inc."; + contact + "Shwetha Bhandari + Srihari Raghavan "; + + description + "This module contains a collection of YANG definitions for + managing in-band OAM based proof of transit configuration + parameters. (https://github.com/ciscodevnet/ioam). + + The model is meant for proof of transit + and is targetted for south-bound deployment nodes."; + + revision 2017-01-12 { + description + "Changes to field names and parameter ranges."; + reference + ""; + } + + typedef profile-index-range { + type int32 { + range "-1 .. 1"; + } + description + "Range used for the profile index. Currently restricted to + -1 to 1 to identify profiles."; + } + + identity path-identifier-identity { + description + "Base identity for path identifier type."; + } + + identity path-identifier-type-acl { + base "path-identifier-identity"; + description + "ACL path identifier type."; + } + + typedef path-identifier-type { + type identityref { + base path-identifier-identity; + } + description + "Path Identifier Identity type."; + } + + grouping pot-profile { + description "A grouping for proof of transit profiles."; + list pot-profile-list { + key "index"; + ordered-by user; + description "A set of pot profiles."; + + leaf index { + type profile-index-range; + mandatory true; + description + "Proof of transit profile index."; + } + + leaf prime-number { + type uint64; + mandatory true; + description + "Prime number used for module math computation"; + } + + leaf secret-share { + type uint64; + mandatory true; + description + "Share of the secret of polynomial 1 used in computation"; + } + + leaf public-polynomial { + type uint64; + mandatory true; + description + "Public polynomial"; + } + + leaf lpc { + type uint64; + mandatory true; + description + "Lagrange Polynomial Coefficient"; + } + + leaf validator { + type boolean; + default "false"; + description + "True if the node is a verifier node"; + } + + leaf validator-key { + type uint64; + description + "Secret key for validating the path, constant of poly 1"; + } + + leaf number-of-bits { + type uint8; + default 32; + description + "Number of bits as mask used in random value generation. + 32-bits of mask is default."; + } + } + } + + container pot-profiles { + description "A group of proof of transit profiles."; + + list pot-profile-set { + key "name"; + ordered-by user; + description + "Set of proof of transit profiles that group parameters + required to classify and compute proof of transit + metadata at a node"; + + leaf name { + type string; + mandatory true; + description + "Unique identifier for each proof of transit profile"; + } + + leaf path-identifier { + type string; + description + "The path identifier could be an ACL or others associated + to classify and apply this profile"; + } + + leaf path-identifier-type-value { + type path-identifier-type; + default path-identifier-type-acl; + description + "Defines how to interpret the path-identifier."; + } + + leaf active-profile-index { + type profile-index-range; + description + "Proof of transit profile index that is currently active. + Will be set in the first hop of the path or chain. + Other nodes will not use this field."; + } + + uses pot-profile; + + /*** list: end ***/ + } + /*** Container: end ***/ + } +/*** module: end ***/ +} diff --git a/l3/api/src/main/yang/ietf-ip.yang b/l3/api/src/main/yang/ietf-ip.yang deleted file mode 100644 index f6c59edea..000000000 --- a/l3/api/src/main/yang/ietf-ip.yang +++ /dev/null @@ -1,742 +0,0 @@ -module ietf-ip { - - yang-version 1; - - namespace - "urn:ietf:params:xml:ns:yang:ietf-ip"; - - prefix ip; - - import ietf-interfaces { - prefix if; - } - import ietf-inet-types { - prefix inet; - } - import ietf-yang-types { - prefix yang; - } - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: Thomas Nadeau - - - WG Chair: Juergen Schoenwaelder - - - Editor: Martin Bjorklund - "; - - description - "This module contains a collection of YANG definitions for - configuring IP implementations. - - Copyright (c) 2014 IETF Trust and the persons identified as - authors of the code. All rights reserved. - - Redistribution and use in source and binary forms, with or - without modification, is permitted pursuant to, and subject - to the license terms contained in, the Simplified BSD License - set forth in Section 4.c of the IETF Trust's Legal Provisions - Relating to IETF Documents - (http://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 7277; see - the RFC itself for full legal notices."; - - revision "2014-06-16" { - description "Initial revision."; - reference - "RFC 7277: A YANG Data Model for IP Management"; - - } - - - feature ipv4-non-contiguous-netmasks { - description - "Indicates support for configuring non-contiguous - subnet masks."; - } - - feature ipv6-privacy-autoconf { - description - "Indicates support for Privacy Extensions for Stateless Address - Autoconfiguration in IPv6."; - reference - "RFC 4941: Privacy Extensions for Stateless Address - Autoconfiguration in IPv6"; - - } - - typedef ip-address-origin { - type enumeration { - enum "other" { - value 0; - description - "None of the following."; - } - enum "static" { - value 1; - description - "Indicates that the address has been statically - configured - for example, using NETCONF or a Command Line - Interface."; - } - enum "dhcp" { - value 2; - description - "Indicates an address that has been assigned to this - system by a DHCP server."; - } - enum "link-layer" { - value 3; - description - "Indicates an address created by IPv6 stateless - autoconfiguration that embeds a link-layer address in its - interface identifier."; - } - enum "random" { - value 4; - description - "Indicates an address chosen by the system at - - random, e.g., an IPv4 address within 169.254/16, an - RFC 4941 temporary address, or an RFC 7217 semantically - opaque address."; - reference - "RFC 4941: Privacy Extensions for Stateless Address - Autoconfiguration in IPv6 - RFC 7217: A Method for Generating Semantically Opaque - Interface Identifiers with IPv6 Stateless - Address Autoconfiguration (SLAAC)"; - - } - } - description - "The origin of an address."; - } - - typedef neighbor-origin { - type enumeration { - enum "other" { - value 0; - description - "None of the following."; - } - enum "static" { - value 1; - description - "Indicates that the mapping has been statically - configured - for example, using NETCONF or a Command Line - Interface."; - } - enum "dynamic" { - value 2; - description - "Indicates that the mapping has been dynamically resolved - using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery - protocol."; - } - } - description - "The origin of a neighbor entry."; - } - - augment /if:interfaces/if:interface { - description - "Parameters for configuring IP on interfaces. - - If an interface is not capable of running IP, the server - must not allow the client to configure these parameters."; - container ipv4 { - presence - "Enables IPv4 unless the 'enabled' leaf - (which defaults to 'true') is set to 'false'"; - description - "Parameters for the IPv4 address family."; - leaf enabled { - type boolean; - default 'true'; - description - "Controls whether IPv4 is enabled or disabled on this - interface. When IPv4 is enabled, this interface is - connected to an IPv4 stack, and the interface can send - and receive IPv4 packets."; - } - - leaf forwarding { - type boolean; - default 'false'; - description - "Controls IPv4 packet forwarding of datagrams received by, - but not addressed to, this interface. IPv4 routers - forward datagrams. IPv4 hosts do not (except those - source-routed via the host)."; - } - - leaf mtu { - type uint16 { - range "68..max"; - } - units "octets"; - description - "The size, in octets, of the largest IPv4 packet that the - interface will send and receive. - - The server may restrict the allowed values for this leaf, - depending on the interface's type. - - If this leaf is not configured, the operationally used MTU - depends on the interface's type."; - reference - "RFC 791: Internet Protocol"; - - } - - list address { - key "ip"; - description - "The list of configured IPv4 addresses on the interface."; - leaf ip { - type inet:ipv4-address-no-zone; - description - "The IPv4 address on the interface."; - } - - choice subnet { - mandatory true; - description - "The subnet can be specified as a prefix-length, or, - if the server supports non-contiguous netmasks, as - a netmask."; - leaf prefix-length { - type uint8 { - range "0..32"; - } - description - "The length of the subnet prefix."; - } - leaf netmask { - if-feature ipv4-non-contiguous-netmasks; - type yang:dotted-quad; - description - "The subnet specified as a netmask."; - } - } // choice subnet - } // list address - - list neighbor { - key "ip"; - description - "A list of mappings from IPv4 addresses to - link-layer addresses. - - Entries in this list are used as static entries in the - ARP Cache."; - reference - "RFC 826: An Ethernet Address Resolution Protocol"; - - leaf ip { - type inet:ipv4-address-no-zone; - description - "The IPv4 address of the neighbor node."; - } - - leaf link-layer-address { - type yang:phys-address; - mandatory true; - description - "The link-layer address of the neighbor node."; - } - } // list neighbor - } // container ipv4 - - container ipv6 { - presence - "Enables IPv6 unless the 'enabled' leaf - (which defaults to 'true') is set to 'false'"; - description - "Parameters for the IPv6 address family."; - leaf enabled { - type boolean; - default 'true'; - description - "Controls whether IPv6 is enabled or disabled on this - interface. When IPv6 is enabled, this interface is - connected to an IPv6 stack, and the interface can send - and receive IPv6 packets."; - } - - leaf forwarding { - type boolean; - default 'false'; - description - "Controls IPv6 packet forwarding of datagrams received by, - but not addressed to, this interface. IPv6 routers - forward datagrams. IPv6 hosts do not (except those - source-routed via the host)."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - Section 6.2.1, IsRouter"; - - } - - leaf mtu { - type uint32 { - range "1280..max"; - } - units "octets"; - description - "The size, in octets, of the largest IPv6 packet that the - interface will send and receive. - - The server may restrict the allowed values for this leaf, - depending on the interface's type. - - If this leaf is not configured, the operationally used MTU - depends on the interface's type."; - reference - "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification - Section 5"; - - } - - list address { - key "ip"; - description - "The list of configured IPv6 addresses on the interface."; - leaf ip { - type inet:ipv6-address-no-zone; - description - "The IPv6 address on the interface."; - } - - leaf prefix-length { - type uint8 { - range "0..128"; - } - mandatory true; - description - "The length of the subnet prefix."; - } - } // list address - - list neighbor { - key "ip"; - description - "A list of mappings from IPv6 addresses to - link-layer addresses. - - Entries in this list are used as static entries in the - Neighbor Cache."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)"; - - leaf ip { - type inet:ipv6-address-no-zone; - description - "The IPv6 address of the neighbor node."; - } - - leaf link-layer-address { - type yang:phys-address; - mandatory true; - description - "The link-layer address of the neighbor node."; - } - } // list neighbor - - leaf dup-addr-detect-transmits { - type uint32; - default '1'; - description - "The number of consecutive Neighbor Solicitation messages - sent while performing Duplicate Address Detection on a - tentative address. A value of zero indicates that - Duplicate Address Detection is not performed on - tentative addresses. A value of one indicates a single - transmission with no follow-up retransmissions."; - reference - "RFC 4862: IPv6 Stateless Address Autoconfiguration"; - - } - - container autoconf { - description - "Parameters to control the autoconfiguration of IPv6 - addresses, as described in RFC 4862."; - reference - "RFC 4862: IPv6 Stateless Address Autoconfiguration"; - - leaf create-global-addresses { - type boolean; - default 'true'; - description - "If enabled, the host creates global addresses as - described in RFC 4862."; - reference - "RFC 4862: IPv6 Stateless Address Autoconfiguration - Section 5.5"; - - } - - leaf create-temporary-addresses { - if-feature ipv6-privacy-autoconf; - type boolean; - default 'false'; - description - "If enabled, the host creates temporary addresses as - described in RFC 4941."; - reference - "RFC 4941: Privacy Extensions for Stateless Address - Autoconfiguration in IPv6"; - - } - - leaf temporary-valid-lifetime { - if-feature ipv6-privacy-autoconf; - type uint32; - units "seconds"; - default '604800'; - description - "The time period during which the temporary address - is valid."; - reference - "RFC 4941: Privacy Extensions for Stateless Address - Autoconfiguration in IPv6 - - TEMP_VALID_LIFETIME"; - - } - - leaf temporary-preferred-lifetime { - if-feature ipv6-privacy-autoconf; - type uint32; - units "seconds"; - default '86400'; - description - "The time period during which the temporary address is - preferred."; - reference - "RFC 4941: Privacy Extensions for Stateless Address - Autoconfiguration in IPv6 - - TEMP_PREFERRED_LIFETIME"; - - } - } // container autoconf - } // container ipv6 - } - - augment /if:interfaces-state/if:interface { - description - "Data nodes for the operational state of IP on interfaces."; - container ipv4 { - presence - "Present if IPv4 is enabled on this interface"; - config false; - description - "Interface-specific parameters for the IPv4 address family."; - leaf forwarding { - type boolean; - description - "Indicates whether IPv4 packet forwarding is enabled or - disabled on this interface."; - } - - leaf mtu { - type uint16 { - range "68..max"; - } - units "octets"; - description - "The size, in octets, of the largest IPv4 packet that the - interface will send and receive."; - reference - "RFC 791: Internet Protocol"; - - } - - list address { - key "ip"; - description - "The list of IPv4 addresses on the interface."; - leaf ip { - type inet:ipv4-address-no-zone; - description - "The IPv4 address on the interface."; - } - - choice subnet { - description - "The subnet can be specified as a prefix-length, or, - if the server supports non-contiguous netmasks, as - a netmask."; - leaf prefix-length { - type uint8 { - range "0..32"; - } - description - "The length of the subnet prefix."; - } - leaf netmask { - if-feature ipv4-non-contiguous-netmasks; - type yang:dotted-quad; - description - "The subnet specified as a netmask."; - } - } // choice subnet - - leaf origin { - type ip-address-origin; - description - "The origin of this address."; - } - } // list address - - list neighbor { - key "ip"; - description - "A list of mappings from IPv4 addresses to - link-layer addresses. - - This list represents the ARP Cache."; - reference - "RFC 826: An Ethernet Address Resolution Protocol"; - - leaf ip { - type inet:ipv4-address-no-zone; - description - "The IPv4 address of the neighbor node."; - } - - leaf link-layer-address { - type yang:phys-address; - description - "The link-layer address of the neighbor node."; - } - - leaf origin { - type neighbor-origin; - description - "The origin of this neighbor entry."; - } - } // list neighbor - } // container ipv4 - - container ipv6 { - presence - "Present if IPv6 is enabled on this interface"; - config false; - description - "Parameters for the IPv6 address family."; - leaf forwarding { - type boolean; - default 'false'; - description - "Indicates whether IPv6 packet forwarding is enabled or - disabled on this interface."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - Section 6.2.1, IsRouter"; - - } - - leaf mtu { - type uint32 { - range "1280..max"; - } - units "octets"; - description - "The size, in octets, of the largest IPv6 packet that the - interface will send and receive."; - reference - "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification - Section 5"; - - } - - list address { - key "ip"; - description - "The list of IPv6 addresses on the interface."; - leaf ip { - type inet:ipv6-address-no-zone; - description - "The IPv6 address on the interface."; - } - - leaf prefix-length { - type uint8 { - range "0..128"; - } - mandatory true; - description - "The length of the subnet prefix."; - } - - leaf origin { - type ip-address-origin; - description - "The origin of this address."; - } - - leaf status { - type enumeration { - enum "preferred" { - value 0; - description - "This is a valid address that can appear as the - destination or source address of a packet."; - } - enum "deprecated" { - value 1; - description - "This is a valid but deprecated address that should - no longer be used as a source address in new - communications, but packets addressed to such an - address are processed as expected."; - } - enum "invalid" { - value 2; - description - "This isn't a valid address, and it shouldn't appear - as the destination or source address of a packet."; - } - enum "inaccessible" { - value 3; - description - "The address is not accessible because the interface - to which this address is assigned is not - operational."; - } - enum "unknown" { - value 4; - description - "The status cannot be determined for some reason."; - } - enum "tentative" { - value 5; - description - "The uniqueness of the address on the link is being - verified. Addresses in this state should not be - used for general communication and should only be - used to determine the uniqueness of the address."; - } - enum "duplicate" { - value 6; - description - "The address has been determined to be non-unique on - the link and so must not be used."; - } - enum "optimistic" { - value 7; - description - "The address is available for use, subject to - restrictions, while its uniqueness on a link is - being verified."; - } - } - description - "The status of an address. Most of the states correspond - to states from the IPv6 Stateless Address - Autoconfiguration protocol."; - reference - "RFC 4293: Management Information Base for the - Internet Protocol (IP) - - IpAddressStatusTC - RFC 4862: IPv6 Stateless Address Autoconfiguration"; - - } - } // list address - - list neighbor { - key "ip"; - description - "A list of mappings from IPv6 addresses to - link-layer addresses. - - This list represents the Neighbor Cache."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)"; - - leaf ip { - type inet:ipv6-address-no-zone; - description - "The IPv6 address of the neighbor node."; - } - - leaf link-layer-address { - type yang:phys-address; - description - "The link-layer address of the neighbor node."; - } - - leaf origin { - type neighbor-origin; - description - "The origin of this neighbor entry."; - } - - leaf is-router { - type empty; - description - "Indicates that the neighbor node acts as a router."; - } - - leaf state { - type enumeration { - enum "incomplete" { - value 0; - description - "Address resolution is in progress, and the link-layer - address of the neighbor has not yet been - determined."; - } - enum "reachable" { - value 1; - description - "Roughly speaking, the neighbor is known to have been - reachable recently (within tens of seconds ago)."; - } - enum "stale" { - value 2; - description - "The neighbor is no longer known to be reachable, but - until traffic is sent to the neighbor no attempt - should be made to verify its reachability."; - } - enum "delay" { - value 3; - description - "The neighbor is no longer known to be reachable, and - traffic has recently been sent to the neighbor. - Rather than probe the neighbor immediately, however, - delay sending probes for a short while in order to - give upper-layer protocols a chance to provide - reachability confirmation."; - } - enum "probe" { - value 4; - description - "The neighbor is no longer known to be reachable, and - unicast Neighbor Solicitation probes are being sent - to verify reachability."; - } - } - description - "The Neighbor Unreachability Detection state of this - entry."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - Section 7.3.2"; - - } - } // list neighbor - } // container ipv6 - } -} // module ietf-ip diff --git a/l3/api/src/main/yang/ietf-ip@2014-06-16.yang b/l3/api/src/main/yang/ietf-ip@2014-06-16.yang new file mode 100644 index 000000000..f6c59edea --- /dev/null +++ b/l3/api/src/main/yang/ietf-ip@2014-06-16.yang @@ -0,0 +1,742 @@ +module ietf-ip { + + yang-version 1; + + namespace + "urn:ietf:params:xml:ns:yang:ietf-ip"; + + prefix ip; + + import ietf-interfaces { + prefix if; + } + import ietf-inet-types { + prefix inet; + } + import ietf-yang-types { + prefix yang; + } + + organization + "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; + + contact + "WG Web: + WG List: + + WG Chair: Thomas Nadeau + + + WG Chair: Juergen Schoenwaelder + + + Editor: Martin Bjorklund + "; + + description + "This module contains a collection of YANG definitions for + configuring IP implementations. + + Copyright (c) 2014 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 7277; see + the RFC itself for full legal notices."; + + revision "2014-06-16" { + description "Initial revision."; + reference + "RFC 7277: A YANG Data Model for IP Management"; + + } + + + feature ipv4-non-contiguous-netmasks { + description + "Indicates support for configuring non-contiguous + subnet masks."; + } + + feature ipv6-privacy-autoconf { + description + "Indicates support for Privacy Extensions for Stateless Address + Autoconfiguration in IPv6."; + reference + "RFC 4941: Privacy Extensions for Stateless Address + Autoconfiguration in IPv6"; + + } + + typedef ip-address-origin { + type enumeration { + enum "other" { + value 0; + description + "None of the following."; + } + enum "static" { + value 1; + description + "Indicates that the address has been statically + configured - for example, using NETCONF or a Command Line + Interface."; + } + enum "dhcp" { + value 2; + description + "Indicates an address that has been assigned to this + system by a DHCP server."; + } + enum "link-layer" { + value 3; + description + "Indicates an address created by IPv6 stateless + autoconfiguration that embeds a link-layer address in its + interface identifier."; + } + enum "random" { + value 4; + description + "Indicates an address chosen by the system at + + random, e.g., an IPv4 address within 169.254/16, an + RFC 4941 temporary address, or an RFC 7217 semantically + opaque address."; + reference + "RFC 4941: Privacy Extensions for Stateless Address + Autoconfiguration in IPv6 + RFC 7217: A Method for Generating Semantically Opaque + Interface Identifiers with IPv6 Stateless + Address Autoconfiguration (SLAAC)"; + + } + } + description + "The origin of an address."; + } + + typedef neighbor-origin { + type enumeration { + enum "other" { + value 0; + description + "None of the following."; + } + enum "static" { + value 1; + description + "Indicates that the mapping has been statically + configured - for example, using NETCONF or a Command Line + Interface."; + } + enum "dynamic" { + value 2; + description + "Indicates that the mapping has been dynamically resolved + using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery + protocol."; + } + } + description + "The origin of a neighbor entry."; + } + + augment /if:interfaces/if:interface { + description + "Parameters for configuring IP on interfaces. + + If an interface is not capable of running IP, the server + must not allow the client to configure these parameters."; + container ipv4 { + presence + "Enables IPv4 unless the 'enabled' leaf + (which defaults to 'true') is set to 'false'"; + description + "Parameters for the IPv4 address family."; + leaf enabled { + type boolean; + default 'true'; + description + "Controls whether IPv4 is enabled or disabled on this + interface. When IPv4 is enabled, this interface is + connected to an IPv4 stack, and the interface can send + and receive IPv4 packets."; + } + + leaf forwarding { + type boolean; + default 'false'; + description + "Controls IPv4 packet forwarding of datagrams received by, + but not addressed to, this interface. IPv4 routers + forward datagrams. IPv4 hosts do not (except those + source-routed via the host)."; + } + + leaf mtu { + type uint16 { + range "68..max"; + } + units "octets"; + description + "The size, in octets, of the largest IPv4 packet that the + interface will send and receive. + + The server may restrict the allowed values for this leaf, + depending on the interface's type. + + If this leaf is not configured, the operationally used MTU + depends on the interface's type."; + reference + "RFC 791: Internet Protocol"; + + } + + list address { + key "ip"; + description + "The list of configured IPv4 addresses on the interface."; + leaf ip { + type inet:ipv4-address-no-zone; + description + "The IPv4 address on the interface."; + } + + choice subnet { + mandatory true; + description + "The subnet can be specified as a prefix-length, or, + if the server supports non-contiguous netmasks, as + a netmask."; + leaf prefix-length { + type uint8 { + range "0..32"; + } + description + "The length of the subnet prefix."; + } + leaf netmask { + if-feature ipv4-non-contiguous-netmasks; + type yang:dotted-quad; + description + "The subnet specified as a netmask."; + } + } // choice subnet + } // list address + + list neighbor { + key "ip"; + description + "A list of mappings from IPv4 addresses to + link-layer addresses. + + Entries in this list are used as static entries in the + ARP Cache."; + reference + "RFC 826: An Ethernet Address Resolution Protocol"; + + leaf ip { + type inet:ipv4-address-no-zone; + description + "The IPv4 address of the neighbor node."; + } + + leaf link-layer-address { + type yang:phys-address; + mandatory true; + description + "The link-layer address of the neighbor node."; + } + } // list neighbor + } // container ipv4 + + container ipv6 { + presence + "Enables IPv6 unless the 'enabled' leaf + (which defaults to 'true') is set to 'false'"; + description + "Parameters for the IPv6 address family."; + leaf enabled { + type boolean; + default 'true'; + description + "Controls whether IPv6 is enabled or disabled on this + interface. When IPv6 is enabled, this interface is + connected to an IPv6 stack, and the interface can send + and receive IPv6 packets."; + } + + leaf forwarding { + type boolean; + default 'false'; + description + "Controls IPv6 packet forwarding of datagrams received by, + but not addressed to, this interface. IPv6 routers + forward datagrams. IPv6 hosts do not (except those + source-routed via the host)."; + reference + "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) + Section 6.2.1, IsRouter"; + + } + + leaf mtu { + type uint32 { + range "1280..max"; + } + units "octets"; + description + "The size, in octets, of the largest IPv6 packet that the + interface will send and receive. + + The server may restrict the allowed values for this leaf, + depending on the interface's type. + + If this leaf is not configured, the operationally used MTU + depends on the interface's type."; + reference + "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + Section 5"; + + } + + list address { + key "ip"; + description + "The list of configured IPv6 addresses on the interface."; + leaf ip { + type inet:ipv6-address-no-zone; + description + "The IPv6 address on the interface."; + } + + leaf prefix-length { + type uint8 { + range "0..128"; + } + mandatory true; + description + "The length of the subnet prefix."; + } + } // list address + + list neighbor { + key "ip"; + description + "A list of mappings from IPv6 addresses to + link-layer addresses. + + Entries in this list are used as static entries in the + Neighbor Cache."; + reference + "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)"; + + leaf ip { + type inet:ipv6-address-no-zone; + description + "The IPv6 address of the neighbor node."; + } + + leaf link-layer-address { + type yang:phys-address; + mandatory true; + description + "The link-layer address of the neighbor node."; + } + } // list neighbor + + leaf dup-addr-detect-transmits { + type uint32; + default '1'; + description + "The number of consecutive Neighbor Solicitation messages + sent while performing Duplicate Address Detection on a + tentative address. A value of zero indicates that + Duplicate Address Detection is not performed on + tentative addresses. A value of one indicates a single + transmission with no follow-up retransmissions."; + reference + "RFC 4862: IPv6 Stateless Address Autoconfiguration"; + + } + + container autoconf { + description + "Parameters to control the autoconfiguration of IPv6 + addresses, as described in RFC 4862."; + reference + "RFC 4862: IPv6 Stateless Address Autoconfiguration"; + + leaf create-global-addresses { + type boolean; + default 'true'; + description + "If enabled, the host creates global addresses as + described in RFC 4862."; + reference + "RFC 4862: IPv6 Stateless Address Autoconfiguration + Section 5.5"; + + } + + leaf create-temporary-addresses { + if-feature ipv6-privacy-autoconf; + type boolean; + default 'false'; + description + "If enabled, the host creates temporary addresses as + described in RFC 4941."; + reference + "RFC 4941: Privacy Extensions for Stateless Address + Autoconfiguration in IPv6"; + + } + + leaf temporary-valid-lifetime { + if-feature ipv6-privacy-autoconf; + type uint32; + units "seconds"; + default '604800'; + description + "The time period during which the temporary address + is valid."; + reference + "RFC 4941: Privacy Extensions for Stateless Address + Autoconfiguration in IPv6 + - TEMP_VALID_LIFETIME"; + + } + + leaf temporary-preferred-lifetime { + if-feature ipv6-privacy-autoconf; + type uint32; + units "seconds"; + default '86400'; + description + "The time period during which the temporary address is + preferred."; + reference + "RFC 4941: Privacy Extensions for Stateless Address + Autoconfiguration in IPv6 + - TEMP_PREFERRED_LIFETIME"; + + } + } // container autoconf + } // container ipv6 + } + + augment /if:interfaces-state/if:interface { + description + "Data nodes for the operational state of IP on interfaces."; + container ipv4 { + presence + "Present if IPv4 is enabled on this interface"; + config false; + description + "Interface-specific parameters for the IPv4 address family."; + leaf forwarding { + type boolean; + description + "Indicates whether IPv4 packet forwarding is enabled or + disabled on this interface."; + } + + leaf mtu { + type uint16 { + range "68..max"; + } + units "octets"; + description + "The size, in octets, of the largest IPv4 packet that the + interface will send and receive."; + reference + "RFC 791: Internet Protocol"; + + } + + list address { + key "ip"; + description + "The list of IPv4 addresses on the interface."; + leaf ip { + type inet:ipv4-address-no-zone; + description + "The IPv4 address on the interface."; + } + + choice subnet { + description + "The subnet can be specified as a prefix-length, or, + if the server supports non-contiguous netmasks, as + a netmask."; + leaf prefix-length { + type uint8 { + range "0..32"; + } + description + "The length of the subnet prefix."; + } + leaf netmask { + if-feature ipv4-non-contiguous-netmasks; + type yang:dotted-quad; + description + "The subnet specified as a netmask."; + } + } // choice subnet + + leaf origin { + type ip-address-origin; + description + "The origin of this address."; + } + } // list address + + list neighbor { + key "ip"; + description + "A list of mappings from IPv4 addresses to + link-layer addresses. + + This list represents the ARP Cache."; + reference + "RFC 826: An Ethernet Address Resolution Protocol"; + + leaf ip { + type inet:ipv4-address-no-zone; + description + "The IPv4 address of the neighbor node."; + } + + leaf link-layer-address { + type yang:phys-address; + description + "The link-layer address of the neighbor node."; + } + + leaf origin { + type neighbor-origin; + description + "The origin of this neighbor entry."; + } + } // list neighbor + } // container ipv4 + + container ipv6 { + presence + "Present if IPv6 is enabled on this interface"; + config false; + description + "Parameters for the IPv6 address family."; + leaf forwarding { + type boolean; + default 'false'; + description + "Indicates whether IPv6 packet forwarding is enabled or + disabled on this interface."; + reference + "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) + Section 6.2.1, IsRouter"; + + } + + leaf mtu { + type uint32 { + range "1280..max"; + } + units "octets"; + description + "The size, in octets, of the largest IPv6 packet that the + interface will send and receive."; + reference + "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + Section 5"; + + } + + list address { + key "ip"; + description + "The list of IPv6 addresses on the interface."; + leaf ip { + type inet:ipv6-address-no-zone; + description + "The IPv6 address on the interface."; + } + + leaf prefix-length { + type uint8 { + range "0..128"; + } + mandatory true; + description + "The length of the subnet prefix."; + } + + leaf origin { + type ip-address-origin; + description + "The origin of this address."; + } + + leaf status { + type enumeration { + enum "preferred" { + value 0; + description + "This is a valid address that can appear as the + destination or source address of a packet."; + } + enum "deprecated" { + value 1; + description + "This is a valid but deprecated address that should + no longer be used as a source address in new + communications, but packets addressed to such an + address are processed as expected."; + } + enum "invalid" { + value 2; + description + "This isn't a valid address, and it shouldn't appear + as the destination or source address of a packet."; + } + enum "inaccessible" { + value 3; + description + "The address is not accessible because the interface + to which this address is assigned is not + operational."; + } + enum "unknown" { + value 4; + description + "The status cannot be determined for some reason."; + } + enum "tentative" { + value 5; + description + "The uniqueness of the address on the link is being + verified. Addresses in this state should not be + used for general communication and should only be + used to determine the uniqueness of the address."; + } + enum "duplicate" { + value 6; + description + "The address has been determined to be non-unique on + the link and so must not be used."; + } + enum "optimistic" { + value 7; + description + "The address is available for use, subject to + restrictions, while its uniqueness on a link is + being verified."; + } + } + description + "The status of an address. Most of the states correspond + to states from the IPv6 Stateless Address + Autoconfiguration protocol."; + reference + "RFC 4293: Management Information Base for the + Internet Protocol (IP) + - IpAddressStatusTC + RFC 4862: IPv6 Stateless Address Autoconfiguration"; + + } + } // list address + + list neighbor { + key "ip"; + description + "A list of mappings from IPv6 addresses to + link-layer addresses. + + This list represents the Neighbor Cache."; + reference + "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)"; + + leaf ip { + type inet:ipv6-address-no-zone; + description + "The IPv6 address of the neighbor node."; + } + + leaf link-layer-address { + type yang:phys-address; + description + "The link-layer address of the neighbor node."; + } + + leaf origin { + type neighbor-origin; + description + "The origin of this neighbor entry."; + } + + leaf is-router { + type empty; + description + "Indicates that the neighbor node acts as a router."; + } + + leaf state { + type enumeration { + enum "incomplete" { + value 0; + description + "Address resolution is in progress, and the link-layer + address of the neighbor has not yet been + determined."; + } + enum "reachable" { + value 1; + description + "Roughly speaking, the neighbor is known to have been + reachable recently (within tens of seconds ago)."; + } + enum "stale" { + value 2; + description + "The neighbor is no longer known to be reachable, but + until traffic is sent to the neighbor no attempt + should be made to verify its reachability."; + } + enum "delay" { + value 3; + description + "The neighbor is no longer known to be reachable, and + traffic has recently been sent to the neighbor. + Rather than probe the neighbor immediately, however, + delay sending probes for a short while in order to + give upper-layer protocols a chance to provide + reachability confirmation."; + } + enum "probe" { + value 4; + description + "The neighbor is no longer known to be reachable, and + unicast Neighbor Solicitation probes are being sent + to verify reachability."; + } + } + description + "The Neighbor Unreachability Detection state of this + entry."; + reference + "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) + Section 7.3.2"; + + } + } // list neighbor + } // container ipv6 + } +} // module ietf-ip diff --git a/l3/api/src/main/yang/nd-proxy.yang b/l3/api/src/main/yang/nd-proxy.yang deleted file mode 100644 index 11a6ad2b8..000000000 --- a/l3/api/src/main/yang/nd-proxy.yang +++ /dev/null @@ -1,45 +0,0 @@ -module nd-proxy { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:vpp:nd:proxy"; - prefix "nd-proxy"; - revision "2017-03-15" { - description "Initial revision of neighbour discovery proxy model for VPP"; - } - - import ietf-inet-types { - prefix "inet"; - } - import ietf-interfaces { - prefix "if"; - } - import ietf-ip { - prefix "ip"; - } - import yang-ext { - prefix "ext"; - } - - augment /if:interfaces/if:interface/ip:ipv6 { - ext:augment-identifier "nd-proxy-ip6-augmentation"; - container nd-proxies { - list nd-proxy { - key "address"; - leaf address { - type inet:ipv6-address-no-zone; - } - } - } - } - - augment /if:interfaces-state/if:interface/ip:ipv6 { - ext:augment-identifier "nd-proxy-ip6-state-augmentation"; - container nd-proxies { - list nd-proxy { - key "address"; - leaf address { - type inet:ipv6-address-no-zone; - } - } - } - } -} \ No newline at end of file diff --git a/l3/api/src/main/yang/nd-proxy@2017-03-15.yang b/l3/api/src/main/yang/nd-proxy@2017-03-15.yang new file mode 100644 index 000000000..11a6ad2b8 --- /dev/null +++ b/l3/api/src/main/yang/nd-proxy@2017-03-15.yang @@ -0,0 +1,45 @@ +module nd-proxy { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:vpp:nd:proxy"; + prefix "nd-proxy"; + revision "2017-03-15" { + description "Initial revision of neighbour discovery proxy model for VPP"; + } + + import ietf-inet-types { + prefix "inet"; + } + import ietf-interfaces { + prefix "if"; + } + import ietf-ip { + prefix "ip"; + } + import yang-ext { + prefix "ext"; + } + + augment /if:interfaces/if:interface/ip:ipv6 { + ext:augment-identifier "nd-proxy-ip6-augmentation"; + container nd-proxies { + list nd-proxy { + key "address"; + leaf address { + type inet:ipv6-address-no-zone; + } + } + } + } + + augment /if:interfaces-state/if:interface/ip:ipv6 { + ext:augment-identifier "nd-proxy-ip6-state-augmentation"; + container nd-proxies { + list nd-proxy { + key "address"; + leaf address { + type inet:ipv6-address-no-zone; + } + } + } + } +} \ No newline at end of file diff --git a/l3/api/src/main/yang/proxy-arp.yang b/l3/api/src/main/yang/proxy-arp.yang deleted file mode 100644 index 3773e99cb..000000000 --- a/l3/api/src/main/yang/proxy-arp.yang +++ /dev/null @@ -1,46 +0,0 @@ -module proxy-arp { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:vpp:proxy:arp"; - prefix "proxy-arp"; - - revision "2017-03-15" { - description "Initial revision of proxy ARP model for VPP"; - } - - import ietf-inet-types { - prefix "inet"; - } - import ietf-interfaces { - prefix "if"; - } - import yang-ext { - prefix "ext"; - } - - container proxy-ranges { - list proxy-range { - key "vrf-id low-addr high-addr"; - leaf vrf-id { - type uint32; - } - leaf low-addr { - type inet:ipv4-address; - } - leaf high-addr { - type inet:ipv4-address; - } - description - "Parameters for configuring Proxy ARP on interfaces."; - } - } - - augment /if:interfaces/if:interface { - ext:augment-identifier "proxy-arp-interface-augmentation"; - - container proxy-arp { - presence "Enables proxy ARP on given interface"; - } - } - - // TODO(HC2VPP-86): add interfaces-state augmentation once VPP supports ARP proxy read (VPP-225) -} \ No newline at end of file diff --git a/l3/api/src/main/yang/proxy-arp@2017-03-15.yang b/l3/api/src/main/yang/proxy-arp@2017-03-15.yang new file mode 100644 index 000000000..3773e99cb --- /dev/null +++ b/l3/api/src/main/yang/proxy-arp@2017-03-15.yang @@ -0,0 +1,46 @@ +module proxy-arp { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:vpp:proxy:arp"; + prefix "proxy-arp"; + + revision "2017-03-15" { + description "Initial revision of proxy ARP model for VPP"; + } + + import ietf-inet-types { + prefix "inet"; + } + import ietf-interfaces { + prefix "if"; + } + import yang-ext { + prefix "ext"; + } + + container proxy-ranges { + list proxy-range { + key "vrf-id low-addr high-addr"; + leaf vrf-id { + type uint32; + } + leaf low-addr { + type inet:ipv4-address; + } + leaf high-addr { + type inet:ipv4-address; + } + description + "Parameters for configuring Proxy ARP on interfaces."; + } + } + + augment /if:interfaces/if:interface { + ext:augment-identifier "proxy-arp-interface-augmentation"; + + container proxy-arp { + presence "Enables proxy ARP on given interface"; + } + } + + // TODO(HC2VPP-86): add interfaces-state augmentation once VPP supports ARP proxy read (VPP-225) +} \ No newline at end of file diff --git a/lisp/api/src/main/yang/adjacencies-identification-context.yang b/lisp/api/src/main/yang/adjacencies-identification-context.yang deleted file mode 100644 index ae05f83f5..000000000 --- a/lisp/api/src/main/yang/adjacencies-identification-context.yang +++ /dev/null @@ -1,65 +0,0 @@ -module adjacencies-identification-context { - yang-version 1; - namespace "urn:honeycomb:params:xml:ns:yang:adjacencies:identification:context"; - prefix "adjacencies-identification-context"; - - description - "This module contains mappings between adjacency identificator and actual unique combination of - remote and local eid in vpp"; - - revision "2016-08-01" { - description - "Initial revision."; - } - - import lisp {prefix "lisp";} - import ietf-lisp-address-types {prefix "lisp-types";} - import yang-ext {prefix "ext";} - import naming-context { prefix "nc";} - - grouping adjacencies-identification-context-attributes{ - - container adjacencies-identification-contexts { - - list adjacencies-identification { - - key "name"; - - leaf name { - type string; - } - - container mappings{ - list mapping { - - key "id"; - - leaf id { - type string; - description "Id that uniquely identifies adjacency"; - } - - container eid-identificator-pair{ - leaf local-eid-id { - type lisp:mapping-id; - description "Local EID identifier"; - mandatory true; - } - - leaf remote-eid-id { - type lisp:mapping-id; - description "Remote EID identifier"; - mandatory true; - } - } - } - } - } - } - } - - augment /nc:contexts { - ext:augment-identifier "adjacencies-identification-ctx-augmentation"; - uses adjacencies-identification-context-attributes; - } -} \ No newline at end of file diff --git a/lisp/api/src/main/yang/adjacencies-identification-context@2016-08-01.yang b/lisp/api/src/main/yang/adjacencies-identification-context@2016-08-01.yang new file mode 100644 index 000000000..ae05f83f5 --- /dev/null +++ b/lisp/api/src/main/yang/adjacencies-identification-context@2016-08-01.yang @@ -0,0 +1,65 @@ +module adjacencies-identification-context { + yang-version 1; + namespace "urn:honeycomb:params:xml:ns:yang:adjacencies:identification:context"; + prefix "adjacencies-identification-context"; + + description + "This module contains mappings between adjacency identificator and actual unique combination of + remote and local eid in vpp"; + + revision "2016-08-01" { + description + "Initial revision."; + } + + import lisp {prefix "lisp";} + import ietf-lisp-address-types {prefix "lisp-types";} + import yang-ext {prefix "ext";} + import naming-context { prefix "nc";} + + grouping adjacencies-identification-context-attributes{ + + container adjacencies-identification-contexts { + + list adjacencies-identification { + + key "name"; + + leaf name { + type string; + } + + container mappings{ + list mapping { + + key "id"; + + leaf id { + type string; + description "Id that uniquely identifies adjacency"; + } + + container eid-identificator-pair{ + leaf local-eid-id { + type lisp:mapping-id; + description "Local EID identifier"; + mandatory true; + } + + leaf remote-eid-id { + type lisp:mapping-id; + description "Remote EID identifier"; + mandatory true; + } + } + } + } + } + } + } + + augment /nc:contexts { + ext:augment-identifier "adjacencies-identification-ctx-augmentation"; + uses adjacencies-identification-context-attributes; + } +} \ No newline at end of file diff --git a/lisp/api/src/main/yang/eid-mapping-context.yang b/lisp/api/src/main/yang/eid-mapping-context.yang deleted file mode 100644 index 3fb6d893a..000000000 --- a/lisp/api/src/main/yang/eid-mapping-context.yang +++ /dev/null @@ -1,44 +0,0 @@ -module eid-mapping-context { - yang-version 1; - namespace "urn:honeycomb:params:xml:ns:yang:eid:mapping:context"; - prefix "eid-mapping-context"; - - description - "This module contains mappings stored for local-mappings id to actual eid"; - - revision "2016-08-01" { - description - "Initial revision."; - } - - import lisp {prefix "lisp";} - import ietf-lisp-address-types {prefix "lisp-types";} - - container contexts { - list eid-mapping-context { - - key "name"; - - leaf name { - type string; - } - - container mappings{ - list mapping { - - key "id"; - - leaf id { - type lisp:mapping-id; - description "Id that uniquely identifies a mapping"; - } - - container eid { - uses lisp-types:lisp-address; - description "EID address"; - } - } - } - } - } -} \ No newline at end of file diff --git a/lisp/api/src/main/yang/eid-mapping-context@2016-08-01.yang b/lisp/api/src/main/yang/eid-mapping-context@2016-08-01.yang new file mode 100644 index 000000000..3fb6d893a --- /dev/null +++ b/lisp/api/src/main/yang/eid-mapping-context@2016-08-01.yang @@ -0,0 +1,44 @@ +module eid-mapping-context { + yang-version 1; + namespace "urn:honeycomb:params:xml:ns:yang:eid:mapping:context"; + prefix "eid-mapping-context"; + + description + "This module contains mappings stored for local-mappings id to actual eid"; + + revision "2016-08-01" { + description + "Initial revision."; + } + + import lisp {prefix "lisp";} + import ietf-lisp-address-types {prefix "lisp-types";} + + container contexts { + list eid-mapping-context { + + key "name"; + + leaf name { + type string; + } + + container mappings{ + list mapping { + + key "id"; + + leaf id { + type lisp:mapping-id; + description "Id that uniquely identifies a mapping"; + } + + container eid { + uses lisp-types:lisp-address; + description "EID address"; + } + } + } + } + } +} \ No newline at end of file diff --git a/lisp/api/src/main/yang/gpe-entry-identification-context.yang b/lisp/api/src/main/yang/gpe-entry-identification-context.yang deleted file mode 100644 index 8f4d8aceb..000000000 --- a/lisp/api/src/main/yang/gpe-entry-identification-context.yang +++ /dev/null @@ -1,70 +0,0 @@ -module gpe-entry-identification-context { - yang-version 1; - namespace "urn:honeycomb:params:xml:ns:yang:gpe:entry:identification:context"; - prefix "gpe-entry-identification-context"; - - description - "This module contains mappings between gpe entry identificator and actual unique combination of - remote/local eid and vni in vpp"; - - revision "2017-05-17" { - description - "Initial revision."; - } - - import lisp {prefix "lisp";} - import ietf-lisp-address-types {prefix "lisp-types";} - import yang-ext {prefix "ext";} - import naming-context { prefix "nc";} - - grouping gpe-entry-identification-context-attributes{ - - container gpe-entry-identification-contexts { - - list gpe-entry-identification { - - key "name"; - - leaf name { - type string; - } - - container mappings{ - list mapping { - - key "id"; - - leaf id { - type string; - description "Id that uniquely identifies gpe entry"; - } - - container gpe-entry-identificator{ - // these three attributes allow to identificated gpe entry - container local-eid { - uses lisp-types:lisp-address; - description "Local EID that must be a local address"; - } - - container remote-eid { - uses lisp-types:lisp-address; - description "Remote EID"; - } - - leaf vni { - type uint32; - mandatory true; - description "Virtual Network Identifier"; - } - } - } - } - } - } - } - - augment /nc:contexts { - ext:augment-identifier "gpe-entry-identification-ctx-augmentation"; - uses gpe-entry-identification-context-attributes; - } -} \ No newline at end of file diff --git a/lisp/api/src/main/yang/gpe-entry-identification-context@2017-05-17.yang b/lisp/api/src/main/yang/gpe-entry-identification-context@2017-05-17.yang new file mode 100644 index 000000000..8f4d8aceb --- /dev/null +++ b/lisp/api/src/main/yang/gpe-entry-identification-context@2017-05-17.yang @@ -0,0 +1,70 @@ +module gpe-entry-identification-context { + yang-version 1; + namespace "urn:honeycomb:params:xml:ns:yang:gpe:entry:identification:context"; + prefix "gpe-entry-identification-context"; + + description + "This module contains mappings between gpe entry identificator and actual unique combination of + remote/local eid and vni in vpp"; + + revision "2017-05-17" { + description + "Initial revision."; + } + + import lisp {prefix "lisp";} + import ietf-lisp-address-types {prefix "lisp-types";} + import yang-ext {prefix "ext";} + import naming-context { prefix "nc";} + + grouping gpe-entry-identification-context-attributes{ + + container gpe-entry-identification-contexts { + + list gpe-entry-identification { + + key "name"; + + leaf name { + type string; + } + + container mappings{ + list mapping { + + key "id"; + + leaf id { + type string; + description "Id that uniquely identifies gpe entry"; + } + + container gpe-entry-identificator{ + // these three attributes allow to identificated gpe entry + container local-eid { + uses lisp-types:lisp-address; + description "Local EID that must be a local address"; + } + + container remote-eid { + uses lisp-types:lisp-address; + description "Remote EID"; + } + + leaf vni { + type uint32; + mandatory true; + description "Virtual Network Identifier"; + } + } + } + } + } + } + } + + augment /nc:contexts { + ext:augment-identifier "gpe-entry-identification-ctx-augmentation"; + uses gpe-entry-identification-context-attributes; + } +} \ No newline at end of file diff --git a/lisp/api/src/main/yang/gpe-locator-pair-identification-context.yang b/lisp/api/src/main/yang/gpe-locator-pair-identification-context.yang deleted file mode 100644 index 776dbc927..000000000 --- a/lisp/api/src/main/yang/gpe-locator-pair-identification-context.yang +++ /dev/null @@ -1,70 +0,0 @@ -module gpe-locator-pair-identification-context { - yang-version 1; - namespace "urn:honeycomb:params:xml:ns:yang:gpe:locator:pair:identification:context"; - prefix "gpe-locator-pair-identification-context"; - - description - "This module contains mappings between gpe entry identificator and locator pair in vpp"; - - revision "2017-05-17" { - description - "Initial revision."; - } - - import lisp {prefix "lisp";} - import ietf-inet-types {prefix "inet";} - import yang-ext {prefix "ext";} - import naming-context { prefix "nc";} - - grouping gpe-locator-pair-identification-context-attributes{ - - container gpe-locator-pair-identification-contexts { - - list gpe-locator-pair-identification { - - key "name"; - - leaf name { - type string; - } - - container mappings{ - list mapping { - - key "id"; - - leaf id { - type string; - description "Id that uniquely identifies gpe entry"; - } - - list locator-pair-mapping { - key "id"; - - leaf id { - type string; - description "Id that uniquely identifies locator pair"; - } - - container pair { - leaf local-address{ - type inet:ip-address; - description "Local locator address"; - } - leaf remote-address { - type inet:ip-address; - description "Remote locator address"; - } - } - } - } - } - } - } - } - - augment /nc:contexts { - ext:augment-identifier "gpe-locator-pair-identification-ctx-augmentation"; - uses gpe-locator-pair-identification-context-attributes; - } -} \ No newline at end of file diff --git a/lisp/api/src/main/yang/gpe-locator-pair-identification-context@2017-05-17.yang b/lisp/api/src/main/yang/gpe-locator-pair-identification-context@2017-05-17.yang new file mode 100644 index 000000000..776dbc927 --- /dev/null +++ b/lisp/api/src/main/yang/gpe-locator-pair-identification-context@2017-05-17.yang @@ -0,0 +1,70 @@ +module gpe-locator-pair-identification-context { + yang-version 1; + namespace "urn:honeycomb:params:xml:ns:yang:gpe:locator:pair:identification:context"; + prefix "gpe-locator-pair-identification-context"; + + description + "This module contains mappings between gpe entry identificator and locator pair in vpp"; + + revision "2017-05-17" { + description + "Initial revision."; + } + + import lisp {prefix "lisp";} + import ietf-inet-types {prefix "inet";} + import yang-ext {prefix "ext";} + import naming-context { prefix "nc";} + + grouping gpe-locator-pair-identification-context-attributes{ + + container gpe-locator-pair-identification-contexts { + + list gpe-locator-pair-identification { + + key "name"; + + leaf name { + type string; + } + + container mappings{ + list mapping { + + key "id"; + + leaf id { + type string; + description "Id that uniquely identifies gpe entry"; + } + + list locator-pair-mapping { + key "id"; + + leaf id { + type string; + description "Id that uniquely identifies locator pair"; + } + + container pair { + leaf local-address{ + type inet:ip-address; + description "Local locator address"; + } + leaf remote-address { + type inet:ip-address; + description "Remote locator address"; + } + } + } + } + } + } + } + } + + augment /nc:contexts { + ext:augment-identifier "gpe-locator-pair-identification-ctx-augmentation"; + uses gpe-locator-pair-identification-context-attributes; + } +} \ No newline at end of file diff --git a/lisp/api/src/main/yang/gpe.yang b/lisp/api/src/main/yang/gpe.yang deleted file mode 100644 index c99d5f26a..000000000 --- a/lisp/api/src/main/yang/gpe.yang +++ /dev/null @@ -1,162 +0,0 @@ -module gpe { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:gpe"; - prefix "gpe"; - - import lisp { - prefix "lisp"; - } - - import ietf-interfaces { - prefix "if"; - } - - import ietf-inet-types { - prefix "inet"; - } - - import ietf-lisp-address-types { - prefix "lisp-types"; - } - - revision 2017-05-18 { - description - "Add support for defining lisp gpe forward entries"; - } - - grouping locator-pair { - container locator-pair { - leaf local-locator { - type inet:ip-address; - description "Local locator address"; - } - leaf remote-locator { - type inet:ip-address; - description "Remote locator address"; - } - leaf weight { - type uint8; - description "Weight"; - } - } - } - grouping gpe-entry-table-grouping { - container gpe-entry-table { - when "../enable = 'true'"; - - list gpe-entry { - key id; - leaf id { - type string; - description "GPE entry ID"; - } - leaf dp-table { - type uint32; - mandatory true; - description "VRF/BD index"; - } - leaf vni { - type uint32; - mandatory true; - description "Virtual Network Identifier"; - } - container local-eid { - presence "Enforce mandatory only if present"; - uses lisp-types:lisp-address; - description "Local EID that must be a local address"; - } - container remote-eid { - presence "Enforce mandatory only if present"; - uses lisp-types:lisp-address; - description "Remote EID"; - } - list locator-pairs { - key id; - leaf id { - type string; - description "Locator Pair ID"; - } - uses locator-pair; - } - leaf action { - type lisp:map-reply-action; - description "Forwarding action for negative entries"; - } - } - } - } - - grouping gpe-feature-data-grouping { - //aggregation of all gpe data, restricted by GPE being enabled - container gpe-feature-data { - leaf enable { - type boolean; - description "Enable/disable GPE feature"; - } - - uses gpe-entry-table-grouping; - } - } - - container gpe { - // gpe_enable_disable - - uses gpe-feature-data-grouping; - description "GPE configuration"; - } - - container gpe-state { - //gpe_enable_disable_status_dump - config false; - - uses gpe-feature-data-grouping; - description "GPE state"; - } - - container native-forward-paths-tables { - // gpe_add_del_native_fwd_rpath - list native-forward-paths-table{ - key table-id; - - leaf table-id { - type uint32; - } - - list native-forward-path { - key next-hop-address; - - leaf next-hop-address { - type inet:ip-address; - } - - leaf next-hop-interface { - type if:interface-ref; - } - } - } - } - - container native-forward-paths-tables-state { - // gpe_native_fwd_rpaths_get - config false; - list native-forward-paths-table{ - key table-id; - - leaf table-id { - type uint32; - } - - list native-forward-path { - key next-hop-address; - - leaf next-hop-address { - type inet:ip-address; - } - - leaf next-hop-interface { - type if:interface-state-ref; - } - } - } - } -} \ No newline at end of file diff --git a/lisp/api/src/main/yang/gpe@2017-05-18.yang b/lisp/api/src/main/yang/gpe@2017-05-18.yang new file mode 100644 index 000000000..c99d5f26a --- /dev/null +++ b/lisp/api/src/main/yang/gpe@2017-05-18.yang @@ -0,0 +1,162 @@ +module gpe { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:gpe"; + prefix "gpe"; + + import lisp { + prefix "lisp"; + } + + import ietf-interfaces { + prefix "if"; + } + + import ietf-inet-types { + prefix "inet"; + } + + import ietf-lisp-address-types { + prefix "lisp-types"; + } + + revision 2017-05-18 { + description + "Add support for defining lisp gpe forward entries"; + } + + grouping locator-pair { + container locator-pair { + leaf local-locator { + type inet:ip-address; + description "Local locator address"; + } + leaf remote-locator { + type inet:ip-address; + description "Remote locator address"; + } + leaf weight { + type uint8; + description "Weight"; + } + } + } + grouping gpe-entry-table-grouping { + container gpe-entry-table { + when "../enable = 'true'"; + + list gpe-entry { + key id; + leaf id { + type string; + description "GPE entry ID"; + } + leaf dp-table { + type uint32; + mandatory true; + description "VRF/BD index"; + } + leaf vni { + type uint32; + mandatory true; + description "Virtual Network Identifier"; + } + container local-eid { + presence "Enforce mandatory only if present"; + uses lisp-types:lisp-address; + description "Local EID that must be a local address"; + } + container remote-eid { + presence "Enforce mandatory only if present"; + uses lisp-types:lisp-address; + description "Remote EID"; + } + list locator-pairs { + key id; + leaf id { + type string; + description "Locator Pair ID"; + } + uses locator-pair; + } + leaf action { + type lisp:map-reply-action; + description "Forwarding action for negative entries"; + } + } + } + } + + grouping gpe-feature-data-grouping { + //aggregation of all gpe data, restricted by GPE being enabled + container gpe-feature-data { + leaf enable { + type boolean; + description "Enable/disable GPE feature"; + } + + uses gpe-entry-table-grouping; + } + } + + container gpe { + // gpe_enable_disable + + uses gpe-feature-data-grouping; + description "GPE configuration"; + } + + container gpe-state { + //gpe_enable_disable_status_dump + config false; + + uses gpe-feature-data-grouping; + description "GPE state"; + } + + container native-forward-paths-tables { + // gpe_add_del_native_fwd_rpath + list native-forward-paths-table{ + key table-id; + + leaf table-id { + type uint32; + } + + list native-forward-path { + key next-hop-address; + + leaf next-hop-address { + type inet:ip-address; + } + + leaf next-hop-interface { + type if:interface-ref; + } + } + } + } + + container native-forward-paths-tables-state { + // gpe_native_fwd_rpaths_get + config false; + list native-forward-paths-table{ + key table-id; + + leaf table-id { + type uint32; + } + + list native-forward-path { + key next-hop-address; + + leaf next-hop-address { + type inet:ip-address; + } + + leaf next-hop-interface { + type if:interface-state-ref; + } + } + } + } +} \ No newline at end of file diff --git a/lisp/api/src/main/yang/ietf-lisp-address-types.yang b/lisp/api/src/main/yang/ietf-lisp-address-types.yang deleted file mode 100755 index 2a3a1d31d..000000000 --- a/lisp/api/src/main/yang/ietf-lisp-address-types.yang +++ /dev/null @@ -1,677 +0,0 @@ -module ietf-lisp-address-types { - namespace "urn:ietf:params:xml:ns:yang:ietf-lisp-address-types"; - prefix laddr; - import ietf-inet-types { - prefix inet; - revision-date 2013-07-15; - } - import ietf-yang-types { - prefix yang; - revision-date 2013-07-15; - } - organization - "IETF LISP (Locator/ID Separation Protocol) Working Group"; - contact - "lisp@ietf.org"; - description - "This YANG module defines the LISP Canonical Address Formats - (LCAF) for LISP. The module can be extended by vendors to - define vendor-specific parameters. - - Copyright (c) 2014 IETF Trust and the persons identified as - authors of the code. All rights reserved. - - Redistribution and use in source and binary forms, with or - without modification, is permitted pursuant to, and subject - to the license terms contained in, the Simplified BSD License - set forth in Section 4.c of the IETF Trust's Legal Provisions - Relating to IETF Documents - (http://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 6338; see - the RFC itself for full legal notices. - - "; - revision 2015-11-05 { - description - "Initial revision."; - reference - "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10"; - } - identity lisp-address-family { - description - "Base identity from which identities describing LISP address - families are derived."; - } - identity no-address-afi { - base lisp-address-family; - description - "IANA Reserved."; - } - identity ipv4-afi { - base lisp-address-family; - description - "IANA IPv4 address family."; - } - identity ipv4-prefix-afi { - base lisp-address-family; - description - "IANA IPv4 address family prefix."; - } - identity ipv6-afi { - base lisp-address-family; - description - "IANA IPv6 address family."; - } - identity ipv6-prefix-afi { - base lisp-address-family; - description - "IANA IPv6 address family prefix."; - } - identity mac-afi { - base lisp-address-family; - description - "IANA MAC address family."; - } - identity distinguished-name-afi { - base lisp-address-family; - description - "IANA Distinguished Name address family."; - } - identity as-number-afi { - base lisp-address-family; - description - "IANA AS Number address family."; - } - identity lcaf { - base lisp-address-family; - description - "IANA LISP Canonical Address Format address family."; - } - identity null-address-lcaf { - base lcaf; - description - "Null body LCAF type."; - } - identity afi-list-lcaf { - base lcaf; - description - "AFI-List LCAF type."; - } - identity instance-id-lcaf { - base lcaf; - description - "Instance-ID LCAF type."; - } - identity as-number-lcaf { - base lcaf; - description - "AS Number LCAF type."; - } - identity application-data-lcaf { - base lcaf; - description - "Application Data LCAF type."; - } - identity geo-coordinates-lcaf { - base lcaf; - description - "Geo-coordinates LCAF type."; - } - identity opaque-key-lcaf { - base lcaf; - description - "Opaque Key LCAF type."; - } - identity nat-traversal-lcaf { - base lcaf; - description - "NAT-Traversal LCAF type."; - } - identity nonce-locator-lcaf { - base lcaf; - description - "Nonce-Locator LCAF type."; - } - identity multicast-info-lcaf { - base lcaf; - description - "Multicast Info LCAF type."; - } - identity explicit-locator-path-lcaf { - base lcaf; - description - "Explicit Locator Path LCAF type."; - } - identity security-key-lcaf { - base lcaf; - description - "Security Key LCAF type."; - } - identity source-dest-key-lcaf { - base lcaf; - description - "Source/Dest LCAF type."; - } - identity replication-list-lcaf { - base lcaf; - description - "Replication-List LCAF type."; - } - identity json-data-model-lcaf { - base lcaf; - description - "JSON Data Model LCAF type."; - } - identity key-value-address-lcaf { - base lcaf; - description - "Key/Value Address LCAF type."; - } - identity encapsulation-format-lcaf { - base lcaf; - description - "Encapsulation Format LCAF type."; - } - identity service-path-lcaf { - base lcaf; - description - "Service Path LCAF type."; - } - typedef instance-id-type { - type uint32 { - range "0..16777215"; - } - description - "Defines the range of values for an Instance ID."; - } - typedef service-path-id-type { - type uint32 { - range "0..16777215"; - } - description - "Defines the range of values for a Service Path ID."; - } - typedef distinguished-name-type { - type string; - description - "Distinguished Name address."; - reference - "http://www.iana.org/assignments/address-family-numbers/ - address-family-numbers.xhtml"; - } - typedef simple-address { - type union { - type inet:ip-address; - type inet:ip-prefix; - type yang:mac-address; - type distinguished-name-type; - type inet:as-number; - } - description - "Union of address types that can be part of LCAFs."; - } - - typedef lisp-address-family-ref { - type identityref { - base lisp-address-family; - } - description - "LISP address family reference."; - } - typedef lcaf-ref { - type identityref { - base lcaf; - } - description - "LCAF types reference."; - } - - grouping lisp-address { - description - "Generic LISP address."; - leaf address-type { - type lisp-address-family-ref; - mandatory true; - description - "Type of the LISP address."; - } - leaf virtual-network-id { - type instance-id-type; - description - "Virtual Network Identifier (instance-id) of the address."; - } - choice address { - description - "Various LISP address types, including IP, MAC, and LCAF."; - - leaf no-address { - when "../address-type = 'laddr:no-addr-afi'" { - description - "When AFI is 0."; - } - type empty; - description - "No address."; - } - leaf ipv4 { - when "../address-type = 'laddr:ipv4-afi'" { - description - "When AFI is IPv4."; - } - type inet:ipv4-address; - description - "IPv4 address."; - } - leaf ipv4-prefix { - when "../address-type = 'laddr:ipv4-prefix-afi'" { - description - "When AFI is IPv4."; - } - type inet:ipv4-prefix; - description - "IPv4 prefix."; - } - leaf ipv6 { - when "../address-type = 'laddr:ipv6-afi'" { - description - "When AFI is IPv6."; - } - type inet:ipv6-address; - description - "IPv6 address."; - } - leaf ipv6-prefix { - when "../address-type = 'laddr:ipv6-prefix-afi'" { - description - "When AFI is IPv6."; - } - type inet:ipv6-prefix; - description - "IPv6 address."; - } - leaf mac { - when "../address-type = 'laddr:mac-afi'" { - description - "When AFI is MAC."; - } - type yang:mac-address; - description - "MAC address."; - } - leaf distinguished-name { - when "../address-type = 'laddr:distinguished-name-afi'" { - description - "When AFI is distinguished-name."; - } - type distinguished-name-type; - description - "Distinguished Name address."; - } - leaf as-number { - when "../address-type = 'laddr:as-number-afi'" { - description - "When AFI is as-number."; - } - type inet:as-number; - description - "AS Number."; - } - container null-address { - when "../address-type = 'laddr:null-address-lcaf'" { - description - "When LCAF type is null."; - } - description - "Null body LCAF type"; - leaf address { - type empty; - description - "AFI address."; - } - } - container afi-list { - when "../address-type = 'laddr:afi-list-lcaf'" { - description - "When LCAF type is AFI-List."; - } - description - "AFI-List LCAF type."; - reference - "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 - #section-4.16.1"; - leaf-list address-list { - type simple-address; - description - "List of AFI addresses."; - } - } - container instance-id { - when "../address-type = 'laddr:instance-id-lcaf'" { - description - "When LCAF type is Instance-ID"; - } - description - "Instance ID LCAF type."; - reference - "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 - #section-4.2"; - leaf iid { - type instance-id-type; - description - "Instance ID value."; - } - leaf mask-length { - type uint8; - description - "Mask length."; - } - leaf address { - type simple-address; - description - "AFI address."; - } - } - container as-number-lcaf { - when "../address-type = 'laddr:as-number-lcaf'" { - description - "When LCAF type is AS-Number."; - } - description - "AS Number LCAF type."; - reference - "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 - #section-4.3"; - leaf as { - type inet:as-number; - description - "AS number."; - } - leaf address { - type simple-address; - description - "AFI address."; - } - } - container application-data { - when "../address-type = 'laddr:application-data-lcaf'" { - description - "When LCAF type is Application Data."; - } - description - "Application Data LCAF type."; - reference - "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 - #section-4.4"; - leaf address { - type simple-address; - description - "AFI address."; - } - leaf protocol { - type uint8; - description - "Protocol number."; - } - leaf ip-tos { - type int32; - description - "Type of service field."; - } - leaf local-port-low { - type inet:port-number; - description - "Low end of local port range."; - } - leaf local-port-high { - type inet:port-number; - description - "High end of local port range."; - } - leaf remote-port-low { - type inet:port-number; - description - "Low end of remote port range."; - } - leaf remote-port-high { - type inet:port-number; - description - "High end of remote port range."; - } - } - container geo-coordinates { - when "../address-type = 'laddr:geo-coordinates-lcaf'" { - description - "When LCAF type is Geo-coordinates."; - } - description - "Geo-coordinates LCAF type."; - reference - "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 - #section-4.5"; - leaf latitude { - type bits { - bit N { - description - "Latitude bit."; - } - } - description - "Bit that selects between North and South latitude."; - } - leaf latitude-degrees { - type uint8 { - range "0 .. 90"; - } - description - "Degrees of latitude."; - } - leaf latitude-minutes { - type uint8 { - range "0..59"; - } - description - "Minutes of latitude."; - } - leaf latitude-seconds { - type uint8 { - range "0..59"; - } - description - "Seconds of latitude."; - } - leaf longitude { - type bits { - bit E { - description - "Longitude bit."; - } - } - description - "Bit that selects between East and West longitude."; - } - leaf longitude-degrees { - type uint16 { - range "0 .. 180"; - } - description - "Degrees of longitude."; - } - leaf longitude-minutes { - type uint8 { - range "0..59"; - } - description - "Minutes of longitude."; - } - leaf longitude-seconds { - type uint8 { - range "0..59"; - } - description - "Seconds of longitude."; - } - leaf altitude { - type int32; - description - "Height relative to sea level in meters."; - } - leaf address { - type simple-address; - description - "AFI address."; - } - } - container nat-traversal { - when "../address-type = 'laddr:nat-traversal-lcaf'" { - description - "When LCAF type is NAT-Traversal."; - } - description - "NAT-Traversal LCAF type."; - reference - "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 - #section-4.6"; - leaf ms-udp-port { - type uint16; - description - "Map-Server UDP port (set to 4342)."; - } - leaf etr-udp-port { - type uint16; - description - "ETR UDP port."; - } - leaf global-etr-rloc { - type simple-address; - description - "Global ETR RLOC address."; - } - leaf ms-rloc { - type simple-address; - description - "Map-Server RLOC address."; - } - leaf private-etr-rloc { - type simple-address; - description - "Private ETR RLOC address."; - } - leaf-list rtr-rlocs { - type simple-address; - description - "List of RTR RLOC addresses."; - } - } - container explicit-locator-path { - when "../address-type = 'laddr:explicit-locator-path-lcaf'" { - description - "When LCAF type type is Explicit Locator Path."; - } - description - "Explicit Locator Path LCAF type."; - reference - "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 - #section-4.9"; - list hop { - key "hop-id"; - ordered-by user; - description - "List of locator hops forming the explicit path."; - leaf hop-id { - type string { - length "1..64"; - } - description - "Unique identifier for the hop."; - } - leaf address { - type simple-address; - description - "AFI address."; - } - leaf lrs-bits { - type bits{ - bit lookup { - description - "Lookup bit."; - } - bit rloc-probe { - description - "RLOC-probe bit."; - } - bit strict { - description - "Strict bit."; - } - } - description - "Flag bits per hop."; - } - } - } - container source-dest-key { - when "../address-type = 'laddr:source-dest-key-lcaf'" { - description - "When LCAF type type is Source/Dest."; - } - description - "Source/Dest LCAF type."; - reference - "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 - #section-4.11"; - leaf source { - type simple-address; - description - "Source address."; - } - leaf dest { - type simple-address; - description - "Destination address."; - } - } - container key-value-address { - when "../address-type = 'laddr:key-value-address-lcaf'" { - description - "When LCAF type type is Key/Value Address."; - } - description - "Key/Value Address LCAF type."; - reference - "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 - #section-4.11"; - leaf key { - type simple-address; - description - "Address as Key."; - } - leaf value { - type simple-address; - description - "Address as Value."; - } - } - container service-path { - when "../address-type = 'laddr:service-path-lcaf'" { - description - "When LCAF type service path identifier."; - } - description - "Service Path LCAF type."; - reference - "http://tools.ietf.org/html/draft-ermagan-lisp-nsh-00"; - leaf service-path-id { - type service-path-id-type; - description - "Service path identifier for the path for NSH header"; - } - leaf service-index { - type uint8; - description - "Service path index for NSH header"; - } - } - } - } -} diff --git a/lisp/api/src/main/yang/ietf-lisp-address-types@2015-11-05.yang b/lisp/api/src/main/yang/ietf-lisp-address-types@2015-11-05.yang new file mode 100755 index 000000000..2a3a1d31d --- /dev/null +++ b/lisp/api/src/main/yang/ietf-lisp-address-types@2015-11-05.yang @@ -0,0 +1,677 @@ +module ietf-lisp-address-types { + namespace "urn:ietf:params:xml:ns:yang:ietf-lisp-address-types"; + prefix laddr; + import ietf-inet-types { + prefix inet; + revision-date 2013-07-15; + } + import ietf-yang-types { + prefix yang; + revision-date 2013-07-15; + } + organization + "IETF LISP (Locator/ID Separation Protocol) Working Group"; + contact + "lisp@ietf.org"; + description + "This YANG module defines the LISP Canonical Address Formats + (LCAF) for LISP. The module can be extended by vendors to + define vendor-specific parameters. + + Copyright (c) 2014 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 6338; see + the RFC itself for full legal notices. + + "; + revision 2015-11-05 { + description + "Initial revision."; + reference + "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10"; + } + identity lisp-address-family { + description + "Base identity from which identities describing LISP address + families are derived."; + } + identity no-address-afi { + base lisp-address-family; + description + "IANA Reserved."; + } + identity ipv4-afi { + base lisp-address-family; + description + "IANA IPv4 address family."; + } + identity ipv4-prefix-afi { + base lisp-address-family; + description + "IANA IPv4 address family prefix."; + } + identity ipv6-afi { + base lisp-address-family; + description + "IANA IPv6 address family."; + } + identity ipv6-prefix-afi { + base lisp-address-family; + description + "IANA IPv6 address family prefix."; + } + identity mac-afi { + base lisp-address-family; + description + "IANA MAC address family."; + } + identity distinguished-name-afi { + base lisp-address-family; + description + "IANA Distinguished Name address family."; + } + identity as-number-afi { + base lisp-address-family; + description + "IANA AS Number address family."; + } + identity lcaf { + base lisp-address-family; + description + "IANA LISP Canonical Address Format address family."; + } + identity null-address-lcaf { + base lcaf; + description + "Null body LCAF type."; + } + identity afi-list-lcaf { + base lcaf; + description + "AFI-List LCAF type."; + } + identity instance-id-lcaf { + base lcaf; + description + "Instance-ID LCAF type."; + } + identity as-number-lcaf { + base lcaf; + description + "AS Number LCAF type."; + } + identity application-data-lcaf { + base lcaf; + description + "Application Data LCAF type."; + } + identity geo-coordinates-lcaf { + base lcaf; + description + "Geo-coordinates LCAF type."; + } + identity opaque-key-lcaf { + base lcaf; + description + "Opaque Key LCAF type."; + } + identity nat-traversal-lcaf { + base lcaf; + description + "NAT-Traversal LCAF type."; + } + identity nonce-locator-lcaf { + base lcaf; + description + "Nonce-Locator LCAF type."; + } + identity multicast-info-lcaf { + base lcaf; + description + "Multicast Info LCAF type."; + } + identity explicit-locator-path-lcaf { + base lcaf; + description + "Explicit Locator Path LCAF type."; + } + identity security-key-lcaf { + base lcaf; + description + "Security Key LCAF type."; + } + identity source-dest-key-lcaf { + base lcaf; + description + "Source/Dest LCAF type."; + } + identity replication-list-lcaf { + base lcaf; + description + "Replication-List LCAF type."; + } + identity json-data-model-lcaf { + base lcaf; + description + "JSON Data Model LCAF type."; + } + identity key-value-address-lcaf { + base lcaf; + description + "Key/Value Address LCAF type."; + } + identity encapsulation-format-lcaf { + base lcaf; + description + "Encapsulation Format LCAF type."; + } + identity service-path-lcaf { + base lcaf; + description + "Service Path LCAF type."; + } + typedef instance-id-type { + type uint32 { + range "0..16777215"; + } + description + "Defines the range of values for an Instance ID."; + } + typedef service-path-id-type { + type uint32 { + range "0..16777215"; + } + description + "Defines the range of values for a Service Path ID."; + } + typedef distinguished-name-type { + type string; + description + "Distinguished Name address."; + reference + "http://www.iana.org/assignments/address-family-numbers/ + address-family-numbers.xhtml"; + } + typedef simple-address { + type union { + type inet:ip-address; + type inet:ip-prefix; + type yang:mac-address; + type distinguished-name-type; + type inet:as-number; + } + description + "Union of address types that can be part of LCAFs."; + } + + typedef lisp-address-family-ref { + type identityref { + base lisp-address-family; + } + description + "LISP address family reference."; + } + typedef lcaf-ref { + type identityref { + base lcaf; + } + description + "LCAF types reference."; + } + + grouping lisp-address { + description + "Generic LISP address."; + leaf address-type { + type lisp-address-family-ref; + mandatory true; + description + "Type of the LISP address."; + } + leaf virtual-network-id { + type instance-id-type; + description + "Virtual Network Identifier (instance-id) of the address."; + } + choice address { + description + "Various LISP address types, including IP, MAC, and LCAF."; + + leaf no-address { + when "../address-type = 'laddr:no-addr-afi'" { + description + "When AFI is 0."; + } + type empty; + description + "No address."; + } + leaf ipv4 { + when "../address-type = 'laddr:ipv4-afi'" { + description + "When AFI is IPv4."; + } + type inet:ipv4-address; + description + "IPv4 address."; + } + leaf ipv4-prefix { + when "../address-type = 'laddr:ipv4-prefix-afi'" { + description + "When AFI is IPv4."; + } + type inet:ipv4-prefix; + description + "IPv4 prefix."; + } + leaf ipv6 { + when "../address-type = 'laddr:ipv6-afi'" { + description + "When AFI is IPv6."; + } + type inet:ipv6-address; + description + "IPv6 address."; + } + leaf ipv6-prefix { + when "../address-type = 'laddr:ipv6-prefix-afi'" { + description + "When AFI is IPv6."; + } + type inet:ipv6-prefix; + description + "IPv6 address."; + } + leaf mac { + when "../address-type = 'laddr:mac-afi'" { + description + "When AFI is MAC."; + } + type yang:mac-address; + description + "MAC address."; + } + leaf distinguished-name { + when "../address-type = 'laddr:distinguished-name-afi'" { + description + "When AFI is distinguished-name."; + } + type distinguished-name-type; + description + "Distinguished Name address."; + } + leaf as-number { + when "../address-type = 'laddr:as-number-afi'" { + description + "When AFI is as-number."; + } + type inet:as-number; + description + "AS Number."; + } + container null-address { + when "../address-type = 'laddr:null-address-lcaf'" { + description + "When LCAF type is null."; + } + description + "Null body LCAF type"; + leaf address { + type empty; + description + "AFI address."; + } + } + container afi-list { + when "../address-type = 'laddr:afi-list-lcaf'" { + description + "When LCAF type is AFI-List."; + } + description + "AFI-List LCAF type."; + reference + "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 + #section-4.16.1"; + leaf-list address-list { + type simple-address; + description + "List of AFI addresses."; + } + } + container instance-id { + when "../address-type = 'laddr:instance-id-lcaf'" { + description + "When LCAF type is Instance-ID"; + } + description + "Instance ID LCAF type."; + reference + "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 + #section-4.2"; + leaf iid { + type instance-id-type; + description + "Instance ID value."; + } + leaf mask-length { + type uint8; + description + "Mask length."; + } + leaf address { + type simple-address; + description + "AFI address."; + } + } + container as-number-lcaf { + when "../address-type = 'laddr:as-number-lcaf'" { + description + "When LCAF type is AS-Number."; + } + description + "AS Number LCAF type."; + reference + "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 + #section-4.3"; + leaf as { + type inet:as-number; + description + "AS number."; + } + leaf address { + type simple-address; + description + "AFI address."; + } + } + container application-data { + when "../address-type = 'laddr:application-data-lcaf'" { + description + "When LCAF type is Application Data."; + } + description + "Application Data LCAF type."; + reference + "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 + #section-4.4"; + leaf address { + type simple-address; + description + "AFI address."; + } + leaf protocol { + type uint8; + description + "Protocol number."; + } + leaf ip-tos { + type int32; + description + "Type of service field."; + } + leaf local-port-low { + type inet:port-number; + description + "Low end of local port range."; + } + leaf local-port-high { + type inet:port-number; + description + "High end of local port range."; + } + leaf remote-port-low { + type inet:port-number; + description + "Low end of remote port range."; + } + leaf remote-port-high { + type inet:port-number; + description + "High end of remote port range."; + } + } + container geo-coordinates { + when "../address-type = 'laddr:geo-coordinates-lcaf'" { + description + "When LCAF type is Geo-coordinates."; + } + description + "Geo-coordinates LCAF type."; + reference + "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 + #section-4.5"; + leaf latitude { + type bits { + bit N { + description + "Latitude bit."; + } + } + description + "Bit that selects between North and South latitude."; + } + leaf latitude-degrees { + type uint8 { + range "0 .. 90"; + } + description + "Degrees of latitude."; + } + leaf latitude-minutes { + type uint8 { + range "0..59"; + } + description + "Minutes of latitude."; + } + leaf latitude-seconds { + type uint8 { + range "0..59"; + } + description + "Seconds of latitude."; + } + leaf longitude { + type bits { + bit E { + description + "Longitude bit."; + } + } + description + "Bit that selects between East and West longitude."; + } + leaf longitude-degrees { + type uint16 { + range "0 .. 180"; + } + description + "Degrees of longitude."; + } + leaf longitude-minutes { + type uint8 { + range "0..59"; + } + description + "Minutes of longitude."; + } + leaf longitude-seconds { + type uint8 { + range "0..59"; + } + description + "Seconds of longitude."; + } + leaf altitude { + type int32; + description + "Height relative to sea level in meters."; + } + leaf address { + type simple-address; + description + "AFI address."; + } + } + container nat-traversal { + when "../address-type = 'laddr:nat-traversal-lcaf'" { + description + "When LCAF type is NAT-Traversal."; + } + description + "NAT-Traversal LCAF type."; + reference + "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 + #section-4.6"; + leaf ms-udp-port { + type uint16; + description + "Map-Server UDP port (set to 4342)."; + } + leaf etr-udp-port { + type uint16; + description + "ETR UDP port."; + } + leaf global-etr-rloc { + type simple-address; + description + "Global ETR RLOC address."; + } + leaf ms-rloc { + type simple-address; + description + "Map-Server RLOC address."; + } + leaf private-etr-rloc { + type simple-address; + description + "Private ETR RLOC address."; + } + leaf-list rtr-rlocs { + type simple-address; + description + "List of RTR RLOC addresses."; + } + } + container explicit-locator-path { + when "../address-type = 'laddr:explicit-locator-path-lcaf'" { + description + "When LCAF type type is Explicit Locator Path."; + } + description + "Explicit Locator Path LCAF type."; + reference + "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 + #section-4.9"; + list hop { + key "hop-id"; + ordered-by user; + description + "List of locator hops forming the explicit path."; + leaf hop-id { + type string { + length "1..64"; + } + description + "Unique identifier for the hop."; + } + leaf address { + type simple-address; + description + "AFI address."; + } + leaf lrs-bits { + type bits{ + bit lookup { + description + "Lookup bit."; + } + bit rloc-probe { + description + "RLOC-probe bit."; + } + bit strict { + description + "Strict bit."; + } + } + description + "Flag bits per hop."; + } + } + } + container source-dest-key { + when "../address-type = 'laddr:source-dest-key-lcaf'" { + description + "When LCAF type type is Source/Dest."; + } + description + "Source/Dest LCAF type."; + reference + "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 + #section-4.11"; + leaf source { + type simple-address; + description + "Source address."; + } + leaf dest { + type simple-address; + description + "Destination address."; + } + } + container key-value-address { + when "../address-type = 'laddr:key-value-address-lcaf'" { + description + "When LCAF type type is Key/Value Address."; + } + description + "Key/Value Address LCAF type."; + reference + "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 + #section-4.11"; + leaf key { + type simple-address; + description + "Address as Key."; + } + leaf value { + type simple-address; + description + "Address as Value."; + } + } + container service-path { + when "../address-type = 'laddr:service-path-lcaf'" { + description + "When LCAF type service path identifier."; + } + description + "Service Path LCAF type."; + reference + "http://tools.ietf.org/html/draft-ermagan-lisp-nsh-00"; + leaf service-path-id { + type service-path-id-type; + description + "Service path identifier for the path for NSH header"; + } + leaf service-index { + type uint8; + description + "Service path index for NSH header"; + } + } + } + } +} diff --git a/lisp/api/src/main/yang/lisp.yang b/lisp/api/src/main/yang/lisp.yang deleted file mode 100755 index 61e321c18..000000000 --- a/lisp/api/src/main/yang/lisp.yang +++ /dev/null @@ -1,476 +0,0 @@ -//TODO mandatory statements -module lisp { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:lisp"; - prefix "lisp"; - import ietf-interfaces { - prefix "if"; - } - import ietf-inet-types { - prefix "inet"; - } - import ietf-lisp-address-types { - prefix "lisp-types"; - } - import v3po { - prefix "v3po"; - } - organization - "FD.io Overlay Forwarding Engine (ONE) project"; - contact - "Florin Coras - Vina Ermagan - ONE list "; - - description - "This YANG module defines the generic configuration and - operational data for LISP in VPP"; - - revision 2017-03-15 { - description - "Excludes lisp-state from config data - Support for Lisp Control Plane Features - - Map request mode - - Multiple map servers - - Petr use - - RLoc probing - - Map Register - - Support for keys in local mappings"; - } - - revision 2016-12-14 { - description - "This revision adds support for L2 features, by adding vrf-subtable/bridge-domain-subtable - containers under vni-table. Both contains mandatory reference to index(vrf-subtable) - or name(bridge-domain-subtable) of respective kind of table."; - - reference - "https://tools.ietf.org/html/rfc6830"; - } - - revision "2016-05-20" { - description - "Initial revision of LISP model"; - reference - "https://tools.ietf.org/html/rfc6830"; - } - - typedef locator-set-ref { - type leafref { - path "/lisp/lisp-feature-data/locator-sets/locator-set/name"; - } - description "Locator-set reference"; - } - - typedef mapping-id { - type string; - description "Mapping ID"; - } - - typedef map-reply-action { - type enumeration { - enum no-action { - value 0; - description - "Mapping is kept alive and no encapsulation occurs."; - } - enum natively-forward { - value 1; - description - "Matching packets are not encapsulated or dropped but - natively forwarded."; - } - enum send-map-request { - value 2; - description - "Matching packets invoke Map-Requests."; - } - enum drop { - value 3; - description - "Matching packets are dropped."; - } - } - description - "Defines the lisp map-cache ACT type"; - reference - "https://tools.ietf.org/html/rfc6830#section-6.1.4"; - } - - typedef map-request-mode { - type enumeration { - enum destination-only { - value 0; - description "Normal map requests"; - } - enum source-destination { - value 1; - description "Source/Destination map requests"; - } - } - } - - typedef hmac-key-type { - type enumeration { - enum no-key { - value 0; - } - enum sha-1-96-key { - value 1; - } - enum sha-256-128-key { - value 2; - } - } - } - - grouping locator-properties-grouping { - description - "Properties of a RLOC"; - leaf priority { - type uint8; - description - "Locator priority."; - } - leaf weight { - type uint8; - description - "Locator weight."; - } - } - - grouping locator-sets-grouping { - // NOTE: to be used only for local locators - // lisp_add_del_locator_set locator-set [del] - // lisp_add_del_locator locator-set iface - // p w [del] - container locator-sets { - list locator-set { - key "name"; - leaf name { - type string; - description "Locator-set name"; - } - list interface { - key "interface-ref"; - leaf interface-ref { - type if:interface-ref; - description "Interface reference"; - } - uses locator-properties-grouping; - description "List of interfaces part of the locator-set"; - } - description "Locator-set"; - } - description "Locator-sets"; - } - description "Grouping for locator-sets"; - } - - grouping hmac-key-grouping { - container hmac-key { - // not mandatory , but when specified, both must be present - // due to presence containers bug, will be checked internaly - - leaf key-type { - type hmac-key-type; - } - - leaf key { - type string; - } - } - } - - grouping adjacencies-grouping { - container adjacencies { - list adjacency { - key "id"; - leaf id { - type string; - description "Adjacency id"; - } - container local-eid { - uses lisp-types:lisp-address; - description "Local EID that must have a local mapping"; - } - container remote-eid { - uses lisp-types:lisp-address; - description "Remote EID that must have a remote mapping"; - } - description "List of adjacencies"; - } - description "Adjacencies programmed into the data plane"; - } - description "Adjacencies grouping"; - } - - grouping dp-subtable-grouping { - // Once both vni and table-id are set: - // lisp_eid_table_add_del_map - container local-mappings { - list local-mapping { - key "id"; - leaf id { - type mapping-id; - description "Id that uniquely identifies a mapping"; - } - container eid { - uses lisp-types:lisp-address; - description "EID address"; - } - leaf locator-set { - type locator-set-ref; - description "Locator-set"; - } - uses hmac-key-grouping; - description "Local mapping"; - } - description "Local EID to locator-set mappings"; - } - // lisp_add_del_local_eid eid locator-set - // [del] - // lisp_add_del_remote_mapping vni eid seid - // [action ] rloc - // [rloc ..] - // NOTE: 1.lisp_add_del_remote_mapping seid is used to build - // src/dst mappings. Rlocs have p/w in them - container remote-mappings { - list remote-mapping { - key "id"; - leaf id { - type mapping-id; - description "Id that uniquely identifies a mapping"; - } - container eid { - description "Remote EID address"; - uses lisp-types:lisp-address; - } - leaf ttl { - type uint32; - description "Mapping validity period."; - } - leaf authoritative { - type bits { - bit A { - description "Authoritative bit."; - } - } - description - "Bit that indicates if mapping comes from an - authoritative source."; - } - choice locator-list { - description - "list of locators are either negative, or positive."; - case negative-mapping { - //NOTE - Wrapped in container to prevent leaf map-reply-action enforcing impresence of rlocs - container map-reply{ - leaf map-reply-action { - type map-reply-action; - description - "Forwarding action for a negative mapping."; - } - } - } - case positive-mapping { - // NOTE if container is not needed to encapsulate - // locator list, remove it - container rlocs { - list locator { - key "address"; - leaf address { - type inet:ip-address; - description "Locator address"; - } - uses locator-properties-grouping; - description "Remote locator"; - } - description - "List of locators for a positive mapping."; - } - } - } - uses adjacencies-grouping; - description "List of remote mappings"; - } - description "Map-cache/remote mappings cache"; - } - description "Data path subtable (VRF/bridge domain) grouping"; - } - - grouping eid-table-grouping { - container eid-table { - list vni-table { - key "virtual-network-identifier"; - leaf virtual-network-identifier { - type uint32; - description "vni"; - } - container vrf-subtable { - presence "Enable L3 mapping"; - leaf table-id { - type uint32; - description "table-id"; - // TODO - HC2VPP-73 - commented due to ODL Boron issues - //mandatory true; - } - - uses dp-subtable-grouping; - description "VRF subtable"; - } - container bridge-domain-subtable { - presence "Enable L2 mapping"; - leaf bridge-domain-ref { - type v3po:bridge-domain-ref; - description "Reference to existing bridge domain"; - // TODO - HC2VPP-73 - commented due to ODL Boron issues - // mandatory true; - } - - uses dp-subtable-grouping; - description "Bridge domain subtable"; - } - description "VNI tables"; - } - description "EID table"; - } - description "EID table grouping"; - } - grouping map-resolvers-grouping { - container map-resolvers { - // lisp_add_del_map_resolver - list map-resolver { - key ip-address; - leaf ip-address { - type inet:ip-address; - description "Map-resolver IP address"; - } - description "List of map-resolvers"; - } - description "Map-resolvers configured"; - } - description "Map-Resolver grouping"; - } - grouping map-servers-grouping { - container map-servers { - //lisp_add_del_map_server - list map-server { - key ip-address; - leaf ip-address { - type inet:ip-address; - description "Map-server IP address"; - } - description "List of map-servers"; - } - } - } - - grouping pitr-cfg-grouping { - // lisp_pitr_set_locator_set - container pitr-cfg { - leaf locator-set { - type locator-set-ref; - default "N/A"; - description "Locator-set reference"; - } - description "Proxy-ITR configuration"; - } - description "PITR configuration grouping"; - } - - grouping use-petr-cfg-grouping { - // lisp_use_petr - container petr-cfg { - leaf petr-address { - type inet:ip-address; - description "PETR address"; - } - } - } - - grouping rloc-probing-grouping { - // lisp_rloc_probe_enable_disable - container rloc-probe { - leaf enabled { - type boolean; - default "false"; - description "Enabled/disable RLOC probing"; - } - } - } - - grouping map-register-grouping { - // lisp_map_register_enable_disable - container map-register { - leaf enabled { - type boolean; - default "false"; - description "Enabled/disable RLOC probing"; - } - } - } - - grouping map-request-mode-grouping { - // lisp_map_request_mode - container map-request-mode { - leaf mode { - type map-request-mode; - default "destination-only"; - } - } - } - - grouping itr-remote-locator-sets-grouping{ - container itr-remote-locator-set{ - // lisp_add_del_map_request_itr_rlocs add/del - // lisp_get_map_request_itr_rlocs - leaf remote-locator-set-name{ - type locator-set-ref; - description "Locators to be used in map-requests"; - } - } - } - - grouping lisp-feature-data-grouping{ - //aggregation of all lisp data, restricted by Lisp beeing enabled - - container lisp-feature-data{ - when "../lisp:enable = 'true'"; - - uses locator-sets-grouping; - uses eid-table-grouping; - uses map-resolvers-grouping; - uses map-servers-grouping; - uses pitr-cfg-grouping; - uses use-petr-cfg-grouping; - uses rloc-probing-grouping; - uses map-register-grouping; - uses map-request-mode-grouping; - uses itr-remote-locator-sets-grouping; - } - } - - // ref https://wiki.fd.io/view/ONE/Command-line_Interface_CLI_Guide - container lisp { - - // lisp_enable_disable / lisp_enable_disable_status_dump - leaf enable { - type boolean; - description "Enable/disable LISP feature"; - } - uses lisp-feature-data-grouping; - description "LISP configuration"; - } - - container lisp-state { - config "false"; - // lisp_enable_disable / lisp_enable_disable_status_dump - leaf enable { - type boolean; - description "Enable/disable LISP feature"; - } - uses lisp-feature-data-grouping; - description "LISP state"; - } -} diff --git a/lisp/api/src/main/yang/lisp@2017-03-15.yang b/lisp/api/src/main/yang/lisp@2017-03-15.yang new file mode 100755 index 000000000..61e321c18 --- /dev/null +++ b/lisp/api/src/main/yang/lisp@2017-03-15.yang @@ -0,0 +1,476 @@ +//TODO mandatory statements +module lisp { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:lisp"; + prefix "lisp"; + import ietf-interfaces { + prefix "if"; + } + import ietf-inet-types { + prefix "inet"; + } + import ietf-lisp-address-types { + prefix "lisp-types"; + } + import v3po { + prefix "v3po"; + } + organization + "FD.io Overlay Forwarding Engine (ONE) project"; + contact + "Florin Coras + Vina Ermagan + ONE list "; + + description + "This YANG module defines the generic configuration and + operational data for LISP in VPP"; + + revision 2017-03-15 { + description + "Excludes lisp-state from config data + Support for Lisp Control Plane Features + - Map request mode + - Multiple map servers + - Petr use + - RLoc probing + - Map Register + - Support for keys in local mappings"; + } + + revision 2016-12-14 { + description + "This revision adds support for L2 features, by adding vrf-subtable/bridge-domain-subtable + containers under vni-table. Both contains mandatory reference to index(vrf-subtable) + or name(bridge-domain-subtable) of respective kind of table."; + + reference + "https://tools.ietf.org/html/rfc6830"; + } + + revision "2016-05-20" { + description + "Initial revision of LISP model"; + reference + "https://tools.ietf.org/html/rfc6830"; + } + + typedef locator-set-ref { + type leafref { + path "/lisp/lisp-feature-data/locator-sets/locator-set/name"; + } + description "Locator-set reference"; + } + + typedef mapping-id { + type string; + description "Mapping ID"; + } + + typedef map-reply-action { + type enumeration { + enum no-action { + value 0; + description + "Mapping is kept alive and no encapsulation occurs."; + } + enum natively-forward { + value 1; + description + "Matching packets are not encapsulated or dropped but + natively forwarded."; + } + enum send-map-request { + value 2; + description + "Matching packets invoke Map-Requests."; + } + enum drop { + value 3; + description + "Matching packets are dropped."; + } + } + description + "Defines the lisp map-cache ACT type"; + reference + "https://tools.ietf.org/html/rfc6830#section-6.1.4"; + } + + typedef map-request-mode { + type enumeration { + enum destination-only { + value 0; + description "Normal map requests"; + } + enum source-destination { + value 1; + description "Source/Destination map requests"; + } + } + } + + typedef hmac-key-type { + type enumeration { + enum no-key { + value 0; + } + enum sha-1-96-key { + value 1; + } + enum sha-256-128-key { + value 2; + } + } + } + + grouping locator-properties-grouping { + description + "Properties of a RLOC"; + leaf priority { + type uint8; + description + "Locator priority."; + } + leaf weight { + type uint8; + description + "Locator weight."; + } + } + + grouping locator-sets-grouping { + // NOTE: to be used only for local locators + // lisp_add_del_locator_set locator-set [del] + // lisp_add_del_locator locator-set iface + // p w [del] + container locator-sets { + list locator-set { + key "name"; + leaf name { + type string; + description "Locator-set name"; + } + list interface { + key "interface-ref"; + leaf interface-ref { + type if:interface-ref; + description "Interface reference"; + } + uses locator-properties-grouping; + description "List of interfaces part of the locator-set"; + } + description "Locator-set"; + } + description "Locator-sets"; + } + description "Grouping for locator-sets"; + } + + grouping hmac-key-grouping { + container hmac-key { + // not mandatory , but when specified, both must be present + // due to presence containers bug, will be checked internaly + + leaf key-type { + type hmac-key-type; + } + + leaf key { + type string; + } + } + } + + grouping adjacencies-grouping { + container adjacencies { + list adjacency { + key "id"; + leaf id { + type string; + description "Adjacency id"; + } + container local-eid { + uses lisp-types:lisp-address; + description "Local EID that must have a local mapping"; + } + container remote-eid { + uses lisp-types:lisp-address; + description "Remote EID that must have a remote mapping"; + } + description "List of adjacencies"; + } + description "Adjacencies programmed into the data plane"; + } + description "Adjacencies grouping"; + } + + grouping dp-subtable-grouping { + // Once both vni and table-id are set: + // lisp_eid_table_add_del_map + container local-mappings { + list local-mapping { + key "id"; + leaf id { + type mapping-id; + description "Id that uniquely identifies a mapping"; + } + container eid { + uses lisp-types:lisp-address; + description "EID address"; + } + leaf locator-set { + type locator-set-ref; + description "Locator-set"; + } + uses hmac-key-grouping; + description "Local mapping"; + } + description "Local EID to locator-set mappings"; + } + // lisp_add_del_local_eid eid locator-set + // [del] + // lisp_add_del_remote_mapping vni eid seid + // [action ] rloc + // [rloc ..] + // NOTE: 1.lisp_add_del_remote_mapping seid is used to build + // src/dst mappings. Rlocs have p/w in them + container remote-mappings { + list remote-mapping { + key "id"; + leaf id { + type mapping-id; + description "Id that uniquely identifies a mapping"; + } + container eid { + description "Remote EID address"; + uses lisp-types:lisp-address; + } + leaf ttl { + type uint32; + description "Mapping validity period."; + } + leaf authoritative { + type bits { + bit A { + description "Authoritative bit."; + } + } + description + "Bit that indicates if mapping comes from an + authoritative source."; + } + choice locator-list { + description + "list of locators are either negative, or positive."; + case negative-mapping { + //NOTE - Wrapped in container to prevent leaf map-reply-action enforcing impresence of rlocs + container map-reply{ + leaf map-reply-action { + type map-reply-action; + description + "Forwarding action for a negative mapping."; + } + } + } + case positive-mapping { + // NOTE if container is not needed to encapsulate + // locator list, remove it + container rlocs { + list locator { + key "address"; + leaf address { + type inet:ip-address; + description "Locator address"; + } + uses locator-properties-grouping; + description "Remote locator"; + } + description + "List of locators for a positive mapping."; + } + } + } + uses adjacencies-grouping; + description "List of remote mappings"; + } + description "Map-cache/remote mappings cache"; + } + description "Data path subtable (VRF/bridge domain) grouping"; + } + + grouping eid-table-grouping { + container eid-table { + list vni-table { + key "virtual-network-identifier"; + leaf virtual-network-identifier { + type uint32; + description "vni"; + } + container vrf-subtable { + presence "Enable L3 mapping"; + leaf table-id { + type uint32; + description "table-id"; + // TODO - HC2VPP-73 - commented due to ODL Boron issues + //mandatory true; + } + + uses dp-subtable-grouping; + description "VRF subtable"; + } + container bridge-domain-subtable { + presence "Enable L2 mapping"; + leaf bridge-domain-ref { + type v3po:bridge-domain-ref; + description "Reference to existing bridge domain"; + // TODO - HC2VPP-73 - commented due to ODL Boron issues + // mandatory true; + } + + uses dp-subtable-grouping; + description "Bridge domain subtable"; + } + description "VNI tables"; + } + description "EID table"; + } + description "EID table grouping"; + } + grouping map-resolvers-grouping { + container map-resolvers { + // lisp_add_del_map_resolver + list map-resolver { + key ip-address; + leaf ip-address { + type inet:ip-address; + description "Map-resolver IP address"; + } + description "List of map-resolvers"; + } + description "Map-resolvers configured"; + } + description "Map-Resolver grouping"; + } + grouping map-servers-grouping { + container map-servers { + //lisp_add_del_map_server + list map-server { + key ip-address; + leaf ip-address { + type inet:ip-address; + description "Map-server IP address"; + } + description "List of map-servers"; + } + } + } + + grouping pitr-cfg-grouping { + // lisp_pitr_set_locator_set + container pitr-cfg { + leaf locator-set { + type locator-set-ref; + default "N/A"; + description "Locator-set reference"; + } + description "Proxy-ITR configuration"; + } + description "PITR configuration grouping"; + } + + grouping use-petr-cfg-grouping { + // lisp_use_petr + container petr-cfg { + leaf petr-address { + type inet:ip-address; + description "PETR address"; + } + } + } + + grouping rloc-probing-grouping { + // lisp_rloc_probe_enable_disable + container rloc-probe { + leaf enabled { + type boolean; + default "false"; + description "Enabled/disable RLOC probing"; + } + } + } + + grouping map-register-grouping { + // lisp_map_register_enable_disable + container map-register { + leaf enabled { + type boolean; + default "false"; + description "Enabled/disable RLOC probing"; + } + } + } + + grouping map-request-mode-grouping { + // lisp_map_request_mode + container map-request-mode { + leaf mode { + type map-request-mode; + default "destination-only"; + } + } + } + + grouping itr-remote-locator-sets-grouping{ + container itr-remote-locator-set{ + // lisp_add_del_map_request_itr_rlocs add/del + // lisp_get_map_request_itr_rlocs + leaf remote-locator-set-name{ + type locator-set-ref; + description "Locators to be used in map-requests"; + } + } + } + + grouping lisp-feature-data-grouping{ + //aggregation of all lisp data, restricted by Lisp beeing enabled + + container lisp-feature-data{ + when "../lisp:enable = 'true'"; + + uses locator-sets-grouping; + uses eid-table-grouping; + uses map-resolvers-grouping; + uses map-servers-grouping; + uses pitr-cfg-grouping; + uses use-petr-cfg-grouping; + uses rloc-probing-grouping; + uses map-register-grouping; + uses map-request-mode-grouping; + uses itr-remote-locator-sets-grouping; + } + } + + // ref https://wiki.fd.io/view/ONE/Command-line_Interface_CLI_Guide + container lisp { + + // lisp_enable_disable / lisp_enable_disable_status_dump + leaf enable { + type boolean; + description "Enable/disable LISP feature"; + } + uses lisp-feature-data-grouping; + description "LISP configuration"; + } + + container lisp-state { + config "false"; + // lisp_enable_disable / lisp_enable_disable_status_dump + leaf enable { + type boolean; + description "Enable/disable LISP feature"; + } + uses lisp-feature-data-grouping; + description "LISP state"; + } +} diff --git a/nat/nat-api/src/main/yang/ietf-nat.yang b/nat/nat-api/src/main/yang/ietf-nat.yang deleted file mode 100644 index 54707708c..000000000 --- a/nat/nat-api/src/main/yang/ietf-nat.yang +++ /dev/null @@ -1,1074 +0,0 @@ -module ietf-nat { - - namespace "urn:ietf:params:xml:ns:yang:ietf-nat"; - //namespace to be assigned by IANA - prefix "nat"; - import ietf-inet-types { - prefix "inet"; - } - - organization "IETF NetMod Working Group"; - contact - "Senthil Sivakumar - Mohamed Boucadair - Suresh Vinapamula "; - - description - "This module is a YANG module for NAT implementations - (including both NAT44 and NAT64 flavors. - - Copyright (c) 2015 IETF Trust and the persons identified as - authors of the code. All rights reserved. - - Redistribution and use in source and binary forms, with or - without modification, is permitted pursuant to, and subject - to the license terms contained in, the Simplified BSD License - set forth in Section 4.c of the IETF Trust's Legal Provisions - Relating to IETF Documents - (http://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC XXXX; see - the RFC itself for full legal notices."; - - revision 2015-09-08 { - description "Fixes few YANG errors."; - reference "-02"; - } - - revision 2015-09-07 { - description "Completes the NAT64 model."; - reference "01"; - } - - revision 2015-08-29 { - description "Initial version."; - reference "00"; - } - - typedef percent { - type uint8 { - range "0 .. 100"; - } - description - "Percentage"; - } - - /* - * Grouping - */ - - grouping timeouts { - description - "Configure values of various timeouts."; - - leaf udp-timeouts { - type uint32; - default 300; - description - "UDP inactivity timeout."; - } - - leaf tcp-idle-timeout { - type uint32; - default 7440; - description - "TCP Idle timeout, as per RFC 5382 should be no - 2 hours and 4 minutes."; - } - - leaf tcp-trans-open-timeout { - type uint32; - default 240; - description - "The value of the transitory open connection - idle-timeout."; - } - - leaf tcp-trans-close-timeout { - type uint32; - default 240; - description - "The value of the transitory close connection - idle-timeout."; - } - - leaf tcp-in-syn-timeout { - type uint32; - default 6; - description - "6 seconds, as defined in [RFC5382]."; - } - - leaf fragment-min-timeout { - type uint32; - default 2; - description - "As long as the NAT has available resources, - the NAT allows the fragments to arrive - over fragment-min-timeout interval. - The default value is inspired from RFC6146."; - } - - leaf icmp-timeout { - type uint32; - default 60; - description - "60 seconds, as defined in [RFC5508]."; - } - } - - // port numbers: single or port range - - grouping port-number { - description - "Individual port or a range of ports."; - - choice port-type { - default single-port-number; - description - "Port type: single or port-range."; - - case single-port-number { - leaf single-port-number { - type inet:port-number; - description - "Used for single port numbers."; - } - } - - case port-range { - leaf start-port-number { - type inet:port-number; - description - "Begining of the port range."; - } - - leaf end-port-number { - type inet:port-number; - description - "End of the port range."; - } - } - } - } - - grouping mapping-entry { - description - "NAT mapping entry."; - - leaf index { - type uint32; - description - "A unique identifier of a mapping entry."; - } - - leaf type { - type enumeration { - enum "static" { - description - "The mapping entry is manually configured."; - } - - enum "dynamic" { - description - "This mapping is created by an outgoing - packet."; - } - } - description - "Indicates the type of a mapping entry. E.g., - a mapping can be: static or dynamic"; - } - - leaf internal-src-address { - type inet:ip-address; - mandatory true; - description - "Corresponds to the source IPv4/IPv6 address - of the IPv4 packet"; - } - - container internal-src-port { - description - "Corresponds to the source port of the - IPv4 packet."; - uses port-number; - } - - leaf external-src-address { - type inet:ipv4-address; - mandatory true; - description - "External IPv4 address assigned by NAT"; - } - - container external-src-port { - description - "External source port number assigned by NAT."; - uses port-number; - } - - leaf transport-protocol { - type uint8; - // mandatory true; - description - "Upper-layer protocol associated with this mapping. - Values are taken from the IANA protocol registry. - For example, this field contains 6 (TCP) for a TCP - mapping or 17 (UDP) for a UDP mapping."; - } - - leaf internal-dst-address { - type inet:ipv4-prefix; - description - "Corresponds to the destination IPv4 address - of the IPv4 packet, for example, some NAT - implementation support translating both source - and destination address and ports referred to as - Twice NAT"; - } - - container internal-dst-port { - description - "Corresponds to the destination port of the - IPv4 packet."; - uses port-number; - } - - leaf external-dst-address { - type inet:ipv4-address; - description - "External destination IPv4 address"; - } - - container external-dst-port { - description - "External source port number."; - uses port-number; - } - - leaf lifetime { - type uint32; - // mandatory true; - description - "Lifetime of the mapping."; - } - } - - grouping nat-parameters { - description - "NAT parameters for a given instance"; - - list external-ip-address-pool { - key pool-id; - - - description - "Pool of external IP addresses used to service - internal hosts. - Both contiguous and non-contiguous pools - can be configured for NAT."; - - leaf pool-id { - type uint32; - description - "An identifier of the address pool."; - } - - leaf external-ip-pool { - type inet:ipv4-prefix; - description - "An IPv4 prefix used for NAT purposes."; - } - } - - - leaf subscriber-mask-v6 { - type uint8 { - range "0 .. 128"; - } - description - "The subscriber-mask is an integer that indicates - the length of significant bits to be applied on - the source IP address (internal side) to - unambiguously identify a CPE. - - Subscriber-mask is a system-wide configuration - parameter that is used to enforce generic - per-subscriberpolicies (e.g., port-quota). - - The enforcement of these generic policies does not - require the configuration of every subscriber's - prefix. - - Example: suppose the 2001:db8:100:100::/56 prefix - is assigned to a NAT64 serviced CPE. Suppose also - that 2001:db8:100:100::1 is the IPv6 address used - by the client that resides in that CPE. When the - NAT64 receives a packet from this client, - it applies the subscriber-mask (e.g., 56) on - the source IPv6 address to compute the associated - prefix for this client (2001:db8:100:100::/56). - Then, the NAT64 enforces policies based on that - prefix (2001:db8:100:100::/56), not on the exact - source IPv6 address."; - } - - - list subscriber-mask-v4 { - - key sub-mask-id; - - description - "IPv4 subscriber mask."; - - leaf sub-mask-id { - type uint32; - description - "An identifier of the subscriber masks."; - } - leaf sub-mask { - type inet:ipv4-prefix; - // mandatory true; - description - "The IP address subnets that matches - should be translated. E.g., If the - private realms that are to be translated - by NAT would be 192.0.2.0/24"; - } - } - - leaf paired-address-pooling { - type boolean; - default true; - description - "Paired address pooling is indicating to NAT - that all the flows from an internal IP - address must be assigned the same external - address. This is defined in RFC 4007."; - } - - leaf nat-mapping-type { - type enumeration { - enum "eim" { - description - "endpoint-independent-mapping. - Refer section 4 of RFC 4787."; - } - - enum "adm" { - description - "address-dependent-mapping. - Refer section 4 of RFC 4787."; - } - - enum "edm" { - description - "address-and-port-dependent-mapping. - Refer section 4 of RFC 4787."; - } - } - description - "Indicates the type of a NAT mapping."; - } - leaf nat-filtering-type { - type enumeration { - enum "eif" { - description - "endpoint-independent- filtering. - Refer section 5 of RFC 4787."; - } - - enum "adf" { - description - "address-dependent- filtering. - Refer section 5 of RFC 4787."; - } - - enum "edf" { - description - "address-and-port-dependent- filtering. - Refer section 5 of RFC 4787."; - } - } - description - "Indicates the type of a NAT filtering."; - } - - leaf port-quota { - type uint16; - description - "Configures a port quota to be assigned per - subscriber."; - } - - container port-set { - description - "Manages port-set assignments."; - - leaf port-set-enable { - type boolean; - description - "Enable/Disable port set assignment."; - } - - leaf port-set-size { - type uint16; - description - "Indicates the size of assigned port - sets."; - } - - leaf port-set-timeout { - type uint32; - description - "Inactivty timeout for port sets."; - } - } - - leaf port-randomization-enable { - type boolean; - description - "Enable/disable port randomization - feature."; - } - - leaf port-preservation-enable { - type boolean; - description - "Indicates whether the PCP server should - preserve the internal port number."; - } - - leaf port-range-preservation-enable { - type boolean; - description - "Indicates whether the NAT device should - preserve the internal port range."; - } - - leaf port-parity-preservation-enable { - type boolean; - description - "Indicates whether the PCP server should - preserve the port parity of the - internal port number."; - } - leaf address-roundrobin-enable { - type boolean; - description - "Enable/disable address allocation - round robin."; - } - - uses timeouts; - container logging-info { - description - "Information about Logging NAT events"; - - leaf destination-address { - type inet:ipv4-prefix; - // mandatory true; - description - "Address of the collector that receives - the logs"; - } - leaf destination-port { - type inet:port-number; - // mandatory true; - description - "Destination port of the collector."; - } - - } - container connection-limit { - description - "Information on the config parameters that - rate limit the translations based on various - criteria"; - - leaf limit-per-subscriber { - type uint32; - description - "Maximum number of NAT mappings per - subscriber."; - } - leaf limit-per-vrf { - type uint32; - description - "Maximum number of NAT mappings per - VLAN/VRF."; - } - leaf limit-per-subnet { - type inet:ipv4-prefix; - description - "Maximum number of NAT mappings per - subnet."; - } - leaf limit-per-instance { - type uint32; - // mandatory true; - description - "Maximum number of NAT mappings per - instance."; - } - } - container mapping-limit { - description - "Information on the config parameters that - rate limit the mappings based on various - criteria"; - - leaf limit-per-subscriber { - type uint32; - description - "Maximum number of NAT mappings per - subscriber."; - } - leaf limit-per-vrf { - type uint32; - description - "Maximum number of NAT mappings per - VLAN/VRF."; - } - leaf limit-per-subnet { - type inet:ipv4-prefix; - description - "Maximum number of NAT mappings per - subnet."; - } - leaf limit-per-instance { - type uint32; - // mandatory true; - description - "Maximum number of NAT mappings per - instance."; - } - } - leaf ftp-alg-enable { - type boolean; - description - "Enable/Disable FTP ALG"; - } - - leaf dns-alg-enable { - type boolean; - description - "Enable/Disable DNSALG"; - } - - leaf tftp-alg-enable { - type boolean; - description - "Enable/Disable TFTP ALG"; - } - - leaf msrpc-alg-enable { - type boolean; - description - "Enable/Disable MS-RPC ALG"; - } - - leaf netbios-alg-enable { - type boolean; - description - "Enable/Disable NetBIOS ALG"; - } - - leaf rcmd-alg-enable { - type boolean; - description - "Enable/Disable rcmd ALG"; - } - - leaf ldap-alg-enable { - type boolean; - description - "Enable/Disable LDAP ALG"; - } - - leaf sip-alg-enable { - type boolean; - description - "Enable/Disable SIP ALG"; - } - - leaf rtsp-alg-enable { - type boolean; - description - "Enable/Disable RTSP ALG"; - } - - leaf h323-alg-enable { - type boolean; - description - "Enable/Disable H323 ALG"; - } - - leaf all-algs-enable { - type boolean; - description - "Enable/Disable all the ALGs"; - } - - container notify-pool-usage { - description - "Notification of Pool usage when certain criteria - is met"; - - leaf pool-id { - type uint32; - description - "Pool-ID for which the notification - criteria is defined"; - } - - leaf notify-pool-hi-threshold { - type percent; - // mandatory true; - description - "Notification must be generated when the - defined high threshold is reached. - For example, if a notification is - required when the pool utilization reaches - 90%, this configuration parameter must - be set to 90%"; - } - - leaf notify-pool-low-threshold { - type percent; - description - "Notification must be generated when the defined - low threshold is reached. - For example, if a notification is required when - the pool utilization reaches below 10%, - this configuration parameter must be set to - 10%"; - } - } - list nat64-prefixes { - key nat64-prefix-id; - - description - "Provides one or a list of NAT64 prefixes - With or without a list of destination IPv4 prefixes. - - Destination-based Pref64::/n is discussed in - Section 5.1 of [RFC7050]). For example: - 192.0.2.0/24 is mapped to 2001:db8:122:300::/56. - 198.51.100.0/24 is mapped to 2001:db8:122::/48."; - - leaf nat64-prefix-id { - type uint32; - description - "An identifier of the NAT64 prefix."; - } - - leaf nat64-prefix { - type inet:ipv6-prefix; - default "64:ff9b::/96"; - description - "A NAT64 prefix. Can be NSP or WKP [RFC6052]."; - } - - list destination-ipv4-prefix { - - key ipv4-prefix-id; - - description - "An IPv4 prefix/address."; - - leaf ipv4-prefix-id { - type uint32; - description - "An identifier of the IPv4 prefix/address."; - } - - leaf ipv4-prefix { - type inet:ipv4-prefix; - description - "An IPv4 address/prefix. "; - } - } - } - } //nat-parameters group - - container nat-config { - description - "NAT"; - - container nat-instances { - description - "nat instances"; - - list nat-instance { - - key "id"; - - description - "A NAT instance."; - - leaf id { - type uint32; - description - "NAT instance identifier."; - } - - leaf enable { - type boolean; - description - "Status of the the NAT instance."; - } - - uses nat-parameters; - - container mapping-table { - description - "NAT dynamic mapping table used to track - sessions"; - - list mapping-entry { - key "index"; - description - "NAT mapping entry."; - uses mapping-entry; - } - } - } - } - } - - /* - * NAT State - */ - - container nat-state { - - config false; - - description - "nat-state"; - - container nat-instances { - description - "nat instances"; - - list nat-instance { - key "id"; - - description - "nat instance"; - - leaf id { - // FIXME changed int32 to uint32 to align with nat-config (authors of draft notified) - type uint32; - description - "The identifier of the nat instance."; - } - - container nat-capabilities { - description - "NAT Capabilities"; - - leaf nat44-support { - type boolean; - description - "Indicates NAT44 support"; - } - - leaf nat64-support { - type boolean; - description - "Indicates NAT64 support"; - } - - leaf static-mapping-support { - type boolean; - description - "Indicates whether static mappings are - supported."; - } - - leaf port-set-support { - type boolean; - description - "Indicates port set assignment - support "; - } - - leaf port-randomization-support { - type boolean; - description - "Indicates whether port randomization is - supported."; - } - - leaf port-range-preservation-support { - type boolean; - description - "Indicates whether port range - preservation is supported."; - } - - leaf port-preservation-suport { - type boolean; - description - "Indicates whether port preservation - is supported."; - } - - leaf port-parity-preservation-support { - type boolean; - description - "Indicates whether port parity - preservation is supported."; - } - - leaf address-roundrobin-support { - type boolean; - description - "Indicates whether address allocation - round robin is supported."; - } - - leaf ftp-alg-support { - type boolean; - description - "Indicates whether FTP ALG is supported"; - } - - leaf dns-alg-support { - type boolean; - description - "Indicates whether DNSALG is supported"; - } - - leaf tftp-support { - type boolean; - description - "Indicates whether TFTP ALG is supported"; - } - - leaf msrpc-alg-support { - type boolean; - description - "Indicates whether MS-RPC ALG is supported"; - } - - leaf netbios-alg-support { - type boolean; - description - "Indicates whether NetBIOS ALG is supported"; - } - - leaf rcmd-alg-support { - type boolean; - description - "Indicates whether rcmd ALG is supported"; - } - - leaf ldap-alg-support { - type boolean; - description - "Indicates whether LDAP ALG is supported"; - } - - leaf sip-alg-support { - type boolean; - description - "Indicates whether SIP ALG is supported"; - } - - leaf rtsp-alg-support { - type boolean; - description - "Indicates whether RTSP ALG is supported"; - } - - leaf h323-alg-support { - type boolean; - description - "Indicates whether H323 ALG is supported"; - } - - leaf paired-address-pooling-support { - type boolean; - description - "Indicates whether paired-address-pooling is - supported"; - } - - leaf endpoint-independent-mapping-support { - type boolean; - description - "Indicates whether endpoint-independent-mapping - in Section 4 of RFC 4787 is supported."; - } - - leaf address-dependent-mapping-support { - type boolean; - description - "Indicates whether endpoint-independent-mapping - in Section 4 of RFC 4787 is supported."; - } - - leaf address-and-port-dependent-mapping-support { - type boolean; - description - "Indicates whether endpoint-independent-mapping in - section 4 of RFC 4787 is supported."; - } - - leaf endpoint-independent-filtering-support { - type boolean; - description - "Indicates whether endpoint-independent-mapping in - section 5 of RFC 4787 is supported."; - } - - leaf address-dependent-filtering { - type boolean; - description - "Indicates whether endpoint-independent-mapping in - section 5 of RFC 4787 is supported."; - } - - leaf address-and-port-dependent-filtering { - type boolean; - description - "Indicates whether endpoint-independent-mapping in - section 5 of RFC 4787 is supported."; - } - - leaf stealth-mode-support { - type boolean; - description - "Indicates whether to respond for unsolicited - traffic."; - } - - } - - container nat-current-config { - description - "current config"; - - uses nat-parameters; - } - - container mapping-table { - description - "Mapping table"; - list mapping-entry { - key "index"; - description - "mapping entry"; - uses mapping-entry; - } - } - - container statistics { - description - "Statistics related to the NAT instance"; - - leaf total-mappings { - type uint32; - description - "Total number of NAT Mappings present - at the time. This includes all the - static and dynamic mappings"; - } - leaf total-tcp-mappings { - type uint32; - description - "Total number of TCP Mappings present - at the time."; - } - leaf total-udp-mappings { - type uint32; - description - "Total number of UDP Mappings present - at the time."; - } - leaf total-icmp-mappings { - type uint32; - description - "Total number of ICMP Mappings present - at the time."; - } - container pool-stats { - description - "Statistics related to Pool usage"; - leaf pool-id { - type uint32; - description - "Unique Identifier that represents - a pool"; - } - leaf address-allocated { - type uint32; - description - "Number of allocated addresses in - the pool"; - } - leaf address-free { - type uint32; - description - "Number of free addresses in - the pool.The sum of free - addresses and allocated - addresses are the total - addresses in the pool"; - } - container port-stats { - description - "Statistics related to port - usage."; - - leaf ports-allocated { - type uint32; - description - "Number of allocated ports - in the pool"; - } - - leaf ports-free { - type uint32; - description - "Number of free addresses - in the pool"; - } - } - } - } //statistics - } //nat-instance - } //nat-instances - } //nat-state - /* - * Notifications - */ - notification nat-event { - description - "Notifications must be generated when the defined - high/low threshold is reached. Related configuration - parameters must be provided to trigger - the notifications."; - - leaf id { - type leafref { - path - "/nat-state/nat-instances/" - + "nat-instance/id"; - } - description - "NAT instance ID."; - } - - leaf notify-pool-threshold { - type percent; - // mandatory true; - description - "A treshhold has been fired."; - } - } -} //module nat \ No newline at end of file diff --git a/nat/nat-api/src/main/yang/ietf-nat@2015-09-08.yang b/nat/nat-api/src/main/yang/ietf-nat@2015-09-08.yang new file mode 100644 index 000000000..54707708c --- /dev/null +++ b/nat/nat-api/src/main/yang/ietf-nat@2015-09-08.yang @@ -0,0 +1,1074 @@ +module ietf-nat { + + namespace "urn:ietf:params:xml:ns:yang:ietf-nat"; + //namespace to be assigned by IANA + prefix "nat"; + import ietf-inet-types { + prefix "inet"; + } + + organization "IETF NetMod Working Group"; + contact + "Senthil Sivakumar + Mohamed Boucadair + Suresh Vinapamula "; + + description + "This module is a YANG module for NAT implementations + (including both NAT44 and NAT64 flavors. + + Copyright (c) 2015 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + + revision 2015-09-08 { + description "Fixes few YANG errors."; + reference "-02"; + } + + revision 2015-09-07 { + description "Completes the NAT64 model."; + reference "01"; + } + + revision 2015-08-29 { + description "Initial version."; + reference "00"; + } + + typedef percent { + type uint8 { + range "0 .. 100"; + } + description + "Percentage"; + } + + /* + * Grouping + */ + + grouping timeouts { + description + "Configure values of various timeouts."; + + leaf udp-timeouts { + type uint32; + default 300; + description + "UDP inactivity timeout."; + } + + leaf tcp-idle-timeout { + type uint32; + default 7440; + description + "TCP Idle timeout, as per RFC 5382 should be no + 2 hours and 4 minutes."; + } + + leaf tcp-trans-open-timeout { + type uint32; + default 240; + description + "The value of the transitory open connection + idle-timeout."; + } + + leaf tcp-trans-close-timeout { + type uint32; + default 240; + description + "The value of the transitory close connection + idle-timeout."; + } + + leaf tcp-in-syn-timeout { + type uint32; + default 6; + description + "6 seconds, as defined in [RFC5382]."; + } + + leaf fragment-min-timeout { + type uint32; + default 2; + description + "As long as the NAT has available resources, + the NAT allows the fragments to arrive + over fragment-min-timeout interval. + The default value is inspired from RFC6146."; + } + + leaf icmp-timeout { + type uint32; + default 60; + description + "60 seconds, as defined in [RFC5508]."; + } + } + + // port numbers: single or port range + + grouping port-number { + description + "Individual port or a range of ports."; + + choice port-type { + default single-port-number; + description + "Port type: single or port-range."; + + case single-port-number { + leaf single-port-number { + type inet:port-number; + description + "Used for single port numbers."; + } + } + + case port-range { + leaf start-port-number { + type inet:port-number; + description + "Begining of the port range."; + } + + leaf end-port-number { + type inet:port-number; + description + "End of the port range."; + } + } + } + } + + grouping mapping-entry { + description + "NAT mapping entry."; + + leaf index { + type uint32; + description + "A unique identifier of a mapping entry."; + } + + leaf type { + type enumeration { + enum "static" { + description + "The mapping entry is manually configured."; + } + + enum "dynamic" { + description + "This mapping is created by an outgoing + packet."; + } + } + description + "Indicates the type of a mapping entry. E.g., + a mapping can be: static or dynamic"; + } + + leaf internal-src-address { + type inet:ip-address; + mandatory true; + description + "Corresponds to the source IPv4/IPv6 address + of the IPv4 packet"; + } + + container internal-src-port { + description + "Corresponds to the source port of the + IPv4 packet."; + uses port-number; + } + + leaf external-src-address { + type inet:ipv4-address; + mandatory true; + description + "External IPv4 address assigned by NAT"; + } + + container external-src-port { + description + "External source port number assigned by NAT."; + uses port-number; + } + + leaf transport-protocol { + type uint8; + // mandatory true; + description + "Upper-layer protocol associated with this mapping. + Values are taken from the IANA protocol registry. + For example, this field contains 6 (TCP) for a TCP + mapping or 17 (UDP) for a UDP mapping."; + } + + leaf internal-dst-address { + type inet:ipv4-prefix; + description + "Corresponds to the destination IPv4 address + of the IPv4 packet, for example, some NAT + implementation support translating both source + and destination address and ports referred to as + Twice NAT"; + } + + container internal-dst-port { + description + "Corresponds to the destination port of the + IPv4 packet."; + uses port-number; + } + + leaf external-dst-address { + type inet:ipv4-address; + description + "External destination IPv4 address"; + } + + container external-dst-port { + description + "External source port number."; + uses port-number; + } + + leaf lifetime { + type uint32; + // mandatory true; + description + "Lifetime of the mapping."; + } + } + + grouping nat-parameters { + description + "NAT parameters for a given instance"; + + list external-ip-address-pool { + key pool-id; + + + description + "Pool of external IP addresses used to service + internal hosts. + Both contiguous and non-contiguous pools + can be configured for NAT."; + + leaf pool-id { + type uint32; + description + "An identifier of the address pool."; + } + + leaf external-ip-pool { + type inet:ipv4-prefix; + description + "An IPv4 prefix used for NAT purposes."; + } + } + + + leaf subscriber-mask-v6 { + type uint8 { + range "0 .. 128"; + } + description + "The subscriber-mask is an integer that indicates + the length of significant bits to be applied on + the source IP address (internal side) to + unambiguously identify a CPE. + + Subscriber-mask is a system-wide configuration + parameter that is used to enforce generic + per-subscriberpolicies (e.g., port-quota). + + The enforcement of these generic policies does not + require the configuration of every subscriber's + prefix. + + Example: suppose the 2001:db8:100:100::/56 prefix + is assigned to a NAT64 serviced CPE. Suppose also + that 2001:db8:100:100::1 is the IPv6 address used + by the client that resides in that CPE. When the + NAT64 receives a packet from this client, + it applies the subscriber-mask (e.g., 56) on + the source IPv6 address to compute the associated + prefix for this client (2001:db8:100:100::/56). + Then, the NAT64 enforces policies based on that + prefix (2001:db8:100:100::/56), not on the exact + source IPv6 address."; + } + + + list subscriber-mask-v4 { + + key sub-mask-id; + + description + "IPv4 subscriber mask."; + + leaf sub-mask-id { + type uint32; + description + "An identifier of the subscriber masks."; + } + leaf sub-mask { + type inet:ipv4-prefix; + // mandatory true; + description + "The IP address subnets that matches + should be translated. E.g., If the + private realms that are to be translated + by NAT would be 192.0.2.0/24"; + } + } + + leaf paired-address-pooling { + type boolean; + default true; + description + "Paired address pooling is indicating to NAT + that all the flows from an internal IP + address must be assigned the same external + address. This is defined in RFC 4007."; + } + + leaf nat-mapping-type { + type enumeration { + enum "eim" { + description + "endpoint-independent-mapping. + Refer section 4 of RFC 4787."; + } + + enum "adm" { + description + "address-dependent-mapping. + Refer section 4 of RFC 4787."; + } + + enum "edm" { + description + "address-and-port-dependent-mapping. + Refer section 4 of RFC 4787."; + } + } + description + "Indicates the type of a NAT mapping."; + } + leaf nat-filtering-type { + type enumeration { + enum "eif" { + description + "endpoint-independent- filtering. + Refer section 5 of RFC 4787."; + } + + enum "adf" { + description + "address-dependent- filtering. + Refer section 5 of RFC 4787."; + } + + enum "edf" { + description + "address-and-port-dependent- filtering. + Refer section 5 of RFC 4787."; + } + } + description + "Indicates the type of a NAT filtering."; + } + + leaf port-quota { + type uint16; + description + "Configures a port quota to be assigned per + subscriber."; + } + + container port-set { + description + "Manages port-set assignments."; + + leaf port-set-enable { + type boolean; + description + "Enable/Disable port set assignment."; + } + + leaf port-set-size { + type uint16; + description + "Indicates the size of assigned port + sets."; + } + + leaf port-set-timeout { + type uint32; + description + "Inactivty timeout for port sets."; + } + } + + leaf port-randomization-enable { + type boolean; + description + "Enable/disable port randomization + feature."; + } + + leaf port-preservation-enable { + type boolean; + description + "Indicates whether the PCP server should + preserve the internal port number."; + } + + leaf port-range-preservation-enable { + type boolean; + description + "Indicates whether the NAT device should + preserve the internal port range."; + } + + leaf port-parity-preservation-enable { + type boolean; + description + "Indicates whether the PCP server should + preserve the port parity of the + internal port number."; + } + leaf address-roundrobin-enable { + type boolean; + description + "Enable/disable address allocation + round robin."; + } + + uses timeouts; + container logging-info { + description + "Information about Logging NAT events"; + + leaf destination-address { + type inet:ipv4-prefix; + // mandatory true; + description + "Address of the collector that receives + the logs"; + } + leaf destination-port { + type inet:port-number; + // mandatory true; + description + "Destination port of the collector."; + } + + } + container connection-limit { + description + "Information on the config parameters that + rate limit the translations based on various + criteria"; + + leaf limit-per-subscriber { + type uint32; + description + "Maximum number of NAT mappings per + subscriber."; + } + leaf limit-per-vrf { + type uint32; + description + "Maximum number of NAT mappings per + VLAN/VRF."; + } + leaf limit-per-subnet { + type inet:ipv4-prefix; + description + "Maximum number of NAT mappings per + subnet."; + } + leaf limit-per-instance { + type uint32; + // mandatory true; + description + "Maximum number of NAT mappings per + instance."; + } + } + container mapping-limit { + description + "Information on the config parameters that + rate limit the mappings based on various + criteria"; + + leaf limit-per-subscriber { + type uint32; + description + "Maximum number of NAT mappings per + subscriber."; + } + leaf limit-per-vrf { + type uint32; + description + "Maximum number of NAT mappings per + VLAN/VRF."; + } + leaf limit-per-subnet { + type inet:ipv4-prefix; + description + "Maximum number of NAT mappings per + subnet."; + } + leaf limit-per-instance { + type uint32; + // mandatory true; + description + "Maximum number of NAT mappings per + instance."; + } + } + leaf ftp-alg-enable { + type boolean; + description + "Enable/Disable FTP ALG"; + } + + leaf dns-alg-enable { + type boolean; + description + "Enable/Disable DNSALG"; + } + + leaf tftp-alg-enable { + type boolean; + description + "Enable/Disable TFTP ALG"; + } + + leaf msrpc-alg-enable { + type boolean; + description + "Enable/Disable MS-RPC ALG"; + } + + leaf netbios-alg-enable { + type boolean; + description + "Enable/Disable NetBIOS ALG"; + } + + leaf rcmd-alg-enable { + type boolean; + description + "Enable/Disable rcmd ALG"; + } + + leaf ldap-alg-enable { + type boolean; + description + "Enable/Disable LDAP ALG"; + } + + leaf sip-alg-enable { + type boolean; + description + "Enable/Disable SIP ALG"; + } + + leaf rtsp-alg-enable { + type boolean; + description + "Enable/Disable RTSP ALG"; + } + + leaf h323-alg-enable { + type boolean; + description + "Enable/Disable H323 ALG"; + } + + leaf all-algs-enable { + type boolean; + description + "Enable/Disable all the ALGs"; + } + + container notify-pool-usage { + description + "Notification of Pool usage when certain criteria + is met"; + + leaf pool-id { + type uint32; + description + "Pool-ID for which the notification + criteria is defined"; + } + + leaf notify-pool-hi-threshold { + type percent; + // mandatory true; + description + "Notification must be generated when the + defined high threshold is reached. + For example, if a notification is + required when the pool utilization reaches + 90%, this configuration parameter must + be set to 90%"; + } + + leaf notify-pool-low-threshold { + type percent; + description + "Notification must be generated when the defined + low threshold is reached. + For example, if a notification is required when + the pool utilization reaches below 10%, + this configuration parameter must be set to + 10%"; + } + } + list nat64-prefixes { + key nat64-prefix-id; + + description + "Provides one or a list of NAT64 prefixes + With or without a list of destination IPv4 prefixes. + + Destination-based Pref64::/n is discussed in + Section 5.1 of [RFC7050]). For example: + 192.0.2.0/24 is mapped to 2001:db8:122:300::/56. + 198.51.100.0/24 is mapped to 2001:db8:122::/48."; + + leaf nat64-prefix-id { + type uint32; + description + "An identifier of the NAT64 prefix."; + } + + leaf nat64-prefix { + type inet:ipv6-prefix; + default "64:ff9b::/96"; + description + "A NAT64 prefix. Can be NSP or WKP [RFC6052]."; + } + + list destination-ipv4-prefix { + + key ipv4-prefix-id; + + description + "An IPv4 prefix/address."; + + leaf ipv4-prefix-id { + type uint32; + description + "An identifier of the IPv4 prefix/address."; + } + + leaf ipv4-prefix { + type inet:ipv4-prefix; + description + "An IPv4 address/prefix. "; + } + } + } + } //nat-parameters group + + container nat-config { + description + "NAT"; + + container nat-instances { + description + "nat instances"; + + list nat-instance { + + key "id"; + + description + "A NAT instance."; + + leaf id { + type uint32; + description + "NAT instance identifier."; + } + + leaf enable { + type boolean; + description + "Status of the the NAT instance."; + } + + uses nat-parameters; + + container mapping-table { + description + "NAT dynamic mapping table used to track + sessions"; + + list mapping-entry { + key "index"; + description + "NAT mapping entry."; + uses mapping-entry; + } + } + } + } + } + + /* + * NAT State + */ + + container nat-state { + + config false; + + description + "nat-state"; + + container nat-instances { + description + "nat instances"; + + list nat-instance { + key "id"; + + description + "nat instance"; + + leaf id { + // FIXME changed int32 to uint32 to align with nat-config (authors of draft notified) + type uint32; + description + "The identifier of the nat instance."; + } + + container nat-capabilities { + description + "NAT Capabilities"; + + leaf nat44-support { + type boolean; + description + "Indicates NAT44 support"; + } + + leaf nat64-support { + type boolean; + description + "Indicates NAT64 support"; + } + + leaf static-mapping-support { + type boolean; + description + "Indicates whether static mappings are + supported."; + } + + leaf port-set-support { + type boolean; + description + "Indicates port set assignment + support "; + } + + leaf port-randomization-support { + type boolean; + description + "Indicates whether port randomization is + supported."; + } + + leaf port-range-preservation-support { + type boolean; + description + "Indicates whether port range + preservation is supported."; + } + + leaf port-preservation-suport { + type boolean; + description + "Indicates whether port preservation + is supported."; + } + + leaf port-parity-preservation-support { + type boolean; + description + "Indicates whether port parity + preservation is supported."; + } + + leaf address-roundrobin-support { + type boolean; + description + "Indicates whether address allocation + round robin is supported."; + } + + leaf ftp-alg-support { + type boolean; + description + "Indicates whether FTP ALG is supported"; + } + + leaf dns-alg-support { + type boolean; + description + "Indicates whether DNSALG is supported"; + } + + leaf tftp-support { + type boolean; + description + "Indicates whether TFTP ALG is supported"; + } + + leaf msrpc-alg-support { + type boolean; + description + "Indicates whether MS-RPC ALG is supported"; + } + + leaf netbios-alg-support { + type boolean; + description + "Indicates whether NetBIOS ALG is supported"; + } + + leaf rcmd-alg-support { + type boolean; + description + "Indicates whether rcmd ALG is supported"; + } + + leaf ldap-alg-support { + type boolean; + description + "Indicates whether LDAP ALG is supported"; + } + + leaf sip-alg-support { + type boolean; + description + "Indicates whether SIP ALG is supported"; + } + + leaf rtsp-alg-support { + type boolean; + description + "Indicates whether RTSP ALG is supported"; + } + + leaf h323-alg-support { + type boolean; + description + "Indicates whether H323 ALG is supported"; + } + + leaf paired-address-pooling-support { + type boolean; + description + "Indicates whether paired-address-pooling is + supported"; + } + + leaf endpoint-independent-mapping-support { + type boolean; + description + "Indicates whether endpoint-independent-mapping + in Section 4 of RFC 4787 is supported."; + } + + leaf address-dependent-mapping-support { + type boolean; + description + "Indicates whether endpoint-independent-mapping + in Section 4 of RFC 4787 is supported."; + } + + leaf address-and-port-dependent-mapping-support { + type boolean; + description + "Indicates whether endpoint-independent-mapping in + section 4 of RFC 4787 is supported."; + } + + leaf endpoint-independent-filtering-support { + type boolean; + description + "Indicates whether endpoint-independent-mapping in + section 5 of RFC 4787 is supported."; + } + + leaf address-dependent-filtering { + type boolean; + description + "Indicates whether endpoint-independent-mapping in + section 5 of RFC 4787 is supported."; + } + + leaf address-and-port-dependent-filtering { + type boolean; + description + "Indicates whether endpoint-independent-mapping in + section 5 of RFC 4787 is supported."; + } + + leaf stealth-mode-support { + type boolean; + description + "Indicates whether to respond for unsolicited + traffic."; + } + + } + + container nat-current-config { + description + "current config"; + + uses nat-parameters; + } + + container mapping-table { + description + "Mapping table"; + list mapping-entry { + key "index"; + description + "mapping entry"; + uses mapping-entry; + } + } + + container statistics { + description + "Statistics related to the NAT instance"; + + leaf total-mappings { + type uint32; + description + "Total number of NAT Mappings present + at the time. This includes all the + static and dynamic mappings"; + } + leaf total-tcp-mappings { + type uint32; + description + "Total number of TCP Mappings present + at the time."; + } + leaf total-udp-mappings { + type uint32; + description + "Total number of UDP Mappings present + at the time."; + } + leaf total-icmp-mappings { + type uint32; + description + "Total number of ICMP Mappings present + at the time."; + } + container pool-stats { + description + "Statistics related to Pool usage"; + leaf pool-id { + type uint32; + description + "Unique Identifier that represents + a pool"; + } + leaf address-allocated { + type uint32; + description + "Number of allocated addresses in + the pool"; + } + leaf address-free { + type uint32; + description + "Number of free addresses in + the pool.The sum of free + addresses and allocated + addresses are the total + addresses in the pool"; + } + container port-stats { + description + "Statistics related to port + usage."; + + leaf ports-allocated { + type uint32; + description + "Number of allocated ports + in the pool"; + } + + leaf ports-free { + type uint32; + description + "Number of free addresses + in the pool"; + } + } + } + } //statistics + } //nat-instance + } //nat-instances + } //nat-state + /* + * Notifications + */ + notification nat-event { + description + "Notifications must be generated when the defined + high/low threshold is reached. Related configuration + parameters must be provided to trigger + the notifications."; + + leaf id { + type leafref { + path + "/nat-state/nat-instances/" + + "nat-instance/id"; + } + description + "NAT instance ID."; + } + + leaf notify-pool-threshold { + type percent; + // mandatory true; + description + "A treshhold has been fired."; + } + } +} //module nat \ No newline at end of file diff --git a/nat/nat-api/src/main/yang/interface-nat.yang b/nat/nat-api/src/main/yang/interface-nat.yang deleted file mode 100644 index c1967cf24..000000000 --- a/nat/nat-api/src/main/yang/interface-nat.yang +++ /dev/null @@ -1,44 +0,0 @@ -module interface-nat { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:interface:nat"; - prefix "ifc-nat"; - - revision "2016-12-14" { - description "Initial revision of interface-nat model"; - } - - import ietf-interfaces { - prefix "if"; - } - import ietf-nat { - prefix "nat"; - } - import yang-ext { - prefix "ext"; - } - - description "Augmentations to interfaces model to connect interfaces with nat configuration"; - - grouping interface-nat-attributes { - container nat { - container inbound { - presence "Enables inbound NAT"; - } - container outbound { - presence "Enables outbound NAT"; - } - } - } - - augment /if:interfaces/if:interface { - ext:augment-identifier "nat-interface-augmentation"; - - uses interface-nat-attributes; - } - - augment /if:interfaces-state/if:interface { - ext:augment-identifier "nat-interface-state-augmentation"; - - uses interface-nat-attributes; - } -} \ No newline at end of file diff --git a/nat/nat-api/src/main/yang/interface-nat@2016-12-14.yang b/nat/nat-api/src/main/yang/interface-nat@2016-12-14.yang new file mode 100644 index 000000000..c1967cf24 --- /dev/null +++ b/nat/nat-api/src/main/yang/interface-nat@2016-12-14.yang @@ -0,0 +1,44 @@ +module interface-nat { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:interface:nat"; + prefix "ifc-nat"; + + revision "2016-12-14" { + description "Initial revision of interface-nat model"; + } + + import ietf-interfaces { + prefix "if"; + } + import ietf-nat { + prefix "nat"; + } + import yang-ext { + prefix "ext"; + } + + description "Augmentations to interfaces model to connect interfaces with nat configuration"; + + grouping interface-nat-attributes { + container nat { + container inbound { + presence "Enables inbound NAT"; + } + container outbound { + presence "Enables outbound NAT"; + } + } + } + + augment /if:interfaces/if:interface { + ext:augment-identifier "nat-interface-augmentation"; + + uses interface-nat-attributes; + } + + augment /if:interfaces-state/if:interface { + ext:augment-identifier "nat-interface-state-augmentation"; + + uses interface-nat-attributes; + } +} \ No newline at end of file diff --git a/nat/nat-api/src/main/yang/nat-context.yang b/nat/nat-api/src/main/yang/nat-context.yang deleted file mode 100644 index dd17ed58c..000000000 --- a/nat/nat-api/src/main/yang/nat-context.yang +++ /dev/null @@ -1,64 +0,0 @@ -module nat-context { - yang-version 1; - namespace "urn:honeycomb:params:xml:ns:yang:nat:context"; - prefix "nc"; - - description "Context for nat mapping"; - - revision "2016-12-14" { - description "Initial revision."; - } - - import ietf-inet-types { - prefix "inet"; - } - - import naming-context { - prefix "nc"; - } - - import yang-ext { - prefix "ext"; - } - - grouping mapping-entry-context-attributes { - container nat-mapping-entry-context { - list nat-instance { - key "id"; - - leaf id { - type uint32; - description "ID of the NAT instance from ietf-nat. Maps to VRF-ID in VPP"; - } - - container mapping-table { - list mapping-entry { - - key "internal external"; - unique "index"; - - leaf internal { - type inet:ip-address; - description "Local IP address set in VPP"; - } - - leaf external { - type inet:ip-address; - description "Extarnal IP address set in VPP"; - } - - leaf index { - type uint32; - description "ID of the NAT's mapping entry from ietf-nat"; - } - } - } - } - } - } - - augment /nc:contexts { - ext:augment-identifier "nat-mapping-entry-ctx-augmentation"; - uses mapping-entry-context-attributes; - } -} \ No newline at end of file diff --git a/nat/nat-api/src/main/yang/nat-context@2016-12-14.yang b/nat/nat-api/src/main/yang/nat-context@2016-12-14.yang new file mode 100644 index 000000000..dd17ed58c --- /dev/null +++ b/nat/nat-api/src/main/yang/nat-context@2016-12-14.yang @@ -0,0 +1,64 @@ +module nat-context { + yang-version 1; + namespace "urn:honeycomb:params:xml:ns:yang:nat:context"; + prefix "nc"; + + description "Context for nat mapping"; + + revision "2016-12-14" { + description "Initial revision."; + } + + import ietf-inet-types { + prefix "inet"; + } + + import naming-context { + prefix "nc"; + } + + import yang-ext { + prefix "ext"; + } + + grouping mapping-entry-context-attributes { + container nat-mapping-entry-context { + list nat-instance { + key "id"; + + leaf id { + type uint32; + description "ID of the NAT instance from ietf-nat. Maps to VRF-ID in VPP"; + } + + container mapping-table { + list mapping-entry { + + key "internal external"; + unique "index"; + + leaf internal { + type inet:ip-address; + description "Local IP address set in VPP"; + } + + leaf external { + type inet:ip-address; + description "Extarnal IP address set in VPP"; + } + + leaf index { + type uint32; + description "ID of the NAT's mapping entry from ietf-nat"; + } + } + } + } + } + } + + augment /nc:contexts { + ext:augment-identifier "nat-mapping-entry-ctx-augmentation"; + uses mapping-entry-context-attributes; + } +} \ No newline at end of file diff --git a/nat/nat-api/src/main/yang/subinterface-nat.yang b/nat/nat-api/src/main/yang/subinterface-nat.yang deleted file mode 100644 index 03773ab5f..000000000 --- a/nat/nat-api/src/main/yang/subinterface-nat.yang +++ /dev/null @@ -1,36 +0,0 @@ -module subinterface-nat { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:subinterface:nat"; - prefix "ifc-nat"; - - revision "2017-06-15" { - description "Initial revision of subinterface-nat model"; - } - - import ietf-interfaces { - prefix "if"; - } - import vpp-vlan { - prefix "vpp-vlan"; - } - import interface-nat { - prefix "ifc-nat"; - } - import yang-ext { - prefix "ext"; - } - - description "Augmentations to subinterfaces model to connect subinterfaces with nat configuration"; - - augment /if:interfaces/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { - ext:augment-identifier "nat-subinterface-augmentation"; - - uses ifc-nat:interface-nat-attributes; - } - - augment /if:interfaces-state/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { - ext:augment-identifier "nat-subinterface-state-augmentation"; - - uses ifc-nat:interface-nat-attributes; - } -} \ No newline at end of file diff --git a/nat/nat-api/src/main/yang/subinterface-nat@2017-06-15.yang b/nat/nat-api/src/main/yang/subinterface-nat@2017-06-15.yang new file mode 100644 index 000000000..03773ab5f --- /dev/null +++ b/nat/nat-api/src/main/yang/subinterface-nat@2017-06-15.yang @@ -0,0 +1,36 @@ +module subinterface-nat { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:subinterface:nat"; + prefix "ifc-nat"; + + revision "2017-06-15" { + description "Initial revision of subinterface-nat model"; + } + + import ietf-interfaces { + prefix "if"; + } + import vpp-vlan { + prefix "vpp-vlan"; + } + import interface-nat { + prefix "ifc-nat"; + } + import yang-ext { + prefix "ext"; + } + + description "Augmentations to subinterfaces model to connect subinterfaces with nat configuration"; + + augment /if:interfaces/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { + ext:augment-identifier "nat-subinterface-augmentation"; + + uses ifc-nat:interface-nat-attributes; + } + + augment /if:interfaces-state/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { + ext:augment-identifier "nat-subinterface-state-augmentation"; + + uses ifc-nat:interface-nat-attributes; + } +} \ No newline at end of file diff --git a/nsh/api/src/main/yang/vpp-nsh.yang b/nsh/api/src/main/yang/vpp-nsh.yang deleted file mode 100644 index a379313cf..000000000 --- a/nsh/api/src/main/yang/vpp-nsh.yang +++ /dev/null @@ -1,344 +0,0 @@ -module vpp-nsh { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:vpp:nsh"; - prefix "vpp-nsh"; - - revision "2017-03-15" { - description - "This revision adds support for NSH-MD2 features"; - } - - revision "2016-12-14" { - description - "This revision adds support for NSH-Proxy and NSH-Classifier features"; - } - - revision "2016-06-24" { - description - "Initial revision of vpp-nsh model"; - } - - import iana-if-type { - prefix "ianaift"; - } - import ietf-interfaces { - prefix "if"; - } - import ietf-yang-types { - prefix "yang"; - } - import ietf-inet-types { - prefix "inet"; - } - import yang-ext { - prefix "ext"; - } - import v3po { - prefix "v3po"; - } - /* - * Defines the supported next protocols that can be used for - * NSH next-protocol field. - */ - identity next-protocol { - description "Base identity from which all nsh next protocols - are derived from"; - } - - identity ipv4 { - base next-protocol; - description - "Support ipv4 to act as next protocol"; - } - - identity ipv6 { - base next-protocol; - description - "Support ipv6 to act as next protocol"; - } - - identity ethernet { - base next-protocol; - description - "Support ethernet to act as next protocol"; - } - - typedef nsh-next-protocol { - type identityref { - base "next-protocol"; - } - description "Identifies a specific next protocol for nsh"; - } - - /* - * Defines the supported nsh header action. - */ - identity action-type { - description "nsh header action type"; - } - - identity swap { - base "action-type"; - description "swap action type"; - } - - identity push { - base "action-type"; - description "push action type"; - } - - identity pop { - base "action-type"; - description "pop action type"; - } - - typedef nsh-action-type { - type identityref { - base "action-type"; - } - } - - /* - * Defines the supported encap type. - */ - identity encap-type { - description "encap type"; - } - - identity vxlan-gpe { - base "encap-type"; - description "vxlan-gpe encap type"; - } - - identity vxlan4 { - base "encap-type"; - description "ipv4 vxlan encap type"; - } - - identity vxlan6 { - base "encap-type"; - description "ipv6 vxlan encap type"; - } - - identity none { - base "encap-type"; - description "encap-none"; - } - - typedef nsh-encap-type { - type identityref { - base "encap-type"; - } - } - - /* - * Defines the supported MD-types. - */ - identity md-type { - description "md type"; - } - - identity md-type1 { - base "md-type"; - description "nsh md-type1"; - } - - identity md-type2 { - base "md-type"; - description "nsh md-type2"; - } - - typedef nsh-md-type { - type identityref { - base "md-type"; - } - } - - grouping nsh-md-type1-attributes { - leaf c1 { - type uint32; - } - leaf c2 { - type uint32; - } - leaf c3 { - type uint32; - } - leaf c4 { - type uint32; - } - } - - grouping nsh-md-type2-attributes { - list md2-data { - key "md2_class type"; - - leaf md2_class { - type uint32 { - range "0..65535"; - } - } - leaf type - { - type uint8; - } - leaf len - { - type uint8; - } - leaf metadata - { - type string { - length 1..128; - } - } - } - } - - grouping nsh-entry-base-attributes { - leaf name { - type string; - description "NSH Entry Name"; - } - leaf nsp { - type uint32 { - range "0..16777215"; - } - } - leaf nsi { - type uint8 { - range "1..255"; - } - } - leaf md-type { - type nsh-md-type; - } - leaf version { - type uint8; - } - leaf length { - type uint8; - } - leaf next-protocol { - type nsh-next-protocol; - } - } - - grouping nsh-map-base-attributes { - leaf name { - type string; - description "NSH Map Name"; - } - leaf nsp { - type uint32 { - range "0..16777215"; - } - } - leaf nsi { - type uint8 { - range "1..255"; - } - } - leaf mapped-nsp { - type uint32 { - range "0..16777215"; - } - } - leaf mapped-nsi { - type uint8 { - range "1..255"; - } - } - leaf nsh-action { - type nsh-action-type; - default "swap"; - } - leaf encap-type { - type nsh-encap-type; - } - leaf encap-if-name { - type string; - description "Interface Name"; - } - } - - container vpp-nsh { - description - "NSH config data"; - - container nsh-entries { - list nsh-entry { - key "name"; - - uses nsh-entry-base-attributes; - - description - "nsh-entry configuration"; - } - } - - container nsh-maps { - list nsh-map { - key "name"; - - uses nsh-map-base-attributes; - - description - "nsh-map configuration"; - } - } - } - - augment /vpp-nsh/nsh-entries/nsh-entry { - ext:augment-identifier nsh-md-type-1-augment; - when "/md-type = 'vpp-nsh:md-type1' "; - uses nsh-md-type1-attributes; - } - - augment /vpp-nsh/nsh-entries/nsh-entry { - ext:augment-identifier nsh-md-type-2-augment; - when "/md-type = 'vpp-nsh:md-type2' "; - uses nsh-md-type2-attributes; - } - - container vpp-nsh-state { - config false; - - description - "NSH operational data"; - - container nsh-entries { - list nsh-entry { - key "name"; - - uses nsh-entry-base-attributes; - - description - "nsh-entry operational data"; - } - } - - container nsh-maps { - list nsh-map { - key "name"; - - uses nsh-map-base-attributes; - - description - "nsh-map operational data"; - } - } - } - - augment /vpp-nsh-state/nsh-entries/nsh-entry { - ext:augment-identifier nsh-md-type-1-state-augment; - when "/md-type = 'vpp-nsh:md-type1' "; - uses nsh-md-type1-attributes; - } - - augment /vpp-nsh-state/nsh-entries/nsh-entry { - ext:augment-identifier nsh-md-type-2-state-augment; - when "/md-type = 'vpp-nsh:md-type2' "; - uses nsh-md-type2-attributes; - } -} \ No newline at end of file diff --git a/nsh/api/src/main/yang/vpp-nsh@2017-03-15.yang b/nsh/api/src/main/yang/vpp-nsh@2017-03-15.yang new file mode 100644 index 000000000..a379313cf --- /dev/null +++ b/nsh/api/src/main/yang/vpp-nsh@2017-03-15.yang @@ -0,0 +1,344 @@ +module vpp-nsh { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:vpp:nsh"; + prefix "vpp-nsh"; + + revision "2017-03-15" { + description + "This revision adds support for NSH-MD2 features"; + } + + revision "2016-12-14" { + description + "This revision adds support for NSH-Proxy and NSH-Classifier features"; + } + + revision "2016-06-24" { + description + "Initial revision of vpp-nsh model"; + } + + import iana-if-type { + prefix "ianaift"; + } + import ietf-interfaces { + prefix "if"; + } + import ietf-yang-types { + prefix "yang"; + } + import ietf-inet-types { + prefix "inet"; + } + import yang-ext { + prefix "ext"; + } + import v3po { + prefix "v3po"; + } + /* + * Defines the supported next protocols that can be used for + * NSH next-protocol field. + */ + identity next-protocol { + description "Base identity from which all nsh next protocols + are derived from"; + } + + identity ipv4 { + base next-protocol; + description + "Support ipv4 to act as next protocol"; + } + + identity ipv6 { + base next-protocol; + description + "Support ipv6 to act as next protocol"; + } + + identity ethernet { + base next-protocol; + description + "Support ethernet to act as next protocol"; + } + + typedef nsh-next-protocol { + type identityref { + base "next-protocol"; + } + description "Identifies a specific next protocol for nsh"; + } + + /* + * Defines the supported nsh header action. + */ + identity action-type { + description "nsh header action type"; + } + + identity swap { + base "action-type"; + description "swap action type"; + } + + identity push { + base "action-type"; + description "push action type"; + } + + identity pop { + base "action-type"; + description "pop action type"; + } + + typedef nsh-action-type { + type identityref { + base "action-type"; + } + } + + /* + * Defines the supported encap type. + */ + identity encap-type { + description "encap type"; + } + + identity vxlan-gpe { + base "encap-type"; + description "vxlan-gpe encap type"; + } + + identity vxlan4 { + base "encap-type"; + description "ipv4 vxlan encap type"; + } + + identity vxlan6 { + base "encap-type"; + description "ipv6 vxlan encap type"; + } + + identity none { + base "encap-type"; + description "encap-none"; + } + + typedef nsh-encap-type { + type identityref { + base "encap-type"; + } + } + + /* + * Defines the supported MD-types. + */ + identity md-type { + description "md type"; + } + + identity md-type1 { + base "md-type"; + description "nsh md-type1"; + } + + identity md-type2 { + base "md-type"; + description "nsh md-type2"; + } + + typedef nsh-md-type { + type identityref { + base "md-type"; + } + } + + grouping nsh-md-type1-attributes { + leaf c1 { + type uint32; + } + leaf c2 { + type uint32; + } + leaf c3 { + type uint32; + } + leaf c4 { + type uint32; + } + } + + grouping nsh-md-type2-attributes { + list md2-data { + key "md2_class type"; + + leaf md2_class { + type uint32 { + range "0..65535"; + } + } + leaf type + { + type uint8; + } + leaf len + { + type uint8; + } + leaf metadata + { + type string { + length 1..128; + } + } + } + } + + grouping nsh-entry-base-attributes { + leaf name { + type string; + description "NSH Entry Name"; + } + leaf nsp { + type uint32 { + range "0..16777215"; + } + } + leaf nsi { + type uint8 { + range "1..255"; + } + } + leaf md-type { + type nsh-md-type; + } + leaf version { + type uint8; + } + leaf length { + type uint8; + } + leaf next-protocol { + type nsh-next-protocol; + } + } + + grouping nsh-map-base-attributes { + leaf name { + type string; + description "NSH Map Name"; + } + leaf nsp { + type uint32 { + range "0..16777215"; + } + } + leaf nsi { + type uint8 { + range "1..255"; + } + } + leaf mapped-nsp { + type uint32 { + range "0..16777215"; + } + } + leaf mapped-nsi { + type uint8 { + range "1..255"; + } + } + leaf nsh-action { + type nsh-action-type; + default "swap"; + } + leaf encap-type { + type nsh-encap-type; + } + leaf encap-if-name { + type string; + description "Interface Name"; + } + } + + container vpp-nsh { + description + "NSH config data"; + + container nsh-entries { + list nsh-entry { + key "name"; + + uses nsh-entry-base-attributes; + + description + "nsh-entry configuration"; + } + } + + container nsh-maps { + list nsh-map { + key "name"; + + uses nsh-map-base-attributes; + + description + "nsh-map configuration"; + } + } + } + + augment /vpp-nsh/nsh-entries/nsh-entry { + ext:augment-identifier nsh-md-type-1-augment; + when "/md-type = 'vpp-nsh:md-type1' "; + uses nsh-md-type1-attributes; + } + + augment /vpp-nsh/nsh-entries/nsh-entry { + ext:augment-identifier nsh-md-type-2-augment; + when "/md-type = 'vpp-nsh:md-type2' "; + uses nsh-md-type2-attributes; + } + + container vpp-nsh-state { + config false; + + description + "NSH operational data"; + + container nsh-entries { + list nsh-entry { + key "name"; + + uses nsh-entry-base-attributes; + + description + "nsh-entry operational data"; + } + } + + container nsh-maps { + list nsh-map { + key "name"; + + uses nsh-map-base-attributes; + + description + "nsh-map operational data"; + } + } + } + + augment /vpp-nsh-state/nsh-entries/nsh-entry { + ext:augment-identifier nsh-md-type-1-state-augment; + when "/md-type = 'vpp-nsh:md-type1' "; + uses nsh-md-type1-attributes; + } + + augment /vpp-nsh-state/nsh-entries/nsh-entry { + ext:augment-identifier nsh-md-type-2-state-augment; + when "/md-type = 'vpp-nsh:md-type2' "; + uses nsh-md-type2-attributes; + } +} \ No newline at end of file diff --git a/routing/routing-api/src/main/yang/vpp-routing-ra.yang b/routing/routing-api/src/main/yang/vpp-routing-ra.yang deleted file mode 100644 index 7f396feaa..000000000 --- a/routing/routing-api/src/main/yang/vpp-routing-ra.yang +++ /dev/null @@ -1,107 +0,0 @@ -module vpp-routing-ra { - - namespace "urn:ietf:params:xml:ns:yang:vpp-routing-ra"; - prefix "vpp-routing"; - description "General extensions for routing advertisments message configuration provided by VPP APIs"; - - revision 2017-05-02 { - description "Changed namespace"; - } - - revision 2017-03-15 { - description "Initial revision."; - } - - import yang-ext { - prefix "ext"; - } - - import hc2vpp-ietf-routing { - prefix "ietf-r"; - } - - import hc2vpp-ietf-ipv6-unicast-routing { - prefix "v6ur"; - } - - grouping ipv6-router-advertisements-vpp-attributes { - leaf suppress-link-layer { - type boolean; - default false; - description - "Dicates not to include the optional source link-layer address - in the ICMPv6 router-advertisement messages."; - } - leaf send-unicast { - type boolean; - default false; - description - "Use the source address of the router-solicitation message if availiable."; - } - leaf cease { - type boolean; - default false; - description - "Cease sending ICMPv6 router-advertisement messages."; - } - leaf initial-count { - type uint8 { - range "1..3"; - } - default 3; - description - "Number of initial ICMPv6 router-advertisement messages sent."; - } - leaf initial-interval { - type uint8 { - range "1..16"; - } - units "seconds"; - default 16; - description - "Interval between initial ICMPv6 router-advertisement messages."; - } - - description - "VPP specific configuration of RA messages. Mapped to sw_interface_ip6nd_ra_config API: - https://git.fd.io/vpp/tree/src/vnet/ip/ip.api#n196"; - - reference - "https://docs.fd.io/vpp/17.04/clicmd_src_vnet_ip.html#clicmd_ip6_nd"; - } - - grouping control-adv-prefixes-vpp-attributes { - leaf advertise-router-address { - type boolean; - default true; - description - "Send full router address in prefix advertisement."; - } - leaf vpp-default { - type boolean; - default false; - description - "Use VPP default values for prefix advertisment."; - } - - description - "VPP specific configuration of prefixes in RA messages. Mapped to sw_interface_ip6nd_ra_prefix API: - https://git.fd.io/vpp/tree/src/vnet/ip/ip.api#n243"; - - reference - "https://docs.fd.io/vpp/17.04/clicmd_src_vnet_ip.html#clicmd_ip6_nd"; - } - - augment "/ietf-r:routing/ietf-r:routing-instance/ietf-r:interfaces/ietf-r:interface/" - + "v6ur:ipv6-router-advertisements" { - ext:augment-identifier "ipv6-router-advertisements-vpp-augmentation"; - uses ipv6-router-advertisements-vpp-attributes; - } - - augment "/ietf-r:routing/ietf-r:routing-instance/ietf-r:interfaces/ietf-r:interface/" - + "v6ur:ipv6-router-advertisements/v6ur:prefix-list/v6ur:prefix" { - // TODO control-adv-prefixes/advertise case should be target node (change after yangtools issues are solved) - ext:augment-identifier "control-adv-prefixes-vpp-augmentation"; - uses control-adv-prefixes-vpp-attributes; - } -} \ No newline at end of file diff --git a/routing/routing-api/src/main/yang/vpp-routing-ra@2017-05-02.yang b/routing/routing-api/src/main/yang/vpp-routing-ra@2017-05-02.yang new file mode 100644 index 000000000..7f396feaa --- /dev/null +++ b/routing/routing-api/src/main/yang/vpp-routing-ra@2017-05-02.yang @@ -0,0 +1,107 @@ +module vpp-routing-ra { + + namespace "urn:ietf:params:xml:ns:yang:vpp-routing-ra"; + prefix "vpp-routing"; + description "General extensions for routing advertisments message configuration provided by VPP APIs"; + + revision 2017-05-02 { + description "Changed namespace"; + } + + revision 2017-03-15 { + description "Initial revision."; + } + + import yang-ext { + prefix "ext"; + } + + import hc2vpp-ietf-routing { + prefix "ietf-r"; + } + + import hc2vpp-ietf-ipv6-unicast-routing { + prefix "v6ur"; + } + + grouping ipv6-router-advertisements-vpp-attributes { + leaf suppress-link-layer { + type boolean; + default false; + description + "Dicates not to include the optional source link-layer address + in the ICMPv6 router-advertisement messages."; + } + leaf send-unicast { + type boolean; + default false; + description + "Use the source address of the router-solicitation message if availiable."; + } + leaf cease { + type boolean; + default false; + description + "Cease sending ICMPv6 router-advertisement messages."; + } + leaf initial-count { + type uint8 { + range "1..3"; + } + default 3; + description + "Number of initial ICMPv6 router-advertisement messages sent."; + } + leaf initial-interval { + type uint8 { + range "1..16"; + } + units "seconds"; + default 16; + description + "Interval between initial ICMPv6 router-advertisement messages."; + } + + description + "VPP specific configuration of RA messages. Mapped to sw_interface_ip6nd_ra_config API: + https://git.fd.io/vpp/tree/src/vnet/ip/ip.api#n196"; + + reference + "https://docs.fd.io/vpp/17.04/clicmd_src_vnet_ip.html#clicmd_ip6_nd"; + } + + grouping control-adv-prefixes-vpp-attributes { + leaf advertise-router-address { + type boolean; + default true; + description + "Send full router address in prefix advertisement."; + } + leaf vpp-default { + type boolean; + default false; + description + "Use VPP default values for prefix advertisment."; + } + + description + "VPP specific configuration of prefixes in RA messages. Mapped to sw_interface_ip6nd_ra_prefix API: + https://git.fd.io/vpp/tree/src/vnet/ip/ip.api#n243"; + + reference + "https://docs.fd.io/vpp/17.04/clicmd_src_vnet_ip.html#clicmd_ip6_nd"; + } + + augment "/ietf-r:routing/ietf-r:routing-instance/ietf-r:interfaces/ietf-r:interface/" + + "v6ur:ipv6-router-advertisements" { + ext:augment-identifier "ipv6-router-advertisements-vpp-augmentation"; + uses ipv6-router-advertisements-vpp-attributes; + } + + augment "/ietf-r:routing/ietf-r:routing-instance/ietf-r:interfaces/ietf-r:interface/" + + "v6ur:ipv6-router-advertisements/v6ur:prefix-list/v6ur:prefix" { + // TODO control-adv-prefixes/advertise case should be target node (change after yangtools issues are solved) + ext:augment-identifier "control-adv-prefixes-vpp-augmentation"; + uses control-adv-prefixes-vpp-attributes; + } +} \ No newline at end of file diff --git a/routing/routing-api/src/main/yang/vpp-routing.yang b/routing/routing-api/src/main/yang/vpp-routing.yang deleted file mode 100644 index 5acda3976..000000000 --- a/routing/routing-api/src/main/yang/vpp-routing.yang +++ /dev/null @@ -1,66 +0,0 @@ -module vpp-routing{ - - namespace "urn:ietf:params:xml:ns:yang:vpp-routing"; - prefix "vpp-routing"; - description "General extensions for routes to be able to use VPP route defining apis"; - - revision 2016-12-14 { - description "Initial revision."; - } - - import yang-ext { - prefix "ext"; - } - - import vpp-classifier { - prefix "classifier"; - } - - import hc2vpp-ietf-routing { - prefix "ietf-r"; - } - - typedef vni-reference{ - type uint32; - description "Vrf index reference"; - } - - grouping vpp-route-attributes { - //lookup_in_vrf - leaf secondary-vrf{ - type vni-reference; - description "Optional secondary vrf used to lookup in"; - } - - leaf classify-table{ - // classify_table_index + is_classify flag - type classifier:classify-table-ref; - description "Optional reference to classify table"; - } - } - - grouping vpp-routing-protocol-attributes{ - //vrf_id - leaf primary-vrf{ - type vni-reference; - mandatory true; - description "Main vrf associated to route"; - } - } - - augment /ietf-r:routing/ietf-r:routing-instance/ietf-r:routing-protocols/ietf-r:routing-protocol{ - ext:augment-identifier "routing-protocol-vpp-attr"; - container vpp-protocol-attributes { - presence "Config attributes"; - uses vpp-routing-protocol-attributes; - } - } - - augment /ietf-r:routing-state/ietf-r:routing-instance/ietf-r:routing-protocols/ietf-r:routing-protocol{ - ext:augment-identifier "routing-protocol-state-vpp-attr"; - container vpp-protocol-state-attributes { - presence "Operational attributes"; - uses vpp-routing-protocol-attributes; - } - } -} \ No newline at end of file diff --git a/routing/routing-api/src/main/yang/vpp-routing@2016-12-14.yang b/routing/routing-api/src/main/yang/vpp-routing@2016-12-14.yang new file mode 100644 index 000000000..5acda3976 --- /dev/null +++ b/routing/routing-api/src/main/yang/vpp-routing@2016-12-14.yang @@ -0,0 +1,66 @@ +module vpp-routing{ + + namespace "urn:ietf:params:xml:ns:yang:vpp-routing"; + prefix "vpp-routing"; + description "General extensions for routes to be able to use VPP route defining apis"; + + revision 2016-12-14 { + description "Initial revision."; + } + + import yang-ext { + prefix "ext"; + } + + import vpp-classifier { + prefix "classifier"; + } + + import hc2vpp-ietf-routing { + prefix "ietf-r"; + } + + typedef vni-reference{ + type uint32; + description "Vrf index reference"; + } + + grouping vpp-route-attributes { + //lookup_in_vrf + leaf secondary-vrf{ + type vni-reference; + description "Optional secondary vrf used to lookup in"; + } + + leaf classify-table{ + // classify_table_index + is_classify flag + type classifier:classify-table-ref; + description "Optional reference to classify table"; + } + } + + grouping vpp-routing-protocol-attributes{ + //vrf_id + leaf primary-vrf{ + type vni-reference; + mandatory true; + description "Main vrf associated to route"; + } + } + + augment /ietf-r:routing/ietf-r:routing-instance/ietf-r:routing-protocols/ietf-r:routing-protocol{ + ext:augment-identifier "routing-protocol-vpp-attr"; + container vpp-protocol-attributes { + presence "Config attributes"; + uses vpp-routing-protocol-attributes; + } + } + + augment /ietf-r:routing-state/ietf-r:routing-instance/ietf-r:routing-protocols/ietf-r:routing-protocol{ + ext:augment-identifier "routing-protocol-state-vpp-attr"; + container vpp-protocol-state-attributes { + presence "Operational attributes"; + uses vpp-routing-protocol-attributes; + } + } +} \ No newline at end of file diff --git a/samples/samples-api/src/main/yang/sample-plugin.yang b/samples/samples-api/src/main/yang/sample-plugin.yang deleted file mode 100644 index 099ab65b8..000000000 --- a/samples/samples-api/src/main/yang/sample-plugin.yang +++ /dev/null @@ -1,42 +0,0 @@ -module sample-plugin { - - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:sample:plugin"; - prefix "samples"; - - revision 2016-12-14 { - description "Sample model for demonstration of transation code"; - } - - import ietf-inet-types { - prefix "inet"; - } - - grouping sample-plugin-params { - container vxlans { - list vxlan-tunnel { - - key id; - leaf id { - type string; - } - - leaf src { - type inet:ip-address; - } - leaf dst { - type inet:ip-address; - } - } - } - } - - container sample-plugin-state { - config false; - uses sample-plugin-params; - } - - container sample-plugin { - uses sample-plugin-params; - } -} \ No newline at end of file diff --git a/samples/samples-api/src/main/yang/sample-plugin@2016-12-14.yang b/samples/samples-api/src/main/yang/sample-plugin@2016-12-14.yang new file mode 100644 index 000000000..099ab65b8 --- /dev/null +++ b/samples/samples-api/src/main/yang/sample-plugin@2016-12-14.yang @@ -0,0 +1,42 @@ +module sample-plugin { + + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:sample:plugin"; + prefix "samples"; + + revision 2016-12-14 { + description "Sample model for demonstration of transation code"; + } + + import ietf-inet-types { + prefix "inet"; + } + + grouping sample-plugin-params { + container vxlans { + list vxlan-tunnel { + + key id; + leaf id { + type string; + } + + leaf src { + type inet:ip-address; + } + leaf dst { + type inet:ip-address; + } + } + } + } + + container sample-plugin-state { + config false; + uses sample-plugin-params; + } + + container sample-plugin { + uses sample-plugin-params; + } +} \ No newline at end of file diff --git a/v3po/api/src/main/yang/dot1q-types.yang b/v3po/api/src/main/yang/dot1q-types.yang deleted file mode 100644 index 594b9d6ce..000000000 --- a/v3po/api/src/main/yang/dot1q-types.yang +++ /dev/null @@ -1,237 +0,0 @@ -module dot1q-types { - namespace "urn:ieee:params:xml:ns:yang:dot1q-types"; - prefix dot1q; - - organization - "Cisco Systems, Inc. - Customer Service - - Postal: 170 W Tasman Drive - San Jose, CA 95134 - - Tel: +1 1800 553-NETS - - E-mail: cs-yang@cisco.com"; - - contact - "Robert Wilton - rwilton@cisco.com"; - - description - "This module contains a collection of generally useful YANG types - that are specific to 802.1Q VLANs that can be usefully shared - between multiple models. - - Terms and Acronyms - - 802.1Q: IEEE 802.1Q VLANs - - VLAN (vlan): Virtual Local Area Network - "; - - revision 2015-06-26 { - description "Latest revision, changed namespace"; - - reference "Intended to be standardized IEEE 802.1"; - } - - typedef PCP { - type uint8 { - range "0..7"; - } - description - "Priority Code Point. PCP is a 3-bit field that refers to the - class of service applied to an 802.1Q VLAN tagged frame. The - field specifies a priority value between 0 and 7, these values - can be used by quality of service (QoS) to prioritize - different classes of traffic."; - reference "IEEE 802.1Q (2014)"; - } - - /* - * Defines what it means to be an 802.1Q VLAN Id, where values 0 - * and 4095 are reserved. - */ - typedef dot1q-vlan-id { - type uint16 { - range "1..4094"; - } - description "An 802.1Q VLAN Identifier"; - reference "IEEE 802.1Q (2014)"; - } - - /* - * Defines the supported IEEE 802.1Q types that can be used for - * VLAN tag matching. - */ - identity dot1q-tag-vlan-type { - description "Base identity from which all 802.1Q VLAN tag types - are derived from"; - } - - identity c-vlan { - base dot1q-tag-vlan-type; - description - "An 802.1Q Customer-VLAN tag, normally using the 0x8100 - Ethertype"; - } - - identity s-vlan { - base dot1q-tag-vlan-type; - description - "An 802.1Q Service-VLAN tag, using the 0x88a8 Ethertype - originally introduced in 802.1ad, and incorporated into - 802.1Q (2011)"; - } - - typedef dot1q-tag-type { - type identityref { - base "dot1q-tag-vlan-type"; - } - description "Identifies a specific 802.1Q tag type"; - reference "IEEE 802.1Q (2014)"; - } - - /* - * Defines the type used to represent ranges of VLAN Ids. - * - * Ideally we would model that as a list of VLAN Ids in YANG, but - * the model is easier to use if this is just represented as a - * string. - * - * This type is used to match an ordered list of VLAN Ids, or - * contiguous ranges of VLAN Ids. Valid VLAN Ids must be in the - * range 1 to 4094, and included in the list in non overlapping - * ascending order. - * - * E.g. "1, 10-100, 50, 500-1000" - */ - typedef dot1q-vlan-id-ranges { - type string { - pattern "([0-9]{1,4}(-[0-9]{1,4})?(,[0-9]{1,4}" + - "(-[0-9]{1,4})?)*)"; - } - description "A list of VLAN Ids, or non overlapping VLAN ranges, - in ascending order, between 1 and 4094"; - } - - /* - * A grouping which represents an 802.1Q VLAN tag, matching both - * the tag Ethertype and a single VLAN Id. The PCP and DEI fields - * in the 802.1Q tag are ignored for tag matching purposes. - */ - grouping dot1q-tag { - description "Grouping to allow configuration to identify a single - 802.1Q VLAN tag"; - container dot1q-tag { - description "Identifies an 802.1Q VLAN tag with an explicit - tag-type and a single VLAN Id"; - leaf tag-type { - type dot1q-tag-type; - mandatory true; - description "VLAN tag type"; - } - leaf vlan-id { - type dot1q-vlan-id; - mandatory true; - description "VLAN Id"; - } - } - } - - /* - * A grouping which represents an 802.1Q VLAN tag, matching both - * the tag Ethertype and a single VLAN Id or "any" to match on any - * VLAN Id. The PCP and DEI fields in the 802.1Q tag are ignored - * for tag matching purposes. - */ - grouping dot1q-tag-or-any { - description "Grouping to allow configuration to identify a single - 802.1Q VLAN tag or the 'any' value to match any VLAN - Id not matched by a more specific VLAN Id match"; - container dot1q-tag { - description "Identifies an 802.1Q VLAN tag with an explicit - tag-type and a single VLAN Id, or 'any' VLAN Id"; - leaf tag-type { - type dot1q-tag-type; - mandatory true; - description "VLAN tag type"; - } - leaf vlan-id { - type union { - type dot1q-vlan-id; - type enumeration { - enum "any" { - value 4096; - description - "Matches 'any' VLAN tag in the range 1 to 4094 that - is not matched by a more specific VLAN Id match"; - } - } - } - mandatory true; - description "VLAN Id or any"; - } - } - } - - /* - * A grouping which represents an 802.1Q tag that matches a range - * of VLAN Ids. The PCP and DEI fields in the 802.1Q tag are - * ignored for tag matching purposes. - */ - grouping dot1q-tag-ranges { - description "Grouping to allow configuration to identify an - 802.1Q VLAN tag that matches any VLAN Id within a - set of non overlapping VLAN Id ranges"; - container dot1q-tag { - description "Identifies an 802.1Q VLAN tag with an explicit - tag-type and and a range of VLAN Ids"; - leaf tag-type { - type dot1q-tag-type; - mandatory true; - description "VLAN tag type"; - } - leaf vlan-ids { - type dot1q-vlan-id-ranges; - mandatory true; - description "VLAN Ids"; - } - } - } - - /* - * A grouping which represents an 802.1Q VLAN tag, matching both - * the tag Ethertype and a single VLAN Id, ordered list of ranges, - * or "any" to match on any VLAN Id. The PCP and DEI fields in the - * 802.1Q tag are ignored for tag matching purposes. - */ - grouping dot1q-tag-ranges-or-any { - description "Grouping to allow configuration to identify an - 802.1Q VLAN tag that matches any specific VLAN Id - within a set of non overlapping VLAN Id ranges, or - the 'any' value to match any VLAN Id"; - container dot1q-tag { - description "Identifies an 802.1Q VLAN tag with an explicit - tag-type, an ordered list of VLAN Id ranges, or - 'any' VLAN Id"; - leaf tag-type { - type dot1q-tag-type; - mandatory true; - description "VLAN tag type"; - } - leaf vlan-id { - type union { - type dot1q-vlan-id-ranges; - type enumeration { - enum "any" { - description "Matches 'any' VLAN tag in the range 1 to - 4094"; - } - } - } - mandatory true; - description "VLAN Ids or any"; - } - } - } -} \ No newline at end of file diff --git a/v3po/api/src/main/yang/dot1q-types@2015-06-26.yang b/v3po/api/src/main/yang/dot1q-types@2015-06-26.yang new file mode 100644 index 000000000..594b9d6ce --- /dev/null +++ b/v3po/api/src/main/yang/dot1q-types@2015-06-26.yang @@ -0,0 +1,237 @@ +module dot1q-types { + namespace "urn:ieee:params:xml:ns:yang:dot1q-types"; + prefix dot1q; + + organization + "Cisco Systems, Inc. + Customer Service + + Postal: 170 W Tasman Drive + San Jose, CA 95134 + + Tel: +1 1800 553-NETS + + E-mail: cs-yang@cisco.com"; + + contact + "Robert Wilton - rwilton@cisco.com"; + + description + "This module contains a collection of generally useful YANG types + that are specific to 802.1Q VLANs that can be usefully shared + between multiple models. + + Terms and Acronyms + + 802.1Q: IEEE 802.1Q VLANs + + VLAN (vlan): Virtual Local Area Network + "; + + revision 2015-06-26 { + description "Latest revision, changed namespace"; + + reference "Intended to be standardized IEEE 802.1"; + } + + typedef PCP { + type uint8 { + range "0..7"; + } + description + "Priority Code Point. PCP is a 3-bit field that refers to the + class of service applied to an 802.1Q VLAN tagged frame. The + field specifies a priority value between 0 and 7, these values + can be used by quality of service (QoS) to prioritize + different classes of traffic."; + reference "IEEE 802.1Q (2014)"; + } + + /* + * Defines what it means to be an 802.1Q VLAN Id, where values 0 + * and 4095 are reserved. + */ + typedef dot1q-vlan-id { + type uint16 { + range "1..4094"; + } + description "An 802.1Q VLAN Identifier"; + reference "IEEE 802.1Q (2014)"; + } + + /* + * Defines the supported IEEE 802.1Q types that can be used for + * VLAN tag matching. + */ + identity dot1q-tag-vlan-type { + description "Base identity from which all 802.1Q VLAN tag types + are derived from"; + } + + identity c-vlan { + base dot1q-tag-vlan-type; + description + "An 802.1Q Customer-VLAN tag, normally using the 0x8100 + Ethertype"; + } + + identity s-vlan { + base dot1q-tag-vlan-type; + description + "An 802.1Q Service-VLAN tag, using the 0x88a8 Ethertype + originally introduced in 802.1ad, and incorporated into + 802.1Q (2011)"; + } + + typedef dot1q-tag-type { + type identityref { + base "dot1q-tag-vlan-type"; + } + description "Identifies a specific 802.1Q tag type"; + reference "IEEE 802.1Q (2014)"; + } + + /* + * Defines the type used to represent ranges of VLAN Ids. + * + * Ideally we would model that as a list of VLAN Ids in YANG, but + * the model is easier to use if this is just represented as a + * string. + * + * This type is used to match an ordered list of VLAN Ids, or + * contiguous ranges of VLAN Ids. Valid VLAN Ids must be in the + * range 1 to 4094, and included in the list in non overlapping + * ascending order. + * + * E.g. "1, 10-100, 50, 500-1000" + */ + typedef dot1q-vlan-id-ranges { + type string { + pattern "([0-9]{1,4}(-[0-9]{1,4})?(,[0-9]{1,4}" + + "(-[0-9]{1,4})?)*)"; + } + description "A list of VLAN Ids, or non overlapping VLAN ranges, + in ascending order, between 1 and 4094"; + } + + /* + * A grouping which represents an 802.1Q VLAN tag, matching both + * the tag Ethertype and a single VLAN Id. The PCP and DEI fields + * in the 802.1Q tag are ignored for tag matching purposes. + */ + grouping dot1q-tag { + description "Grouping to allow configuration to identify a single + 802.1Q VLAN tag"; + container dot1q-tag { + description "Identifies an 802.1Q VLAN tag with an explicit + tag-type and a single VLAN Id"; + leaf tag-type { + type dot1q-tag-type; + mandatory true; + description "VLAN tag type"; + } + leaf vlan-id { + type dot1q-vlan-id; + mandatory true; + description "VLAN Id"; + } + } + } + + /* + * A grouping which represents an 802.1Q VLAN tag, matching both + * the tag Ethertype and a single VLAN Id or "any" to match on any + * VLAN Id. The PCP and DEI fields in the 802.1Q tag are ignored + * for tag matching purposes. + */ + grouping dot1q-tag-or-any { + description "Grouping to allow configuration to identify a single + 802.1Q VLAN tag or the 'any' value to match any VLAN + Id not matched by a more specific VLAN Id match"; + container dot1q-tag { + description "Identifies an 802.1Q VLAN tag with an explicit + tag-type and a single VLAN Id, or 'any' VLAN Id"; + leaf tag-type { + type dot1q-tag-type; + mandatory true; + description "VLAN tag type"; + } + leaf vlan-id { + type union { + type dot1q-vlan-id; + type enumeration { + enum "any" { + value 4096; + description + "Matches 'any' VLAN tag in the range 1 to 4094 that + is not matched by a more specific VLAN Id match"; + } + } + } + mandatory true; + description "VLAN Id or any"; + } + } + } + + /* + * A grouping which represents an 802.1Q tag that matches a range + * of VLAN Ids. The PCP and DEI fields in the 802.1Q tag are + * ignored for tag matching purposes. + */ + grouping dot1q-tag-ranges { + description "Grouping to allow configuration to identify an + 802.1Q VLAN tag that matches any VLAN Id within a + set of non overlapping VLAN Id ranges"; + container dot1q-tag { + description "Identifies an 802.1Q VLAN tag with an explicit + tag-type and and a range of VLAN Ids"; + leaf tag-type { + type dot1q-tag-type; + mandatory true; + description "VLAN tag type"; + } + leaf vlan-ids { + type dot1q-vlan-id-ranges; + mandatory true; + description "VLAN Ids"; + } + } + } + + /* + * A grouping which represents an 802.1Q VLAN tag, matching both + * the tag Ethertype and a single VLAN Id, ordered list of ranges, + * or "any" to match on any VLAN Id. The PCP and DEI fields in the + * 802.1Q tag are ignored for tag matching purposes. + */ + grouping dot1q-tag-ranges-or-any { + description "Grouping to allow configuration to identify an + 802.1Q VLAN tag that matches any specific VLAN Id + within a set of non overlapping VLAN Id ranges, or + the 'any' value to match any VLAN Id"; + container dot1q-tag { + description "Identifies an 802.1Q VLAN tag with an explicit + tag-type, an ordered list of VLAN Id ranges, or + 'any' VLAN Id"; + leaf tag-type { + type dot1q-tag-type; + mandatory true; + description "VLAN tag type"; + } + leaf vlan-id { + type union { + type dot1q-vlan-id-ranges; + type enumeration { + enum "any" { + description "Matches 'any' VLAN tag in the range 1 to + 4094"; + } + } + } + mandatory true; + description "VLAN Ids or any"; + } + } + } +} \ No newline at end of file diff --git a/v3po/api/src/main/yang/pbb-types.yang b/v3po/api/src/main/yang/pbb-types.yang deleted file mode 100644 index 8c3aad41a..000000000 --- a/v3po/api/src/main/yang/pbb-types.yang +++ /dev/null @@ -1,81 +0,0 @@ -module pbb-types { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:pbb-types"; - prefix "pbb-types"; - - description "Common types used for defining Pbb based subinterfaces"; - - revision "2016-12-14" { - description - "Initial revision."; - } - - import ietf-yang-types { - prefix yang; - } - - import ietf-interfaces { - prefix if; - } - - import yang-ext { - prefix "ext"; - } - - typedef operation { - type enumeration { - // NOTE - Does not specify disabled enum value(0), because its used internally to delete/disable rewrite - enum "push-2" { - value 2; - } - - enum "pop-2" { - value 4; - description "Encapsulate/Decapsulate pbb packet according to incoming/outcoming direction"; - } - enum "translate-2-1" { - value 7; - } - } - } - - grouping pbb-rewrite-attributes { - description "Provider Backbone Bridge attributes"; - - leaf destination-address { - type yang:mac-address; - description "backbone destination address"; - } - - leaf source-address { - type yang:mac-address; - description "backbone source address"; - } - - leaf outer-tag { - type uint16; - } - - leaf b-vlan-tag-vlan-id { - type uint16 { - //12 bit range - range "1..4095"; - } - description "backbone vlan id"; - } - - leaf i-tag-isid { - type uint32 { - //24 bit range - range "1..16777215"; - } - description "identifier of the backbone service instance "; - } - - leaf interface-operation { - type operation; - default pop-2; - description "Define operation that will pbb interface perform while processing packets"; - } - } -} diff --git a/v3po/api/src/main/yang/pbb-types@2016-12-14.yang b/v3po/api/src/main/yang/pbb-types@2016-12-14.yang new file mode 100644 index 000000000..8c3aad41a --- /dev/null +++ b/v3po/api/src/main/yang/pbb-types@2016-12-14.yang @@ -0,0 +1,81 @@ +module pbb-types { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:pbb-types"; + prefix "pbb-types"; + + description "Common types used for defining Pbb based subinterfaces"; + + revision "2016-12-14" { + description + "Initial revision."; + } + + import ietf-yang-types { + prefix yang; + } + + import ietf-interfaces { + prefix if; + } + + import yang-ext { + prefix "ext"; + } + + typedef operation { + type enumeration { + // NOTE - Does not specify disabled enum value(0), because its used internally to delete/disable rewrite + enum "push-2" { + value 2; + } + + enum "pop-2" { + value 4; + description "Encapsulate/Decapsulate pbb packet according to incoming/outcoming direction"; + } + enum "translate-2-1" { + value 7; + } + } + } + + grouping pbb-rewrite-attributes { + description "Provider Backbone Bridge attributes"; + + leaf destination-address { + type yang:mac-address; + description "backbone destination address"; + } + + leaf source-address { + type yang:mac-address; + description "backbone source address"; + } + + leaf outer-tag { + type uint16; + } + + leaf b-vlan-tag-vlan-id { + type uint16 { + //12 bit range + range "1..4095"; + } + description "backbone vlan id"; + } + + leaf i-tag-isid { + type uint32 { + //24 bit range + range "1..16777215"; + } + description "identifier of the backbone service instance "; + } + + leaf interface-operation { + type operation; + default pop-2; + description "Define operation that will pbb interface perform while processing packets"; + } + } +} diff --git a/v3po/api/src/main/yang/subinterface-span.yang b/v3po/api/src/main/yang/subinterface-span.yang deleted file mode 100644 index 9308c5d4a..000000000 --- a/v3po/api/src/main/yang/subinterface-span.yang +++ /dev/null @@ -1,44 +0,0 @@ -module subinterface-span { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:subinterface-span"; - prefix "subif-span"; - - revision "2017-05-10" { - description - "Initialial revision that adds support for mirroring interfaces on subinterfaces. - Vpp implementation allows/implements only two cases: - - Src: interface |Dst: interface - covered in v3po.yang - - Src: interface |Dst: subinterface - covered by this model"; - } - - revision "2017-06-07" { - description "Eliminated config leafrefs in operational tree"; - } - - import v3po { - prefix "v3po"; - } - - import vpp-vlan { - prefix "vpp-vlan"; - } - - import yang-ext { - prefix "ext"; - } - - augment /if:interfaces/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { - ext:augment-identifier "vpp-subinterface-span-augmentation"; - - container span { - uses v3po:span-attributes; - } - } - - augment /if:interfaces-state/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { - ext:augment-identifier "vpp-subinterface-span-state-augmentation"; - container span-state { - uses v3po:span-state-attributes; - } - } -} \ No newline at end of file diff --git a/v3po/api/src/main/yang/subinterface-span@2017-05-10.yang b/v3po/api/src/main/yang/subinterface-span@2017-05-10.yang new file mode 100644 index 000000000..9308c5d4a --- /dev/null +++ b/v3po/api/src/main/yang/subinterface-span@2017-05-10.yang @@ -0,0 +1,44 @@ +module subinterface-span { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:subinterface-span"; + prefix "subif-span"; + + revision "2017-05-10" { + description + "Initialial revision that adds support for mirroring interfaces on subinterfaces. + Vpp implementation allows/implements only two cases: + - Src: interface |Dst: interface - covered in v3po.yang + - Src: interface |Dst: subinterface - covered by this model"; + } + + revision "2017-06-07" { + description "Eliminated config leafrefs in operational tree"; + } + + import v3po { + prefix "v3po"; + } + + import vpp-vlan { + prefix "vpp-vlan"; + } + + import yang-ext { + prefix "ext"; + } + + augment /if:interfaces/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { + ext:augment-identifier "vpp-subinterface-span-augmentation"; + + container span { + uses v3po:span-attributes; + } + } + + augment /if:interfaces-state/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { + ext:augment-identifier "vpp-subinterface-span-state-augmentation"; + container span-state { + uses v3po:span-state-attributes; + } + } +} \ No newline at end of file diff --git a/v3po/api/src/main/yang/unnumbered-interfaces.yang b/v3po/api/src/main/yang/unnumbered-interfaces.yang deleted file mode 100644 index 18ef2b681..000000000 --- a/v3po/api/src/main/yang/unnumbered-interfaces.yang +++ /dev/null @@ -1,44 +0,0 @@ -module unnumbered-interfaces { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:unnumbered:interfaces"; - prefix "uni"; - - revision "2017-05-10" { - description - "Initialial revision"; - } - - import ietf-interfaces { - prefix "if"; - } - - import vpp-vlan { - prefix "vpp-vlan"; - } - - import yang-ext { - prefix "ext"; - } - - grouping unnumbered-config-attributes { - container unnumbered { - presence "Sets interface as unnumbered"; - leaf use { - type string; - mandatory true; - description - "Name of interface or subinterface which IP is to be borrowed."; - } - } - } - - augment /if:interfaces/if:interface { - ext:augment-identifier "interface-unnumbered-augmentation"; - uses unnumbered-config-attributes; - } - - augment /if:interfaces/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { - ext:augment-identifier "subinterface-unnumbered-augmentation"; - uses unnumbered-config-attributes; - } -} \ No newline at end of file diff --git a/v3po/api/src/main/yang/unnumbered-interfaces@2017-05-10.yang b/v3po/api/src/main/yang/unnumbered-interfaces@2017-05-10.yang new file mode 100644 index 000000000..18ef2b681 --- /dev/null +++ b/v3po/api/src/main/yang/unnumbered-interfaces@2017-05-10.yang @@ -0,0 +1,44 @@ +module unnumbered-interfaces { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:unnumbered:interfaces"; + prefix "uni"; + + revision "2017-05-10" { + description + "Initialial revision"; + } + + import ietf-interfaces { + prefix "if"; + } + + import vpp-vlan { + prefix "vpp-vlan"; + } + + import yang-ext { + prefix "ext"; + } + + grouping unnumbered-config-attributes { + container unnumbered { + presence "Sets interface as unnumbered"; + leaf use { + type string; + mandatory true; + description + "Name of interface or subinterface which IP is to be borrowed."; + } + } + } + + augment /if:interfaces/if:interface { + ext:augment-identifier "interface-unnumbered-augmentation"; + uses unnumbered-config-attributes; + } + + augment /if:interfaces/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { + ext:augment-identifier "subinterface-unnumbered-augmentation"; + uses unnumbered-config-attributes; + } +} \ No newline at end of file diff --git a/v3po/api/src/main/yang/v3po-context.yang b/v3po/api/src/main/yang/v3po-context.yang deleted file mode 100644 index ae35be5dd..000000000 --- a/v3po/api/src/main/yang/v3po-context.yang +++ /dev/null @@ -1,29 +0,0 @@ -module v3po-context { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:v3po:context"; - prefix "v3po-ctx"; - - revision "2016-09-09" { - description - "Initial revision of v3po specific context"; - } - - container disabled-interfaces { - config false; - // context data - - description "Index list of disabled interfaces. VPP does not always delete an interface after deletion. It just - disables it and keeps it there. Honeycomb can hide such interfaces from operational data, and this - is the place to heep track of which interfaces were deleted, but are expected to show up in VPP"; - - list disabled-interface-index { - - key "index"; - - leaf index { - type int32; - } - } - } - -} \ No newline at end of file diff --git a/v3po/api/src/main/yang/v3po-context@2016-09-09.yang b/v3po/api/src/main/yang/v3po-context@2016-09-09.yang new file mode 100644 index 000000000..ae35be5dd --- /dev/null +++ b/v3po/api/src/main/yang/v3po-context@2016-09-09.yang @@ -0,0 +1,29 @@ +module v3po-context { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:v3po:context"; + prefix "v3po-ctx"; + + revision "2016-09-09" { + description + "Initial revision of v3po specific context"; + } + + container disabled-interfaces { + config false; + // context data + + description "Index list of disabled interfaces. VPP does not always delete an interface after deletion. It just + disables it and keeps it there. Honeycomb can hide such interfaces from operational data, and this + is the place to heep track of which interfaces were deleted, but are expected to show up in VPP"; + + list disabled-interface-index { + + key "index"; + + leaf index { + type int32; + } + } + } + +} \ No newline at end of file diff --git a/v3po/api/src/main/yang/v3po.yang b/v3po/api/src/main/yang/v3po.yang deleted file mode 100644 index 7ef5d8876..000000000 --- a/v3po/api/src/main/yang/v3po.yang +++ /dev/null @@ -1,786 +0,0 @@ -module v3po { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:v3po"; - prefix "v3po"; - - revision "2017-03-15" { - description - "Revision changes: - - acl and ietf-acl moved to vpp-interface-acl - - vpp-state and rpc moved to vpp-management - - bridge domains moved to standalone container"; - } - - revision "2016-12-14" { - description - "This revision adds the following new features: - - ingress/egress ACLs support - - moved ACL definitions to vpp-acl module - - updated l2 container constraint (permit IP address on BVI interface) - - added PID of vpp process to vpp-state - - added support for Loopback interfaces - - added support for port mirroring"; - } - - revision "2017-06-07" { - description "Eliminated config leafrefs in operational tree"; - } - - - revision "2015-01-05" { - description "Initial revision of v3po model"; - } - - import iana-if-type { - prefix "ianaift"; - } - import ietf-interfaces { - prefix "if"; - } - import ietf-yang-types { - prefix "yang"; - } - import ietf-inet-types { - prefix "inet"; - } - import ietf-ip { - prefix "ip"; - } - import yang-ext { - prefix "ext"; - } - - typedef bridge-domain-ref { - type leafref { - path "/bridge-domains/bridge-domain/name"; - } - description - "This type is used by to reference a bridge domain table"; - } - - typedef bridged-virtual-interface-ref { - type leafref { - path "/if:interfaces/if:interface/l2/bridged-virtual-interface"; - } - description - "This type is used by to reference a bridged virtual interface"; - } - - identity vxlan-tunnel { - base if:interface-type; - } - - identity gre-tunnel { - base if:interface-type; - } - - identity vhost-user { - base if:interface-type; - } - - identity tap { - base if:interface-type; - } - - identity loopback { - base if:interface-type; - } - - identity l2-fib-action { - description "Base identity for l2-fib actions"; - } - - identity l2-fib-forward { - base l2-fib-action; - description - "Forwards packet with configured mac address"; - } - - identity l2-fib-filter { - base l2-fib-action; - description - "Drops packet with configured mac address"; - } - - typedef l2-fib-action { - type identityref { - base "l2-fib-action"; - } - description "Identifies a specific L2 FIB action"; - } - - typedef vxlan-vni { - // FIXME: should be in a vxlan-specific model - description "VNI used in a VXLAN tunnel"; - type uint32 { - range "0..16777215"; - } - } - - typedef vhost-user-role { - type enumeration { - enum "server"; - enum "client"; - } - } - - identity vxlan-gpe-tunnel { - base if:interface-type; - } - - typedef vxlan-gpe-vni { - description "VNI used in a VXLAN-GPE tunnel"; - type uint32 { - range "0..16777215"; - } - } - - typedef vxlan-gpe-next-protocol { - type enumeration { - enum "ipv4" { - value 1; - } - enum "ipv6" { - value 2; - } - enum "ethernet" { - value 3; - } - enum "nsh" { - value 4; - } - } - } - - - typedef span-state { - type enumeration { - enum "receive" { - value "1"; - description - "Receive (Rx) SPAN—The goal of receive (or ingress) SPAN - is to monitor as much as possible all the packets received by the source interface. - A copy of each packet received by the source is sent to the destination port for that SPAN session. - You can monitor a series or range of ingress ports in a SPAN session."; - } - - enum "transmit" { - value "2"; - description - "Transmit (Tx) SPAN—The goal of transmit (or egress) SPAN is to monitor as much as possible all the packets - sent by the source interface after all modification and processing is performed by the switch. - A copy of each packet sent by the source is sent to the destination port for that SPAN session. - The copy is provided after the packet is modified. Monitors a range of egress ports in a SPAN session."; - } - - enum "both" { - value "3"; - description - "In a SPAN session, you can monitor a series or range of ports for both received and sent packets."; - } - } - } - - grouping bridge-domain-attributes { - leaf flood { - type boolean; - default true; - description - "Enable/disable L2 flooding."; - } - leaf forward { - type boolean; - default true; - description - "Enable/disable L2 forwarding."; - } - leaf learn { - type boolean; - default true; - description - "Enable/disable L2 learning."; - } - leaf unknown-unicast-flood { - type boolean; - default true; - } - leaf arp-termination { - type boolean; - default false; - } - - container arp-termination-table { - when "../v3po:arp-termination = 'true'"; - - // TODO(HONEYCOMB-133): add support for read (after VPP-230 is done) - list arp-termination-table-entry { - key "ip-address phys-address"; - leaf ip-address { - // FIXME: change to ip-address-no-zone after https://bugs.opendaylight.org/show_bug.cgi?id=6413 is resolved - type inet:ip-address; - } - leaf phys-address { - type yang:phys-address; - } - } - } - } - - // TODO express constraints for L2 FIB entries in YANG if possible - grouping l2-fib-attributes { - container l2-fib-table { - list l2-fib-entry { - key "phys-address"; - - leaf phys-address { - type yang:phys-address; - } - - leaf outgoing-interface { - // either filter must be specified or interface(can't be both) - when "../action != 'l2-fib-filter'"; - type if:interface-ref; - // mandatory true; - when is not actually resolved, so mandatory can't be in place - description - "One of interfaces assigned to the FIB table's bridge-domain."; - } - leaf static-config { - type boolean; - default false; - description - "Static entries cannot be overridden by mac learning."; - } - leaf action { - type l2-fib-action; - mandatory true; - description - "L2 FIB action. For filter action, entry must be configured as static."; - } - leaf bridged-virtual-interface { - when "../action = 'forward'"; - type boolean; - config false; // FIXME setting bvi is currently not supported by VPP's binary api - } - } - } - } - - grouping interface-tag { - leaf tag { - type string { - length 1..63; - } - description - "ASCII string placeholder for interface metadata. Value is stored in vpp, - and returned in read requests. No processing involved."; - } - } - - grouping tap-interface-base-attributes { - leaf tap-name { - type string{ - pattern "[a-zA-Z0-9\-;.+@$#^&*!_()=\[\]]*"; - } - } - uses interface-tag; - } - - grouping tap-interface-config-attributes { - leaf mac { - type yang:phys-address; - mandatory false; - description "Mac address to be set for the tap interface. Random will be used if not configured"; - } - - leaf device-instance { - type uint32; - mandatory false; - description "Custom device instance. Autogenerated will be used if not configured"; - } - } - - grouping loopback-interface-base-attributes { - leaf mac { - type yang:phys-address; - mandatory false; - description "Mac address of the loopback interface"; - } - } - - grouping ethernet-base-attributes { - leaf mtu { - type uint16 { - range "64..9216"; - } - units "octets"; - default 9216; - description - "The size, in octets, of the largest packet that the - hardware interface will send and receive."; - } - } - - grouping routing-base-attributes { - leaf ipv4-vrf-id { - type uint32; - } - leaf ipv6-vrf-id { - type uint32; - } - description - "Defines VRF tables used for ipv4 and ipv6 traffic"; - } - - grouping ethernet-state-attributes { - leaf manufacturer-description { - type string; - config false; - } - leaf duplex { - type enumeration { - enum "half"; - enum "full"; - } - config false; - } - } - - grouping vhost-user-interface-base-attributes { - leaf socket { - type string { - length 1..255; - } - } - leaf role { - type vhost-user-role; - default "server"; - } - uses interface-tag; - description "vhost-user settings"; - } - - grouping vhost-user-interface-config-attributes { - leaf device-instance { - type uint32; - mandatory false; - description "Custom device instance. Autogenerated will be used if not configured"; - } - description "vhost-user settings"; - } - - grouping vhost-user-interface-state-attributes { - leaf features { - type uint64; - config false; - } - leaf virtio-net-hdr-size { - type uint32; - config false; - } - leaf num-memory-regions { - type uint32; - config false; - } - leaf connect-error { - type string; - config false; - } - } - - /* - * Defines the supported decap node for vxlan. - */ - identity decap-node { - description - "Define the supported decap node"; - } - identity l2-input { - base decap-node; - description - "The next decap node is l2-input"; - } - identity nsh-proxy { - base decap-node; - description - "The next decap node is nsh-proxy"; - } - typedef vxlan-decap-node { - type identityref { - base "decap-node"; - } - } - grouping vxlan-base-attributes { - // FIXME: this should be in an vxlan-specific extension - leaf src { - /*mandatory true;*/ - type inet:ip-address; - } - leaf dst { - /*mandatory true;*/ - type inet:ip-address; - } - leaf vni { - /*mandatory true;*/ - type vxlan-vni; - } - leaf encap-vrf-id { - type uint32; - } - leaf decap-next { - type vxlan-decap-node; - default "l2-input"; - } - } - - grouping gre-base-attributes { - leaf src { - /*mandatory true;*/ - type inet:ip-address; - } - leaf dst { - /*mandatory true;*/ - type inet:ip-address; - } - leaf outer-fib-id { - type uint32; - } - } - - grouping vxlan-gpe-base-attributes { - leaf local { - /*mandatory true;*/ - type inet:ip-address; - } - leaf remote { - /*mandatory true;*/ - type inet:ip-address; - } - leaf vni { - /*mandatory true;*/ - type vxlan-gpe-vni; - } - leaf next-protocol { - type vxlan-gpe-next-protocol; - } - leaf encap-vrf-id { - type uint32; - } - leaf decap-vrf-id { - type uint32; - } - } - - grouping l2-config-attributes { - description - "Parameters for configuring Layer2 features on interfaces."; - - choice interconnection { - case xconnect-based { - leaf xconnect-outgoing-interface { - /* Don't allow selection of this interface */ - must "../../if:name != current()"; - type if:interface-ref; - description - "L2 xconnect mode"; - } - } - case bridge-based { - uses bridge-based-attributes; - } - } - } - - grouping l2-state-attributes { - description - "Parameters for configuring Layer2 features on interfaces."; - - choice interconnection { - case xconnect-based { - leaf xconnect-outgoing-interface { - /* Don't allow selection of this interface */ - must "../../if:name != current()"; - type if:interface-state-ref; - description - "L2 xconnect mode"; - } - } - case bridge-based { - uses bridge-based-attributes; - } - } - } - - grouping bridge-based-attributes { - leaf bridge-domain { - type bridge-domain-ref; - mandatory true; - description - "Interfaces in a bridge-domain forward packets to other - interfaces in the same bridge-domain based on - destination mac address."; - } - leaf split-horizon-group { - when "../bridge-domain"; - type uint8 { - range "0..255"; - } - default 0; //no split horizon group - description - "Interface's split-horizon group. Interfaces in the same - bridge-domain and split-horizon group can not forward - packets between each other. "; - } - leaf bridged-virtual-interface { - when "../bridge-domain"; - type boolean; - default false; - description - "Interface forward packets in the bridge-domain - associated with the BVI."; - } - } - - grouping span-attributes { - description "Parameters of the SPAN feature"; - - container mirrored-interfaces { - list mirrored-interface { - key "iface-ref"; - leaf iface-ref { - type if:interface-ref; - } - - leaf state { - type span-state; - mandatory true; - } - } - } - } - - grouping span-state-attributes { - description "Parameters of the SPAN feature"; - - container mirrored-interfaces { - list mirrored-interface { - key "iface-ref"; - leaf iface-ref { - type if:interface-state-ref; - } - - leaf state { - type span-state; - mandatory true; - } - } - } - } - - augment /if:interfaces/if:interface { - ext:augment-identifier "vpp-interface-augmentation"; - - // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because: - // 1. The link between interface type and this augmentation is unclear - // 2. Only this augmentation with combination of ifc type is trigger to do something for vpp, what if user only configures base interface stuff ? + We need to get leaves defined by ietf-interfaces when we are processing this augment - // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult - - container tap { - when "../if:type = 'v3po:tap'"; - uses tap-interface-base-attributes; - uses tap-interface-config-attributes; - } - - container loopback { - presence "Presence of this container indicates loopback nature of the interface"; - when "../if:type = 'v3po:loopback'"; - uses loopback-interface-base-attributes; - } - - container ethernet { - when "../if:type = 'ianaift:ethernetCsmacd'"; - uses ethernet-base-attributes; - } - - container routing { - uses routing-base-attributes; - } - - container vhost-user { - when "../if:type = 'v3po:vhost-user'"; - uses vhost-user-interface-base-attributes; - uses vhost-user-interface-config-attributes; - } - - container vxlan { - when "../if:type = 'v3po:vxlan-tunnel'"; - uses vxlan-base-attributes; - } - - container gre { - when "../if:type = 'v3po:gre-tunnel'"; - uses gre-base-attributes; - } - - container l2 { - must "bridged-virtual-interface = 'true' or " + - "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " + - "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))"; - - uses l2-config-attributes; - } - - container vxlan-gpe { - when "../if:type = 'v3po:vxlan-gpe-tunnel'"; - - uses vxlan-gpe-base-attributes; - } - - container span { - uses span-attributes; - } - } - - container bridge-domains { - presence "Bridge domains configuration"; - list bridge-domain { - key "name"; - - leaf name { - type string; - } - - uses bridge-domain-attributes; - uses l2-fib-attributes; - - description - "bridge-domain configuration"; - } - } - - augment /if:interfaces-state/if:interface { - ext:augment-identifier "vpp-interface-state-augmentation"; - - leaf description { - type string; - } - - container tap { - when "../if:type = 'v3po:tap'"; - uses tap-interface-base-attributes; - } - - container ethernet { - when "../if:type = 'ianaift:ethernetCsmacd'"; - uses ethernet-base-attributes; - uses ethernet-state-attributes; - } - - container routing { - uses routing-base-attributes; - } - - container vhost-user { - when "../if:type = 'v3po:vhost-user'"; - uses vhost-user-interface-base-attributes; - uses vhost-user-interface-state-attributes; - } - - container vxlan { - when "../if:type = 'v3po:vxlan-tunnel'"; - uses vxlan-base-attributes; - } - container vxlan-gpe { - when "../if:type = 'v3po:vxlan-gpe-tunnel'"; - - uses vxlan-gpe-base-attributes; - } - - container gre { - when "../if:type = 'gre-tunnel'"; - uses gre-base-attributes; - } - - container l2 { - must "bridged-virtual-interface = 'true' or " + - "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " + - "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))"; - - uses l2-state-attributes; - } - - container span { - uses span-state-attributes; - } - } - - augment /if:interfaces-state/if:interface/if:statistics { - ext:augment-identifier "vpp-interface-statistics-augmentation"; - leaf in-errors-no-buf { - type yang:counter64; - } - leaf in-errors-miss { - type yang:counter64; - } - leaf out-discards-fifo-full { - type yang:counter64; - } - } - - container bridge-domains-state { - // FIXME: Should this live in bridge-domain.yang in a modular fashion ? - config "false"; - list bridge-domain { - - key "name"; - leaf name { - type string; - } - - uses bridge-domain-attributes; - uses l2-fib-attributes; - - description - "bridge-domain operational data"; - } - } - - // VPP Notifications - - typedef interface-status { - type enumeration { - enum up { - value 1; - } - enum down { - value 0; - } - } - } - - typedef interface-name-or-index { - type union { - type string; - type uint32; - } - } - - notification interface-state-change { - leaf name { - type interface-name-or-index; - } - - leaf admin-status { - type interface-status; - } - - leaf oper-status { - type interface-status; - } - } - - notification interface-deleted { - leaf name { - type interface-name-or-index; - } - } -} diff --git a/v3po/api/src/main/yang/v3po@2017-06-07.yang b/v3po/api/src/main/yang/v3po@2017-06-07.yang new file mode 100644 index 000000000..58ef0685a --- /dev/null +++ b/v3po/api/src/main/yang/v3po@2017-06-07.yang @@ -0,0 +1,785 @@ +module v3po { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:v3po"; + prefix "v3po"; + + revision "2017-06-07" { + description "Eliminated config leafrefs in operational tree"; + } + + revision "2017-03-15" { + description + "Revision changes: + - acl and ietf-acl moved to vpp-interface-acl + - vpp-state and rpc moved to vpp-management + - bridge domains moved to standalone container"; + } + + revision "2016-12-14" { + description + "This revision adds the following new features: + - ingress/egress ACLs support + - moved ACL definitions to vpp-acl module + - updated l2 container constraint (permit IP address on BVI interface) + - added PID of vpp process to vpp-state + - added support for Loopback interfaces + - added support for port mirroring"; + } + + revision "2015-01-05" { + description "Initial revision of v3po model"; + } + + import iana-if-type { + prefix "ianaift"; + } + import ietf-interfaces { + prefix "if"; + } + import ietf-yang-types { + prefix "yang"; + } + import ietf-inet-types { + prefix "inet"; + } + import ietf-ip { + prefix "ip"; + } + import yang-ext { + prefix "ext"; + } + + typedef bridge-domain-ref { + type leafref { + path "/bridge-domains/bridge-domain/name"; + } + description + "This type is used by to reference a bridge domain table"; + } + + typedef bridged-virtual-interface-ref { + type leafref { + path "/if:interfaces/if:interface/l2/bridged-virtual-interface"; + } + description + "This type is used by to reference a bridged virtual interface"; + } + + identity vxlan-tunnel { + base if:interface-type; + } + + identity gre-tunnel { + base if:interface-type; + } + + identity vhost-user { + base if:interface-type; + } + + identity tap { + base if:interface-type; + } + + identity loopback { + base if:interface-type; + } + + identity l2-fib-action { + description "Base identity for l2-fib actions"; + } + + identity l2-fib-forward { + base l2-fib-action; + description + "Forwards packet with configured mac address"; + } + + identity l2-fib-filter { + base l2-fib-action; + description + "Drops packet with configured mac address"; + } + + typedef l2-fib-action { + type identityref { + base "l2-fib-action"; + } + description "Identifies a specific L2 FIB action"; + } + + typedef vxlan-vni { + // FIXME: should be in a vxlan-specific model + description "VNI used in a VXLAN tunnel"; + type uint32 { + range "0..16777215"; + } + } + + typedef vhost-user-role { + type enumeration { + enum "server"; + enum "client"; + } + } + + identity vxlan-gpe-tunnel { + base if:interface-type; + } + + typedef vxlan-gpe-vni { + description "VNI used in a VXLAN-GPE tunnel"; + type uint32 { + range "0..16777215"; + } + } + + typedef vxlan-gpe-next-protocol { + type enumeration { + enum "ipv4" { + value 1; + } + enum "ipv6" { + value 2; + } + enum "ethernet" { + value 3; + } + enum "nsh" { + value 4; + } + } + } + + + typedef span-state { + type enumeration { + enum "receive" { + value "1"; + description + "Receive (Rx) SPAN—The goal of receive (or ingress) SPAN + is to monitor as much as possible all the packets received by the source interface. + A copy of each packet received by the source is sent to the destination port for that SPAN session. + You can monitor a series or range of ingress ports in a SPAN session."; + } + + enum "transmit" { + value "2"; + description + "Transmit (Tx) SPAN—The goal of transmit (or egress) SPAN is to monitor as much as possible all the packets + sent by the source interface after all modification and processing is performed by the switch. + A copy of each packet sent by the source is sent to the destination port for that SPAN session. + The copy is provided after the packet is modified. Monitors a range of egress ports in a SPAN session."; + } + + enum "both" { + value "3"; + description + "In a SPAN session, you can monitor a series or range of ports for both received and sent packets."; + } + } + } + + grouping bridge-domain-attributes { + leaf flood { + type boolean; + default true; + description + "Enable/disable L2 flooding."; + } + leaf forward { + type boolean; + default true; + description + "Enable/disable L2 forwarding."; + } + leaf learn { + type boolean; + default true; + description + "Enable/disable L2 learning."; + } + leaf unknown-unicast-flood { + type boolean; + default true; + } + leaf arp-termination { + type boolean; + default false; + } + + container arp-termination-table { + when "../v3po:arp-termination = 'true'"; + + // TODO(HONEYCOMB-133): add support for read (after VPP-230 is done) + list arp-termination-table-entry { + key "ip-address phys-address"; + leaf ip-address { + // FIXME: change to ip-address-no-zone after https://bugs.opendaylight.org/show_bug.cgi?id=6413 is resolved + type inet:ip-address; + } + leaf phys-address { + type yang:phys-address; + } + } + } + } + + // TODO express constraints for L2 FIB entries in YANG if possible + grouping l2-fib-attributes { + container l2-fib-table { + list l2-fib-entry { + key "phys-address"; + + leaf phys-address { + type yang:phys-address; + } + + leaf outgoing-interface { + // either filter must be specified or interface(can't be both) + when "../action != 'l2-fib-filter'"; + type if:interface-ref; + // mandatory true; - when is not actually resolved, so mandatory can't be in place + description + "One of interfaces assigned to the FIB table's bridge-domain."; + } + leaf static-config { + type boolean; + default false; + description + "Static entries cannot be overridden by mac learning."; + } + leaf action { + type l2-fib-action; + mandatory true; + description + "L2 FIB action. For filter action, entry must be configured as static."; + } + leaf bridged-virtual-interface { + when "../action = 'forward'"; + type boolean; + config false; // FIXME setting bvi is currently not supported by VPP's binary api + } + } + } + } + + grouping interface-tag { + leaf tag { + type string { + length 1..63; + } + description + "ASCII string placeholder for interface metadata. Value is stored in vpp, + and returned in read requests. No processing involved."; + } + } + + grouping tap-interface-base-attributes { + leaf tap-name { + type string{ + pattern "[a-zA-Z0-9\-;.+@$#^&*!_()=\[\]]*"; + } + } + uses interface-tag; + } + + grouping tap-interface-config-attributes { + leaf mac { + type yang:phys-address; + mandatory false; + description "Mac address to be set for the tap interface. Random will be used if not configured"; + } + + leaf device-instance { + type uint32; + mandatory false; + description "Custom device instance. Autogenerated will be used if not configured"; + } + } + + grouping loopback-interface-base-attributes { + leaf mac { + type yang:phys-address; + mandatory false; + description "Mac address of the loopback interface"; + } + } + + grouping ethernet-base-attributes { + leaf mtu { + type uint16 { + range "64..9216"; + } + units "octets"; + default 9216; + description + "The size, in octets, of the largest packet that the + hardware interface will send and receive."; + } + } + + grouping routing-base-attributes { + leaf ipv4-vrf-id { + type uint32; + } + leaf ipv6-vrf-id { + type uint32; + } + description + "Defines VRF tables used for ipv4 and ipv6 traffic"; + } + + grouping ethernet-state-attributes { + leaf manufacturer-description { + type string; + config false; + } + leaf duplex { + type enumeration { + enum "half"; + enum "full"; + } + config false; + } + } + + grouping vhost-user-interface-base-attributes { + leaf socket { + type string { + length 1..255; + } + } + leaf role { + type vhost-user-role; + default "server"; + } + uses interface-tag; + description "vhost-user settings"; + } + + grouping vhost-user-interface-config-attributes { + leaf device-instance { + type uint32; + mandatory false; + description "Custom device instance. Autogenerated will be used if not configured"; + } + description "vhost-user settings"; + } + + grouping vhost-user-interface-state-attributes { + leaf features { + type uint64; + config false; + } + leaf virtio-net-hdr-size { + type uint32; + config false; + } + leaf num-memory-regions { + type uint32; + config false; + } + leaf connect-error { + type string; + config false; + } + } + + /* + * Defines the supported decap node for vxlan. + */ + identity decap-node { + description + "Define the supported decap node"; + } + identity l2-input { + base decap-node; + description + "The next decap node is l2-input"; + } + identity nsh-proxy { + base decap-node; + description + "The next decap node is nsh-proxy"; + } + typedef vxlan-decap-node { + type identityref { + base "decap-node"; + } + } + grouping vxlan-base-attributes { + // FIXME: this should be in an vxlan-specific extension + leaf src { + /*mandatory true;*/ + type inet:ip-address; + } + leaf dst { + /*mandatory true;*/ + type inet:ip-address; + } + leaf vni { + /*mandatory true;*/ + type vxlan-vni; + } + leaf encap-vrf-id { + type uint32; + } + leaf decap-next { + type vxlan-decap-node; + default "l2-input"; + } + } + + grouping gre-base-attributes { + leaf src { + /*mandatory true;*/ + type inet:ip-address; + } + leaf dst { + /*mandatory true;*/ + type inet:ip-address; + } + leaf outer-fib-id { + type uint32; + } + } + + grouping vxlan-gpe-base-attributes { + leaf local { + /*mandatory true;*/ + type inet:ip-address; + } + leaf remote { + /*mandatory true;*/ + type inet:ip-address; + } + leaf vni { + /*mandatory true;*/ + type vxlan-gpe-vni; + } + leaf next-protocol { + type vxlan-gpe-next-protocol; + } + leaf encap-vrf-id { + type uint32; + } + leaf decap-vrf-id { + type uint32; + } + } + + grouping l2-config-attributes { + description + "Parameters for configuring Layer2 features on interfaces."; + + choice interconnection { + case xconnect-based { + leaf xconnect-outgoing-interface { + /* Don't allow selection of this interface */ + must "../../if:name != current()"; + type if:interface-ref; + description + "L2 xconnect mode"; + } + } + case bridge-based { + uses bridge-based-attributes; + } + } + } + + grouping l2-state-attributes { + description + "Parameters for configuring Layer2 features on interfaces."; + + choice interconnection { + case xconnect-based { + leaf xconnect-outgoing-interface { + /* Don't allow selection of this interface */ + must "../../if:name != current()"; + type if:interface-state-ref; + description + "L2 xconnect mode"; + } + } + case bridge-based { + uses bridge-based-attributes; + } + } + } + + grouping bridge-based-attributes { + leaf bridge-domain { + type bridge-domain-ref; + mandatory true; + description + "Interfaces in a bridge-domain forward packets to other + interfaces in the same bridge-domain based on + destination mac address."; + } + leaf split-horizon-group { + when "../bridge-domain"; + type uint8 { + range "0..255"; + } + default 0; //no split horizon group + description + "Interface's split-horizon group. Interfaces in the same + bridge-domain and split-horizon group can not forward + packets between each other. "; + } + leaf bridged-virtual-interface { + when "../bridge-domain"; + type boolean; + default false; + description + "Interface forward packets in the bridge-domain + associated with the BVI."; + } + } + + grouping span-attributes { + description "Parameters of the SPAN feature"; + + container mirrored-interfaces { + list mirrored-interface { + key "iface-ref"; + leaf iface-ref { + type if:interface-ref; + } + + leaf state { + type span-state; + mandatory true; + } + } + } + } + + grouping span-state-attributes { + description "Parameters of the SPAN feature"; + + container mirrored-interfaces { + list mirrored-interface { + key "iface-ref"; + leaf iface-ref { + type if:interface-state-ref; + } + + leaf state { + type span-state; + mandatory true; + } + } + } + } + + augment /if:interfaces/if:interface { + ext:augment-identifier "vpp-interface-augmentation"; + + // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because: + // 1. The link between interface type and this augmentation is unclear + // 2. Only this augmentation with combination of ifc type is trigger to do something for vpp, what if user only configures base interface stuff ? + We need to get leaves defined by ietf-interfaces when we are processing this augment + // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult + + container tap { + when "../if:type = 'v3po:tap'"; + uses tap-interface-base-attributes; + uses tap-interface-config-attributes; + } + + container loopback { + presence "Presence of this container indicates loopback nature of the interface"; + when "../if:type = 'v3po:loopback'"; + uses loopback-interface-base-attributes; + } + + container ethernet { + when "../if:type = 'ianaift:ethernetCsmacd'"; + uses ethernet-base-attributes; + } + + container routing { + uses routing-base-attributes; + } + + container vhost-user { + when "../if:type = 'v3po:vhost-user'"; + uses vhost-user-interface-base-attributes; + uses vhost-user-interface-config-attributes; + } + + container vxlan { + when "../if:type = 'v3po:vxlan-tunnel'"; + uses vxlan-base-attributes; + } + + container gre { + when "../if:type = 'v3po:gre-tunnel'"; + uses gre-base-attributes; + } + + container l2 { + must "bridged-virtual-interface = 'true' or " + + "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " + + "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))"; + + uses l2-config-attributes; + } + + container vxlan-gpe { + when "../if:type = 'v3po:vxlan-gpe-tunnel'"; + + uses vxlan-gpe-base-attributes; + } + + container span { + uses span-attributes; + } + } + + container bridge-domains { + presence "Bridge domains configuration"; + list bridge-domain { + key "name"; + + leaf name { + type string; + } + + uses bridge-domain-attributes; + uses l2-fib-attributes; + + description + "bridge-domain configuration"; + } + } + + augment /if:interfaces-state/if:interface { + ext:augment-identifier "vpp-interface-state-augmentation"; + + leaf description { + type string; + } + + container tap { + when "../if:type = 'v3po:tap'"; + uses tap-interface-base-attributes; + } + + container ethernet { + when "../if:type = 'ianaift:ethernetCsmacd'"; + uses ethernet-base-attributes; + uses ethernet-state-attributes; + } + + container routing { + uses routing-base-attributes; + } + + container vhost-user { + when "../if:type = 'v3po:vhost-user'"; + uses vhost-user-interface-base-attributes; + uses vhost-user-interface-state-attributes; + } + + container vxlan { + when "../if:type = 'v3po:vxlan-tunnel'"; + uses vxlan-base-attributes; + } + container vxlan-gpe { + when "../if:type = 'v3po:vxlan-gpe-tunnel'"; + + uses vxlan-gpe-base-attributes; + } + + container gre { + when "../if:type = 'gre-tunnel'"; + uses gre-base-attributes; + } + + container l2 { + must "bridged-virtual-interface = 'true' or " + + "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " + + "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))"; + + uses l2-state-attributes; + } + + container span { + uses span-state-attributes; + } + } + + augment /if:interfaces-state/if:interface/if:statistics { + ext:augment-identifier "vpp-interface-statistics-augmentation"; + leaf in-errors-no-buf { + type yang:counter64; + } + leaf in-errors-miss { + type yang:counter64; + } + leaf out-discards-fifo-full { + type yang:counter64; + } + } + + container bridge-domains-state { + // FIXME: Should this live in bridge-domain.yang in a modular fashion ? + config "false"; + list bridge-domain { + + key "name"; + leaf name { + type string; + } + + uses bridge-domain-attributes; + uses l2-fib-attributes; + + description + "bridge-domain operational data"; + } + } + + // VPP Notifications + + typedef interface-status { + type enumeration { + enum up { + value 1; + } + enum down { + value 0; + } + } + } + + typedef interface-name-or-index { + type union { + type string; + type uint32; + } + } + + notification interface-state-change { + leaf name { + type interface-name-or-index; + } + + leaf admin-status { + type interface-status; + } + + leaf oper-status { + type interface-status; + } + } + + notification interface-deleted { + leaf name { + type interface-name-or-index; + } + } +} diff --git a/v3po/api/src/main/yang/vpp-pbb.yang b/v3po/api/src/main/yang/vpp-pbb.yang deleted file mode 100644 index d3ca160ce..000000000 --- a/v3po/api/src/main/yang/vpp-pbb.yang +++ /dev/null @@ -1,32 +0,0 @@ -module vpp-pbb { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:vpp-pbb"; - prefix "vpp-pbb"; - - revision "2016-12-14" { - description "Initial revision of pbb model"; - } - - import pbb-types { - prefix "pbb-types"; - } - - import yang-ext { - prefix "ext"; - } - - augment /if:interfaces/if:interface { - ext:augment-identifier "pbb-rewrite-interface-augmentation"; - container pbb-rewrite{ - uses pbb-types:pbb-rewrite-attributes; - } - } - - augment /if:interfaces-state/if:interface { - ext:augment-identifier "pbb-rewrite-state-interface-augmentation"; - container pbb-rewrite-state{ - uses pbb-types:pbb-rewrite-attributes; - config false; - } - } -} \ No newline at end of file diff --git a/v3po/api/src/main/yang/vpp-pbb@2016-12-14.yang b/v3po/api/src/main/yang/vpp-pbb@2016-12-14.yang new file mode 100644 index 000000000..d3ca160ce --- /dev/null +++ b/v3po/api/src/main/yang/vpp-pbb@2016-12-14.yang @@ -0,0 +1,32 @@ +module vpp-pbb { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:vpp-pbb"; + prefix "vpp-pbb"; + + revision "2016-12-14" { + description "Initial revision of pbb model"; + } + + import pbb-types { + prefix "pbb-types"; + } + + import yang-ext { + prefix "ext"; + } + + augment /if:interfaces/if:interface { + ext:augment-identifier "pbb-rewrite-interface-augmentation"; + container pbb-rewrite{ + uses pbb-types:pbb-rewrite-attributes; + } + } + + augment /if:interfaces-state/if:interface { + ext:augment-identifier "pbb-rewrite-state-interface-augmentation"; + container pbb-rewrite-state{ + uses pbb-types:pbb-rewrite-attributes; + config false; + } + } +} \ No newline at end of file diff --git a/v3po/api/src/main/yang/vpp-vlan.yang b/v3po/api/src/main/yang/vpp-vlan.yang deleted file mode 100644 index 5999a2850..000000000 --- a/v3po/api/src/main/yang/vpp-vlan.yang +++ /dev/null @@ -1,461 +0,0 @@ -module vpp-vlan { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:vpp:vlan"; - prefix "vpp-vlan"; - - revision "2017-05-09" { - description "Revision changes: - - add support for ipv4/6 vrf id for sub interfaces"; - } - - revision "2017-03-15" { - description - "Revision changes: - - acl and ietf-acl moved to vpp-subinterface-acl"; - } - - revision "2016-12-14" { - description - "This revision adds the following new features: - - ingress/egress ACLs support"; - } - - revision "2015-05-27" { - description - "Initial revision of vlan model for VPP. - Reuses some concepts from draft-wilton-netmod-intf-vlan-yang-02 model."; - } - - revision "2017-06-07" { - description "Eliminated config leafrefs in operational tree"; - } - - import ietf-interfaces { - prefix "if"; - } - import ietf-inet-types { - prefix inet; - } - import ietf-yang-types { - prefix "yang"; - } - import yang-ext { - prefix "ext"; - } - import dot1q-types { - prefix dot1q; - } - import v3po { - prefix v3po; - } - - typedef sub-interface-status { - type enumeration { - enum "up"; - enum "down"; - } - } - - // todo add 802dot1ad support to dot1q-types.yang - /* - * Defines the supported IEEE 802.1Q types that can be used for - * VLAN tag matching. - */ - identity vlan-type { - description "Base identity from which all VLAN types - are derived from"; - } - - identity 802dot1q { - base vlan-type; - description - "An 802.1Q VLAN type"; - } - - identity 802dot1ad { - base vlan-type; - description - "An 802.1ad VLAN type"; - } - - typedef vlan-type { - type identityref { - base "vlan-type"; - } - description "Identifies a specific VLAN type"; - } - - grouping match-attributes { - choice match-type { - mandatory true; - description "Provides a choice of how the frames may be matched"; - - case default { - description "Default match"; - leaf default { - type empty; - description - "Default match. Matches all traffic not matched to any - other peer sub-interface by a more specific - encapsulation."; - } // leaf default - } // case default - - case untagged { - description "Match untagged Ethernet frames only"; - leaf untagged { - type empty; - description - "Untagged match. Matches all untagged traffic."; - } // leaf untagged - } // case untagged - - case vlan-tagged { - container vlan-tagged { - description "Matches VLAN tagged frames. Vlan tags need to be specified to use this match type"; - - leaf match-exact-tags { - type boolean; - default true; - description - "If set, indicates that all 802.1Q VLAN tags in the - Ethernet frame header must be explicitly matched, i.e. - the EtherType following the matched tags must not be a - 802.1Q tag EtherType. If unset then extra 802.1Q VLAN - tags are allowed."; - } - } // container vlan-tagged - } // case vlan-tagged - } - } - - // TODO VPP does not allow to change subinterface nor delete it (except for tag-rewrite operation) - grouping sub-interface-base-attributes { - leaf vlan-type { - type vlan-type; - default 802dot1q; - } - - container tags { - list tag { - key "index"; - max-elements 2; - - description "The VLAN tags to use by locally sourced traffic"; - - leaf index { - type uint8 { - range "0..1"; - } - - /* - * Only allow a push of an inner tag if an outer tag is also - * being pushed. - */ - must "index != 0 or - count(../../push-tags[index = 0]/index) > 0" { - error-message "An inner tag can only be pushed if an outer - tag is also specified"; - description "Only allow a push of an inner tag if an outer - tag is also being pushed"; - } - description "The index into the tag stack"; - } - - uses dot1q:dot1q-tag-or-any; - - } - } - - container match { - description - "The match used to classify frames to this interface"; - uses match-attributes; - } - } - - grouping rewrite-attributes { - container rewrite { - uses tag-rewrite; - } - } - - grouping sub-interface-l2-config-attributes { - container l2 { - uses v3po:l2-config-attributes; - uses rewrite-attributes; - } - } - - grouping sub-interface-l2-state-attributes { - container l2 { - uses v3po:l2-state-attributes; - uses rewrite-attributes; - } - } - - grouping sub-interface-config-attributes { - leaf enabled { - type boolean; - default "false"; - description - "Contains the configured, desired state of the sub-interface. - To enable sub-interface, the super inerface needs to be enabled"; - } - } - - grouping sub-interface-operational-attributes { - leaf admin-status { - type sub-interface-status; - mandatory true; - } - leaf oper-status { - type sub-interface-status; - mandatory true; - } - leaf if-index { - type int32 { - range "1..2147483647"; - } - mandatory true; - } - leaf phys-address { - type yang:phys-address; - description - "The sub-interface's Media Access Control (MAC) address."; - } - leaf speed { - type yang:gauge64; - units "bits/second"; - } - } - - /* - * Only symetrical rewrite is supported - */ - grouping tag-rewrite { - description "Flexible rewrite"; - - leaf vlan-type { // todo rename to push_dot1q, mandatory(?) with default true - type vlan-type; - default 802dot1q; - } - - leaf pop-tags { - type uint8 { - range 1..2; - } - description "The number of tags to pop (or translate if used in - conjunction with push-tags)"; - } - - list push-tags { - key "index"; - max-elements 2; - description "The number of tags to push (or translate if used - in conjunction with pop-tags)"; - /* - * Server should order by increasing index. - */ - leaf index { - type uint8 { - range 0..1; - } - - /* - * Only allow a push of an inner tag if an outer tag is also - * being pushed. - */ - must "index != 0 or - count(../../push-tags[index = 0]/index) > 0" { - error-message "An inner tag can only be pushed if an outer - tag is also specified"; - description "Only allow a push of an inner tag if an outer - tag is also being pushed"; - } - } - - uses dot1q:dot1q-tag; - } - } - - grouping sub-interface-ip4-attributes { - container ipv4 { - // TODO: add currently unsupported: - // enabled, forwarding, mtu, address/origin(config false), neighbor/origin(config false) - - // TODO: reuse groupings once ietf-ip provides them - - description - "Parameters for the IPv4 address family (based on ietf-ip rev. 2014-06-16)"; - - list address { - key "ip"; - description - "The list of configured IPv4 addresses on the interface."; - leaf ip { - type inet:ipv4-address-no-zone; - description - "The IPv4 address on the interface."; - } - - choice subnet { - mandatory true; - description - "The subnet can be specified as a prefix-length, or, - if the server supports non-contiguous netmasks, as - a netmask."; - leaf prefix-length { - type uint8 { - range "0..32"; - } - description - "The length of the subnet prefix."; - } - leaf netmask { - type yang:dotted-quad; - description - "The subnet specified as a netmask (contiguous)"; - } - } // choice subnet - } // list address - - list neighbor { - key "ip"; - description - "A list of mappings from IPv4 addresses to - link-layer addresses. - - Entries in this list are used as static entries in the - ARP Cache."; - reference - "RFC 826: An Ethernet Address Resolution Protocol"; - - leaf ip { - type inet:ipv4-address-no-zone; - description - "The IPv4 address of the neighbor node."; - } - - leaf link-layer-address { - type yang:phys-address; - mandatory true; - description - "The link-layer address of the neighbor node."; - } - } // list neighbor - } - } - - grouping sub-interface-ip6-attributes { - container ipv6 { - // TODO: add currently unsupported: - // enabled, forwarding, mtu, neighbor, dup-addr-detect-transmits, autoconf, - // address(config false): origin, status - // neighbor(config false): origin, is-router, state - - // TODO: reuse groupings once ietf-ip provides them - - description - "Parameters for the IPv6 address family (based on ietf-ip rev. 2014-06-16)"; - - list address { - key "ip"; - description - "The list of configured IPv6 addresses on the interface."; - leaf ip { - type inet:ipv6-address-no-zone; - description - "The IPv6 address on the interface."; - } - - leaf prefix-length { - type uint8 { - range "0..128"; - } - mandatory true; - description - "The length of the subnet prefix."; - } - } // list address - - list neighbor { - key "ip"; - description - "A list of mappings from IPv6 addresses to - link-layer addresses. - - Entries in this list are used as static entries in the - Neighbor Cache."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)"; - - leaf ip { - type inet:ipv6-address-no-zone; - description - "The IPv6 address of the neighbor node."; - } - - leaf link-layer-address { - type yang:phys-address; - mandatory true; - description - "The link-layer address of the neighbor node."; - } - } // list neighbor - } - } - - grouping sub-interface-routing-attributes { - description "Provides basic attributes for ipv4/6 vrf configuration"; - container routing { - uses v3po:routing-base-attributes; - } - } - - augment /if:interfaces/if:interface { - ext:augment-identifier "subinterface-augmentation"; - - container sub-interfaces { - description "L2 vlan subinterfaces"; - - - list sub-interface { - key "identifier"; - leaf identifier { - type uint32; - } - - uses sub-interface-base-attributes; - uses sub-interface-config-attributes; - uses sub-interface-ip4-attributes; - uses sub-interface-ip6-attributes; - uses sub-interface-routing-attributes; - uses sub-interface-l2-config-attributes; - } - } - } - - augment /if:interfaces-state/if:interface { - ext:augment-identifier "subinterface-state-augmentation"; - - container sub-interfaces { - description "L2 vlan subinterfaces"; - - list sub-interface { - key "identifier"; - leaf identifier { - type uint32; - } - - uses sub-interface-base-attributes; - uses sub-interface-operational-attributes; - uses sub-interface-ip4-attributes; - uses sub-interface-ip6-attributes; - uses sub-interface-routing-attributes; - uses sub-interface-l2-state-attributes; - } - } - } - -} diff --git a/v3po/api/src/main/yang/vpp-vlan@2017-06-07.yang b/v3po/api/src/main/yang/vpp-vlan@2017-06-07.yang new file mode 100644 index 000000000..7c77a05b0 --- /dev/null +++ b/v3po/api/src/main/yang/vpp-vlan@2017-06-07.yang @@ -0,0 +1,461 @@ +module vpp-vlan { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:vpp:vlan"; + prefix "vpp-vlan"; + + revision "2017-06-07" { + description "Eliminated config leafrefs in operational tree"; + } + + revision "2017-05-09" { + description "Revision changes: + - add support for ipv4/6 vrf id for sub interfaces"; + } + + revision "2017-03-15" { + description + "Revision changes: + - acl and ietf-acl moved to vpp-subinterface-acl"; + } + + revision "2016-12-14" { + description + "This revision adds the following new features: + - ingress/egress ACLs support"; + } + + revision "2015-05-27" { + description + "Initial revision of vlan model for VPP. + Reuses some concepts from draft-wilton-netmod-intf-vlan-yang-02 model."; + } + + import ietf-interfaces { + prefix "if"; + } + import ietf-inet-types { + prefix inet; + } + import ietf-yang-types { + prefix "yang"; + } + import yang-ext { + prefix "ext"; + } + import dot1q-types { + prefix dot1q; + } + import v3po { + prefix v3po; + } + + typedef sub-interface-status { + type enumeration { + enum "up"; + enum "down"; + } + } + + // todo add 802dot1ad support to dot1q-types.yang + /* + * Defines the supported IEEE 802.1Q types that can be used for + * VLAN tag matching. + */ + identity vlan-type { + description "Base identity from which all VLAN types + are derived from"; + } + + identity 802dot1q { + base vlan-type; + description + "An 802.1Q VLAN type"; + } + + identity 802dot1ad { + base vlan-type; + description + "An 802.1ad VLAN type"; + } + + typedef vlan-type { + type identityref { + base "vlan-type"; + } + description "Identifies a specific VLAN type"; + } + + grouping match-attributes { + choice match-type { + mandatory true; + description "Provides a choice of how the frames may be matched"; + + case default { + description "Default match"; + leaf default { + type empty; + description + "Default match. Matches all traffic not matched to any + other peer sub-interface by a more specific + encapsulation."; + } // leaf default + } // case default + + case untagged { + description "Match untagged Ethernet frames only"; + leaf untagged { + type empty; + description + "Untagged match. Matches all untagged traffic."; + } // leaf untagged + } // case untagged + + case vlan-tagged { + container vlan-tagged { + description "Matches VLAN tagged frames. Vlan tags need to be specified to use this match type"; + + leaf match-exact-tags { + type boolean; + default true; + description + "If set, indicates that all 802.1Q VLAN tags in the + Ethernet frame header must be explicitly matched, i.e. + the EtherType following the matched tags must not be a + 802.1Q tag EtherType. If unset then extra 802.1Q VLAN + tags are allowed."; + } + } // container vlan-tagged + } // case vlan-tagged + } + } + + // TODO VPP does not allow to change subinterface nor delete it (except for tag-rewrite operation) + grouping sub-interface-base-attributes { + leaf vlan-type { + type vlan-type; + default 802dot1q; + } + + container tags { + list tag { + key "index"; + max-elements 2; + + description "The VLAN tags to use by locally sourced traffic"; + + leaf index { + type uint8 { + range "0..1"; + } + + /* + * Only allow a push of an inner tag if an outer tag is also + * being pushed. + */ + must "index != 0 or + count(../../push-tags[index = 0]/index) > 0" { + error-message "An inner tag can only be pushed if an outer + tag is also specified"; + description "Only allow a push of an inner tag if an outer + tag is also being pushed"; + } + description "The index into the tag stack"; + } + + uses dot1q:dot1q-tag-or-any; + + } + } + + container match { + description + "The match used to classify frames to this interface"; + uses match-attributes; + } + } + + grouping rewrite-attributes { + container rewrite { + uses tag-rewrite; + } + } + + grouping sub-interface-l2-config-attributes { + container l2 { + uses v3po:l2-config-attributes; + uses rewrite-attributes; + } + } + + grouping sub-interface-l2-state-attributes { + container l2 { + uses v3po:l2-state-attributes; + uses rewrite-attributes; + } + } + + grouping sub-interface-config-attributes { + leaf enabled { + type boolean; + default "false"; + description + "Contains the configured, desired state of the sub-interface. + To enable sub-interface, the super inerface needs to be enabled"; + } + } + + grouping sub-interface-operational-attributes { + leaf admin-status { + type sub-interface-status; + mandatory true; + } + leaf oper-status { + type sub-interface-status; + mandatory true; + } + leaf if-index { + type int32 { + range "1..2147483647"; + } + mandatory true; + } + leaf phys-address { + type yang:phys-address; + description + "The sub-interface's Media Access Control (MAC) address."; + } + leaf speed { + type yang:gauge64; + units "bits/second"; + } + } + + /* + * Only symetrical rewrite is supported + */ + grouping tag-rewrite { + description "Flexible rewrite"; + + leaf vlan-type { // todo rename to push_dot1q, mandatory(?) with default true + type vlan-type; + default 802dot1q; + } + + leaf pop-tags { + type uint8 { + range 1..2; + } + description "The number of tags to pop (or translate if used in + conjunction with push-tags)"; + } + + list push-tags { + key "index"; + max-elements 2; + description "The number of tags to push (or translate if used + in conjunction with pop-tags)"; + /* + * Server should order by increasing index. + */ + leaf index { + type uint8 { + range 0..1; + } + + /* + * Only allow a push of an inner tag if an outer tag is also + * being pushed. + */ + must "index != 0 or + count(../../push-tags[index = 0]/index) > 0" { + error-message "An inner tag can only be pushed if an outer + tag is also specified"; + description "Only allow a push of an inner tag if an outer + tag is also being pushed"; + } + } + + uses dot1q:dot1q-tag; + } + } + + grouping sub-interface-ip4-attributes { + container ipv4 { + // TODO: add currently unsupported: + // enabled, forwarding, mtu, address/origin(config false), neighbor/origin(config false) + + // TODO: reuse groupings once ietf-ip provides them + + description + "Parameters for the IPv4 address family (based on ietf-ip rev. 2014-06-16)"; + + list address { + key "ip"; + description + "The list of configured IPv4 addresses on the interface."; + leaf ip { + type inet:ipv4-address-no-zone; + description + "The IPv4 address on the interface."; + } + + choice subnet { + mandatory true; + description + "The subnet can be specified as a prefix-length, or, + if the server supports non-contiguous netmasks, as + a netmask."; + leaf prefix-length { + type uint8 { + range "0..32"; + } + description + "The length of the subnet prefix."; + } + leaf netmask { + type yang:dotted-quad; + description + "The subnet specified as a netmask (contiguous)"; + } + } // choice subnet + } // list address + + list neighbor { + key "ip"; + description + "A list of mappings from IPv4 addresses to + link-layer addresses. + + Entries in this list are used as static entries in the + ARP Cache."; + reference + "RFC 826: An Ethernet Address Resolution Protocol"; + + leaf ip { + type inet:ipv4-address-no-zone; + description + "The IPv4 address of the neighbor node."; + } + + leaf link-layer-address { + type yang:phys-address; + mandatory true; + description + "The link-layer address of the neighbor node."; + } + } // list neighbor + } + } + + grouping sub-interface-ip6-attributes { + container ipv6 { + // TODO: add currently unsupported: + // enabled, forwarding, mtu, neighbor, dup-addr-detect-transmits, autoconf, + // address(config false): origin, status + // neighbor(config false): origin, is-router, state + + // TODO: reuse groupings once ietf-ip provides them + + description + "Parameters for the IPv6 address family (based on ietf-ip rev. 2014-06-16)"; + + list address { + key "ip"; + description + "The list of configured IPv6 addresses on the interface."; + leaf ip { + type inet:ipv6-address-no-zone; + description + "The IPv6 address on the interface."; + } + + leaf prefix-length { + type uint8 { + range "0..128"; + } + mandatory true; + description + "The length of the subnet prefix."; + } + } // list address + + list neighbor { + key "ip"; + description + "A list of mappings from IPv6 addresses to + link-layer addresses. + + Entries in this list are used as static entries in the + Neighbor Cache."; + reference + "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)"; + + leaf ip { + type inet:ipv6-address-no-zone; + description + "The IPv6 address of the neighbor node."; + } + + leaf link-layer-address { + type yang:phys-address; + mandatory true; + description + "The link-layer address of the neighbor node."; + } + } // list neighbor + } + } + + grouping sub-interface-routing-attributes { + description "Provides basic attributes for ipv4/6 vrf configuration"; + container routing { + uses v3po:routing-base-attributes; + } + } + + augment /if:interfaces/if:interface { + ext:augment-identifier "subinterface-augmentation"; + + container sub-interfaces { + description "L2 vlan subinterfaces"; + + + list sub-interface { + key "identifier"; + leaf identifier { + type uint32; + } + + uses sub-interface-base-attributes; + uses sub-interface-config-attributes; + uses sub-interface-ip4-attributes; + uses sub-interface-ip6-attributes; + uses sub-interface-routing-attributes; + uses sub-interface-l2-config-attributes; + } + } + } + + augment /if:interfaces-state/if:interface { + ext:augment-identifier "subinterface-state-augmentation"; + + container sub-interfaces { + description "L2 vlan subinterfaces"; + + list sub-interface { + key "identifier"; + leaf identifier { + type uint32; + } + + uses sub-interface-base-attributes; + uses sub-interface-operational-attributes; + uses sub-interface-ip4-attributes; + uses sub-interface-ip6-attributes; + uses sub-interface-routing-attributes; + uses sub-interface-l2-state-attributes; + } + } + } + +} 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 diff --git a/vpp-common/naming-context-api/src/main/yang/multi-naming-context.yang b/vpp-common/naming-context-api/src/main/yang/multi-naming-context.yang deleted file mode 100644 index 23079601a..000000000 --- a/vpp-common/naming-context-api/src/main/yang/multi-naming-context.yang +++ /dev/null @@ -1,68 +0,0 @@ -module multi-naming-context { - yang-version 1; - namespace "urn:honeycomb:params:xml:ns:yang:multi:naming:context"; - prefix "mnc"; - - description - "This module contains data definition for naming multi-mapping context"; - - import naming-context { - prefix "nc"; - } - - import yang-ext { - prefix "ext"; - } - - - revision "2016-4-11" { - description - "Initial revision."; - } - - - grouping multi-naming-contexts-attributes{ - container multi-naming-contexts { - config false; - // context data - - list multi-naming { - - key "name"; - - leaf name { - type string; - } - - container mappings { - list mapping { - - key "name"; - - leaf name { - type string; - } - - list value{ - key "name"; - - unique "index"; - leaf index { - type int32; - } - - leaf name { - type string; - } - } - } - } - } - } - } - - augment /nc:contexts { - ext:augment-identifier "multi-mapping-ctx-augmentation"; - uses multi-naming-contexts-attributes; - } -} \ No newline at end of file diff --git a/vpp-common/naming-context-api/src/main/yang/multi-naming-context@2016-4-11.yang b/vpp-common/naming-context-api/src/main/yang/multi-naming-context@2016-4-11.yang new file mode 100644 index 000000000..23079601a --- /dev/null +++ b/vpp-common/naming-context-api/src/main/yang/multi-naming-context@2016-4-11.yang @@ -0,0 +1,68 @@ +module multi-naming-context { + yang-version 1; + namespace "urn:honeycomb:params:xml:ns:yang:multi:naming:context"; + prefix "mnc"; + + description + "This module contains data definition for naming multi-mapping context"; + + import naming-context { + prefix "nc"; + } + + import yang-ext { + prefix "ext"; + } + + + revision "2016-4-11" { + description + "Initial revision."; + } + + + grouping multi-naming-contexts-attributes{ + container multi-naming-contexts { + config false; + // context data + + list multi-naming { + + key "name"; + + leaf name { + type string; + } + + container mappings { + list mapping { + + key "name"; + + leaf name { + type string; + } + + list value{ + key "name"; + + unique "index"; + leaf index { + type int32; + } + + leaf name { + type string; + } + } + } + } + } + } + } + + augment /nc:contexts { + ext:augment-identifier "multi-mapping-ctx-augmentation"; + uses multi-naming-contexts-attributes; + } +} \ No newline at end of file diff --git a/vpp-common/naming-context-api/src/main/yang/naming-context.yang b/vpp-common/naming-context-api/src/main/yang/naming-context.yang deleted file mode 100644 index c101b5c26..000000000 --- a/vpp-common/naming-context-api/src/main/yang/naming-context.yang +++ /dev/null @@ -1,44 +0,0 @@ -module naming-context { - yang-version 1; - namespace "urn:honeycomb:params:xml:ns:yang:naming:context"; - prefix "nc"; - - description - "This module contains data definition for naming mapping context"; - - revision "2016-05-13" { - description - "Initial revision."; - } - - container contexts { - config false; - // context data - - list naming-context { - - key "name"; - - leaf name { - type string; - } - - container mappings { - list mapping { - - key "name"; - unique "index"; - - leaf name { - type string; - } - - leaf index { - type int32; - } - } - } - } - } - -} \ No newline at end of file diff --git a/vpp-common/naming-context-api/src/main/yang/naming-context@2016-05-13.yang b/vpp-common/naming-context-api/src/main/yang/naming-context@2016-05-13.yang new file mode 100644 index 000000000..c101b5c26 --- /dev/null +++ b/vpp-common/naming-context-api/src/main/yang/naming-context@2016-05-13.yang @@ -0,0 +1,44 @@ +module naming-context { + yang-version 1; + namespace "urn:honeycomb:params:xml:ns:yang:naming:context"; + prefix "nc"; + + description + "This module contains data definition for naming mapping context"; + + revision "2016-05-13" { + description + "Initial revision."; + } + + container contexts { + config false; + // context data + + list naming-context { + + key "name"; + + leaf name { + type string; + } + + container mappings { + list mapping { + + key "name"; + unique "index"; + + leaf name { + type string; + } + + leaf index { + type int32; + } + } + } + } + } + +} \ No newline at end of file diff --git a/vpp-management/api/src/main/yang/vpp-management.yang b/vpp-management/api/src/main/yang/vpp-management.yang deleted file mode 100644 index 2582cbea4..000000000 --- a/vpp-management/api/src/main/yang/vpp-management.yang +++ /dev/null @@ -1,54 +0,0 @@ -module vpp-management { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:vpp:management"; - prefix "vpp-m"; - - revision "2017-03-15" { - description - "This revision add support for - - Vpp state attributes read - - RPC cli support"; - } - - container vpp-state { - config false; - - description - "VPP operational data"; - - container version { - leaf name { - type string; - } - leaf build-directory { - type string; - } - leaf build-date { - type string; - } - leaf branch { - type string; - } - leaf pid { - type uint32; - description - "PID of the vpp process"; - } - description - "vlib version info"; - } - } - - rpc cli-inband { - input { - leaf cmd { - type string; - } - } - output { - leaf reply { - type string; - } - } - } -} \ No newline at end of file diff --git a/vpp-management/api/src/main/yang/vpp-management@2017-03-15.yang b/vpp-management/api/src/main/yang/vpp-management@2017-03-15.yang new file mode 100644 index 000000000..2582cbea4 --- /dev/null +++ b/vpp-management/api/src/main/yang/vpp-management@2017-03-15.yang @@ -0,0 +1,54 @@ +module vpp-management { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:vpp:management"; + prefix "vpp-m"; + + revision "2017-03-15" { + description + "This revision add support for + - Vpp state attributes read + - RPC cli support"; + } + + container vpp-state { + config false; + + description + "VPP operational data"; + + container version { + leaf name { + type string; + } + leaf build-directory { + type string; + } + leaf build-date { + type string; + } + leaf branch { + type string; + } + leaf pid { + type uint32; + description + "PID of the vpp process"; + } + description + "vlib version info"; + } + } + + rpc cli-inband { + input { + leaf cmd { + type string; + } + } + output { + leaf reply { + type string; + } + } + } +} \ No newline at end of file -- cgit 1.2.3-korg