FreeBSD/sys/netipsec/key.c
/*
 * time handler.
 * scanning SPD and SAD to check status for each entries,
 * and do to remove or to expire.
 * XXX: year 2038 problem may remain.
 */
time handler.
scanning SPD and SAD to check status for each entries,
and do to remove or to expire.
XXX: year 2038 problem may remain.
time handler . scanning SPD and SAD to check status for each entries and do to remove or to expire . XXX : year 2038 problem may remain .
static void
key_timehandler(void *arg)
{
	VNET_ITERATOR_DECL(vnet_iter);
	time_t now = time_second;
	VNET_LIST_RLOCK_NOSLEEP();
	VNET_FOREACH(vnet_iter) {
		CURVNET_SET(vnet_iter);
		key_flush_spd(now);
		key_flush_sad(now);
		key_flush_acq(now);
		key_flush_spacq(now);
		CURVNET_RESTORE();
	}
	VNET_LIST_RUNLOCK_NOSLEEP();
#ifndef IPSEC_DEBUG2
	callout_schedule(&key_timer, hz);
#endif 
}
static void key_timehandler ( void * arg ) { VNET_ITERATOR_DECL ( vnet_iter ) ; time_t now = time_second ; VNET_LIST_RLOCK_NOSLEEP ( ) ; VNET_FOREACH ( vnet_iter ) { CURVNET_SET ( vnet_iter ) ; key_flush_spd ( now ) ; key_flush_sad ( now ) ; key_flush_acq ( now ) ; key_flush_spacq ( now ) ; CURVNET_RESTORE ( ) ; } VNET_LIST_RUNLOCK_NOSLEEP ( ) ; #ifndef IPSEC_DEBUG2 callout_schedule ( & key_timer , hz ) ; #endif }
time handler.
time handler .
/* do exchange to tick time !! */ /* IPSEC_DEBUG2 */