diff options
author | Karen Schoener <karen@voltanet.io> | 2021-02-24 23:24:35 +0100 |
---|---|---|
committer | Karen Schoener <karen@voltanet.io> | 2021-02-24 23:34:05 +0100 |
commit | f9a4d683dca57ba7c58d416d73f03acd86acb1b0 (patch) | |
tree | 1582eadf6584ebfed489b99482e17ce6341d8eb1 /ldpd/ldpd.c | |
parent | Merge pull request #7957 from idryzhov/ospf-instance (diff) | |
download | frr-f9a4d683dca57ba7c58d416d73f03acd86acb1b0.tar.xz frr-f9a4d683dca57ba7c58d416d73f03acd86acb1b0.zip |
ldpd: Add support for read-only snmp mib objects (excluding statistics)
Add support for read-only snmp mib objects as described in RFC 3815,
excluding statistics.
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Karen Schoener <karen@voltanet.io>
Diffstat (limited to 'ldpd/ldpd.c')
-rw-r--r-- | ldpd/ldpd.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c index 83e93ebbb..14235a0f1 100644 --- a/ldpd/ldpd.c +++ b/ldpd/ldpd.c @@ -86,6 +86,30 @@ static struct imsgev *iev_lde, *iev_lde_sync; static pid_t ldpe_pid; static pid_t lde_pid; +static struct frr_daemon_info ldpd_di; + +DEFINE_HOOK(ldp_register_mib, (struct thread_master * tm), (tm)) + +static void ldp_load_module(const char *name) +{ + const char *dir; + dir = ldpd_di.module_path ? ldpd_di.module_path : frr_moduledir; + char moderr[256]; + struct frrmod_runtime *module; + + module = frrmod_load(name, dir, moderr, sizeof(moderr)); + if (!module) { + fprintf(stderr, "%s: failed to load %s", __func__, name); + log_warnx("%s: failed to load %s", __func__, name); + } +} + +void ldp_agentx_enabled(void) +{ + ldp_load_module("snmp"); + hook_call(ldp_register_mib, master); +} + enum ldpd_process ldpd_process; #define LDP_DEFAULT_CONFIG "ldpd.conf" @@ -94,8 +118,6 @@ enum ldpd_process ldpd_process; /* Master of threads. */ struct thread_master *master; -static struct frr_daemon_info ldpd_di; - /* ldpd privileges */ static zebra_capabilities_t _caps_p [] = { @@ -1343,6 +1365,9 @@ merge_global(struct ldpd_conf *conf, struct ldpd_conf *xconf) ldpe_reset_ds_nbrs(); } + if (ldpd_process == PROC_LDP_ENGINE) + ldpe_set_config_change_time(); + conf->flags = xconf->flags; } |