NetSim Source Code Help
Loading...
Searching...
No Matches
OSPF_Msg.h
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
15#ifndef _NETSIM_OSPF_MSG_H_
16#define _NETSIM_OSPF_MSG_H_
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21#define OSPF_VERSION 2
22#ifndef OSPFID
24#endif // !OSPFID
25#define INTERFACE_MTU_DEFAULT 1500 //Bytes
26#define IP_HDR_LEN 20 //Bytes
27#define OSPF_INITIAL_SEQUENCE_NUMBER 0x80000001
28#define OSPF_MAX_SEQUENCE_NUMBER 0x7FFFFFFF
29
30
32 {
38 };
39#define OSPFMSG_TO_PACKETTYPE(msg) (APP_PROTOCOL_OSPF*100+msg)
40#define OSPFMSG_FROM_PACKETTYPE(type) (type/100==APP_PROTOCOL_OSPF?type%100:0)
41
42 // Type of link.
43 typedef enum
44 {
50 static char strOSPFLINKTYPE[][50] = { "NULL","Point_to_Point","Transit","Stub","Virtual" };
51
52 /*
53 A.3.1 The OSPF packet header
54 0 1 2 3
55 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
56 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
57 | Version # | Type | Packet length |
58 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
59 | Router ID |
60 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
61 | Area ID |
62 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
63 | Checksum | AuType |
64 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
65 | Authentication |
66 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
67 | Authentication |
68 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
69
70 */
71
73 {
82
83 void* ospfMSG;
84 };
85#define OSPFPACKETHDR_LEN 24 //Bytes
86#define OSPF_HDR_SET_ROUTERID(hdr,id) ((hdr)->RouterId = id)
87#define OSPF_HDR_SET_AREAID(hdr,id) ((hdr)->AreaId = id)
88#define OSPF_MSG_TYPE(hdr) ((hdr)->Type)
89#define OSPF_MSG_IS_TYPE(hdr,type) ((hdr)->Type==type)
90#define OSPF_HDR_GET_LEN(hdr) ((hdr)->Packet_length)
91#define OSPF_PACKET_GET_HDR(packet) ((ptrOSPFPACKETHDR)((packet)->pstruAppData->Packet_AppProtocol))
92#define OSPF_PACKET_SET_HDR(packet,hdr) ((packet)->pstruAppData->Packet_AppProtocol=hdr)
93#define OSPF_HDR_GET_MSG(hdr) ((hdr)->ospfMSG)
94#define OSPF_PACKET_GET_MSG(packet) (OSPF_HDR_GET_MSG(OSPF_PACKET_GET_HDR(packet)))
95#define OSPF_PACKET_GET_MSG_TYPE(packet) (OSPF_MSG_TYPE(OSPF_PACKET_GET_HDR(packet)))
97 UINT16 len);
99 OSPFMSG type,
100 void* msg,
101 UINT16 len);
104
105 //OSPF Option
106#define OPT_E_BIT_INDEX 2
107#define OPT_MC_BIT_INDEX 3
108#define OPT_NP_BIT_INDEX 4
109#define OPT_EA_BIT_INDEX 5
110#define OPT_DC_BIT_INDEX 6
111#define OPT_SET_E(opt) ((opt) = setBit((opt),OPT_E_BIT_INDEX))
112#define OPT_SET_MC(opt) ((opt) = setBit((opt),OPT_MC_BIT_INDEX))
113#define OPT_SET_NP(opt) ((opt) = setBit((opt),OPT_NP_BIT_INDEX))
114#define OPT_SET_EA(opt) ((opt) = setBit((opt),OPT_EA_BIT_INDEX))
115#define OPT_SET_DC(opt) ((opt) = setBit((opt),OPT_DC_BIT_INDEX))
116#define OPT_IS_E(opt) (isBitSet((opt),OPT_E_BIT_INDEX))
117#define OPT_IS_MC(opt) (isBitSet((opt),OPT_MC_BIT_INDEX))
118#define OPT_IS_NP(opt) (isBitSet((opt),OPT_NP_BIT_INDEX))
119#define OPT_IS_EA(opt) (isBitSet((opt),OPT_EA_BIT_INDEX))
120#define OPT_IS_DC(opt) (isBitSet((opt),OPT_DC_BIT_INDEX))
121
122 /*
123 A.3.2 The Hello packet
124 0 1 2 3
125 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
126 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
127 | Version # | 1 | Packet length |
128 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
129 | Router ID |
130 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
131 | Area ID |
132 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
133 | Checksum | AuType |
134 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
135 | Authentication |
136 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
137 | Authentication |
138 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
139 | Network Mask |
140 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
141 | HelloInterval | Options | Rtr Pri |
142 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
143 | RouterDeadInterval |
144 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
145 | Designated Router |
146 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
147 | Backup Designated Router |
148 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
149 | Neighbor |
150 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
151 | ... |
152 */
154 {
163
165 };
166#define OSPFHELLO_LEN_FIXED 20 //Bytes
170
171 /*
172 A.3.3 The Database Description packet
173 0 1 2 3
174 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
175 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
176 | Version # | 2 | Packet length |
177 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
178 | Router ID |
179 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
180 | Area ID |
181 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
182 | Checksum | AuType |
183 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
184 | Authentication |
185 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
186 | Authentication |
187 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
188 | Interface MTU | Options |0|0|0|0|0|I|M|MS
189 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
190 | DD sequence number |
191 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
192 | |
193 +- -+
194 | |
195 +- An LSA Header -+
196 | |
197 +- -+
198 | |
199 +- -+
200 | |
201 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
202 | ... |
203 */
204 typedef struct stru_ospf_DD
205 {
213#define OSPFDD_LEN_FIXED 8 //Bytes
214#define DD_INIT_BIT_INDEX 3
215#define DD_MORE_BIT_INDEX 2
216#define DD_MASTER_BIT_INDEX 1
217#define DD_SET_INIT(dd) ((dd)->IMMS = (UINT8)setBit((dd)->IMMS,DD_INIT_BIT_INDEX))
218#define DD_SET_MORE(dd) ((dd)->IMMS = (UINT8)setBit((dd)->IMMS,DD_MORE_BIT_INDEX))
219#define DD_SET_MASTER(dd) ((dd)->IMMS = (UINT8)setBit((dd)->IMMS,DD_MASTER_BIT_INDEX))
220#define DD_IS_INIT(dd) (isBitSet((dd)->IMMS,DD_INIT_BIT_INDEX))
221#define DD_IS_MORE(dd) (isBitSet((dd)->IMMS,DD_MORE_BIT_INDEX))
222#define DD_IS_MASTER(dd) (isBitSet((dd)->IMMS,DD_MASTER_BIT_INDEX))
223#define OSPF_DD_MAX_LSA_COUNT() ((INTERFACE_MTU_DEFAULT - IP_HDR_LEN - OSPFDD_LEN_FIXED - OSPFPACKETHDR_LEN) / OSPFLSAHDR_LEN);
227
228 /*
229 A.3.4 The Link State Request packet
230 0 1 2 3
231 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
232 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
233 | Version # | 3 | Packet length |
234 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
235 | Router ID |
236 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
237 | Area ID |
238 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
239 | Checksum | AuType |
240 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
241 | Authentication |
242 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
243 | Authentication |
244 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
245 | LS type |
246 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
247 | Link State ID |
248 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
249 | Advertising Router |
250 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
251 | ... |
252 */
254 {
259
260 typedef struct stru_ospf_lsrequest
261 {
265#define OSPFLSREQ_LEN_SINGLE 12 //Bytes
269
270 /*
271 A.3.5 The Link State Update packet
272 0 1 2 3
273 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
274 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
275 | Version # | 4 | Packet length |
276 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
277 | Router ID |
278 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
279 | Area ID |
280 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
281 | Checksum | AuType |
282 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
283 | Authentication |
284 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
285 | Authentication |
286 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
287 | # LSAs |
288 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
289 | |
290 +- +-+
291 | LSAs |
292 +- +-+
293 | ... |
294
295 */
296 typedef struct stur_ospf_lsupdate
297 {
299 void** LSAs;
301#define OSPFLSUPDATE_LEN_FIXED 4 //Bytes
305
306 /*
307 A.3.6 The Link State Acknowledgment packet
308 0 1 2 3
309 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
310 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
311 | Version # | 5 | Packet length |
312 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
313 | Router ID |
314 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
315 | Area ID |
316 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
317 | Checksum | AuType |
318 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
319 | Authentication |
320 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
321 | Authentication |
322 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
323 | |
324 +- -+
325 | |
326 +- An LSA Header -+
327 | |
328 +- -+
329 | |
330 +- -+
331 | |
332 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
333 | ... |
334 */
335 typedef struct stru_ospf_lsack
336 {
340#define OSPFLSACK_LEN_FIXED 0 //Bytes
344
345 /*
346 LS Type Description
347 ___________________________________
348 1 Router-LSAs
349 2 Network-LSAs
350 3 Summary-LSAs (IP network)
351 4 Summary-LSAs (ASBR)
352 5 AS-external-LSAs
353 */
355 {
362 };
363 static char strLSTYPE[][50] = { "UNKNOWN",
364 "ROUTER_LSA",
365 "NETWORK_LSA",
366 "SUMMARY_LSA_ROUTER",
367 "SUMMARY_LSA_NETWORK",
368 "AS_EXTERNAL_LSA"
369 "UNDEFINED"};
370
371 /*
372 A.4.1 The LSA header
373 0 1 2 3
374 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
375 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
376 | LS age | Options | LS type |
377 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
378 | Link State ID |
379 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
380 | Advertising Router |
381 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
382 | LS sequence number |
383 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
384 | LS checksum | length |
385 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
386 */
388 {
397 void* lsaInfo;
398
399 //Simulation specific.
400 double time;
401 };
402#define OSPFLSAHDR_LEN 20 //Bytes
407
408 /*
409 A.4.2 Router-LSAs
410 0 1 2 3
411 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
412 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
413 | LS age | Options | 1 |
414 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
415 | Link State ID |
416 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
417 | Advertising Router |
418 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
419 | LS sequence number |
420 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
421 | LS checksum | length |
422 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
423 | 0 |V|E|B| 0 | # links |
424 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
425 | Link ID |
426 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
427 | Link Data |
428 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
429 | Type | # TOS | metric |
430 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
431 | ... |
432 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
433 | TOS | 0 | TOS metric |
434 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
435 | Link ID |
436 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
437 | Link Data |
438 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
439 | ... |
440 */
441 typedef struct stru_ospf_rlsa_link
442 {
451 #define OSPFRLSALINK_LEN_FIXED 12 //Bytes
452
454 {
459 };
460#define OSPFRLSA_LEN_FIXED 4 //Bytes
463
464 //Function prototype
465 NetSim_PACKET* OSPF_PACKET_NEW(double time,
466 OSPFMSG type,
467 NETSIM_ID d,
468 NETSIM_ID in);
469 void OSPF_SEND_PACKET(NetSim_PACKET* packet);
471 NETSIM_ID d,
472 NETSIM_ID in);
473
474#ifdef __cplusplus
475}
476#endif
477#endif //_NETSIM_OSPF_MSG_H_
unsigned int NETSIM_ID
Definition: Animation.h:45
#define UINT
Definition: Linux.h:38
#define UINT16
Definition: Linux.h:33
#define UINT8
Definition: Linux.h:31
void OSPF_DD_MSG_NEW(ptrOSPFPACKETHDR hdr)
Definition: OSPF_DD.c:23
void OSPF_LSACK_NEW(ptrOSPFPACKETHDR hdr)
Definition: OSPF_LSAACK.c:45
void OSPFLSAINFO_FREE_RLSA(ptrOSPFRLSA rlsa)
Definition: OSPF_RLSA.c:48
ptrOSPFLSAHDR OSPF_LSA_HDR_COPY(ptrOSPFLSAHDR lsa)
Definition: OSPF_LSA.c:245
ptrOSPFLSACK OSPF_LSACK_COPY(ptrOSPFLSACK ack)
Definition: OSPF_LSAACK.c:23
ptrOSPFRLSA OSPFLSAINFO_COPY_RLSA(ptrOSPFRLSA rlsa)
Definition: OSPF_RLSA.c:61
OSPFLINKTYPE
Definition: OSPF_Msg.h:44
@ OSPFLINKTYPE_VIRTUAL
Definition: OSPF_Msg.h:48
@ OSPFLINKTYPE_TRANSIT
Definition: OSPF_Msg.h:46
@ OSPFLINKTYPE_POINT_TO_POINT
Definition: OSPF_Msg.h:45
@ OSPFLINKTYPE_STUB
Definition: OSPF_Msg.h:47
struct stur_ospf_lsupdate OSPFLSUPDATE
ptrOSPFLSUPDATE OSPF_LSUPDATE_MSG_COPY(ptrOSPFLSUPDATE lsu)
Definition: OSPF_LSUPDATE.c:32
struct stru_ospf_lsack * ptrOSPFLSACK
static char strOSPFLINKTYPE[][50]
Definition: OSPF_Msg.h:50
void OSPF_SEND_PACKET(NetSim_PACKET *packet)
Definition: OSPF_Msg.c:136
void OSPF_LSA_MSG_FREE(ptrOSPFLSAHDR hdr)
Definition: OSPF_LSA.c:231
struct stru_ospf_DD * ptrOSPFDD
void OSPF_LSUPDATE_MSG_NEW(ptrOSPFPACKETHDR hdr)
Definition: OSPF_LSUPDATE.c:23
void OSPF_HELLO_MSG_NEW(ptrOSPFPACKETHDR hdr)
Definition: OSPF_Hello.c:24
ptrOSPFLSAHDR OSPF_LSA_MSG_COPY(ptrOSPFLSAHDR hdr)
Definition: OSPF_LSA.c:237
enum_ospf_msg
Definition: OSPF_Msg.h:32
@ OSPFMSG_DD
Definition: OSPF_Msg.h:34
@ OSPFMSG_HELLO
Definition: OSPF_Msg.h:33
@ OSPFMSG_LSUPDATE
Definition: OSPF_Msg.h:36
@ OSPFMSG_LSACK
Definition: OSPF_Msg.h:37
@ OSPFMSG_LSREQUEST
Definition: OSPF_Msg.h:35
void OSPF_LSA_HDR_FREE(ptrOSPFLSAHDR lsa)
Definition: OSPF_LSA.c:253
struct stur_ospf_lsupdate * ptrOSPFLSUPDATE
struct stru_ospf_lsrequest OSPFLSREQ
struct stru_ospf_LSREQ_Object * ptrOSPFLSREQOBJ
static char strLSTYPE[][50]
Definition: OSPF_Msg.h:363
NETSIM_IPAddress OSPFID
Definition: OSPF_Msg.h:23
void OSPF_HDR_FREE(ptrOSPFPACKETHDR hdr)
Definition: OSPF_Msg.c:59
void OSPF_LSUPDATE_MSG_FREE(ptrOSPFLSUPDATE lsu)
Definition: OSPF_LSUPDATE.c:44
void OSPF_HDR_INCREASE_LEN(NetSim_PACKET *packet, UINT16 len)
Definition: OSPF_Msg.c:80
ptrOSPFLSREQ OSPF_LSREQ_MSG_COPY(ptrOSPFLSREQ lsr)
Definition: OSPF_LSREQ.c:39
struct stru_ospf_lsack OSPFLSACK
void OSPF_LSREQ_MSG_FREE(ptrOSPFLSREQ lsr)
Definition: OSPF_LSREQ.c:54
bool validate_ospf_packet(NetSim_PACKET *packet, NETSIM_ID d, NETSIM_ID in)
Definition: OSPF_Msg.c:202
void OSPF_LSACK_FREE(ptrOSPFLSACK ack)
Definition: OSPF_LSAACK.c:37
struct stru_ospf_rlsa_link * ptrOSPFRLSALINK
struct stru_ospf_LSREQ_Object OSPFLSREQOBJ
ptrOSPFHELLO OSPF_HELLO_MSG_COPY(ptrOSPFHELLO hello)
Definition: OSPF_Hello.c:33
struct stru_ospf_DD OSPFDD
void OSPF_LSREQ_MSG_NEW(ptrOSPFPACKETHDR hdr)
Definition: OSPF_LSREQ.c:30
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
enum_ls_type
Definition: OSPF_Msg.h:355
@ LSTYPE_ROUTERLSA
Definition: OSPF_Msg.h:356
@ LSTYPE_UNDEFINED
Definition: OSPF_Msg.h:361
@ LSTYPE_NETWORKLSA
Definition: OSPF_Msg.h:357
@ LSTYPE_SUMMARYLSA_NETWORK
Definition: OSPF_Msg.h:359
@ LSTYPE_ASEXTERNALLSA
Definition: OSPF_Msg.h:360
@ LSTYPE_SUMMARYLSA_ROUTER
Definition: OSPF_Msg.h:358
struct stru_ospf_lsrequest * ptrOSPFLSREQ
ptrOSPFDD OSPF_DD_MSG_COPY(ptrOSPFDD dd)
Definition: OSPF_DD.c:32
void OSPF_DD_MSG_FREE(ptrOSPFDD dd)
Definition: OSPF_DD.c:44
NetSim_PACKET * OSPF_PACKET_NEW(double time, OSPFMSG type, NETSIM_ID d, NETSIM_ID in)
Definition: OSPF_Msg.c:106
void OSPF_HELLO_MSG_FREE(ptrOSPFHELLO hello)
Definition: OSPF_Hello.c:45
struct stru_ospf_rlsa_link OSPFRLSALINK
enum enum_ls_type LSTYPE
Definition: OSPF_Typedef.h:36
enum enum_ospf_msg OSPFMSG
Definition: OSPF_Typedef.h:38
LSTYPE LSType
Definition: OSPF_Msg.h:391
UINT LSSequenceNumber
Definition: OSPF_Msg.h:394
UINT16 LSChecksum
Definition: OSPF_Msg.h:395
void * lsaInfo
Definition: OSPF_Msg.h:397
UINT16 length
Definition: OSPF_Msg.h:396
OSPFID AdvertisingRouter
Definition: OSPF_Msg.h:393
UINT16 LSAge
Definition: OSPF_Msg.h:389
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
NETSIM_IPAddress LinkStateId
Definition: OSPF_Msg.h:256
NETSIM_IPAddress AdvertisingRouter
Definition: OSPF_Msg.h:257
NETSIM_IPAddress NetworkMask
Definition: OSPF_Msg.h:155
UINT RouterDeadInterval
Definition: OSPF_Msg.h:159
UINT16 HelloInterval
Definition: OSPF_Msg.h:156
NETSIM_IPAddress DesignatedRouter
Definition: OSPF_Msg.h:160
NETSIM_IPAddress * Neighbor
Definition: OSPF_Msg.h:162
NETSIM_IPAddress BackupDesignatedRouter
Definition: OSPF_Msg.h:161
ptrOSPFLSAHDR * LSAHeader
Definition: OSPF_Msg.h:338
ptrOSPFLSREQOBJ * lsrObj
Definition: OSPF_Msg.h:263
ptrOSPFRLSALINK * rlsaLink
Definition: OSPF_Msg.h:458