summaryrefslogtreecommitdiff
path: root/src/ir_mctrl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir_mctrl.h')
-rw-r--r--src/ir_mctrl.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/src/ir_mctrl.h b/src/ir_mctrl.h
new file mode 100644
index 0000000..2e58d2b
--- /dev/null
+++ b/src/ir_mctrl.h
@@ -0,0 +1,89 @@
+#ifndef IR_MCTRL_H
+#define IR_MCTRL_H
+
+#include "MESA_handle_logger.h"
+#include "Maat_rule.h"
+#include "Maat_command.h"
+#include "MESA_htable.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/mctrl.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 1800
+#define MAX_THREAD_NUM 1
+
+//nominee_type
+#define STATIC_NOMINEE 1
+#define DYNAMIC_NOMINEE 2
+
+//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;
+ int nominee_type;
+ int version;
+};
+
+struct mctrl_glocal_info
+{
+ void *logger_handle;
+ Maat_feather_t d_feather;
+ Maat_feather_t s_feather;
+ Maat_feather_t n_feather;
+ Maat_feather_t i_feather;
+ MESA_htable_handle s_d_htable;
+ int update_type_s;
+ int update_type_d;
+ int version_s;
+ int version_d;
+};
+
+
+#endif
+