Initial commit
This commit is contained in:
42
mqttauditing.c
Normal file
42
mqttauditing.c
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user