static char RFC2833_CHARS[] = "0123456789*#ABCDF";
-#ifdef _MSC_VER
+#ifndef _MSC_VER
+#define switch_inet_ntop inet_ntop
+#else
/* Copyright (c) 1996 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
*/
-static const char *inet_ntop4(const unsigned char *src, char *dst, size_t size);
+static const char *switch_inet_ntop4(const unsigned char *src, char *dst, size_t size);
#if HAVE_SIN6
-static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size);
+static const char *switch_inet_ntop6(const unsigned char *src, char *dst, size_t size);
#endif
/* char *
* Paul Vixie, 1996.
*/
const char *
-inet_ntop(int af, void const *src, char *dst, size_t size)
+switch_inet_ntop(int af, void const *src, char *dst, size_t size)
{
switch (af) {
case AF_INET:
- return inet_ntop4(src, dst, size);
+ return switch_inet_ntop4(src, dst, size);
#if HAVE_SIN6
case AF_INET6:
- return inet_ntop6(src, dst, size);
+ return switch_inet_ntop6(src, dst, size);
#endif
default:
return NULL;
* Paul Vixie, 1996.
*/
static const char *
-inet_ntop4(const unsigned char *src, char *dst, size_t size)
+switch_inet_ntop4(const unsigned char *src, char *dst, size_t size)
{
static const char fmt[] = "%u.%u.%u.%u";
char tmp[sizeof "255.255.255.255"];
* Paul Vixie, 1996.
*/
static const char *
-inet_ntop6(unsigned char const *src, char *dst, size_t size)
+switch_inet_ntop6(unsigned char const *src, char *dst, size_t size)
{
/*
* Note that int32_t and int16_t need only be "at least" large enough
assert(buf);
*buf = '\0';
if (in) {
- inet_ntop(AF_INET, in, buf, len);
+ switch_inet_ntop(AF_INET, in, buf, len);
}
return buf;
}