diff options
author | Donald Sharp <donaldsharp72@gmail.com> | 2023-02-15 13:24:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-15 13:24:35 +0100 |
commit | 7bdeb1cd8470b0ff4b95c9f5788cdabad35ac722 (patch) | |
tree | 44991eb596a7b54ef120f16c1bcd9b4431e2a78f /babeld | |
parent | Merge pull request #12494 from louis-6wind/ext_admin_group (diff) | |
parent | babeld: changes for code maintainability (diff) | |
download | frr-7bdeb1cd8470b0ff4b95c9f5788cdabad35ac722.tar.xz frr-7bdeb1cd8470b0ff4b95c9f5788cdabad35ac722.zip |
Merge pull request #12802 from sri-mohan1/sri-bable
babeld: changes for code maintainability
Diffstat (limited to 'babeld')
-rw-r--r-- | babeld/babel_interface.c | 12 | ||||
-rw-r--r-- | babeld/babel_interface.h | 2 | ||||
-rw-r--r-- | babeld/babel_zebra.c | 16 | ||||
-rw-r--r-- | babeld/babeld.c | 2 |
4 files changed, 17 insertions, 15 deletions
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c index 53dcbb834..e8be854f8 100644 --- a/babeld/babel_interface.c +++ b/babeld/babel_interface.c @@ -66,7 +66,7 @@ static vector babel_enable_if; /* enable interfaces (by cmd). */ int babel_ifp_up(struct interface *ifp) { - debugf(BABEL_DEBUG_IF, "receive a 'interface up'"); + debugf(BABEL_DEBUG_IF, "receive an 'interface up'"); interface_recalculate(ifp); return 0; @@ -75,7 +75,7 @@ int babel_ifp_up(struct interface *ifp) int babel_ifp_down(struct interface *ifp) { - debugf(BABEL_DEBUG_IF, "receive a 'interface down'"); + debugf(BABEL_DEBUG_IF, "receive an 'interface down'"); if (ifp == NULL) { return 0; @@ -87,7 +87,7 @@ babel_ifp_down(struct interface *ifp) int babel_ifp_create (struct interface *ifp) { - debugf(BABEL_DEBUG_IF, "receive a 'interface add'"); + debugf(BABEL_DEBUG_IF, "receive an 'interface add'"); interface_recalculate(ifp); @@ -97,7 +97,7 @@ int babel_ifp_create (struct interface *ifp) int babel_ifp_destroy(struct interface *ifp) { - debugf(BABEL_DEBUG_IF, "receive a 'interface delete'"); + debugf(BABEL_DEBUG_IF, "receive an 'interface delete'"); if (IS_ENABLE(ifp)) interface_reset(ifp); @@ -112,7 +112,7 @@ babel_interface_address_add (ZAPI_CALLBACK_ARGS) struct connected *ifc; struct prefix *prefix; - debugf(BABEL_DEBUG_IF, "receive a 'interface address add'"); + debugf(BABEL_DEBUG_IF, "receive an 'interface address add'"); ifc = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_ADD, zclient->ibuf, vrf_id); @@ -148,7 +148,7 @@ babel_interface_address_delete (ZAPI_CALLBACK_ARGS) struct connected *ifc; struct prefix *prefix; - debugf(BABEL_DEBUG_IF, "receive a 'interface address delete'"); + debugf(BABEL_DEBUG_IF, "receive an 'interface address delete'"); ifc = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_DELETE, zclient->ibuf, vrf_id); diff --git a/babeld/babel_interface.h b/babeld/babel_interface.h index 983382792..cf85310be 100644 --- a/babeld/babel_interface.h +++ b/babeld/babel_interface.h @@ -100,7 +100,7 @@ if_up(struct interface *ifp) { return (if_is_operative(ifp) && ifp->connected != NULL && - (babel_get_if_nfo(ifp)->flags & BABEL_IF_IS_UP)); + CHECK_FLAG(babel_get_if_nfo(ifp)->flags, BABEL_IF_IS_UP)); } struct buffered_update { diff --git a/babeld/babel_zebra.c b/babeld/babel_zebra.c index daaa870a6..bc8274d21 100644 --- a/babeld/babel_zebra.c +++ b/babeld/babel_zebra.c @@ -139,7 +139,7 @@ DEFUN (debug_babel, for(i = 0; debug_type[i].str != NULL; i++) { if (strncmp (debug_type[i].str, argv[2]->arg, debug_type[i].str_min_len) == 0) { - debug |= debug_type[i].type; + SET_FLAG(debug, debug_type[i].type); return CMD_SUCCESS; } } @@ -169,7 +169,7 @@ DEFUN (no_debug_babel, for (i = 0; debug_type[i].str; i++) { if (strncmp(debug_type[i].str, argv[3]->arg, debug_type[i].str_min_len) == 0) { - debug &= ~debug_type[i].type; + UNSET_FLAG(debug, debug_type[i].type); return CMD_SUCCESS; } } @@ -195,16 +195,18 @@ debug_babel_config_write (struct vty * vty) lines++; } else + { for (i = 0; debug_type[i].str != NULL; i++) - if - ( - debug_type[i].type != BABEL_DEBUG_ALL - && CHECK_FLAG (debug, debug_type[i].type) - ) + { + if (debug_type[i].type != BABEL_DEBUG_ALL + && CHECK_FLAG (debug, debug_type[i].type)) { vty_out (vty, "debug babel %s\n", debug_type[i].str); lines++; } + } + } + if (lines) { vty_out (vty, "!\n"); diff --git a/babeld/babeld.c b/babeld/babeld.c index 972d52819..81a1eb0e4 100644 --- a/babeld/babeld.c +++ b/babeld/babeld.c @@ -277,7 +277,7 @@ babel_get_myid(void) exit(1); } /* Clear group and global bits */ - myid[0] &= ~3; + UNSET_FLAG (myid[0], 3); } /* Make some noise so that others notice us, and send retractions in |