summaryrefslogtreecommitdiffstats
path: root/sysdep
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1999-02-05 22:37:34 +0100
committerMartin Mares <mj@ucw.cz>1999-02-05 22:37:34 +0100
commit31b3e1bbf5bc823ec5cf6d88931132f00e6c52b9 (patch)
treeb3c3da837ca2079a222dfc99ab479bd040ba21ad /sysdep
parentc4c63eecc37a744c53c23da89b1ba09b9640cb6e (diff)
downloadbird-31b3e1bbf5bc823ec5cf6d88931132f00e6c52b9.tar
bird-31b3e1bbf5bc823ec5cf6d88931132f00e6c52b9.zip
Implemented new configuration/reconfiguration interface and defined protocol
state machines. Full explanation will follow soon.
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/unix/main.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index bea479c..96e6cf9 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -1,7 +1,7 @@
/*
* BIRD Internet Routing Daemon -- Unix Entry Point
*
- * (c) 1998 Martin Mares <mj@ucw.cz>
+ * (c) 1998--1999 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
@@ -74,18 +74,17 @@ cf_read(byte *dest, unsigned int len)
static void
read_config(void)
{
- cf_lex_init_tables();
- cf_allocate();
+ struct config *conf = config_alloc(PATH_CONFIG);
+
conf_fd = open(PATH_CONFIG, O_RDONLY);
if (conf_fd < 0)
die("Unable to open configuration file " PATH_CONFIG ": %m");
- protos_preconfig();
cf_read_hook = cf_read;
- cf_lex_init(1);
- cf_parse();
- filters_postconfig();
- protos_postconfig();
+ if (!config_parse(conf))
+ die(PATH_CONFIG ", line %d: %s", conf->err_lino, conf->err_msg);
+ config_commit(conf);
}
+
/*
* Hic Est main()
*/
@@ -105,15 +104,12 @@ main(void)
protos_build();
add_tail(&protocol_list, &proto_unix_kernel.n);
- protos_init();
- debug("Reading configuration file.\n");
read_config();
signal_init();
scan_if_init();
- auto_router_id();
protos_start();