Example #1
0
void arpFlush (void)

    {
    register struct llinfo_arp *la;
    FAST struct rtentry * 	pRoute; 
    int				s;

#ifdef VIRTUAL_STACK
    virtualStackIdCheck();
    la = _llinfo_arp.la_next;
#else
    la = llinfo_arp.la_next;
#endif /* VIRTUAL_STACK */

    s = splnet ();

#ifdef VIRTUAL_STACK
    while (la != &_llinfo_arp) 
#else
    while (la != &llinfo_arp) 
#endif
	{
	pRoute = la->la_rt; 
	la = la->la_next;

	/* if entry permanent */
	if ((pRoute->rt_rmx.rmx_expire == 0) || (pRoute->rt_flags == 0))
	    continue;

	arptfree(la->la_prev); /* timer has expired; clear */
	}

    splx (s);
    }
Example #2
0
/*
 * Timeout routine.  Age arp_tab entries periodically.
 */
void
arptimer()
{
	int s = splnet();
	register struct llinfo_arp *la = llinfo_arp.la_next;

	timeout(arptimer, (caddr_t)0, arpt_prune * hz);
	while (la != &llinfo_arp) {
		register struct rtentry *rt = la->la_rt;
		la = la->la_next;
		if (rt->rt_expire && rt->rt_expire <= time.tv_sec)
			arptfree(la->la_prev); /* timer has expired, clear */
	}
	splx(s);
}
Example #3
0
/*
 * Timeout routine.  Age arp_tab entries once a minute.
 */
arptimer()
{
	register struct arptab *at;
	register i;

	TIMEOUT(arptimer, (caddr_t)0, ARPT_AGE * hz);
	at = &arptab[0];
	for (i = 0; i < ARPTAB_SIZE; i++, at++) {
		if (at->at_flags == 0 || (at->at_flags & ATF_PERM))
			continue;
		if (++at->at_timer < ((at->at_flags&ATF_COM) ?
		    ARPT_KILLC : ARPT_KILLI))
			continue;
		/* timer has expired, clear entry */
		arptfree(at);
	}
}
Example #4
0
void
in_arpdrain(void *ignored_arg)
{
#pragma unused (ignored_arg)
	struct llinfo_arp *la, *ola;
	struct timeval timenow;

	lck_mtx_lock(rnh_lock);
	la = llinfo_arp.lh_first;
	getmicrotime(&timenow);
	while ((ola = la) != 0) {
		struct rtentry *rt = la->la_rt;
		la = la->la_le.le_next;
		RT_LOCK(rt);
		if (rt->rt_expire && rt->rt_expire <= timenow.tv_sec)
			arptfree(ola); /* timer has expired, clear */
		else
			RT_UNLOCK(rt);
	}
	lck_mtx_unlock(rnh_lock);
}