diff options
Diffstat (limited to 'nest/bfd.h')
-rw-r--r-- | nest/bfd.h | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -23,11 +23,6 @@ struct bfd_options { u8 mode; }; -struct bfd_session_state { - u8 state; - u8 diag; -}; - struct bfd_request { resource r; node n; @@ -40,12 +35,13 @@ struct bfd_request { void (*hook)(struct bfd_request *); void *data; - event event; + struct birdloop *target; struct bfd_session *session; - struct bfd_session_state old_state; + u8 state; u8 diag; + u8 old_state; u8 down; }; @@ -56,19 +52,20 @@ struct bfd_request { #define BFD_STATE_INIT 2 #define BFD_STATE_UP 3 + static inline struct bfd_options * bfd_new_options(void) { return cfg_allocz(sizeof(struct bfd_options)); } #ifdef CONFIG_BFD -struct bfd_request * bfd_request_session(pool *p, ip_addr addr, ip_addr local, struct iface *iface, struct iface *vrf, void (*hook)(struct bfd_request *), void *data, struct event_list *list, const struct bfd_options *opts); +struct bfd_request * bfd_request_session(pool *p, ip_addr addr, ip_addr local, struct iface *iface, struct iface *vrf, void (*hook)(struct bfd_request *), void *data, struct birdloop *target, const struct bfd_options *opts); void bfd_update_request(struct bfd_request *req, const struct bfd_options *opts); static inline void cf_check_bfd(int use UNUSED) { } #else -static inline struct bfd_request * bfd_request_session(pool *p UNUSED, ip_addr addr UNUSED, ip_addr local UNUSED, struct iface *iface UNUSED, struct iface *vrf UNUSED, void (*hook)(struct bfd_request *) UNUSED, void *data UNUSED, const struct bfd_options *opts UNUSED) { return NULL; } +static inline struct bfd_request * bfd_request_session(pool *p UNUSED, ip_addr addr UNUSED, ip_addr local UNUSED, struct iface *iface UNUSED, struct iface *vrf UNUSED, void (*hook)(struct bfd_request *) UNUSED, void *data UNUSED, struct birdloop *target UNUSED, const struct bfd_options *opts UNUSED) { return NULL; } static inline void bfd_update_request(struct bfd_request *req UNUSED, const struct bfd_options *opts UNUSED) { }; static inline void cf_check_bfd(int use) { if (use) cf_error("BFD not available"); } |