--- mqtt/inc/mqttd.h 2011/12/14 12:45:30 1.1.2.5 +++ mqtt/inc/mqttd.h 2012/07/03 09:02:50 1.3 @@ -2,8 +2,11 @@ #define __MQTTD_H +#define API_SERVER_SIDE +#include + + struct tagStore { - char st_qos; u_short st_msgid; mqtt_subscr_t st_subscr; @@ -12,8 +15,8 @@ struct tagStore { }; struct tagSession { - /* client session thread id */ - pthread_t sess_tid; + /* server dispatcher */ + mqtt_srv_t *sess_srv; /* client network settings */ int sess_sock; @@ -39,19 +42,21 @@ struct tagSession { char *msg; } sess_will; - /* Data Storage by QoS class */ - SLIST_HEAD(qosStore, tagStore) sess_store[MQTT_QOS_RESERVED]; + /* session subscriptions & send pubs */ + SLIST_HEAD(tStore, tagStore) sess_subscr; TAILQ_ENTRY(tagSession) sess_node; }; - typedef TAILQ_HEAD(, tagSession) sessions_t; extern sessions_t Sessions; extern sched_root_task_t *root; -extern sl_config cfg; -extern pthread_mutex_t mtx_sess; +extern cfg_root_t cfg; + + +/* function prototypes */ +void *startSession(sched_task_t *task); #endif