From: Vitaly _Vi Shukela <[email protected]>

---
 include/seccomp.h.in |  9 +++++++++
 src/api.c            | 16 ++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/include/seccomp.h.in b/include/seccomp.h.in
index b21205c..055f806 100644
--- a/include/seccomp.h.in
+++ b/include/seccomp.h.in
@@ -25,6 +25,7 @@
 #include <inttypes.h>
 #include <asm/unistd.h>
 #include <linux/audit.h>
+#include <stdarg.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -389,6 +390,10 @@ int seccomp_syscall_priority(scmp_filter_ctx ctx,
 int seccomp_rule_add(scmp_filter_ctx ctx,
                     uint32_t action, int syscall, unsigned int arg_cnt, ...);
 
+/** va_list analogue of seccomp_rule_add */
+int vseccomp_rule_add(scmp_filter_ctx ctx,
+                    uint32_t action, int syscall, unsigned int arg_cnt, 
va_list arg_list);
+
 /**
  * Add a new rule to the filter
  * @param ctx the filter context
@@ -407,6 +412,10 @@ int seccomp_rule_add(scmp_filter_ctx ctx,
 int seccomp_rule_add_exact(scmp_filter_ctx ctx, uint32_t action,
                           int syscall, unsigned int arg_cnt, ...);
 
+/** va_list analogue of seccomp_rule_add_exact */
+int vseccomp_rule_add_exact(scmp_filter_ctx ctx, uint32_t action,
+                          int syscall, unsigned int arg_cnt, va_list arg_list);
+
 /**
  * Generate seccomp Pseudo Filter Code (PFC) and export it to a file
  * @param ctx the filter context
diff --git a/src/api.c b/src/api.c
index 5072afc..f0de914 100644
--- a/src/api.c
+++ b/src/api.c
@@ -477,6 +477,14 @@ int seccomp_rule_add(scmp_filter_ctx ctx,
 }
 
 /* NOTE - function header comment in include/seccomp.h */
+int vseccomp_rule_add(scmp_filter_ctx ctx,
+                    uint32_t action, int syscall, unsigned int arg_cnt, 
va_list arg_list)
+{
+    return _seccomp_rule_add((struct db_filter_col *)ctx,
+                              0, action, syscall, arg_cnt, arg_list);
+}
+
+/* NOTE - function header comment in include/seccomp.h */
 int seccomp_rule_add_exact(scmp_filter_ctx ctx, uint32_t action,
                           int syscall, unsigned int arg_cnt, ...)
 {
@@ -492,6 +500,14 @@ int seccomp_rule_add_exact(scmp_filter_ctx ctx, uint32_t 
action,
 }
 
 /* NOTE - function header comment in include/seccomp.h */
+int vseccomp_rule_add_exact(scmp_filter_ctx ctx,
+                    uint32_t action, int syscall, unsigned int arg_cnt, 
va_list arg_list)
+{
+    return _seccomp_rule_add((struct db_filter_col *)ctx,
+                              1, action, syscall, arg_cnt, arg_list);
+}
+
+/* NOTE - function header comment in include/seccomp.h */
 int seccomp_export_pfc(const scmp_filter_ctx ctx, int fd)
 {
        if (_ctx_valid(ctx))
-- 
1.7.11.6.1.gada05e2


------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
libseccomp-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libseccomp-discuss

Reply via email to