1 | /*
|
---|
2 | * TOPPERS ECHONET Lite Communication Middleware
|
---|
3 | *
|
---|
4 | * Copyright (C) 2015 Cores Co., Ltd. Japan
|
---|
5 | *
|
---|
6 | * 上記著作権者は,以下の(1)〜(4)の条件を満たす場合に限り,本ソフトウェ
|
---|
7 | * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
|
---|
8 | * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
|
---|
9 | * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
|
---|
10 | * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
|
---|
11 | * スコード中に含まれていること.
|
---|
12 | * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
|
---|
13 | * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
|
---|
14 | * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
|
---|
15 | * の無保証規定を掲載すること.
|
---|
16 | * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
|
---|
17 | * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
|
---|
18 | * と.
|
---|
19 | * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
|
---|
20 | * 作権表示,この利用条件および下記の無保証規定を掲載すること.
|
---|
21 | * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
|
---|
22 | * 報告すること.
|
---|
23 | * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
|
---|
24 | * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
|
---|
25 | * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
|
---|
26 | * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
|
---|
27 | * 免責すること.
|
---|
28 | *
|
---|
29 | * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
|
---|
30 | * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
|
---|
31 | * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
|
---|
32 | * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
|
---|
33 | * の責任を負わない.
|
---|
34 | *
|
---|
35 | * @(#) $Id: wamp_router.h 108 2015-06-11 09:15:46Z coas-nagasima $
|
---|
36 | */
|
---|
37 |
|
---|
38 | #ifndef WAMP_ROUTER_H
|
---|
39 | #define WAMP_ROUTER_H
|
---|
40 |
|
---|
41 | typedef enum wamp_router_roles {
|
---|
42 | WAMP_ROUTER_ROLES_PUBLISHER = 1,
|
---|
43 | WAMP_ROUTER_ROLES_SUBSCRIBER = 2,
|
---|
44 | WAMP_ROUTER_ROLES_CALLER = 4,
|
---|
45 | WAMP_ROUTER_ROLES_CALLEE = 8,
|
---|
46 | WAMP_ROUTER_ROLES_IN_GETTING = 0x80,
|
---|
47 | } wamp_router_roles_t;
|
---|
48 |
|
---|
49 | typedef struct wamp_session
|
---|
50 | {
|
---|
51 | struct wamp_router *router;
|
---|
52 | int id;
|
---|
53 | char realm[80];
|
---|
54 | wamp_router_roles_t roles;
|
---|
55 | } wamp_session_t;
|
---|
56 |
|
---|
57 | typedef struct wamp_router
|
---|
58 | {
|
---|
59 | struct wamp_state *s;
|
---|
60 | wamp_session_t sessions[1];
|
---|
61 | wamp_session_t *current_session;
|
---|
62 | int session_id;
|
---|
63 | } wamp_router_t;
|
---|
64 |
|
---|
65 | wamp_session_t *wamp_router_hello(wamp_router_t *router);
|
---|
66 | void wamp_router_hello_realm(wamp_router_t *router, const char *value);
|
---|
67 | void wamp_router_hello_details_param(wamp_router_t *router, jsonsl_action_t action,
|
---|
68 | struct jsonsl_state_st *state, const char *buf);
|
---|
69 | void wamp_router_hello_details(wamp_router_t *router);
|
---|
70 | void wamp_router_hello_close(struct wamp_state *s);
|
---|
71 |
|
---|
72 | void wamp_router_authenticate(wamp_router_t *router);
|
---|
73 | void wamp_router_authenticate_signature(wamp_router_t *router, const char *value);
|
---|
74 | void wamp_router_authenticate_extra(wamp_router_t *router, const char *value);
|
---|
75 | void wamp_router_authenticate_extra_param(wamp_router_t *router, jsonsl_action_t action,
|
---|
76 | struct jsonsl_state_st *state, const char *buf);
|
---|
77 | void wamp_router_authenticate_close(struct wamp_state *s);
|
---|
78 |
|
---|
79 | void wamp_router_goodbye(wamp_router_t *router);
|
---|
80 | void wamp_router_goodbye_details_param(wamp_router_t *router, jsonsl_action_t action,
|
---|
81 | struct jsonsl_state_st *state, const char *buf);
|
---|
82 | void wamp_router_goodbye_details(wamp_router_t *router);
|
---|
83 | void wamp_router_goodbye_reason(wamp_router_t *router, const char *value);
|
---|
84 | void wamp_router_goodbye_close(struct wamp_state *s);
|
---|
85 |
|
---|
86 | #endif // WAMP_ROUTER_H
|
---|