[101] | 1 | /*
|
---|
| 2 | * TOPPERS ECHONET Lite Communication Middleware
|
---|
| 3 | *
|
---|
| 4 | * Copyright (C) 2015 Cores Co., Ltd. Japan
|
---|
| 5 | *
|
---|
| 6 | * ãLì ÒÍCȺÌ(1)`(4)Ìðð½·êÉÀèC{\tgEF
|
---|
| 7 | * Ai{\tgEFAðüϵ½àÌðÜÞDȺ¯¶jðgpE¡»Eü
|
---|
| 8 | * ÏEÄzziȺCpÆÄÔj·é±Æð³Åø·éD
|
---|
| 9 | * (1) {\tgEFAð\[XR[hÌ`Åp·éêÉÍCãLÌì
|
---|
| 10 | * \¦C±Ìpð¨æѺL̳ÛØKèªC»ÌÜÜÌ`Å\[
|
---|
| 11 | * XR[hÉÜÜêÄ¢é±ÆD
|
---|
| 12 | * (2) {\tgEFAðCCu`®ÈÇC¼Ì\tgEFAJÉg
|
---|
| 13 | * pÅ«é`ÅÄzz·éêÉÍCÄzzɺ¤hL
|
---|
| 14 | gip
|
---|
| 15 | * Ò}j
|
---|
| 16 | AÈÇjÉCãLÌì \¦C±Ìpð¨æѺL
|
---|
| 17 | * ̳ÛØKèðfÚ·é±ÆD
|
---|
| 18 | * (3) {\tgEFAðC@íÉgÝÞÈÇC¼Ì\tgEFAJÉg
|
---|
| 19 | * pÅ«È¢`ÅÄzz·éêÉÍCÌ¢¸ê©Ìðð½·±
|
---|
| 20 | * ÆD
|
---|
| 21 | * (a) Äzzɺ¤hL
|
---|
| 22 | gipÒ}j
|
---|
| 23 | AÈÇjÉCãLÌ
|
---|
| 24 | * ì \¦C±Ìpð¨æѺL̳ÛØKèðfÚ·é±ÆD
|
---|
| 25 | * (b) ÄzzÌ`ÔðCÊÉèßéû@ÉæÁÄCTOPPERSvWFNgÉ
|
---|
| 26 | * ñ·é±ÆD
|
---|
| 27 | * (4) {\tgEFAÌpÉæè¼ÚIܽÍÔÚIɶ¶é¢©Èé¹
|
---|
| 28 | * Q©çàCãLì Ò¨æÑTOPPERSvWFNgðÆÓ·é±ÆD
|
---|
| 29 | * ܽC{\tgEFAÌ[UܽÍGh[U©çÌ¢©Èé
|
---|
| 30 | * RÉîÿ©çàCãLì Ò¨æÑTOPPERSvWFNgð
|
---|
| 31 | * ÆÓ·é±ÆD
|
---|
| 32 | *
|
---|
| 33 | * {\tgEFAÍC³ÛØÅñ³êÄ¢éàÌÅ éDãLì Ò¨
|
---|
| 34 | * æÑTOPPERSvWFNgÍC{\tgEFAÉÖµÄCÁèÌgpÚI
|
---|
| 35 | * ÉηéK«àÜßÄC¢©ÈéÛØàsíÈ¢DܽC{\tgEF
|
---|
| 36 | * AÌpÉæè¼ÚIܽÍÔÚIɶ¶½¢©Èé¹QÉÖµÄàC»
|
---|
| 37 | * ÌÓCðíÈ¢D
|
---|
| 38 | *
|
---|
| 39 | * @(#) $Id: wamp_router.h 101 2015-06-02 15:37:23Z coas-nagasima $
|
---|
| 40 | */
|
---|
| 41 |
|
---|
| 42 | #ifndef WAMP_ROUTER_H
|
---|
| 43 | #define WAMP_ROUTER_H
|
---|
| 44 |
|
---|
| 45 | typedef enum wamp_router_roles {
|
---|
| 46 | WAMP_ROUTER_ROLES_PUBLISHER = 1,
|
---|
| 47 | WAMP_ROUTER_ROLES_SUBSCRIBER = 2,
|
---|
| 48 | WAMP_ROUTER_ROLES_CALLER = 4,
|
---|
| 49 | WAMP_ROUTER_ROLES_CALLEE = 8,
|
---|
| 50 | WAMP_ROUTER_ROLES_IN_GETTING = 0x80,
|
---|
| 51 | } wamp_router_roles_t;
|
---|
| 52 |
|
---|
| 53 | typedef struct wamp_session
|
---|
| 54 | {
|
---|
| 55 | struct wamp_router *router;
|
---|
| 56 | int id;
|
---|
| 57 | char realm[80];
|
---|
| 58 | wamp_router_roles_t roles;
|
---|
| 59 | } wamp_session_t;
|
---|
| 60 |
|
---|
| 61 | typedef struct wamp_router
|
---|
| 62 | {
|
---|
| 63 | struct wamp_state *s;
|
---|
| 64 | wamp_session_t sessions[1];
|
---|
| 65 | wamp_session_t *current_session;
|
---|
| 66 | int session_id;
|
---|
| 67 | } wamp_router_t;
|
---|
| 68 |
|
---|
| 69 | wamp_session_t *wamp_router_hello(wamp_router_t *router);
|
---|
| 70 | void wamp_router_hello_realm(wamp_router_t *router, const char *value);
|
---|
| 71 | void wamp_router_hello_details_param(wamp_router_t *router, jsonsl_action_t action,
|
---|
| 72 | struct jsonsl_state_st *state, const char *buf);
|
---|
| 73 | void wamp_router_hello_details(wamp_router_t *router);
|
---|
| 74 | void wamp_router_hello_close(struct wamp_state *s);
|
---|
| 75 |
|
---|
| 76 | void wamp_router_authenticate(wamp_router_t *router);
|
---|
| 77 | void wamp_router_authenticate_signature(wamp_router_t *router, const char *value);
|
---|
| 78 | void wamp_router_authenticate_extra(wamp_router_t *router, const char *value);
|
---|
| 79 | void wamp_router_authenticate_extra_param(wamp_router_t *router, jsonsl_action_t action,
|
---|
| 80 | struct jsonsl_state_st *state, const char *buf);
|
---|
| 81 | void wamp_router_authenticate_close(struct wamp_state *s);
|
---|
| 82 |
|
---|
| 83 | void wamp_router_goodbye(wamp_router_t *router);
|
---|
| 84 | void wamp_router_goodbye_details_param(wamp_router_t *router, jsonsl_action_t action,
|
---|
| 85 | struct jsonsl_state_st *state, const char *buf);
|
---|
| 86 | void wamp_router_goodbye_details(wamp_router_t *router);
|
---|
| 87 | void wamp_router_goodbye_reason(wamp_router_t *router, const char *value);
|
---|
| 88 | void wamp_router_goodbye_close(struct wamp_state *s);
|
---|
| 89 |
|
---|
| 90 | #endif // WAMP_ROUTER_H
|
---|