summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1999-12-06 14:44:45 +0100
committerMartin Mares <mj@ucw.cz>1999-12-06 14:44:45 +0100
commit7c0cc76ed76100ef8492f13eeec1e061d52b9be0 (patch)
tree76b6fd21c4cbf507f731012bef357135966b6e76
parenta9c986f98116fef5c35d956e7a867be0735f3268 (diff)
downloadbird-7c0cc76ed76100ef8492f13eeec1e061d52b9be0.tar
bird-7c0cc76ed76100ef8492f13eeec1e061d52b9be0.zip
Moved initialization of protocol list to proto.c.
Added sysdep configuration hooks.
-rw-r--r--conf/conf.c3
-rw-r--r--conf/conf.h6
-rw-r--r--nest/proto.c1
3 files changed, 9 insertions, 1 deletions
diff --git a/conf/conf.c b/conf/conf.c
index 4e2f920..ea65183 100644
--- a/conf/conf.c
+++ b/conf/conf.c
@@ -31,7 +31,6 @@ config_alloc(byte *name)
c->pool = p;
cfg_mem = c->mem = l;
- init_list(&c->protos);
c->file_name = cfg_strdup(name);
return c;
}
@@ -45,6 +44,7 @@ config_parse(struct config *c)
if (setjmp(conf_jmpbuf))
return 0;
cf_lex_init(0);
+ sysdep_preconfig(c);
protos_preconfig(c);
rt_preconfig(c);
cf_parse();
@@ -80,6 +80,7 @@ void
config_commit(struct config *c)
{
config = c;
+ sysdep_commit(c);
rt_commit(c);
protos_commit(c);
}
diff --git a/conf/conf.h b/conf/conf.h
index 957ce44..b0a3811 100644
--- a/conf/conf.h
+++ b/conf/conf.h
@@ -18,6 +18,7 @@ struct config {
linpool *mem; /* Linear pool containing configuration data */
list protos; /* Configured protocol instances (struct proto_config) */
list tables; /* Configured routing tables (struct rtable_config) */
+ list logfiles; /* Configured log fils (sysdep) */
struct rtable_config *master_rtc; /* Configuration of master routing table */
u32 router_id; /* Our Router ID */
char *err_msg; /* Parser error message */
@@ -83,4 +84,9 @@ void cf_pop_scope(void);
int cf_parse(void);
+/* Sysdep hooks */
+
+void sysdep_preconfig(struct config *);
+void sysdep_commit(struct config *);
+
#endif
diff --git a/nest/proto.c b/nest/proto.c
index a0beb5f..ab7de0f 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -155,6 +155,7 @@ protos_preconfig(struct config *c)
init_list(&inactive_proto_list);
init_list(&initial_proto_list);
init_list(&flush_proto_list);
+ init_list(&c->protos);
debug("Protocol preconfig:");
WALK_LIST(p, protocol_list)
{