summaryrefslogtreecommitdiff
path: root/include/ir_mctrl.h
blob: 1fceab6d08a7cc6b8b8a36d0bbb347bb42ac701b (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
61
62
63
64
65
#ifndef IR_MCTRL_H
#define IR_MCTRL_H

#define MAX_STRING_LEN                64
#define MAX_PORT_LEN                  6
#define MAX_PATH_LEN                  64
#define MAX_TABLE_NAME_LEN            64
#define MAX_TIME_LEN				  50
#define	HTABLE_DATA_LEN				  512

#define MCTRL_CONF_FILE				"./conf/redis.conf"

//table name
#define NOMINEE_IP					"IR_NOMINEE_IP"
#define INTERCEPT_IP				"IR_INTERCEPT_IP"
#define STATIC_NOMINEE_IP 			"IR_STATIC_NOMINEE_IP"
#define DYNAMIC_NOMINEE_IP			"IR_DYNAMIC_NOMINEE_IP"
#define CANDIDATE_IP				"IR_CANDIDATE_IP"

#define TIME_OUT						30
#define MAX_THREAD_NUM                1


//htable flag
#define	S_OR_D_ORIGIN_FLAG				8
#define INTERCEPT_FLAG					4
#define NOMINEE_FLAG					2
#define CANDIDATE_FLAG					1

#define O_AND_C_FLAG					9
#define O_AND_N_FLAG					10
#define O_AND_C_AND_N_FLAG				11
#define O_AND_I_FLAG					12
#define O_AND_C_AND_I_FLAG				13
#define O_AND_I_AND_N_FLAG				14
#define ALL_EXIST_FLAG					15

struct IR_MCTRL_INFO
{
	int region_id; 
	int group_id; 
	int addr_type;
	char src_ip[MAX_STRING_LEN];
	char mask_src_ip[MAX_STRING_LEN];
	char src_port[MAX_PORT_LEN];
	char mask_src_port[MAX_PORT_LEN];
	char dst_ip[MAX_STRING_LEN];
	char mask_dst_ip[MAX_STRING_LEN];
	char dst_port[MAX_PORT_LEN];
	char mask_dst_port[MAX_PORT_LEN];
	int procotol;
	int direction;
	int is_valid;
	int action;
	int service;
	int addr_pool_id;
	char effective_range[MAX_STRING_LEN];
	char user_region[MAX_STRING_LEN];
	char op_time[MAX_TIME_LEN]; 
	int htable_flag;
	
};

#endif