aboutsummaryrefslogtreecommitdiffstats
path: root/src/cyn.h
diff options
context:
space:
mode:
authorJose Bollo <jose.bollo@iot.bzh>2018-09-19 14:52:03 +0200
committerJose Bollo <jose.bollo@iot.bzh>2018-09-20 23:39:57 +0200
commit4123ffb189acd0c18cddd0df75a58cbc3276ad80 (patch)
treea393e83dce5f57c7db0ab5475841c86829468ebe /src/cyn.h
parent7ae3477d84ae13c5e9ef9bb1980a8f70f8b7e9bf (diff)
Add session, value as string and expiration
The DB now records sessions. It has expiration management (currently coarse: ~16s, see db.c) that is propagated to caches. Values are now strings. Default values are "yes" and "no" for allowed or denied permissions. new program: cynadm Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/cyn.h')
-rw-r--r--src/cyn.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/cyn.h b/src/cyn.h
index df08a5a..379deef 100644
--- a/src/cyn.h
+++ b/src/cyn.h
@@ -18,9 +18,9 @@
#pragma once
-#define DENY 0
-#define ALLOW 1
-#define ASK 2
+#define DENY "no"
+#define ALLOW "yes"
+#define ASK "ask"
#define DEFAULT DENY
/** enter critical recoverable section */
@@ -45,7 +45,8 @@ cyn_set(
const char *session,
const char *user,
const char *permission,
- uint32_t value
+ const char *value,
+ time_t expire
);
extern
@@ -64,7 +65,8 @@ cyn_test(
const char *session,
const char *user,
const char *permission,
- uint32_t *value
+ const char **value,
+ time_t *expire
);
extern
@@ -77,7 +79,8 @@ cyn_list(
const char *session,
const char *user,
const char *permission,
- uint32_t value),
+ const char *value,
+ time_t expire),
const char *client,
const char *session,
const char *user,
@@ -87,7 +90,7 @@ cyn_list(
extern
int
cyn_check_async(
- void (*check_cb)(void *closure, uint32_t value),
+ void (*check_cb)(void *closure, const char *value, time_t expire),
void *closure,
const char *client,
const char *session,