]> git.puffer.fish Git - matthieu/frr.git/commitdiff
yang: zebra rib model add route entry
authorChirag Shah <chirag@cumulusnetworks.com>
Fri, 6 Mar 2020 05:43:41 +0000 (21:43 -0800)
committerSantosh P K <sapk@vmware.com>
Thu, 16 Apr 2020 15:17:59 +0000 (08:17 -0700)
FRR rib model need to accomodate route entries for
a given destination prefix.

Add a list of route entry under the list of prefix.

+--rw ribs
   +--rw rib* [afi-safi-name table-id]
      +--rw table-id         uint32
      +--rw afi-safi-name    identityref
      +--ro route* [prefix]
         +--ro prefix         ietf-inet-types:ip-prefix
         +--ro route-entry* [protocol]
            +--ro protocol           frr-route-types:frr-route-types-v4
            +--ro instance?          uint16
            +--ro distance?          uint8
            +--ro metric?            uint32
            +--ro tag?               uint32
            +--ro selected?          empty
            +--ro installed?         empty
            +--ro failed?            empty
            +--ro queued?            empty
            +--ro internal-flags?    int32
            +--ro internal-status?   int32
            +--ro uptime?            ietf-yang-types:date-and-time
            +--ro nexthop-group* [name]
               +--ro name            string
               +--ro frr-nexthops
                  +--ro nexthop* [nh-type gateway interface]
                     +--ro nh-type             frr-nexthop:nexthop-type
                     +--ro vrf?                frr-vrf:vrf-ref
                     +--ro gateway             frr-nexthop:optional-ip-address
                     +--ro interface           frr-interface:interface-ref
                     +--ro bh-type?            frr-nexthop:blackhole-type
                     +--ro onlink?             boolean <false>
                     +--ro mpls-label-stack
                     |  +--ro entry* [id]
                     |     +--ro id               uint8
                     |     +--ro label?           ietf-routing-types:mpls-label
                     |     +--ro ttl?             uint8
                     |     +--ro traffic-class?   uint8
                     +--ro duplicate?          empty
                     +--ro recursive?          empty
                     +--ro active?             empty
                     +--ro fib?                empty

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
yang/frr-zebra.yang

index 205109d8aed673a08348e44392288f09974dc443..518cef4011b74ad111a8596dde6622fa34830a78 100644 (file)
@@ -165,11 +165,6 @@ module frr-zebra {
   grouping route-common {
     description
       "Common information about a route.";
-    leaf vrf {
-      type frr-vrf:vrf-ref;
-      description
-        "The route's vrf name.";
-    }
 
     leaf distance {
       type uint8;
@@ -572,22 +567,24 @@ module frr-zebra {
              description
                 "The route's prefix.";
           }
+          list route-entry {
+            key "protocol";
+            leaf protocol {
+               type frr-route-types:frr-route-types-v4;
+               //TODO: Use unified route types done in PR 5183 when it is merged.
+               //type frr-route-types:frr-route-types;
+               description
+                  "The protocol owning the route.";
+            }
 
-          leaf protocol {
-             when "'../../afi-safi-name' = 'ipv4-unicast'";
-             type frr-route-types:frr-route-types-v4;
-             description
-                "The protocol owning the route.";
-          }
-
-          leaf protocol-v6 {
-             when "'../../afi-safi-name' = 'ipv6-unicast'";
-             type frr-route-types:frr-route-types-v6;
-             description
-                "The protocol owning the route.";
+            leaf instance {
+              type uint16;
+              must "../protocol = \"ospf\"";
+              description
+              "Retrieve routes from a specific OSPF instance.";
+            }
+            uses route-common;
           }
-
-          uses route-common;
         }
       }
     }
@@ -1937,7 +1934,7 @@ module frr-zebra {
     uses ribs;
   }
 
-  augment "/frr-vrf:lib/frr-vrf:vrf/ribs/rib/route/nexthop-group/frr-nexthops/nexthop" {
+  augment "/frr-vrf:lib/frr-vrf:vrf/ribs/rib/route/route-entry/nexthop-group/frr-nexthops/nexthop" {
     uses frr-nh:frr-nexthop-operational;
   }