From 31b3e1bbf5bc823ec5cf6d88931132f00e6c52b9 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 5 Feb 1999 21:37:34 +0000 Subject: Implemented new configuration/reconfiguration interface and defined protocol state machines. Full explanation will follow soon. --- sysdep/unix/main.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'sysdep') 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 + * (c) 1998--1999 Martin Mares * * 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(); -- cgit v1.2.3