Merging lcal address with lisp-address.
[lispflowmapping.git] / mappingservice / lisp-proto / src / main / yang / lisp-address-types.yang
index 72d1fbc34c6722959cbdbcf44eb5282e5cdd5792..a2ba43c8eb669e1f1bd52e14772ea546392c1909 100644 (file)
@@ -41,32 +41,42 @@ module lisp-address-types {
       "Base identity from which identities describing LISP address
        families are derived.";
   }
-  identity no-address {
-      base lisp-address-family;
-      description
-        "IANA Reserved.";
+  identity no-address-afi {
+    base lisp-address-family;
+    description
+      "IANA Reserved.";
     }
-  identity ipv4 {
+  identity ipv4-afi {
     base lisp-address-family;
     description
       "IANA IPv4 address family.";
   }
-  identity ipv6 {
+  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 mac {
+  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 {
+  identity distinguished-name-afi {
     base lisp-address-family;
     description
       "IANA Distinguished Name address family.";
   }
-  identity as-number {
+  identity as-number-afi {
       base lisp-address-family;
       description
         "IANA AS Number address family.";
@@ -76,17 +86,17 @@ module lisp-address-types {
     description
       "IANA LISP Canonical Address Format address family.";
   }
-  identity null-address {
+  identity null-address-lcaf {
     base lcaf;
     description
       "Null body LCAF type.";
   }
-  identity afi-list {
+  identity afi-list-lcaf {
     base lcaf;
     description
       "AFI-List LCAF type.";
   }
-  identity instance-id {
+  identity instance-id-lcaf {
     base lcaf;
     description
       "Instance-ID LCAF type.";
@@ -96,67 +106,67 @@ module lisp-address-types {
     description
       "AS Number LCAF type.";
   }
-  identity application-data {
+  identity application-data-lcaf {
     base lcaf;
     description
       "Application Data LCAF type.";
   }
-  identity geo-coordinates {
+  identity geo-coordinates-lcaf {
     base lcaf;
     description
       "Geo-coordinates LCAF type.";
   }
-  identity opaque-key {
+  identity opaque-key-lcaf {
     base lcaf;
     description
       "Opaque Key LCAF type.";
   }
-  identity nat-traversal {
+  identity nat-traversal-lcaf {
     base lcaf;
     description
       "NAT-Traversal LCAF type.";
   }
-  identity nonce-locator {
+  identity nonce-locator-lcaf {
     base lcaf;
     description
       "Nonce-Locator LCAF type.";
   }
-  identity multicast-info {
+  identity multicast-info-lcaf {
     base lcaf;
     description
       "Multicast Info LCAF type.";
   }
-  identity explicit-locator-path {
+  identity explicit-locator-path-lcaf {
     base lcaf;
     description
       "Explicit Locator Path LCAF type.";
   }
-  identity security-key {
+  identity security-key-lcaf {
     base lcaf;
     description
       "Security Key LCAF type.";
   }
-  identity source-dest-key {
+  identity source-dest-key-lcaf {
     base lcaf;
     description
       "Source/Dest LCAF type.";
   }
-  identity replication-list {
+  identity replication-list-lcaf {
     base lcaf;
     description
       "Replication-List LCAF type.";
   }
-  identity json-data-model {
+  identity json-data-model-lcaf {
     base lcaf;
     description
       "JSON Data Model LCAF type.";
   }
-  identity key-value-address {
+  identity key-value-address-lcaf {
     base lcaf;
     description
-      "Key-Value LCAF type.";
+      "Key/Value Address LCAF type.";
   }
-  identity encapsulation-format {
+  identity encapsulation-format-lcaf {
     base lcaf;
     description
       "Encapsulation Format LCAF type.";
@@ -167,26 +177,27 @@ module lisp-address-types {
     }
     description
       "Defines the range of values for an Instance 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 distinguished-name-type;
       type inet:as-number;
     }
     description
       "Union of address types that can be part of LCAFs.";
   }
-  typedef distinguished-name {
-    type string;
-    description
-      "Distinguished Name address.";
-    reference
-      "http://www.iana.org/assignments/address-family-numbers/
-       address-family-numbers.xhtml";
-  }
+
   typedef lisp-address-family-ref {
     type identityref {
       base lisp-address-family;
@@ -201,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" {
+        when "../../address-type = 'null-address-lcaf'" {
           description
             "When LCAF type is null.";
         }
@@ -226,7 +317,7 @@ module lisp-address-types {
         }
       }
       container afi-list {
-        when "../../lcaf-type = afi-list" {
+        when "../../address-type = 'afi-list-lcaf'" {
           description
             "When LCAF type is AFI-List.";
         }
@@ -242,7 +333,7 @@ module lisp-address-types {
         }
       }
       container instance-id {
-        when "../../lcaf-type = instance-id" {
+        when "../../address-type = 'instance-id-lcaf'" {
           description
             "When LCAF type is Instance-ID";
         }
@@ -251,7 +342,7 @@ module lisp-address-types {
         reference
           "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
            #section-4.2";
-        leaf instance-id {
+        leaf iid {
           type instance-id-type;
           description
             "Instance ID value.";
@@ -268,7 +359,7 @@ module lisp-address-types {
         }
       }
       container as-number-lcaf {
-        when "../../lcaf-type = as-number-lcaf" {
+        when "../../address-type = 'as-number-lcaf'" {
           description
             "When LCAF type is AS-Number.";
         }
@@ -289,7 +380,7 @@ module lisp-address-types {
         }
       }
       container application-data {
-        when "../../lcaf-type = application-data" {
+        when "../../address-type = 'application-data-lcaf'" {
           description
             "When LCAF type is Application Data.";
         }
@@ -335,7 +426,7 @@ module lisp-address-types {
         }
       }
       container geo-coordinates {
-        when "../../lcaf-type = geo-coordinates" {
+        when "../../address-type = 'geo-coordinates-lcaf'" {
           description
             "When LCAF type is Geo-coordinates.";
         }
@@ -418,7 +509,7 @@ module lisp-address-types {
         }
       }
       container nat-traversal {
-        when "../../lcaf-type = nat-traversal" {
+        when "../../address-type = 'nat-traversal-lcaf'" {
           description
             "When LCAF type is NAT-Traversal.";
         }
@@ -459,7 +550,7 @@ module lisp-address-types {
         }
       }
       container explicit-locator-path {
-        when "../../lcaf-type = explicit-locator-path" {
+        when "../../address-type = 'explicit-locator-path-lcaf'" {
           description
             "When LCAF type type is Explicit Locator Path.";
         }
@@ -498,15 +589,15 @@ module lisp-address-types {
         }
       }
       container source-dest-key {
-        when "../../lcaf-type = source-dest-key" {
+        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
@@ -518,88 +609,27 @@ module lisp-address-types {
             "Destination prefix.";
         }
       }
-    }
-  }
-  grouping lisp-address {
-    description
-      "Generic LISP address.";
-    leaf afi {
-      type lisp-address-family-ref;
-      mandatory true;
-      description
-        "LISP address family AFI.";
-    }
-    leaf instance-id {
-      type instance-id-type;
-      description
-        "Instance ID of the address.";
-    }
-    choice address {
-      leaf no-address {
-        when "../../afi = 'laddr:no-addr'" {
+      container key-value-address {
+        when "../../lcaf-type = 'key-value-address-lcaf'" {
           description
-            "When AFI is 0.";
+            "When LCAF type type is Key/Value Address.";
         }
-        type empty;
         description
-          "No address.";
-      }
-      leaf ipv4 {
-        when "../../afi = 'laddr:ipv4'" {
-          description
-            "When AFI is IPv4.";
-        }
-        type inet:ipv4-prefix;
-        description
-          "IPv4 address.";
-      }
-      leaf ipv6 {
-        when "../../afi = 'laddr:ipv6'" {
-          description
-            "When AFI is IPv6.";
-        }
-        type inet:ipv6-prefix;
-        description
-          "IPv6 address.";
-      }
-      leaf mac {
-        when "../../afi = 'laddr:mac'" {
-          description
-            "When AFI is MAC.";
-        }
-        type yang:mac-address;
-        description
-          "MAC address.";
-      }
-      leaf distinguished-name {
-        when "../../afi = 'laddr:distinguished-name'" {
-          description
-            "When AFI is distinguished-name.";
-        }
-        type distinguished-name;
-        description
-          "Distinguished Name address.";
-      }
-      leaf as-number {
-          when "../../afi = 'laddr:as-number'" {
-            description
-              "When AFI is as-number.";
-          }
-          type inet:as-number;
+          "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
-            "AS Number.";
+            "Address as Key.";
         }
-      container lcaf {
-        when "../../afi = 'laddr:lcaf'" {
+        leaf value {
+          type simple-address;
           description
-            "When AFI is LCAF.";
+            "Address as Value.";
         }
-        uses lcaf-address;
-        description
-          "LCAF address.";
       }
-      description
-        "Selection of address type.";
     }
   }
-}
+}
\ No newline at end of file