version 1.1, 2011/12/08 14:52:47
|
version 1.2, 2012/01/27 15:05:38
|
Line 0
|
Line 1
|
|
#ifndef __MQTTD_H |
|
#define __MQTTD_H |
|
|
|
|
|
struct tagStore { |
|
char st_qos; |
|
u_short st_msgid; |
|
|
|
mqtt_subscr_t st_subscr; |
|
|
|
TAILQ_ENTRY(tagStore) st_node; |
|
}; |
|
|
|
struct tagSession { |
|
/* client session thread id */ |
|
pthread_t sess_tid; |
|
|
|
/* client network settings */ |
|
int sess_sock; |
|
u_short sess_ka; |
|
/* client send retry in miliseconds, if client not receive message */ |
|
u_int sess_retry; |
|
/* message work buffer */ |
|
mqtt_msg_t *sess_buf; |
|
|
|
/* authentication user info */ |
|
char sess_cid[MAX_CONNID]; |
|
char sess_user[MAX_CRED]; |
|
char sess_pass[MAX_CRED]; |
|
char sess_addr[64]; |
|
|
|
/* connect flags */ |
|
char sess_clean; |
|
struct { |
|
char flag; |
|
char qos; |
|
char retain; |
|
char *topic; |
|
char *msg; |
|
} sess_will; |
|
|
|
/* Data Storage by QoS class */ |
|
TAILQ_HEAD(qosStore, tagStore) sess_sndqueue; |
|
|
|
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, mtx_pub; |
|
|
|
|
|
#endif |