summaryrefslogtreecommitdiff
path: root/lib/agentx.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@users.noreply.github.com>2021-02-24 13:24:33 -0500
committerGitHub <noreply@github.com>2021-02-24 13:24:33 -0500
commit7a32a3ec534d3751e0e6928b34b454ed13e44b00 (patch)
treefe48ada40b022151cefc13b2d5b4655d9c98c8b0 /lib/agentx.c
parent0ff791138668c50a1c60b209333091682d8926d3 (diff)
parentec48460efdb0d8f4b184a13d7836826f5f82767a (diff)
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 5351f8bda2..c8d7d75a81 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)
{