diff options
author | Karsten Keil <kkeil@suse.de> | 2008-07-23 17:05:24 +0200 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-07-23 14:24:19 -0400 |
commit | 7fe0fb941cb8ee2562cae02028df4e80f61548f4 (patch) | |
tree | 99655ebf9ae9396096b5b72fa0303892668dce9e /config.h | |
parent | 57ca2819802b3263da69976a4c3f1496e76f677f (diff) | |
download | tftp-hpa-7fe0fb941cb8ee2562cae02028df4e80f61548f4.tar.gz |
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 <kkeil@suse.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 46 |
1 files changed, 46 insertions, 0 deletions
@@ -106,6 +106,9 @@ #endif #endif #endif +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif #ifdef HAVE_GETOPT_H #include <getopt.h> @@ -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" |