TSG-18165 Manipulation日志中 Subscriber ID值为空
This commit is contained in:
@@ -335,7 +335,8 @@ int doh_send_log(struct doh_conf *handle, const struct tfe_http_session *http, c
|
|||||||
cJSON_AddStringToObject(common_obj, "doh_version", app_proto[http->major_version]);
|
cJSON_AddStringToObject(common_obj, "doh_version", app_proto[http->major_version]);
|
||||||
cJSON_AddStringToObject(common_obj, "decoded_as", "DoH");
|
cJSON_AddStringToObject(common_obj, "decoded_as", "DoH");
|
||||||
|
|
||||||
char opt_val[24] = { 0 };
|
char opt_val[24]={0};
|
||||||
|
char source_subscribe_id[64]={0};
|
||||||
uint16_t opt_out_size;
|
uint16_t opt_out_size;
|
||||||
struct tfe_cmsg *cmsg = tfe_stream_get0_cmsg(stream);
|
struct tfe_cmsg *cmsg = tfe_stream_get0_cmsg(stream);
|
||||||
if (cmsg != NULL)
|
if (cmsg != NULL)
|
||||||
@@ -345,6 +346,11 @@ int doh_send_log(struct doh_conf *handle, const struct tfe_http_session *http, c
|
|||||||
{
|
{
|
||||||
cJSON_AddStringToObject(common_obj, "session_id", opt_val);
|
cJSON_AddStringToObject(common_obj, "session_id", opt_val);
|
||||||
}
|
}
|
||||||
|
ret = tfe_cmsg_get_value(cmsg, TFE_CMSG_SRC_SUB_ID, (unsigned char *)source_subscribe_id, sizeof(source_subscribe_id), &opt_out_size);
|
||||||
|
if (ret==0)
|
||||||
|
{
|
||||||
|
cJSON_AddStringToObject(common_obj, "subscriber_id", source_subscribe_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (http->req)
|
if (http->req)
|
||||||
|
|||||||
@@ -760,7 +760,7 @@ void policy_action_param_dup(int idx, void **to, void **from, long argl, void *a
|
|||||||
void ma_profile_table_new_cb(const char *table_name, int table_id, const char* key, const char* table_line, void **ad, long argl, void* argp)
|
void ma_profile_table_new_cb(const char *table_name, int table_id, const char* key, const char* table_line, void **ad, long argl, void* argp)
|
||||||
{
|
{
|
||||||
int ret=0, profile_id=0, is_valid=0;
|
int ret=0, profile_id=0, is_valid=0;
|
||||||
char profile_name[256]={0}, formate[128]={0};
|
char profile_name[512]={0}, formate[128]={0};
|
||||||
char profile_path[TFE_PATH_MAX]={0};
|
char profile_path[TFE_PATH_MAX]={0};
|
||||||
|
|
||||||
ret=sscanf(table_line, "%d\t%s\t%s\t%s\t%d", &profile_id, profile_name, formate, profile_path, &is_valid);
|
ret=sscanf(table_line, "%d\t%s\t%s\t%s\t%d", &profile_id, profile_name, formate, profile_path, &is_valid);
|
||||||
@@ -800,7 +800,7 @@ void ma_profile_table_new_cb(const char *table_name, int table_id, const char* k
|
|||||||
void ma_insert_profile_table_new_cb(const char *table_name, int table_id, const char* key, const char* table_line, void **ad, long argl, void* argp)
|
void ma_insert_profile_table_new_cb(const char *table_name, int table_id, const char* key, const char* table_line, void **ad, long argl, void* argp)
|
||||||
{
|
{
|
||||||
int ret=0, profile_id=0, is_valid=0;
|
int ret=0, profile_id=0, is_valid=0;
|
||||||
char profile_name[256]={0}, formate[128]={0};
|
char profile_name[512]={0}, formate[128]={0};
|
||||||
char profile_path[TFE_PATH_MAX]={0},profile_position[TFE_PATH_MAX]={0};
|
char profile_path[TFE_PATH_MAX]={0},profile_position[TFE_PATH_MAX]={0};
|
||||||
|
|
||||||
ret=sscanf(table_line, "%d\t%s\t%s\t%s\t%s\t%d", &profile_id, profile_name, formate, profile_path, profile_position, &is_valid);
|
ret=sscanf(table_line, "%d\t%s\t%s\t%s\t%s\t%d", &profile_id, profile_name, formate, profile_path, profile_position, &is_valid);
|
||||||
@@ -840,8 +840,8 @@ void ma_insert_profile_table_new_cb(const char *table_name, int table_id, const
|
|||||||
void ma_hijack_profile_table_new_cb(const char *table_name, int table_id, const char* key, const char* table_line, void **ad, long argl, void* argp)
|
void ma_hijack_profile_table_new_cb(const char *table_name, int table_id, const char* key, const char* table_line, void **ad, long argl, void* argp)
|
||||||
{
|
{
|
||||||
int ret=0, profile_id=0, is_valid=0;
|
int ret=0, profile_id=0, is_valid=0;
|
||||||
char profile_name[256]={0}, formate[128]={0};
|
char profile_name[512]={0}, formate[128]={0};
|
||||||
char profile_path[TFE_PATH_MAX]={0},hijack_name[128]={0};
|
char profile_path[TFE_PATH_MAX]={0},hijack_name[512]={0};
|
||||||
|
|
||||||
ret=sscanf(table_line, "%d\t%s\t%s\t%s\t%s\t%d", &profile_id, profile_name, hijack_name, formate, profile_path, &is_valid);
|
ret=sscanf(table_line, "%d\t%s\t%s\t%s\t%s\t%d", &profile_id, profile_name, hijack_name, formate, profile_path, &is_valid);
|
||||||
if(ret!=6)
|
if(ret!=6)
|
||||||
@@ -868,7 +868,7 @@ void ma_lua_profile_table_new_cb(const char *table_name, int table_id, const cha
|
|||||||
{
|
{
|
||||||
int timeout=0;
|
int timeout=0;
|
||||||
int ret=0, profile_id=0, is_valid=0;
|
int ret=0, profile_id=0, is_valid=0;
|
||||||
char profile_name[128]={0}, profile_path[TFE_PATH_MAX]={0};
|
char profile_name[512]={0}, profile_path[TFE_PATH_MAX]={0};
|
||||||
|
|
||||||
ret=sscanf(table_line, "%d\t%s\t%d\t%d", &profile_id, profile_path, &timeout, &is_valid);
|
ret=sscanf(table_line, "%d\t%s\t%d\t%d", &profile_id, profile_path, &timeout, &is_valid);
|
||||||
if(ret!=4)
|
if(ret!=4)
|
||||||
|
|||||||
@@ -212,6 +212,7 @@ int proxy_send_log(struct proxy_logger* handle, const struct proxy_log* log_msg)
|
|||||||
cJSON_AddNumberToObject(common_obj, "end_timestamp_ms", get_time_ms(cur_time));
|
cJSON_AddNumberToObject(common_obj, "end_timestamp_ms", get_time_ms(cur_time));
|
||||||
|
|
||||||
unsigned int category_id_val[64]={0};
|
unsigned int category_id_val[64]={0};
|
||||||
|
char source_subscribe_id[64]={0};
|
||||||
char opt_val[24]={0}; uint16_t opt_out_size;
|
char opt_val[24]={0}; uint16_t opt_out_size;
|
||||||
struct tfe_cmsg * cmsg = tfe_stream_get0_cmsg(log_msg->stream);
|
struct tfe_cmsg * cmsg = tfe_stream_get0_cmsg(log_msg->stream);
|
||||||
if (cmsg!=NULL)
|
if (cmsg!=NULL)
|
||||||
@@ -221,6 +222,11 @@ int proxy_send_log(struct proxy_logger* handle, const struct proxy_log* log_msg)
|
|||||||
{
|
{
|
||||||
cJSON_AddStringToObject(common_obj, "session_id", opt_val);
|
cJSON_AddStringToObject(common_obj, "session_id", opt_val);
|
||||||
}
|
}
|
||||||
|
ret = tfe_cmsg_get_value(cmsg, TFE_CMSG_SRC_SUB_ID, (unsigned char *)source_subscribe_id, sizeof(source_subscribe_id), &opt_out_size);
|
||||||
|
if (ret==0)
|
||||||
|
{
|
||||||
|
cJSON_AddStringToObject(common_obj, "subscriber_id", source_subscribe_id);
|
||||||
|
}
|
||||||
ret = proxy_log_get_fqdn_cat(cmsg, category_id_val, sizeof(category_id_val));
|
ret = proxy_log_get_fqdn_cat(cmsg, category_id_val, sizeof(category_id_val));
|
||||||
if (ret>0)
|
if (ret>0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user