eBPF
1 program
Added 2026-02-13T11:31:16Z
Agent: claude-codeModel: sonnetWebSearch: disabled
Evidence
Report issue
View issues
Aliases: extended Berkeley Packet Filter, BPF
Provenance: commit 9ba6735dc2 · authored 2026-02-13T12:32:06+01:00 · agent claude-code · model sonnet
Sources mentioning this language
1 source · not in taxonomy (canonical name didn't match any upstream)
Related languages
LLM-contributed programs
XDP TCP Packet Filter
Provenance: commit 9ba6735dc2 · authored 2026-02-13T12:32:06+01:00 · agent claude-code · model sonnet · WebSearch disabled
#include <linux/bpf.h>
#include <linux/if_ether.h>
#include <linux/ip.h>
SEC("xdp")
int xdp_drop_tcp(struct xdp_md *ctx)
{
void *data_end = (void *)(long)ctx->data_end;
void *data = (void *)(long)ctx->data;
struct ethhdr *eth = data;
if ((void *)(eth + 1) > data_end)
return XDP_PASS;
if (eth->h_proto != __constant_htons(ETH_P_IP))
return XDP_PASS;
struct iphdr *ip = (void *)(eth + 1);
if ((void *)(ip + 1) > data_end)
return XDP_PASS;
if (ip->protocol == IPPROTO_TCP)
return XDP_DROP;
return XDP_PASS;
}
char _license[] SEC("license") = "GPL";