TSG-12300 代理日志增加Traffic Vsys id字段

This commit is contained in:
fengweihao
2022-10-26 14:30:45 +08:00
committed by 卢文朋
parent 87adce7cbf
commit 6e4fc2a978
9 changed files with 66 additions and 9 deletions

View File

@@ -74,10 +74,15 @@ static int doh_get_answer_ttl(cJSON *object)
return (rand() % (max - min + 1) + min);
}
static cJSON *doh_get_answer_records(cJSON *object, int qtype)
static cJSON *doh_get_answer_records(struct doh_ctx *ctx, cJSON *object, int qtype)
{
int i = 0;
cJSON *vsys_id=cJSON_GetObjectItem(object, "vsys_id");
if(vsys_id && vsys_id->type==cJSON_Number)
{
ctx->vsys_id = vsys_id->valueint;
}
cJSON *resolution = cJSON_GetObjectItem(object, "resolution");
int size = cJSON_GetArraySize(resolution);
for (i = 0; i < size; i++)
@@ -114,7 +119,7 @@ static void doh_get_cheat_data(Maat_rule_t *p_result, int qtype, struct doh_ctx
goto end;
}
answer_array = doh_get_answer_records(object, qtype);
answer_array = doh_get_answer_records(ctx, object, qtype);
if (answer_array != NULL)
{
answer_size = cJSON_GetArraySize(answer_array);