diff options
author | Quentin Young <qlyoung@users.noreply.github.com> | 2021-02-24 19:24:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-24 19:24:33 +0100 |
commit | 7a32a3ec534d3751e0e6928b34b454ed13e44b00 (patch) | |
tree | fe48ada40b022151cefc13b2d5b4655d9c98c8b0 /lib/agentx.c | |
parent | Merge pull request #7879 from AnuradhaKaruppiah/advertise-svi-mac (diff) | |
parent | lib: add agentx_enabled hook (diff) | |
download | frr-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.c | 13 |
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) { |