mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 17:18:56 +00:00
babeld: Get main to work correctly
Get main to init up in the libfrr paradigm. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
2579b2c144
commit
900b8c5802
@ -46,8 +46,6 @@ THE SOFTWARE.
|
|||||||
#include "resend.h"
|
#include "resend.h"
|
||||||
#include "babel_zebra.h"
|
#include "babel_zebra.h"
|
||||||
|
|
||||||
|
|
||||||
static void babel_init (int argc, char **argv);
|
|
||||||
static void babel_fail(void);
|
static void babel_fail(void);
|
||||||
static void babel_init_random(void);
|
static void babel_init_random(void);
|
||||||
static void babel_replace_by_null(int fd);
|
static void babel_replace_by_null(int fd);
|
||||||
@ -85,6 +83,7 @@ static zebra_capabilities_t _caps_p [] =
|
|||||||
ZCAP_NET_RAW,
|
ZCAP_NET_RAW,
|
||||||
ZCAP_BIND
|
ZCAP_BIND
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct zebra_privs_t babeld_privs =
|
static struct zebra_privs_t babeld_privs =
|
||||||
{
|
{
|
||||||
#if defined(FRR_USER)
|
#if defined(FRR_USER)
|
||||||
@ -97,7 +96,7 @@ static struct zebra_privs_t babeld_privs =
|
|||||||
.vty_group = VTY_GROUP,
|
.vty_group = VTY_GROUP,
|
||||||
#endif
|
#endif
|
||||||
.caps_p = _caps_p,
|
.caps_p = _caps_p,
|
||||||
.cap_num_p = 2,
|
.cap_num_p = array_size(_caps_p),
|
||||||
.cap_num_i = 0
|
.cap_num_i = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -149,23 +148,10 @@ FRR_DAEMON_INFO(babeld, BABELD,
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
struct thread thread;
|
int rc;
|
||||||
/* and print banner too */
|
|
||||||
babel_init(argc, argv);
|
|
||||||
while (thread_fetch (master, &thread)) {
|
|
||||||
thread_call (&thread);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* make initialisations witch don't need infos about kernel(interfaces, etc.) */
|
frr_preinit (&babeld_di, argc, argv);
|
||||||
static void
|
frr_opt_add ("", longopts, "");
|
||||||
babel_init(int argc, char **argv)
|
|
||||||
{
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
frr_preinit (&babeld_di, argc, argv);
|
|
||||||
frr_opt_add ("", longopts, "");
|
|
||||||
|
|
||||||
babel_init_random();
|
babel_init_random();
|
||||||
|
|
||||||
@ -193,7 +179,7 @@ babel_init(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* create the threads handler */
|
/* create the threads handler */
|
||||||
master = thread_master_create ();
|
master = frr_init ();
|
||||||
|
|
||||||
/* Library inits. */
|
/* Library inits. */
|
||||||
zprivs_init (&babeld_privs);
|
zprivs_init (&babeld_privs);
|
||||||
@ -222,6 +208,11 @@ babel_init(int argc, char **argv)
|
|||||||
schedule_neighbours_check(5000, 1);
|
schedule_neighbours_check(5000, 1);
|
||||||
|
|
||||||
zlog_notice ("BABELd %s starting: vty@%d", BABEL_VERSION, babel_vty_port);
|
zlog_notice ("BABELd %s starting: vty@%d", BABEL_VERSION, babel_vty_port);
|
||||||
|
|
||||||
|
frr_config_fork();
|
||||||
|
frr_run(master);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user