summaryrefslogtreecommitdiffstats
path: root/lib/agentx.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@users.noreply.github.com>2021-02-24 19:24:33 +0100
committerGitHub <noreply@github.com>2021-02-24 19:24:33 +0100
commit7a32a3ec534d3751e0e6928b34b454ed13e44b00 (patch)
treefe48ada40b022151cefc13b2d5b4655d9c98c8b0 /lib/agentx.c
parentMerge pull request #7879 from AnuradhaKaruppiah/advertise-svi-mac (diff)
parentlib: add agentx_enabled hook (diff)
downloadfrr-7a32a3ec534d3751e0e6928b34b454ed13e44b00.tar.xz
frr-7a32a3ec534d3751e0e6928b34b454ed13e44b00.zip
Merge pull request #8023 from volta-networks/feat_add_agentx_enabled_hook
lib: add agentx_enabled hook
Diffstat (limited to 'lib/agentx.c')
-rw-r--r--lib/agentx.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/agentx.c b/lib/agentx.c
index 5351f8bda..c8d7d75a8 100644
--- a/lib/agentx.c
+++ b/lib/agentx.c
@@ -36,6 +36,8 @@
XREF_SETUP()
+DEFINE_HOOK(agentx_enabled, (), ())
+
static int agentx_enabled = 0;
static struct thread_master *agentx_tm;
@@ -226,6 +228,7 @@ DEFUN (agentx_enable,
events = list_new();
agentx_events_update();
agentx_enabled = 1;
+ hook_call(agentx_enabled);
}
return CMD_SUCCESS;
@@ -259,6 +262,16 @@ void smux_init(struct thread_master *tm)
install_element(CONFIG_NODE, &no_agentx_cmd);
}
+void smux_agentx_enable(void)
+{
+ if (!agentx_enabled) {
+ init_snmp(FRR_SMUX_NAME);
+ events = list_new();
+ agentx_events_update();
+ agentx_enabled = 1;
+ }
+}
+
void smux_register_mib(const char *descr, struct variable *var, size_t width,
int num, oid name[], size_t namelen)
{