BUG-4827: Modify ipv4-routes list model, to include path-id as part of the key
[bgpcep.git] / bgp / inet / src / main / yang / bgp-inet.yang
index 55e50bab713f34a569ca4831dbad02daffac2ebc..cdcc58489e42b2edf92cb822a201f83eab3c7956 100644 (file)
@@ -7,6 +7,7 @@ module bgp-inet {
     import bgp-multiprotocol { prefix bgp-mp; revision-date 2013-09-19; }
     import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
     import bgp-message { prefix bgp-msg; revision-date 2013-09-19; }
+    import bmp-monitor { prefix bmp-mon; revision-date 2015-05-12; }
 
     organization "Cisco Systems, Inc.";
     contact "Dana Kutenicsova <dkutenic@cisco.com>";
@@ -31,6 +32,9 @@ module bgp-inet {
         leaf prefix {
             type inet:ipv4-prefix;
         }
+        leaf path-id {
+            type bgp-msg:path-id;
+        }
     }
 
     grouping ipv6-prefix {
@@ -58,9 +62,9 @@ module bgp-inet {
     grouping ipv4-routes {
         container ipv4-routes {
             list ipv4-route {
-                uses bgp-mp:ipv4-prefix;
+                uses ipv4-prefix;
 
-                key prefix;
+                key "prefix path-id";
 
                 uses bgp-rib:route;
             }
@@ -70,7 +74,7 @@ module bgp-inet {
     grouping ipv6-routes {
         container ipv6-routes {
             list ipv6-route {
-                uses bgp-mp:ipv6-prefix;
+                uses ipv6-prefix;
 
                 key prefix;
 
@@ -79,7 +83,7 @@ module bgp-inet {
         }
     }
 
-    augment "/bgp-msg:update/bgp-msg:path-attributes/bgp-mp:mp-reach-nlri/bgp-mp:advertized-routes/bgp-mp:destination-type" {
+    augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-reach-nlri/bgp-mp:advertized-routes/bgp-mp:destination-type" {
         case destination-ipv4-case {
             when "../../afi = ipv4";
             uses ipv4-prefixes;
@@ -90,7 +94,7 @@ module bgp-inet {
         }
     }
 
-    augment "/bgp-msg:update/bgp-msg:path-attributes/bgp-mp:mp-unreach-nlri/bgp-mp:withdrawn-routes/bgp-mp:destination-type" {
+    augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-unreach-nlri/bgp-mp:withdrawn-routes/bgp-mp:destination-type" {
         case destination-ipv4-case {
             when "../../afi = ipv4";
             uses ipv4-prefixes;
@@ -150,5 +154,25 @@ module bgp-inet {
             uses ipv6-routes;
         }
     }
+
+    augment "/bmp-mon:bmp-monitor/bmp-mon:monitor/bmp-mon:router/bmp-mon:peer/bmp-mon:pre-policy-rib/bmp-mon:tables/bmp-mon:routes" {
+        case ipv4-routes-case {
+            uses ipv4-routes;
+        }
+
+        case ipv6-routes-case {
+            uses ipv6-routes;
+        }
+    }
+
+    augment "/bmp-mon:bmp-monitor/bmp-mon:monitor/bmp-mon:router/bmp-mon:peer/bmp-mon:post-policy-rib/bmp-mon:tables/bmp-mon:routes" {
+        case ipv4-routes-case {
+            uses ipv4-routes;
+        }
+
+        case ipv6-routes-case {
+            uses ipv6-routes;
+        }
+    }
 }