Bug 5270: Fix merging
[lispflowmapping.git] / mappingservice / lisp-proto / src / main / yang / odl-lisp-proto.yang
index eb077db9957d0ca8e18aa384c0d020c155b8e476..58bf372611c9937ec6c9a373966a3c8275f548a4 100644 (file)
@@ -21,6 +21,35 @@ module odl-lisp-proto {
         reference "https://tools.ietf.org/html/rfc6830";
     }
 
+    typedef ipv4-address-binary {
+        type binary {
+            length "4";
+        }
+        description
+            "The ipv4-address-binary type represents an IPv4 address in binary
+             in network byte order.";
+    }
+
+    typedef ipv6-address-binary {
+        type binary {
+            length "16";
+        }
+        description
+            "The ipv6-address-binary type represents an IPv6 address in binary
+             in network byte order.";
+    }
+
+    typedef ip-address-binary {
+        type union {
+            type ipv4-address-binary;
+            type ipv6-address-binary;
+        }
+        description
+            "The ip-address-binary type represents an IP address in binary
+             in network byte order, and is IP version neutral.  The length of
+             the byte array implies the IP version.";
+    }
+
     grouping transport-address {
         container transport-address {
             leaf ipAddress {
@@ -88,34 +117,69 @@ module odl-lisp-proto {
         }
     }
 
+    grouping mapping-record-metadata {
+        leaf xtr-id {
+            type binary {
+                length "16";
+            }
+            description
+                "128 bit xTR identifier.";
+        }
+        leaf site-id {
+            type binary {
+                length "8";
+            }
+            description
+                "64 bit site identifier.";
+        }
+        leaf source-rloc {
+            type inet:ip-address;
+            description
+                "The Source IP address used for sending the enclosing control
+                 packet in RLOC space.";
+        }
+        leaf timestamp {
+            type int64;
+            description
+                "Milliseconds since January 1, 1970, 00:00:00 GMT";
+        }
+        description
+            "This is a collection of fields which are not present in the actual
+            mapping record defined in RFC 6830, but are used internally in
+            OpenDaylight";
+    }
+
     grouping mapping-record-container {
         container mapping-record {
-               leaf recordTtl {
-                   type int32;
-               }
-               leaf maskLength {
-                   type uint8;
-               }
-               leaf mapVersion {
-                   type int16;
-               }
-               leaf action {
-                   type enumeration {
-                       enum NoAction;
-                       enum NativelyForward;
-                       enum SendMapRequest;
-                       enum Drop;
-                   }
-               }
-               leaf authoritative {
-                   type boolean;
-               }
-               // EID prefix
-               uses eid-container;
-       
-               // locator record list
-               uses LocatorRecords;
-           }
+            leaf recordTtl {
+                type int32;
+            }
+            leaf maskLength {
+                type uint8;
+            }
+            leaf mapVersion {
+                type int16;
+            }
+            leaf action {
+                type enumeration {
+                    enum NoAction;
+                    enum NativelyForward;
+                    enum SendMapRequest;
+                    enum Drop;
+                }
+            }
+            leaf authoritative {
+                type boolean;
+            }
+            // EID prefix
+            uses eid-container;
+
+            // locator record list
+            uses LocatorRecords;
+
+            // metadata
+            uses mapping-record-metadata;
+        }
     }
 
     grouping mapping-record-list {
@@ -130,10 +194,14 @@ module odl-lisp-proto {
 
     grouping xtrSiteId {
         leaf xtrId {
-            type binary;
+            type binary {
+                length "16";
+            }
         }
         leaf siteId {
-            type binary;
+            type binary {
+                length "8";
+            }
         }
     }
 
@@ -157,6 +225,9 @@ module odl-lisp-proto {
         leaf authenticationData {
             type binary;
         }
+        leaf mergeEnabled {
+            type boolean;
+        }
         uses mapping-record-list;
         uses xtrSiteId;
     }
@@ -175,6 +246,9 @@ module odl-lisp-proto {
         leaf authenticationData {
             type binary;
         }
+        leaf mergeEnabled {
+            type boolean;
+        }
         uses mapping-record-list;
         uses xtrSiteId;
     }