Export print_seccomp_fprog for further use in parser of ptrace syscall
* defs.h (print_seccomp_fprog): New prototype.
* seccomp.c (print_seccomp_fprog): Remove "static" keyword.
Move printing of struct seccomp_fprog fields ...
(print_seccomp_filter): ... here.
diff --git a/seccomp.c b/seccomp.c
index 5d972f9..4d8d7e4 100644
--- a/seccomp.c
+++ b/seccomp.c
@@ -171,11 +171,9 @@
return true;
}
-static void
+void
print_seccomp_fprog(struct tcb *tcp, unsigned long addr, unsigned short len)
{
- tprintf("{len=%u, filter=", len);
-
if (abbrev(tcp)) {
printaddr(addr);
} else {
@@ -185,8 +183,6 @@
print_array(tcp, addr, len, &filter, sizeof(filter),
umoven_or_printaddr, print_bpf_filter, &insns);
}
-
- tprints("}");
}
#include "seccomp_fprog.h"
@@ -196,8 +192,11 @@
{
struct seccomp_fprog fprog;
- if (fetch_seccomp_fprog(tcp, addr, &fprog))
+ if (fetch_seccomp_fprog(tcp, addr, &fprog)) {
+ tprintf("{len=%hu, filter=", fprog.len);
print_seccomp_fprog(tcp, fprog.filter, fprog.len);
+ tprints("}");
+ }
}
static void