proto_start(struct proto *p)
{
rem_node(&p->n);
+ p->state = PRS_STARTING;
if (p->start)
p->start(p);
if_feed_baby(p);
rt_feed_baby(p);
+ p->state = PRS_UP;
add_tail(&proto_list, &p->n);
}
unsigned debug; /* Debugging flags */
pool *pool; /* Local objects */
unsigned preference; /* Default route preference */
+ unsigned state; /* PRS_... */
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);
/* Hic sunt protocol-specific data */
};
+#define PRS_DOWN 0 /* Inactive */
+#define PRS_STARTING 1
+#define PRS_UP 2
+
void *proto_new(struct protocol *, unsigned size);
extern list proto_list, inactive_proto_list;