summaryrefslogtreecommitdiff
path: root/lib/agentx.c
diff options
context:
space:
mode:
authorKaren Schoener <karen@voltanet.io>2021-02-05 16:05:36 -0500
committerKaren Schoener <karen@voltanet.io>2021-02-16 11:53:42 -0500
commitec48460efdb0d8f4b184a13d7836826f5f82767a (patch)
tree053639e48ca08f515809c9619126010bfbea2c41 /lib/agentx.c
parent658186e8b6ad84bd92fa46201901cf75bf3174c2 (diff)
lib: add agentx_enabled hook
Adding agentx_enabled hook. This permits the main LDP process to signal the lde and ldpe processes when agentx is enabled. Signed-off-by: Karen Schoener <karen@voltanet.io>
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 f049d699a8..4f5a1d1847 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)
{