summaryrefslogtreecommitdiffstats
path: root/iptables/xshared.h
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2023-07-21 11:15:15 +0200
committerPhil Sutter <phil@nwl.cc>2023-07-28 11:32:41 +0200
commit405ee2c3fea3ebdb8ac2af183db903c81e78f528 (patch)
treeb894a8e1886757246db79b20c3bd324cad8e5f0d /iptables/xshared.h
parent10583537004f7ecd4aa11f6c12b7ba73fb77fc11 (diff)
nft: More verbose extension comparison debugging
Dump extension data if it differs. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/xshared.h')
-rw-r--r--iptables/xshared.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/iptables/xshared.h b/iptables/xshared.h
index 0ed9f3c2..a200e0d6 100644
--- a/iptables/xshared.h
+++ b/iptables/xshared.h
@@ -12,8 +12,15 @@
#ifdef DEBUG
#define DEBUGP(x, args...) fprintf(stderr, x, ## args)
+#define DEBUG_HEXDUMP(pfx, data, len) \
+ for (int __i = 0; __i < (len); __i++) { \
+ if (__i % 16 == 0) \
+ printf("%s%s: ", __i ? "\n" : "", (pfx)); \
+ printf("%02x ", ((const unsigned char *)data)[__i]); \
+ } printf("\n")
#else
#define DEBUGP(x, args...)
+#define DEBUG_HEXDUMP(pfx, data, len)
#endif
enum {