diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2016-06-12 17:31:50 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2017-03-25 08:52:28 +0100 |
| commit | a5b38c5bd252ab7bf2294a2303ce845df40d82dd (patch) | |
| tree | 5bd23b8f1f0c9876e3ffe94e8d03364a165a1271 /lib/libfrr.c | |
| parent | b249c083d53ef25c54f4347f656daebf61827581 (diff) | |
lib: add hook infrastructure
Please refer to lib/hook.h for a description/documentation.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/libfrr.c')
| -rw-r--r-- | lib/libfrr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libfrr.c b/lib/libfrr.c index 5c047040ae..64f8be2ca6 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -30,6 +30,8 @@ #include "log_int.h" #include "module.h" +DEFINE_HOOK(frr_late_init, (struct thread_master *tm), (tm)) + const char frr_sysconfdir[] = SYSCONFDIR; const char frr_vtydir[] = DAEMON_VTY_DIR; @@ -311,9 +313,9 @@ int frr_getopt(int argc, char * const argv[], int *longindex) return opt; } +static struct thread_master *master; struct thread_master *frr_init(void) { - struct thread_master *master; struct option_chain *oc; struct frrmod_runtime *module; char moderr[256]; @@ -354,6 +356,8 @@ struct thread_master *frr_init(void) void frr_config_fork(void) { + hook_call(frr_late_init, master); + if (di->instance) { snprintf(config_default, sizeof(config_default), "%s/%s-%d.conf", frr_sysconfdir, di->name, di->instance); |
