mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 04:50:29 +00:00
lib: add frr_early_init hook
To bring up bits that use thread_master before other init happens. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
d948c317c5
commit
603c61656f
@ -46,6 +46,7 @@
|
|||||||
#include "frrscript.h"
|
#include "frrscript.h"
|
||||||
#include "systemd.h"
|
#include "systemd.h"
|
||||||
|
|
||||||
|
DEFINE_HOOK(frr_early_init, (struct thread_master * tm), (tm));
|
||||||
DEFINE_HOOK(frr_late_init, (struct thread_master * tm), (tm));
|
DEFINE_HOOK(frr_late_init, (struct thread_master * tm), (tm));
|
||||||
DEFINE_HOOK(frr_config_pre, (struct thread_master * tm), (tm));
|
DEFINE_HOOK(frr_config_pre, (struct thread_master * tm), (tm));
|
||||||
DEFINE_HOOK(frr_config_post, (struct thread_master * tm), (tm));
|
DEFINE_HOOK(frr_config_post, (struct thread_master * tm), (tm));
|
||||||
@ -765,6 +766,7 @@ struct thread_master *frr_init(void)
|
|||||||
|
|
||||||
master = thread_master_create(NULL);
|
master = thread_master_create(NULL);
|
||||||
signal_init(master, di->n_signals, di->signals);
|
signal_init(master, di->n_signals, di->signals);
|
||||||
|
hook_call(frr_early_init, master);
|
||||||
|
|
||||||
#ifdef HAVE_SQLITE3
|
#ifdef HAVE_SQLITE3
|
||||||
if (!di->db_file)
|
if (!di->db_file)
|
||||||
|
@ -144,6 +144,7 @@ extern uint32_t frr_get_fd_limit(void);
|
|||||||
extern bool frr_is_startup_fd(int fd);
|
extern bool frr_is_startup_fd(int fd);
|
||||||
|
|
||||||
/* call order of these hooks is as ordered here */
|
/* call order of these hooks is as ordered here */
|
||||||
|
DECLARE_HOOK(frr_early_init, (struct thread_master * tm), (tm));
|
||||||
DECLARE_HOOK(frr_late_init, (struct thread_master * tm), (tm));
|
DECLARE_HOOK(frr_late_init, (struct thread_master * tm), (tm));
|
||||||
/* fork() happens between late_init and config_pre */
|
/* fork() happens between late_init and config_pre */
|
||||||
DECLARE_HOOK(frr_config_pre, (struct thread_master * tm), (tm));
|
DECLARE_HOOK(frr_config_pre, (struct thread_master * tm), (tm));
|
||||||
|
Loading…
Reference in New Issue
Block a user