]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Cleanup bgp_nexthop_set|get function names
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 15 Oct 2018 12:33:58 +0000 (08:33 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 16 Nov 2018 14:43:35 +0000 (09:43 -0500)
The bgp_nexthop_set_node_info and bgp_nexthop_get_node_info
function names were slightly backwards, rename to bgp_node_set and get

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_nexthop.c
bgpd/bgp_nht.c
bgpd/bgp_table.h

index 9d76a410759154003753f5bda9ca27b711a19d5f..1877077602c2a708a46ace362c9ebe63e098cd4b 100644 (file)
@@ -81,7 +81,7 @@ static void bgp_nexthop_cache_reset(struct bgp_table *table)
        struct bgp_nexthop_cache *bnc;
 
        for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) {
-               bnc = bgp_nexthop_get_node_info(rn);
+               bnc = bgp_node_get_bgp_nexthop_info(rn);
                if (!bnc)
                        continue;
 
@@ -92,7 +92,7 @@ static void bgp_nexthop_cache_reset(struct bgp_table *table)
                }
 
                bnc_free(bnc);
-               bgp_nexthop_set_node_info(rn, NULL);
+               bgp_node_set_bgp_nexthop_info(rn, NULL);
                bgp_unlock_node(rn);
        }
 }
@@ -601,7 +601,7 @@ static void bgp_show_nexthops(struct vty *vty, struct bgp *bgp, int detail)
 
                for (rn = bgp_table_top(bgp->nexthop_cache_table[afi]); rn;
                     rn = bgp_route_next(rn)) {
-                       bnc = bgp_nexthop_get_node_info(rn);
+                       bnc = bgp_node_get_bgp_nexthop_info(rn);
                        if (!bnc)
                                continue;
 
index 0dce96f43240c5703dc52548a118ed9f318498f0..221bfea93df3e0a861346da1ef2c0ee3bc5ad7e0 100644 (file)
@@ -95,7 +95,7 @@ static void bgp_unlink_nexthop_check(struct bgp_nexthop_cache *bnc)
                }
                unregister_zebra_rnh(bnc,
                                     CHECK_FLAG(bnc->flags, BGP_STATIC_ROUTE));
-               bgp_nexthop_set_node_info(bnc->node, NULL);
+               bgp_node_set_bgp_nexthop_info(bnc->node, NULL);
                bgp_unlock_node(bnc->node);
                bnc->node = NULL;
                bnc_free(bnc);
@@ -126,7 +126,7 @@ void bgp_unlink_nexthop_by_peer(struct peer *peer)
 
        rn = bgp_node_get(peer->bgp->nexthop_cache_table[afi], &p);
 
-       bnc = bgp_nexthop_get_node_info(rn);
+       bnc = bgp_node_get_bgp_nexthop_info(rn);
        if (!bnc)
                return;
 
@@ -183,10 +183,10 @@ int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop,
        else
                rn = bgp_node_get(bgp_nexthop->nexthop_cache_table[afi], &p);
 
-       bnc = bgp_nexthop_get_node_info(rn);
+       bnc = bgp_node_get_bgp_nexthop_info(rn);
        if (!bnc) {
                bnc = bnc_new();
-               bgp_nexthop_set_node_info(rn, bnc);
+               bgp_node_set_bgp_nexthop_info(rn, bnc);
                bnc->node = rn;
                bnc->bgp = bgp_nexthop;
                bgp_lock_node(rn);
@@ -293,7 +293,7 @@ void bgp_delete_connected_nexthop(afi_t afi, struct peer *peer)
                return;
        }
 
-       bnc = bgp_nexthop_get_node_info(rn);
+       bnc = bgp_node_get_bgp_nexthop_info(rn);
        if (!bnc) {
                if (BGP_DEBUG(nht, NHT))
                        zlog_debug("Cannot find connected NHT node for peer %s on route_node as expected",
@@ -318,7 +318,7 @@ void bgp_delete_connected_nexthop(afi_t afi, struct peer *peer)
                        zlog_debug("Freeing connected NHT node %p for peer %s",
                                   bnc, peer->host);
                unregister_zebra_rnh(bnc, 0);
-               bgp_nexthop_set_node_info(bnc->node, NULL);
+               bgp_node_set_bgp_nexthop_info(bnc->node, NULL);
                bgp_unlock_node(bnc->node);
                bnc_free(bnc);
        }
@@ -371,7 +371,7 @@ void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id)
                return;
        }
 
-       bnc = bgp_nexthop_get_node_info(rn);
+       bnc = bgp_node_get_bgp_nexthop_info(rn);
        if (!bnc) {
                if (BGP_DEBUG(nht, NHT)) {
                        char buf[PREFIX2STR_BUFFER];
@@ -510,7 +510,7 @@ void bgp_cleanup_nexthops(struct bgp *bgp)
 
                for (rn = bgp_table_top(bgp->nexthop_cache_table[afi]); rn;
                     rn = bgp_route_next(rn)) {
-                       bnc = bgp_nexthop_get_node_info(rn);
+                       bnc = bgp_node_get_bgp_nexthop_info(rn);
                        if (!bnc)
                                continue;
 
@@ -829,7 +829,7 @@ void bgp_nht_register_nexthops(struct bgp *bgp)
 
                for (rn = bgp_table_top(bgp->nexthop_cache_table[afi]); rn;
                     rn = bgp_route_next(rn)) {
-                       bnc = bgp_nexthop_get_node_info(rn);
+                       bnc = bgp_node_get_bgp_nexthop_info(rn);
 
                        if (!bnc)
                                continue;
@@ -867,7 +867,7 @@ void bgp_nht_register_enhe_capability_interfaces(struct peer *peer)
                return;
        rn = bgp_node_lookup(bgp->nexthop_cache_table[AFI_IP6], &p);
 
-       bnc = bgp_nexthop_get_node_info(rn);
+       bnc = bgp_node_get_bgp_nexthop_info(rn);
        if (!bnc)
                return;
 
index ee21e74a157f7e8b174a3f554d249f69bac7b95d..77722e515bd8d239a10a388dc81cf2ace2b36964 100644 (file)
@@ -365,12 +365,12 @@ static inline void bgp_connected_set_node_info(struct bgp_node *node,
 }
 
 static inline struct bgp_nexthop_cache *
-bgp_nexthop_get_node_info(struct bgp_node *node)
+bgp_node_get_bgp_nexthop_info(struct bgp_node *node)
 {
        return node->info;
 }
 
-static inline void bgp_nexthop_set_node_info(struct bgp_node *node,
+static inline void bgp_node_set_bgp_nexthop_info(struct bgp_node *node,
                                             struct bgp_nexthop_cache *bnc)
 {
        node->info = bnc;