From 5a8ba9fc0ad9f0d6d3ca3075bf229a2319eb5cc0 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 16 Nov 2018 08:46:19 -0500 Subject: [PATCH] bgpd: Cleanup bgp_static_set|get function names The bgp_static_set_node_info and bgp_static_get_node_info function names were slightly backwards rename to bgp_node_get_bgp_static_info and bgp_node_set_bgp_static_info Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 46 ++++++++++++++++++++++++--------------------- bgpd/bgp_routemap.c | 2 +- bgpd/bgp_table.h | 7 ++++--- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 1822c60322..c582c46c8e 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -4905,7 +4905,7 @@ static int bgp_static_set(struct vty *vty, const char *negate, return CMD_WARNING_CONFIG_FAILED; } - bgp_static = bgp_static_get_node_info(rn); + bgp_static = bgp_node_get_bgp_static_info(rn); if ((label_index != BGP_INVALID_LABEL_INDEX) && (label_index != bgp_static->label_index)) { @@ -4927,7 +4927,7 @@ static int bgp_static_set(struct vty *vty, const char *negate, /* Clear configuration. */ bgp_static_free(bgp_static); - bgp_static_set_node_info(rn, NULL); + bgp_node_set_bgp_static_info(rn, NULL); bgp_unlock_node(rn); bgp_unlock_node(rn); } else { @@ -4935,7 +4935,7 @@ static int bgp_static_set(struct vty *vty, const char *negate, /* Set BGP static route configuration. */ rn = bgp_node_get(bgp->route[afi][safi], &p); - bgp_static = bgp_static_get_node_info(rn); + bgp_static = bgp_node_get_bgp_static_info(rn); if (bgp_static) { /* Configuration change. */ /* Label index cannot be changed. */ @@ -4986,7 +4986,7 @@ static int bgp_static_set(struct vty *vty, const char *negate, bgp_static->rmap.map = route_map_lookup_by_name(rmap); } - bgp_static_set_node_info(rn, bgp_static); + bgp_node_set_bgp_static_info(rn, bgp_static); } bgp_static->valid = 1; @@ -5022,15 +5022,17 @@ void bgp_static_add(struct bgp *bgp) for (rm = bgp_table_top(table); rm; rm = bgp_route_next(rm)) { bgp_static = - bgp_static_get_node_info(rm); + bgp_node_get_bgp_static_info( + rm); bgp_static_update_safi(bgp, &rm->p, bgp_static, afi, safi); } } else { - bgp_static_update(bgp, &rn->p, - bgp_static_get_node_info(rn), - afi, safi); + bgp_static_update( + bgp, &rn->p, + bgp_node_get_bgp_static_info(rn), afi, + safi); } } } @@ -5059,19 +5061,20 @@ void bgp_static_delete(struct bgp *bgp) for (rm = bgp_table_top(table); rm; rm = bgp_route_next(rm)) { bgp_static = - bgp_static_get_node_info(rm); + bgp_node_get_bgp_static_info( + rm); bgp_static_withdraw_safi( bgp, &rm->p, AFI_IP, safi, (struct prefix_rd *)&rn->p); bgp_static_free(bgp_static); - bgp_static_set_node_info(rn, NULL); + bgp_node_set_bgp_static_info(rn, NULL); bgp_unlock_node(rn); } } else { - bgp_static = bgp_static_get_node_info(rn); + bgp_static = bgp_node_get_bgp_static_info(rn); bgp_static_withdraw(bgp, &rn->p, afi, safi); bgp_static_free(bgp_static); - bgp_static_set_node_info(rn, NULL); + bgp_node_set_bgp_static_info(rn, NULL); bgp_unlock_node(rn); } } @@ -5101,13 +5104,14 @@ void bgp_static_redo_import_check(struct bgp *bgp) for (rm = bgp_table_top(table); rm; rm = bgp_route_next(rm)) { bgp_static = - bgp_static_get_node_info(rm); + bgp_node_get_bgp_static_info( + rm); bgp_static_update_safi(bgp, &rm->p, bgp_static, afi, safi); } } else { - bgp_static = bgp_static_get_node_info(rn); + bgp_static = bgp_node_get_bgp_static_info(rn); bgp_static_update(bgp, &rn->p, bgp_static, afi, safi); } @@ -5280,7 +5284,7 @@ int bgp_static_set_safi(afi_t afi, safi_t safi, struct vty *vty, if (gwip) prefix_copy(&bgp_static->gatewayIp, &gw_ip); } - bgp_static_set_node_info(rn, bgp_static); + bgp_node_set_bgp_static_info(rn, bgp_static); bgp_static->valid = 1; bgp_static_update_safi(bgp, &p, bgp_static, afi, safi); @@ -5343,9 +5347,9 @@ int bgp_static_unset_safi(afi_t afi, safi_t safi, struct vty *vty, if (rn) { bgp_static_withdraw_safi(bgp, &p, afi, safi, &prd); - bgp_static = bgp_static_get_node_info(rn); + bgp_static = bgp_node_get_bgp_static_info(rn); bgp_static_free(bgp_static); - bgp_static_set_node_info(rn, NULL); + bgp_node_set_bgp_static_info(rn, NULL); bgp_unlock_node(rn); bgp_unlock_node(rn); } else @@ -11156,7 +11160,7 @@ uint8_t bgp_distance_apply(struct prefix *p, struct bgp_path_info *pinfo, /* Backdoor check. */ rn = bgp_node_lookup(bgp->route[afi][safi], p); if (rn) { - bgp_static = bgp_static_get_node_info(rn); + bgp_static = bgp_node_get_bgp_static_info(rn); bgp_unlock_node(rn); if (bgp_static->backdoor) { @@ -11603,7 +11607,7 @@ static void bgp_config_write_network_vpn(struct vty *vty, struct bgp *bgp, continue; for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) { - bgp_static = bgp_static_get_node_info(rn); + bgp_static = bgp_node_get_bgp_static_info(rn); if (bgp_static == NULL) continue; @@ -11654,7 +11658,7 @@ static void bgp_config_write_network_evpn(struct vty *vty, struct bgp *bgp, continue; for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) { - bgp_static = bgp_static_get_node_info(rn); + bgp_static = bgp_node_get_bgp_static_info(rn); if (bgp_static == NULL) continue; @@ -11730,7 +11734,7 @@ void bgp_config_write_network(struct vty *vty, struct bgp *bgp, afi_t afi, /* Network configuration. */ for (rn = bgp_table_top(bgp->route[afi][safi]); rn; rn = bgp_route_next(rn)) { - bgp_static = bgp_static_get_node_info(rn); + bgp_static = bgp_node_get_bgp_static_info(rn); if (bgp_static == NULL) continue; diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 73b01b6b2d..1a0532fbb8 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -3227,7 +3227,7 @@ static void bgp_route_map_process_update(struct bgp *bgp, const char *rmap_name, /* For network route-map updates. */ for (bn = bgp_table_top(bgp->route[afi][safi]); bn; bn = bgp_route_next(bn)) { - bgp_static = bgp_static_get_node_info(bn); + bgp_static = bgp_node_get_bgp_static_info(bn); if (!bgp_static) continue; diff --git a/bgpd/bgp_table.h b/bgpd/bgp_table.h index 1ad5e5e8b2..9fcf5c1c79 100644 --- a/bgpd/bgp_table.h +++ b/bgpd/bgp_table.h @@ -342,13 +342,14 @@ static inline void bgp_distance_set_node_info(struct bgp_node *node, node->info = distance; } -static inline struct bgp_static *bgp_static_get_node_info(struct bgp_node *node) +static inline struct bgp_static * +bgp_node_get_bgp_static_info(struct bgp_node *node) { return node->info; } -static inline void bgp_static_set_node_info(struct bgp_node *node, - struct bgp_static *bgp_static) +static inline void bgp_node_set_bgp_static_info(struct bgp_node *node, + struct bgp_static *bgp_static) { node->info = bgp_static; } -- 2.39.5