summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorfengweihao <[email protected]>2024-09-11 17:49:14 +0800
committerfengweihao <[email protected]>2024-09-11 17:49:14 +0800
commit1b917ef5ae149cc7bd966d88465769fb7b25ce72 (patch)
treeed70049ae5b43e634ca60f45dd8e8e035fba5c80 /common
parent268b80c3de6727ba0d82af3df433091b2225142e (diff)
TSG-22512 修复Manipulation配置Server FQDN Tags策略无法命中v4.10.2-20240911
TSG-22504 Manipulation日志输出Client Country,server_country字段 TSG-22374 修复Manipulation日志字段中的http版本号
Diffstat (limited to 'common')
-rw-r--r--common/src/tfe_scan.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/common/src/tfe_scan.cpp b/common/src/tfe_scan.cpp
index a6cfd0b..aa292bc 100644
--- a/common/src/tfe_scan.cpp
+++ b/common/src/tfe_scan.cpp
@@ -152,16 +152,26 @@ int tfe_get_library_tags(const struct tfe_stream *stream, cJSON *common_obj, tfe
struct library_tag_ctx *library_tag =(struct library_tag_ctx *)maat_plugin_table_get_ex_data(tfe_get_maat_handle(), tfe_bussiness_tableid_get(PXY_CTRL_LIBRARY_TAG), (const char *)&tag_id_array[i], sizeof(long long));
if(library_tag != NULL)
{
- if(library_tag->category == CATEGORY_TYPE_ASN && tlv_type == TFE_CMSG_SRC_IP_TAGS_IDS_STR)
+ if(library_tag->category == CATEGORY_TYPE_ASN && tlv_type == TFE_CMSG_SRC_IP_TAGS_IDS_STR && atol(library_tag->tag_value) > 0)
{
- cJSON_AddNumberToObject(common_obj, "client_asn", atol(library_tag->tag_value));
+ cJSON_AddNumberToObject(common_obj, "client_asn", atol(library_tag->tag_value));
}
- if(library_tag->category == CATEGORY_TYPE_ASN && tlv_type == TFE_CMSG_DST_IP_TAGS_IDS_STR)
+ if(library_tag->category == CATEGORY_TYPE_CONTRY_CODE && tlv_type== TFE_CMSG_SRC_IP_TAGS_IDS_STR)
+ {
+ cJSON_AddStringToObject(common_obj, "client_country", library_tag->tag_value);
+ }
+
+ if(library_tag->category == CATEGORY_TYPE_ASN && tlv_type == TFE_CMSG_DST_IP_TAGS_IDS_STR && atol(library_tag->tag_value) > 0)
{
cJSON_AddNumberToObject(common_obj, "server_asn", atol(library_tag->tag_value));
}
+ if(library_tag->category == CATEGORY_TYPE_CONTRY_CODE && tlv_type== TFE_CMSG_DST_IP_TAGS_IDS_STR)
+ {
+ cJSON_AddStringToObject(common_obj, "server_country", library_tag->tag_value);
+ }
+
memset(value, 0, sizeof(value));
snprintf(value, sizeof(value), "%s:%s", library_tag->tag_key, library_tag->tag_value);
cJSON_AddItemToArray(tags_array, cJSON_CreateString(value));