diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:39:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:39:49 +0000 |
commit | a0aa2307322cd47bbf416810ac0292925e03be87 (patch) | |
tree | 37076262a026c4b48c8a0e84f44ff9187556ca35 /ebpf/Makefile.am | |
parent | Initial commit. (diff) | |
download | suricata-a0aa2307322cd47bbf416810ac0292925e03be87.tar.xz suricata-a0aa2307322cd47bbf416810ac0292925e03be87.zip |
Adding upstream version 1:7.0.3.upstream/1%7.0.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ebpf/Makefile.am')
-rw-r--r-- | ebpf/Makefile.am | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ebpf/Makefile.am b/ebpf/Makefile.am new file mode 100644 index 0000000..ad32efd --- /dev/null +++ b/ebpf/Makefile.am @@ -0,0 +1,31 @@ +EXTRA_DIST= include bypass_filter.c filter.c lb.c vlan_filter.c xdp_filter.c \ + xdp_lb.c bpf_helpers.h hash_func01.h + +if BUILD_EBPF + +# Maintaining a local copy of UAPI linux/bpf.h +BPF_CFLAGS = -Iinclude + +BPF_TARGETS = lb.bpf +BPF_TARGETS += filter.bpf +BPF_TARGETS += bypass_filter.bpf +BPF_TARGETS += xdp_filter.bpf +BPF_TARGETS += xdp_lb.bpf +BPF_TARGETS += vlan_filter.bpf + +all: $(BPF_TARGETS) + + +$(BPF_TARGETS): %.bpf: %.c +# From C-code to LLVM-IR format suffix .ll (clang -S -emit-llvm) + ${CLANG} -Wall $(BPF_CFLAGS) -O2 \ + -I/usr/include/$(build_cpu)-$(build_os)/ \ + -D__KERNEL__ -D__ASM_SYSREG_H \ + -target bpf -S -emit-llvm $< -o ${@:.bpf=.ll} +# From LLVM-IR to BPF-bytecode in ELF-obj file + ${LLC} -march=bpf -filetype=obj ${@:.bpf=.ll} -o $@ + ${RM} ${@:.bpf=.ll} + +CLEANFILES = *.bpf *.ll + +endif |