version 1.2.2.8, 2012/04/27 10:07:50
|
version 1.2.2.12, 2012/06/01 10:39:48
|
Line 14 struct tagStore {
|
Line 14 struct tagStore {
|
SLIST_ENTRY(tagStore) st_node; |
SLIST_ENTRY(tagStore) st_node; |
}; |
}; |
|
|
|
struct tagPkt { |
|
ait_val_t *pkt_data; |
|
|
|
SLIST_ENTRY(tagPkt) pkt_node; |
|
}; |
|
|
struct tagSession { |
struct tagSession { |
/* client session thread id */ |
|
pthread_t sess_tid; |
|
pthread_mutex_t sess_mtx; |
|
/* server dispatcher */ |
/* server dispatcher */ |
mqtt_srv_t *sess_srv; |
mqtt_srv_t *sess_srv; |
|
|
Line 45 struct tagSession {
|
Line 48 struct tagSession {
|
char *msg; |
char *msg; |
} sess_will; |
} sess_will; |
|
|
/* session subscriptions */ | /* session subscriptions & send pubs */ |
SLIST_HEAD(tStore, tagStore) sess_subscr; |
SLIST_HEAD(tStore, tagStore) sess_subscr; |
|
SLIST_HEAD(tPkt, tagPkt) sess_sndpkt; |
|
|
TAILQ_ENTRY(tagSession) sess_node; |
TAILQ_ENTRY(tagSession) sess_node; |
}; |
}; |
typedef TAILQ_HEAD(, tagSession) sessions_t; |
typedef TAILQ_HEAD(, tagSession) sessions_t; |
#define SESS_ELEM_LOCK(x) pthread_mutex_lock(&(x)->sess_mtx) |
|
#define SESS_ELEM_UNLOCK(x) pthread_mutex_unlock(&(x)->sess_mtx) |
|
#define SESS_LOCK pthread_mutex_lock(&mtx_sess) |
|
#define SESS_UNLOCK pthread_mutex_unlock(&mtx_sess) |
|
|
|
struct tagPub { |
|
ait_val_t pub_name; |
|
mqtt_msg_t pub_packet; |
|
|
|
TAILQ_ENTRY(tagPub) pub_node; |
|
}; |
|
typedef TAILQ_HEAD(, tagPub) pubs_t; |
|
#define PUBS_LOCK pthread_mutex_lock(&mtx_pub) |
|
#define PUBS_UNLOCK pthread_mutex_unlock(&mtx_pub) |
|
|
|
|
|
extern sessions_t Sessions; |
extern sessions_t Sessions; |
extern pubs_t Pubs; |
|
extern sched_root_task_t *root; |
extern sched_root_task_t *root; |
extern cfg_root_t cfg; |
extern cfg_root_t cfg; |
extern pthread_mutex_t mtx_sess, mtx_pub; | |
| |
| /* function prototypes */ |
| void *startSession(sched_task_t *task); |
|
|
|
|
#endif |
#endif |