Skip to content

Commit

Permalink
zebra: zebra rib nexthop northbound
Browse files Browse the repository at this point in the history
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
  • Loading branch information
chiragshah6 committed Apr 15, 2020
1 parent 62fae1a commit 2788e0d
Show file tree
Hide file tree
Showing 4 changed files with 364 additions and 92 deletions.
4 changes: 2 additions & 2 deletions zebra/zebra_nb.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,9 +680,9 @@ const struct frr_yang_module_info frr_zebra_info = {
}
},
{
.xpath = "/frr-vrf:lib/vrf/frr-zebra:ribs/rib/route/route-entry/nexthop-group/frr-nexthops/nexthop/weight",
.xpath = "/frr-vrf:lib/vrf/frr-zebra:zebra/ribs/rib/route/route-entry/nexthop-group/frr-nexthops/nexthop/weight",
.cbs = {
.get_elem = lib_vrf_ribs_rib_route_route_entry_nexthop_group_frr_nexthops_nexthop_weight_get_elem,
.get_elem = lib_vrf_zebra_ribs_rib_route_route_entry_nexthop_group_frr_nexthops_nexthop_weight_get_elem,
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion zebra/zebra_nb.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ struct yang_data *
lib_vrf_zebra_ribs_rib_route_route_entry_nexthop_group_frr_nexthops_nexthop_fib_get_elem(
const char *xpath, const void *list_entry);
struct yang_data *
lib_vrf_ribs_rib_route_route_entry_nexthop_group_frr_nexthops_nexthop_weight_get_elem(
lib_vrf_zebra_ribs_rib_route_route_entry_nexthop_group_frr_nexthops_nexthop_weight_get_elem(
const char *xpath, const void *list_entry);

#endif
9 changes: 5 additions & 4 deletions zebra/zebra_nb_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1330,17 +1330,16 @@ int lib_vrf_zebra_ribs_rib_create(enum nb_event event,
union nb_resource *resource)
{
// uint32_t table_id;
const char *vrf_name;
struct vrf *vrf;
afi_t afi = AFI_IP;
safi_t safi = SAFI_UNICAST;
struct zebra_vrf *zvrf;
struct zebra_router_table *zrt;

vrf_name = nb_running_get_entry(dnode, NULL, false);
vrf = vrf_lookup_by_name(vrf_name);
vrf = nb_running_get_entry(dnode, NULL, false);
zvrf = vrf_info_lookup(vrf->vrf_id);

// TODO: parse afi-safi-name and table_id
// table_id = yang_dnode_get_uint32(dnode, "./table-id");
zlog_debug("%s: vrf %s", __PRETTY_FUNCTION__, vrf->name);

Expand Down Expand Up @@ -1378,8 +1377,10 @@ int lib_vrf_zebra_ribs_rib_destroy(enum nb_event event,
struct zebra_router_table *zrt;

zrt = nb_running_unset_entry(dnode);
if (!zrt)
if (!zrt) {
zlog_debug("%s: zrt is not found", __func__);
return NB_ERR_INCONSISTENCY;
}

return NB_OK;
}
Expand Down
Loading

0 comments on commit 2788e0d

Please sign in to comment.