--- mqtt/inc/mqttd.h 2012/01/27 15:05:38 1.2 +++ mqtt/inc/mqttd.h 2012/07/03 09:02:50 1.3 @@ -2,18 +2,21 @@ #define __MQTTD_H +#define API_SERVER_SIDE +#include + + struct tagStore { - char st_qos; u_short st_msgid; mqtt_subscr_t st_subscr; - TAILQ_ENTRY(tagStore) st_node; + SLIST_ENTRY(tagStore) st_node; }; struct tagSession { - /* client session thread id */ - pthread_t sess_tid; + /* server dispatcher */ + mqtt_srv_t *sess_srv; /* client network settings */ int sess_sock; @@ -39,8 +42,8 @@ struct tagSession { char *msg; } sess_will; - /* Data Storage by QoS class */ - TAILQ_HEAD(qosStore, tagStore) sess_sndqueue; + /* session subscriptions & send pubs */ + SLIST_HEAD(tStore, tagStore) sess_subscr; TAILQ_ENTRY(tagSession) sess_node; }; @@ -49,8 +52,11 @@ 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, mtx_pub; +extern cfg_root_t cfg; + + +/* function prototypes */ +void *startSession(sched_task_t *task); #endif