From 7fe0fb941cb8ee2562cae02028df4e80f61548f4 Mon Sep 17 00:00:00 2001 From: Karsten Keil Date: Wed, 23 Jul 2008 17:05:24 +0200 Subject: IPv6 infrastructure support Add autoconf rules to detect IPv6 availability and some of the neeeded support functions. Add stubs for getaddrinfo and inet_ntop. You can disable IPv6 at compile time with ./configure --without-ipv6 Signed-off-by: Karsten Keil Signed-off-by: H. Peter Anvin --- config.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'config.h') diff --git a/config.h b/config.h index ed1e39a..38be517 100644 --- a/config.h +++ b/config.h @@ -106,6 +106,9 @@ #endif #endif #endif +#ifdef HAVE_NETDB_H +#include +#endif #ifdef HAVE_GETOPT_H #include @@ -301,6 +304,49 @@ int dup2(int, int); int daemon(int, int); #endif +#ifndef HAVE_GETADDRINFO +#ifndef HAVE_STRUCT_ADDRINFO +struct addrinfo { + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + size_t ai_addrlen; + struct sockaddr *ai_addr; + char *ai_canonname; + struct addrinfo *ai_next; +}; +#endif +int getaddrinfo(const char *, const char *, const struct addrinfo *, + struct addrinfo **); +void freeaddrinfo(struct addrinfo *); +const char *gai_strerror(int); + +#ifndef AI_CANONNAME +#define AI_CANONNAME 0x0002 /* Request for canonical name. */ +#endif + +#ifndef EAI_NONAME +#define EAI_NONAME -2 /* NAME or SERVICE is unknown. */ +#endif +#ifndef EAI_ADDRFAMILY +#define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */ +#endif +#ifndef EAI_MEMORY +#define EAI_MEMORY -10 /* Memory allocation failure. */ +#endif +#ifndef EAI_SYSTEM +#define EAI_SYSTEM -11 /* System error returned in rrno'. */ +#endif +#endif + +#ifndef HAVE_INET_NTOP +const char *inet_ntop(int, const void *, char *, socklen_t); +#ifndef INET6_ADDRSTRLEN +#define INET6_ADDRSTRLEN 48 +#endif +#endif + /* tftp-hpa version and configuration strings */ #include "version.h" -- cgit v1.2.1