Initial commit

This commit is contained in:
2020-06-17 09:06:02 +02:00
commit 9552a54c3d
12 changed files with 185 additions and 0 deletions

42
mqttauditing.c Normal file
View File

@ -0,0 +1,42 @@
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <libconfig.h>
#include <math.h>
#include "ringbuffer.h"
#include "logging.h"
extern char VERSION[];
extern uint32_t REFCNT;
config_t cfg;
void readConfig() {
config_init(&cfg);
if (! config_read_file(&cfg, "/opt/etc/mqttauditing.cfg")) {
logmsg(LOG_ERR, "failed to read config file: %s:%d - %s\n",
config_error_file(&cfg), config_error_line(&cfg),
config_error_text(&cfg));
config_destroy(&cfg);
exit(-1);
}
}
int main (void) {
fprintf(stderr, "VERSION: %s, REFCNT: %u\n", VERSION, REFCNT);
readConfig();
fprintf(stderr, "started.\n");
// will never be reached
config_destroy(&cfg);
}