From f1ff3208a055f462e69c9ac7479271aecf784d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Wed, 1 Jun 2016 22:22:46 +0100 Subject: Move ip6_to_str_buf() to to_str.c and make it take the buffer length. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also make it use ws_inet_ntop6() (rather than implementing the string conversion ourselves). Remove ip6_to_str_buf_len(). Change-Id: I1eff3a8941e00987c2ff0c4dcfda13476af86191 Reviewed-on: https://code.wireshark.org/review/15692 Reviewed-by: João Valverde Reviewed-by: Michael Mann --- epan/to_str.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'epan/to_str.h') diff --git a/epan/to_str.h b/epan/to_str.h index 36849e0b84..2377dde425 100644 --- a/epan/to_str.h +++ b/epan/to_str.h @@ -26,6 +26,7 @@ #include #include "wsutil/nstime.h" +#include #include "time_fmt.h" #include #include @@ -34,7 +35,7 @@ #define GUID_STR_LEN 37 #define MAX_IP_STR_LEN 16 -#define MAX_IP6_STR_LEN 40 +#define MAX_IP6_STR_LEN WS_INET6_ADDRSTRLEN #define MAX_ADDR_STR_LEN 256 #define VINES_ADDR_LEN 6 #define EUI64_STR_LEN 24 @@ -91,8 +92,8 @@ WS_DLL_PUBLIC void address_to_str_buf(const address *addr, gchar *buf, int b #define tvb_eui64_to_str(tvb, offset) tvb_address_to_str(wmem_packet_scope(), tvb, AT_EUI64, offset) void ip_to_str_buf(const guint8 *ad, gchar *buf, const int buf_len); +void ip6_to_str_buf(const struct e_in6_addr *, gchar *, int buf_len); -void ip6_to_str_buf(const struct e_in6_addr *, gchar *); extern gchar* ipxnet_to_str_punct(wmem_allocator_t *scope, const guint32 ad, const char punct); WS_DLL_PUBLIC gchar* eui64_to_str(wmem_allocator_t *scope, const guint64 ad); -- cgit v1.2.1