/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
- Copyright (c) 2005 Free Software Foundation, Inc.
+
+ Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
* SOFTWARE.
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
/* Specification. */
-#include "inet_ntop.h"
+#include <arpa/inet.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
-#ifndef EAFNOSUPPORT
-# define EAFNOSUPPORT EINVAL
-#endif
-
#define NS_IN6ADDRSZ 16
#define NS_INT16SZ 2
*/
typedef int verify_int_size[2 * sizeof (int) - 7];
-#if HAVE_IPV4
static const char *inet_ntop4 (const unsigned char *src, char *dst, socklen_t size);
-#endif
#if HAVE_IPV6
static const char *inet_ntop6 (const unsigned char *src, char *dst, socklen_t size);
#endif
/* NOTREACHED */
}
-#if HAVE_IPV4
-
/* const char *
* inet_ntop4(src, dst, size)
* format an IPv4 address
return strcpy (dst, tmp);
}
-#endif
-
#if HAVE_IPV6
/* const char *