+/* declaration of wsreq structure */
+struct afb_wsreq
+{
+ /*
+ * CAUTION: 'context' field should be the first because there
+ * is an implicit convertion to struct afb_context
+ */
+ struct afb_context context;
+ int refcount;
+ struct afb_ws_json1 *aws;
+ struct afb_wsreq *next;
+ struct afb_wsj1_msg *msgj1;
+};
+
+/* interface for afb_ws_json1 / afb_wsj1 */
+static struct afb_wsj1_itf wsj1_itf = {
+ .on_hangup = (void*)aws_on_hangup,
+ .on_call = (void*)aws_on_call
+};
+
+/* interface for wsreq / afb_req */
+const struct afb_req_itf afb_ws_json1_req_itf = {
+ .json = (void*)wsreq_json,
+ .get = (void*)wsreq_get,
+ .success = (void*)wsreq_success,
+ .fail = (void*)wsreq_fail,
+ .raw = (void*)wsreq_raw,
+ .send = (void*)wsreq_send,
+ .context_get = (void*)afb_context_get,
+ .context_set = (void*)afb_context_set,
+ .addref = (void*)wsreq_addref,
+ .unref = (void*)wsreq_unref,
+ .session_close = (void*)afb_context_close,
+ .session_set_LOA = (void*)afb_context_change_loa,
+ .subscribe = (void*)wsreq_subscribe,
+ .unsubscribe = (void*)wsreq_unsubscribe,
+ .subcall = (void*)wsreq_subcall
+};
+
+/* the interface for events */
+static const struct afb_evt_itf evt_itf = {
+ .broadcast = (void*)aws_on_event,
+ .push = (void*)aws_on_event
+};
+
+/***************************************************************
+****************************************************************
+**
+** functions of afb_ws_json1 / afb_wsj1
+**
+****************************************************************
+***************************************************************/