summaryrefslogtreecommitdiff
path: root/lib/libfrr.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-05-31 19:25:46 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-03-24 13:02:05 +0100
commit30771d65b23e4ef15a8298357b70fc083c699750 (patch)
tree3916bace6127d166780fdd187b4908f2f7e12e7b /lib/libfrr.h
parent4c0a782d477d527fb795640225c5f22767105f32 (diff)
lib: dynamic module loading
This adds a "-M" option to each daemon, to load dynamic modules at startup. Modules are by default located in /usr/lib/frr/modules (lib64 if appropriate). Unloading or loading at runtime is not supported at this point to keep things simple. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/libfrr.h')
-rw-r--r--lib/libfrr.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/libfrr.h b/lib/libfrr.h
index d37f406f5b..71225fad38 100644
--- a/lib/libfrr.h
+++ b/lib/libfrr.h
@@ -26,6 +26,7 @@
#include "thread.h"
#include "log.h"
#include "getopt.h"
+#include "module.h"
#define FRR_NO_PRIVSEP (1 << 0)
#define FRR_NO_TCPVTY (1 << 1)
@@ -40,6 +41,7 @@ struct frr_daemon_info {
const char *name;
const char *logname;
unsigned short instance;
+ struct frrmod_runtime *module;
char *vty_addr;
int vty_port;
@@ -67,15 +69,22 @@ struct frr_daemon_info {
* i.e. "ZEBRA" or "BGP"
*
* note that this macro is also a latch-on point for other changes (e.g.
- * upcoming plugin support) that need to place some per-daemon things. Each
+ * upcoming module support) that need to place some per-daemon things. Each
* daemon should have one of these.
*/
#define FRR_DAEMON_INFO(execname, constname, ...) \
static struct frr_daemon_info execname ##_di = { \
.name = # execname, \
.logname = # constname, \
+ .module = THIS_MODULE, \
__VA_ARGS__ \
- };
+ }; \
+ FRR_COREMOD_SETUP( \
+ .name = # execname, \
+ .description = # execname " daemon", \
+ .version = FRR_VERSION, \
+ ) \
+ /* end */
extern void frr_preinit(struct frr_daemon_info *daemon,
int argc, char **argv);