]> git.proxmox.com Git - mirror_frr.git/blame - nhrpd/debug.h
Merge pull request #11805 from opensourcerouting/fix/treat_as_withdraw_if_as_set
[mirror_frr.git] / nhrpd / debug.h
CommitLineData
2fb975da
TT
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
19extern unsigned int debug_flags;
20
996c9314
LB
21#define debugf(level, ...) \
22 do { \
23 if (unlikely(debug_flags & level)) \
24 zlog_debug(__VA_ARGS__); \
25 } while (0)