diff options
| author | arf20 <aruizfernandez05@gmail.com> | 2025-10-28 13:45:38 +0100 |
|---|---|---|
| committer | arf20 <aruizfernandez05@gmail.com> | 2025-10-28 13:45:38 +0100 |
| commit | 1fa9b6e34e5c92aa7fe492417cda2d21ec067ff8 (patch) | |
| tree | 3d8f8c28cbc0d5d8632c72449a4a45bdab278425 /config.h | |
| parent | 52dc621b426fcb55ef3887e67de08a612b15480d (diff) | |
| download | arfnet2-status-master.tar.gz arfnet2-status-master.zip | |
Diffstat (limited to 'config.h')
| -rw-r--r-- | config.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/config.h b/config.h new file mode 100644 index 0000000..dbcfb97 --- /dev/null +++ b/config.h @@ -0,0 +1,37 @@ +#ifndef _CONFIG_H +#define _CONFIG_H + +#include <time.h> + + +#define BUFF_SIZE 65535 +#define INIT_VEC_CAPACITY 256 +#define CONFIG_PATH "monitor.cfg" + +#define DEFAULT_PORT 8888 +#define DEFAULT_INTERVAL 60 +#define DEFAULT_LOG_PATH "events.log" + +/* config types */ +typedef struct { + time_t interval; + char *target_config; +} monitor_config_t; + +typedef struct { + char *from; + char *alert_config; +} alert_config_t; + + +/* config objects */ +extern unsigned short port; +extern char *log_path; +extern monitor_config_t monitor_config; +extern alert_config_t alert_config; + + +int config_load(const char *conf_path); + +#endif /* _CONFIG_H */ + |
