From 980ffedbb04bf3beedf147fc7dfed40cdbf968aa Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 6 Dec 1998 17:40:42 +0000 Subject: Kernel syncer is now configurable. It will probably need some more options, but at least basic tuning is possible now. --- sysdep/unix/Modules | 1 + sysdep/unix/krt.Y | 34 ++++++++++++++++++++++++++++++++++ sysdep/unix/krt.h | 2 ++ sysdep/unix/main.c | 2 +- sysdep/unix/sync-rt.c | 3 +++ 5 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 sysdep/unix/krt.Y (limited to 'sysdep/unix') diff --git a/sysdep/unix/Modules b/sysdep/unix/Modules index 70ed145..441c3f0 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 0000000..d4dd082 --- /dev/null +++ b/sysdep/unix/krt.Y @@ -0,0 +1,34 @@ +/* + * BIRD -- UNIX Kernel Syncer Configuration + * + * (c) 1998 Martin Mares + * + * 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 e7b5597..2da29e5 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 4aeb9c1..f5076c4 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 69b2bde..169494e 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; -- cgit v1.2.3