Add "ip6_to_str_buf()", by analogy to "ip_to_str_buf()".

svn path=/trunk/; revision=9216
This commit is contained in:
Guy Harris 2003-12-09 05:06:22 +00:00
parent df0b981ca6
commit 8061eba526
3 changed files with 12 additions and 5 deletions

View File

@ -1,7 +1,7 @@
/* resolv.c
* Routines for network object lookup
*
* $Id: resolv.c,v 1.38 2003/11/20 05:04:57 guy Exp $
* $Id: resolv.c,v 1.39 2003/12/09 05:06:22 guy Exp $
*
* Laurent Deniel <laurent.deniel@free.fr>
*
@ -441,7 +441,7 @@ static guchar *host_name_lookup6(struct e_in6_addr *addr, gboolean *found)
/* unknown host or DNS timeout */
#endif /* INET6 */
*found = FALSE;
sprintf(name, "%s", ip6_to_str(addr));
ip6_to_str_buf(addr, name);
return (name);
}

View File

@ -1,7 +1,7 @@
/* to_str.c
* Routines for utilities to convert various other types to strings.
*
* $Id: to_str.c,v 1.41 2003/12/08 23:40:13 guy Exp $
* $Id: to_str.c,v 1.42 2003/12/09 05:06:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -245,10 +245,16 @@ ip6_to_str(const struct e_in6_addr *ad) {
}
strp=str[i];
inet_ntop(AF_INET6, (const guchar*)ad, (gchar*)strp, INET6_ADDRSTRLEN);
ip6_to_str_buf(ad, strp);
return strp;
}
void
ip6_to_str_buf(const struct e_in6_addr *ad, gchar *buf)
{
inet_ntop(AF_INET6, (const guchar*)ad, buf, INET6_ADDRSTRLEN);
}
gchar*
ipx_addr_to_str(guint32 net, const guint8 *ad)
{

View File

@ -1,7 +1,7 @@
/* to_str.h
* Definitions for utilities to convert various other types to strings.
*
* $Id: to_str.h,v 1.20 2003/12/08 23:40:13 guy Exp $
* $Id: to_str.h,v 1.21 2003/12/09 05:06:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -54,6 +54,7 @@ extern void ip_to_str_buf(const guint8 *, gchar *);
extern gchar* fc_to_str(const guint8 *);
extern gchar* fcwwn_to_str (const guint8 *);
extern char* ip6_to_str(const struct e_in6_addr *);
extern void ip6_to_str_buf(const struct e_in6_addr *, gchar *);
extern gchar* ipx_addr_to_str(guint32, const guint8 *);
extern gchar* ipxnet_to_string(const guint8 *ad);
extern gchar* ipxnet_to_str_punct(const guint32 ad, char punct);