summaryrefslogtreecommitdiff
path: root/src/inc/ip_control.h
blob: c95f201f8ade9cbb23bb8379d37ef848a63e67ef (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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_ */