mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
16 lines
302 B
C
16 lines
302 B
C
#include <linux/bpf.h>
|
|
#include <bpf/bpf_helpers.h>
|
|
|
|
SEC("xdp")
|
|
int print_xdp_data(struct xdp_md *ctx)
|
|
{
|
|
// 'data' is a pointer to the start of packet data
|
|
long data = (long)ctx->data;
|
|
|
|
bpf_printk("ctx->data = %lld\n", data);
|
|
|
|
return XDP_PASS;
|
|
}
|
|
|
|
char LICENSE[] SEC("license") = "GPL";
|