TSG-21787 Proxy初始化kafka topic时增加client.id参数

TSG-21730 Proxy优化Manipulation日志中host和fqdn字段的格式
This commit is contained in:
fengweihao
2024-07-12 11:13:56 +08:00
parent 5eccfbb882
commit 88a7a8c5c4
7 changed files with 101 additions and 188 deletions

View File

@@ -337,6 +337,17 @@ static int doh_get_ip_server_geolocation(struct tfe_cmsg * cmsg, cJSON *common_o
return 0;
}
int doh_add_host_to_object(cJSON *common_obj, const char *req_spec_host)
{
unsigned int port;
char *format_host=ALLOC(char, strlen(req_spec_host)+1);
sscanf(req_spec_host, "%[^:]:%u", format_host, &port);
cJSON_AddStringToObject(common_obj, "doh_host", format_host);
cJSON_AddStringToObject(common_obj, "server_fqdn", format_host);
FREE(&format_host);
return 0;
}
int doh_send_log(struct doh_conf *handle, const struct tfe_http_session *http, const struct tfe_stream *stream, struct doh_ctx *ctx)
{
struct doh_maat_rule_t *result = ctx->result;
@@ -446,8 +457,7 @@ int doh_send_log(struct doh_conf *handle, const struct tfe_http_session *http, c
cJSON_AddNumberToObject(common_obj, "sent_bytes", c2s_byte_num);
cJSON_AddNumberToObject(common_obj, "received_bytes", s2c_byte_num);
cJSON_AddStringToObject(common_obj, "doh_url", http->req->req_spec.url);
cJSON_AddStringToObject(common_obj, "doh_host", http->req->req_spec.host);
cJSON_AddStringToObject(common_obj, "server_fqdn", http->req->req_spec.host);
doh_add_host_to_object(common_obj, http->req->req_spec.host);
if(handle->effective_device_tag)
{