summaryrefslogtreecommitdiff
path: root/src/common/sandbox.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/sandbox.h')
-rw-r--r--src/common/sandbox.h37
1 files changed, 29 insertions, 8 deletions
diff --git a/src/common/sandbox.h b/src/common/sandbox.h
index 9a61749a3f..59474c4fe8 100644
--- a/src/common/sandbox.h
+++ b/src/common/sandbox.h
@@ -40,27 +40,48 @@
#define PARAM_NUM 1
/**
- * Structure used to manage a sandbox configuration.
- *
- * It is implemented as a linked list of parameters. Currently only controls
- * parameters for open, openat, execve, stat64.
+ * Enum used to manage the type of the implementation for general purpose.
*/
-struct pfd_elem {
+typedef enum {
+ /** Libseccomp implementation based on seccomp2*/
+ LIBSECCOMP2 = 0
+} SB_IMPL;
+
+/**
+ * Configuration parameter structure associated with the LIBSECCOMP2
+ * implementation.
+ */
+typedef struct smp_param {
/** syscall associated with parameter. */
int syscall;
/** parameter index. */
int pindex;
/** parameter value. */
- intptr_t param;
+ intptr_t value;
/** parameter flag (0 = not protected, 1 = protected). */
int prot;
+} smp_param_t;
+
+/**
+ * Structure used to manage a sandbox configuration.
+ *
+ * It is implemented as a linked list of parameters. Currently only controls
+ * parameters for open, openat, execve, stat64.
+ */
+struct sandbox_cfg_elem {
+ /** Sandbox implementation which dictates the parameter type. */
+ SB_IMPL implem;
+
+ /** Configuration parameter. */
+ void *param;
- struct pfd_elem *next;
+ /** Next element of the configuration*/
+ struct sandbox_cfg_elem *next;
};
/** Typedef to structure used to manage a sandbox configuration. */
-typedef struct pfd_elem sandbox_cfg_t;
+typedef struct sandbox_cfg_elem sandbox_cfg_t;
/**
* Structure used for keeping a linked list of getaddrinfo pre-recorded