]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Preparing to send DD packets.
authorOndrej Filip <feela@network.cz>
Tue, 24 Aug 1999 14:42:51 +0000 (14:42 +0000)
committerOndrej Filip <feela@network.cz>
Tue, 24 Aug 1999 14:42:51 +0000 (14:42 +0000)
proto/ospf/ospf.c
proto/ospf/ospf.h

index 1fa33fc2198cfefab7ccf00ea0dc0837bfdba522..47e2b78505fd4d1b7d002de3707c5db22e566f3c 100644 (file)
@@ -44,7 +44,13 @@ tryadj(struct ospf_neighbor *n, struct proto *p)
 {
   DBG("%s: Going to build adjacency.\n", p->name);
   neigh_chstate(n,NEIGHBOR_EXSTART);
-  /* FIXME Go on */
+  if(n->adj==0)        /* First time adjacency */
+  {
+    n->dds=random_u32;
+  }
+  n->dds++;
+  n->ms=NEIGHBOR_MASTER;
+  /* FIXME Go on, start to send DD packets */
 }
 
 /* Neighbor is inactive for a long time. Remove it. */
@@ -284,6 +290,7 @@ ospf_hello_rx(struct ospf_hello_packet *ps, struct proto *p,
     n->priority=ps->priority;
     n->options=ps->options;
     n->ifa=ifa;
+    n->adj=0;
     neigh_chstate(n,NEIGHBOR_INIT);
   }
   tm_start(n->inactim,ifa->deadc*ifa->helloint);
index ca563a4a1955ff89cc9d8804967b12f8521513ca..dde436c9f9adffac8fdb2de8f131f3546a65ad6f 100644 (file)
@@ -123,6 +123,8 @@ struct ospf_neighbor
 #define NEIGHBOR_FULL 7
   timer *inactim;      /* Inactivity timer */
   byte ms;             /* Master/slave */
+#define NEIGHBOR_SLAVE 0
+#define NEIGHBOR_MASTER 1
   u32 dds;             /* DD Sequence number being sentg */
   u32 ddr;             /* last Dat Des packet */
   u32 rid;             /* Router ID */
@@ -130,6 +132,7 @@ struct ospf_neighbor
   byte options;                /* Options */
   u32 dr;              /* Neigbour's idea of DR */
   u32 bdr;             /* Neigbour's idea of BDR */
+  u8 adj;              /* built adjacency? */
 };
 
 #endif /* _BIRD_OSPF_H_ */