diff options
author | Ondrej Filip <feela@network.cz> | 1999-08-24 14:42:51 +0000 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 1999-08-24 14:42:51 +0000 |
commit | e3121112ab8cda4b4e413a801e5626f9ffb02ca8 (patch) | |
tree | 8bd42dda3884690a78643f074788ad5c1f0c626d /proto | |
parent | 2981814066543b72e292b7b36ca41bfa1cc2554c (diff) |
Preparing to send DD packets.
Diffstat (limited to 'proto')
-rw-r--r-- | proto/ospf/ospf.c | 9 | ||||
-rw-r--r-- | proto/ospf/ospf.h | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index 1fa33fc2..47e2b785 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -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); diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h index ca563a4a..dde436c9 100644 --- a/proto/ospf/ospf.h +++ b/proto/ospf/ospf.h @@ -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_ */ |