]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Remove ifp_nhg_XXX functions completely
authorDonald Sharp <sharpd@nvidia.com>
Thu, 8 Feb 2024 16:56:40 +0000 (11:56 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 8 Feb 2024 16:56:40 +0000 (11:56 -0500)
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>
zebra/interface.c
zebra/interface.h
zebra/zebra_nhg.c

index 829f9dab61c42e86e2a14084f05e98f7c29535b3..efa7283e31e19ce3285f316b75a82f112286f0d4 100644 (file)
@@ -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. */
 void if_up(struct interface *ifp, bool install_connected)
 {
index 7d633f32d2ea07d464714915f6695a36002fc759..8d19c1838fbfc0338effaaeb13645b815b2ec34a 100644 (file)
@@ -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);
 
 /* 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 void vrf_add_update(struct vrf *vrfp);
index ecdba8866de2922398bc363a1c8a58bccc2da64a..527522a6f497a3f62741a6f8bcb23381570683ba 100644 (file)
@@ -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)
 {
+       struct zebra_if *zif = (struct zebra_if *)ifp->info;
+
        nhe->ifp = ifp;
-       if_nhg_dependents_add(ifp, nhe);
+       nhg_connected_tree_add_nhe(&zif->nhg_dependents, nhe);
 }
 
 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 */
        zebra_nhg_depends_release(nhe);
        zebra_nhg_dependents_release(nhe);
-       if (nhe->ifp)
-               if_nhg_dependents_del(nhe->ifp, nhe);
+       if (nhe->ifp) {
+               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)