From 837f9dfbd512fef39b081dcb92bf488589c1366e Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 11 Feb 2009 17:00:42 +0000 Subject: [PATCH] Tue Jan 13 16:23:09 CST 2009 Pekka Pessi * su_inet_ntop(), su_inet_pton(): added in 1.12.9 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11823 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/sofia-sip/libsofia-sip-ua/su/inet_ntop.c | 16 ++++++++++++++++ libs/sofia-sip/libsofia-sip-ua/su/inet_pton.c | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/libs/sofia-sip/libsofia-sip-ua/su/inet_ntop.c b/libs/sofia-sip/libsofia-sip-ua/su/inet_ntop.c index e5301824a7..b061059ebb 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/inet_ntop.c +++ b/libs/sofia-sip/libsofia-sip-ua/su/inet_ntop.c @@ -44,6 +44,22 @@ static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size); * author: * Paul Vixie, 1996. */ + +/** inet_ntop() replacement. + * + * Convert a network format address to presentation format. + * + * @param af[in] address family + * @param src[in] network address to convert + * @param dst[out] return-value string + * @param size[in] maximum lenght of @a dst string + * + * @return Pointer to presentation format address (`dst'), or NULL (see errno). + * + * @author Paul Vixie, 1996. + * + * @NEW_1_12_9 + */ const char * su_inet_ntop(int af, void const *src, char *dst, size_t size) { diff --git a/libs/sofia-sip/libsofia-sip-ua/su/inet_pton.c b/libs/sofia-sip/libsofia-sip-ua/su/inet_pton.c index 877e111129..b3fab0796a 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/inet_pton.c +++ b/libs/sofia-sip/libsofia-sip-ua/su/inet_pton.c @@ -44,6 +44,25 @@ static int inet_pton6(const char *src, unsigned char *dst); * author: * Paul Vixie, 1996. */ + +/** inet_pton() replacement. + * + * Convert from presentation format in @a src (which usually means ASCII printable) + * to network format in @a dst (which is usually some kind of binary format). + * + * @param af[in] address family + * @param src[in] string containing address to convert + * @param dst[out] return-value network address + * (struct in_addr or struct in_addr6) + * + * @retval 1 if the address was valid for the specified address family + * @retval 0 if the address wasn't valid (`dst' is untouched in this case) + * @retval -1 if some other error occurred (`dst' is untouched in this case, too) + * + * @author Paul Vixie, 1996. + * + * @NEW_1_12_9 + */ int su_inet_pton(int af, const char * src, void * dst) {