These new verbs are now available to plugins.
LOA is the level-of-authorisation.
The usage of these new verbs must be protected
by a mechanism that is still to be done.
Change-Id: Ia591fb6bf9cd16956dc95658c5ba3a24ee4380be
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
void (*addref)(void *closure);
void (*unref)(void *closure);
+
+ void (*session_close)(void *closure);
+ void (*session_set_LOA)(void *closure, unsigned level);
};
struct afb_req {
return req.itf->unref(req.closure);
}
+static inline void afb_req_session_close(struct afb_req req)
+{
+ return req.itf->session_close(req.closure);
+}
+
+static inline void afb_req_session_set_LOA(struct afb_req req, unsigned level)
+{
+ return req.itf->session_set_LOA(req.closure, level);
+}
+
#include <stdlib.h>
static inline struct afb_req *afb_req_store(struct afb_req req)
.context_get = (void*)afb_context_get,
.context_set = (void*)afb_context_set,
.addref = (void*)afb_hreq_addref,
- .unref = (void*)afb_hreq_unref
+ .unref = (void*)afb_hreq_unref,
+ .session_close = (void*)afb_context_close,
+ .session_set_LOA = (void*)afb_context_change_loa
};
static struct hreq_data *get_data(struct afb_hreq *hreq, const char *key, int create)
.context_get = (void*)afb_context_get,
.context_set = (void*)afb_context_set,
.addref = (void*)wsreq_addref,
- .unref = (void*)wsreq_unref
+ .unref = (void*)wsreq_unref,
+ .session_close = (void*)afb_context_close,
+ .session_set_LOA = (void*)afb_context_change_loa
};
static int aws_wsreq_parse(struct afb_wsreq *r, char *text, size_t size)