]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
struct ospf_neigbor added. Neigbor state machine implementation can start.
authorOndrej Filip <feela@network.cz>
Mon, 24 May 1999 21:17:16 +0000 (21:17 +0000)
committerOndrej Filip <feela@network.cz>
Mon, 24 May 1999 21:17:16 +0000 (21:17 +0000)
proto/ospf/ospf.c
proto/ospf/ospf.h

index ac2eef19bee40ce82a34175c19c28a700ef30482..914adce90eda61fe46ec09929838adc0c6cdae81 100644 (file)
@@ -273,14 +273,6 @@ hello_timer_hook(timer *timer)
     p->name, ifa->iface->name);
 }
 
-void
-add_hello_timer(struct ospf_iface *ifa)
-{
-  struct proto *p;
-  p=(struct proto *)(ifa->proto);
-
-}
-
 void
 wait_timer_hook(timer *timer)
 {
@@ -296,6 +288,7 @@ wait_timer_hook(timer *timer)
     /*
      * Wait time fired. Now we must change state
      * to DR or DROTHER depending on priority
+     * FIXME: I can be also BDR
      */
     if(ifa->priority!=0)
     {
@@ -303,6 +296,7 @@ wait_timer_hook(timer *timer)
 
       ifa->state=OSPF_IS_DR;
       ifa->drip=ifa->iface->addr->ip;
+      ifa->drid=p->cf->global->router_id;
       /* FIXME: Set ifa->drid */
     }
     else
@@ -343,7 +337,7 @@ ospf_add_timers(struct ospf_iface *ifa, pool *pool, int wait)
     ifa->wait_timer->recurrent=0;
     ifa->wait_timer->expires=0;
     ifa->state=OSPF_IS_WAITING;
-    tm_start(ifa->wait_timer,(wait!=0 ? wait : WAIT_D));
+    tm_start(ifa->wait_timer,(wait!=0 ? wait : WAIT_DMH*ifa->helloint));
     DBG(p->name);
     DBG(": Installing wait timer.\n");
   }
index 6b57596198ca9e2a2e89c00a2959a50ca72f1dda..4ab38d6bb7c363f5eb11494c870779013735ed70 100644 (file)
@@ -70,8 +70,7 @@ struct ospf_iface {
 #define PRIORITY_D 1
 #define HELLOINT_D 10
 #define DEADINT_D 4
-#define WAIT_D 20      /* Value of Wait timer - I didn't found it in RFC */
-
+#define WAIT_DMH 2     /* Value of Wait timer - not found it in RFC - using 2*HELLO */
 };
 
 struct ospf_sock {
@@ -113,4 +112,24 @@ struct ospf_hello_packet {
   u32 bdr;
 };
 
+/* FIXME: int is not a good idea */
+struct ospf_neighbor
+{
+  int state;
+#define NEIGHBOR_DOWN 0
+#define NEIGHBOR_INIT 1
+#define NEIGHBOR_2WAY 2
+#define NEIGHBOR_ATTEMPT 3
+#define NEIGHBOR_EXSTART 4
+  timer *inactim;      /* Inactivity timer */
+  int ms;              /* Master/slave */
+  int dds;             /* DD Sequence number being sentg */
+  int ddr;             /* last Dat Des packet */
+  u32 rid;             /* Router ID */
+  int pri;             /* Priority */
+  int options;         /* Options */
+  u32 dr;              /* Neigbour's idea of DR */
+  u32 bdr;             /* Neigbour's idea of BDR */
+};
+
 #endif /* _BIRD_OSPF_H_ */