summaryrefslogtreecommitdiff
path: root/bgpd/bgp_addpath.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2020-03-20 11:57:54 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2020-03-21 14:59:18 +0200
commit3dc339cdc2686a1fe6008acd827f9f5ba11a9fed (patch)
treee405af3f4d5ea456eeb19ef6f3dc629060b66a0e /bgpd/bgp_addpath.c
parent09fdbbe98cf143a5cf0418d6f804646ee00a9e4d (diff)
bgpd: Convert lots of int type functions to bool/void
Some were converted to bool, where true/false status is needed. Converted to void only those, where the return status was only false or true. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'bgpd/bgp_addpath.c')
-rw-r--r--bgpd/bgp_addpath.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/bgpd/bgp_addpath.c b/bgpd/bgp_addpath.c
index aaa77b04dc..75fdb0bb44 100644
--- a/bgpd/bgp_addpath.c
+++ b/bgpd/bgp_addpath.c
@@ -65,8 +65,8 @@ bgp_addpath_names(enum bgp_addpath_strat strat)
/*
* Returns if any peer is transmitting addpaths for a given afi/safi.
*/
-int bgp_addpath_is_addpath_used(struct bgp_addpath_bgp_data *d, afi_t afi,
- safi_t safi)
+bool bgp_addpath_is_addpath_used(struct bgp_addpath_bgp_data *d, afi_t afi,
+ safi_t safi)
{
return d->total_peercount[afi][safi] > 0;
}
@@ -123,15 +123,15 @@ uint32_t bgp_addpath_id_for_peer(struct peer *peer, afi_t afi, safi_t safi,
* Returns true if the path has an assigned addpath ID for any of the addpath
* strategies.
*/
-int bgp_addpath_info_has_ids(struct bgp_addpath_info_data *d)
+bool bgp_addpath_info_has_ids(struct bgp_addpath_info_data *d)
{
int i;
for (i = 0; i < BGP_ADDPATH_MAX; i++)
if (d->addpath_tx_id[i] != 0)
- return 1;
+ return true;
- return 0;
+ return false;
}
/*
@@ -152,7 +152,7 @@ void bgp_addpath_free_node_data(struct bgp_addpath_bgp_data *bd,
/*
* Check to see if the addpath strategy requires DMED to be configured to work.
*/
-int bgp_addpath_dmed_required(int strategy)
+bool bgp_addpath_dmed_required(int strategy)
{
return strategy == BGP_ADDPATH_BEST_PER_AS;
}
@@ -161,21 +161,20 @@ int bgp_addpath_dmed_required(int strategy)
* Return true if this is a path we should advertise due to a
* configured addpath-tx knob
*/
-int bgp_addpath_tx_path(enum bgp_addpath_strat strat,
- struct bgp_path_info *pi)
+bool bgp_addpath_tx_path(enum bgp_addpath_strat strat, struct bgp_path_info *pi)
{
switch (strat) {
case BGP_ADDPATH_NONE:
- return 0;
+ return false;
case BGP_ADDPATH_ALL:
- return 1;
+ return true;
case BGP_ADDPATH_BEST_PER_AS:
if (CHECK_FLAG(pi->flags, BGP_PATH_DMED_SELECTED))
- return 1;
+ return true;
else
- return 0;
+ return false;
default:
- return 0;
+ return false;
}
}