From 93fb60d54ca7ce3efec1cc0b39fb0840d055ccd1 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 27 Nov 1998 21:08:37 +0000 Subject: [PATCH] Fixed few misspellings and exported instance init as rip_init_instance(). --- proto/rip/rip.c | 20 +++++++++++--------- proto/rip/rip.h | 2 ++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/proto/rip/rip.c b/proto/rip/rip.c index 0f04f312..79b22dfd 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -139,7 +139,7 @@ givemore: c->rif->busy = NULL; rem_node(NODE c); mb_free(c); - debug( "done\n" ); + debug( " done\n" ); return; } @@ -428,7 +428,7 @@ rip_timer(timer *t) static void rip_start(struct proto *p) { - debug( "RIP: initializing instance...\n" ); + debug( "RIP: starting instance...\n" ); P->magic = RIP_MAGIC; init_list( &P->rtable ); @@ -516,7 +516,7 @@ new_iface(struct proto *p, struct iface *new) i->sock->daddr = new->opposite; if (!ipa_nonzero(i->sock->daddr)) - log( L_WARN "RIP: interface %s is too strange for me\n", i->iface->name ); + log( L_WARN "RIP: interface %s is too strange for me", i->iface->name ); if (sk_open(i->sock)<0) die( "RIP/%s: could not listen on %s\n", p->name, i->iface->name ); @@ -610,12 +610,9 @@ rip_rte_remove(net *net, rte *rte) rem_node( &rte->u.rip.garbage ); } -static void -rip_preconfig(struct protocol *x) +void +rip_init_instance(struct proto *p) { - struct proto *p = proto_new(&proto_rip, sizeof(struct rip_data)); - - debug( "RIP: preconfig\n" ); p->preference = DEF_PREF_RIP; p->start = rip_start; p->if_notify = rip_if_notify; @@ -627,6 +624,12 @@ rip_preconfig(struct protocol *x) p->dump = rip_dump; } +static void +rip_preconfig(struct protocol *x) +{ + debug( "RIP: preconfig\n" ); +} + static void rip_postconfig(struct protocol *p) { @@ -640,4 +643,3 @@ struct protocol proto_rip = { rip_preconfig, rip_postconfig }; - diff --git a/proto/rip/rip.h b/proto/rip/rip.h index 1f87891c..b87ca1a1 100644 --- a/proto/rip/rip.h +++ b/proto/rip/rip.h @@ -81,3 +81,5 @@ struct rip_data { #define RIP_MAGIC 81861253 #define CHK_MAGIC do { if (P->magic != RIP_MAGIC) die( "Not enough magic\n" ); } while (0) + +void rip_init_instance(struct proto *p);