summaryrefslogtreecommitdiff
path: root/ldpd/ldp_debug.h
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-03-03 17:50:22 -0300
committerRenato Westphal <renato@opensourcerouting.org>2017-03-03 17:50:22 -0300
commitfaf757937f8a38f96cfd732068588830e0a998b5 (patch)
treeaff5843f22d2071449a69a6d6ed030d969184cc3 /ldpd/ldp_debug.h
parent8afbd8942ae56af31c0bcbf741b4ef11f2b8f229 (diff)
ldpd: create helper functions to log sent/received messages
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ldpd/ldp_debug.h')
-rw-r--r--ldpd/ldp_debug.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/ldpd/ldp_debug.h b/ldpd/ldp_debug.h
index aa0cd47e7b..f944851b6e 100644
--- a/ldpd/ldp_debug.h
+++ b/ldpd/ldp_debug.h
@@ -104,6 +104,14 @@ do { \
log_debug("msg[out]: " emsg, __VA_ARGS__); \
} while (0)
+#define debug_msg(out, emsg, ...) \
+do { \
+ if (out) \
+ debug_msg_send(emsg, __VA_ARGS__); \
+ else \
+ debug_msg_recv(emsg, __VA_ARGS__); \
+} while (0)
+
#define debug_kalive_recv(emsg, ...) \
do { \
if (LDP_DEBUG(msg, MSG_RECV_ALL)) \