diff options
| author | liuxueli <[email protected]> | 2021-10-25 21:59:38 +0800 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2021-10-25 21:59:38 +0800 |
| commit | 72254973b6df6402cd203c1747ee59d71a732154 (patch) | |
| tree | 26df08cab4b783685c509abb8c647ded592731d2 | |
| parent | 9fcc3c88d383dd7ea289310a56a01e3a9827c6a1 (diff) | |
TSG-8084: 使用开关(DYNAMIC_MAAT_SWITCH)控制使用静态或动态MAAT句柄扫描subscriber_id,默认使用静态MAAT句柄v5.4.8
| -rw-r--r-- | bin/tsg_static_tableinfo.conf | 3 | ||||
| -rw-r--r-- | src/tsg_entry.cpp | 8 | ||||
| -rw-r--r-- | src/tsg_entry.h | 1 | ||||
| -rw-r--r-- | src/tsg_rule.cpp | 21 |
4 files changed, 23 insertions, 10 deletions
diff --git a/bin/tsg_static_tableinfo.conf b/bin/tsg_static_tableinfo.conf index bd63ecd..598ca5d 100644 --- a/bin/tsg_static_tableinfo.conf +++ b/bin/tsg_static_tableinfo.conf @@ -79,4 +79,5 @@ 67 TSG_FILED_GTP_IMSI virtual TSG_OBJ_IMSI -- 68 TSG_FILED_GTP_APN virtual TSG_OBJ_APN -- 69 TSG_FILED_GTP_PHONE_NUMBER virtual TSG_OBJ_PHONE_NUMBER -- -70 APP_SIGNATURE_UPDATE_PROFILE plugin {"key":1,"valid":4,"foreign":"2"}
\ No newline at end of file +70 APP_SIGNATURE_UPDATE_PROFILE plugin {"key":1,"valid":4,"foreign":"2"} +71 TSG_DYN_SUBSCRIBER_IP plugin {"key":3,"valid":5} --
\ No newline at end of file diff --git a/src/tsg_entry.cpp b/src/tsg_entry.cpp index f54a6f6..7ffafb8 100644 --- a/src/tsg_entry.cpp +++ b/src/tsg_entry.cpp @@ -2018,10 +2018,12 @@ extern "C" int TSG_MASTER_UNLOAD() { Maat_burn_feather(g_tsg_maat_feather); g_tsg_maat_feather=NULL; - - Maat_burn_feather(g_tsg_dynamic_maat_feather); - g_tsg_dynamic_maat_feather=NULL; + if(g_tsg_para.dynamic_maat_switch==1) + { + Maat_burn_feather(g_tsg_dynamic_maat_feather); + g_tsg_dynamic_maat_feather=NULL; + } return 0; } diff --git a/src/tsg_entry.h b/src/tsg_entry.h index 1ae650e..6568fdc 100644 --- a/src/tsg_entry.h +++ b/src/tsg_entry.h @@ -226,6 +226,7 @@ typedef struct tsg_para int level; short mirror_switch; unsigned short timeout; + int dynamic_maat_switch; int app_dict_field_num; int device_seq_in_dc; int datacenter_id; diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp index 99392ad..62016a9 100644 --- a/src/tsg_rule.cpp +++ b/src/tsg_rule.cpp @@ -1700,14 +1700,23 @@ int tsg_rule_init(const char* conffile, void *logger) return -1;
}
- //init dynamic maat feather
- g_tsg_dynamic_maat_feather=init_maat_feather(maat_conffile, (char *)"TSG_DYNAMIC", (char *)"DYNAMIC", logger);
- if(g_tsg_maat_feather==NULL)
+
+ //init dynamic maat feather
+ MESA_load_profile_int_def(conffile, "MAAT", "DYNAMIC_MAAT_SWITCH", &g_tsg_para.dynamic_maat_switch, 0);
+ if(g_tsg_para.dynamic_maat_switch==1)
{
- MESA_handle_runtime_log(g_tsg_para.maat_logger, RLOG_LV_FATAL, "init_maat_feather failed, instance_name: %s module: %s", "TSG_DYNAMIC", "DYNAMIC");
- return -1;
+ g_tsg_dynamic_maat_feather=init_maat_feather(maat_conffile, (char *)"TSG_DYNAMIC", (char *)"DYNAMIC", logger);
+ if(g_tsg_maat_feather==NULL)
+ {
+ MESA_handle_runtime_log(g_tsg_para.maat_logger, RLOG_LV_FATAL, "init_maat_feather failed, instance_name: %s module: %s", "TSG_DYNAMIC", "DYNAMIC");
+ return -1;
+ }
}
-
+ else
+ {
+ g_tsg_dynamic_maat_feather=g_tsg_maat_feather;
+ }
+
MESA_load_profile_string_def(conffile, "MAAT", "CB_SUBSCRIBER_IP_TABLE", cb_subscriber_ip_table, sizeof(cb_subscriber_ip_table), "TSG_DYN_SUBSCRIBER_IP");
g_tsg_para.dyn_subscribe_ip_table_id=Maat_table_register(g_tsg_dynamic_maat_feather, cb_subscriber_ip_table);
|
