diff options
author | Timo Teräs <timo.teras@iki.fi> | 2014-09-30 08:20:31 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2014-09-30 08:20:45 +0300 |
commit | ae9537903c496dc50693c59b7b0751aee38ed012 (patch) | |
tree | b1eddd7d5178eac802cb4018a0d75bd899133457 /nhrpd/nhrpd.h | |
parent | 55bccfd7198195aef8f968691b53ec867cbe3989 (diff) | |
download | quagga-old-nhrp.tar.bz2 quagga-old-nhrp.tar.xz |
add nhrpd skeletonold-nhrp
Diffstat (limited to 'nhrpd/nhrpd.h')
-rw-r--r-- | nhrpd/nhrpd.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/nhrpd/nhrpd.h b/nhrpd/nhrpd.h new file mode 100644 index 00000000..016ab34e --- /dev/null +++ b/nhrpd/nhrpd.h @@ -0,0 +1,43 @@ + +#define NHRP_DEBUG_COMMON (1 << 0) +#define NHRP_DEBUG_KERNEL (1 << 1) +#define NHRP_DEBUG_ROUTE (1 << 2) +#define NHRP_DEBUG_ALL (0xFFFF) + +#define NHRP_VTY_PORT 2610 +#define NHRP_DEFAULT_CONFIG "nhrpd.conf" + +#if defined(__GNUC__) && (__GNUC__ >= 3) +#define likely(_x) __builtin_expect(!!(_x), 1) +#define unlikely(_x) __builtin_expect(!!(_x), 0) +#else +#define likely(_x) !!(_x) +#define unlikely(_x) !!(_x) +#endif + +extern unsigned int debug_flags; + +#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L + +#define debugf(level, ...) \ + do { \ + if (unlikely(debug_flags & level)) \ + zlog_debug(__VA_ARGS__); \ + } while(0) + +#elif defined __GNUC__ + +#define debugf(level, _args...) \ + do { \ + if (unlikely(debug_flags & level)) \ + zlog_debug(_args); \ + } while(0) + +#else + +static inline void debugf(int level, const char *format, ...) { } + +void nhrp_zebra_init(void); +void nhrp_zebra_terminate(void); + +#endif |