--- mqtt/inc/defs.h 2011/11/21 12:16:11 1.1.1.1.2.2 +++ mqtt/inc/defs.h 2011/12/12 09:24:24 1.1.1.1.2.19 @@ -2,15 +2,48 @@ #define __DEFS_H -#define STRSIZ 256 +#define STRSIZ 256 +#define MAX_CONNID 24 +#define MAX_CRED 13 +#define MQTTMSG_MAX 65529 +#define WILDCARDS "/#+" +#define MQTT_CONNFLGS_INIT { 1, 1, 1, 3, 1, 1, 1 } -#define LOGERR { \ - mqtt_Errno = errno; \ - strlcpy(mqtt_Error, strerror(errno), sizeof mqtt_Error); \ - } +#define MQTT_DATA_MAX 268435455 +#define MQTT_CONN_STR "MQIsdp" +#define MQTT_PROTO_VER 3 +#define MQTT_KEEPALIVE 10 +#define DEFAULT_RETRY 1 +#define DEFAULT_CONFIG "/etc/mqtt.conf" +#define MQTT_PORT "1883" +#define MQTT_HOST "localhost" +#define MQTT_USER "mqtt" + +#define VERB(x) if ((x) <= Verbose) +#define FTRACE(x) VERB((x)) syslog(LOG_DEBUG, "I'm in %s(%d)", __func__, __LINE__); + +#define LOGERR { \ + mqtt_Errno = errno; \ + strlcpy(mqtt_Error, strerror(errno), sizeof mqtt_Error); \ + } + + +extern int mqtt_Errno; +extern char mqtt_Error[STRSIZ]; +extern struct tagCallbacks call; + +extern char cliCmd[], *cliStr[]; + inline void mqtt_SetErr(int eno, char *estr, ...); +inline struct mqtthdr *_mqtt_readHEADER(mqtt_msg_t * __restrict, u_char, int *, int *); + +extern int Verbose, Kill; + +extern struct tagCallbacks call; +extern sqlite3 *acc, *pub; +extern FILE *logg; #endif