21int fn_NetSim_AODV_TransmitHelloMessage(NetSim_EVENTDETAILS* pstruEventDetails)
23 NetSim_EVENTDETAILS pevent;
25 memcpy(&pevent,pstruEventDetails,
sizeof pevent);
26 pevent.dEventTime += AODV_HELLO_INTERVAL;
28 if(AODV_DEV_VAR(pstruEventDetails->nDeviceId)->dLastBroadcastTime+AODV_HELLO_INTERVAL > pstruEventDetails->dEventTime)
30 if(AODV_DEV_VAR(pstruEventDetails->nDeviceId)->routeTable)
32 NetSim_PACKET* packet = fn_NetSim_AODV_GenerateCtrlPacket(pstruEventDetails->nDeviceId,
35 pstruEventDetails->dEventTime,
37 AODV_RREP* hello = calloc(1,
sizeof* hello);
38 packet->pstruNetworkData->Packet_RoutingProtocol = hello;
39 packet->pstruNetworkData->nTTL = 2;
40 strcpy(packet->szPacketType,
"AODV_RREP(HELLO)");
41 hello->DestinationIPaddress = aodv_get_curr_ip();
44 hello->LastAddress = aodv_get_curr_ip();
45 hello->
Lifetime = (
unsigned int)(pstruEventDetails->dEventTime +
46 (
double)AODV_ALLOWED_HELLO_LOSS*AODV_HELLO_INTERVAL);
50 pevent.dEventTime = pstruEventDetails->dEventTime;
51 pevent.dPacketSize = fnGetPacketSize(packet);
52 pevent.nApplicationId = 0;
53 pevent.nApplicationId = 0;
54 pevent.nEventType = NETWORK_OUT_EVENT;
55 pevent.nProtocolId = fn_NetSim_Stack_GetNWProtocol(pstruEventDetails->nDeviceId);
56 pevent.nSubEventType = 0;
57 pevent.pPacket = packet;
58 pevent.szOtherDetails = NULL;
60 packet->pstruNetworkData->szNextHopIp=NULL;
NETSIM_IPAddress OriginatorIPaddress
The IP address of the node which originated the RREQ for which the route is supplied.
unsigned int DestinationSequenceNumber
The destination sequence number associated to the route.
unsigned int Lifetime
The time in milliseconds for which nodes receiving the RREP consider the route to be valid.