aboutsummaryrefslogtreecommitdiffstats
path: root/include/afb/afb-binding-v2.h
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-05-19 10:42:21 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-05-19 23:04:44 +0200
commit248ba86f06b1903fff3e0538d7b06c02610b4806 (patch)
tree21d524816ba34ce998407b2b48c367d4de06c4b4 /include/afb/afb-binding-v2.h
parente000e3b73ee0582882324e504fe2dae7386534f8 (diff)
Bindings V2: Refactor session flags
Change-Id: Idb104b3db69d785b11446fe9b66084839290362f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'include/afb/afb-binding-v2.h')
-rw-r--r--include/afb/afb-binding-v2.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/include/afb/afb-binding-v2.h b/include/afb/afb-binding-v2.h
index 19bff05a..d869dc6e 100644
--- a/include/afb/afb-binding-v2.h
+++ b/include/afb/afb-binding-v2.h
@@ -19,6 +19,8 @@
#include <stdint.h>
+#include "afb-session-v2.h"
+
struct afb_service;
struct afb_daemon;
struct afb_binding_v2;
@@ -43,7 +45,7 @@ struct afb_verb_v2
{
const char *verb; /* name of the verb */
void (*callback)(struct afb_req req); /* callback function implementing the verb */
- const struct afb_auth *auth; /* required authorisation */
+ const struct afb_auth *auth; /* required authorisation */
uint32_t session; /* authorisation and session requirements of the verb */
};
@@ -78,3 +80,33 @@ struct afb_binding_v2
# define AFB_DEBUG_V2(daemon,...) do{if(afbBindingV2verbosity>=3)afb_daemon_verbose(daemon,7,NULL,0,__VA_ARGS__);}while(0)
# endif
#endif
+
+#if AFB_BINDING_VERSION == 2
+
+# define afb_binding afb_binding_v2
+# define afb_binding_interface afb_binding_interface_v2
+
+# define AFB_SESSION_NONE AFB_SESSION_NONE_V2
+# define AFB_SESSION_CLOSE AFB_SESSION_CLOSE_V2
+# define AFB_SESSION_RENEW AFB_SESSION_REFRESH_V2
+# define AFB_SESSION_REFRESH AFB_SESSION_REFRESH_V2
+# define AFB_SESSION_CHECK AFB_SESSION_CHECK_V2
+
+# define AFB_SESSION_LOA_MASK AFB_SESSION_LOA_MASK_V2
+
+# define AFB_SESSION_LOA_0 AFB_SESSION_LOA_0_V2
+# define AFB_SESSION_LOA_1 AFB_SESSION_LOA_1_V2
+# define AFB_SESSION_LOA_2 AFB_SESSION_LOA_2_V2
+# define AFB_SESSION_LOA_3 AFB_SESSION_LOA_3_V2
+
+# if !defined(AFB_BINDING_PRAGMA_NO_VERBOSE_MACRO)
+
+# define ERROR AFB_ERROR_V2
+# define WARNING AFB_WARNING_V2
+# define NOTICE AFB_NOTICE_V2
+# define INFO AFB_INFO_V2
+# define DEBUG AFB_DEBUG_V2
+
+# endif
+
+#endif