]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Proto struct now contain (down | starting | up) state.
authorMartin Mares <mj@ucw.cz>
Mon, 19 Oct 1998 17:45:29 +0000 (17:45 +0000)
committerMartin Mares <mj@ucw.cz>
Mon, 19 Oct 1998 17:45:29 +0000 (17:45 +0000)
nest/proto.c
nest/protocol.h

index f142a77dc945db093194f53e429051b0ccac788e..0760130239decdddff69cfbff23645b972efc7c9 100644 (file)
@@ -71,10 +71,12 @@ static void
 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);
 }
 
index 9a0ea98dd96da4f00b92928ff2d9d4d4bebb6378..f138d865fe2e186e30ac67ae00fefdf538b57559 100644 (file)
@@ -59,6 +59,7 @@ struct proto {
   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);
@@ -80,6 +81,10 @@ struct proto {
   /* 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;