void NS_CLASS local_repair_timeout(void *arg) { rt_table_t *rt; struct in_addr rerr_dest; RERR *rerr = NULL; rt = (rt_table_t *) arg; if (!rt) return; rerr_dest.s_addr = AODV_BROADCAST; /* Default destination */ /* Unset the REPAIR flag */ rt->flags &= ~RT_REPAIR; #ifndef NS_PORT nl_send_del_route_msg(rt->dest_addr); #endif /* Route should already be invalidated. */ if (rt->nprec) { rerr = rerr_create(0, rt->dest_addr, rt->dest_seqno); if (rt->nprec == 1) { rerr_dest = FIRST_PREC(rt->precursors)->neighbor; aodv_socket_send((AODV_msg *) rerr, rerr_dest, RERR_CALC_SIZE(rerr), 1, &DEV_IFINDEX(rt->ifindex)); } else { int i; for (i = 0; i < MAX_NR_INTERFACES; i++) { if (!DEV_NR(i).enabled) continue; aodv_socket_send((AODV_msg *) rerr, rerr_dest, RERR_CALC_SIZE(rerr), 1, &DEV_NR(i)); } } DEBUG(LOG_DEBUG, 0, "Sending RERR about %s to %s", ip_to_str(rt->dest_addr), ip_to_str(rerr_dest)); } precursor_list_destroy(rt); /* Purge any packets that may be queued */ /* packet_queue_set_verdict(rt->dest_addr, PQ_DROP); */ rt->rt_timer.handler = &NS_CLASS route_delete_timeout; timer_set_timeout(&rt->rt_timer, DELETE_PERIOD); DEBUG(LOG_DEBUG, 0, "%s removed in %u msecs", ip_to_str(rt->dest_addr), DELETE_PERIOD); }
void NS_CLASS local_repair_timeout(void *arg) { rt_table_t *rt; u_int32_t rerr_dest = AODV_BROADCAST; RERR *rerr = NULL; rt = (rt_table_t *) arg; if (!rt) return; /* Unset the REPAIR flag */ rt->flags &= ~RT_REPAIR; rt->rt_timer.handler = &NS_CLASS route_delete_timeout; timer_set_timeout(&rt->rt_timer, DELETE_PERIOD); DEBUG(LOG_DEBUG, 0, "%s removed in %u msecs", ip_to_str(rt->dest_addr), DELETE_PERIOD); /* Route should already be invalidated. */ if (rt->nprec) { rerr = rerr_create(0, rt->dest_addr, rt->dest_seqno); if (rt->nprec == 1) { rerr_dest = FIRST_PREC(rt->precursors)->neighbor; aodv_socket_send((AODV_msg *) rerr, rerr_dest, RERR_CALC_SIZE(rerr), 1, &DEV_IFINDEX(rt->ifindex)); } else { int i; for (i = 0; i < MAX_NR_INTERFACES; i++) { if (!DEV_NR(i).enabled) continue; aodv_socket_send((AODV_msg *) rerr, rerr_dest, RERR_CALC_SIZE(rerr), 1, &DEV_NR(i)); } } DEBUG(LOG_DEBUG, 0, "Sending RERR about %s to %s", ip_to_str(rt->dest_addr), ip_to_str(rerr_dest)); } precursor_list_destroy(rt); }