#include "vmlinux.h" #include /// @ifindex 1 /// @flags 0 /// @xdpopts {"old_prog_fd":0} SEC("xdp") int xdp_pass(struct xdp_md* ctx) { void* data = (void*)(long)ctx->data; void* data_end = (void*)(long)ctx->data_end; int pkt_sz = data_end - data; bpf_printk("xdp test: packet size is %d", pkt_sz); return XDP_PASS; } char __license[] SEC("license") = "GPL";