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: