recorder/udata.h

61 lines
2.0 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
2016-07-18 07:37:28 -07:00
# include <stdarg.h>
2015-08-27 14:42:18 -07:00
# include "mongoose.h"
#endif
// #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
2016-09-07 00:18:49 -07:00
struct mosquitto *mosq; /* MQTT connection */
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 */
char *capath; /* CA path */
char *certfile; /* certificate (client) */
char *keyfile; /* client key */
2017-05-17 02:15:19 -07:00
char *identity; /* PSK identity (hint) */
char *psk; /* PSK */
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 */
char *browser_apikey; /* Google maps browser API key */
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; /* 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' */
struct gcache *wpdb; /* lmdb named database 'wp' (waypoints) */
2015-08-14 09:40:35 -07:00
};
2015-08-15 01:46:46 -07:00
#endif