summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1998-06-03 08:42:16 +0000
committerMartin Mares <mj@ucw.cz>1998-06-03 08:42:16 +0000
commitc5ffa447598bc24cf1b674553bc4d3cc80a831d1 (patch)
treeb08cb3d4e9910a28e0abbc5d9d650168035edff9 /nest
parentd9f330c5ffe03c05b7e6541a06adac657f24407b (diff)
Skeleton of device route protocol. As it's tightly coupled with our kernel,
it sits here instead of `proto/dev'.
Diffstat (limited to 'nest')
-rw-r--r--nest/Makefile2
-rw-r--r--nest/rt-dev.c58
2 files changed, 59 insertions, 1 deletions
diff --git a/nest/Makefile b/nest/Makefile
index aaa0c2a0..3990a89c 100644
--- a/nest/Makefile
+++ b/nest/Makefile
@@ -1,4 +1,4 @@
THISDIR=nest
-OBJS=rt-table.o rt-fib.o rt-attr.o proto.o iface.o
+OBJS=rt-table.o rt-fib.o rt-attr.o proto.o iface.o rt-dev.o
include ../Rules
diff --git a/nest/rt-dev.c b/nest/rt-dev.c
new file mode 100644
index 00000000..90cac70e
--- /dev/null
+++ b/nest/rt-dev.c
@@ -0,0 +1,58 @@
+/*
+ * BIRD -- Direct Device Routes
+ *
+ * (c) 1998 Martin Mares <mj@ucw.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+#define LOCAL_DEBUG
+
+#include "nest/bird.h"
+#include "nest/iface.h"
+#include "nest/protocol.h"
+#include "nest/route.h"
+#include "lib/resource.h"
+
+static struct proto *dev_proto;
+
+static void
+dev_if_notify(struct proto *p, unsigned c, struct iface *old, struct iface *new)
+{
+ debug("IF notify %x\n", c);
+}
+
+static void
+dev_start(struct proto *p)
+{
+}
+
+static void
+dev_init(struct protocol *p)
+{
+}
+
+static void
+dev_preconfig(struct protocol *x)
+{
+ struct proto *p = proto_new(&proto_device, sizeof(struct proto));
+
+ dev_proto = p;
+ p->preference = DEF_PREF_DIRECT;
+ p->start = dev_start;
+ p->if_notify = dev_if_notify;
+}
+
+static void
+dev_postconfig(struct protocol *p)
+{
+}
+
+struct protocol proto_device = {
+ { NULL, NULL },
+ "Device",
+ 0,
+ dev_init,
+ dev_preconfig,
+ dev_postconfig
+};