74 lines
1.3 KiB
C
74 lines
1.3 KiB
C
#ifndef CONF_H
|
|
#define CONF_H
|
|
|
|
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
#include <stddef.h>
|
|
#include <string.h>
|
|
|
|
#define WHITELIST_IP_NUM 1024
|
|
|
|
typedef struct CONF
|
|
{
|
|
char *DAEMON;
|
|
int TIME;
|
|
|
|
// 磁盘使用率
|
|
int IS_DISK;
|
|
int DISK_USE;
|
|
|
|
// 杀毒
|
|
int CLAMAV;
|
|
char *CLAMAV_TIME;
|
|
int CLAMAV_TIME_LEN;
|
|
char *CLAMAV_ARG;
|
|
int CLAMAV_ARG_LEN;
|
|
|
|
int IS_BLOCKED;
|
|
int REFUSE_NUMBER;
|
|
|
|
// 获取公网IP Url地址
|
|
char *PUBLIC_IP;
|
|
|
|
// 地域白名单
|
|
int REGION;
|
|
int IP2REGION;
|
|
char *REGION_URL;
|
|
int REGION_URL_LEN;
|
|
char *REGION_LIST;
|
|
int REGION_LIST_LEN;
|
|
|
|
// IPV4 白名单
|
|
int IPV4_RESTRICTION;
|
|
char *IPV4_WHITE_LIST;
|
|
int IPV4_WHITE_LIST_LEN;
|
|
|
|
// NGINX
|
|
int NGINX;
|
|
char *NGINX_LOG_FILE;
|
|
int NGINX_LOG_FILE_LEN;
|
|
char *NGINX_REGION_LIST;
|
|
int NGINX_REGION_LIST_LEN;
|
|
|
|
int IS_MAIL;
|
|
|
|
// 钉钉
|
|
int IS_DING_WEBHOOK;
|
|
char *PHONE;
|
|
char *DING_WEBHOOK;
|
|
|
|
// 第三方邮箱
|
|
int IS_QQMAIL;
|
|
//char *SEND_QQ;
|
|
//char *QQMAIL_KEY;
|
|
char *RECV_MAIL;
|
|
} conf;
|
|
|
|
void read_conf(char *filename, conf * configure);
|
|
void free_conf(conf * conf);
|
|
void ptintf_conf(conf * conf);
|
|
void split_string(char string[], char delims[], char (*whitelist_ip)[WHITELIST_IP_NUM]);
|
|
|
|
#endif
|