Skip to content

Commit

Permalink
Merge pull request #6250 from chiragshah6/yang_nb6
Browse files Browse the repository at this point in the history
*: RIB operational northbound callbacks implementation
  • Loading branch information
rwestphal authored May 13, 2020
2 parents 02b89bd + 00ebe5b commit a10f92e
Show file tree
Hide file tree
Showing 8 changed files with 748 additions and 333 deletions.
37 changes: 19 additions & 18 deletions yang/frr-zebra.yang
Original file line number Diff line number Diff line change
Expand Up @@ -632,45 +632,44 @@ module frr-zebra {
"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.";
}

leaf table-id {
type uint32;
description
"Routing Table id (default id - 254).";
}

list route {
key "prefix";
config false;
leaf prefix {
type inet:ip-prefix;
description
"The route's prefix.";
type inet:ip-prefix;
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.";
type frr-route-types:frr-route-types;
description
"The protocol owning the route.";
}

leaf instance {
type uint16;
must "../protocol = \"ospf\"";
description
"Retrieve routes from a specific OSPF instance.";
"Retrieve routes from a specific OSPF instance.";
}

uses route-common;
}
}
Expand Down Expand Up @@ -2070,10 +2069,12 @@ module frr-zebra {
augment "/frr-vrf:lib/frr-vrf:vrf" {
description
"Extends VRF model with Zebra-related parameters.";
uses ribs;
container zebra {
uses ribs;
}
}

augment "/frr-vrf:lib/frr-vrf:vrf/ribs/rib/route/route-entry/nexthop-group/frr-nexthops/nexthop" {
augment "/frr-vrf:lib/frr-vrf:vrf/frr-zebra:zebra/ribs/rib/route/route-entry/nexthop-group/frr-nexthops/nexthop" {
uses frr-nh:frr-nexthop-operational;
}

Expand Down
10 changes: 10 additions & 0 deletions zebra/rib.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,22 @@ DECLARE_LIST(re_list, struct route_entry, next);
(re) && ((next) = re_list_next(&((dest)->routes), (re)), 1); \
(re) = (next))

#define RE_DEST_FIRST_ROUTE(dest, re) \
((re) = (dest) ? re_list_first(&((dest)->routes)) : NULL)

#define RE_DEST_NEXT_ROUTE(dest, re) \
((re) = (dest) ? re_list_next(&((dest)->routes), (re)) : NULL)

#define RNODE_FOREACH_RE(rn, re) \
RE_DEST_FOREACH_ROUTE (rib_dest_from_rnode(rn), re)

#define RNODE_FOREACH_RE_SAFE(rn, re, next) \
RE_DEST_FOREACH_ROUTE_SAFE (rib_dest_from_rnode(rn), re, next)

#define RNODE_FIRST_RE(rn, re) RE_DEST_FIRST_ROUTE(rib_dest_from_rnode(rn), re)

#define RNODE_NEXT_RE(rn, re) RE_DEST_NEXT_ROUTE(rib_dest_from_rnode(rn), re)

#if defined(HAVE_RTADV)
/* Structure which hold status of router advertisement. */
struct rtadv {
Expand Down
Loading

0 comments on commit a10f92e

Please sign in to comment.