RT_TIMER_ADD(9) | Kernel Developer's Manual | RT_TIMER_ADD(9)

# NAME

`rt_timer_add`, `rt_timer_remove_all`, `rt_timer_get_expire`, `rt_timer_queue_init`, `rt_timer_queue_change`, `rt_timer_queue_flush`, `rt_timer_queue_count` — route timer queues interface

# SYNOPSIS

`#include <net/route.h>`

int
`rt_timer_add`(struct rtentry *rt, struct rttimer_queue *queue, u_int rtableid);

void
`rt_timer_remove_all`(struct rtentry *rt);

time_t
`rt_timer_get_expire`(const struct rtentry *rt);

void
`rt_timer_queue_init`(struct rttimer_queue *rtq, int timeout, void (*func)(struct rtentry *, u_int));

void
`rt_timer_queue_change`(struct rttimer_queue *rtq, int timeout);

void
`rt_timer_queue_flush`(struct rttimer_queue *rtq);

unsigned long
`rt_timer_queue_count`(struct rttimer_queue *rtq);

# DESCRIPTION

The `rt_timer` subsystem queues routing-related functions for asynchronous execution in the future.

`rt_timer_add`() allocates an rttimer_queue rtq to be called on rt using the timeout of queue. If an action already exists, it will be replaced with the new one.

`rt_timer_remove_all`() removes all timeouts associated with rt from all routing timer queues.

`rt_timer_get_expire`() returns the current expiry time in seconds.

`rt_timer_queue_init`() creates a timer queue with a timeout of timeout seconds.

`rt_timer_queue_change`() sets the timeout for rtq to timeout seconds.

`rt_timer_queue_flush`() removes all timeouts from the routing timer queue rtq, executes their associated callback and destroys it.

`rt_timer_queue_count`() returns the number of timers present in the queue rtq.

# CONTEXT

`rt_timer_add`(), `rt_timer_remove_all`(), `rt_timer_get_expire`(), `rt_timer_queue_init`(), `rt_timer_queue_change`(), `rt_timer_queue_flush`() and `rt_timer_queue_count`() can be called during autoconf, from process context, or from interrupt context.

# ERRORS

`rt_timer_add`() may fail with `ENOBUFS` if memory could not be allocated for the timeout.

# SEE ALSO

route(4), route(9)

June 20, 2023 | Debian