summaryrefslogtreecommitdiff
path: root/nest/bfd.h
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2013-11-22 02:43:41 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2013-11-22 02:48:44 +0100
commit0aeac9cb7f9887374ce0258c8653f9518529bf08 (patch)
tree2d16e0904be1658c08a4c779cf4132bc8bf20efa /nest/bfd.h
parent8931425d02dd8656b48142f608d3119ab6f4a96f (diff)
parent7c9930f9c8feb3b08f7a9e94a08807ccbbc096f5 (diff)
Merge commit 'origin/bfd'
Diffstat (limited to 'nest/bfd.h')
-rw-r--r--nest/bfd.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/nest/bfd.h b/nest/bfd.h
new file mode 100644
index 00000000..79c3c921
--- /dev/null
+++ b/nest/bfd.h
@@ -0,0 +1,51 @@
+/*
+ * BIRD -- Bidirectional Forwarding Detection (BFD)
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+#ifndef _BIRD_NBFD_H_
+#define _BIRD_NBFD_H_
+
+#include "lib/lists.h"
+#include "lib/resource.h"
+
+struct bfd_session;
+
+struct bfd_request {
+ resource r;
+ node n;
+
+ ip_addr addr;
+ ip_addr local;
+ struct iface *iface;
+
+ void (*hook)(struct bfd_request *);
+ void *data;
+
+ struct bfd_session *session;
+
+ u8 state;
+ u8 diag;
+ u8 old_state;
+ u8 down;
+};
+
+
+#ifdef CONFIG_BFD
+
+struct bfd_request * bfd_request_session(pool *p, ip_addr addr, ip_addr local, struct iface *iface, void (*hook)(struct bfd_request *), void *data);
+
+static inline void cf_check_bfd(int use) { }
+
+#else
+
+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; }
+
+static inline void cf_check_bfd(int use) { if (use) cf_error("BFD not available"); }
+
+#endif /* CONFIG_BFD */
+
+
+
+#endif /* _BIRD_NBFD_H_ */