struct proto again contains instance name (a copy of proto->cf->name).
This commit is contained in:
parent
3b15402fd4
commit
64011f898c
4 changed files with 9 additions and 5 deletions
|
@ -101,7 +101,7 @@ neigh_dump(neighbor *n)
|
||||||
debug("%s ", n->iface->name);
|
debug("%s ", n->iface->name);
|
||||||
else
|
else
|
||||||
debug("[] ");
|
debug("[] ");
|
||||||
debug("%s %p", n->proto->cf->name, n->data);
|
debug("%s %p", n->proto->name, n->data);
|
||||||
if (n->flags & NEF_STICKY)
|
if (n->flags & NEF_STICKY)
|
||||||
debug(" STICKY");
|
debug(" STICKY");
|
||||||
debug("\n");
|
debug("\n");
|
||||||
|
@ -319,7 +319,7 @@ if_feed_baby(struct proto *p)
|
||||||
|
|
||||||
if (!p->if_notify)
|
if (!p->if_notify)
|
||||||
return;
|
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)
|
WALK_LIST(i, iface_list)
|
||||||
p->if_notify(p, IF_CHANGE_CREATE | ((i->flags & IF_UP) ? IF_CHANGE_UP : 0), NULL, i);
|
p->if_notify(p, IF_CHANGE_CREATE | ((i->flags & IF_UP) ? IF_CHANGE_UP : 0), NULL, i);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ struct network;
|
||||||
struct proto_config;
|
struct proto_config;
|
||||||
struct config;
|
struct config;
|
||||||
struct proto;
|
struct proto;
|
||||||
|
struct event;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Routing Protocol
|
* Routing Protocol
|
||||||
|
@ -75,12 +76,15 @@ struct proto {
|
||||||
struct protocol *proto; /* Protocol */
|
struct protocol *proto; /* Protocol */
|
||||||
struct proto_config *cf; /* Configuration data */
|
struct proto_config *cf; /* Configuration data */
|
||||||
pool *pool; /* Pool containing local objects */
|
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 debug; /* Debugging flags */
|
||||||
unsigned preference; /* Default route preference */
|
unsigned preference; /* Default route preference */
|
||||||
unsigned disabled; /* Manually disabled */
|
unsigned disabled; /* Manually disabled */
|
||||||
unsigned proto_state; /* Protocol state machine (see below) */
|
unsigned proto_state; /* Protocol state machine (see below) */
|
||||||
unsigned core_state; /* Core 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 (*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);
|
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_new(struct proto_config *, unsigned size);
|
||||||
void *proto_config_new(struct protocol *, 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:
|
* Each protocol instance runs two different state machines:
|
||||||
|
|
|
@ -139,7 +139,7 @@ rta_dump(rta *a)
|
||||||
static char *rtd[] = { "", " DEV", " HOLE", " UNREACH", " PROHIBIT" };
|
static char *rtd[] = { "", " DEV", " HOLE", " UNREACH", " PROHIBIT" };
|
||||||
|
|
||||||
debug("p=%s uc=%d %s %s%s%s TOS=%d",
|
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);
|
rtd[a->dest], a->tos);
|
||||||
if (a->flags & RTF_EXTERIOR)
|
if (a->flags & RTF_EXTERIOR)
|
||||||
debug(" EXT");
|
debug(" EXT");
|
||||||
|
|
|
@ -121,7 +121,7 @@ rt_feed_baby(struct proto *p)
|
||||||
|
|
||||||
if (!p->rt_notify)
|
if (!p->rt_notify)
|
||||||
return;
|
return;
|
||||||
debug("Announcing routes to new protocol %s\n", p->cf->name);
|
debug("Announcing routes to new protocol %s\n", p->name);
|
||||||
while (t)
|
while (t)
|
||||||
{
|
{
|
||||||
FIB_WALK(&t->fib, fn)
|
FIB_WALK(&t->fib, fn)
|
||||||
|
|
Loading…
Reference in a new issue