From 5920990fecba7e2430af3cfaa8bcbaed40d0ba1a Mon Sep 17 00:00:00 2001 From: hasso Date: Tue, 5 Apr 2005 14:36:49 +0000 Subject: * lib/prefix.[hc]: inet6_ntoa utility function copied from ripngd/ripngd.c (inet6_ntop). * ripngd.[hc]: Remove inet6_ntop() and any usage of it. inet6_ntoa() from lib is used now. * ripng_interface.c: inet6_ntop() -> inet6_ntoa(). * ripng_peer.c: inet6_ntop() -> inet6_ntoa(). --- lib/ChangeLog | 5 +++++ lib/prefix.c | 11 +++++++++++ lib/prefix.h | 2 ++ 3 files changed, 18 insertions(+) (limited to 'lib') diff --git a/lib/ChangeLog b/lib/ChangeLog index 57bb3d1c..ee20de84 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2004-04-05 Hasso Tepper + + * lib/prefix.[hc]: inet6_ntoa utility function copied from + ripngd/ripngd.c (inet6_ntop). + 2004-04-05 Paul Jakma * vty.c: Improve logging of failures to open vty socket(s). diff --git a/lib/prefix.c b/lib/prefix.c index 82075442..56539fc9 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -735,3 +735,14 @@ netmask_str2prefix_str (const char *net_str, const char *mask_str, return 1; } +#ifdef HAVE_IPV6 +/* Utility function for making IPv6 address string. */ +const char * +inet6_ntoa (struct in6_addr *addr) +{ + static char buf[INET6_ADDRSTRLEN]; + + inet_ntop (AF_INET6, addr, buf, INET6_ADDRSTRLEN); + return buf; +} +#endif /* HAVE_IPV6 */ diff --git a/lib/prefix.h b/lib/prefix.h index 0546095b..7ef53473 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -173,6 +173,8 @@ int ip6_masklen (struct in6_addr); void masklen2ip6 (int, struct in6_addr *); void str2in6_addr (const char *, struct in6_addr *); +const char *inet6_ntoa (struct in6_addr *); + #endif /* HAVE_IPV6 */ int all_digit (const char *); -- cgit v1.2.1