29 return memcmp(d1, d2,
sizeof* d1);
56 return base_changed || dodag_config_changed;
101 if (dodag_config_suboption == NULL)
120 if (!best_dio_base->
G && diobase->
G)
123 best_dio_base = best_dio_pdu->
Base;
125 else if (best_dio_base->
G == diobase->
G)
127 if (best_dio_base->
Prf < diobase->
Prf)
130 best_dio_base = best_dio_pdu->
Base;
132 else if (best_dio_base->
Prf == diobase->
Prf)
134 if (best_dio_base->
DTSN < diobase->
DTSN)
137 best_dio_base = best_dio_pdu->
Base;
143 if (best_dio_pdu != root_dio_pdu)
160 print_rpl_log(
"node '%d': no preferable DODAG iterations around", d);
163 if (old_pref_parent != NULL &&
167 if (diobase->
G == best_dio_base->
G &&
168 diobase->
Prf == best_dio_base->
Prf)
174 best_dio_base = best_dio_pdu->
Base;
228 print_rpl_log(
"node '%d': received a new/modified message from node '%d' with dodag_id = '%s'",
256 if (preferred_dodag_pdu != NULL)
259 print_rpl_log(
"node '%d': was isolated, now found dodag_id = '%s'",
271 if (preferred_dodag_pdu != NULL)
274 print_rpl_log(
"node '%d': was root of dodag_id = '%s', now found a better one with dodag_id = '%s'",
293 if (preferred_dodag_pdu != NULL)
296 print_rpl_log(
"node '%d': was member of dodag_id = '%s', now found a better one with dodag_id = '%s'",
304 print_rpl_log(
"node '%d': was member of dodag_id = '%s', now starting own root",
315 print_rpl_log(
"node '%d': '%d' sent a modified DIO message and is a member of dodag_id = '%s', reevaluating our neighbors",
334 fnNetSimError(
"node '%d': not root, not joined, not poisoning and not isolated either, what are we anyway?", d);
static bool dio_pdu_changed(PRPL_NEIGHBOR neighbor, PRPL_CTRL_MSG dio_pdu)
void rpl_dio_msg_copy(const NetSim_PACKET *destPacket, const NetSim_PACKET *srcPacket)
static bool dio_pdu_dodag_config_changed(PRPL_CTRL_MSG c1, PRPL_CTRL_MSG c2)
PRPL_CTRL_MSG get_preferred_dodag_dio_pdu(NETSIM_ID d, bool *same, double time)
void rpl_dio_msg_destroy(NetSim_PACKET *packet)
void start_dio_poisoning(NETSIM_ID d)
void rpl_process_dio_msg()
void update_dodag_config(NETSIM_ID node, PRPL_CTRL_MSG dio_pdu)
void join_dodag_iteration(NETSIM_ID d, PRPL_CTRL_MSG dio_pdu)
#define IP_COMPARE(ip1, ip2)
#define fnNetSimError(x,...)
void forget_neighbor_messages(PRPL_NODE rpl)
void choose_parents_and_siblings(NETSIM_ID d)
PRPL_NEIGHBOR rpl_find_neighbor(NETSIM_ID d, NETSIM_ID r)
void update_neighbor_dio_message(PRPL_NEIGHBOR neighbor, PRPL_CTRL_MSG dio_pdu)
void rpl_node_remove_all_parents(NETSIM_ID d)
void start_as_root(NETSIM_ID d)
bool rpl_node_is_isolated(PRPL_NODE rpl)
void rpl_delete_all_route(NETSIM_ID d)
void * get_option_from_msg(PRPL_CTRL_MSG msg, RPL_OPTION_TYPE type)
bool rpl_node_is_joined(PRPL_NODE r)
void rpl_dio_pdu_free(PRPL_CTRL_MSG dio)
bool rpl_node_is_root(PRPL_NODE r)
void print_rpl_log(char *format,...)
#define rpl_node_has_sibling(node, sibling)
bool rpl_node_is_poisoning(PRPL_NODE r)
#define RPL_IP_TO_STR(ip)
void rpl_trickle_reset(NETSIM_ID nDevId)
NetSim_PACKET * create_root_dio_message(NETSIM_ID ndevId, double time, bool include_dodag_config, bool include_seq_num)
#define rpl_node_has_parent(node, parent)
PRPL_CTRL_MSG rpl_dio_pdu_duplicate(PRPL_CTRL_MSG dio)
@ RPLOPTION_DODAGConfiguration
#define GET_PRPL_CTRL_MSG(packet)
struct stru_rpl_ctrl_message * PRPL_CTRL_MSG
EXPORTED struct stru_NetSim_EventDetails * pstruEventDetails
#define fn_NetSim_Packet_FreePacket(pstruPacket)
struct stru_NetSim_Packet * pPacket
void * Packet_RoutingProtocol
struct stru_NetSim_Packet_NetworkLayer * pstruNetworkData
PRPL_NEIGHBOR pref_parent
PRPL_NEIGHBOR * neighbor_list
UINT8 poison_count_so_far