From 16346c99a674d95970cfc59b0aa5d00e91cc4e0f Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Tue, 16 May 2023 18:05:46 +0200 Subject: filter: refactoring filter Attempt to simplify the filter build: - storing all the bpf_args in a common array and saving the index of each entry in filter_input - added new flag to filter_add_arg for append an argument to an entry - split large loop in filter_build in multiple functions - adjust and refactor tests/units/test_filter The tests in test_filter_build.c still need to be fixed --- tests/unit/testutil.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/unit/testutil.h') diff --git a/tests/unit/testutil.h b/tests/unit/testutil.h index 638dd0a..4f104ac 100644 --- a/tests/unit/testutil.h +++ b/tests/unit/testutil.h @@ -55,7 +55,8 @@ struct args_target { bool open_path; int fd; int nr; - struct arg args[6]; + bool filter_args[6]; + struct bpf_arg args[6]; void *targs[6]; int (*install_filter)(struct args_target *at); int (*target)(void *); -- cgit v1.2.3