26 [IGMP_TIMER_QUERY] = 60,
27 [IGMP_TIMER_SRC] = (3 * 60),
28 [IGMP_TIMER_LEAVE] = 60,
29 [IGMP_TIMER_REPORT_INTERVAL] = 1,
32 #define IGMP_N_TIMERS (IGMP_TIMER_REPORT_INTERVAL+1) 85 const u32 *i1 = _v1, *i2 = _v2;
94 return (dt < 0 ? -1 : (dt > 0 ? +1 : 0));
117 return (timer->
data);
147 uword *event_data = 0, event_type;
189 .name =
"igmp-timer-process",
217 return (timer - timer_pool);
242 s =
format (s,
"not-running");
249 format (s,
"[expires-in:%f]",
enum igmp_timer_type_t_ igmp_timer_type_t
int igmp_timer_is_running(igmp_timer_id_t tid)
static igmp_timer_type_t igmp_default_timer_values[]
Default timer values as per RFC.
void * data
Data registered by the client and passed back when the timer expires.
igmp_timer_function_t func
Call-back function to invoke on expiry.
static f64 vlib_process_wait_for_event_or_clock(vlib_main_t *vm, f64 dt)
Suspend a cooperative multi-tasking thread Waits for an event, or for the indicated number of seconds...
void igmp_timer_retire(igmp_timer_id_t *tid)
static uword * vlib_process_wait_for_event(vlib_main_t *vm)
static u32 * pending_timers
Vector of pending timers.
static int igmp_timer_compare(const void *_v1, const void *_v2)
static f64 vlib_time_now(vlib_main_t *vm)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
igmp_timer_id_t igmp_timer_schedule(f64 when, u32 obj, igmp_timer_function_t fn, void *data)
Schedule a timer to expire in 'when' seconds.
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
u32 igmp_timer_type_get(igmp_timer_type_t t)
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type...
void * igmp_timer_get_data(igmp_timer_id_t tid)
#define vec_search(v, E)
Search a vector for the index of the entry that matches.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
u32 igmp_timer_id_t
The id of a running timer.
#define vec_del1(v, i)
Delete the element at index I.
void igmp_timer_type_set(igmp_timer_type_t t, u32 v)
u32 obj
index of the object that scheduled the timer
#define VLIB_REGISTER_NODE(x,...)
void igmp_timer_set_data(igmp_timer_id_t tid, void *data)
static uword igmp_timer_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
igmp timer process
enum @666 igmp_process_event_t
#define IGMP_TIMER_ID_INVALID
#define pool_put_index(p, i)
Free pool element with given index.
vlib_node_registration_t igmp_timer_process_node
(constructor) VLIB_REGISTER_NODE (igmp_timer_process_node)
void(* igmp_timer_function_t)(u32 obj, void *data)
A call-back function invoked when a timer expires;.
static vlib_main_t * vlib_get_main(void)
u32 igmp_get_next_timer(void)
igmp get next timer
u8 * format_igmp_timer_id(u8 *s, va_list *args)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
static igmp_timer_t * timer_pool
pool of timers
f64 exp_time
Expiration timer.
struct igmp_timer_t_ igmp_timer_t
Timer.