summaryrefslogtreecommitdiff
path: root/src/db.h
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2012-07-23 14:58:41 -0400
committerPaul Moore <pmoore@redhat.com>2012-07-25 13:04:53 -0400
commit3c19d845928884feae3b0d3cdac70d5c19893082 (patch)
tree429e78123525e61b4fc263c3a392bcb6ecf5826e /src/db.h
parent93cf1dfe0e8f4591ba038bcfc7d451f459078a9a (diff)
downloadlibseccomp-3c19d845928884feae3b0d3cdac70d5c19893082.tar.gz
api: remove the internal state and make the API context-aware
IMPORTANT: WILL CAUSE BREAKAGE WITH v0.1.x API The current API relies on the library storing internal state about the filter context. While this is okay in several cases, it may cause problems in others, e.g. threaded applications. Since the bulk of the library already operates on a filter context, known as "struct db_filter", this patch simply adds an additional parameter to the public API, exporting this context as an opaque context/handle. Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'src/db.h')
-rw-r--r--src/db.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/db.h b/src/db.h
index bcfa80f..34734c4 100644
--- a/src/db.h
+++ b/src/db.h
@@ -154,10 +154,11 @@ struct db_filter {
int db_action_valid(uint32_t action);
+void db_reset(struct db_filter *db, uint32_t def_action);
struct db_filter *db_init(const struct arch_def *arch, uint32_t def_action);
void db_release(struct db_filter *db);
-int db_attr_get(struct db_filter *db,
+int db_attr_get(const struct db_filter *db,
enum scmp_filter_attr attr, uint32_t *value);
int db_attr_set(struct db_filter *db,
enum scmp_filter_attr attr, uint32_t value);