From b21b19c5785487f2ff4a6ce38f45c2e6c35f4363 Mon Sep 17 00:00:00 2001 From: paul Date: Sun, 15 Jun 2003 01:28:29 +0000 Subject: 2003-06-15 Paul Jakma * lib/vty.{c,h}: Remove vty layer depending on a 'master' global, pass the thread master in explicitly to vty_init. Sort out some header dependency problems with lib/command.h * zebra/: Move globals to struct zebrad. Update vty_init(). * (.*)/\1_main.c: update call to vty_init(). --- zebra/main.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'zebra/main.c') diff --git a/zebra/main.c b/zebra/main.c index 85707f42..c47b83e3 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -36,8 +36,11 @@ #include "zebra/debug.h" #include "zebra/rib.h" -/* Master of threads. */ -struct thread_master *master; +/* Zebra instance */ +struct zebra_t zebrad = +{ + .rtm_table_default = 0, +}; /* process id. */ pid_t old_pid; @@ -280,7 +283,7 @@ main (int argc, char **argv) } /* Make master thread emulator. */ - master = thread_master_create (); + zebrad.master = thread_master_create (); /* privs initialise */ zprivs_init (&zserv_privs); @@ -288,7 +291,7 @@ main (int argc, char **argv) /* Vty related initialize. */ signal_init (); cmd_init (1); - vty_init (); + vty_init (zebrad.master); memory_init (); /* Zebra related initialize. */ @@ -345,7 +348,7 @@ main (int argc, char **argv) /* Make vty server socket. */ vty_serv_sock (vty_addr, vty_port, ZEBRA_VTYSH_PATH); - while (thread_fetch (master, &thread)) + while (thread_fetch (zebrad.master, &thread)) thread_call (&thread); /* Not reached... */ -- cgit v1.2.3