diff options
author | Alice Frosi <afrosi@redhat.com> | 2023-04-18 14:49:58 +0200 |
---|---|---|
committer | Alice Frosi <afrosi@redhat.com> | 2023-04-18 14:49:58 +0200 |
commit | dc3f0a74bcf166d792d360de050276f3e354c111 (patch) | |
tree | 9a541af66c7310084b46e3b4f6b599c566abbeaa | |
parent | 4cc38c6516e248fe28ddf409c900b6c6bbc50bf8 (diff) | |
download | seitan-dc3f0a74bcf166d792d360de050276f3e354c111.tar seitan-dc3f0a74bcf166d792d360de050276f3e354c111.tar.gz seitan-dc3f0a74bcf166d792d360de050276f3e354c111.tar.bz2 seitan-dc3f0a74bcf166d792d360de050276f3e354c111.tar.lz seitan-dc3f0a74bcf166d792d360de050276f3e354c111.tar.xz seitan-dc3f0a74bcf166d792d360de050276f3e354c111.tar.zst seitan-dc3f0a74bcf166d792d360de050276f3e354c111.zip |
filter: clean-up unused functions
-rw-r--r-- | cooker/filter.c | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/cooker/filter.c b/cooker/filter.c index 9cc9595..e77c609 100644 --- a/cooker/filter.c +++ b/cooker/filter.c @@ -163,16 +163,6 @@ static unsigned get_n_args_syscall_entry(const struct bpf_call *entry) return n; } -static unsigned get_n_args_syscall(const struct syscall_entry *table) -{ - unsigned i, n = 0; - - for (i = 0; i < table->count; i++) - n += get_n_args_syscall_entry(table->entry + i); - - return n; -} - static unsigned int get_n_args_syscall_instr(const struct syscall_entry *table) { const struct bpf_call *entry; @@ -227,17 +217,6 @@ static unsigned int get_n_args_syscall_instr(const struct syscall_entry *table) return total_instr; } -static unsigned int get_total_args_instr(const struct syscall_entry table[], - unsigned int n_syscall) -{ - unsigned i, n = 0; - - for (i = 0; i < n_syscall; i++) { - n += get_n_args_syscall_instr(&table[i]); - } - return n; -} - static bool check_args_syscall_entry(const struct bpf_call *entry){ return entry->args[0].cmp != NO_CHECK || entry->args[1].cmp != NO_CHECK || @@ -440,23 +419,20 @@ unsigned int create_bfp_program(struct syscall_entry table[], unsigned int n_syscall) { unsigned int offset_left, offset_right; + unsigned int n_nodes, notify, accept; + unsigned int next_offset, offset; const struct bpf_call *entry; - unsigned int n_args, n_nodes; - unsigned int notify, accept; - unsigned int i, j, k; unsigned int size = 0; - unsigned int next_offset, offset; unsigned int next_args_off; - unsigned n_checks; int nodes[MAX_JUMPS]; + unsigned int i, j, k; + unsigned n_checks; create_lookup_nodes(nodes, n_syscall); /* No nodes if there is a single syscall */ n_nodes = (1 << count_shift_right(n_syscall - 1)) - 1; - n_args = get_total_args_instr(table, n_syscall); - /* Pre */ /* cppcheck-suppress badBitmaskCheck */ filter[size++] = (struct sock_filter)BPF_STMT( |