NetSim Source Code Help
Loading...
Searching...
No Matches
OSPF_DD.c
Go to the documentation of this file.
1/************************************************************************************
2* Copyright (C) 2020 *
3* TETCOS, Bangalore. India *
4* *
5* Tetcos owns the intellectual property rights in the Product and its content. *
6* The copying, redistribution, reselling or publication of any or all of the *
7* Product or its content without express prior written consent of Tetcos is *
8* prohibited. Ownership and / or any other right relating to the software and all *
9* intellectual property rights therein shall remain at all times with Tetcos. *
10* *
11* Author: Shashi Kant Suman *
12* *
13* ---------------------------------------------------------------------------------*/
14#include "main.h"
15#include "NetSim_utility.h"
16#include "OSPF.h"
17#include "OSPF_enum.h"
18#include "OSPF_Msg.h"
19#include "OSPF_Interface.h"
20#include "OSPF_Neighbor.h"
21#include "OSPF_List.h"
22
24{
25 ptrOSPFDD dd = calloc(1, sizeof* dd);
28 dd,
30}
31
33{
34 ptrOSPFDD d = calloc(1, sizeof* d);
35 memcpy(d, dd, sizeof* d);
36 if (dd->numLSA)
37 d->LSAHeader = calloc(dd->numLSA, sizeof* d->LSAHeader);
38 UINT i;
39 for (i = 0; i < dd->numLSA; i++)
41 return d;
42}
43
45{
46 UINT i;
47 for (i = 0; i < dd->numLSA; i++)
49 free(dd->LSAHeader);
50 free(dd);
51}
52
54 ptrOSPF_IF ospf,
55 ptrOSPF_NEIGHBOR neigh)
56{
58 if (ospf->Type == OSPFIFTYPE_VIRTUALLINK)
59 dd->InterfaceMTU = 0;
60 else
62 dd->DDSequenceNumber = neigh->DDSeqNo;
63 DD_SET_INIT(dd);
64 DD_SET_MORE(dd);
65 DD_SET_MASTER(dd);
66 neigh->IMMS = dd->IMMS;
67}
68
70 UINT16* count,
71 UINT maxCount)
72{
73 ptrOSPFLSAHDR* ret = NULL;
74 UINT16 c = 0;
75 ptrOSPFLSAHDR lsa;
76 while ((lsa = ospf_list_get_mem(list)) != NULL)
77 {
78 if (ret)
79 ret = realloc(ret, (c + 1) * sizeof* ret);
80 else
81 ret = calloc(1, sizeof* ret);
82 ret[c] = lsa;
83 c++;
84 if (c >= maxCount)
85 break;
86 }
87 *count = c;
88 return ret;
89}
90
92 ptrOSPF_IF ospf,
93 ptrOSPF_NEIGHBOR neigh)
94{
97 if (ospf->Type == OSPFIFTYPE_VIRTUALLINK)
98 dd->InterfaceMTU = 0;
99 else
101 dd->DDSequenceNumber = neigh->DDSeqNo;
102
103 UINT maxLSAHdrCount = OSPF_DD_MAX_LSA_COUNT();
105 &dd->numLSA,
106 maxLSAHdrCount);
107
108 dd->LSAHeader = lsahdr;
110 DD_SET_MORE(dd);
111
112 if (neigh->isMaster)
113 DD_SET_MASTER(dd);
114 neigh->IMMS = dd->IMMS;
115
117}
118
120 ptrOSPF_NEIGHBOR neigh)
121{
122 add_dest_to_packet(packet, neigh->devId);
123 packet->pstruNetworkData->szDestIP = neigh->neighborIPAddr;
124 packet->pstruNetworkData->nTTL = 2;
125}
126
127static void send_DD_msg(ptrOSPF_IF ospf,
128 ptrOSPF_NEIGHBOR neigh)
129{
130 OSPFMSG type = OSPFMSG_DD;
132 type,
135
136 ospf_DD_update_dst(packet, neigh);
138
139 if (neigh->state == OSPFNEIGHSTATE_ExStart)
140 set_DD_param_in_exstart(hdr, ospf, neigh);
141 else if (neigh->state == OSPFNEIGHSTATE_Exchange)
142 set_DD_param_in_exchange(packet, ospf, neigh);
143
144 OSPF_SEND_PACKET(packet);
145
146 if (neigh->lastSentDDPacket)
148 neigh->lastSentDDPacket = OSPF_HDR_COPY(hdr);
150}
151
153 ptrOSPF_NEIGHBOR neigh)
154{
155 ptrOSPFDD dd = hdr->ospfMSG;
156 ptrOSPFDD old = neigh->lastrecvDDPacket->ospfMSG;
158 dd->Option = old->Option;
159 dd->InterfaceMTU = old->InterfaceMTU;
160
161 if (old->numLSA)
162 {
163 dd->numLSA = old->numLSA;
164 dd->LSAHeader = calloc(dd->numLSA, sizeof* dd->LSAHeader);
165 UINT i;
166 for (i = 0; i < old->numLSA; i++)
167 dd->LSAHeader[i] = OSPF_LSA_HDR_COPY(old->LSAHeader[i]);
168 }
169
170 dd->IMMS = old->IMMS;
171}
172
173static void resend_DD_msg(ptrOSPF_IF ospf,
174 ptrOSPF_NEIGHBOR neigh)
175{
176 ospf;
177
178 OSPFMSG type = OSPFMSG_DD;
180 type,
183
184 ospf_DD_update_dst(packet, neigh);
186
187 copy_DD_param(hdr, neigh);
188 OSPF_SEND_PACKET(packet);
189
190 if (neigh->lastSentDDPacket)
192 neigh->lastSentDDPacket = OSPF_HDR_COPY(hdr);
194}
195
197 ptrOSPF_NEIGHBOR neigh)
198{
202 OSPF_DD_RXMT_IN_EXSTART,
203 NULL,
204 neigh);
205}
206
208{
211 if (neigh->state != OSPFNEIGHSTATE_ExStart)
212 return;
213 print_ospf_log(OSPF_LOG, "Time %0.4lf, Router %d, interface %d (%s), Sending DD msg to neighbor %s",
217 DEVICE_MYIP()->str_ip,
218 neigh->neighborId->str_ip);
219 print_ospf_log(OSPF_LOG, "Neighbor state is %s",
220 strNeighborState[neigh->state]);
221 send_DD_msg(ospf, neigh);
224}
225
227 ptrOSPF_IF thisInterface,
228 ptrOSPF_NEIGHBOR neigh,
230{
231 print_ospf_log(OSPF_LOG, "Processing DD msg");
232 ptrOSPFDD dd = hdr->ospfMSG;
233 ptrOSPFAREA_DS area = OSPF_AREA_GET_ID(ospf, thisInterface->areaId);
234 UINT numLSA = dd->numLSA;
235 UINT i;
236 for (i = 0; i < numLSA; i++)
237 {
238 ptrOSPFLSAHDR lsa = dd->LSAHeader[i];
239 ptrOSPFLSAHDR oldLsa = NULL;
240
241 // Check for the validity of LSA
242 if (lsa->LSType < LSTYPE_ROUTERLSA ||
243 lsa->LSType >= LSTYPE_UNDEFINED)
244 {
245 print_ospf_log(OSPF_LOG, "Unknown LSA type %d. Discard DD packet",
246 lsa->LSType);
247
248 ospf_event_set_and_call(OSPF_SeqNumberMismatch, neigh);
249 return;
250 }
251
252 // Looks up for the LSA in its own Database
253 oldLsa = ospf_lsdb_lookup(ospf, area, lsa->LSType,
254 lsa->AdvertisingRouter, lsa->LinkStateID);
255
256 // Add to request list if the LSA doesn't exist or if
257 // this instance is more recent one
258
259 if (!oldLsa ||
260 ospf_lsa_compare(ospf, oldLsa, lsa) > 0)
261 {
262 print_ospf_log(OSPF_LOG, "Adding LSA to request list");
264 }
265 }
266
267 if (neigh->isMaster)
268 {
269 neigh->DDSeqNo++;
270 if (!isBitSet(neigh->IMMS, DD_MORE_BIT_INDEX) &&
271 !DD_IS_MORE(dd))
272 {
273 print_ospf_log(OSPF_LOG, "Scheduling event Exchange_Done");
277 OSPF_ExchangeDone,
278 NULL,
279 neigh);
280 }
281 else
282 {
283 print_ospf_log(OSPF_LOG, "More bit is set. Sending DD msg");
284 send_DD_msg(thisInterface, neigh);
285 }
286 }
287 else
288 {
289 neigh->DDSeqNo = dd->DDSequenceNumber;
290 print_ospf_log(OSPF_LOG, "I am slave. Sending DD msg");
291 send_DD_msg(thisInterface, neigh);
292 if (!DD_IS_MORE(dd) &&
294 {
295 print_ospf_log(OSPF_LOG, "Scheduling event Exchange_Done");
299 OSPF_ExchangeDone,
300 NULL,
301 neigh);
302 }
303 }
304}
305
307 ptrOSPF_NEIGHBOR neigh,
308 ptrOSPFDD dd)
309{
310 ospf;
311
313 return false;
314
315 if (!neigh)
316 return false;
317
318 if (neigh->state == OSPFNEIGHSTATE_DOWN)
319 return false;
320
321 if (neigh->state == OSPFNEIGHSTATE_Attempt)
322 return false;
323
324 return true;
325}
326
329{
330 if (!neigh->lastrecvDDPacket)
331 return false;
332 ptrOSPFDD n = hdr->ospfMSG;
334
335 if (n->DDSequenceNumber == o->DDSequenceNumber &&
336 n->IMMS == o->IMMS &&
337 n->Option == o->Option)
338 return true;
339
340 return false;
341}
342
344 ptrOSPF_IF ospfif,
345 ptrOSPF_NEIGHBOR neigh,
347{
348 ptrOSPFDD dd = hdr->ospfMSG;
349 if (DD_IS_INIT(dd) &&
350 DD_IS_MORE(dd) &&
351 DD_IS_MASTER(dd) &&
352 !dd->LSAHeader &&
354 {
355 neigh->DDSeqNo = dd->DDSequenceNumber;
356 neigh->isMaster = false;
357 print_ospf_log(OSPF_LOG, "I am now slave.");
358 }
359 else if (!DD_IS_INIT(dd) &&
360 !DD_IS_MASTER(dd) &&
361 dd->DDSequenceNumber == neigh->DDSeqNo &&
363 {
364 neigh->isMaster = true;
365 print_ospf_log(OSPF_LOG, "I am now master.");
366 }
367 else
368 {
369 print_ospf_log(OSPF_LOG, "Neither master nor slave. Who i am? Ignoring DD msg.");
370 return;
371 }
372
373 ospf_event_set_and_call(OSPF_NegotiationDone, neigh);
374 neigh->neighborOption = dd->Option;
375 ospf_process_DD(ospf, ospfif, neigh, hdr);
376}
377
380{
381 hdr;
382
383 ospf_event_set_and_call(OSPF_2WayReceived, neigh);
384}
385
387 ptrOSPF_NEIGHBOR neigh,
389{
390 hdr;
391
392 if (neigh->isMaster)
393 print_ospf_log(OSPF_LOG, "I am master. Discarding duplicate DD");
394 else
395 resend_DD_msg(ospf, neigh);
396}
397
399 ptrOSPF_IF thisInterface,
400 ptrOSPF_NEIGHBOR neigh,
402 bool isDuplicate)
403{
404 if (isDuplicate)
405 {
406 ospf_process_dd_in_exchange_state_for_duplicate(thisInterface, neigh, hdr);
407 return;
408 }
409
410 ptrOSPFDD dd = hdr->ospfMSG;
411
412 /*
413 If the state of the MS-bit is inconsistent with the
414 master/slave state of the connection, generate the
415 neighbor event SeqNumberMismatch and stop processing the
416 packet.
417 */
418 if ((DD_IS_MASTER(dd) && neigh->isMaster) ||
419 (!DD_IS_MASTER(dd) && !neigh->isMaster))
420 {
421 print_ospf_log(OSPF_LOG, "MS-bit is inconsistent with the "
422 "master / slave state of the connection");
423 ospf_event_set_and_call(OSPF_SeqNumberMismatch, neigh);
424 return;
425 }
426
427 /*
428 If the initialize(I) bit is set, generate the neighbor
429 event SeqNumberMismatch and stop processing the packet
430 */
431 if (DD_IS_INIT(dd))
432 {
433 print_ospf_log(OSPF_LOG, "Initialize(I) bit is set");
434 ospf_event_set_and_call(OSPF_SeqNumberMismatch, neigh);
435 return;
436 }
437
438 /*
439 If the packet's Options field indicates a different set
440 of optional OSPF capabilities than were previously
441 received from the neighbor (recorded in the Neighbor
442 Options field of the neighbor structure), generate the
443 neighbor event SeqNumberMismatch and stop processing the
444 packet
445 */
446 if (dd->Option != neigh->neighborOption)
447 {
448 print_ospf_log(OSPF_LOG, "packet's Options field indicates a different set "
449 "of optional OSPF capabilities than were previously "
450 "received from the neighbor(recorded in the Neighbor "
451 "Options field of the neighbor structure)");
452 ospf_event_set_and_call(OSPF_SeqNumberMismatch, neigh);
453 return;
454 }
455
456 /*
457 Database Description packets must be processed in
458 sequence, as indicated by the packets' DD sequence
459 numbers. If the router is master, the next packet
460 received should have DD sequence number equal to the DD
461 sequence number in the neighbor data structure. If the
462 router is slave, the next packet received should have DD
463 sequence number equal to one more than the DD sequence
464 number stored in the neighbor data structure. In either
465 case, if the packet is the next in sequence it should be
466 accepted and its contents processed.
467 */
468 if ((neigh->isMaster &&
469 neigh->DDSeqNo != dd->DDSequenceNumber) ||
470 (!neigh->isMaster &&
471 dd->DDSequenceNumber != neigh->DDSeqNo + 1))
472 {
473 print_ospf_log(OSPF_LOG, "DD seq number mismatch");
474 ospf_event_set_and_call(OSPF_SeqNumberMismatch, neigh);
475 return;
476 }
477
478 ospf_process_DD(ospf, thisInterface, neigh, hdr);
479}
480
482 ptrOSPF_NEIGHBOR neigh,
484 bool isDuplicate)
485{
486 hdr;
487
488 if (isDuplicate)
489 {
490 if (neigh->isMaster)
491 {
492 print_ospf_log(OSPF_LOG, "Duplicate DD msg received. I am master. Discarding packet");
493 return;
494 }
495 else
496 {
499 {
500 resend_DD_msg(ospf, neigh);
501 return;
502 }
503 }
504 }
505
506 print_ospf_log(OSPF_LOG, "DD seq number mismatch");
507 ospf_event_set_and_call(OSPF_SeqNumberMismatch, neigh);
508}
509
511{
516 ptrOSPFDD dd = OSPF_HDR_GET_MSG(hdr);
518 ptrOSPF_IF thisInterface = OSPF_IF_CURRENT();
519 OSPFID rid = hdr->RouterId;
520 ptrOSPF_NEIGHBOR neigh = OSPF_NEIGHBOR_FIND(thisInterface, rid);
521
522 print_ospf_log(OSPF_LOG, "Time %0.4lf ms, Router %d interface %d (%s) received DD msg from neighbor %s",
524 d,
525 in,
526 DEVICE_NWADDRESS(d, in)->str_ip,
527 hdr->RouterId->str_ip);
528
529 if (!validate_dd_msg(thisInterface, neigh, dd))
530 {
531 print_ospf_log(OSPF_LOG, "DD msg is not validated. Deleting DD msg...");
532 goto TERMINATE_PROCESSING_DD;
533 }
534
535 bool isDuplicate = ospf_dd_check_duplicate(neigh, hdr);
536
538 neigh->lastrecvDDPacket = OSPF_HDR_COPY(hdr);
539
540 print_ospf_log(OSPF_LOG, "Neighbor state is %s", strNeighborState[neigh->state]);
541
542 switch (neigh->state)
543 {
547 print_ospf_log(OSPF_LOG, "Ignoring DD msg");
548 break;
551 if (neigh->state != OSPFNEIGHSTATE_ExStart)
552 break;
555 thisInterface,
556 neigh,
557 hdr);
558 break;
560 ospf_process_dd_in_exchange_state(ospf, thisInterface, neigh, hdr, isDuplicate);
561 break;
564 ospf_process_dd_in_loading_or_full_state(thisInterface, neigh, hdr, isDuplicate);
565 break;
566 default:
567 fnNetSimError("Unknown neighbor state %s in %s.",
568 strNeighborState[neigh->state],
569 __FUNCTION__);
570 break;
571 }
572
573TERMINATE_PROCESSING_DD:
577}
unsigned int NETSIM_ID
Definition: Animation.h:45
#define c
#define UINT
Definition: Linux.h:38
#define fnNetSimError(x,...)
Definition: Linux.h:56
#define UINT16
Definition: Linux.h:33
#define realloc(p, s)
Definition: Memory.h:32
#define free(p)
Definition: Memory.h:31
#define calloc(c, s)
Definition: Memory.h:29
int isBitSet(unsigned int num, int index)
int ospf_lsa_compare(ptrOSPF_PDS ospf, ptrOSPFLSAHDR oldLS, ptrOSPFLSAHDR newLS)
Definition: OSPF_LSA.c:403
void ospf_event_set_and_call(int subevent, void *otherDetails)
#define OSPF_CURR_TIME()
Definition: OSPF.h:40
#define OSPF_PDS_CURRENT()
Definition: OSPF.h:151
#define OSPF_IF_CURRENT()
Definition: OSPF.h:179
void print_ospf_log(OSPFLOGFLAG logFlag, char *format,...)
#define OSPF_AREA_GET_ID(ospf, id)
Definition: OSPF.h:106
void ospf_lsreq_insertToList(ptrOSPF_NEIGHBOR neigh, ptrOSPFLSAHDR lsHdr, double time)
Definition: OSPF_LSREQ.c:74
@ OSPF_LOG
Definition: OSPF.h:31
ptrOSPFLSAHDR ospf_lsdb_lookup(ptrOSPF_PDS ospf, ptrOSPFAREA_DS area, LSTYPE lsType, OSPFID adveRouter, OSPFID linkStateID)
Definition: OSPF_LSDB.c:59
#define ospf_event_add(time, d, in, subevent, packet, eventdata)
Definition: OSPF.h:400
ptrOSPF_NEIGHBOR OSPF_NEIGHBOR_FIND(ptrOSPF_IF ospf, OSPFID id)
Definition: OSPF_Neighbor.c:93
void OSPF_DD_MSG_NEW(ptrOSPFPACKETHDR hdr)
Definition: OSPF_DD.c:23
static void set_DD_param_in_exchange(NetSim_PACKET *packet, ptrOSPF_IF ospf, ptrOSPF_NEIGHBOR neigh)
Definition: OSPF_DD.c:91
static void ospf_DD_update_dst(NetSim_PACKET *packet, ptrOSPF_NEIGHBOR neigh)
Definition: OSPF_DD.c:119
static ptrOSPFLSAHDR * ospf_DD_getTopLSAFromList(ptrOSPFLIST list, UINT16 *count, UINT maxCount)
Definition: OSPF_DD.c:69
static void send_DD_msg(ptrOSPF_IF ospf, ptrOSPF_NEIGHBOR neigh)
Definition: OSPF_DD.c:127
static void ospf_process_dd_in_init_state(ptrOSPF_NEIGHBOR neigh, ptrOSPFPACKETHDR hdr)
Definition: OSPF_DD.c:378
void start_sending_dd_msg()
Definition: OSPF_DD.c:207
static void ospf_process_dd_in_loading_or_full_state(ptrOSPF_IF ospf, ptrOSPF_NEIGHBOR neigh, ptrOSPFPACKETHDR hdr, bool isDuplicate)
Definition: OSPF_DD.c:481
static void ospf_process_DD(ptrOSPF_PDS ospf, ptrOSPF_IF thisInterface, ptrOSPF_NEIGHBOR neigh, ptrOSPFPACKETHDR hdr)
Definition: OSPF_DD.c:226
static void ospf_process_dd_in_exchange_state(ptrOSPF_PDS ospf, ptrOSPF_IF thisInterface, ptrOSPF_NEIGHBOR neigh, ptrOSPFPACKETHDR hdr, bool isDuplicate)
Definition: OSPF_DD.c:398
static bool validate_dd_msg(ptrOSPF_IF ospf, ptrOSPF_NEIGHBOR neigh, ptrOSPFDD dd)
Definition: OSPF_DD.c:306
static void ospf_process_dd_in_exstart_state(ptrOSPF_PDS ospf, ptrOSPF_IF ospfif, ptrOSPF_NEIGHBOR neigh, ptrOSPFPACKETHDR hdr)
Definition: OSPF_DD.c:343
void ospf_handle_DD()
Definition: OSPF_DD.c:510
static void copy_DD_param(ptrOSPFPACKETHDR hdr, ptrOSPF_NEIGHBOR neigh)
Definition: OSPF_DD.c:152
static void set_DD_param_in_exstart(ptrOSPFPACKETHDR hdr, ptrOSPF_IF ospf, ptrOSPF_NEIGHBOR neigh)
Definition: OSPF_DD.c:53
static void add_DD_rxmt_timer_in_exstart_state(ptrOSPF_IF ospf, ptrOSPF_NEIGHBOR neigh)
Definition: OSPF_DD.c:196
static bool ospf_dd_check_duplicate(ptrOSPF_NEIGHBOR neigh, ptrOSPFPACKETHDR hdr)
Definition: OSPF_DD.c:327
static void resend_DD_msg(ptrOSPF_IF ospf, ptrOSPF_NEIGHBOR neigh)
Definition: OSPF_DD.c:173
static void ospf_process_dd_in_exchange_state_for_duplicate(ptrOSPF_IF ospf, ptrOSPF_NEIGHBOR neigh, ptrOSPFPACKETHDR hdr)
Definition: OSPF_DD.c:386
ptrOSPFDD OSPF_DD_MSG_COPY(ptrOSPFDD dd)
Definition: OSPF_DD.c:32
void OSPF_DD_MSG_FREE(ptrOSPFDD dd)
Definition: OSPF_DD.c:44
@ OSPFIFTYPE_VIRTUALLINK
ptrOSPFLSAHDR OSPF_LSA_HDR_COPY(ptrOSPFLSAHDR lsa)
Definition: OSPF_LSA.c:245
void OSPF_LSA_HDR_FREE(ptrOSPFLSAHDR lsa)
Definition: OSPF_LSA.c:253
void * ospf_list_get_mem(ptrOSPFLIST list)
bool ospf_list_is_empty(ptrOSPFLIST list)
void OSPF_SEND_PACKET(NetSim_PACKET *packet)
Definition: OSPF_Msg.c:136
void OSPF_HDR_FREE(ptrOSPFPACKETHDR hdr)
Definition: OSPF_Msg.c:59
void OSPF_HDR_INCREASE_LEN(NetSim_PACKET *packet, UINT16 len)
Definition: OSPF_Msg.c:80
ptrOSPFPACKETHDR OSPF_HDR_COPY(ptrOSPFPACKETHDR hdr)
Definition: OSPF_Msg.c:48
void OSPF_HDR_SET_MSG(ptrOSPFPACKETHDR hdr, OSPFMSG type, void *msg, UINT16 len)
Definition: OSPF_Msg.c:70
NetSim_PACKET * OSPF_PACKET_NEW(double time, OSPFMSG type, NETSIM_ID d, NETSIM_ID in)
Definition: OSPF_Msg.c:106
#define OSPFDD_LEN_FIXED
Definition: OSPF_Msg.h:213
#define INTERFACE_MTU_DEFAULT
Definition: OSPF_Msg.h:25
@ OSPFMSG_DD
Definition: OSPF_Msg.h:34
#define DD_SET_MORE(dd)
Definition: OSPF_Msg.h:218
#define DD_MORE_BIT_INDEX
Definition: OSPF_Msg.h:215
#define DD_IS_INIT(dd)
Definition: OSPF_Msg.h:220
#define DD_SET_INIT(dd)
Definition: OSPF_Msg.h:217
#define DD_SET_MASTER(dd)
Definition: OSPF_Msg.h:219
#define DD_IS_MASTER(dd)
Definition: OSPF_Msg.h:222
#define OSPFLSAHDR_LEN
Definition: OSPF_Msg.h:402
#define OSPF_HDR_GET_MSG(hdr)
Definition: OSPF_Msg.h:93
#define OSPF_DD_MAX_LSA_COUNT()
Definition: OSPF_Msg.h:223
#define DD_IS_MORE(dd)
Definition: OSPF_Msg.h:221
#define OSPF_PACKET_GET_HDR(packet)
Definition: OSPF_Msg.h:91
@ LSTYPE_ROUTERLSA
Definition: OSPF_Msg.h:356
@ LSTYPE_UNDEFINED
Definition: OSPF_Msg.h:361
@ OSPFNEIGHSTATE_Exchange
Definition: OSPF_Neighbor.h:29
@ OSPFNEIGHSTATE_Loading
Definition: OSPF_Neighbor.h:31
@ OSPFNEIGHSTATE_2Way
Definition: OSPF_Neighbor.h:28
@ OSPFNEIGHSTATE_Full
Definition: OSPF_Neighbor.h:30
@ OSPFNEIGHSTATE_ExStart
Definition: OSPF_Neighbor.h:27
@ OSPFNEIGHSTATE_Attempt
Definition: OSPF_Neighbor.h:26
@ OSPFNEIGHSTATE_Init
Definition: OSPF_Neighbor.h:25
@ OSPFNEIGHSTATE_DOWN
Definition: OSPF_Neighbor.h:24
static char strNeighborState[][50]
Definition: OSPF_Neighbor.h:33
#define OSPFID_ISGREATER(id1, id2)
Definition: OSPF_Typedef.h:43
void * ptrOSPFLIST
Definition: OSPF_Typedef.h:50
#define OSPFID_ISSMALLER(id1, id2)
Definition: OSPF_Typedef.h:44
enum enum_ospf_msg OSPFMSG
Definition: OSPF_Typedef.h:38
void add_dest_to_packet(NetSim_PACKET *packet, NETSIM_ID dest)
#define DEVICE_NWADDRESS(DeviceId, InterfaceId)
Definition: Stack.h:805
#define MILLISECOND
Definition: Stack.h:59
#define SECOND
Definition: Stack.h:60
#define DEVICE_MYIP()
Definition: Stack.h:806
EXPORTED struct stru_NetSim_EventDetails * pstruEventDetails
Definition: Stack.h:837
#define fn_NetSim_Packet_FreePacket(pstruPacket)
Definition: main.h:177
struct stru_NetSim_Packet * pPacket
Definition: Stack.h:754
NETSIM_ID nDeviceId
Definition: Stack.h:750
NETSIM_ID nInterfaceId
Definition: Stack.h:751
NETSIM_IPAddress szDestIP
Definition: Packet.h:199
struct stru_NetSim_Packet_NetworkLayer * pstruNetworkData
Definition: Packet.h:275
char str_ip[_NETSIM_IP_LEN]
Definition: IP_Addressing.h:54
LSTYPE LSType
Definition: OSPF_Msg.h:391
OSPFID AdvertisingRouter
Definition: OSPF_Msg.h:393
OSPFID LinkStateID
Definition: OSPF_Msg.h:392
ptrOSPFLSAHDR * LSAHeader
Definition: OSPF_Msg.h:211
UINT DDSequenceNumber
Definition: OSPF_Msg.h:209
UINT16 InterfaceMTU
Definition: OSPF_Msg.h:206
UINT8 IMMS
Definition: OSPF_Msg.h:208
UINT16 numLSA
Definition: OSPF_Msg.h:210
UINT8 Option
Definition: OSPF_Msg.h:207
OSPFTIME routerDeadInterval
OSPFTIME RxmtInterval
OSPFIFTYPE Type
ptrOSPFPACKETHDR lastrecvDDPacket
Definition: OSPF_Neighbor.h:54
ptrOSPFPACKETHDR lastSentDDPacket
Definition: OSPF_Neighbor.h:55
OSPFNEIGHSTATE state
Definition: OSPF_Neighbor.h:47
ptrOSPFLIST neighDBSummaryList
Definition: OSPF_Neighbor.h:66
NETSIM_IPAddress neighborIPAddr
Definition: OSPF_Neighbor.h:58
OSPFID routerId
Definition: OSPF.h:114