From a1bf6440b5c27f7fb829eb25f6ac1c2629eb72eb Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 6 Dec 1998 18:21:23 +0000 Subject: Added skeleton of static route protocol. --- proto/static/static.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 proto/static/static.c (limited to 'proto/static/static.c') diff --git a/proto/static/static.c b/proto/static/static.c new file mode 100644 index 0000000..679ee6e --- /dev/null +++ b/proto/static/static.c @@ -0,0 +1,73 @@ +/* + * BIRD -- Static Route Generator + * + * (c) 1998 Martin Mares + * + * 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 "conf/conf.h" + +#include "static.h" + +#define GET_DATA struct static_proto *p = (struct static_proto *) P + +static void +static_start(struct proto *P) +{ + DBG("Static: take off!\n"); +} + +static void +static_neigh_notify(struct neighbor *n) +{ + DBG("Static: neighbor notify got, don't know why.\n"); +} + +static void +static_dump(struct proto *P) +{ + DBG("Static: no dumps available in demo version.\n"); +} + +void +static_init_instance(struct static_proto *P) +{ + struct proto *p = &P->p; + + p->preference = DEF_PREF_STATIC; + p->start = static_start; + p->neigh_notify = static_neigh_notify; + p->dump = static_dump; + /* FIXME: Should shutdown remove all routes? */ +} + +static void +static_init(struct protocol *p) +{ +} + +static void +static_preconfig(struct protocol *x) +{ +} + +static void +static_postconfig(struct protocol *p) +{ +} + +struct protocol proto_static = { + { NULL, NULL }, + "Static", + 0, + static_init, + static_preconfig, + static_postconfig +}; -- cgit v1.2.3