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