sys/netiso/iso_snpac.c
/*
 * FUNCTION:		snpac_age
 *
 * PURPOSE:			Time out snpac entries
 *
 * RETURNS:			
 *
 * SIDE EFFECTS:	
 *
 * NOTES:			When encountering an entry for the first time, snpac_age
 *					may delete up to SNPAC_AGE too many seconds. Ie.
 *					if the entry is added a moment before snpac_age is
 *					called, the entry will immediately have SNPAC_AGE
 *					seconds taken off the holding time, even though
 *					it has only been held a brief moment.
 *
 *					The proper way to do this is set an expiry timeval
 *					equal to current time + holding time. Then snpac_age
 *					would time out entries where expiry date is older
 *					than the current time.
 */
snpac_age
PURPOSE:                     Time out snpac entries



SIDE EFFECTS.

When encountering an entry for the first time, snpac_age
may delete up to SNPAC_AGE too many seconds. Ie.
if the entry is added a moment before snpac_age is
called, the entry will immediately have SNPAC_AGE
seconds taken off the holding time, even though
it has only been held a brief moment.

The proper way to do this is set an expiry timeval
equal to current time + holding time. Then snpac_age
would time out entries where expiry date is older
than the current time.
snpac_age PURPOSE : Time out snpac entries SIDE EFFECTS . When encountering an entry for the first time snpac_age may delete up to SNPAC_AGE too many seconds . Ie . if the entry is added a moment before snpac_age is called the entry will immediately have SNPAC_AGE seconds taken off the holding time even though it has only been held a brief moment . The proper way to do this is set an expiry timeval equal to current time + holding time . Then snpac_age would time out entries where expiry date is older than the current time .
void
snpac_age()
{
	register struct	llinfo_llc *lc, *nlc;
	register struct	rtentry *rt;
	timeout(snpac_age, (caddr_t)0, SNPAC_AGE * hz);
	for (lc = llinfo_llc.lc_next; lc != & llinfo_llc; lc = nlc) {
		nlc = lc->lc_next;
		if (lc->lc_flags & SNPA_VALID) {
			rt = lc->lc_rt;
			if (rt->rt_rmx.rmx_expire && rt->rt_rmx.rmx_expire < time.tv_sec)
				snpac_free(lc);
		}
	}
}
void snpac_age ( ) { register struct llinfo_llc * lc , * nlc ; register struct rtentry * rt ; timeout ( snpac_age , ( caddr_t ) 0 , SNPAC_AGE * hz ) ; for ( lc = llinfo_llc . lc_next ; lc != & llinfo_llc ; lc = nlc ) { nlc = lc -> lc_next ; if ( lc -> lc_flags & SNPA_VALID ) { rt = lc -> lc_rt ; if ( rt -> rt_rmx . rmx_expire && rt -> rt_rmx . rmx_expire < time . tv_sec ) snpac_free ( lc ) ; } } }
FUNCTION:            snpac_age
 PURPOSE:                     Time out snpac entries
FUNCTION : snpac_age PURPOSE : Time out snpac entries