summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorlijie <[email protected]>2019-01-22 20:18:52 +0800
committerlijie <[email protected]>2019-01-22 20:18:52 +0800
commit8fd0a24f86624b3c985038e60887b32e41b0559e (patch)
treedf102d89dd9b78e7ca26f132f75dbf27364e4591 /include
parenta558cf074391f1f4b3581c9a4b5d6c6241d21c28 (diff)
添加Ip location功能,同时修复读取redis数据,当进行删除操作时内存泄漏问题
Diffstat (limited to 'include')
-rw-r--r--include/mrl_main.h16
-rw-r--r--include/mrl_utils.h9
2 files changed, 17 insertions, 8 deletions
diff --git a/include/mrl_main.h b/include/mrl_main.h
index 8ccae5e..70f6039 100644
--- a/include/mrl_main.h
+++ b/include/mrl_main.h
@@ -20,11 +20,11 @@ struct mrl_global_cfg
char mrl_log_path[MRL_MAX_PATH];
int mrl_log_level;
- //detect info
- //TODO �¸��汾��Ҫ������̨̽���������һ̨����һ̨����
- char dest_ip[MRL_STR_IP_LEN];
- uint16_t dest_port;
- uint16_t local_port;
+ //detect server info
+ char inside_detect_ip[MRL_STR_IP_LEN];
+ char outside_detect_ip[MRL_STR_IP_LEN];
+ uint16_t detect_port;
+ uint16_t local_port;
//socket info
char mgw_ip[MRL_STR_IP_LEN];
@@ -50,8 +50,10 @@ struct mrl_global_cfg
unsigned int ht_max_element_num;
unsigned int ht_mutex_num;
- //candidate info
- char ip_location[MRL_LOCATION_LEN];
+ //ip location info
+ unsigned int ip_location_enable;//0--close;1--enable
+ unsigned int ip_location_level;//0--contruny;1--province
+ char ip_location_name[MRL_LOCATION_NAME_LEN];
//vxlan_info
char link_identity_path[MRL_MAX_PATH];
diff --git a/include/mrl_utils.h b/include/mrl_utils.h
index c08e887..43368cd 100644
--- a/include/mrl_utils.h
+++ b/include/mrl_utils.h
@@ -23,7 +23,7 @@
#define MRL_DATE_LEN 50
-#define MRL_LOCATION_LEN 20
+#define MRL_LOCATION_NAME_LEN 20
#define MRL_MAX_PATH 50
#define MRL_IPV4_TYPE 4
@@ -52,6 +52,13 @@
#define MRL_INVALID 0
#define MRL_VALID 1
+#define MRL_CLOSED_LOCATION -1
+#define MRL_INSIDE_LOCATION 0
+#define MRL_OUTSIDE_LOCATION 1
+
+#define MRL_COUNTRY_LEVEL 0
+#define MRL_PROVINCE_LEVEL 1
+
#define MRL_ADD_DNAT_NOMINEE 0
#define MRL_DEL_DNAT_NOMINEE 1