]> git.ipfire.org Git - thirdparty/bird.git/blob - nest/bfd.h
Merge commit 'origin/master' into socket
[thirdparty/bird.git] / nest / bfd.h
1 /*
2 * BIRD -- Bidirectional Forwarding Detection (BFD)
3 *
4 * Can be freely distributed and used under the terms of the GNU GPL.
5 */
6
7 #ifndef _BIRD_NBFD_H_
8 #define _BIRD_NBFD_H_
9
10 #include "lib/lists.h"
11 #include "lib/resource.h"
12
13 struct bfd_session;
14
15 struct bfd_request {
16 resource r;
17 node n;
18
19 ip_addr addr;
20 ip_addr local;
21 struct iface *iface;
22
23 void (*hook)(struct bfd_request *);
24 void *data;
25
26 struct bfd_session *session;
27
28 u8 state;
29 u8 diag;
30 u8 old_state;
31 u8 down;
32 };
33
34
35 #ifdef CONFIG_BFD
36
37 struct bfd_request * bfd_request_session(pool *p, ip_addr addr, ip_addr local, struct iface *iface, void (*hook)(struct bfd_request *), void *data);
38
39 static inline void cf_check_bfd(int use) { }
40
41 #else
42
43 static inline struct bfd_request * bfd_request_session(pool *p, ip_addr addr, ip_addr local, struct iface *iface, void (*hook)(struct bfd_request *), void *data) { return NULL; }
44
45 static inline void cf_check_bfd(int use) { if (use) cf_error("BFD not available"); }
46
47 #endif /* CONFIG_BFD */
48
49
50
51 #endif /* _BIRD_NBFD_H_ */