diff --git a/Makefile b/Makefile index f385259ec..c99e50b9f 100644 --- a/Makefile +++ b/Makefile @@ -72,22 +72,26 @@ TMP_FILES := bpf/kmesh/bpf2go/bpf2go.go \ bpf/kmesh/ads/include/config.h \ bpf/include/bpf_helper_defs_ext.h \ -.PHONY: all -all: +.PHONY: all data daemon +all: data controller + +data: $(QUIET) find $(ROOT_DIR)/mk -name "*.pc" | xargs sed -i "s#^prefix=.*#prefix=${ROOT_DIR}#g" $(QUIET) make -C api/v2-c $(QUIET) make -C bpf/deserialization_to_bpf_map $(QUIET) $(GO) generate bpf/kmesh/bpf2go/bpf2go.go - + + $(call printlog, BUILD, "kernel") + $(QUIET) make -C kernel/ko_src + +controller: + $(QUIET) find $(ROOT_DIR)/mk -name "*.pc" | xargs sed -i "s#^prefix=.*#prefix=${ROOT_DIR}#g" $(call printlog, BUILD, $(APPS1)) $(QUIET) (export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):$(ROOT_DIR)mk; \ $(GO) build -ldflags $(LDFLAGS) -tags $(ENHANCED_KERNEL) -o $(APPS1) $(GOFLAGS) ./daemon/main.go) - $(call printlog, BUILD, "kernel") - $(QUIET) make -C kernel/ko_src - $(call printlog, BUILD, $(APPS2)) $(QUIET) cd oncn-mda && cmake . -B build && make -C build diff --git a/bpf/include/bpf_helper_defs_ext.h b/bpf/include/bpf_helper_defs_ext.h index 7bd9549b8..77547010b 100644 --- a/bpf/include/bpf_helper_defs_ext.h +++ b/bpf/include/bpf_helper_defs_ext.h @@ -10,9 +10,9 @@ * By default, these IDs are in the 5.10 kernel with kmesh kernel patches. */ -static void *(*bpf_strncpy)(char *dst, __u32 dst_size, char *src) = (void *)171; -static void *(*bpf_strnstr)(void *s1, void *s2, __u32 size) = (void *)172; -static __u64 (*bpf_strnlen)(char *buff, __u32 size) = (void *)173; +static void *(*bpf_strncpy)(char *dst, __u32 dst_size, char *src) = (void *)210; +static void *(*bpf_strnstr)(void *s1, void *s2, __u32 size) = (void *)211; +static __u64 (*bpf_strnlen)(char *buff, __u32 size) = (void *)212; static __u64 (*bpf__strncmp)(const char *s1, __u32 s1_size, const char *s2) = (void *)174; -static long (*bpf_parse_header_msg)(struct bpf_mem_ptr *msg) = (void *)175; -static void *(*bpf_get_msg_header_element)(void *name) = (void *)176; +static long (*bpf_parse_header_msg)(struct bpf_mem_ptr *msg) = (void *)213; +static void *(*bpf_get_msg_header_element)(void *name) = (void *)214; diff --git a/bpf/kmesh/bpf2go/bpf2go.go b/bpf/kmesh/bpf2go/bpf2go.go index 7ca98eb2d..5163f6284 100644 --- a/bpf/kmesh/bpf2go/bpf2go.go +++ b/bpf/kmesh/bpf2go/bpf2go.go @@ -18,18 +18,18 @@ package bpf2go // go run github.com/cilium/ebpf/cmd/bpf2go --help -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshCgroupSock ../ads/cgroup_sock.c -- -I../ads/include -I../../include -I../../../api/v2-c -DCGROUP_SOCK_MANAGE -DKERNEL_VERSION_HIGHER_5_13_0=1 -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshCgroupSockWorkload ../workload/cgroup_sock.c -- -I../workload/include -I../../include -I../probes -DKERNEL_VERSION_HIGHER_5_13_0=1 -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshSockops ../ads/sockops.c -- -I../ads/include -I../../include -I../../../api/v2-c -DKERNEL_VERSION_HIGHER_5_13_0=1 -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshTracePoint ../ads/tracepoint.c -- -I../ads/include -I../../include -DKERNEL_VERSION_HIGHER_5_13_0=1 -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshSockopsWorkload ../workload/sockops.c -- -I../workload/include -I../../include -I../probes -DKERNEL_VERSION_HIGHER_5_13_0=1 -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshXDPAuth ../workload/xdp.c -- -I../workload/include -I../../include -I../../../api/v2-c -DKERNEL_VERSION_HIGHER_5_13_0=1 -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshSendmsg ../workload/sendmsg.c -- -I../workload/include -I../../include -DKERNEL_VERSION_HIGHER_5_13_0=1 +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go --output-dir kernelnative/normal --go-package normal -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshCgroupSock ../ads/cgroup_sock.c -- -I../ads/include -I../../include -I../../../api/v2-c -DCGROUP_SOCK_MANAGE -DKERNEL_VERSION_HIGHER_5_13_0=1 +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go --output-dir dualengine --go-package dualengine -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshCgroupSockWorkload ../workload/cgroup_sock.c -- -I../workload/include -I../../include -I../probes -DKERNEL_VERSION_HIGHER_5_13_0=1 +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go --output-dir kernelnative/enhanced --go-package enhanced -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshSockops ../ads/sockops.c -- -I../ads/include -I../../include -I../../../api/v2-c -DKERNEL_VERSION_HIGHER_5_13_0=1 +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go --output-dir kernelnative/enhanced --go-package enhanced -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshTracePoint ../ads/tracepoint.c -- -I../ads/include -I../../include -DKERNEL_VERSION_HIGHER_5_13_0=1 +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go --output-dir dualengine --go-package dualengine -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshSockopsWorkload ../workload/sockops.c -- -I../workload/include -I../../include -I../probes -DKERNEL_VERSION_HIGHER_5_13_0=1 +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go --output-dir dualengine --go-package dualengine -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshXDPAuth ../workload/xdp.c -- -I../workload/include -I../../include -I../../../api/v2-c -DKERNEL_VERSION_HIGHER_5_13_0=1 +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go --output-dir dualengine --go-package dualengine -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshSendmsg ../workload/sendmsg.c -- -I../workload/include -I../../include -DKERNEL_VERSION_HIGHER_5_13_0=1 -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshCgroupSockCompat ../ads/cgroup_sock.c -- -I../ads/include -I../../include -I../../../api/v2-c -DCGROUP_SOCK_MANAGE -DKERNEL_VERSION_HIGHER_5_13_0=0 -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshCgroupSockWorkloadCompat ../workload/cgroup_sock.c -- -I../workload/include -I../../include -I../probes -DKERNEL_VERSION_HIGHER_5_13_0=0 -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshSockopsCompat ../ads/sockops.c -- -I../ads/include -I../../include -I../../../api/v2-c -DKERNEL_VERSION_HIGHER_5_13_0=0 -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshTracePointCompat ../ads/tracepoint.c -- -I../ads/include -I../../include -DKERNEL_VERSION_HIGHER_5_13_0=0 -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshSockopsWorkloadCompat ../workload/sockops.c -- -I../workload/include -I../../include -I../probes -DKERNEL_VERSION_HIGHER_5_13_0=0 -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshXDPAuthCompat ../workload/xdp.c -- -I../workload/include -I../../include -I../../../api/v2-c -DKERNEL_VERSION_HIGHER_5_13_0=0 -//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshSendmsgCompat ../workload/sendmsg.c -- -I../workload/include -I../../include -DKERNEL_VERSION_HIGHER_5_13_0=0 +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go --output-dir kernelnative/normal --go-package normal -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshCgroupSockCompat ../ads/cgroup_sock.c -- -I../ads/include -I../../include -I../../../api/v2-c -DCGROUP_SOCK_MANAGE -DKERNEL_VERSION_HIGHER_5_13_0=0 +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go --output-dir dualengine --go-package dualengine -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshCgroupSockWorkloadCompat ../workload/cgroup_sock.c -- -I../workload/include -I../../include -I../probes -DKERNEL_VERSION_HIGHER_5_13_0=0 +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go --output-dir kernelnative/enhanced --go-package enhanced -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshSockopsCompat ../ads/sockops.c -- -I../ads/include -I../../include -I../../../api/v2-c -DKERNEL_VERSION_HIGHER_5_13_0=0 +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go --output-dir kernelnative/enhanced --go-package enhanced -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshTracePointCompat ../ads/tracepoint.c -- -I../ads/include -I../../include -DKERNEL_VERSION_HIGHER_5_13_0=0 +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go --output-dir dualengine --go-package dualengine -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshSockopsWorkloadCompat ../workload/sockops.c -- -I../workload/include -I../../include -I../probes -DKERNEL_VERSION_HIGHER_5_13_0=0 +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go --output-dir dualengine --go-package dualengine -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshXDPAuthCompat ../workload/xdp.c -- -I../workload/include -I../../include -I../../../api/v2-c -DKERNEL_VERSION_HIGHER_5_13_0=0 +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go --output-dir dualengine --go-package dualengine -cc clang --cflags $EXTRA_CFLAGS --cflags $EXTRA_CDEFINE KmeshSendmsgCompat ../workload/sendmsg.c -- -I../workload/include -I../../include -DKERNEL_VERSION_HIGHER_5_13_0=0 diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfeb.go new file mode 100644 index 000000000..4dcc5701c --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfeb.go @@ -0,0 +1,203 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshCgroupSockWorkloadBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshCgroupSockWorkloadBuf struct{ Data [40]int8 } + +type KmeshCgroupSockWorkloadLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshCgroupSockWorkloadManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshCgroupSockWorkloadSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshCgroupSockWorkload returns the embedded CollectionSpec for KmeshCgroupSockWorkload. +func LoadKmeshCgroupSockWorkload() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshCgroupSockWorkloadBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshCgroupSockWorkload: %w", err) + } + + return spec, err +} + +// LoadKmeshCgroupSockWorkloadObjects loads KmeshCgroupSockWorkload and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshCgroupSockWorkloadObjects +// *KmeshCgroupSockWorkloadPrograms +// *KmeshCgroupSockWorkloadMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshCgroupSockWorkloadObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshCgroupSockWorkload() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshCgroupSockWorkloadSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockWorkloadSpecs struct { + KmeshCgroupSockWorkloadProgramSpecs + KmeshCgroupSockWorkloadMapSpecs +} + +// KmeshCgroupSockWorkloadSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockWorkloadProgramSpecs struct { + CgroupConnect4Prog *ebpf.ProgramSpec `ebpf:"cgroup_connect4_prog"` + CgroupConnect6Prog *ebpf.ProgramSpec `ebpf:"cgroup_connect6_prog"` +} + +// KmeshCgroupSockWorkloadMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockWorkloadMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` + MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + MapOfTailCallProg *ebpf.MapSpec `ebpf:"map_of_tail_call_prog"` + MapOfTcpInfo *ebpf.MapSpec `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.MapSpec `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.MapSpec `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshCgroupSockWorkloadObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockWorkloadObjects struct { + KmeshCgroupSockWorkloadPrograms + KmeshCgroupSockWorkloadMaps +} + +func (o *KmeshCgroupSockWorkloadObjects) Close() error { + return _KmeshCgroupSockWorkloadClose( + &o.KmeshCgroupSockWorkloadPrograms, + &o.KmeshCgroupSockWorkloadMaps, + ) +} + +// KmeshCgroupSockWorkloadMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockWorkloadMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshService *ebpf.Map `ebpf:"kmesh_service"` + MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + MapOfTailCallProg *ebpf.Map `ebpf:"map_of_tail_call_prog"` + MapOfTcpInfo *ebpf.Map `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.Map `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.Map `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshCgroupSockWorkloadMaps) Close() error { + return _KmeshCgroupSockWorkloadClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshBackend, + m.KmeshEndpoint, + m.KmeshEvents, + m.KmeshFrontend, + m.KmeshManage, + m.KmeshService, + m.MapOfAuth, + m.MapOfDstInfo, + m.MapOfSockStorage, + m.MapOfTailCallProg, + m.MapOfTcpInfo, + m.MapOfTuple, + m.MapOfWlPolicy, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshCgroupSockWorkloadPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockWorkloadPrograms struct { + CgroupConnect4Prog *ebpf.Program `ebpf:"cgroup_connect4_prog"` + CgroupConnect6Prog *ebpf.Program `ebpf:"cgroup_connect6_prog"` +} + +func (p *KmeshCgroupSockWorkloadPrograms) Close() error { + return _KmeshCgroupSockWorkloadClose( + p.CgroupConnect4Prog, + p.CgroupConnect6Prog, + ) +} + +func _KmeshCgroupSockWorkloadClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshcgroupsockworkload_bpfeb.o +var _KmeshCgroupSockWorkloadBytes []byte diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfel.go new file mode 100644 index 000000000..17db7ab38 --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkload_bpfel.go @@ -0,0 +1,203 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshCgroupSockWorkloadBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshCgroupSockWorkloadBuf struct{ Data [40]int8 } + +type KmeshCgroupSockWorkloadLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshCgroupSockWorkloadManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshCgroupSockWorkloadSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshCgroupSockWorkload returns the embedded CollectionSpec for KmeshCgroupSockWorkload. +func LoadKmeshCgroupSockWorkload() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshCgroupSockWorkloadBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshCgroupSockWorkload: %w", err) + } + + return spec, err +} + +// LoadKmeshCgroupSockWorkloadObjects loads KmeshCgroupSockWorkload and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshCgroupSockWorkloadObjects +// *KmeshCgroupSockWorkloadPrograms +// *KmeshCgroupSockWorkloadMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshCgroupSockWorkloadObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshCgroupSockWorkload() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshCgroupSockWorkloadSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockWorkloadSpecs struct { + KmeshCgroupSockWorkloadProgramSpecs + KmeshCgroupSockWorkloadMapSpecs +} + +// KmeshCgroupSockWorkloadSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockWorkloadProgramSpecs struct { + CgroupConnect4Prog *ebpf.ProgramSpec `ebpf:"cgroup_connect4_prog"` + CgroupConnect6Prog *ebpf.ProgramSpec `ebpf:"cgroup_connect6_prog"` +} + +// KmeshCgroupSockWorkloadMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockWorkloadMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` + MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + MapOfTailCallProg *ebpf.MapSpec `ebpf:"map_of_tail_call_prog"` + MapOfTcpInfo *ebpf.MapSpec `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.MapSpec `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.MapSpec `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshCgroupSockWorkloadObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockWorkloadObjects struct { + KmeshCgroupSockWorkloadPrograms + KmeshCgroupSockWorkloadMaps +} + +func (o *KmeshCgroupSockWorkloadObjects) Close() error { + return _KmeshCgroupSockWorkloadClose( + &o.KmeshCgroupSockWorkloadPrograms, + &o.KmeshCgroupSockWorkloadMaps, + ) +} + +// KmeshCgroupSockWorkloadMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockWorkloadMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshService *ebpf.Map `ebpf:"kmesh_service"` + MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + MapOfTailCallProg *ebpf.Map `ebpf:"map_of_tail_call_prog"` + MapOfTcpInfo *ebpf.Map `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.Map `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.Map `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshCgroupSockWorkloadMaps) Close() error { + return _KmeshCgroupSockWorkloadClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshBackend, + m.KmeshEndpoint, + m.KmeshEvents, + m.KmeshFrontend, + m.KmeshManage, + m.KmeshService, + m.MapOfAuth, + m.MapOfDstInfo, + m.MapOfSockStorage, + m.MapOfTailCallProg, + m.MapOfTcpInfo, + m.MapOfTuple, + m.MapOfWlPolicy, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshCgroupSockWorkloadPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockWorkloadPrograms struct { + CgroupConnect4Prog *ebpf.Program `ebpf:"cgroup_connect4_prog"` + CgroupConnect6Prog *ebpf.Program `ebpf:"cgroup_connect6_prog"` +} + +func (p *KmeshCgroupSockWorkloadPrograms) Close() error { + return _KmeshCgroupSockWorkloadClose( + p.CgroupConnect4Prog, + p.CgroupConnect6Prog, + ) +} + +func _KmeshCgroupSockWorkloadClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshcgroupsockworkload_bpfel.o +var _KmeshCgroupSockWorkloadBytes []byte diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfeb.go new file mode 100644 index 000000000..cb8055572 --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfeb.go @@ -0,0 +1,203 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshCgroupSockWorkloadCompatBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshCgroupSockWorkloadCompatBuf struct{ Data [40]int8 } + +type KmeshCgroupSockWorkloadCompatLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshCgroupSockWorkloadCompatManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshCgroupSockWorkloadCompatSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshCgroupSockWorkloadCompat returns the embedded CollectionSpec for KmeshCgroupSockWorkloadCompat. +func LoadKmeshCgroupSockWorkloadCompat() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshCgroupSockWorkloadCompatBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshCgroupSockWorkloadCompat: %w", err) + } + + return spec, err +} + +// LoadKmeshCgroupSockWorkloadCompatObjects loads KmeshCgroupSockWorkloadCompat and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshCgroupSockWorkloadCompatObjects +// *KmeshCgroupSockWorkloadCompatPrograms +// *KmeshCgroupSockWorkloadCompatMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshCgroupSockWorkloadCompatObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshCgroupSockWorkloadCompat() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshCgroupSockWorkloadCompatSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockWorkloadCompatSpecs struct { + KmeshCgroupSockWorkloadCompatProgramSpecs + KmeshCgroupSockWorkloadCompatMapSpecs +} + +// KmeshCgroupSockWorkloadCompatSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockWorkloadCompatProgramSpecs struct { + CgroupConnect4Prog *ebpf.ProgramSpec `ebpf:"cgroup_connect4_prog"` + CgroupConnect6Prog *ebpf.ProgramSpec `ebpf:"cgroup_connect6_prog"` +} + +// KmeshCgroupSockWorkloadCompatMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockWorkloadCompatMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` + MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + MapOfTailCallProg *ebpf.MapSpec `ebpf:"map_of_tail_call_prog"` + MapOfTcpInfo *ebpf.MapSpec `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.MapSpec `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.MapSpec `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshCgroupSockWorkloadCompatObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockWorkloadCompatObjects struct { + KmeshCgroupSockWorkloadCompatPrograms + KmeshCgroupSockWorkloadCompatMaps +} + +func (o *KmeshCgroupSockWorkloadCompatObjects) Close() error { + return _KmeshCgroupSockWorkloadCompatClose( + &o.KmeshCgroupSockWorkloadCompatPrograms, + &o.KmeshCgroupSockWorkloadCompatMaps, + ) +} + +// KmeshCgroupSockWorkloadCompatMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockWorkloadCompatMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshService *ebpf.Map `ebpf:"kmesh_service"` + MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + MapOfTailCallProg *ebpf.Map `ebpf:"map_of_tail_call_prog"` + MapOfTcpInfo *ebpf.Map `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.Map `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.Map `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshCgroupSockWorkloadCompatMaps) Close() error { + return _KmeshCgroupSockWorkloadCompatClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshBackend, + m.KmeshEndpoint, + m.KmeshEvents, + m.KmeshFrontend, + m.KmeshManage, + m.KmeshService, + m.MapOfAuth, + m.MapOfDstInfo, + m.MapOfSockStorage, + m.MapOfTailCallProg, + m.MapOfTcpInfo, + m.MapOfTuple, + m.MapOfWlPolicy, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshCgroupSockWorkloadCompatPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockWorkloadCompatPrograms struct { + CgroupConnect4Prog *ebpf.Program `ebpf:"cgroup_connect4_prog"` + CgroupConnect6Prog *ebpf.Program `ebpf:"cgroup_connect6_prog"` +} + +func (p *KmeshCgroupSockWorkloadCompatPrograms) Close() error { + return _KmeshCgroupSockWorkloadCompatClose( + p.CgroupConnect4Prog, + p.CgroupConnect6Prog, + ) +} + +func _KmeshCgroupSockWorkloadCompatClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshcgroupsockworkloadcompat_bpfeb.o +var _KmeshCgroupSockWorkloadCompatBytes []byte diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfel.go new file mode 100644 index 000000000..2c54a2c20 --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshcgroupsockworkloadcompat_bpfel.go @@ -0,0 +1,203 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshCgroupSockWorkloadCompatBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshCgroupSockWorkloadCompatBuf struct{ Data [40]int8 } + +type KmeshCgroupSockWorkloadCompatLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshCgroupSockWorkloadCompatManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshCgroupSockWorkloadCompatSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshCgroupSockWorkloadCompat returns the embedded CollectionSpec for KmeshCgroupSockWorkloadCompat. +func LoadKmeshCgroupSockWorkloadCompat() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshCgroupSockWorkloadCompatBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshCgroupSockWorkloadCompat: %w", err) + } + + return spec, err +} + +// LoadKmeshCgroupSockWorkloadCompatObjects loads KmeshCgroupSockWorkloadCompat and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshCgroupSockWorkloadCompatObjects +// *KmeshCgroupSockWorkloadCompatPrograms +// *KmeshCgroupSockWorkloadCompatMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshCgroupSockWorkloadCompatObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshCgroupSockWorkloadCompat() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshCgroupSockWorkloadCompatSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockWorkloadCompatSpecs struct { + KmeshCgroupSockWorkloadCompatProgramSpecs + KmeshCgroupSockWorkloadCompatMapSpecs +} + +// KmeshCgroupSockWorkloadCompatSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockWorkloadCompatProgramSpecs struct { + CgroupConnect4Prog *ebpf.ProgramSpec `ebpf:"cgroup_connect4_prog"` + CgroupConnect6Prog *ebpf.ProgramSpec `ebpf:"cgroup_connect6_prog"` +} + +// KmeshCgroupSockWorkloadCompatMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockWorkloadCompatMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` + MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + MapOfTailCallProg *ebpf.MapSpec `ebpf:"map_of_tail_call_prog"` + MapOfTcpInfo *ebpf.MapSpec `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.MapSpec `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.MapSpec `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshCgroupSockWorkloadCompatObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockWorkloadCompatObjects struct { + KmeshCgroupSockWorkloadCompatPrograms + KmeshCgroupSockWorkloadCompatMaps +} + +func (o *KmeshCgroupSockWorkloadCompatObjects) Close() error { + return _KmeshCgroupSockWorkloadCompatClose( + &o.KmeshCgroupSockWorkloadCompatPrograms, + &o.KmeshCgroupSockWorkloadCompatMaps, + ) +} + +// KmeshCgroupSockWorkloadCompatMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockWorkloadCompatMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshService *ebpf.Map `ebpf:"kmesh_service"` + MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + MapOfTailCallProg *ebpf.Map `ebpf:"map_of_tail_call_prog"` + MapOfTcpInfo *ebpf.Map `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.Map `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.Map `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshCgroupSockWorkloadCompatMaps) Close() error { + return _KmeshCgroupSockWorkloadCompatClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshBackend, + m.KmeshEndpoint, + m.KmeshEvents, + m.KmeshFrontend, + m.KmeshManage, + m.KmeshService, + m.MapOfAuth, + m.MapOfDstInfo, + m.MapOfSockStorage, + m.MapOfTailCallProg, + m.MapOfTcpInfo, + m.MapOfTuple, + m.MapOfWlPolicy, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshCgroupSockWorkloadCompatPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockWorkloadCompatPrograms struct { + CgroupConnect4Prog *ebpf.Program `ebpf:"cgroup_connect4_prog"` + CgroupConnect6Prog *ebpf.Program `ebpf:"cgroup_connect6_prog"` +} + +func (p *KmeshCgroupSockWorkloadCompatPrograms) Close() error { + return _KmeshCgroupSockWorkloadCompatClose( + p.CgroupConnect4Prog, + p.CgroupConnect6Prog, + ) +} + +func _KmeshCgroupSockWorkloadCompatClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshcgroupsockworkloadcompat_bpfel.o +var _KmeshCgroupSockWorkloadCompatBytes []byte diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfeb.go new file mode 100644 index 000000000..4bed256e0 --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfeb.go @@ -0,0 +1,149 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshSendmsgBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshSendmsgBuf struct{ Data [40]int8 } + +type KmeshSendmsgLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +// LoadKmeshSendmsg returns the embedded CollectionSpec for KmeshSendmsg. +func LoadKmeshSendmsg() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshSendmsgBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshSendmsg: %w", err) + } + + return spec, err +} + +// LoadKmeshSendmsgObjects loads KmeshSendmsg and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshSendmsgObjects +// *KmeshSendmsgPrograms +// *KmeshSendmsgMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshSendmsgObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshSendmsg() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshSendmsgSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSendmsgSpecs struct { + KmeshSendmsgProgramSpecs + KmeshSendmsgMapSpecs +} + +// KmeshSendmsgSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSendmsgProgramSpecs struct { + SendmsgProg *ebpf.ProgramSpec `ebpf:"sendmsg_prog"` +} + +// KmeshSendmsgMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSendmsgMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshSendmsgObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSendmsgObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSendmsgObjects struct { + KmeshSendmsgPrograms + KmeshSendmsgMaps +} + +func (o *KmeshSendmsgObjects) Close() error { + return _KmeshSendmsgClose( + &o.KmeshSendmsgPrograms, + &o.KmeshSendmsgMaps, + ) +} + +// KmeshSendmsgMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSendmsgObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSendmsgMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshSendmsgMaps) Close() error { + return _KmeshSendmsgClose( + m.BpfLogLevel, + m.KmeshEvents, + m.MapOfDstInfo, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshSendmsgPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSendmsgObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSendmsgPrograms struct { + SendmsgProg *ebpf.Program `ebpf:"sendmsg_prog"` +} + +func (p *KmeshSendmsgPrograms) Close() error { + return _KmeshSendmsgClose( + p.SendmsgProg, + ) +} + +func _KmeshSendmsgClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshsendmsg_bpfeb.o +var _KmeshSendmsgBytes []byte diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfel.go new file mode 100644 index 000000000..a0a78499f --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsg_bpfel.go @@ -0,0 +1,149 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshSendmsgBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshSendmsgBuf struct{ Data [40]int8 } + +type KmeshSendmsgLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +// LoadKmeshSendmsg returns the embedded CollectionSpec for KmeshSendmsg. +func LoadKmeshSendmsg() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshSendmsgBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshSendmsg: %w", err) + } + + return spec, err +} + +// LoadKmeshSendmsgObjects loads KmeshSendmsg and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshSendmsgObjects +// *KmeshSendmsgPrograms +// *KmeshSendmsgMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshSendmsgObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshSendmsg() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshSendmsgSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSendmsgSpecs struct { + KmeshSendmsgProgramSpecs + KmeshSendmsgMapSpecs +} + +// KmeshSendmsgSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSendmsgProgramSpecs struct { + SendmsgProg *ebpf.ProgramSpec `ebpf:"sendmsg_prog"` +} + +// KmeshSendmsgMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSendmsgMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshSendmsgObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSendmsgObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSendmsgObjects struct { + KmeshSendmsgPrograms + KmeshSendmsgMaps +} + +func (o *KmeshSendmsgObjects) Close() error { + return _KmeshSendmsgClose( + &o.KmeshSendmsgPrograms, + &o.KmeshSendmsgMaps, + ) +} + +// KmeshSendmsgMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSendmsgObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSendmsgMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshSendmsgMaps) Close() error { + return _KmeshSendmsgClose( + m.BpfLogLevel, + m.KmeshEvents, + m.MapOfDstInfo, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshSendmsgPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSendmsgObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSendmsgPrograms struct { + SendmsgProg *ebpf.Program `ebpf:"sendmsg_prog"` +} + +func (p *KmeshSendmsgPrograms) Close() error { + return _KmeshSendmsgClose( + p.SendmsgProg, + ) +} + +func _KmeshSendmsgClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshsendmsg_bpfel.o +var _KmeshSendmsgBytes []byte diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfeb.go new file mode 100644 index 000000000..61c2fd88f --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfeb.go @@ -0,0 +1,149 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshSendmsgCompatBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshSendmsgCompatBuf struct{ Data [40]int8 } + +type KmeshSendmsgCompatLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +// LoadKmeshSendmsgCompat returns the embedded CollectionSpec for KmeshSendmsgCompat. +func LoadKmeshSendmsgCompat() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshSendmsgCompatBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshSendmsgCompat: %w", err) + } + + return spec, err +} + +// LoadKmeshSendmsgCompatObjects loads KmeshSendmsgCompat and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshSendmsgCompatObjects +// *KmeshSendmsgCompatPrograms +// *KmeshSendmsgCompatMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshSendmsgCompatObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshSendmsgCompat() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshSendmsgCompatSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSendmsgCompatSpecs struct { + KmeshSendmsgCompatProgramSpecs + KmeshSendmsgCompatMapSpecs +} + +// KmeshSendmsgCompatSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSendmsgCompatProgramSpecs struct { + SendmsgProg *ebpf.ProgramSpec `ebpf:"sendmsg_prog"` +} + +// KmeshSendmsgCompatMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSendmsgCompatMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshSendmsgCompatObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSendmsgCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSendmsgCompatObjects struct { + KmeshSendmsgCompatPrograms + KmeshSendmsgCompatMaps +} + +func (o *KmeshSendmsgCompatObjects) Close() error { + return _KmeshSendmsgCompatClose( + &o.KmeshSendmsgCompatPrograms, + &o.KmeshSendmsgCompatMaps, + ) +} + +// KmeshSendmsgCompatMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSendmsgCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSendmsgCompatMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshSendmsgCompatMaps) Close() error { + return _KmeshSendmsgCompatClose( + m.BpfLogLevel, + m.KmeshEvents, + m.MapOfDstInfo, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshSendmsgCompatPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSendmsgCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSendmsgCompatPrograms struct { + SendmsgProg *ebpf.Program `ebpf:"sendmsg_prog"` +} + +func (p *KmeshSendmsgCompatPrograms) Close() error { + return _KmeshSendmsgCompatClose( + p.SendmsgProg, + ) +} + +func _KmeshSendmsgCompatClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshsendmsgcompat_bpfeb.o +var _KmeshSendmsgCompatBytes []byte diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfel.go new file mode 100644 index 000000000..02a1ea659 --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsendmsgcompat_bpfel.go @@ -0,0 +1,149 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshSendmsgCompatBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshSendmsgCompatBuf struct{ Data [40]int8 } + +type KmeshSendmsgCompatLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +// LoadKmeshSendmsgCompat returns the embedded CollectionSpec for KmeshSendmsgCompat. +func LoadKmeshSendmsgCompat() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshSendmsgCompatBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshSendmsgCompat: %w", err) + } + + return spec, err +} + +// LoadKmeshSendmsgCompatObjects loads KmeshSendmsgCompat and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshSendmsgCompatObjects +// *KmeshSendmsgCompatPrograms +// *KmeshSendmsgCompatMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshSendmsgCompatObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshSendmsgCompat() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshSendmsgCompatSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSendmsgCompatSpecs struct { + KmeshSendmsgCompatProgramSpecs + KmeshSendmsgCompatMapSpecs +} + +// KmeshSendmsgCompatSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSendmsgCompatProgramSpecs struct { + SendmsgProg *ebpf.ProgramSpec `ebpf:"sendmsg_prog"` +} + +// KmeshSendmsgCompatMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSendmsgCompatMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshSendmsgCompatObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSendmsgCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSendmsgCompatObjects struct { + KmeshSendmsgCompatPrograms + KmeshSendmsgCompatMaps +} + +func (o *KmeshSendmsgCompatObjects) Close() error { + return _KmeshSendmsgCompatClose( + &o.KmeshSendmsgCompatPrograms, + &o.KmeshSendmsgCompatMaps, + ) +} + +// KmeshSendmsgCompatMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSendmsgCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSendmsgCompatMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshSendmsgCompatMaps) Close() error { + return _KmeshSendmsgCompatClose( + m.BpfLogLevel, + m.KmeshEvents, + m.MapOfDstInfo, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshSendmsgCompatPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSendmsgCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSendmsgCompatPrograms struct { + SendmsgProg *ebpf.Program `ebpf:"sendmsg_prog"` +} + +func (p *KmeshSendmsgCompatPrograms) Close() error { + return _KmeshSendmsgCompatClose( + p.SendmsgProg, + ) +} + +func _KmeshSendmsgCompatClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshsendmsgcompat_bpfel.o +var _KmeshSendmsgCompatBytes []byte diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfeb.go new file mode 100644 index 000000000..8eef0a88d --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfeb.go @@ -0,0 +1,200 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshSockopsWorkloadBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshSockopsWorkloadBuf struct{ Data [40]int8 } + +type KmeshSockopsWorkloadLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshSockopsWorkloadManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshSockopsWorkloadSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshSockopsWorkload returns the embedded CollectionSpec for KmeshSockopsWorkload. +func LoadKmeshSockopsWorkload() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshSockopsWorkloadBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshSockopsWorkload: %w", err) + } + + return spec, err +} + +// LoadKmeshSockopsWorkloadObjects loads KmeshSockopsWorkload and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshSockopsWorkloadObjects +// *KmeshSockopsWorkloadPrograms +// *KmeshSockopsWorkloadMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshSockopsWorkloadObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshSockopsWorkload() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshSockopsWorkloadSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsWorkloadSpecs struct { + KmeshSockopsWorkloadProgramSpecs + KmeshSockopsWorkloadMapSpecs +} + +// KmeshSockopsWorkloadSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsWorkloadProgramSpecs struct { + SockopsProg *ebpf.ProgramSpec `ebpf:"sockops_prog"` +} + +// KmeshSockopsWorkloadMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsWorkloadMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` + MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + MapOfKmeshSocket *ebpf.MapSpec `ebpf:"map_of_kmesh_socket"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + MapOfTcpInfo *ebpf.MapSpec `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.MapSpec `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.MapSpec `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshSockopsWorkloadObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsWorkloadObjects struct { + KmeshSockopsWorkloadPrograms + KmeshSockopsWorkloadMaps +} + +func (o *KmeshSockopsWorkloadObjects) Close() error { + return _KmeshSockopsWorkloadClose( + &o.KmeshSockopsWorkloadPrograms, + &o.KmeshSockopsWorkloadMaps, + ) +} + +// KmeshSockopsWorkloadMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsWorkloadMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshService *ebpf.Map `ebpf:"kmesh_service"` + MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + MapOfKmeshSocket *ebpf.Map `ebpf:"map_of_kmesh_socket"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + MapOfTcpInfo *ebpf.Map `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.Map `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.Map `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshSockopsWorkloadMaps) Close() error { + return _KmeshSockopsWorkloadClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshBackend, + m.KmeshEndpoint, + m.KmeshEvents, + m.KmeshFrontend, + m.KmeshManage, + m.KmeshService, + m.MapOfAuth, + m.MapOfDstInfo, + m.MapOfKmeshSocket, + m.MapOfSockStorage, + m.MapOfTcpInfo, + m.MapOfTuple, + m.MapOfWlPolicy, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshSockopsWorkloadPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsWorkloadPrograms struct { + SockopsProg *ebpf.Program `ebpf:"sockops_prog"` +} + +func (p *KmeshSockopsWorkloadPrograms) Close() error { + return _KmeshSockopsWorkloadClose( + p.SockopsProg, + ) +} + +func _KmeshSockopsWorkloadClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshsockopsworkload_bpfeb.o +var _KmeshSockopsWorkloadBytes []byte diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfel.go new file mode 100644 index 000000000..846fbdfea --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkload_bpfel.go @@ -0,0 +1,200 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshSockopsWorkloadBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshSockopsWorkloadBuf struct{ Data [40]int8 } + +type KmeshSockopsWorkloadLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshSockopsWorkloadManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshSockopsWorkloadSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshSockopsWorkload returns the embedded CollectionSpec for KmeshSockopsWorkload. +func LoadKmeshSockopsWorkload() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshSockopsWorkloadBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshSockopsWorkload: %w", err) + } + + return spec, err +} + +// LoadKmeshSockopsWorkloadObjects loads KmeshSockopsWorkload and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshSockopsWorkloadObjects +// *KmeshSockopsWorkloadPrograms +// *KmeshSockopsWorkloadMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshSockopsWorkloadObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshSockopsWorkload() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshSockopsWorkloadSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsWorkloadSpecs struct { + KmeshSockopsWorkloadProgramSpecs + KmeshSockopsWorkloadMapSpecs +} + +// KmeshSockopsWorkloadSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsWorkloadProgramSpecs struct { + SockopsProg *ebpf.ProgramSpec `ebpf:"sockops_prog"` +} + +// KmeshSockopsWorkloadMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsWorkloadMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` + MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + MapOfKmeshSocket *ebpf.MapSpec `ebpf:"map_of_kmesh_socket"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + MapOfTcpInfo *ebpf.MapSpec `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.MapSpec `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.MapSpec `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshSockopsWorkloadObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsWorkloadObjects struct { + KmeshSockopsWorkloadPrograms + KmeshSockopsWorkloadMaps +} + +func (o *KmeshSockopsWorkloadObjects) Close() error { + return _KmeshSockopsWorkloadClose( + &o.KmeshSockopsWorkloadPrograms, + &o.KmeshSockopsWorkloadMaps, + ) +} + +// KmeshSockopsWorkloadMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsWorkloadMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshService *ebpf.Map `ebpf:"kmesh_service"` + MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + MapOfKmeshSocket *ebpf.Map `ebpf:"map_of_kmesh_socket"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + MapOfTcpInfo *ebpf.Map `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.Map `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.Map `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshSockopsWorkloadMaps) Close() error { + return _KmeshSockopsWorkloadClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshBackend, + m.KmeshEndpoint, + m.KmeshEvents, + m.KmeshFrontend, + m.KmeshManage, + m.KmeshService, + m.MapOfAuth, + m.MapOfDstInfo, + m.MapOfKmeshSocket, + m.MapOfSockStorage, + m.MapOfTcpInfo, + m.MapOfTuple, + m.MapOfWlPolicy, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshSockopsWorkloadPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsWorkloadObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsWorkloadPrograms struct { + SockopsProg *ebpf.Program `ebpf:"sockops_prog"` +} + +func (p *KmeshSockopsWorkloadPrograms) Close() error { + return _KmeshSockopsWorkloadClose( + p.SockopsProg, + ) +} + +func _KmeshSockopsWorkloadClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshsockopsworkload_bpfel.o +var _KmeshSockopsWorkloadBytes []byte diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfeb.go new file mode 100644 index 000000000..d4acaf447 --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfeb.go @@ -0,0 +1,200 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshSockopsWorkloadCompatBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshSockopsWorkloadCompatBuf struct{ Data [40]int8 } + +type KmeshSockopsWorkloadCompatLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshSockopsWorkloadCompatManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshSockopsWorkloadCompatSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshSockopsWorkloadCompat returns the embedded CollectionSpec for KmeshSockopsWorkloadCompat. +func LoadKmeshSockopsWorkloadCompat() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshSockopsWorkloadCompatBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshSockopsWorkloadCompat: %w", err) + } + + return spec, err +} + +// LoadKmeshSockopsWorkloadCompatObjects loads KmeshSockopsWorkloadCompat and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshSockopsWorkloadCompatObjects +// *KmeshSockopsWorkloadCompatPrograms +// *KmeshSockopsWorkloadCompatMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshSockopsWorkloadCompatObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshSockopsWorkloadCompat() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshSockopsWorkloadCompatSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsWorkloadCompatSpecs struct { + KmeshSockopsWorkloadCompatProgramSpecs + KmeshSockopsWorkloadCompatMapSpecs +} + +// KmeshSockopsWorkloadCompatSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsWorkloadCompatProgramSpecs struct { + SockopsProg *ebpf.ProgramSpec `ebpf:"sockops_prog"` +} + +// KmeshSockopsWorkloadCompatMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsWorkloadCompatMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` + MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + MapOfKmeshSocket *ebpf.MapSpec `ebpf:"map_of_kmesh_socket"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + MapOfTcpInfo *ebpf.MapSpec `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.MapSpec `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.MapSpec `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshSockopsWorkloadCompatObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsWorkloadCompatObjects struct { + KmeshSockopsWorkloadCompatPrograms + KmeshSockopsWorkloadCompatMaps +} + +func (o *KmeshSockopsWorkloadCompatObjects) Close() error { + return _KmeshSockopsWorkloadCompatClose( + &o.KmeshSockopsWorkloadCompatPrograms, + &o.KmeshSockopsWorkloadCompatMaps, + ) +} + +// KmeshSockopsWorkloadCompatMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsWorkloadCompatMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshService *ebpf.Map `ebpf:"kmesh_service"` + MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + MapOfKmeshSocket *ebpf.Map `ebpf:"map_of_kmesh_socket"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + MapOfTcpInfo *ebpf.Map `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.Map `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.Map `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshSockopsWorkloadCompatMaps) Close() error { + return _KmeshSockopsWorkloadCompatClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshBackend, + m.KmeshEndpoint, + m.KmeshEvents, + m.KmeshFrontend, + m.KmeshManage, + m.KmeshService, + m.MapOfAuth, + m.MapOfDstInfo, + m.MapOfKmeshSocket, + m.MapOfSockStorage, + m.MapOfTcpInfo, + m.MapOfTuple, + m.MapOfWlPolicy, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshSockopsWorkloadCompatPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsWorkloadCompatPrograms struct { + SockopsProg *ebpf.Program `ebpf:"sockops_prog"` +} + +func (p *KmeshSockopsWorkloadCompatPrograms) Close() error { + return _KmeshSockopsWorkloadCompatClose( + p.SockopsProg, + ) +} + +func _KmeshSockopsWorkloadCompatClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshsockopsworkloadcompat_bpfeb.o +var _KmeshSockopsWorkloadCompatBytes []byte diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfel.go new file mode 100644 index 000000000..78b0cffab --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshsockopsworkloadcompat_bpfel.go @@ -0,0 +1,200 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshSockopsWorkloadCompatBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshSockopsWorkloadCompatBuf struct{ Data [40]int8 } + +type KmeshSockopsWorkloadCompatLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshSockopsWorkloadCompatManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshSockopsWorkloadCompatSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshSockopsWorkloadCompat returns the embedded CollectionSpec for KmeshSockopsWorkloadCompat. +func LoadKmeshSockopsWorkloadCompat() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshSockopsWorkloadCompatBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshSockopsWorkloadCompat: %w", err) + } + + return spec, err +} + +// LoadKmeshSockopsWorkloadCompatObjects loads KmeshSockopsWorkloadCompat and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshSockopsWorkloadCompatObjects +// *KmeshSockopsWorkloadCompatPrograms +// *KmeshSockopsWorkloadCompatMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshSockopsWorkloadCompatObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshSockopsWorkloadCompat() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshSockopsWorkloadCompatSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsWorkloadCompatSpecs struct { + KmeshSockopsWorkloadCompatProgramSpecs + KmeshSockopsWorkloadCompatMapSpecs +} + +// KmeshSockopsWorkloadCompatSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsWorkloadCompatProgramSpecs struct { + SockopsProg *ebpf.ProgramSpec `ebpf:"sockops_prog"` +} + +// KmeshSockopsWorkloadCompatMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsWorkloadCompatMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` + MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.MapSpec `ebpf:"map_of_dst_info"` + MapOfKmeshSocket *ebpf.MapSpec `ebpf:"map_of_kmesh_socket"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + MapOfTcpInfo *ebpf.MapSpec `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.MapSpec `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.MapSpec `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshSockopsWorkloadCompatObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsWorkloadCompatObjects struct { + KmeshSockopsWorkloadCompatPrograms + KmeshSockopsWorkloadCompatMaps +} + +func (o *KmeshSockopsWorkloadCompatObjects) Close() error { + return _KmeshSockopsWorkloadCompatClose( + &o.KmeshSockopsWorkloadCompatPrograms, + &o.KmeshSockopsWorkloadCompatMaps, + ) +} + +// KmeshSockopsWorkloadCompatMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsWorkloadCompatMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshService *ebpf.Map `ebpf:"kmesh_service"` + MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` + MapOfDstInfo *ebpf.Map `ebpf:"map_of_dst_info"` + MapOfKmeshSocket *ebpf.Map `ebpf:"map_of_kmesh_socket"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + MapOfTcpInfo *ebpf.Map `ebpf:"map_of_tcp_info"` + MapOfTuple *ebpf.Map `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.Map `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshSockopsWorkloadCompatMaps) Close() error { + return _KmeshSockopsWorkloadCompatClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshBackend, + m.KmeshEndpoint, + m.KmeshEvents, + m.KmeshFrontend, + m.KmeshManage, + m.KmeshService, + m.MapOfAuth, + m.MapOfDstInfo, + m.MapOfKmeshSocket, + m.MapOfSockStorage, + m.MapOfTcpInfo, + m.MapOfTuple, + m.MapOfWlPolicy, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshSockopsWorkloadCompatPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsWorkloadCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsWorkloadCompatPrograms struct { + SockopsProg *ebpf.Program `ebpf:"sockops_prog"` +} + +func (p *KmeshSockopsWorkloadCompatPrograms) Close() error { + return _KmeshSockopsWorkloadCompatClose( + p.SockopsProg, + ) +} + +func _KmeshSockopsWorkloadCompatClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshsockopsworkloadcompat_bpfel.o +var _KmeshSockopsWorkloadCompatBytes []byte diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfeb.go new file mode 100644 index 000000000..766b70048 --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfeb.go @@ -0,0 +1,194 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshXDPAuthBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshXDPAuthBuf struct{ Data [40]int8 } + +type KmeshXDPAuthLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshXDPAuthManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshXDPAuthSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshXDPAuth returns the embedded CollectionSpec for KmeshXDPAuth. +func LoadKmeshXDPAuth() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshXDPAuthBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshXDPAuth: %w", err) + } + + return spec, err +} + +// LoadKmeshXDPAuthObjects loads KmeshXDPAuth and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshXDPAuthObjects +// *KmeshXDPAuthPrograms +// *KmeshXDPAuthMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshXDPAuthObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshXDPAuth() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshXDPAuthSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshXDPAuthSpecs struct { + KmeshXDPAuthProgramSpecs + KmeshXDPAuthMapSpecs +} + +// KmeshXDPAuthSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshXDPAuthProgramSpecs struct { + XdpShutdown *ebpf.ProgramSpec `ebpf:"xdp_shutdown"` +} + +// KmeshXDPAuthMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshXDPAuthMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` + MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` + MapOfAuthz *ebpf.MapSpec `ebpf:"map_of_authz"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + MapOfTuple *ebpf.MapSpec `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.MapSpec `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshXDPAuthObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshXDPAuthObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshXDPAuthObjects struct { + KmeshXDPAuthPrograms + KmeshXDPAuthMaps +} + +func (o *KmeshXDPAuthObjects) Close() error { + return _KmeshXDPAuthClose( + &o.KmeshXDPAuthPrograms, + &o.KmeshXDPAuthMaps, + ) +} + +// KmeshXDPAuthMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshXDPAuthObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshXDPAuthMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshService *ebpf.Map `ebpf:"kmesh_service"` + MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` + MapOfAuthz *ebpf.Map `ebpf:"map_of_authz"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + MapOfTuple *ebpf.Map `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.Map `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshXDPAuthMaps) Close() error { + return _KmeshXDPAuthClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshBackend, + m.KmeshEndpoint, + m.KmeshEvents, + m.KmeshFrontend, + m.KmeshManage, + m.KmeshService, + m.MapOfAuth, + m.MapOfAuthz, + m.MapOfSockStorage, + m.MapOfTuple, + m.MapOfWlPolicy, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshXDPAuthPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshXDPAuthObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshXDPAuthPrograms struct { + XdpShutdown *ebpf.Program `ebpf:"xdp_shutdown"` +} + +func (p *KmeshXDPAuthPrograms) Close() error { + return _KmeshXDPAuthClose( + p.XdpShutdown, + ) +} + +func _KmeshXDPAuthClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshxdpauth_bpfeb.o +var _KmeshXDPAuthBytes []byte diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfel.go new file mode 100644 index 000000000..3f8dd7015 --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauth_bpfel.go @@ -0,0 +1,194 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshXDPAuthBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshXDPAuthBuf struct{ Data [40]int8 } + +type KmeshXDPAuthLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshXDPAuthManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshXDPAuthSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshXDPAuth returns the embedded CollectionSpec for KmeshXDPAuth. +func LoadKmeshXDPAuth() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshXDPAuthBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshXDPAuth: %w", err) + } + + return spec, err +} + +// LoadKmeshXDPAuthObjects loads KmeshXDPAuth and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshXDPAuthObjects +// *KmeshXDPAuthPrograms +// *KmeshXDPAuthMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshXDPAuthObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshXDPAuth() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshXDPAuthSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshXDPAuthSpecs struct { + KmeshXDPAuthProgramSpecs + KmeshXDPAuthMapSpecs +} + +// KmeshXDPAuthSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshXDPAuthProgramSpecs struct { + XdpShutdown *ebpf.ProgramSpec `ebpf:"xdp_shutdown"` +} + +// KmeshXDPAuthMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshXDPAuthMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` + MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` + MapOfAuthz *ebpf.MapSpec `ebpf:"map_of_authz"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + MapOfTuple *ebpf.MapSpec `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.MapSpec `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshXDPAuthObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshXDPAuthObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshXDPAuthObjects struct { + KmeshXDPAuthPrograms + KmeshXDPAuthMaps +} + +func (o *KmeshXDPAuthObjects) Close() error { + return _KmeshXDPAuthClose( + &o.KmeshXDPAuthPrograms, + &o.KmeshXDPAuthMaps, + ) +} + +// KmeshXDPAuthMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshXDPAuthObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshXDPAuthMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshService *ebpf.Map `ebpf:"kmesh_service"` + MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` + MapOfAuthz *ebpf.Map `ebpf:"map_of_authz"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + MapOfTuple *ebpf.Map `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.Map `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshXDPAuthMaps) Close() error { + return _KmeshXDPAuthClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshBackend, + m.KmeshEndpoint, + m.KmeshEvents, + m.KmeshFrontend, + m.KmeshManage, + m.KmeshService, + m.MapOfAuth, + m.MapOfAuthz, + m.MapOfSockStorage, + m.MapOfTuple, + m.MapOfWlPolicy, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshXDPAuthPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshXDPAuthObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshXDPAuthPrograms struct { + XdpShutdown *ebpf.Program `ebpf:"xdp_shutdown"` +} + +func (p *KmeshXDPAuthPrograms) Close() error { + return _KmeshXDPAuthClose( + p.XdpShutdown, + ) +} + +func _KmeshXDPAuthClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshxdpauth_bpfel.o +var _KmeshXDPAuthBytes []byte diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfeb.go b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfeb.go new file mode 100644 index 000000000..307208048 --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfeb.go @@ -0,0 +1,194 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshXDPAuthCompatBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshXDPAuthCompatBuf struct{ Data [40]int8 } + +type KmeshXDPAuthCompatLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshXDPAuthCompatManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshXDPAuthCompatSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshXDPAuthCompat returns the embedded CollectionSpec for KmeshXDPAuthCompat. +func LoadKmeshXDPAuthCompat() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshXDPAuthCompatBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshXDPAuthCompat: %w", err) + } + + return spec, err +} + +// LoadKmeshXDPAuthCompatObjects loads KmeshXDPAuthCompat and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshXDPAuthCompatObjects +// *KmeshXDPAuthCompatPrograms +// *KmeshXDPAuthCompatMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshXDPAuthCompatObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshXDPAuthCompat() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshXDPAuthCompatSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshXDPAuthCompatSpecs struct { + KmeshXDPAuthCompatProgramSpecs + KmeshXDPAuthCompatMapSpecs +} + +// KmeshXDPAuthCompatSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshXDPAuthCompatProgramSpecs struct { + XdpShutdown *ebpf.ProgramSpec `ebpf:"xdp_shutdown"` +} + +// KmeshXDPAuthCompatMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshXDPAuthCompatMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` + MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` + MapOfAuthz *ebpf.MapSpec `ebpf:"map_of_authz"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + MapOfTuple *ebpf.MapSpec `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.MapSpec `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshXDPAuthCompatObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshXDPAuthCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshXDPAuthCompatObjects struct { + KmeshXDPAuthCompatPrograms + KmeshXDPAuthCompatMaps +} + +func (o *KmeshXDPAuthCompatObjects) Close() error { + return _KmeshXDPAuthCompatClose( + &o.KmeshXDPAuthCompatPrograms, + &o.KmeshXDPAuthCompatMaps, + ) +} + +// KmeshXDPAuthCompatMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshXDPAuthCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshXDPAuthCompatMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshService *ebpf.Map `ebpf:"kmesh_service"` + MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` + MapOfAuthz *ebpf.Map `ebpf:"map_of_authz"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + MapOfTuple *ebpf.Map `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.Map `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshXDPAuthCompatMaps) Close() error { + return _KmeshXDPAuthCompatClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshBackend, + m.KmeshEndpoint, + m.KmeshEvents, + m.KmeshFrontend, + m.KmeshManage, + m.KmeshService, + m.MapOfAuth, + m.MapOfAuthz, + m.MapOfSockStorage, + m.MapOfTuple, + m.MapOfWlPolicy, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshXDPAuthCompatPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshXDPAuthCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshXDPAuthCompatPrograms struct { + XdpShutdown *ebpf.Program `ebpf:"xdp_shutdown"` +} + +func (p *KmeshXDPAuthCompatPrograms) Close() error { + return _KmeshXDPAuthCompatClose( + p.XdpShutdown, + ) +} + +func _KmeshXDPAuthCompatClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshxdpauthcompat_bpfeb.o +var _KmeshXDPAuthCompatBytes []byte diff --git a/bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfel.go b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfel.go new file mode 100644 index 000000000..be34f963d --- /dev/null +++ b/bpf/kmesh/bpf2go/dualengine/kmeshxdpauthcompat_bpfel.go @@ -0,0 +1,194 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 + +package dualengine + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshXDPAuthCompatBpfSockTuple struct { + Ipv4 struct { + Saddr uint32 + Daddr uint32 + Sport uint16 + Dport uint16 + } + _ [24]byte +} + +type KmeshXDPAuthCompatBuf struct{ Data [40]int8 } + +type KmeshXDPAuthCompatLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshXDPAuthCompatManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshXDPAuthCompatSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshXDPAuthCompat returns the embedded CollectionSpec for KmeshXDPAuthCompat. +func LoadKmeshXDPAuthCompat() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshXDPAuthCompatBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshXDPAuthCompat: %w", err) + } + + return spec, err +} + +// LoadKmeshXDPAuthCompatObjects loads KmeshXDPAuthCompat and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshXDPAuthCompatObjects +// *KmeshXDPAuthCompatPrograms +// *KmeshXDPAuthCompatMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshXDPAuthCompatObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshXDPAuthCompat() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshXDPAuthCompatSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshXDPAuthCompatSpecs struct { + KmeshXDPAuthCompatProgramSpecs + KmeshXDPAuthCompatMapSpecs +} + +// KmeshXDPAuthCompatSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshXDPAuthCompatProgramSpecs struct { + XdpShutdown *ebpf.ProgramSpec `ebpf:"xdp_shutdown"` +} + +// KmeshXDPAuthCompatMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshXDPAuthCompatMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshBackend *ebpf.MapSpec `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.MapSpec `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.MapSpec `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshService *ebpf.MapSpec `ebpf:"kmesh_service"` + MapOfAuth *ebpf.MapSpec `ebpf:"map_of_auth"` + MapOfAuthz *ebpf.MapSpec `ebpf:"map_of_authz"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + MapOfTuple *ebpf.MapSpec `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.MapSpec `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshXDPAuthCompatObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshXDPAuthCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshXDPAuthCompatObjects struct { + KmeshXDPAuthCompatPrograms + KmeshXDPAuthCompatMaps +} + +func (o *KmeshXDPAuthCompatObjects) Close() error { + return _KmeshXDPAuthCompatClose( + &o.KmeshXDPAuthCompatPrograms, + &o.KmeshXDPAuthCompatMaps, + ) +} + +// KmeshXDPAuthCompatMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshXDPAuthCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshXDPAuthCompatMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshBackend *ebpf.Map `ebpf:"kmesh_backend"` + KmeshEndpoint *ebpf.Map `ebpf:"kmesh_endpoint"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshFrontend *ebpf.Map `ebpf:"kmesh_frontend"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshService *ebpf.Map `ebpf:"kmesh_service"` + MapOfAuth *ebpf.Map `ebpf:"map_of_auth"` + MapOfAuthz *ebpf.Map `ebpf:"map_of_authz"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + MapOfTuple *ebpf.Map `ebpf:"map_of_tuple"` + MapOfWlPolicy *ebpf.Map `ebpf:"map_of_wl_policy"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshXDPAuthCompatMaps) Close() error { + return _KmeshXDPAuthCompatClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshBackend, + m.KmeshEndpoint, + m.KmeshEvents, + m.KmeshFrontend, + m.KmeshManage, + m.KmeshService, + m.MapOfAuth, + m.MapOfAuthz, + m.MapOfSockStorage, + m.MapOfTuple, + m.MapOfWlPolicy, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshXDPAuthCompatPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshXDPAuthCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshXDPAuthCompatPrograms struct { + XdpShutdown *ebpf.Program `ebpf:"xdp_shutdown"` +} + +func (p *KmeshXDPAuthCompatPrograms) Close() error { + return _KmeshXDPAuthCompatClose( + p.XdpShutdown, + ) +} + +func _KmeshXDPAuthCompatClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshxdpauthcompat_bpfel.o +var _KmeshXDPAuthCompatBytes []byte diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfeb.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfeb.go new file mode 100644 index 000000000..a3e569faf --- /dev/null +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfeb.go @@ -0,0 +1,193 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package enhanced + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshSockopsBuf struct{ Data [40]int8 } + +type KmeshSockopsLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshSockopsManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshSockopsSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshSockops returns the embedded CollectionSpec for KmeshSockops. +func LoadKmeshSockops() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshSockopsBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshSockops: %w", err) + } + + return spec, err +} + +// LoadKmeshSockopsObjects loads KmeshSockops and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshSockopsObjects +// *KmeshSockopsPrograms +// *KmeshSockopsMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshSockopsObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshSockops() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshSockopsSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsSpecs struct { + KmeshSockopsProgramSpecs + KmeshSockopsMapSpecs +} + +// KmeshSockopsSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsProgramSpecs struct { + ClusterManager *ebpf.ProgramSpec `ebpf:"cluster_manager"` + FilterChainManager *ebpf.ProgramSpec `ebpf:"filter_chain_manager"` + FilterManager *ebpf.ProgramSpec `ebpf:"filter_manager"` + RouteConfigManager *ebpf.ProgramSpec `ebpf:"route_config_manager"` + SockopsProg *ebpf.ProgramSpec `ebpf:"sockops_prog"` +} + +// KmeshSockopsMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfRouterConfig *ebpf.MapSpec `ebpf:"map_of_router_config"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshSockopsObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsObjects struct { + KmeshSockopsPrograms + KmeshSockopsMaps +} + +func (o *KmeshSockopsObjects) Close() error { + return _KmeshSockopsClose( + &o.KmeshSockopsPrograms, + &o.KmeshSockopsMaps, + ) +} + +// KmeshSockopsMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfRouterConfig *ebpf.Map `ebpf:"map_of_router_config"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshSockopsMaps) Close() error { + return _KmeshSockopsClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshCluster, + m.KmeshEvents, + m.KmeshListener, + m.KmeshManage, + m.KmeshTailCallCtx, + m.KmeshTailCallProg, + m.MapOfClusterEps, + m.MapOfClusterEpsData, + m.MapOfRouterConfig, + m.MapOfSockStorage, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshSockopsPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsPrograms struct { + ClusterManager *ebpf.Program `ebpf:"cluster_manager"` + FilterChainManager *ebpf.Program `ebpf:"filter_chain_manager"` + FilterManager *ebpf.Program `ebpf:"filter_manager"` + RouteConfigManager *ebpf.Program `ebpf:"route_config_manager"` + SockopsProg *ebpf.Program `ebpf:"sockops_prog"` +} + +func (p *KmeshSockopsPrograms) Close() error { + return _KmeshSockopsClose( + p.ClusterManager, + p.FilterChainManager, + p.FilterManager, + p.RouteConfigManager, + p.SockopsProg, + ) +} + +func _KmeshSockopsClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshsockops_bpfeb.o +var _KmeshSockopsBytes []byte diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go new file mode 100644 index 000000000..3ef5f8d6f --- /dev/null +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockops_bpfel.go @@ -0,0 +1,193 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 + +package enhanced + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshSockopsBuf struct{ Data [40]int8 } + +type KmeshSockopsLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshSockopsManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshSockopsSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshSockops returns the embedded CollectionSpec for KmeshSockops. +func LoadKmeshSockops() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshSockopsBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshSockops: %w", err) + } + + return spec, err +} + +// LoadKmeshSockopsObjects loads KmeshSockops and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshSockopsObjects +// *KmeshSockopsPrograms +// *KmeshSockopsMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshSockopsObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshSockops() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshSockopsSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsSpecs struct { + KmeshSockopsProgramSpecs + KmeshSockopsMapSpecs +} + +// KmeshSockopsSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsProgramSpecs struct { + ClusterManager *ebpf.ProgramSpec `ebpf:"cluster_manager"` + FilterChainManager *ebpf.ProgramSpec `ebpf:"filter_chain_manager"` + FilterManager *ebpf.ProgramSpec `ebpf:"filter_manager"` + RouteConfigManager *ebpf.ProgramSpec `ebpf:"route_config_manager"` + SockopsProg *ebpf.ProgramSpec `ebpf:"sockops_prog"` +} + +// KmeshSockopsMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfRouterConfig *ebpf.MapSpec `ebpf:"map_of_router_config"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshSockopsObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsObjects struct { + KmeshSockopsPrograms + KmeshSockopsMaps +} + +func (o *KmeshSockopsObjects) Close() error { + return _KmeshSockopsClose( + &o.KmeshSockopsPrograms, + &o.KmeshSockopsMaps, + ) +} + +// KmeshSockopsMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfRouterConfig *ebpf.Map `ebpf:"map_of_router_config"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshSockopsMaps) Close() error { + return _KmeshSockopsClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshCluster, + m.KmeshEvents, + m.KmeshListener, + m.KmeshManage, + m.KmeshTailCallCtx, + m.KmeshTailCallProg, + m.MapOfClusterEps, + m.MapOfClusterEpsData, + m.MapOfRouterConfig, + m.MapOfSockStorage, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshSockopsPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsPrograms struct { + ClusterManager *ebpf.Program `ebpf:"cluster_manager"` + FilterChainManager *ebpf.Program `ebpf:"filter_chain_manager"` + FilterManager *ebpf.Program `ebpf:"filter_manager"` + RouteConfigManager *ebpf.Program `ebpf:"route_config_manager"` + SockopsProg *ebpf.Program `ebpf:"sockops_prog"` +} + +func (p *KmeshSockopsPrograms) Close() error { + return _KmeshSockopsClose( + p.ClusterManager, + p.FilterChainManager, + p.FilterManager, + p.RouteConfigManager, + p.SockopsProg, + ) +} + +func _KmeshSockopsClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshsockops_bpfel.o +var _KmeshSockopsBytes []byte diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfeb.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfeb.go new file mode 100644 index 000000000..9622340c1 --- /dev/null +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfeb.go @@ -0,0 +1,193 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package enhanced + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshSockopsCompatBuf struct{ Data [40]int8 } + +type KmeshSockopsCompatLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshSockopsCompatManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshSockopsCompatSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshSockopsCompat returns the embedded CollectionSpec for KmeshSockopsCompat. +func LoadKmeshSockopsCompat() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshSockopsCompatBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshSockopsCompat: %w", err) + } + + return spec, err +} + +// LoadKmeshSockopsCompatObjects loads KmeshSockopsCompat and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshSockopsCompatObjects +// *KmeshSockopsCompatPrograms +// *KmeshSockopsCompatMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshSockopsCompatObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshSockopsCompat() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshSockopsCompatSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsCompatSpecs struct { + KmeshSockopsCompatProgramSpecs + KmeshSockopsCompatMapSpecs +} + +// KmeshSockopsCompatSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsCompatProgramSpecs struct { + ClusterManager *ebpf.ProgramSpec `ebpf:"cluster_manager"` + FilterChainManager *ebpf.ProgramSpec `ebpf:"filter_chain_manager"` + FilterManager *ebpf.ProgramSpec `ebpf:"filter_manager"` + RouteConfigManager *ebpf.ProgramSpec `ebpf:"route_config_manager"` + SockopsProg *ebpf.ProgramSpec `ebpf:"sockops_prog"` +} + +// KmeshSockopsCompatMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsCompatMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfRouterConfig *ebpf.MapSpec `ebpf:"map_of_router_config"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshSockopsCompatObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsCompatObjects struct { + KmeshSockopsCompatPrograms + KmeshSockopsCompatMaps +} + +func (o *KmeshSockopsCompatObjects) Close() error { + return _KmeshSockopsCompatClose( + &o.KmeshSockopsCompatPrograms, + &o.KmeshSockopsCompatMaps, + ) +} + +// KmeshSockopsCompatMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsCompatMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfRouterConfig *ebpf.Map `ebpf:"map_of_router_config"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshSockopsCompatMaps) Close() error { + return _KmeshSockopsCompatClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshCluster, + m.KmeshEvents, + m.KmeshListener, + m.KmeshManage, + m.KmeshTailCallCtx, + m.KmeshTailCallProg, + m.MapOfClusterEps, + m.MapOfClusterEpsData, + m.MapOfRouterConfig, + m.MapOfSockStorage, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshSockopsCompatPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsCompatPrograms struct { + ClusterManager *ebpf.Program `ebpf:"cluster_manager"` + FilterChainManager *ebpf.Program `ebpf:"filter_chain_manager"` + FilterManager *ebpf.Program `ebpf:"filter_manager"` + RouteConfigManager *ebpf.Program `ebpf:"route_config_manager"` + SockopsProg *ebpf.Program `ebpf:"sockops_prog"` +} + +func (p *KmeshSockopsCompatPrograms) Close() error { + return _KmeshSockopsCompatClose( + p.ClusterManager, + p.FilterChainManager, + p.FilterManager, + p.RouteConfigManager, + p.SockopsProg, + ) +} + +func _KmeshSockopsCompatClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshsockopscompat_bpfeb.o +var _KmeshSockopsCompatBytes []byte diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfel.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfel.go new file mode 100644 index 000000000..35f994847 --- /dev/null +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshsockopscompat_bpfel.go @@ -0,0 +1,193 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 + +package enhanced + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshSockopsCompatBuf struct{ Data [40]int8 } + +type KmeshSockopsCompatLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshSockopsCompatManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshSockopsCompatSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshSockopsCompat returns the embedded CollectionSpec for KmeshSockopsCompat. +func LoadKmeshSockopsCompat() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshSockopsCompatBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshSockopsCompat: %w", err) + } + + return spec, err +} + +// LoadKmeshSockopsCompatObjects loads KmeshSockopsCompat and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshSockopsCompatObjects +// *KmeshSockopsCompatPrograms +// *KmeshSockopsCompatMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshSockopsCompatObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshSockopsCompat() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshSockopsCompatSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsCompatSpecs struct { + KmeshSockopsCompatProgramSpecs + KmeshSockopsCompatMapSpecs +} + +// KmeshSockopsCompatSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsCompatProgramSpecs struct { + ClusterManager *ebpf.ProgramSpec `ebpf:"cluster_manager"` + FilterChainManager *ebpf.ProgramSpec `ebpf:"filter_chain_manager"` + FilterManager *ebpf.ProgramSpec `ebpf:"filter_manager"` + RouteConfigManager *ebpf.ProgramSpec `ebpf:"route_config_manager"` + SockopsProg *ebpf.ProgramSpec `ebpf:"sockops_prog"` +} + +// KmeshSockopsCompatMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshSockopsCompatMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfRouterConfig *ebpf.MapSpec `ebpf:"map_of_router_config"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshSockopsCompatObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsCompatObjects struct { + KmeshSockopsCompatPrograms + KmeshSockopsCompatMaps +} + +func (o *KmeshSockopsCompatObjects) Close() error { + return _KmeshSockopsCompatClose( + &o.KmeshSockopsCompatPrograms, + &o.KmeshSockopsCompatMaps, + ) +} + +// KmeshSockopsCompatMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsCompatMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfRouterConfig *ebpf.Map `ebpf:"map_of_router_config"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshSockopsCompatMaps) Close() error { + return _KmeshSockopsCompatClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshCluster, + m.KmeshEvents, + m.KmeshListener, + m.KmeshManage, + m.KmeshTailCallCtx, + m.KmeshTailCallProg, + m.MapOfClusterEps, + m.MapOfClusterEpsData, + m.MapOfRouterConfig, + m.MapOfSockStorage, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshSockopsCompatPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshSockopsCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshSockopsCompatPrograms struct { + ClusterManager *ebpf.Program `ebpf:"cluster_manager"` + FilterChainManager *ebpf.Program `ebpf:"filter_chain_manager"` + FilterManager *ebpf.Program `ebpf:"filter_manager"` + RouteConfigManager *ebpf.Program `ebpf:"route_config_manager"` + SockopsProg *ebpf.Program `ebpf:"sockops_prog"` +} + +func (p *KmeshSockopsCompatPrograms) Close() error { + return _KmeshSockopsCompatClose( + p.ClusterManager, + p.FilterChainManager, + p.FilterManager, + p.RouteConfigManager, + p.SockopsProg, + ) +} + +func _KmeshSockopsCompatClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshsockopscompat_bpfel.o +var _KmeshSockopsCompatBytes []byte diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshtracepoint_bpfeb.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshtracepoint_bpfeb.go new file mode 100644 index 000000000..9deec1c35 --- /dev/null +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshtracepoint_bpfeb.go @@ -0,0 +1,115 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package enhanced + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +// LoadKmeshTracePoint returns the embedded CollectionSpec for KmeshTracePoint. +func LoadKmeshTracePoint() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshTracePointBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshTracePoint: %w", err) + } + + return spec, err +} + +// LoadKmeshTracePointObjects loads KmeshTracePoint and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshTracePointObjects +// *KmeshTracePointPrograms +// *KmeshTracePointMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshTracePointObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshTracePoint() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshTracePointSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshTracePointSpecs struct { + KmeshTracePointProgramSpecs + KmeshTracePointMapSpecs +} + +// KmeshTracePointSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshTracePointProgramSpecs struct { + ConnectRet *ebpf.ProgramSpec `ebpf:"connect_ret"` +} + +// KmeshTracePointMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshTracePointMapSpecs struct { +} + +// KmeshTracePointObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshTracePointObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshTracePointObjects struct { + KmeshTracePointPrograms + KmeshTracePointMaps +} + +func (o *KmeshTracePointObjects) Close() error { + return _KmeshTracePointClose( + &o.KmeshTracePointPrograms, + &o.KmeshTracePointMaps, + ) +} + +// KmeshTracePointMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshTracePointObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshTracePointMaps struct { +} + +func (m *KmeshTracePointMaps) Close() error { + return _KmeshTracePointClose() +} + +// KmeshTracePointPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshTracePointObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshTracePointPrograms struct { + ConnectRet *ebpf.Program `ebpf:"connect_ret"` +} + +func (p *KmeshTracePointPrograms) Close() error { + return _KmeshTracePointClose( + p.ConnectRet, + ) +} + +func _KmeshTracePointClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshtracepoint_bpfeb.o +var _KmeshTracePointBytes []byte diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshtracepoint_bpfel.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshtracepoint_bpfel.go new file mode 100644 index 000000000..20d20d7d9 --- /dev/null +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshtracepoint_bpfel.go @@ -0,0 +1,115 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 + +package enhanced + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +// LoadKmeshTracePoint returns the embedded CollectionSpec for KmeshTracePoint. +func LoadKmeshTracePoint() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshTracePointBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshTracePoint: %w", err) + } + + return spec, err +} + +// LoadKmeshTracePointObjects loads KmeshTracePoint and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshTracePointObjects +// *KmeshTracePointPrograms +// *KmeshTracePointMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshTracePointObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshTracePoint() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshTracePointSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshTracePointSpecs struct { + KmeshTracePointProgramSpecs + KmeshTracePointMapSpecs +} + +// KmeshTracePointSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshTracePointProgramSpecs struct { + ConnectRet *ebpf.ProgramSpec `ebpf:"connect_ret"` +} + +// KmeshTracePointMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshTracePointMapSpecs struct { +} + +// KmeshTracePointObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshTracePointObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshTracePointObjects struct { + KmeshTracePointPrograms + KmeshTracePointMaps +} + +func (o *KmeshTracePointObjects) Close() error { + return _KmeshTracePointClose( + &o.KmeshTracePointPrograms, + &o.KmeshTracePointMaps, + ) +} + +// KmeshTracePointMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshTracePointObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshTracePointMaps struct { +} + +func (m *KmeshTracePointMaps) Close() error { + return _KmeshTracePointClose() +} + +// KmeshTracePointPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshTracePointObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshTracePointPrograms struct { + ConnectRet *ebpf.Program `ebpf:"connect_ret"` +} + +func (p *KmeshTracePointPrograms) Close() error { + return _KmeshTracePointClose( + p.ConnectRet, + ) +} + +func _KmeshTracePointClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshtracepoint_bpfel.o +var _KmeshTracePointBytes []byte diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshtracepointcompat_bpfeb.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshtracepointcompat_bpfeb.go new file mode 100644 index 000000000..76bdabd1b --- /dev/null +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshtracepointcompat_bpfeb.go @@ -0,0 +1,115 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package enhanced + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +// LoadKmeshTracePointCompat returns the embedded CollectionSpec for KmeshTracePointCompat. +func LoadKmeshTracePointCompat() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshTracePointCompatBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshTracePointCompat: %w", err) + } + + return spec, err +} + +// LoadKmeshTracePointCompatObjects loads KmeshTracePointCompat and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshTracePointCompatObjects +// *KmeshTracePointCompatPrograms +// *KmeshTracePointCompatMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshTracePointCompatObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshTracePointCompat() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshTracePointCompatSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshTracePointCompatSpecs struct { + KmeshTracePointCompatProgramSpecs + KmeshTracePointCompatMapSpecs +} + +// KmeshTracePointCompatSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshTracePointCompatProgramSpecs struct { + ConnectRet *ebpf.ProgramSpec `ebpf:"connect_ret"` +} + +// KmeshTracePointCompatMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshTracePointCompatMapSpecs struct { +} + +// KmeshTracePointCompatObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshTracePointCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshTracePointCompatObjects struct { + KmeshTracePointCompatPrograms + KmeshTracePointCompatMaps +} + +func (o *KmeshTracePointCompatObjects) Close() error { + return _KmeshTracePointCompatClose( + &o.KmeshTracePointCompatPrograms, + &o.KmeshTracePointCompatMaps, + ) +} + +// KmeshTracePointCompatMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshTracePointCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshTracePointCompatMaps struct { +} + +func (m *KmeshTracePointCompatMaps) Close() error { + return _KmeshTracePointCompatClose() +} + +// KmeshTracePointCompatPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshTracePointCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshTracePointCompatPrograms struct { + ConnectRet *ebpf.Program `ebpf:"connect_ret"` +} + +func (p *KmeshTracePointCompatPrograms) Close() error { + return _KmeshTracePointCompatClose( + p.ConnectRet, + ) +} + +func _KmeshTracePointCompatClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshtracepointcompat_bpfeb.o +var _KmeshTracePointCompatBytes []byte diff --git a/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshtracepointcompat_bpfel.go b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshtracepointcompat_bpfel.go new file mode 100644 index 000000000..b0fc02813 --- /dev/null +++ b/bpf/kmesh/bpf2go/kernelnative/enhanced/kmeshtracepointcompat_bpfel.go @@ -0,0 +1,115 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 + +package enhanced + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +// LoadKmeshTracePointCompat returns the embedded CollectionSpec for KmeshTracePointCompat. +func LoadKmeshTracePointCompat() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshTracePointCompatBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshTracePointCompat: %w", err) + } + + return spec, err +} + +// LoadKmeshTracePointCompatObjects loads KmeshTracePointCompat and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshTracePointCompatObjects +// *KmeshTracePointCompatPrograms +// *KmeshTracePointCompatMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshTracePointCompatObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshTracePointCompat() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshTracePointCompatSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshTracePointCompatSpecs struct { + KmeshTracePointCompatProgramSpecs + KmeshTracePointCompatMapSpecs +} + +// KmeshTracePointCompatSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshTracePointCompatProgramSpecs struct { + ConnectRet *ebpf.ProgramSpec `ebpf:"connect_ret"` +} + +// KmeshTracePointCompatMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshTracePointCompatMapSpecs struct { +} + +// KmeshTracePointCompatObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshTracePointCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshTracePointCompatObjects struct { + KmeshTracePointCompatPrograms + KmeshTracePointCompatMaps +} + +func (o *KmeshTracePointCompatObjects) Close() error { + return _KmeshTracePointCompatClose( + &o.KmeshTracePointCompatPrograms, + &o.KmeshTracePointCompatMaps, + ) +} + +// KmeshTracePointCompatMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshTracePointCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshTracePointCompatMaps struct { +} + +func (m *KmeshTracePointCompatMaps) Close() error { + return _KmeshTracePointCompatClose() +} + +// KmeshTracePointCompatPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshTracePointCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshTracePointCompatPrograms struct { + ConnectRet *ebpf.Program `ebpf:"connect_ret"` +} + +func (p *KmeshTracePointCompatPrograms) Close() error { + return _KmeshTracePointCompatClose( + p.ConnectRet, + ) +} + +func _KmeshTracePointCompatClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshtracepointcompat_bpfel.o +var _KmeshTracePointCompatBytes []byte diff --git a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfeb.go b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfeb.go new file mode 100644 index 000000000..51c7023ae --- /dev/null +++ b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfeb.go @@ -0,0 +1,187 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package normal + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshCgroupSockBuf struct{ Data [40]int8 } + +type KmeshCgroupSockLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshCgroupSockManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshCgroupSockSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshCgroupSock returns the embedded CollectionSpec for KmeshCgroupSock. +func LoadKmeshCgroupSock() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshCgroupSockBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshCgroupSock: %w", err) + } + + return spec, err +} + +// LoadKmeshCgroupSockObjects loads KmeshCgroupSock and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshCgroupSockObjects +// *KmeshCgroupSockPrograms +// *KmeshCgroupSockMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshCgroupSockObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshCgroupSock() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshCgroupSockSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockSpecs struct { + KmeshCgroupSockProgramSpecs + KmeshCgroupSockMapSpecs +} + +// KmeshCgroupSockSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockProgramSpecs struct { + CgroupConnect4Prog *ebpf.ProgramSpec `ebpf:"cgroup_connect4_prog"` + ClusterManager *ebpf.ProgramSpec `ebpf:"cluster_manager"` + FilterChainManager *ebpf.ProgramSpec `ebpf:"filter_chain_manager"` + FilterManager *ebpf.ProgramSpec `ebpf:"filter_manager"` +} + +// KmeshCgroupSockMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshCgroupSockObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockObjects struct { + KmeshCgroupSockPrograms + KmeshCgroupSockMaps +} + +func (o *KmeshCgroupSockObjects) Close() error { + return _KmeshCgroupSockClose( + &o.KmeshCgroupSockPrograms, + &o.KmeshCgroupSockMaps, + ) +} + +// KmeshCgroupSockMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshCgroupSockMaps) Close() error { + return _KmeshCgroupSockClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshCluster, + m.KmeshEvents, + m.KmeshListener, + m.KmeshManage, + m.KmeshTailCallCtx, + m.KmeshTailCallProg, + m.MapOfClusterEps, + m.MapOfClusterEpsData, + m.MapOfSockStorage, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshCgroupSockPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockPrograms struct { + CgroupConnect4Prog *ebpf.Program `ebpf:"cgroup_connect4_prog"` + ClusterManager *ebpf.Program `ebpf:"cluster_manager"` + FilterChainManager *ebpf.Program `ebpf:"filter_chain_manager"` + FilterManager *ebpf.Program `ebpf:"filter_manager"` +} + +func (p *KmeshCgroupSockPrograms) Close() error { + return _KmeshCgroupSockClose( + p.CgroupConnect4Prog, + p.ClusterManager, + p.FilterChainManager, + p.FilterManager, + ) +} + +func _KmeshCgroupSockClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshcgroupsock_bpfeb.o +var _KmeshCgroupSockBytes []byte diff --git a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfel.go b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfel.go new file mode 100644 index 000000000..28beebe13 --- /dev/null +++ b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsock_bpfel.go @@ -0,0 +1,187 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 + +package normal + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshCgroupSockBuf struct{ Data [40]int8 } + +type KmeshCgroupSockLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshCgroupSockManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshCgroupSockSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshCgroupSock returns the embedded CollectionSpec for KmeshCgroupSock. +func LoadKmeshCgroupSock() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshCgroupSockBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshCgroupSock: %w", err) + } + + return spec, err +} + +// LoadKmeshCgroupSockObjects loads KmeshCgroupSock and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshCgroupSockObjects +// *KmeshCgroupSockPrograms +// *KmeshCgroupSockMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshCgroupSockObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshCgroupSock() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshCgroupSockSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockSpecs struct { + KmeshCgroupSockProgramSpecs + KmeshCgroupSockMapSpecs +} + +// KmeshCgroupSockSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockProgramSpecs struct { + CgroupConnect4Prog *ebpf.ProgramSpec `ebpf:"cgroup_connect4_prog"` + ClusterManager *ebpf.ProgramSpec `ebpf:"cluster_manager"` + FilterChainManager *ebpf.ProgramSpec `ebpf:"filter_chain_manager"` + FilterManager *ebpf.ProgramSpec `ebpf:"filter_manager"` +} + +// KmeshCgroupSockMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshCgroupSockObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockObjects struct { + KmeshCgroupSockPrograms + KmeshCgroupSockMaps +} + +func (o *KmeshCgroupSockObjects) Close() error { + return _KmeshCgroupSockClose( + &o.KmeshCgroupSockPrograms, + &o.KmeshCgroupSockMaps, + ) +} + +// KmeshCgroupSockMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshCgroupSockMaps) Close() error { + return _KmeshCgroupSockClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshCluster, + m.KmeshEvents, + m.KmeshListener, + m.KmeshManage, + m.KmeshTailCallCtx, + m.KmeshTailCallProg, + m.MapOfClusterEps, + m.MapOfClusterEpsData, + m.MapOfSockStorage, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshCgroupSockPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockPrograms struct { + CgroupConnect4Prog *ebpf.Program `ebpf:"cgroup_connect4_prog"` + ClusterManager *ebpf.Program `ebpf:"cluster_manager"` + FilterChainManager *ebpf.Program `ebpf:"filter_chain_manager"` + FilterManager *ebpf.Program `ebpf:"filter_manager"` +} + +func (p *KmeshCgroupSockPrograms) Close() error { + return _KmeshCgroupSockClose( + p.CgroupConnect4Prog, + p.ClusterManager, + p.FilterChainManager, + p.FilterManager, + ) +} + +func _KmeshCgroupSockClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshcgroupsock_bpfel.o +var _KmeshCgroupSockBytes []byte diff --git a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfeb.go b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfeb.go new file mode 100644 index 000000000..54aec6ca9 --- /dev/null +++ b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfeb.go @@ -0,0 +1,187 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build mips || mips64 || ppc64 || s390x + +package normal + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshCgroupSockCompatBuf struct{ Data [40]int8 } + +type KmeshCgroupSockCompatLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshCgroupSockCompatManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshCgroupSockCompatSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshCgroupSockCompat returns the embedded CollectionSpec for KmeshCgroupSockCompat. +func LoadKmeshCgroupSockCompat() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshCgroupSockCompatBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshCgroupSockCompat: %w", err) + } + + return spec, err +} + +// LoadKmeshCgroupSockCompatObjects loads KmeshCgroupSockCompat and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshCgroupSockCompatObjects +// *KmeshCgroupSockCompatPrograms +// *KmeshCgroupSockCompatMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshCgroupSockCompatObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshCgroupSockCompat() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshCgroupSockCompatSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockCompatSpecs struct { + KmeshCgroupSockCompatProgramSpecs + KmeshCgroupSockCompatMapSpecs +} + +// KmeshCgroupSockCompatSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockCompatProgramSpecs struct { + CgroupConnect4Prog *ebpf.ProgramSpec `ebpf:"cgroup_connect4_prog"` + ClusterManager *ebpf.ProgramSpec `ebpf:"cluster_manager"` + FilterChainManager *ebpf.ProgramSpec `ebpf:"filter_chain_manager"` + FilterManager *ebpf.ProgramSpec `ebpf:"filter_manager"` +} + +// KmeshCgroupSockCompatMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockCompatMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshCgroupSockCompatObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockCompatObjects struct { + KmeshCgroupSockCompatPrograms + KmeshCgroupSockCompatMaps +} + +func (o *KmeshCgroupSockCompatObjects) Close() error { + return _KmeshCgroupSockCompatClose( + &o.KmeshCgroupSockCompatPrograms, + &o.KmeshCgroupSockCompatMaps, + ) +} + +// KmeshCgroupSockCompatMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockCompatMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshCgroupSockCompatMaps) Close() error { + return _KmeshCgroupSockCompatClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshCluster, + m.KmeshEvents, + m.KmeshListener, + m.KmeshManage, + m.KmeshTailCallCtx, + m.KmeshTailCallProg, + m.MapOfClusterEps, + m.MapOfClusterEpsData, + m.MapOfSockStorage, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshCgroupSockCompatPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockCompatPrograms struct { + CgroupConnect4Prog *ebpf.Program `ebpf:"cgroup_connect4_prog"` + ClusterManager *ebpf.Program `ebpf:"cluster_manager"` + FilterChainManager *ebpf.Program `ebpf:"filter_chain_manager"` + FilterManager *ebpf.Program `ebpf:"filter_manager"` +} + +func (p *KmeshCgroupSockCompatPrograms) Close() error { + return _KmeshCgroupSockCompatClose( + p.CgroupConnect4Prog, + p.ClusterManager, + p.FilterChainManager, + p.FilterManager, + ) +} + +func _KmeshCgroupSockCompatClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshcgroupsockcompat_bpfeb.o +var _KmeshCgroupSockCompatBytes []byte diff --git a/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfel.go b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfel.go new file mode 100644 index 000000000..6533eba45 --- /dev/null +++ b/bpf/kmesh/bpf2go/kernelnative/normal/kmeshcgroupsockcompat_bpfel.go @@ -0,0 +1,187 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 + +package normal + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type KmeshCgroupSockCompatBuf struct{ Data [40]int8 } + +type KmeshCgroupSockCompatLogEvent struct { + Ret uint32 + Msg [255]int8 + _ [1]byte +} + +type KmeshCgroupSockCompatManagerKey struct { + NetnsCookie uint64 + _ [8]byte +} + +type KmeshCgroupSockCompatSockStorageData struct { + ConnectNs uint64 + Direction uint8 + ConnectSuccess uint8 + _ [6]byte +} + +// LoadKmeshCgroupSockCompat returns the embedded CollectionSpec for KmeshCgroupSockCompat. +func LoadKmeshCgroupSockCompat() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_KmeshCgroupSockCompatBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load KmeshCgroupSockCompat: %w", err) + } + + return spec, err +} + +// LoadKmeshCgroupSockCompatObjects loads KmeshCgroupSockCompat and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *KmeshCgroupSockCompatObjects +// *KmeshCgroupSockCompatPrograms +// *KmeshCgroupSockCompatMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func LoadKmeshCgroupSockCompatObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := LoadKmeshCgroupSockCompat() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// KmeshCgroupSockCompatSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockCompatSpecs struct { + KmeshCgroupSockCompatProgramSpecs + KmeshCgroupSockCompatMapSpecs +} + +// KmeshCgroupSockCompatSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockCompatProgramSpecs struct { + CgroupConnect4Prog *ebpf.ProgramSpec `ebpf:"cgroup_connect4_prog"` + ClusterManager *ebpf.ProgramSpec `ebpf:"cluster_manager"` + FilterChainManager *ebpf.ProgramSpec `ebpf:"filter_chain_manager"` + FilterManager *ebpf.ProgramSpec `ebpf:"filter_manager"` +} + +// KmeshCgroupSockCompatMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type KmeshCgroupSockCompatMapSpecs struct { + BpfLogLevel *ebpf.MapSpec `ebpf:"bpf_log_level"` + InnerMap *ebpf.MapSpec `ebpf:"inner_map"` + KmeshCluster *ebpf.MapSpec `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.MapSpec `ebpf:"kmesh_events"` + KmeshListener *ebpf.MapSpec `ebpf:"kmesh_listener"` + KmeshManage *ebpf.MapSpec `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.MapSpec `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.MapSpec `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.MapSpec `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.MapSpec `ebpf:"map_of_cluster_eps_data"` + MapOfSockStorage *ebpf.MapSpec `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.MapSpec `ebpf:"outer_map"` + TmpBuf *ebpf.MapSpec `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.MapSpec `ebpf:"tmp_log_buf"` +} + +// KmeshCgroupSockCompatObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockCompatObjects struct { + KmeshCgroupSockCompatPrograms + KmeshCgroupSockCompatMaps +} + +func (o *KmeshCgroupSockCompatObjects) Close() error { + return _KmeshCgroupSockCompatClose( + &o.KmeshCgroupSockCompatPrograms, + &o.KmeshCgroupSockCompatMaps, + ) +} + +// KmeshCgroupSockCompatMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockCompatMaps struct { + BpfLogLevel *ebpf.Map `ebpf:"bpf_log_level"` + InnerMap *ebpf.Map `ebpf:"inner_map"` + KmeshCluster *ebpf.Map `ebpf:"kmesh_cluster"` + KmeshEvents *ebpf.Map `ebpf:"kmesh_events"` + KmeshListener *ebpf.Map `ebpf:"kmesh_listener"` + KmeshManage *ebpf.Map `ebpf:"kmesh_manage"` + KmeshTailCallCtx *ebpf.Map `ebpf:"kmesh_tail_call_ctx"` + KmeshTailCallProg *ebpf.Map `ebpf:"kmesh_tail_call_prog"` + MapOfClusterEps *ebpf.Map `ebpf:"map_of_cluster_eps"` + MapOfClusterEpsData *ebpf.Map `ebpf:"map_of_cluster_eps_data"` + MapOfSockStorage *ebpf.Map `ebpf:"map_of_sock_storage"` + OuterMap *ebpf.Map `ebpf:"outer_map"` + TmpBuf *ebpf.Map `ebpf:"tmp_buf"` + TmpLogBuf *ebpf.Map `ebpf:"tmp_log_buf"` +} + +func (m *KmeshCgroupSockCompatMaps) Close() error { + return _KmeshCgroupSockCompatClose( + m.BpfLogLevel, + m.InnerMap, + m.KmeshCluster, + m.KmeshEvents, + m.KmeshListener, + m.KmeshManage, + m.KmeshTailCallCtx, + m.KmeshTailCallProg, + m.MapOfClusterEps, + m.MapOfClusterEpsData, + m.MapOfSockStorage, + m.OuterMap, + m.TmpBuf, + m.TmpLogBuf, + ) +} + +// KmeshCgroupSockCompatPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to LoadKmeshCgroupSockCompatObjects or ebpf.CollectionSpec.LoadAndAssign. +type KmeshCgroupSockCompatPrograms struct { + CgroupConnect4Prog *ebpf.Program `ebpf:"cgroup_connect4_prog"` + ClusterManager *ebpf.Program `ebpf:"cluster_manager"` + FilterChainManager *ebpf.Program `ebpf:"filter_chain_manager"` + FilterManager *ebpf.Program `ebpf:"filter_manager"` +} + +func (p *KmeshCgroupSockCompatPrograms) Close() error { + return _KmeshCgroupSockCompatClose( + p.CgroupConnect4Prog, + p.ClusterManager, + p.FilterChainManager, + p.FilterManager, + ) +} + +func _KmeshCgroupSockCompatClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed kmeshcgroupsockcompat_bpfel.o +var _KmeshCgroupSockCompatBytes []byte diff --git a/pkg/bpf/ads/sock_connection.go b/pkg/bpf/ads/sock_connection.go index e2db0b1e5..d83ed1ee5 100644 --- a/pkg/bpf/ads/sock_connection.go +++ b/pkg/bpf/ads/sock_connection.go @@ -28,7 +28,7 @@ import ( "github.com/cilium/ebpf" "github.com/cilium/ebpf/link" - "kmesh.net/kmesh/bpf/kmesh/bpf2go" + bpf2go "kmesh.net/kmesh/bpf/kmesh/bpf2go/kernelnative/normal" "kmesh.net/kmesh/daemon/options" "kmesh.net/kmesh/pkg/bpf/utils" helper "kmesh.net/kmesh/pkg/utils" diff --git a/pkg/bpf/ads/sock_ops.go b/pkg/bpf/ads/sock_ops.go index 22ec2d3d4..9e6437252 100644 --- a/pkg/bpf/ads/sock_ops.go +++ b/pkg/bpf/ads/sock_ops.go @@ -27,7 +27,7 @@ import ( "github.com/cilium/ebpf" "github.com/cilium/ebpf/link" - "kmesh.net/kmesh/bpf/kmesh/bpf2go" + bpf2go "kmesh.net/kmesh/bpf/kmesh/bpf2go/kernelnative/enhanced" "kmesh.net/kmesh/daemon/options" "kmesh.net/kmesh/pkg/bpf/utils" helper "kmesh.net/kmesh/pkg/utils" diff --git a/pkg/bpf/ads/trace_point.go b/pkg/bpf/ads/trace_point.go index 72e2849b9..0e2993272 100644 --- a/pkg/bpf/ads/trace_point.go +++ b/pkg/bpf/ads/trace_point.go @@ -23,7 +23,7 @@ import ( "github.com/cilium/ebpf" "github.com/cilium/ebpf/link" - "kmesh.net/kmesh/bpf/kmesh/bpf2go" + bpf2go "kmesh.net/kmesh/bpf/kmesh/bpf2go/kernelnative/enhanced" "kmesh.net/kmesh/daemon/options" helper "kmesh.net/kmesh/pkg/utils" ) diff --git a/pkg/bpf/workload/sendmsg.go b/pkg/bpf/workload/sendmsg.go index 7805e724e..9dfc451c8 100644 --- a/pkg/bpf/workload/sendmsg.go +++ b/pkg/bpf/workload/sendmsg.go @@ -26,7 +26,7 @@ import ( "github.com/cilium/ebpf" "github.com/cilium/ebpf/link" - "kmesh.net/kmesh/bpf/kmesh/bpf2go" + bpf2go "kmesh.net/kmesh/bpf/kmesh/bpf2go/dualengine" "kmesh.net/kmesh/daemon/options" "kmesh.net/kmesh/pkg/bpf/restart" "kmesh.net/kmesh/pkg/bpf/utils" diff --git a/pkg/bpf/workload/sock_connection.go b/pkg/bpf/workload/sock_connection.go index aa37748f2..c38f47631 100644 --- a/pkg/bpf/workload/sock_connection.go +++ b/pkg/bpf/workload/sock_connection.go @@ -27,7 +27,7 @@ import ( "github.com/cilium/ebpf" "github.com/cilium/ebpf/link" - "kmesh.net/kmesh/bpf/kmesh/bpf2go" + bpf2go "kmesh.net/kmesh/bpf/kmesh/bpf2go/dualengine" "kmesh.net/kmesh/daemon/options" "kmesh.net/kmesh/pkg/bpf/utils" "kmesh.net/kmesh/pkg/constants" diff --git a/pkg/bpf/workload/sock_ops.go b/pkg/bpf/workload/sock_ops.go index db58e8573..9d113917d 100644 --- a/pkg/bpf/workload/sock_ops.go +++ b/pkg/bpf/workload/sock_ops.go @@ -28,7 +28,7 @@ import ( "github.com/cilium/ebpf" "github.com/cilium/ebpf/link" - "kmesh.net/kmesh/bpf/kmesh/bpf2go" + bpf2go "kmesh.net/kmesh/bpf/kmesh/bpf2go/dualengine" "kmesh.net/kmesh/daemon/options" "kmesh.net/kmesh/pkg/bpf/utils" helper "kmesh.net/kmesh/pkg/utils" diff --git a/pkg/bpf/workload/xdp.go b/pkg/bpf/workload/xdp.go index 02cc77707..8b698fa00 100644 --- a/pkg/bpf/workload/xdp.go +++ b/pkg/bpf/workload/xdp.go @@ -27,7 +27,7 @@ import ( "github.com/cilium/ebpf" "github.com/cilium/ebpf/link" - "kmesh.net/kmesh/bpf/kmesh/bpf2go" + bpf2go "kmesh.net/kmesh/bpf/kmesh/bpf2go/dualengine" "kmesh.net/kmesh/daemon/options" "kmesh.net/kmesh/pkg/constants" helper "kmesh.net/kmesh/pkg/utils" diff --git a/pkg/controller/workload/bpfcache/factory.go b/pkg/controller/workload/bpfcache/factory.go index 7072d4b0e..1c2cc3396 100644 --- a/pkg/controller/workload/bpfcache/factory.go +++ b/pkg/controller/workload/bpfcache/factory.go @@ -19,7 +19,7 @@ package bpfcache import ( "istio.io/istio/pkg/util/sets" - "kmesh.net/kmesh/bpf/kmesh/bpf2go" + bpf2go "kmesh.net/kmesh/bpf/kmesh/bpf2go/dualengine" "kmesh.net/kmesh/pkg/logger" ) diff --git a/pkg/controller/workload/bpfcache/fake_map.go b/pkg/controller/workload/bpfcache/fake_map.go index 27a7ba3dc..b70086bc3 100644 --- a/pkg/controller/workload/bpfcache/fake_map.go +++ b/pkg/controller/workload/bpfcache/fake_map.go @@ -23,7 +23,7 @@ import ( "github.com/cilium/ebpf" "github.com/cilium/ebpf/rlimit" - "kmesh.net/kmesh/bpf/kmesh/bpf2go" + bpf2go "kmesh.net/kmesh/bpf/kmesh/bpf2go/dualengine" ) func NewFakeWorkloadMap(t *testing.T) bpf2go.KmeshCgroupSockWorkloadMaps { diff --git a/pkg/controller/workload/workload_processor.go b/pkg/controller/workload/workload_processor.go index 049cb0002..819b4e9ae 100644 --- a/pkg/controller/workload/workload_processor.go +++ b/pkg/controller/workload/workload_processor.go @@ -31,7 +31,7 @@ import ( "kmesh.net/kmesh/api/v2/workloadapi" "kmesh.net/kmesh/api/v2/workloadapi/security" security_v2 "kmesh.net/kmesh/api/v2/workloadapi/security" - "kmesh.net/kmesh/bpf/kmesh/bpf2go" + bpf2go "kmesh.net/kmesh/bpf/kmesh/bpf2go/dualengine" "kmesh.net/kmesh/pkg/auth" kmeshbpf "kmesh.net/kmesh/pkg/bpf/restart" maps_v2 "kmesh.net/kmesh/pkg/cache/v2/maps"