TSG-23921 Tfe uses field instead of attribute and field_name value to remove the attr prefix
This commit is contained in:
@@ -3,18 +3,18 @@
|
||||
#include <tfe_scan.h>
|
||||
#include <MESA/stream.h>
|
||||
|
||||
static int scan_object(uuid_t *result, struct maat_state *scan_mid, int hit_cnt, struct maat_hit_object objects, const char *table_name, const char *attribute_name)
|
||||
static int scan_object(uuid_t *result, struct maat_state *scan_mid, int hit_cnt, struct maat_hit_object objects, const char *table_name, const char *filed_name)
|
||||
{
|
||||
size_t n_hit_result=0;
|
||||
int scan_ret=0, hit_cnt_group=0;
|
||||
|
||||
scan_ret = maat_scan_object(tfe_get_maat_handle(), table_name, attribute_name, &objects, 1, result+hit_cnt+hit_cnt_group,
|
||||
scan_ret = maat_scan_object(tfe_get_maat_handle(), table_name, filed_name, &objects, 1, result+hit_cnt+hit_cnt_group,
|
||||
MAX_SCAN_RESULT-hit_cnt-hit_cnt_group, &n_hit_result, scan_mid);
|
||||
if(scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
hit_cnt_group+=n_hit_result;
|
||||
}
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), table_name, attribute_name, result+hit_cnt+hit_cnt_group,
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), table_name, filed_name, result+hit_cnt+hit_cnt_group,
|
||||
MAX_SCAN_RESULT-hit_cnt-hit_cnt_group, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
@@ -40,10 +40,10 @@ static int get_route_dir(const struct tfe_stream * stream)
|
||||
return (route_dir==69) ? 1 : 0;
|
||||
}
|
||||
|
||||
const char *get_attribute_name(const struct tfe_stream *stream, enum scan_common_table table_type)
|
||||
const char *get_filed_name(const struct tfe_stream *stream, enum scan_common_table table_type)
|
||||
{
|
||||
int c2s = 0;
|
||||
const char *attribute_name=NULL;
|
||||
const char *filed_name=NULL;
|
||||
int dir_is_e2i = get_route_dir(stream);
|
||||
|
||||
if (table_type == PXY_CTRL_SOURCE_IP || table_type == PXY_CTRL_DESTINATION_IP || table_type == PXY_CTRL_SOURCE_PORT || table_type == PXY_CTRL_DESTINATION_PORT)
|
||||
@@ -52,14 +52,14 @@ const char *get_attribute_name(const struct tfe_stream *stream, enum scan_common
|
||||
|
||||
if(table_type == PXY_CTRL_SOURCE_IP || table_type == PXY_CTRL_DESTINATION_IP)
|
||||
{
|
||||
attribute_name = (c2s == dir_is_e2i) ? "ATTR_INTERNAL_IP" : "ATTR_EXTERNAL_IP";
|
||||
filed_name = (c2s == dir_is_e2i) ? "INTERNAL_IP" : "EXTERNAL_IP";
|
||||
}
|
||||
if(table_type == PXY_CTRL_SOURCE_PORT || table_type == PXY_CTRL_DESTINATION_PORT)
|
||||
{
|
||||
attribute_name = (c2s == dir_is_e2i) ? "ATTR_INTERNAL_PORT" : "ATTR_EXTERNAL_PORT";
|
||||
filed_name = (c2s == dir_is_e2i) ? "INTERNAL_PORT" : "EXTERNAL_PORT";
|
||||
}
|
||||
}
|
||||
return attribute_name;
|
||||
return filed_name;
|
||||
}
|
||||
|
||||
const char *get_table_name(const struct tfe_stream *stream, enum scan_common_table table_type)
|
||||
@@ -93,8 +93,8 @@ int tfe_scan_internal_exteral_by_last_group(const struct tfe_stream *stream, uui
|
||||
return hit_cnt_group;
|
||||
}
|
||||
|
||||
const char *attribute_name = get_attribute_name(stream, table_type);
|
||||
if(attribute_name == NULL)
|
||||
const char *filed_name = get_filed_name(stream, table_type);
|
||||
if(filed_name == NULL)
|
||||
{
|
||||
return hit_cnt_group;
|
||||
}
|
||||
@@ -103,13 +103,13 @@ int tfe_scan_internal_exteral_by_last_group(const struct tfe_stream *stream, uui
|
||||
if(n_last_hit_object > 0)
|
||||
{
|
||||
maat_state_get_last_hit_objects(scan_mid, last_hit_objects, array_size);
|
||||
scan_ret = maat_scan_object(tfe_get_maat_handle(), table_name, attribute_name, last_hit_objects, array_size, result+hit_cnt+hit_cnt_group,
|
||||
scan_ret = maat_scan_object(tfe_get_maat_handle(), table_name, filed_name, last_hit_objects, array_size, result+hit_cnt+hit_cnt_group,
|
||||
MAX_SCAN_RESULT-hit_cnt-hit_cnt_group, &n_hit_result, scan_mid);
|
||||
if(scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
hit_cnt_group += n_hit_result;
|
||||
}
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), table_name, attribute_name,
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), table_name, filed_name,
|
||||
result+hit_cnt+hit_cnt_group, MAX_SCAN_RESULT-hit_cnt-hit_cnt_group, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
@@ -179,22 +179,22 @@ int tfe_get_library_tags(const struct tfe_stream *stream, cJSON *common_obj, tfe
|
||||
{
|
||||
if(library_tag->category == CATEGORY_TYPE_ASN && tlv_type == TFE_CMSG_SRC_IP_TAGS_IDS_ARR && atol(library_tag->tag_value) > 0)
|
||||
{
|
||||
cJSON_AddNumberToObject(common_obj, "client_asn", atol(library_tag->tag_value));
|
||||
cJSON_AddNumberToObject(common_obj, "source_asn", atol(library_tag->tag_value));
|
||||
}
|
||||
|
||||
if(library_tag->category == CATEGORY_TYPE_CONTRY_CODE && tlv_type== TFE_CMSG_SRC_IP_TAGS_IDS_ARR)
|
||||
{
|
||||
cJSON_AddStringToObject(common_obj, "client_country", library_tag->tag_value);
|
||||
cJSON_AddStringToObject(common_obj, "source_country", library_tag->tag_value);
|
||||
}
|
||||
|
||||
if(library_tag->category == CATEGORY_TYPE_ASN && tlv_type == TFE_CMSG_DST_IP_TAGS_IDS_ARR && atol(library_tag->tag_value) > 0)
|
||||
{
|
||||
cJSON_AddNumberToObject(common_obj, "server_asn", atol(library_tag->tag_value));
|
||||
cJSON_AddNumberToObject(common_obj, "destination_asn", atol(library_tag->tag_value));
|
||||
}
|
||||
|
||||
if(library_tag->category == CATEGORY_TYPE_CONTRY_CODE && tlv_type== TFE_CMSG_DST_IP_TAGS_IDS_ARR)
|
||||
{
|
||||
cJSON_AddStringToObject(common_obj, "server_country", library_tag->tag_value);
|
||||
cJSON_AddStringToObject(common_obj, "destination_country", library_tag->tag_value);
|
||||
}
|
||||
|
||||
memset(value, 0, sizeof(value));
|
||||
@@ -227,7 +227,7 @@ int tfe_scan_ip_tags(const struct tfe_stream *stream, uuid_t *result, struct maa
|
||||
{
|
||||
memset(&objects, 0, sizeof(objects));
|
||||
uuid_copy(objects.object_uuid, opt_val[i]);
|
||||
scan_ret = maat_scan_object(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "ATTR_SOURCE_IP", &objects, 1, result+hit_cnt+hit_cnt_ip,
|
||||
scan_ret = maat_scan_object(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "SOURCE_IP", &objects, 1, result+hit_cnt+hit_cnt_ip,
|
||||
MAX_SCAN_RESULT-hit_cnt-hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if(scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
@@ -260,7 +260,7 @@ int tfe_scan_ip_tags(const struct tfe_stream *stream, uuid_t *result, struct maa
|
||||
{
|
||||
memset(&objects, 0, sizeof(objects));
|
||||
uuid_copy(objects.object_uuid, opt_val[i]);
|
||||
scan_ret = maat_scan_object(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "ATTR_DESTINATION_IP", &objects, 1, result+hit_cnt+hit_cnt_ip,
|
||||
scan_ret = maat_scan_object(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "DESTINATION_IP", &objects, 1, result+hit_cnt+hit_cnt_ip,
|
||||
MAX_SCAN_RESULT-hit_cnt-hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if(scan_ret==MAAT_SCAN_HIT)
|
||||
{
|
||||
@@ -300,7 +300,7 @@ int tfe_scan_fqdn_tags(const struct tfe_stream *stream, uuid_t *result, struct m
|
||||
{
|
||||
memset(&objects, 0, sizeof(objects));
|
||||
uuid_copy(objects.object_uuid, opt_val[i]);
|
||||
scan_ret = scan_object(result, scan_mid, hit_cnt, objects, "TSG_OBJ_FQDN", "ATTR_SERVER_FQDN");
|
||||
scan_ret = scan_object(result, scan_mid, hit_cnt, objects, "TSG_OBJ_FQDN", "SERVER_FQDN");
|
||||
if (scan_ret > 0)
|
||||
{
|
||||
char result_str[UUID_STRING_SIZE]={0};
|
||||
@@ -328,13 +328,13 @@ int tfe_scan_app_id(uuid_t *result, struct maat_state *scan_mid, int hit_cnt, lo
|
||||
{
|
||||
memset(&objects, 0, sizeof(objects));
|
||||
uuid_copy(objects.object_uuid, app_dict->object_uuid);
|
||||
scan_ret=maat_scan_object(tfe_get_maat_handle(), "APP_ID_DICT", "ATTR_APP_ID", &objects, 1, result+hit_cnt+hit_app_id,
|
||||
scan_ret=maat_scan_object(tfe_get_maat_handle(), "APP_ID_DICT", "APP_ID", &objects, 1, result+hit_cnt+hit_app_id,
|
||||
MAX_SCAN_RESULT-hit_cnt-hit_app_id, &n_hit_result, scan_mid);
|
||||
if(scan_ret==MAAT_SCAN_HIT)
|
||||
{
|
||||
hit_app_id += n_hit_result;
|
||||
}
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "APP_ID_DICT", "ATTR_APP_ID", result+hit_cnt+hit_app_id, MAX_SCAN_RESULT-hit_cnt-hit_app_id, &n_hit_result, scan_mid);
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "APP_ID_DICT", "APP_ID", result+hit_cnt+hit_app_id, MAX_SCAN_RESULT-hit_cnt-hit_app_id, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
hit_app_id += n_hit_result;
|
||||
@@ -344,7 +344,7 @@ int tfe_scan_app_id(uuid_t *result, struct maat_state *scan_mid, int hit_cnt, lo
|
||||
return hit_app_id;
|
||||
}
|
||||
|
||||
int tfe_scan_value_by_cmsg(const struct tfe_stream *stream, enum tfe_cmsg_tlv_type tlv_type, uuid_t *result, struct maat_state *scan_mid, int hit_cnt, const char *table_name, const char *attribute_name, char *opt_val)
|
||||
int tfe_scan_value_by_cmsg(const struct tfe_stream *stream, enum tfe_cmsg_tlv_type tlv_type, uuid_t *result, struct maat_state *scan_mid, int hit_cnt, const char *table_name, const char *filed_name, char *opt_val)
|
||||
{
|
||||
uint16_t opt_out_size = 0;
|
||||
int hit_cnt_string=0;
|
||||
@@ -360,13 +360,13 @@ int tfe_scan_value_by_cmsg(const struct tfe_stream *stream, enum tfe_cmsg_tlv_ty
|
||||
{
|
||||
size_t n_hit_result=0;
|
||||
|
||||
int scan_ret = maat_scan_string(tfe_get_maat_handle(), table_name, attribute_name, opt_val, strlen(opt_val), result+hit_cnt+hit_cnt_string, MAX_SCAN_RESULT-hit_cnt-hit_cnt_string,
|
||||
int scan_ret = maat_scan_string(tfe_get_maat_handle(), table_name, filed_name, opt_val, strlen(opt_val), result+hit_cnt+hit_cnt_string, MAX_SCAN_RESULT-hit_cnt-hit_cnt_string,
|
||||
&n_hit_result,scan_mid);
|
||||
if(scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
hit_cnt_string+=n_hit_result;
|
||||
}
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), table_name, attribute_name, result+hit_cnt+hit_cnt_string, MAX_SCAN_RESULT-hit_cnt-hit_cnt_string, &n_hit_result, scan_mid);
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), table_name, filed_name, result+hit_cnt+hit_cnt_string, MAX_SCAN_RESULT-hit_cnt-hit_cnt_string, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
hit_cnt_string+=n_hit_result;
|
||||
@@ -380,25 +380,25 @@ int tfe_scan_device(const struct tfe_stream *stream, uuid_t *result, struct maat
|
||||
char opt_val[4][128]={0};
|
||||
int scan_ret = 0, htt_cnt_device = 0;
|
||||
|
||||
scan_ret = tfe_scan_value_by_cmsg(stream, TFE_CMSG_SRC_IMSI_STR, result, scan_mid, hit_cnt, "TSG_OBJ_IMSI", "ATTR_GTP_IMSI", opt_val[0]);
|
||||
scan_ret = tfe_scan_value_by_cmsg(stream, TFE_CMSG_SRC_IMSI_STR, result, scan_mid, hit_cnt, "TSG_OBJ_IMSI", "GTP_IMSI", opt_val[0]);
|
||||
if(scan_ret > 0)
|
||||
{
|
||||
htt_cnt_device += scan_ret;
|
||||
}
|
||||
|
||||
scan_ret = tfe_scan_value_by_cmsg(stream, TFE_CMSG_SRC_IMEI_STR, result, scan_mid, hit_cnt, "TSG_OBJ_IMEI","ATTR_GTP_IMEI", opt_val[1]);
|
||||
scan_ret = tfe_scan_value_by_cmsg(stream, TFE_CMSG_SRC_IMEI_STR, result, scan_mid, hit_cnt, "TSG_OBJ_IMEI","GTP_IMEI", opt_val[1]);
|
||||
if(scan_ret > 0)
|
||||
{
|
||||
htt_cnt_device += scan_ret;
|
||||
}
|
||||
|
||||
scan_ret = tfe_scan_value_by_cmsg(stream, TFE_CMSG_SRC_PHONE_NUM_STR, result, scan_mid, hit_cnt, "TSG_OBJ_PHONE_NUMBER","ATTR_GTP_PHONE_NUMBER", opt_val[2]);
|
||||
scan_ret = tfe_scan_value_by_cmsg(stream, TFE_CMSG_SRC_PHONE_NUM_STR, result, scan_mid, hit_cnt, "TSG_OBJ_PHONE_NUMBER","GTP_PHONE_NUMBER", opt_val[2]);
|
||||
if(scan_ret > 0)
|
||||
{
|
||||
htt_cnt_device += scan_ret;
|
||||
}
|
||||
|
||||
scan_ret = tfe_scan_value_by_cmsg(stream, TFE_CMSG_SRC_APN_STR, result, scan_mid, hit_cnt, "TSG_OBJ_APN", "ATTR_GTP_APN", opt_val[3]);
|
||||
scan_ret = tfe_scan_value_by_cmsg(stream, TFE_CMSG_SRC_APN_STR, result, scan_mid, hit_cnt, "TSG_OBJ_APN", "GTP_APN", opt_val[3]);
|
||||
if(scan_ret > 0)
|
||||
{
|
||||
htt_cnt_device += scan_ret;
|
||||
@@ -415,7 +415,7 @@ int tfe_scan_port(const struct tfe_stream *stream, uuid_t *result, struct maat_s
|
||||
int hit_cnt_port = 0;
|
||||
size_t n_hit_result = 0;
|
||||
|
||||
scan_ret=maat_scan_integer(tfe_get_maat_handle(), "TSG_OBJ_PORT", "ATTR_SOURCE_PORT", ntohs(source),
|
||||
scan_ret=maat_scan_integer(tfe_get_maat_handle(), "TSG_OBJ_PORT", "SOURCE_PORT", ntohs(source),
|
||||
result+hit_cnt+hit_cnt_port, MAX_SCAN_RESULT-hit_cnt-hit_cnt_port, &n_hit_result, scan_mid);
|
||||
if(scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
@@ -426,14 +426,14 @@ int tfe_scan_port(const struct tfe_stream *stream, uuid_t *result, struct maat_s
|
||||
{
|
||||
hit_cnt_port+=scan_ret;
|
||||
}
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_PORT", "ATTR_SOURCE_PORT",
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_PORT", "SOURCE_PORT",
|
||||
result+hit_cnt+hit_cnt_port, MAX_SCAN_RESULT-hit_cnt-hit_cnt_port, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
hit_cnt_port+=n_hit_result;
|
||||
}
|
||||
|
||||
scan_ret=maat_scan_integer(tfe_get_maat_handle(), "TSG_OBJ_PORT", "ATTR_DESTINATION_PORT", ntohs(dest),
|
||||
scan_ret=maat_scan_integer(tfe_get_maat_handle(), "TSG_OBJ_PORT", "DESTINATION_PORT", ntohs(dest),
|
||||
result+hit_cnt+hit_cnt_port, MAX_SCAN_RESULT-hit_cnt-hit_cnt_port, &n_hit_result, scan_mid);
|
||||
if(scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
@@ -444,7 +444,7 @@ int tfe_scan_port(const struct tfe_stream *stream, uuid_t *result, struct maat_s
|
||||
{
|
||||
hit_cnt_port+=scan_ret;
|
||||
}
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_PORT", "ATTR_DESTINATION_PORT", result+hit_cnt+hit_cnt_port,
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_PORT", "DESTINATION_PORT", result+hit_cnt+hit_cnt_port,
|
||||
MAX_SCAN_RESULT-hit_cnt-hit_cnt_port, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
@@ -467,20 +467,20 @@ int tfe_scan_ipv4_addr(const struct tfe_stream *stream, uuid_t *result, struct m
|
||||
memset(&objects, 0, sizeof(objects));
|
||||
uuid_parse(protocol_uuid, objects_uuid);
|
||||
uuid_copy(objects.object_uuid, objects_uuid);
|
||||
scan_ret = maat_scan_object(tfe_get_maat_handle(), "TSG_OBJ_IP_PROTOCOL", "ATTR_IP_PROTOCOL", &objects, 1, result+hit_cnt+hit_cnt_ip,
|
||||
scan_ret = maat_scan_object(tfe_get_maat_handle(), "TSG_OBJ_IP_PROTOCOL", "IP_PROTOCOL", &objects, 1, result+hit_cnt+hit_cnt_ip,
|
||||
MAX_SCAN_RESULT-hit_cnt-hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if(scan_ret==MAAT_SCAN_HIT)
|
||||
{
|
||||
hit_cnt_ip += n_hit_result;
|
||||
}
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_IP_PROTOCOL", "ATTR_IP_PROTOCOL", result+hit_cnt+hit_cnt_ip,
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_IP_PROTOCOL", "IP_PROTOCOL", result+hit_cnt+hit_cnt_ip,
|
||||
MAX_SCAN_RESULT-hit_cnt-hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
hit_cnt_ip += n_hit_result;
|
||||
}
|
||||
|
||||
scan_ret = maat_scan_ipv4_port(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "ATTR_SOURCE_IP", sapp_addr.v4->saddr, ntohs(sapp_addr.v4->source),
|
||||
scan_ret = maat_scan_ipv4_port(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "SOURCE_IP", sapp_addr.v4->saddr, ntohs(sapp_addr.v4->source),
|
||||
result+hit_cnt+hit_cnt_ip, MAX_SCAN_RESULT-hit_cnt-hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
@@ -491,14 +491,14 @@ int tfe_scan_ipv4_addr(const struct tfe_stream *stream, uuid_t *result, struct m
|
||||
{
|
||||
hit_cnt_ip += scan_ret;
|
||||
}
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "ATTR_SOURCE_IP", result+hit_cnt+hit_cnt_ip,
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "SOURCE_IP", result+hit_cnt+hit_cnt_ip,
|
||||
MAX_SCAN_RESULT-hit_cnt-hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
hit_cnt_ip += n_hit_result;
|
||||
}
|
||||
|
||||
scan_ret = maat_scan_ipv4_port(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "ATTR_DESTINATION_IP", sapp_addr.v4->daddr, ntohs(sapp_addr.v4->dest),
|
||||
scan_ret = maat_scan_ipv4_port(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "DESTINATION_IP", sapp_addr.v4->daddr, ntohs(sapp_addr.v4->dest),
|
||||
result+hit_cnt+hit_cnt_ip, MAX_SCAN_RESULT-hit_cnt-hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if(scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
@@ -509,7 +509,7 @@ int tfe_scan_ipv4_addr(const struct tfe_stream *stream, uuid_t *result, struct m
|
||||
{
|
||||
hit_cnt_ip += scan_ret;
|
||||
}
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "ATTR_DESTINATION_IP",
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "DESTINATION_IP",
|
||||
result+hit_cnt+hit_cnt_ip, MAX_SCAN_RESULT-hit_cnt-hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
@@ -531,19 +531,19 @@ int tfe_scan_ipv6_addr(const struct tfe_stream *stream, uuid_t *result, struct m
|
||||
memset(&objects, 0, sizeof(objects));
|
||||
uuid_parse(protocol_uuid, objects_uuid);
|
||||
uuid_copy(objects.object_uuid, objects_uuid);
|
||||
scan_ret = maat_scan_object(tfe_get_maat_handle(), "TSG_OBJ_IP_PROTOCOL", "ATTR_IP_PROTOCOL", &objects, 1, result+hit_cnt+hit_cnt_ip,
|
||||
scan_ret = maat_scan_object(tfe_get_maat_handle(), "TSG_OBJ_IP_PROTOCOL", "IP_PROTOCOL", &objects, 1, result+hit_cnt+hit_cnt_ip,
|
||||
MAX_SCAN_RESULT-hit_cnt-hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if(scan_ret==MAAT_SCAN_HIT)
|
||||
{
|
||||
hit_cnt_ip += n_hit_result;
|
||||
}
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_IP_PROTOCOL", "ATTR_IP_PROTOCOL",
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_IP_PROTOCOL", "IP_PROTOCOL",
|
||||
result+hit_cnt+hit_cnt_ip, MAX_SCAN_RESULT-hit_cnt-hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
hit_cnt_ip += n_hit_result;
|
||||
}
|
||||
scan_ret = maat_scan_ipv6_port(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "ATTR_SOURCE_IP", sapp_addr.v6->saddr, ntohs(sapp_addr.v6->source),
|
||||
scan_ret = maat_scan_ipv6_port(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "SOURCE_IP", sapp_addr.v6->saddr, ntohs(sapp_addr.v6->source),
|
||||
result+hit_cnt+hit_cnt_ip, MAX_SCAN_RESULT-hit_cnt-hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
@@ -554,14 +554,14 @@ int tfe_scan_ipv6_addr(const struct tfe_stream *stream, uuid_t *result, struct m
|
||||
{
|
||||
hit_cnt_ip += scan_ret;
|
||||
}
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "ATTR_SOURCE_IP",
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "SOURCE_IP",
|
||||
result+hit_cnt+hit_cnt_ip, MAX_SCAN_RESULT-hit_cnt-hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
hit_cnt_ip += n_hit_result;
|
||||
}
|
||||
|
||||
scan_ret = maat_scan_ipv6_port(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "ATTR_DESTINATION_IP", sapp_addr.v6->daddr, ntohs(sapp_addr.v6->dest),
|
||||
scan_ret = maat_scan_ipv6_port(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "DESTINATION_IP", sapp_addr.v6->daddr, ntohs(sapp_addr.v6->dest),
|
||||
result+hit_cnt+hit_cnt_ip, MAX_SCAN_RESULT-hit_cnt-hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
@@ -572,7 +572,7 @@ int tfe_scan_ipv6_addr(const struct tfe_stream *stream, uuid_t *result, struct m
|
||||
{
|
||||
hit_cnt_ip += scan_ret;
|
||||
}
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "ATTR_DESTINATION_IP",
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_IP_ADDR", "DESTINATION_IP",
|
||||
result+hit_cnt+hit_cnt_ip, MAX_SCAN_RESULT-hit_cnt-hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
@@ -602,7 +602,7 @@ int tfe_scan_subscribe_id(const struct tfe_stream *stream, uuid_t *result, struc
|
||||
|
||||
if (strlen(source_subscribe_id))
|
||||
{
|
||||
scan_ret = maat_scan_string(tfe_get_maat_handle(), "TSG_OBJ_SUBSCRIBER_ID", "ATTR_SUBSCRIBER_ID",
|
||||
scan_ret = maat_scan_string(tfe_get_maat_handle(), "TSG_OBJ_SUBSCRIBER_ID", "SUBSCRIBER_ID",
|
||||
source_subscribe_id, strlen(source_subscribe_id),result + hit_cnt + hit_cnt_ip,
|
||||
MAX_SCAN_RESULT - hit_cnt - hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
@@ -618,7 +618,7 @@ int tfe_scan_subscribe_id(const struct tfe_stream *stream, uuid_t *result, struc
|
||||
TFE_LOG_INFO(logger, "Scan src TSG_OBJ_SUBSCRIBER_ID, NO hit subid: %s scan ret: %d addr: %s",
|
||||
source_subscribe_id, scan_ret, stream->str_stream_info);
|
||||
}
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_SUBSCRIBER_ID", "ATTR_SUBSCRIBER_ID",
|
||||
scan_ret = maat_scan_not_logic(tfe_get_maat_handle(), "TSG_OBJ_SUBSCRIBER_ID", "SUBSCRIBER_ID",
|
||||
result + hit_cnt + hit_cnt_ip, MAX_SCAN_RESULT - hit_cnt - hit_cnt_ip, &n_hit_result, scan_mid);
|
||||
if (scan_ret == MAAT_SCAN_HIT)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user