summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_debug.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-05-05 17:31:33 +0200
committerDonald Sharp <sharpd@nvidia.com>2022-05-13 14:40:41 +0200
commitd032ddcedc421eb20e77cc008055a01ac66b3ff4 (patch)
tree018c1420ec57b7600cb9c9e1efa248455f97e1f2 /bgpd/bgp_debug.c
parentMerge pull request #11197 from opensourcerouting/feature/gr_notification_docs (diff)
downloadfrr-d032ddcedc421eb20e77cc008055a01ac66b3ff4.tar.xz
frr-d032ddcedc421eb20e77cc008055a01ac66b3ff4.zip
bgpd: Make bgp_debug.[ch] take `const struct peer *` and return bool
Several functions in bgp_debug.[ch] take a const struct peer * and also return a bool instead of an int. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_debug.c')
-rw-r--r--bgpd/bgp_debug.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c
index 57f37c173..cd6ba0084 100644
--- a/bgpd/bgp_debug.c
+++ b/bgpd/bgp_debug.c
@@ -2576,9 +2576,9 @@ static int bgp_debug_per_prefix(const struct prefix *p,
/* Return true if this peer is on the per_peer_list of peers to debug
* for BGP_DEBUG_TYPE
*/
-static int bgp_debug_per_peer(char *host, unsigned long term_bgp_debug_type,
- unsigned int BGP_DEBUG_TYPE,
- struct list *per_peer_list)
+static bool bgp_debug_per_peer(char *host, unsigned long term_bgp_debug_type,
+ unsigned int BGP_DEBUG_TYPE,
+ struct list *per_peer_list)
{
struct bgp_debug_filter *filter;
struct listnode *node, *nnode;
@@ -2586,25 +2586,25 @@ static int bgp_debug_per_peer(char *host, unsigned long term_bgp_debug_type,
if (term_bgp_debug_type & BGP_DEBUG_TYPE) {
/* We are debugging all peers so return true */
if (!per_peer_list || list_isempty(per_peer_list))
- return 1;
+ return true;
else {
if (!host)
- return 0;
+ return false;
for (ALL_LIST_ELEMENTS(per_peer_list, node, nnode,
filter))
if (strcmp(filter->host, host) == 0)
- return 1;
+ return true;
- return 0;
+ return false;
}
}
- return 0;
+ return false;
}
-int bgp_debug_neighbor_events(struct peer *peer)
+bool bgp_debug_neighbor_events(const struct peer *peer)
{
char *host = NULL;
@@ -2616,7 +2616,7 @@ int bgp_debug_neighbor_events(struct peer *peer)
bgp_debug_neighbor_events_peers);
}
-int bgp_debug_keepalive(struct peer *peer)
+bool bgp_debug_keepalive(const struct peer *peer)
{
char *host = NULL;
@@ -2628,7 +2628,7 @@ int bgp_debug_keepalive(struct peer *peer)
bgp_debug_keepalive_peers);
}
-bool bgp_debug_update(struct peer *peer, const struct prefix *p,
+bool bgp_debug_update(const struct peer *peer, const struct prefix *p,
struct update_group *updgrp, unsigned int inbound)
{
char *host = NULL;