Support Watt-32 under Win32.
[platform/upstream/c-ares.git] / ares_ipv6.h
1 /* $Id$ */
2
3 /* Copyright (C) 2005 by Dominick Meglio
4  *
5  * Permission to use, copy, modify, and distribute this
6  * software and its documentation for any purpose and without
7  * fee is hereby granted, provided that the above copyright
8  * notice appear in all copies and that both that copyright
9  * notice and this permission notice appear in supporting
10  * documentation, and that the name of M.I.T. not be used in
11  * advertising or publicity pertaining to distribution of the
12  * software without specific, written prior permission.
13  * M.I.T. makes no representations about the suitability of
14  * this software for any purpose.  It is provided "as is"
15  * without express or implied warranty.
16  */
17
18 #ifndef ARES_IPV6_H
19 #define ARES_IPV6_H
20
21 #ifndef HAVE_PF_INET6
22 #define PF_INET6 AF_INET6
23 #endif
24
25 #if !defined(HAVE_STRUCT_IN6_ADDR) && !defined(s6_addr)
26 struct in6_addr {
27   union {
28     unsigned char _S6_u8[16];
29   } _S6_un;
30 };
31 #define s6_addr _S6_un._S6_u8
32 #endif
33
34 #ifndef HAVE_STRUCT_SOCKADDR_IN6
35 struct sockaddr_in6
36 {
37   unsigned short  sin6_family;
38   unsigned short  sin6_port;
39   unsigned long   sin6_flowinfo;
40   struct in6_addr sin6_addr;
41   unsigned int    sin6_scope_id;
42 };
43 #endif
44
45 #ifndef HAVE_STRUCT_ADDRINFO
46 struct addrinfo
47 {
48   int              ai_flags;
49   int              ai_family;
50   int              ai_socktype;
51   int              ai_protocol;
52   socklen_t        ai_addrlen;   /* Follow rfc3493 struct addrinfo */
53   char            *ai_canonname;
54   struct sockaddr *ai_addr;
55   struct addrinfo *ai_next;
56 };
57 #endif
58
59 #ifndef NS_IN6ADDRSZ
60 #if SIZEOF_STRUCT_IN6_ADDR == 0
61 /* We cannot have it set to zero, so we pick a fixed value here */
62 #define NS_IN6ADDRSZ 16
63 #else
64 #define NS_IN6ADDRSZ SIZEOF_STRUCT_IN6_ADDR
65 #endif
66 #endif
67
68 #ifndef NS_INADDRSZ
69 #define NS_INADDRSZ SIZEOF_STRUCT_IN_ADDR
70 #endif
71
72 #ifndef NS_INT16SZ
73 #define NS_INT16SZ 2
74 #endif
75
76 #ifndef IF_NAMESIZE
77 #ifdef IFNAMSIZ
78 #define IF_NAMESIZE IFNAMSIZ
79 #else
80 #define IF_NAMESIZE 256
81 #endif
82 #endif
83
84 #endif /* ARES_IPV6_H */