Needed now that in6_addr is referenced in ares.h

pull/1/head
Yang Tse 17 years ago
parent d9dd239771
commit 8627b23715
  1. 7
      ahost.c
  2. 17
      ares.h
  3. 10
      ares_ipv6.h
  4. 1
      ares_parse_a_reply.c
  5. 1
      ares_parse_aaaa_reply.c
  6. 10
      config-win32.h
  7. 3
      nameser.h

@ -40,13 +40,6 @@
#include "inet_net_pton.h" #include "inet_net_pton.h"
#include "ares_getopt.h" #include "ares_getopt.h"
#ifndef HAVE_STRUCT_IN6_ADDR
struct in6_addr
{
unsigned char s6_addr[16];
};
#endif
static void callback(void *arg, int status, int timeouts, struct hostent *host); static void callback(void *arg, int status, int timeouts, struct hostent *host);
static void usage(void); static void usage(void);

@ -43,8 +43,12 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <tcp.h> #include <tcp.h>
#elif defined(WIN32) #elif defined(WIN32)
#include <winsock2.h> # ifndef WIN32_LEAN_AND_MEAN
#include <windows.h> # define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h>
# include <winsock2.h>
# include <ws2tcpip.h>
#else #else
#include <netinet/in.h> #include <netinet/in.h>
#include <sys/socket.h> #include <sys/socket.h>
@ -241,6 +245,15 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
int ares_expand_string(const unsigned char *encoded, const unsigned char *abuf, int ares_expand_string(const unsigned char *encoded, const unsigned char *abuf,
int alen, unsigned char **s, long *enclen); int alen, unsigned char **s, long *enclen);
#ifndef s6_addr
struct in6_addr {
union {
unsigned char _S6_u8[16];
} _S6_un;
};
#define s6_addr _S6_un._S6_u8
#endif
struct addrttl { struct addrttl {
struct in_addr ipaddr; struct in_addr ipaddr;
int ttl; int ttl;

@ -21,11 +21,13 @@
#define PF_INET6 AF_INET6 #define PF_INET6 AF_INET6
#endif #endif
#ifndef HAVE_STRUCT_IN6_ADDR #ifndef s6_addr
struct in6_addr struct in6_addr {
{ union {
unsigned char s6_addr[16]; unsigned char _S6_u8[16];
} _S6_un;
}; };
#define s6_addr _S6_un._S6_u8
#endif #endif
#ifndef HAVE_STRUCT_SOCKADDR_IN6 #ifndef HAVE_STRUCT_SOCKADDR_IN6

@ -32,6 +32,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <limits.h>
#include "ares.h" #include "ares.h"
#include "ares_dns.h" #include "ares_dns.h"
#include "ares_private.h" #include "ares_private.h"

@ -34,6 +34,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <limits.h>
#include "ares.h" #include "ares.h"
#include "ares_dns.h" #include "ares_dns.h"
#include "inet_net_pton.h" #include "inet_net_pton.h"

@ -174,19 +174,29 @@
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
/* Define this if you have address family AF_INET6 */ /* Define this if you have address family AF_INET6 */
#ifdef HAVE_WINSOCK2_H
#define HAVE_AF_INET6 1 #define HAVE_AF_INET6 1
#endif
/* Define this if you have protocol family PF_INET6 */ /* Define this if you have protocol family PF_INET6 */
#ifdef HAVE_WINSOCK2_H
#define HAVE_PF_INET6 1 #define HAVE_PF_INET6 1
#endif
/* Define this if you have struct in6_addr */ /* Define this if you have struct in6_addr */
#ifdef HAVE_WS2TCPIP_H
#define HAVE_STRUCT_IN6_ADDR 1 #define HAVE_STRUCT_IN6_ADDR 1
#endif
/* Define this if you have struct sockaddr_in6 */ /* Define this if you have struct sockaddr_in6 */
#ifdef HAVE_WS2TCPIP_H
#define HAVE_STRUCT_SOCKADDR_IN6 1 #define HAVE_STRUCT_SOCKADDR_IN6 1
#endif
/* Define this if you have sockaddr_in6 with scopeid */ /* Define this if you have sockaddr_in6 with scopeid */
#ifdef HAVE_WS2TCPIP_H
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
#endif
#endif /* __ARES_CONFIG_WIN32_H */ #endif /* __ARES_CONFIG_WIN32_H */

@ -7,9 +7,6 @@
port build */ port build */
#ifndef NETWARE #ifndef NETWARE
#ifndef __CYGWIN__
#include <windows.h>
#endif
#include <process.h> /* for the _getpid() proto */ #include <process.h> /* for the _getpid() proto */
#endif /* !NETWARE */ #endif /* !NETWARE */
#include <sys/types.h> #include <sys/types.h>

Loading…
Cancel
Save