diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2016-11-14 09:56:02 +0900 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2017-03-08 00:15:39 +0100 |
| commit | 16077f2fc5f4d73648b4ebef877e1f021864358d (patch) | |
| tree | 73d9eb31cab0943147924a5d93c938021682df36 /lib/libfrr.c | |
| parent | eb05883f3ecd94be017eb7d15181a989f26541ee (diff) | |
*: add frr_run()
Contains the fetch-and-run-thread logic, and vty startup (which is the
last thing happening before entering the main loop).
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/libfrr.c')
| -rw-r--r-- | lib/libfrr.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/libfrr.c b/lib/libfrr.c index ad85c6f89a..570d9724d7 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -369,3 +369,24 @@ void frr_vty_serv(void) vty_serv_sock(di->vty_addr, di->vty_port, di->vty_path); } +void frr_run(struct thread_master *master) +{ + char instanceinfo[64] = ""; + + frr_vty_serv(); + + if (di->instance) + snprintf(instanceinfo, sizeof(instanceinfo), "instance %u ", + di->instance); + + zlog_notice("%s %s starting: %svty@%d%s", + di->name, + FRR_VERSION, + instanceinfo, + di->vty_port, + di->startinfo); + + struct thread thread; + while (thread_fetch(master, &thread)) + thread_call(&thread); +} |
