]> git.proxmox.com Git - mirror_frr.git/blob - nhrpd/debug.h
Merge pull request #10158 from ckishimo/ospf6d_norefresh
[mirror_frr.git] / nhrpd / debug.h
1 #include "log.h"
2
3 #if defined(__GNUC__) && (__GNUC__ >= 3)
4 #define likely(_x) __builtin_expect(!!(_x), 1)
5 #define unlikely(_x) __builtin_expect(!!(_x), 0)
6 #else
7 #define likely(_x) !!(_x)
8 #define unlikely(_x) !!(_x)
9 #endif
10
11 #define NHRP_DEBUG_COMMON (1 << 0)
12 #define NHRP_DEBUG_KERNEL (1 << 1)
13 #define NHRP_DEBUG_IF (1 << 2)
14 #define NHRP_DEBUG_ROUTE (1 << 3)
15 #define NHRP_DEBUG_VICI (1 << 4)
16 #define NHRP_DEBUG_EVENT (1 << 5)
17 #define NHRP_DEBUG_ALL (0xFFFF)
18
19 extern unsigned int debug_flags;
20
21 #define debugf(level, ...) \
22 do { \
23 if (unlikely(debug_flags & level)) \
24 zlog_debug(__VA_ARGS__); \
25 } while (0)