mirror of
https://github.com/h3xduck/TripleCross.git
synced 2025-12-23 01:53:06 +08:00
16 lines
317 B
C
16 lines
317 B
C
#include "vmlinux.h"
|
|
#include <bpf/bpf_helpers.h>
|
|
|
|
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("packet size: %d", pkt_sz);
|
|
return XDP_PASS;
|
|
}
|
|
|
|
char __license[] SEC("license") = "GPL";
|