+
+extern void afb_xreq_fail(struct afb_xreq *xreq, const char *status, const char *info);
+extern void afb_xreq_fail_f(struct afb_xreq *xreq, const char *status, const char *info, ...);
+extern void afb_xreq_fail_unknown_api(struct afb_xreq *xreq);
+extern void afb_xreq_fail_unknown_verb(struct afb_xreq *xreq);
+
+extern const char *afb_xreq_raw(struct afb_xreq *xreq, size_t *size);
+
+extern int afb_xreq_subscribe(struct afb_xreq *xreq, struct afb_eventid *eventid);
+extern int afb_xreq_unsubscribe(struct afb_xreq *xreq, struct afb_eventid *eventid);
+
+extern void afb_xreq_subcall(
+ struct afb_xreq *xreq,
+ const char *api,
+ const char *verb,
+ struct json_object *args,
+ void (*callback)(void*, int, struct json_object*, struct afb_request *),
+ void *cb_closure);
+extern void afb_xreq_unhooked_subcall(
+ struct afb_xreq *xreq,
+ const char *api,
+ const char *verb,
+ struct json_object *args,
+ void (*callback)(void*, int, struct json_object*, struct afb_request *),
+ void *cb_closure);
+
+extern int afb_xreq_unhooked_subcall_sync(
+ struct afb_xreq *xreq,
+ const char *api,
+ const char *verb,
+ struct json_object *args,
+ struct json_object **result);
+extern int afb_xreq_subcall_sync(
+ struct afb_xreq *xreq,
+ const char *api,
+ const char *verb,
+ struct json_object *args,
+ struct json_object **result);
+
+/* initialisation and processing of xreq */
+extern void afb_xreq_init(struct afb_xreq *xreq, const struct afb_xreq_query_itf *queryitf);
+
+extern void afb_xreq_process(struct afb_xreq *xreq, struct afb_apiset *apiset);
+
+extern void afb_xreq_call_verb_v1(struct afb_xreq *xreq, const struct afb_verb_desc_v1 *verb);
+extern void afb_xreq_call_verb_v2(struct afb_xreq *xreq, const struct afb_verb_v2 *verb);
+extern void afb_xreq_call_verb_vdyn(struct afb_xreq *xreq, const struct afb_api_dyn_verb *verb);
+
+static inline struct afb_request *xreq_to_request(struct afb_xreq *xreq)
+{
+ return &xreq->request;
+}
+
+static inline struct afb_xreq *xreq_from_request(struct afb_request *request)
+{
+ return CONTAINER_OF(struct afb_xreq, request, request);
+}
+