]> git.proxmox.com Git - mirror_frr.git/blobdiff - ldpd/ldpe.c
ldpd: Add support for read-only snmp mib objects (excluding statistics)
[mirror_frr.git] / ldpd / ldpe.c
index 6a5a0750bd007f2cc281ea33c4ca80f44b064ae2..d09eb2fa33e84c00320467e93bb08bce4f88aa2e 100644 (file)
@@ -33,6 +33,7 @@
 #include "memory.h"
 #include "privs.h"
 #include "sigevent.h"
+#include "libfrr.h"
 
 static void     ldpe_shutdown(void);
 static int      ldpe_dispatch_main(struct thread *);
@@ -103,15 +104,13 @@ char *pkt_ptr; /* packet buffer */
 void
 ldpe(void)
 {
-       struct thread            thread;
-
 #ifdef HAVE_SETPROCTITLE
        setproctitle("ldp engine");
 #endif
        ldpd_process = PROC_LDP_ENGINE;
        log_procname = log_procnames[ldpd_process];
 
-       master = thread_master_create(NULL);
+       master = frr_init();
 
        /* setup signal handler */
        signal_init(master, array_size(ldpe_signals), ldpe_signals);
@@ -133,9 +132,12 @@ ldpe(void)
        /* create base configuration */
        leconf = config_new_empty();
 
-       /* Fetch next active thread. */
+       struct thread thread;
        while (thread_fetch(master, &thread))
                thread_call(&thread);
+
+       /* NOTREACHED */
+       return;
 }
 
 void
@@ -387,6 +389,9 @@ ldpe_dispatch_main(struct thread *thread)
                        memcpy(&init, imsg.data, sizeof(init));
                        ldpe_init(&init);
                        break;
+               case IMSG_AGENTX_ENABLED:
+                       ldp_agentx_enabled();
+                       break;
                case IMSG_CLOSE_SOCKETS:
                        af = imsg.hdr.peerid;
 
@@ -1073,3 +1078,10 @@ ldpe_check_filter_af(int af, struct ldpd_af_conf *af_conf,
        if (strcmp(af_conf->acl_thello_accept_from, filter_name) == 0)
                ldpe_remove_dynamic_tnbrs(af);
 }
+
+void
+ldpe_set_config_change_time(void)
+{
+       /* SNMP update time when ever there is a config change */
+       leconf->config_change_time = time(NULL);
+}