struct proto again contains instance name (a copy of proto->cf->name).

This commit is contained in:
Martin Mares 1999-02-11 22:45:54 +00:00
parent 3b15402fd4
commit 64011f898c
4 changed files with 9 additions and 5 deletions

View file

@ -101,7 +101,7 @@ neigh_dump(neighbor *n)
debug("%s ", n->iface->name);
else
debug("[] ");
debug("%s %p", n->proto->cf->name, n->data);
debug("%s %p", n->proto->name, n->data);
if (n->flags & NEF_STICKY)
debug(" STICKY");
debug("\n");
@ -319,7 +319,7 @@ if_feed_baby(struct proto *p)
if (!p->if_notify)
return;
debug("Announcing interfaces to new protocol %s\n", p->cf->name);
debug("Announcing interfaces to new protocol %s\n", p->name);
WALK_LIST(i, iface_list)
p->if_notify(p, IF_CHANGE_CREATE | ((i->flags & IF_UP) ? IF_CHANGE_UP : 0), NULL, i);
}

View file

@ -20,6 +20,7 @@ struct network;
struct proto_config;
struct config;
struct proto;
struct event;
/*
* Routing Protocol
@ -75,12 +76,15 @@ struct proto {
struct protocol *proto; /* Protocol */
struct proto_config *cf; /* Configuration data */
pool *pool; /* Pool containing local objects */
struct event *attn; /* "Pay attention" event */
char *name; /* Name of this instance (== cf->name) */
unsigned debug; /* Debugging flags */
unsigned preference; /* Default route preference */
unsigned disabled; /* Manually disabled */
unsigned proto_state; /* Protocol state machine (see below) */
unsigned core_state; /* Core state machine (see below) */
unsigned core_goal; /* State we want to reach (see below) */
void (*if_notify)(struct proto *, unsigned flags, struct iface *new, struct iface *old);
void (*rt_notify)(struct proto *, struct network *net, struct rte *new, struct rte *old);
@ -101,7 +105,7 @@ void proto_build(struct proto_config *);
void *proto_new(struct proto_config *, unsigned size);
void *proto_config_new(struct protocol *, unsigned size);
extern list proto_list, inactive_proto_list;
extern list proto_list;
/*
* Each protocol instance runs two different state machines:

View file

@ -139,7 +139,7 @@ rta_dump(rta *a)
static char *rtd[] = { "", " DEV", " HOLE", " UNREACH", " PROHIBIT" };
debug("p=%s uc=%d %s %s%s%s TOS=%d",
a->proto->cf->name, a->uc, rts[a->source], sco[a->scope], rtc[a->cast],
a->proto->name, a->uc, rts[a->source], sco[a->scope], rtc[a->cast],
rtd[a->dest], a->tos);
if (a->flags & RTF_EXTERIOR)
debug(" EXT");

View file

@ -121,7 +121,7 @@ rt_feed_baby(struct proto *p)
if (!p->rt_notify)
return;
debug("Announcing routes to new protocol %s\n", p->cf->name);
debug("Announcing routes to new protocol %s\n", p->name);
while (t)
{
FIB_WALK(&t->fib, fn)