X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-xreq.h;h=ccd79c4edba4a20cadfea11f3409cd0e9188eeef;hb=65353dce81a629e042800bb7b86fcd869a76727e;hp=f1945a02133c26e7b76f6d849b031ab52c20949c;hpb=ec0564bc90b3c63f7e82f09e81db8bd2cfac89a2;p=src%2Fapp-framework-binder.git diff --git a/src/afb-xreq.h b/src/afb-xreq.h index f1945a02..ccd79c4e 100644 --- a/src/afb-xreq.h +++ b/src/afb-xreq.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2019 "IoT.bzh" + * Copyright (C) 2015-2020 "IoT.bzh" * Author José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -59,8 +59,6 @@ struct afb_xreq int hookflags; /**< flags for hooking */ int hookindex; /**< hook index of the request if hooked */ #endif - struct afb_evt_listener *listener; /**< event listener for the request */ - struct afb_cred *cred; /**< client credential if revelant */ struct afb_xreq *caller; /**< caller request if any */ }; @@ -97,8 +95,12 @@ extern struct json_object *afb_xreq_json(struct afb_xreq *xreq); extern void afb_xreq_reply(struct afb_xreq *xreq, struct json_object *obj, const char *error, const char *info); extern void afb_xreq_reply_f(struct afb_xreq *xreq, struct json_object *obj, const char *error, const char *info, ...); -extern void afb_xreq_reply_unknown_api(struct afb_xreq *xreq); -extern void afb_xreq_reply_unknown_verb(struct afb_xreq *xreq); +extern int afb_xreq_reply_unknown_api(struct afb_xreq *xreq); +extern int afb_xreq_reply_unknown_verb(struct afb_xreq *xreq); + +extern int afb_xreq_reply_invalid_token(struct afb_xreq *xreq); +extern int afb_xreq_reply_insufficient_scope(struct afb_xreq *xreq, const char *scope); + extern const char *afb_xreq_raw(struct afb_xreq *xreq, size_t *size);