]> git.ipfire.org Git - thirdparty/bird.git/blame - nest/bfd.h
Bison: A bit more verbose error messages in config.
[thirdparty/bird.git] / nest / bfd.h
CommitLineData
7c9930f9
OZ
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
13struct bfd_session;
14
15struct 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
538264cf
OZ
35#define BFD_STATE_ADMIN_DOWN 0
36#define BFD_STATE_DOWN 1
37#define BFD_STATE_INIT 2
38#define BFD_STATE_UP 3
39
40
7c9930f9
OZ
41#ifdef CONFIG_BFD
42
43struct bfd_request * bfd_request_session(pool *p, ip_addr addr, ip_addr local, struct iface *iface, void (*hook)(struct bfd_request *), void *data);
44
3e236955 45static inline void cf_check_bfd(int use UNUSED) { }
7c9930f9
OZ
46
47#else
48
abd4367f 49static inline struct bfd_request * bfd_request_session(pool *p UNUSED, ip_addr addr UNUSED, ip_addr local UNUSED, struct iface *iface UNUSED, void (*hook)(struct bfd_request *) UNUSED, void *data UNUSED) { return NULL; }
7c9930f9
OZ
50
51static inline void cf_check_bfd(int use) { if (use) cf_error("BFD not available"); }
52
53#endif /* CONFIG_BFD */
54
55
56
57#endif /* _BIRD_NBFD_H_ */