Return to mqttd.h CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / mqtt / inc |
1.2 misho 1: #ifndef __MQTTD_H
2: #define __MQTTD_H
3:
4:
5: struct tagStore {
6: char st_qos;
7: u_short st_msgid;
8:
9: mqtt_subscr_t st_subscr;
10:
11: TAILQ_ENTRY(tagStore) st_node;
12: };
13:
14: struct tagSession {
15: /* client session thread id */
16: pthread_t sess_tid;
1.2.2.2 ! misho 17: pthread_mutex_t sess_mtx;
1.2.2.1 misho 18: /* server dispatcher */
19: mqtt_srv_t *sess_srv;
1.2 misho 20:
21: /* client network settings */
22: int sess_sock;
23: u_short sess_ka;
24: /* client send retry in miliseconds, if client not receive message */
25: u_int sess_retry;
26: /* message work buffer */
27: mqtt_msg_t *sess_buf;
28:
29: /* authentication user info */
30: char sess_cid[MAX_CONNID];
31: char sess_user[MAX_CRED];
32: char sess_pass[MAX_CRED];
33: char sess_addr[64];
34:
35: /* connect flags */
36: char sess_clean;
37: struct {
38: char flag;
39: char qos;
40: char retain;
41: char *topic;
42: char *msg;
43: } sess_will;
44:
45: /* Data Storage by QoS class */
46: TAILQ_HEAD(qosStore, tagStore) sess_sndqueue;
47:
48: TAILQ_ENTRY(tagSession) sess_node;
49: };
50: typedef TAILQ_HEAD(, tagSession) sessions_t;
51:
52:
53: extern sessions_t Sessions;
54: extern sched_root_task_t *root;
55: extern sl_config cfg;
56: extern pthread_mutex_t mtx_sess, mtx_pub;
57:
58:
59: #endif