summaryrefslogtreecommitdiff
path: root/sysdep/unix
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1998-12-06 17:40:42 +0000
committerMartin Mares <mj@ucw.cz>1998-12-06 17:40:42 +0000
commit980ffedbb04bf3beedf147fc7dfed40cdbf968aa (patch)
tree075cadebb6c03fe359f77f51dc11d5e06d66f95f /sysdep/unix
parent0846203e896d8ab009217968e391b5e13ea3c4c6 (diff)
Kernel syncer is now configurable. It will probably need some more
options, but at least basic tuning is possible now.
Diffstat (limited to 'sysdep/unix')
-rw-r--r--sysdep/unix/Modules1
-rw-r--r--sysdep/unix/krt.Y34
-rw-r--r--sysdep/unix/krt.h2
-rw-r--r--sysdep/unix/main.c2
-rw-r--r--sysdep/unix/sync-rt.c3
5 files changed, 41 insertions, 1 deletions
diff --git a/sysdep/unix/Modules b/sysdep/unix/Modules
index 70ed1454..441c3f07 100644
--- a/sysdep/unix/Modules
+++ b/sysdep/unix/Modules
@@ -5,6 +5,7 @@ io.c
unix.h
sync-if.c
sync-rt.c
+krt.Y
krt.h
krt-set.c
krt-set.h
diff --git a/sysdep/unix/krt.Y b/sysdep/unix/krt.Y
new file mode 100644
index 00000000..d4dd0824
--- /dev/null
+++ b/sysdep/unix/krt.Y
@@ -0,0 +1,34 @@
+/*
+ * BIRD -- UNIX Kernel Syncer Configuration
+ *
+ * (c) 1998 Martin Mares <mj@ucw.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+CF_HDR
+
+#include "lib/krt.h"
+
+CF_DECLS
+
+CF_KEYWORDS(KERNEL)
+
+CF_GRAMMAR
+
+/* Kernel protocol */
+
+CF_ADDTO(proto, kern_proto '}')
+
+kern_proto_start: proto_start KERNEL {
+ if (!(this_proto = cf_krt_proto)) cf_error("Kernel protocol already defined");
+ cf_krt_proto = NULL;
+ }
+ ;
+
+CF_ADDTO(kern_proto, kern_proto_start '{')
+CF_ADDTO(kern_proto, kern_proto proto_item ';')
+
+CF_CODE
+
+CF_END
diff --git a/sysdep/unix/krt.h b/sysdep/unix/krt.h
index e7b55974..2da29e5d 100644
--- a/sysdep/unix/krt.h
+++ b/sysdep/unix/krt.h
@@ -22,6 +22,8 @@ struct krt_proto {
struct krt_scan_params scanopt;
};
+extern struct proto *cf_krt_proto;
+
/* krt-scan.c */
void krt_scan_preconfig(struct krt_proto *);
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index 4aeb9c19..f5076c41 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -82,7 +82,6 @@ read_config(void)
cf_read_hook = cf_read;
cf_lex_init(1);
cf_parse();
- add_tail(&protocol_list, &proto_unix_kernel.n); /* FIXME: Must be _always_ the last one */
protos_postconfig();
}
@@ -104,6 +103,7 @@ main(void)
if_init();
protos_build();
+ add_tail(&protocol_list, &proto_unix_kernel.n);
protos_init();
debug("Reading configuration file.\n");
diff --git a/sysdep/unix/sync-rt.c b/sysdep/unix/sync-rt.c
index 69b2bde1..169494e2 100644
--- a/sysdep/unix/sync-rt.c
+++ b/sysdep/unix/sync-rt.c
@@ -23,6 +23,8 @@
#include "unix.h"
#include "krt.h"
+struct proto *cf_krt_proto;
+
void
krt_start(struct proto *P)
{
@@ -42,6 +44,7 @@ krt_preconfig(struct protocol *x)
{
struct krt_proto *p = (struct krt_proto *) proto_new(&proto_unix_kernel, sizeof(struct krt_proto));
+ cf_krt_proto = &p->p;
p->p.preference = DEF_PREF_UKR;
p->p.start = krt_start;
p->p.shutdown = krt_shutdown;