创建一个 BPF_MAP_TYPE_SOCKMAP 类型的 map 对象。 struct bpf_map_def SEC("maps") sock_map = { .type= BPF_MAP_TYPE_SOCKMAP,//指定map的类型 .key_size = sizeof(int), .value_size = sizeof(int),//存放句柄 .max_entries = 16, }; //使用这个map存储每个句柄的类型,类型1:client—>prox...
(CONFIG_NF_TABLES_MODULE) struct netns_nftables nft; #endif #endif #ifdef CONFIG_WEXT_CORE struct sk_buff_head wext_nlevents; #endif struct net_generic __rcu *gen; /* Used to store attached BPF programs */ struct netns_bpf bpf; /* Note : following structs are cache line aligned */...
bitmap.h bitops.h bitrev.h bits.h blk-cgroup.h blk-crypto-profile.h blk-crypto.h blk-integrity.h blk-mq-pci.h blk-mq-virtio.h blk-mq.h blk-pm.h blk_types.h blkdev.h blkpg.h blktrace_api.h blockgroup_lock.h bma150.h bootconfig.h bootmem_info.h bottom...
entries */ } HEADER; #endif /* MAKE_NTOP_PACKETSZ_*/ typedef struct portProtoMapper { u_int Proto; /* Port/proto to map */ u_int mappedPortProto; /* Mapped port/proto*/ u_char dummyEntry; /* Set to 1 if this entryis dummy */ } PortProtoMapper; ...
.type= BPF_MAP_TYPE_SOCKMAP,//指定map的类型 .key_size = sizeof(int), .value_size = sizeof(int),//存放句柄 .max_entries = 16, }; //使用这个map存储每个句柄的类型,类型1:client—>proxy;类型2:pronxy—>upstream struct bpf_map_def SEC("maps") proxy_map = { ...