blob: 609efe0503a28cd444e93d3ddf75f16a9e5bf8d2 (
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
58
59
60
|
/*
* 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
void *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);
int make_ip_control_wblist(black_ip* dns_black_ip,int rule_id,int risk);
int ip_control_send_pkt(struct streaminfo *stream,target_tag *flow_tag,const void *raw_pkt,int thread_seq);
#ifdef __cplusplus
}
#endif
#endif /* IP_CONTROL_H_ */
|