mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 08:32:45 +00:00
zebra: Remove ifp_nhg_XXX functions completely
These functions provided a level of abstraction that forced us to call multiple functions when a simple data structure change was all that is needed. Let's consolidate down and make things a bit simpler. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
b9130ab51b
commit
2934127547
@ -954,35 +954,6 @@ static void if_down_del_nbr_connected(struct interface *ifp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void if_nhg_dependents_add(struct interface *ifp, struct nhg_hash_entry *nhe)
|
|
||||||
{
|
|
||||||
if (ifp->info) {
|
|
||||||
struct zebra_if *zif = (struct zebra_if *)ifp->info;
|
|
||||||
|
|
||||||
nhg_connected_tree_add_nhe(&zif->nhg_dependents, nhe);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void if_nhg_dependents_del(struct interface *ifp, struct nhg_hash_entry *nhe)
|
|
||||||
{
|
|
||||||
if (ifp->info) {
|
|
||||||
struct zebra_if *zif = (struct zebra_if *)ifp->info;
|
|
||||||
|
|
||||||
nhg_connected_tree_del_nhe(&zif->nhg_dependents, nhe);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int if_nhg_dependents_count(const struct interface *ifp)
|
|
||||||
{
|
|
||||||
if (ifp->info) {
|
|
||||||
struct zebra_if *zif = (struct zebra_if *)ifp->info;
|
|
||||||
|
|
||||||
return nhg_connected_tree_count(&zif->nhg_dependents);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Interface is up. */
|
/* Interface is up. */
|
||||||
void if_up(struct interface *ifp, bool install_connected)
|
void if_up(struct interface *ifp, bool install_connected)
|
||||||
{
|
{
|
||||||
|
@ -331,11 +331,6 @@ void link_param_cmd_set_float(struct interface *ifp, float *field,
|
|||||||
void link_param_cmd_unset(struct interface *ifp, uint32_t type);
|
void link_param_cmd_unset(struct interface *ifp, uint32_t type);
|
||||||
|
|
||||||
/* Nexthop group connected functions */
|
/* Nexthop group connected functions */
|
||||||
extern void if_nhg_dependents_add(struct interface *ifp,
|
|
||||||
struct nhg_hash_entry *nhe);
|
|
||||||
extern void if_nhg_dependents_del(struct interface *ifp,
|
|
||||||
struct nhg_hash_entry *nhe);
|
|
||||||
extern unsigned int if_nhg_dependents_count(const struct interface *ifp);
|
|
||||||
extern bool if_nhg_dependents_is_empty(const struct interface *ifp);
|
extern bool if_nhg_dependents_is_empty(const struct interface *ifp);
|
||||||
|
|
||||||
extern void vrf_add_update(struct vrf *vrfp);
|
extern void vrf_add_update(struct vrf *vrfp);
|
||||||
|
@ -309,8 +309,10 @@ static int zebra_nhg_insert_id(struct nhg_hash_entry *nhe)
|
|||||||
|
|
||||||
static void zebra_nhg_set_if(struct nhg_hash_entry *nhe, struct interface *ifp)
|
static void zebra_nhg_set_if(struct nhg_hash_entry *nhe, struct interface *ifp)
|
||||||
{
|
{
|
||||||
|
struct zebra_if *zif = (struct zebra_if *)ifp->info;
|
||||||
|
|
||||||
nhe->ifp = ifp;
|
nhe->ifp = ifp;
|
||||||
if_nhg_dependents_add(ifp, nhe);
|
nhg_connected_tree_add_nhe(&zif->nhg_dependents, nhe);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1073,8 +1075,11 @@ static void zebra_nhg_release_all_deps(struct nhg_hash_entry *nhe)
|
|||||||
/* Remove it from any lists it may be on */
|
/* Remove it from any lists it may be on */
|
||||||
zebra_nhg_depends_release(nhe);
|
zebra_nhg_depends_release(nhe);
|
||||||
zebra_nhg_dependents_release(nhe);
|
zebra_nhg_dependents_release(nhe);
|
||||||
if (nhe->ifp)
|
if (nhe->ifp) {
|
||||||
if_nhg_dependents_del(nhe->ifp, nhe);
|
struct zebra_if *zif = nhe->ifp->info;
|
||||||
|
|
||||||
|
nhg_connected_tree_del_nhe(&zif->nhg_dependents, nhe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zebra_nhg_release(struct nhg_hash_entry *nhe)
|
static void zebra_nhg_release(struct nhg_hash_entry *nhe)
|
||||||
|
Loading…
Reference in New Issue
Block a user