summaryrefslogtreecommitdiffstats
path: root/sysdep
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1998-10-18 13:53:21 +0200
committerMartin Mares <mj@ucw.cz>1998-10-18 13:53:21 +0200
commit0432c0173bb4d234e8ba8e4afea0a8e708e119d8 (patch)
tree52a7c25de9102f8da2693f9daa9278b172086fb0 /sysdep
parent05e56feb57b8e313a2328dbe82e2c2a70ff5115a (diff)
downloadbird-0432c0173bb4d234e8ba8e4afea0a8e708e119d8.tar
bird-0432c0173bb4d234e8ba8e4afea0a8e708e119d8.zip
Split protocol init to building of protocol list and real protocol init.
Added kernel route table syncer skeleton.
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/unix/Modules1
-rw-r--r--sysdep/unix/main.c2
-rw-r--r--sysdep/unix/sync-if.c1
-rw-r--r--sysdep/unix/sync-rt.c62
-rw-r--r--sysdep/unix/unix.h4
5 files changed, 69 insertions, 1 deletions
diff --git a/sysdep/unix/Modules b/sysdep/unix/Modules
index 0b5117a..f3e68e8 100644
--- a/sysdep/unix/Modules
+++ b/sysdep/unix/Modules
@@ -4,3 +4,4 @@ timer.h
io.c
unix.h
sync-if.c
+sync-rt.c
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index b57e94e..a6c4748 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -76,6 +76,8 @@ main(void)
io_init();
rt_init();
if_init();
+ protos_build();
+ add_tail(&protocol_list, &proto_unix_kernel.n); /* FIXME: Must be _always_ the last one */
protos_init();
protos_preconfig();
protos_postconfig();
diff --git a/sysdep/unix/sync-if.c b/sysdep/unix/sync-if.c
index 4478c10..4439256 100644
--- a/sysdep/unix/sync-if.c
+++ b/sysdep/unix/sync-if.c
@@ -180,4 +180,3 @@ scan_if_init(void)
if_scan_timer->recurrent = if_scan_period;
tm_start(if_scan_timer, if_scan_period);
}
-
diff --git a/sysdep/unix/sync-rt.c b/sysdep/unix/sync-rt.c
new file mode 100644
index 0000000..c1bf7f7
--- /dev/null
+++ b/sysdep/unix/sync-rt.c
@@ -0,0 +1,62 @@
+/*
+ * BIRD -- Unix Routing Table Scanning and Syncing
+ *
+ * (c) 1998 Martin Mares <mj@ucw.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+#include <string.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+
+#define LOCAL_DEBUG
+
+#include "nest/bird.h"
+#include "nest/iface.h"
+#include "nest/route.h"
+#include "nest/protocol.h"
+#include "lib/timer.h"
+
+#include "unix.h"
+
+void
+uk_rt_notify(struct proto *p, net *net, rte *new, rte *old)
+{
+}
+
+void
+uk_start(struct proto *p)
+{
+}
+
+void
+uk_init(struct protocol *x)
+{
+}
+
+void
+uk_preconfig(struct protocol *x)
+{
+ struct proto *p = proto_new(&proto_unix_kernel, sizeof(struct proto));
+
+ p->preference = DEF_PREF_UKR;
+ p->rt_notify = uk_rt_notify;
+ p->start = uk_start;
+}
+
+void
+uk_postconfig(struct protocol *x)
+{
+}
+
+struct protocol proto_unix_kernel = {
+ { NULL, NULL },
+ "kernel",
+ 0,
+ uk_init,
+ uk_preconfig,
+ uk_postconfig
+};
diff --git a/sysdep/unix/unix.h b/sysdep/unix/unix.h
index 127101e..7b0a921 100644
--- a/sysdep/unix/unix.h
+++ b/sysdep/unix/unix.h
@@ -22,4 +22,8 @@ extern int if_scan_period;
void scan_if_init(void);
+/* sync-rt.c */
+
+extern struct protocol proto_unix_kernel;
+
#endif