diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/src/tfe_scan.cpp | 16 |
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)); |
