flores/lib/ebpf/c/target_ip_map.h
2025-04-15 19:59:12 +08:00

10 lines
396 B
C

#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
// 存储需要contrack的IP地址
struct {
__uint(type, BPF_MAP_TYPE_HASH);
__type(key, __u32); // key 类型(目标 IP 地址)
__type(value, __u8); // value 类型(标志位,无实际用途,设置为 1 表示存在)
__uint(max_entries, 1024); // 最多存储 1024 个目标 IP
} target_ip_map SEC(".maps");