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 <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2018-11-16 08:46:19 -05:00
parent b613a9183f
commit 5a8ba9fc0a
3 changed files with 30 additions and 25 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;
}