add runtime code

This commit is contained in:
2025-04-15 19:59:12 +08:00
parent 0a5f457059
commit 51aa9cb67f
34 changed files with 1941 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
#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");