From f74d5846ac66546b57a128c89e400f70b1de687e Mon Sep 17 00:00:00 2001 From: liuxueli Date: Fri, 10 Jun 2022 10:06:32 +0800 Subject: [PATCH] =?UTF-8?q?TSG-10873:=20=E6=94=AF=E6=8C=81=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=AD=98=E5=82=A8GTP-C=E4=BF=A1=E4=BB=A4=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tsg_entry.h | 1 + src/tsg_gtp_signaling.cpp | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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);