diff options
| author | liuxueli <[email protected]> | 2023-10-11 11:41:32 +0800 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2023-10-11 11:41:32 +0800 |
| commit | 24c3e11424c66b6ac57deef298e898a966e87af9 (patch) | |
| tree | 9483a3685e05a22d32bf0a83dd1c0fa7d7dbd876 /src/tsg_rule.cpp | |
| parent | b174b308f019b5a6bd85dc70e34fda979d4aa4b4 (diff) | |
支持输出动态IPPORT表的查询数及命中数统计v6.0.54
Diffstat (limited to 'src/tsg_rule.cpp')
| -rw-r--r-- | src/tsg_rule.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp index ff7abd7..ec16fc8 100644 --- a/src/tsg_rule.cpp +++ b/src/tsg_rule.cpp @@ -2442,12 +2442,24 @@ int srt_attribute_set_dynamic_ipport_mapping(const struct streaminfo *a_stream, if(*dest_mapping==NULL) { - maat_ipport_plugin_table_get_ex_data(feather, g_tsg_maat_rt_para.plugin_dyn_mapping_tb.id, &dest_ip, dest_port, (void **)dest_mapping, 1); + tsg_stat_dyn_ipport_mapping_metrics_update(a_stream->threadnum, THREAD_DYN_IPPORT_MAPPING_QUERY_METRICS, 1); + + int n_ex_data=maat_ipport_plugin_table_get_ex_data(feather, g_tsg_maat_rt_para.plugin_dyn_mapping_tb.id, &dest_ip, dest_port, (void **)dest_mapping, 1); + if(n_ex_data>0) + { + tsg_stat_dyn_ipport_mapping_metrics_update(a_stream->threadnum, THREAD_DYN_IPPORT_MAPPING_RESPONSE_METRICS, 1); + } } if(*source_mapping==NULL) { - maat_ipport_plugin_table_get_ex_data(feather, g_tsg_maat_rt_para.plugin_dyn_mapping_tb.id, &source_ip, source_port, (void **)source_mapping, 1); + tsg_stat_dyn_ipport_mapping_metrics_update(a_stream->threadnum, THREAD_DYN_IPPORT_MAPPING_QUERY_METRICS, 1); + + int n_ex_data=maat_ipport_plugin_table_get_ex_data(feather, g_tsg_maat_rt_para.plugin_dyn_mapping_tb.id, &source_ip, source_port, (void **)source_mapping, 1); + if(n_ex_data>0) + { + tsg_stat_dyn_ipport_mapping_metrics_update(a_stream->threadnum, THREAD_DYN_IPPORT_MAPPING_RESPONSE_METRICS, 1); + } } return 0; |
