diff --git a/src/tsg_entry.h b/src/tsg_entry.h index f94f989..210172b 100644 --- a/src/tsg_entry.h +++ b/src/tsg_entry.h @@ -280,6 +280,7 @@ typedef struct tsg_para int app_dict_field_num; int device_seq_in_dc; int datacenter_id; + int hash_switch; int hash_timeout; int hash_slot_size; int feature_tamper; diff --git a/src/tsg_gtp_signaling.cpp b/src/tsg_gtp_signaling.cpp index 9cfab94..d0dc79b 100644 --- a/src/tsg_gtp_signaling.cpp +++ b/src/tsg_gtp_signaling.cpp @@ -8,7 +8,7 @@ #include "tsg_entry.h" #include "tsg_gtp_signaling.h" -MESA_htable_handle g_gtp_signaling_hash_handle; +MESA_htable_handle g_gtp_signaling_hash_handle=NULL; static int is_gtp_tunnel(const struct streaminfo *a_stream) @@ -136,6 +136,11 @@ int tsg_get_umts_user_info(const struct streaminfo *a_stream, struct umts_user_i int ret=0; unsigned int uplink=0,downlink=0; + if(g_tsg_para.hash_switch==0) + { + return 0; + } + if(*user_info!=NULL) { return 1; @@ -170,6 +175,13 @@ int tsg_get_umts_user_info(const struct streaminfo *a_stream, struct umts_user_i int tsg_gtp_signaling_hash_init(const char* conffile, void *logger) { + int hash_switch=0; + MESA_load_profile_int_def(conffile, "GTP_SIGNALING", "HASH_SWITCH", &g_tsg_para.hash_switch, 1); + if(g_tsg_para.hash_switch==0) + { + return 0; + } + MESA_htable_create_args_t args; MESA_load_profile_int_def(conffile, "GTP_SIGNALING", "HASH_TIMEOUT", &g_tsg_para.hash_timeout, 300);