22#define is_neighbor_DR(ospf,neigh) (!OSPFID_COMPARE(ospf->designaterRouter,neigh->neighborId))
23#define is_neighbor_backupDR(ospf, neigh) (!OSPFID_COMPARE(ospf->backupDesignaterRouter,neigh->neighborId))
122 neigh =
calloc(1,
sizeof* neigh);
186 print_ospf_log(
OSPF_LOG,
"Time %0.4lf, Router %d, Interface %d (%s) 1-way event is triggered for neighbor %s",
245 print_ospf_log(
OSPF_LOG,
"Time %0.4lf: Router %d, interface %d (%s) 2-Way received event triggered for neighbor %s",
261 print_ospf_log(
OSPF_LOG,
"Time %0.4lf, Router %d, interface %d (%s) HelloReceived event triggered for neighbor %s",
285 OSPF_InactivityTimer,
361 print_ospf_log(
OSPF_LOG,
"Time %0.4lf, Router %d, Interface %d (%s), %s event is triggered for neighbor %s",
385 print_ospf_log(
OSPF_LOG,
"Time %0.4lf, Router %d, Interface %d (%s), %s event is triggered for neighbor %s",
433 OSPF_InactivityTimer,
445 "%s event is triggered for neighbor %s.",
524 for (i = 0; i < ospf->
ifCount; i++)
571 for (i = 0; i < ospf->
ifCount; i++)
580 return thisInterface->
id;
596 "Neighbor (%s) state move up to Full", d, tempNeighborInfo->
neighborId);
#define IP_COMPARE(ip1, ip2)
char * GetStringOSPF_Subevent(NETSIM_ID)
char * form_dlogId(char *name, NETSIM_ID d)
#define OSPF_PDS_CURRENT()
#define OSPF_AREA_GET_IN(ospf, in)
#define OSPF_IF_CURRENT()
void start_sending_dd_msg()
void print_ospf_log(OSPFLOGFLAG logFlag, char *format,...)
void ospf_lsa_printList(char *logid, ptrOSPFLIST list, char *name)
void ospf_lsreq_send(ptrOSPF_PDS ospf, NETSIM_ID interfaceId, NETSIM_IPAddress nbrAddr, bool retx)
UINT16 ospf_lsa_maskDoNotAge(ptrOSPF_PDS ospf, UINT16 routerLSAAge)
ptrOSPFLIST ospf_lsreq_initList()
void ospf_lsa_schedule_routerLSA(ptrOSPF_PDS ospf, ptrOSPFAREA_DS area, bool isFlush)
#define ospf_event_add(time, d, in, subevent, packet, eventdata)
void ospf_lsa_scheduleNWLSA(ptrOSPF_PDS ospf, ptrOSPF_IF thisInterface, ptrOSPFAREA_DS area, bool isFlush)
ptrOSPFLSAHDR OSPF_LSA_HDR_COPY(ptrOSPFLSAHDR lsa)
void OSPF_LSA_MSG_FREE(ptrOSPFLSAHDR hdr)
ptrOSPFLSAHDR OSPF_LSA_MSG_COPY(ptrOSPFLSAHDR hdr)
#define ospf_list_add_mem(list, mem)
void ospf_list_deleteIterator(void *ite)
void ospf_list_delete_all(ptrOSPFLIST list)
void * ospf_list_iterate_mem(ptrOSPFLIST list, void *iterator)
void ospf_list_destroy(ptrOSPFLIST list)
ptrOSPFLIST ospf_list_init(void(*freeMem)(void *), void *(*copyMem)(void *))
void * ospf_list_newIterator()
bool ospf_list_is_empty(ptrOSPFLIST list)
void OSPF_HDR_FREE(ptrOSPFPACKETHDR hdr)
static void ospf_neighbor_change_state(ptrOSPF_NEIGHBOR neigh, OSPFNEIGHSTATE state)
void ospf_neighbor_handle_KillNbrEvent()
#define is_neighbor_backupDR(ospf, neigh)
void ospf_neighbor_handle_1way_event()
bool ospf_is_dr_router_fulladjacentwithAnother(ptrOSPF_IF ospf)
void ospf_neighbor_handle_exchangeDone_event()
ptrOSPF_NEIGHBOR OSPF_NEIGHBOR_FIND_BY_IP(ptrOSPF_IF thisInterface, NETSIM_IPAddress ip)
void ospf_neighbor_handle_inactivityTimer_event()
void ospf_neighbor_handle_helloReceived_event()
void ospf_neighbor_handle_start_event()
#define is_neighbor_DR(ospf, neigh)
void ospf_neighbor_add(ptrOSPF_IF ospf, ptrOSPF_NEIGHBOR neigh)
ptrOSPF_NEIGHBOR ospf_neighbor_new(NETSIM_IPAddress ip, OSPFID rid)
void ospf_neighbor_handle_negotiationDone_event()
bool ospf_neighbor_isAnyNeighborInExchangeOrLoadingState(ptrOSPF_PDS ospf)
ptrOSPFLSAHDR ospf_neighbor_searchSendList(ptrOSPFLIST list, ptrOSPFLSAHDR lsa)
static void ospf_handle_2wayReceived_event_in_init_state(ptrOSPF_IF ospf, ptrOSPF_NEIGHBOR neigh)
static void ospf_neighbor_addToRxtList(ptrOSPF_PDS ospf, ptrOSPF_IF thisInterface, ptrOSPF_NEIGHBOR neigh, ptrOSPFLSAHDR lsa)
bool ospf_is_router_fullAdjacentWithDR(ptrOSPF_IF ospf)
NETSIM_ID ospf_neighbor_getInterfaceIdforThisNeighbor(ptrOSPF_PDS ospf, NETSIM_IPAddress neighIPaddr)
static void ospf_neighbor_attempt_adjacency(ptrOSPF_NEIGHBOR neigh)
static void ospf_neighbor_create_DBSummaryList(ptrOSPF_PDS pds, ptrOSPF_IF ospf, ptrOSPF_NEIGHBOR neigh)
void ospf_neighbor_insertToSendList(ptrOSPFLIST list, ptrOSPFLSAHDR lsa, double time)
void ospf_neighbor_handle_2wayReceived_event()
static void ospf_neighbor_update_DBSummaryList(ptrOSPF_PDS ospf, ptrOSPF_IF thisInterface, ptrOSPF_NEIGHBOR neigh, ptrOSPFLIST list)
static void restart_inactivity_timer(ptrOSPF_IF ospf, ptrOSPF_NEIGHBOR neigh)
static bool is_adjacency_should_established(ptrOSPF_IF ospf, ptrOSPF_NEIGHBOR neigh)
void ospf_neighbor_handle_LoadingDoneEvent()
void ospf_neighbor_remove(ptrOSPF_PDS ospf, ptrOSPF_IF thisInterface, ptrOSPF_NEIGHBOR neigh)
ptrOSPF_NEIGHBOR OSPF_NEIGHBOR_FIND(ptrOSPF_IF ospf, OSPFID id)
@ OSPFNEIGHSTATE_Exchange
static char strNeighborState[][50]
enum enum_ospf_neighbor_state OSPFNEIGHSTATE
int fnDeleteEvent(unsigned long long int nEventId)
EXPORTED struct stru_NetSim_EventDetails * pstruEventDetails
NETSIM_ID fn_NetSim_Stack_GetDeviceId_asIP(NETSIM_IPAddress ip, NETSIM_ID *nInterfaceId)
ptrOSPFLIST routerLSAList
ptrOSPFLIST routerSummaryLSAList
ptrOSPFLIST nwSummaryLSAList
char str_ip[_NETSIM_IP_LEN]
NETSIM_IPAddress neighborIP
OSPFTIME routerDeadInterval
ptrOSPF_NEIGHBOR * neighborRouterList
bool isInactivityTimerAdded
ptrOSPFLIST neighLSRxtList
ptrOSPFLIST linkStateSendList
ptrOSPFPACKETHDR lastrecvDDPacket
OSPFID neighborDesignateBackupRouter
ptrOSPFPACKETHDR lastSentDDPacket
OSPFID neighborDesignateRouter
ptrOSPFLIST neighDBSummaryList
ptrOSPFLIST neighLSReqList
NETSIM_IPAddress neighborIPAddr