33 double delay = max_time + min_time - ((rank - min_rank) * (max_time - min_time) / (max_rank - min_rank) + min_time);
61 for (i = 0; i < route_count; i++)
69 if (route_list != NULL)
80 memset(&pevent, 0,
sizeof pevent);
95 for (i = 0; i < route_count; i++)
115 ispresent = (
bool*)
calloc(target_count,
sizeof* ispresent);
121 for (i = 0; i < target_count; i++)
130#ifdef DEBUG_RPL_PRINT_DAO_ROUTE_INFOMATION
131 print_rpl_log(
"Node '%d',%0.3lfms: received dao msg with old route information. dest = %s, gateway=%s.",
140 if (route_list != NULL)
143 for (i = 0; i < target_count; i++)
147#ifdef DEBUG_RPL_PRINT_DAO_ROUTE_INFOMATION
148 print_rpl_log(
"Node '%d',%0.3lfms: received dao msg with new route information. dest = %s, gateway= %s.",
156 target[i]->Traget_Prefix,
158 target[i]->Prefix_Length,
169 memset(&pevent, 0,
sizeof pevent);
188 double minupdatetime = 0xFFFFFFFFFFFF;
190 for (i = 0; i < route_count; i++)
195#ifdef DEBUG_RPL_PRINT_DAO_ROUTE_INFOMATION
196 print_rpl_log(
"Node '%d',%0.3lfms: Route %s, prefix %d is expired.",
236 memcpy(drpl, srpl,
sizeof* drpl);
241 memcpy(db, b,
sizeof* db);
void rpl_dao_msg_copy(const NetSim_PACKET *destPacket, const NetSim_PACKET *srcPacket)
static double compute_dao_delay(NETSIM_ID d)
void rpl_process_dao_msg()
void rpl_dao_msg_destroy(NetSim_PACKET *packet)
static ptrIP_ROUTINGTABLE check_is_route_is_present(PRPL_TARGET_OPTION target, ptrIP_ROUTINGTABLE *route_list, UINT route_count)
void rpl_dao_route_timeout()
int iptable_delete_by_route(ptrIP_WRAPPER wrapper, ptrIP_ROUTINGTABLE route)
ptrIP_ROUTINGTABLE iptable_add(ptrIP_WRAPPER wrapper, NETSIM_IPAddress dest, NETSIM_IPAddress subnet, unsigned int prefix_len, NETSIM_IPAddress gateway, UINT interfaceCount, NETSIM_IPAddress *interfaceIp, NETSIM_ID *interfaceId, unsigned int metric, char *type)
ptrIP_ROUTINGTABLE * iptable_get_table_by_type(ptrIP_ROUTINGTABLE table, char *type, UINT *count)
NETSIM_IPAddress IP_COPY(NETSIM_IPAddress ip)
#define IP_COMPARE(ip1, ip2)
bool rpl_node_is_joined(PRPL_NODE r)
void print_rpl_log(char *format,...)
#define RPL_DEFAULT_DAO_REMOVE_TIMEOUT
#define RPL_IP_TO_STR(ip)
void create_and_add_rpl_target_option(NetSim_PACKET *dao_pdu, UINT8 prefix_len, NETSIM_IPAddress dest)
PRPL_OPTION rpl_option_copy(PRPL_OPTION option)
void rpl_node_send_msg(NETSIM_ID ndevid, NetSim_PACKET *packet)
void ** get_all_option_from_msg(PRPL_CTRL_MSG msg, RPL_OPTION_TYPE type, UINT *count)
NetSim_PACKET * create_dao_message(NETSIM_ID ndevid, double time, NETSIM_ID parent)
void rpl_option_destroy(PRPL_OPTION option)
#define GET_PRPL_CTRL_MSG(packet)
struct stru_rpl_ctrl_message * PRPL_CTRL_MSG
struct stru_rpl_dao_base * PRPL_DAO_BASE
#define DEVICE_TYPE(DeviceId)
#define DEVICE_NWADDRESS(DeviceId, InterfaceId)
EXPORTED struct stru_NetSim_EventDetails * pstruEventDetails
#define IP_WRAPPER_GET(DeviceId)
#define IP_TABLE_GET(DeviceId)
#define fnpAddEvent(pstruEvent)
struct stru_NetSim_Packet * pPacket
netsimDEVICE_TYPE nDeviceType
Structure to store ip routing table.
NETSIM_IPAddress networkDestination
void * Packet_RoutingProtocol
NETSIM_IPAddress szSourceIP
struct stru_NetSim_Packet_NetworkLayer * pstruNetworkData
PRPL_NEIGHBOR pref_parent
NETSIM_IPAddress Traget_Prefix