version 1.2, 2012/01/27 15:05:38
|
version 1.3, 2012/07/03 09:02:50
|
Line 2
|
Line 2
|
#define __MQTTD_H |
#define __MQTTD_H |
|
|
|
|
|
#define API_SERVER_SIDE |
|
#include <mqttapi.h> |
|
|
|
|
struct tagStore { |
struct tagStore { |
char st_qos; |
|
u_short st_msgid; |
u_short st_msgid; |
|
|
mqtt_subscr_t st_subscr; |
mqtt_subscr_t st_subscr; |
|
|
TAILQ_ENTRY(tagStore) st_node; | SLIST_ENTRY(tagStore) st_node; |
}; |
}; |
|
|
struct tagSession { |
struct tagSession { |
/* client session thread id */ | /* server dispatcher */ |
pthread_t sess_tid; | mqtt_srv_t *sess_srv; |
|
|
/* client network settings */ |
/* client network settings */ |
int sess_sock; |
int sess_sock; |
Line 39 struct tagSession {
|
Line 42 struct tagSession {
|
char *msg; |
char *msg; |
} sess_will; |
} sess_will; |
|
|
/* Data Storage by QoS class */ | /* session subscriptions & send pubs */ |
TAILQ_HEAD(qosStore, tagStore) sess_sndqueue; | SLIST_HEAD(tStore, tagStore) sess_subscr; |
|
|
TAILQ_ENTRY(tagSession) sess_node; |
TAILQ_ENTRY(tagSession) sess_node; |
}; |
}; |
Line 49 typedef TAILQ_HEAD(, tagSession) sessions_t;
|
Line 52 typedef TAILQ_HEAD(, tagSession) sessions_t;
|
|
|
extern sessions_t Sessions; |
extern sessions_t Sessions; |
extern sched_root_task_t *root; |
extern sched_root_task_t *root; |
extern sl_config cfg; | extern cfg_root_t cfg; |
extern pthread_mutex_t mtx_sess, mtx_pub; | |
| |
| /* function prototypes */ |
| void *startSession(sched_task_t *task); |
|
|
|
|
#endif |
#endif |