Organize debug code.

This commit is contained in:
gamemann
2021-11-12 18:19:07 +00:00
parent 8527ed163c
commit 0268ab26ee

View File

@@ -23,14 +23,12 @@
#define ALLOWSINGLEIPV4V6 // When this is defined, a check will occur inside the IPv4 and IPv6 filters. For IPv6 packets, if no IPv6 source/destination IP addresses are set, but there is an IPv4 address, it will ignore the filter. The same goes for IPv4, if there is no IPv4 source/destination IP addresses set, if an IPv6 address is set, it will ignore the filter. #define ALLOWSINGLEIPV4V6 // When this is defined, a check will occur inside the IPv4 and IPv6 filters. For IPv6 packets, if no IPv6 source/destination IP addresses are set, but there is an IPv4 address, it will ignore the filter. The same goes for IPv4, if there is no IPv4 source/destination IP addresses set, if an IPv6 address is set, it will ignore the filter.
#ifdef DEBUG #ifdef DEBUG
#define bpf_printk(fmt, ...) \ #define bpf_printk(fmt, ...) \
({ \ ({ \
char ____fmt[] = fmt; \ char ____fmt[] = fmt; \
bpf_trace_printk(____fmt, sizeof(____fmt), \ bpf_trace_printk(____fmt, sizeof(____fmt), \
##__VA_ARGS__); \ ##__VA_ARGS__); \
}) })
#endif #endif
struct bpf_map_def SEC("maps") filters_map = struct bpf_map_def SEC("maps") filters_map =