File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / bird / nest / bfd.h
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Mar 17 19:50:23 2021 UTC (3 years, 4 months ago) by misho
Branches: bird, MAIN
CVS tags: v1_6_8p3, HEAD
bird 1.6.8

    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:   struct iface *vrf;
   23: 
   24:   void (*hook)(struct bfd_request *);
   25:   void *data;
   26: 
   27:   struct bfd_session *session;
   28: 
   29:   u8 state;
   30:   u8 diag;
   31:   u8 old_state;
   32:   u8 down;
   33: };
   34: 
   35: 
   36: #define BFD_STATE_ADMIN_DOWN	0
   37: #define BFD_STATE_DOWN		1
   38: #define BFD_STATE_INIT		2
   39: #define BFD_STATE_UP		3
   40: 
   41: 
   42: #ifdef CONFIG_BFD
   43: 
   44: 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);
   45: 
   46: static inline void cf_check_bfd(int use UNUSED) { }
   47: 
   48: #else
   49: 
   50: static inline 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) { return NULL; }
   51: 
   52: static inline void cf_check_bfd(int use) { if (use) cf_error("BFD not available"); }
   53: 
   54: #endif /* CONFIG_BFD */
   55: 
   56: 
   57: 
   58: #endif /* _BIRD_NBFD_H_ */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>