2 #include "bpf_helpers.h"
4 #include "bpf_endian.h"
6 int _version SEC("version") = 1;
8 #define bpf_printk(fmt, ...) \
10 char ____fmt[] = fmt; \
11 bpf_trace_printk(____fmt, sizeof(____fmt), \
16 int bpf_prog1(struct sk_msg_md *msg)
18 void *data_end = (void *)(long) msg->data_end;
19 void *data = (void *)(long) msg->data;
23 if (data + 8 > data_end)
26 bpf_printk("data length %i\n", (__u64)msg->data_end - (__u64)msg->data);
28 bpf_printk("hello sendmsg hook %i %i\n", d[0], d[1]);
33 char _license[] SEC("license") = "GPL";