struct rttimer_queue *
rt_timer_queue_create(
time_t timeout
)
void
rt_timer_queue_change(
struct rttimer_queue *q
, time_t timeout
)
void
rt_timer_queue_destroy(
struct rttimer_queue *q
, int destroy
)
int
rt_timer_add(
struct rtentry *rt
, void(*f)(struct rtentry *, struct rttimer *)
, struct rttimer_queue *q
)
void
rt_timer_remove_all(
struct rtentry *rt
)
For maximum efficiency, a separate queue should be defined for each timeout period. For example, one queue should be created for the 10 minute path MTU discovery timeouts, another for 20 minute ARP timeouts after 20 minutes, and so on. This permits extremely fast queue manipulations so that the timeout functions remain scalable, even in the face of thousands of route manipulations per minute.
It is possible to create only a single timeout queue for all possible timeout values, but doing so is not scalable as queue manipulations become quite expensive if the timeout deltas are not roughly constant.
The rt_timer interface provides the following functions:
time_t timeout
)
timeout
,
expressed in seconds.
rttimer_queue *q
, time_t timeout
)
rttimer_queue *q
, int destroy
)
destroy
argument is non-zero, the timeout action is performed for each entry.
struct rtentry *rt
, void(*f)(struct rtentry *, struct rttimer *)
, struct rttimer_queue *q
)
f
will be called after the timeout period for queue
q
has elapsed.
If
f
is NULL
the route will be deleted when the timeout expires.
struct rtentry *rt
)
sys/net/route.h
and
sys/net/route.c
.