diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/agentx.c | 11 | ||||
-rw-r--r-- | lib/smux.h | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/agentx.c b/lib/agentx.c index bdf0d9716..5f6245980 100644 --- a/lib/agentx.c +++ b/lib/agentx.c @@ -32,6 +32,8 @@ #include "linklist.h" #include "lib/version.h" #include "lib_errors.h" +#include "hook.h" +#include "libfrr.h" #include "xref.h" XREF_SETUP(); @@ -245,6 +247,13 @@ DEFUN (no_agentx, return CMD_WARNING_CONFIG_FAILED; } +static int smux_disable(void) +{ + agentx_enabled = false; + + return 0; +} + bool smux_enabled(void) { return agentx_enabled; @@ -264,6 +273,8 @@ void smux_init(struct thread_master *tm) install_node(&agentx_node); install_element(CONFIG_NODE, &agentx_enable_cmd); install_element(CONFIG_NODE, &no_agentx_cmd); + + hook_register(frr_early_fini, smux_disable); } void smux_agentx_enable(void) diff --git a/lib/smux.h b/lib/smux.h index 27f03b685..1d73406a2 100644 --- a/lib/smux.h +++ b/lib/smux.h @@ -109,6 +109,9 @@ struct index_oid { #define SNMP_IP6ADDRESS(V) (*var_len = sizeof(struct in6_addr), (uint8_t *)&V) +/* + * Check to see if snmp is enabled or not + */ extern bool smux_enabled(void); extern void smux_init(struct thread_master *tm); |