summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/seccomp.h.in14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/seccomp.h.in b/include/seccomp.h.in
index 333a89c..6f836fb 100644
--- a/include/seccomp.h.in
+++ b/include/seccomp.h.in
@@ -25,6 +25,7 @@
#include <elf.h>
#include <inttypes.h>
+#include <stdlib.h>
#include <asm/unistd.h>
#include <linux/audit.h>
#include <linux/types.h>
@@ -816,6 +817,19 @@ int seccomp_export_pfc(const scmp_filter_ctx ctx, int fd);
*/
int seccomp_export_bpf(const scmp_filter_ctx ctx, int fd);
+/**
+ * Generate seccomp Berkeley Packet Filter (BPF) code and export it to a buffer
+ * @param ctx the filter context
+ * @param buf the destination buffer
+ * @param len on input the length of the buffer, on output the number of bytes
+ * in the program
+ *
+ * This function generates seccomp Berkeley Packer Filter (BPF) code and writes
+ * it to the given buffer. Returns zero on success, negative values on failure.
+ *
+ */
+int seccomp_export_bpf_mem(const scmp_filter_ctx ctx, void *buf, size_t *len);
+
/*
* pseudo syscall definitions
*/