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
|
2016-12-07 11:40:59 -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
|
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 */
|
2016-02-25 09:29:39 -07:00
|
|
|
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 */
|
2017-03-13 09:33:20 -07:00
|
|
|
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 */
|
2015-08-19 08:27:49 -07:00
|
|
|
int revgeo; /* True (default) if we should do reverse Geo lookups */
|
2015-09-21 02:34:00 -07:00
|
|
|
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
|
2015-09-03 10:11:20 -07:00
|
|
|
struct mg_server *mgserver; /* Mongoose */
|
2016-02-25 09:29:39 -07:00
|
|
|
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 */
|
2016-09-12 01:10:36 -07:00
|
|
|
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
|
2016-02-25 09:29:39 -07:00
|
|
|
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
|
2016-01-22 14:42:30 -07:00
|
|
|
struct gcache *keydb; /* encryption keys */
|
2015-09-19 07:11:53 -07:00
|
|
|
#endif
|
2015-10-01 03:06:00 -07:00
|
|
|
char *label; /* Server label */
|
2018-05-04 00:34:02 -07:00
|
|
|
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' */
|
2016-12-07 11:40:59 -07:00
|
|
|
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
|