FreeBSD/sys/netinet/ip_mroute.c
/*
 * Schedule a timer to process periodically bw_meter entry of type "<="
 * by linking the entry in the proper hash bucket.
 */
Schedule a timer to process periodically bw_meter entry of type "<="
by linking the entry in the proper hash bucket.
Schedule a timer to process periodically bw_meter entry of type " < = " by linking the entry in the proper hash bucket .
static void
schedule_bw_meter(struct bw_meter *x, struct timeval *nowp)
{
    int time_hash;
    MFC_LOCK_ASSERT();
    if (!(x->bm_flags & BW_METER_LEQ))
	return;		
    x->bm_start_time = *nowp;
    x->bm_measured.b_packets = 0;
    x->bm_measured.b_bytes = 0;
    x->bm_flags &= ~BW_METER_UPCALL_DELIVERED;
    BW_METER_TIMEHASH(x, time_hash);
    x->bm_time_next = V_bw_meter_timers[time_hash];
    V_bw_meter_timers[time_hash] = x;
    x->bm_time_hash = time_hash;
}
static void schedule_bw_meter ( struct bw_meter * x , struct timeval * nowp ) { int time_hash ; MFC_LOCK_ASSERT ( ) ; if ( ! ( x -> bm_flags & BW_METER_LEQ ) ) return ; x -> bm_start_time = * nowp ; x -> bm_measured . b_packets = 0 ; x -> bm_measured . b_bytes = 0 ; x -> bm_flags &= ~ BW_METER_UPCALL_DELIVERED ; BW_METER_TIMEHASH ( x , time_hash ) ; x -> bm_time_next = V_bw_meter_timers [ time_hash ] ; V_bw_meter_timers [ time_hash ] = x ; x -> bm_time_hash = time_hash ; }
Schedule a timer to process periodically bw_meter entry of type "<="
 by linking the entry in the proper hash bucket.
Schedule a timer to process periodically bw_meter entry of type " < = " by linking the entry in the proper hash bucket .
/* XXX: we schedule timers only for "<=" entries */ /*
     * Reset the bw_meter entry
     */ /*
     * Compute the timeout hash value and insert the entry
     */