Containerize lisp-address everywhere 57/28457/11
authorLorand Jakab <lojakab@cisco.com>
Tue, 20 Oct 2015 12:38:46 +0000 (15:38 +0300)
committerLorand Jakab <lojakab@cisco.com>
Tue, 20 Oct 2015 12:38:46 +0000 (15:38 +0300)
Change-Id: Ie11ae5953a40af2b95bb75b1f4ffa3f9a23208ff
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
mappingservice/api/src/main/yang/mappingservice.yang
mappingservice/lisp-proto/src/main/yang/lisp-proto.yang

index f5136fcaf5b6516bedf284a69aae320de8bb9228..41ad7fb8398bd24c61b9b69fed6227eb33adc5cc 100644 (file)
@@ -7,7 +7,6 @@ module mappingservice {
     import config { prefix config; revision-date 2013-04-05; }
     import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
     import yang-ext { prefix ext; revision-date 2013-07-09; }
-    import lisp-address-types { prefix lisp-address; revision-date 2015-03-09; }
     import lisp-proto { prefix lisp-proto; revision-date 2015-08-20; }
 
     contact "Lorand Jakab <lojakab@cisco.com";
@@ -75,12 +74,14 @@ module mappingservice {
         description "A classifier for endpoint-id elements which allows direct access to a particular element in the data tree.";
     }
 
-    grouping mapping-authkey {
-        leaf key-type {
-            type uint16;
-        }
-        leaf authkey {
-            type string;
+    grouping mapping-authkey-container {
+        container mapping-authkey {
+            leaf key-string {
+                type string;
+            }
+            leaf key-type {
+                type uint16;
+            }
         }
     }
 
@@ -105,7 +106,7 @@ module mappingservice {
                 description "Site ID";
                 type site-id;
             }
-            uses lisp-proto:EidToLocatorRecord;
+            uses lisp-proto:mapping-record-container;
         }
         list authentication-key {
             description "A list of authentication keys for EID prefixes within the same Instance ID";
@@ -114,8 +115,8 @@ module mappingservice {
             leaf eid-uri {
                 type eid-uri;
             }
-            uses lisp-address:lisp-address;
-            uses mapping-authkey;
+            uses lisp-proto:eid-container;
+            uses mapping-authkey-container;
         }
     }
 
@@ -131,73 +132,66 @@ module mappingservice {
 
     rpc add-key {
         input {
-            uses lisp-address:lisp-address;
-            uses mapping-authkey;
+            uses lisp-proto:eid-container;
+            uses mapping-authkey-container;
         }
     }
 
     rpc get-key {
         input {
-            uses lisp-address:lisp-address;
+            uses lisp-proto:eid-container;
         }
         output {
-            uses mapping-authkey;
+            uses mapping-authkey-container;
         }
     }
 
     rpc update-key {
         input {
-            container eid {
-                uses lisp-address:lisp-address;
-            }
-            container key {
-                uses mapping-authkey;
-            }
+            uses lisp-proto:eid-container;
+            uses mapping-authkey-container;
         }
     }
 
     rpc remove-key {
         input {
-            uses lisp-address:lisp-address;
+            uses lisp-proto:eid-container;
         }
     }
 
     rpc add-mapping {
         input {
-            uses lisp-proto:EidToLocatorRecord;
+            uses lisp-proto:mapping-record-container;
         }
     }
 
     rpc get-mapping {
         input {
-            uses lisp-address:lisp-address;
+            uses lisp-proto:eid-container;
         }
         output {
-            uses lisp-proto:EidToLocatorRecords;
+            uses lisp-proto:mapping-record-container;
         }
     }
 
     rpc update-mapping {
         input {
-            uses lisp-proto:EidToLocatorRecord;
+            uses lisp-proto:mapping-record-container;
         }
     }
 
     rpc remove-mapping {
         input {
-            uses lisp-address:lisp-address;
+            uses lisp-proto:eid-container;
         }
     }
 
     notification mapping-changed {
         description "Notification sent when a mapping is changed";
-        container mapping {
-            description "Mapping that has been changed";
-            uses lisp-proto:EidToLocatorRecord;
-        }
-        leaf change {
+        leaf change-type {
             description "The type of change";
             type mapping-change;
         }
+        uses lisp-proto:mapping-record-container;
     }
 }
index 0f69580658a1da5fd154e65842e3ddc2bc4b09da..1b13ff389cc72e00974f56e53a826edb56474625 100644 (file)
@@ -360,9 +360,21 @@ module lisp-proto {
         }
     }
 
+    grouping eid-container {
+        container eid {
+            uses lisp-address:lisp-address;
+        }
+    }
+
+    grouping rloc-container {
+        container rloc {
+            uses lisp-address:lisp-address;
+        }
+    }
+
     grouping EidRecords {
         list EidRecord {
-            uses lisp-address:lisp-address;
+            uses eid-container;
         }
     }
 
@@ -395,9 +407,7 @@ module lisp-proto {
             }
 
             //locator address
-            container rloc {
-                uses lisp-address:lisp-address;
-            }
+            uses rloc-container;
         }
     }
 
@@ -423,17 +433,21 @@ module lisp-proto {
             type boolean;
         }
         // EID prefix
-        container eid {
-            uses lisp-address:lisp-address;
-        }
+        uses eid-container;
 
         // locator record list
         uses LocatorRecords;
     }
 
+    grouping mapping-record-container {
+        container mapping-record {
+            uses EidToLocatorRecord;
+        }
+    }
+
     grouping EidToLocatorRecords {
         list eidToLocatorRecord {
-            uses EidToLocatorRecord;
+            uses mapping-record-container;
         }
     }
 
@@ -512,14 +526,14 @@ module lisp-proto {
             type int64;
         }
         container SourceEid {
-            uses lisp-address:lisp-address;
+            uses eid-container;
         }
         list itrRloc {
-            uses lisp-address:lisp-address;
+            uses rloc-container;
         }
         uses EidRecords;
-        container MapReply{
-            uses EidToLocatorRecord;
+        container MapReply {
+            uses mapping-record-container;
         }
     }