blob: 0c0b502ba0871866c59192c6db50ea6d52db1c6e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#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 *mail_server;
char *from;
char *user;
char *password;
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 */
|