-
Notifications
You must be signed in to change notification settings - Fork 0
/
lispd_timers.h
45 lines (37 loc) · 1.02 KB
/
lispd_timers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* lispd_timers.h
*
* Timer maintenance routines. Simple to start with (single
* master timer triggers check of timestamps for map-registers/
* map-reply retries).
*
* Author: Chris White
* Copyright 2010 Cisco Systems, Inc.
*/
#ifndef LISPD_TIMERS_H_
#define LISPD_TIMERS_H_
#include <signal.h>
#include <time.h>
#define RLOC_PROBE_CHECK_INTERVAL 1 // 1 second
#define EXPIRE_MAP_CACHE "Expire map cache"
typedef struct _timer_links {
struct _timer_links *prev;
struct _timer_links *next;
} timer_links;
struct _timer;
typedef int (*timer_callback)(struct _timer *t, void *arg);
typedef struct _timer {
timer_links links;
int duration;
int rotation_count;
timer_callback cb;
void *cb_argument;
char name[64];
} timer;
int init_timers();
timer *create_timer(char *);
void start_timer(timer *, int, timer_callback,
void *);
void stop_timer(timer *);
void handle_timers(void);
#endif /*LISPD_TIMERS_H_*/