From 303cfba62642e0f895dd178ba5faf0c0dc3c4eab Mon Sep 17 00:00:00 2001 From: Chirag Shah Date: Thu, 5 Mar 2020 21:43:41 -0800 Subject: [PATCH] yang: zebra rib model add route entry 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 +--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 --- yang/frr-zebra.yang | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/yang/frr-zebra.yang b/yang/frr-zebra.yang index 205109d8ae..518cef4011 100644 --- a/yang/frr-zebra.yang +++ b/yang/frr-zebra.yang @@ -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; } -- 2.39.5