From 319ecfeabb24dca5f3769f3d99ae287fc03404b8 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Sun, 30 Sep 2018 11:00:33 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81HTTP=E4=B8=9A=E5=8A=A1=E5=B1=82?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=BC=BA=E5=B0=91=E6=BA=90=E7=9B=AE=E7=9A=84?= =?UTF-8?q?IP=E5=92=8C=E7=AB=AF=E5=8F=A3=EF=BC=8CTFE=5FADDR=5FIPV4->TFE=5F?= =?UTF-8?q?ADDR=5FSTREAM=5FTUPLE4=5FV4=E3=80=822=E3=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/business/pangu-http/pangu_logger.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/plugin/business/pangu-http/pangu_logger.cpp b/plugin/business/pangu-http/pangu_logger.cpp index 3a01c9c..007e3e0 100644 --- a/plugin/business/pangu-http/pangu_logger.cpp +++ b/plugin/business/pangu-http/pangu_logger.cpp @@ -175,24 +175,24 @@ int pangu_send_log(struct pangu_logger* handle, const struct pangu_log* log_msg) switch(addr->addrtype) { - case TFE_ADDR_IPV4: + case TFE_ADDR_STREAM_TUPLE4_V4: cJSON_AddNumberToObject(common_obj, "addr_type", 4); - inet_ntop(AF_INET, &addr->ipv4->saddr, src_ip_str, sizeof(src_ip_str)); - inet_ntop(AF_INET, &addr->ipv4->daddr, dst_ip_str, sizeof(dst_ip_str)); + inet_ntop(AF_INET, &addr->tuple4_v4->saddr, src_ip_str, sizeof(src_ip_str)); + inet_ntop(AF_INET, &addr->tuple4_v4->daddr, dst_ip_str, sizeof(dst_ip_str)); cJSON_AddStringToObject(common_obj, "s_ip", src_ip_str); cJSON_AddStringToObject(common_obj, "d_ip", dst_ip_str); - cJSON_AddNumberToObject(common_obj, "s_port", ntohs(addr->ipv4->source)); - cJSON_AddNumberToObject(common_obj, "d_port", ntohs(addr->ipv4->dest)); + cJSON_AddNumberToObject(common_obj, "s_port", ntohs(addr->tuple4_v4->source)); + cJSON_AddNumberToObject(common_obj, "d_port", ntohs(addr->tuple4_v4->dest)); cJSON_AddStringToObject(common_obj, "trans_proto", "IPv4_TCP"); break; - case TFE_ADDR_IPV6: + case TFE_ADDR_STREAM_TUPLE4_V6: cJSON_AddNumberToObject(common_obj, "addr_type", 6); - inet_ntop(AF_INET6, &addr->ipv6->saddr, src_ip_str, sizeof(src_ip_str)); - inet_ntop(AF_INET6, &addr->ipv6->daddr, dst_ip_str, sizeof(dst_ip_str)); + inet_ntop(AF_INET6, &addr->tuple4_v6->saddr, src_ip_str, sizeof(src_ip_str)); + inet_ntop(AF_INET6, &addr->tuple4_v6->daddr, dst_ip_str, sizeof(dst_ip_str)); cJSON_AddStringToObject(common_obj, "s_ip", src_ip_str); cJSON_AddStringToObject(common_obj, "d_ip", dst_ip_str); - cJSON_AddNumberToObject(common_obj, "s_port", ntohs(addr->ipv6->source)); - cJSON_AddNumberToObject(common_obj, "d_port", ntohs(addr->ipv6->dest)); + cJSON_AddNumberToObject(common_obj, "s_port", ntohs(addr->tuple4_v6->source)); + cJSON_AddNumberToObject(common_obj, "d_port", ntohs(addr->tuple4_v6->dest)); cJSON_AddStringToObject(common_obj, "trans_proto", "IPv6_TCP"); break; default: