Added kernel route table syncer skeleton.
debug(" inactive %s\n", p->name);
}
+void
+protos_build(void)
+{
+ init_list(&protocol_list);
+ add_tail(&protocol_list, &proto_device.n);
+ add_tail(&protocol_list, &proto_rip.n);
+}
+
void
protos_init(void)
{
struct protocol *p;
debug("Initializing protocols\n");
- init_list(&protocol_list);
- add_tail(&protocol_list, &proto_device.n);
- add_tail(&protocol_list, &proto_rip.n); /* HACK: We should really read this from config */
WALK_LIST(p, protocol_list)
p->init(p);
}
void (*postconfig)(struct protocol *); /* After configuring */
};
+void protos_build(void);
void protos_init(void);
void protos_preconfig(void);
void protos_postconfig(void);
#define DEF_PREF_BGP 100 /* BGP */
#define DEF_PREF_OSPF_EXTERNAL 80 /* OSPF external routes */
#define DEF_PREF_RIP_EXTERNAL 70 /* RIP external routes */
+#define DEF_PREF_UKR 50 /* Unidentified Kernel Route */
#define DEF_PREF_SINK 10 /* Sink route */
#endif
io.c
unix.h
sync-if.c
+sync-rt.c
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();
if_scan_timer->recurrent = if_scan_period;
tm_start(if_scan_timer, if_scan_period);
}
-
--- /dev/null
+/*
+ * 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
+};
void scan_if_init(void);
+/* sync-rt.c */
+
+extern struct protocol proto_unix_kernel;
+
#endif