From 4eff2cdb9991eed51e7e00e4dcc2f5fa1955cf17 Mon Sep 17 00:00:00 2001 From: Fábio Depin Date: Wed, 2 Jul 2025 02:41:55 -0300 Subject: Refactor: make src_name/dst_name dynamically allocated to reduce RAM usage (#2908) - Changed ndpi_flow_info: replaced fixed-size char arrays (always INET6_ADDRSTRLEN) for src_name and dst_name with char* pointers. - Now IPv4 flows use only INET_ADDRSTRLEN when needed, instead of always reserving IPv6 size. --- example/reader_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'example/reader_util.h') diff --git a/example/reader_util.h b/example/reader_util.h index 56195a2e0..c49237b9f 100644 --- a/example/reader_util.h +++ b/example/reader_util.h @@ -195,7 +195,7 @@ typedef struct ndpi_flow_info { u_int16_t vlan_id; ndpi_packet_tunnel tunnel_type; struct ndpi_flow_struct *ndpi_flow; - char src_name[INET6_ADDRSTRLEN], dst_name[INET6_ADDRSTRLEN]; + char *src_name, *dst_name; u_int8_t ip_version; u_int32_t cwr_count, src2dst_cwr_count, dst2src_cwr_count; u_int32_t ece_count, src2dst_ece_count, dst2src_ece_count; -- cgit v1.2.3