From a520fc7fa1c5f4c23eb3090e26556d092d074002 Mon Sep 17 00:00:00 2001 From: "vermagan@cisco.com" Date: Wed, 21 Oct 2015 00:25:35 -0700 Subject: [PATCH] Merging lcal address with lisp-address. Change-Id: I0c3b973d010431f53568ee1c944f7c2c426a22f2 Signed-off-by: vermagan@cisco.com --- .../src/main/yang/lisp-address-types.yang | 221 ++++++++---------- 1 file changed, 101 insertions(+), 120 deletions(-) diff --git a/mappingservice/lisp-proto/src/main/yang/lisp-address-types.yang b/mappingservice/lisp-proto/src/main/yang/lisp-address-types.yang index 944b9d045..a2ba43c8e 100644 --- a/mappingservice/lisp-proto/src/main/yang/lisp-address-types.yang +++ b/mappingservice/lisp-proto/src/main/yang/lisp-address-types.yang @@ -178,7 +178,7 @@ module lisp-address-types { description "Defines the range of values for an Instance ID."; } - typedef distinguished-name-type { + typedef distinguished-name-type { type string; description "Distinguished Name address."; @@ -197,6 +197,7 @@ module lisp-address-types { description "Union of address types that can be part of LCAFs."; } + typedef lisp-address-family-ref { type identityref { base lisp-address-family; @@ -211,19 +212,99 @@ module lisp-address-types { description "LCAF types reference."; } - grouping lcaf-address { + + grouping lisp-address { description - "Group of all the LCAF types."; - leaf lcaf-type { - type lcaf-ref; + "Generic LISP address."; + leaf address-type { + type lisp-address-family-ref; mandatory true; description - "Enumeration of LCAF types."; + "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 "The LCAF addresses."; + 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 "../../lcaf-type = null-address-lcaf" { + when "../../address-type = 'null-address-lcaf'" { description "When LCAF type is null."; } @@ -236,7 +317,7 @@ module lisp-address-types { } } container afi-list { - when "../../lcaf-type = afi-list-lcaf" { + when "../../address-type = 'afi-list-lcaf'" { description "When LCAF type is AFI-List."; } @@ -252,7 +333,7 @@ module lisp-address-types { } } container instance-id { - when "../../lcaf-type = instance-id-lcaf" { + when "../../address-type = 'instance-id-lcaf'" { description "When LCAF type is Instance-ID"; } @@ -278,7 +359,7 @@ module lisp-address-types { } } container as-number-lcaf { - when "../../lcaf-type = as-number-lcaf-lcaf" { + when "../../address-type = 'as-number-lcaf'" { description "When LCAF type is AS-Number."; } @@ -299,7 +380,7 @@ module lisp-address-types { } } container application-data { - when "../../lcaf-type = application-data-lcaf" { + when "../../address-type = 'application-data-lcaf'" { description "When LCAF type is Application Data."; } @@ -345,7 +426,7 @@ module lisp-address-types { } } container geo-coordinates { - when "../../lcaf-type = geo-coordinates-lcaf" { + when "../../address-type = 'geo-coordinates-lcaf'" { description "When LCAF type is Geo-coordinates."; } @@ -428,7 +509,7 @@ module lisp-address-types { } } container nat-traversal { - when "../../lcaf-type = nat-traversal-lcaf" { + when "../../address-type = 'nat-traversal-lcaf'" { description "When LCAF type is NAT-Traversal."; } @@ -469,7 +550,7 @@ module lisp-address-types { } } container explicit-locator-path { - when "../../lcaf-type = explicit-locator-path-lcaf" { + when "../../address-type = 'explicit-locator-path-lcaf'" { description "When LCAF type type is Explicit Locator Path."; } @@ -508,15 +589,15 @@ module lisp-address-types { } } container source-dest-key { - when "../../lcaf-type = source-dest-key-lcaf" { + when "../../address-type = '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"; + "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10 + #section-4.11"; leaf source { type inet:ip-prefix; description @@ -529,7 +610,7 @@ module lisp-address-types { } } container key-value-address { - when "../../lcaf-type = key-value-address-lcaf" { + when "../../lcaf-type = 'key-value-address-lcaf'" { description "When LCAF type type is Key/Value Address."; } @@ -551,104 +632,4 @@ module lisp-address-types { } } } - grouping lisp-address { - description - "Generic LISP address."; - leaf afi { - type lisp-address-family-ref; - mandatory true; - description - "LISP address family AFI."; - } - leaf virtual-network-id { - type instance-id-type; - description - "Instance ID of the address."; - } - choice address { - leaf no-address { - when "../../afi = 'laddr:no-addr-afi'" { - description - "When AFI is 0."; - } - type empty; - description - "No address."; - } - leaf ipv4 { - when "../../afi = 'laddr:ipv4-afi'" { - description - "When AFI is IPv4."; - } - type inet:ipv4-address; - description - "IPv4 address."; - } - leaf ipv4-prefix { - when "../../afi = 'laddr:ipv4-prefix-afi'" { - description - "When AFI is IPv4."; - } - type inet:ipv4-prefix; - description - "IPv4 prefix."; - } - leaf ipv6 { - when "../../afi = 'laddr:ipv6-afi'" { - description - "When AFI is IPv6."; - } - type inet:ipv6-address; - description - "IPv6 address."; - } - leaf ipv6-prefix { - when "../../afi = 'laddr:ipv6-prefix-afi'" { - description - "When AFI is IPv6."; - } - type inet:ipv6-prefix; - description - "IPv6 address."; - } - leaf mac { - when "../../afi = 'laddr:mac-afi'" { - description - "When AFI is MAC."; - } - type yang:mac-address; - description - "MAC address."; - } - leaf distinguished-name { - when "../../afi = 'laddr:distinguished-name-afi'" { - description - "When AFI is distinguished-name."; - } - type distinguished-name-type; - description - "Distinguished Name address."; - } - leaf as-number { - when "../../afi = 'laddr:as-number-afi'" { - description - "When AFI is as-number."; - } - type inet:as-number; - description - "AS Number."; - } - container lcaf { - when "../../afi = 'laddr:lcaf'" { - description - "When AFI is LCAF."; - } - uses lcaf-address; - description - "LCAF address."; - } - description - "Selection of address type."; - } - } -} +} \ No newline at end of file -- 2.36.6