recorder/udata.h

52 lines
1.6 KiB
C
Raw Normal View History

2015-08-15 01:46:46 -07:00
#ifndef UDATA_H_INCLUDED
# define UDATA_H_INCLUDED
2015-09-17 23:23:10 -07:00
#include "json.h"
2015-08-14 09:40:35 -07:00
2015-09-28 10:04:37 -07:00
#ifdef WITH_HTTP
2015-08-27 14:42:18 -07:00
# include "mongoose.h"
#endif
2016-02-22 05:09:57 -07:00
#include "gcache.h"
2015-08-27 14:42:18 -07:00
2015-08-14 09:40:35 -07:00
struct udata {
2015-09-17 23:23:10 -07:00
JsonNode *topics; /* Array of topics to subscribe to */
2015-08-14 09:40:35 -07:00
int ignoreretained; /* True if retained messages should be ignored */
2016-02-19 08:31:32 -07:00
#if WITH_MQTT
2015-08-14 09:40:35 -07:00
char *pubprefix; /* If not NULL (default), republish modified payload to <pubprefix>/topic */
2016-02-19 08:31:32 -07:00
int qos; /* Subscribe QoS */
char *hostname; /* MQTT broker */
int port; /* MQTT port */
char *username; /* MQTT user */
char *password; /* MQTT password */
2016-02-25 10:59:48 -07:00
char *clientid; /* MQTT clientid */
2016-02-25 23:38:46 -07:00
char *cafile; /* path to CA PEM for MQTT */
2016-02-19 08:31:32 -07:00
#endif
2015-08-14 09:40:35 -07:00
int skipdemo; /* True if _demo users are to be skipped */
int revgeo; /* True (default) if we should do reverse Geo lookups */
int verbose; /* TRUE if print verbose messages to stdout */
2015-10-23 08:03:19 -07:00
int norec; /* If TRUE, no .REC files are written to */
2015-09-01 04:31:49 -07:00
struct gcache *gc;
2015-09-24 04:18:16 -07:00
struct gcache *t2t; /* topic to tid */
2015-09-28 10:04:37 -07:00
#ifdef WITH_HTTP
struct mg_server *mgserver; /* Mongoose */
char *http_host; /* address of http bind */
int http_port; /* port number for above */
2016-03-03 11:05:44 -07:00
char *http_logdir; /* full path to http access log */
2015-08-27 14:42:18 -07:00
#endif
2015-09-19 07:11:53 -07:00
#ifdef WITH_LUA
char *luascript; /* Path to Lua script */
2015-09-19 07:11:53 -07:00
struct luadata *luadata; /* Lua stuff */
2015-09-25 08:43:17 -07:00
struct gcache *luadb; /* lmdb named database 'luadb' */
2016-01-24 05:39:10 -07:00
#endif
#ifdef WITH_ENCRYPT
struct gcache *keydb; /* encryption keys */
2015-09-19 07:11:53 -07:00
#endif
char *label; /* Server label */
char *geokey; /* Google reverse-geo API key */
2016-01-28 01:39:42 -07:00
int debug; /* enable for debugging */
2016-02-23 04:05:46 -07:00
struct gcache *httpfriends; /* lmdb named database 'friends' */
2015-08-14 09:40:35 -07:00
};
2015-08-15 01:46:46 -07:00
#endif