BUG-2383: fix the RIB model 79/15779/8
authorRobert Varga <rovarga@cisco.com>
Thu, 26 Feb 2015 10:33:20 +0000 (11:33 +0100)
committerDana Kutenicsova <dkutenic@cisco.com>
Thu, 5 Mar 2015 08:49:41 +0000 (09:49 +0100)
The overall goal is to store adjacency ribs in the datastore. In order
to do that, we need to fix the (defunct) model, so each peer has a
unique subtree. This patch fixes the model and introduces a peer ID
type, which we will use throughout to identify peers.

Change-Id: I45a4493d0aabb29828e6e935017939a5b09e7b60
Signed-off-by: Robert Varga <rovarga@cisco.com>
bgp/rib-api/src/main/yang/bgp-rib.yang

index b127ff58e9a94f973ff764335291548d13726eb8..b4d0fd910d63b539266400d9ec6949e9ffa63dd6 100644 (file)
@@ -35,6 +35,23 @@ module bgp-rib {
         type inet:uri;
     }
 
+    typedef peer-id {
+        description
+            "An abstract peer identifier. The protocol part identifies
+            the type of the peer. One well-known protocol is define, which
+            has the following format: bgp://1.2.3.4, where 1.2.3.4 is the
+            peer's BGP Identifier in IPv4 dotted-quad format.";
+        type inet:uri;
+    }
+
+    typedef peer-role {
+        type enumeration {
+            enum ebgp;
+            enum ibgp;
+            enum rr-client;
+        }
+    }
+
     grouping route {
         container attributes {
             uses bgp-msg:path-attributes;
@@ -106,8 +123,22 @@ module bgp-rib {
             }
             key id;
 
-            list peers {
+            list peer {
+                key peer-id;
+                leaf peer-id {
+                    type peer-id;
+                }
+                leaf peer-role {
+                    type peer-role;
+                    mandatory true;
+                }
+
                 container adj-rib-in {
+                    description "Routes as we have received them from the peer.";
+                    uses rib;
+                }
+                container effective-rib-in {
+                    description "Routes as processed by inbound policy.";
                     uses rib;
                 }
                 container adj-rib-out {