diff options
Diffstat (limited to 'src/inc/ip_control.h')
| -rw-r--r-- | src/inc/ip_control.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/inc/ip_control.h b/src/inc/ip_control.h new file mode 100644 index 0000000..c95f201 --- /dev/null +++ b/src/inc/ip_control.h @@ -0,0 +1,57 @@ +/* + * ip_control.h + * + * Created on: 2015年5月26日 + * Author: byte + */ + +#ifndef IP_CONTROL_H_ +#define IP_CONTROL_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define IPC_WHITE_IP_TYPE 1 +#define IPC_BLACK_IP_TYPE 2 + +typedef struct black_ip_t{ + int thread_num;//线程号 仅DNS使用 + int ip_type;//IP地址类型 IPC_WHITE_IP_TYPE/IPC_BLACK_IP_TYPE 仅DNS使用 + int ip_num;//黑IP个数 + unsigned int ipv4[MAX_IP_NUM];//解析出的IP地址 仅DNS使用 +}black_ip; + +typedef struct target_tag_t +{ + int type;//业务类型 + int rule_id;//规则ID + short risk;//告警级别 + char id[22];//唯一日志ID + black_ip *dns_ip;//仅DNS使用 +}target_tag; + + +/* +* name:make_ip_control_wblist +* functionality:add white or black list +* param: +* [IN]: +* stream:stream info +* thread_num:the thread num +* rule_id:Maat result config_id +* risk:alarm risk +* type:IPC_WHITE_IP_TYPE or IPC_BLACK_IP_TYPE +* [OUT]: none +* returns: +* >0,success; +* <=0, there is error +* */ +//wblist:white black list +int make_ip_control_wblist(struct streaminfo* stream,int thread_num,int rule_id,int risk,int type); + +#ifdef __cplusplus +} +#endif +#endif /* IP_CONTROL_H_ */ |
