From: Chirag Shah Date: Fri, 6 Dec 2019 02:48:14 +0000 (-0800) Subject: yang: zebra rib operational model X-Git-Tag: base_7.4~70^2~25 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=4218384d6f2d09d0c34df020bd293f3f24c620aa;p=mirror%2Ffrr.git yang: zebra rib operational model augment /frr-vrf:lib/frr-vrf:vrf: +--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 protocol? frr-route-types:frr-route-types-v4 +--ro protocol-v6? frr-route-types:frr-route-types-v6 +--ro vrf? frr-vrf:vrf-ref +--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 --- diff --git a/yang/frr-zebra.yang b/yang/frr-zebra.yang index 736bbc2c81..d3a9d88968 100644 --- a/yang/frr-zebra.yang +++ b/yang/frr-zebra.yang @@ -31,6 +31,10 @@ module frr-zebra { prefix frr-interface; } + import frr-vrf { + prefix frr-vrf; + } + organization "FRRouting"; contact @@ -44,6 +48,35 @@ module frr-zebra { "Initial revision."; } + identity afi-safi-type { + description + "Base identity type (AFI,SAFI) tuples for RIB"; + } + + identity ipv4-unicast { + base afi-safi-type; + description + "This identity represents the IPv4 unicast address family."; + } + + identity ipv6-unicast { + base afi-safi-type; + description + "This identity represents the IPv6 unicast address family."; + } + + identity ipv4-multicast { + base afi-safi-type; + description + "This identity represents the IPv4 multicast address family."; + } + + identity ipv6-multicast { + base afi-safi-type; + description + "This identity represents the IPv6 multicast address family."; + } + typedef unix-timestamp { type uint32; units "seconds"; @@ -133,9 +166,7 @@ module frr-zebra { description "Common information about a route."; leaf vrf { - type string { - length "1..36"; - } + type frr-vrf:vrf-ref; description "The route's vrf name."; } @@ -160,25 +191,25 @@ module frr-zebra { "Route tag value."; } - leaf is-selected { + leaf selected { type empty; description "Route is the selected or preferred route for the prefix."; } - leaf is-installed { + leaf installed { type empty; description "Route is installed in the FIB."; } - leaf is-failed { + leaf failed { type empty; description "Route installation in FIB has failed."; } - leaf is-queued { + leaf queued { type empty; description "Route has a pending FIB operation that has not completed."; @@ -197,17 +228,12 @@ module frr-zebra { } leaf uptime { - type uint32; - units "seconds"; + type yang:date-and-time; description "Uptime for the route."; } - container nexthop-group { - description - "Nexthop information for the route."; - uses frr-nh:frr-nexthop-group; - } + uses frr-nh:frr-nexthop-grouping; } // End of route-common @@ -257,6 +283,37 @@ module frr-zebra { uses route-common; } + // End of ip6-route + + /* + * IP Prefix Route object. + */ + + grouping ip-route { + description + "An IPv4/IPv6 prefix route."; + leaf prefix { + type inet:ip-prefix; + description + "The route's prefix."; + } + + 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."; + } + + uses route-common; + } /* * Information about EVPN VNIs @@ -442,6 +499,7 @@ module frr-zebra { description "Debug kernel messages sent."; } + leaf debug-kernel-msg-recv { type boolean; description @@ -515,6 +573,36 @@ module frr-zebra { } } + grouping ribs { + container ribs { + description + "RIBs supported by FRR."; + list rib { + key "afi-safi-name table-id"; + leaf table-id { + type uint32; + description + "Routing Table id (default id - 254)."; + } + + leaf afi-safi-name { + type identityref { + base afi-safi-type; + } + mandatory true; + description + "AFI, SAFI name."; + } + + list route { + key "prefix"; + config false; + uses ip-route; + } + } + } + } + // End of zebra container /* * RPCs @@ -532,6 +620,7 @@ module frr-zebra { description "Retrieve IPv4 routes."; } + leaf prefix-v4 { type inet:ipv4-prefix; description @@ -605,7 +694,7 @@ module frr-zebra { type uint32 { range "1..65535"; } - must '../protocol = "ospf"'; + must "../protocol = \"ospf\""; description "Retrieve routes from a specific OSPF instance."; } @@ -1852,6 +1941,16 @@ module frr-zebra { } } + augment "/frr-vrf:lib/frr-vrf:vrf" { + description + "Extends VRF model with Zebra-related parameters."; + uses ribs; + } + + augment "/frr-vrf:lib/frr-vrf:vrf/ribs/rib/route/nexthop-group/frr-nexthops/nexthop" { + uses frr-nh:frr-nexthop-operational; + } + /* * Main zebra container */