diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2019-07-02 18:05:27 +0200 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2019-07-02 18:05:27 +0200 |
commit | 307fc4259a4945a857170547ff3ab50b2c162cbc (patch) | |
tree | f6c73eb5307dd6f397affb9a0be8756c9b35bc88 | |
parent | bfdd: convert `bfd` command to northbound (diff) | |
download | frr-307fc4259a4945a857170547ff3ab50b2c162cbc.tar.xz frr-307fc4259a4945a857170547ff3ab50b2c162cbc.zip |
bfdd: fix some CI warnings
Use `static` functions for file local functions to please `check_patch.pl`.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
-rw-r--r-- | bfdd/bfd.c | 16 | ||||
-rw-r--r-- | bfdd/bfdd_northbound.c | 22 |
2 files changed, 14 insertions, 24 deletions
diff --git a/bfdd/bfd.c b/bfdd/bfd.c index fc9d03343..5d143d4e5 100644 --- a/bfdd/bfd.c +++ b/bfdd/bfd.c @@ -1289,8 +1289,6 @@ static unsigned int bfd_key_hash_do(const void *p); static void _bfd_free(struct hash_bucket *hb, void *arg __attribute__((__unused__))); -int _bfd_session_next(struct hash_bucket *hb, void *arg); -void _bfd_session_remove_manual(struct hash_bucket *hb, void *arg); /* BFD hash for our discriminator. */ static unsigned int bfd_id_hash_do(const void *p) @@ -1343,9 +1341,10 @@ struct bfd_key_walk_partial_lookup { }; /* ignore some parameters */ -static int bfd_key_lookup_ignore_partial_walker(struct hash_bucket *b, void *data) +static int bfd_key_lookup_ignore_partial_walker(struct hash_bucket *b, + void *data) { - struct bfd_key_walk_partial_lookup *ctx = + struct bfd_key_walk_partial_lookup *ctx = (struct bfd_key_walk_partial_lookup *)data; struct bfd_session *given = ctx->given; struct bfd_session *parsed = b->data; @@ -1354,7 +1353,8 @@ static int bfd_key_lookup_ignore_partial_walker(struct hash_bucket *b, void *dat return HASHWALK_CONTINUE; if (given->key.mhop != parsed->key.mhop) return HASHWALK_CONTINUE; - if (memcmp(&given->key.peer, &parsed->key.peer, sizeof(struct in6_addr))) + if (memcmp(&given->key.peer, &parsed->key.peer, + sizeof(struct in6_addr))) return HASHWALK_CONTINUE; if (memcmp(given->key.vrfname, parsed->key.vrfname, MAXNAMELEN)) return HASHWALK_CONTINUE; @@ -1538,7 +1538,7 @@ struct bfd_session_iterator { const struct bfd_session *bsi_bs; }; -int _bfd_session_next(struct hash_bucket *hb, void *arg) +static int _bfd_session_next(struct hash_bucket *hb, void *arg) { struct bfd_session_iterator *bsi = arg; struct bfd_session *bs = hb->data; @@ -1588,8 +1588,8 @@ const struct bfd_session *bfd_session_next(const struct bfd_session *bs, return bsi.bsi_bs; } -void _bfd_session_remove_manual(struct hash_bucket *hb, - void *arg __attribute__((__unused__))) +static void _bfd_session_remove_manual(struct hash_bucket *hb, + void *arg __attribute__((__unused__))) { struct bfd_session *bs = hb->data; diff --git a/bfdd/bfdd_northbound.c b/bfdd/bfdd_northbound.c index cb097248c..7cd2fb6b9 100644 --- a/bfdd/bfdd_northbound.c +++ b/bfdd/bfdd_northbound.c @@ -28,20 +28,10 @@ #include "bfd.h" /* - * Prototypes. - */ -void bfd_session_get_key(bool mhop, const struct lyd_node *dnode, - struct bfd_key *bk); -int bfd_session_create(enum nb_event event, const struct lyd_node *dnode, - union nb_resource *resource, bool mhop); -int bfd_session_destroy(enum nb_event event, const struct lyd_node *dnode, - bool mhop); - -/* * Helpers. */ -void bfd_session_get_key(bool mhop, const struct lyd_node *dnode, - struct bfd_key *bk) +static void bfd_session_get_key(bool mhop, const struct lyd_node *dnode, + struct bfd_key *bk) { const char *ifname = NULL, *vrfname = NULL; struct sockaddr_any psa, lsa; @@ -64,8 +54,8 @@ void bfd_session_get_key(bool mhop, const struct lyd_node *dnode, gen_bfd_key(bk, &psa, &lsa, mhop, ifname, vrfname); } -int bfd_session_create(enum nb_event event, const struct lyd_node *dnode, - union nb_resource *resource, bool mhop) +static int bfd_session_create(enum nb_event event, const struct lyd_node *dnode, + union nb_resource *resource, bool mhop) { struct bfd_session *bs; struct bfd_key bk; @@ -126,8 +116,8 @@ int bfd_session_create(enum nb_event event, const struct lyd_node *dnode, return NB_OK; } -int bfd_session_destroy(enum nb_event event, const struct lyd_node *dnode, - bool mhop) +static int bfd_session_destroy(enum nb_event event, + const struct lyd_node *dnode, bool mhop) { struct bfd_session *bs; struct bfd_key bk; |