ares_ipv6.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* $Id$ */
  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. #ifndef ARES_IPV6_H
  17. #define ARES_IPV6_H
  18. #ifndef HAVE_PF_INET6
  19. #define PF_INET6 AF_INET6
  20. #endif
  21. #if !defined(HAVE_STRUCT_IN6_ADDR) && !defined(s6_addr)
  22. struct in6_addr {
  23. union {
  24. unsigned char _S6_u8[16];
  25. } _S6_un;
  26. };
  27. #define s6_addr _S6_un._S6_u8
  28. #endif
  29. #ifndef HAVE_STRUCT_SOCKADDR_IN6
  30. struct sockaddr_in6
  31. {
  32. unsigned short sin6_family;
  33. unsigned short sin6_port;
  34. unsigned long sin6_flowinfo;
  35. struct in6_addr sin6_addr;
  36. unsigned int sin6_scope_id;
  37. };
  38. #endif
  39. #ifndef HAVE_STRUCT_ADDRINFO
  40. struct addrinfo
  41. {
  42. int ai_flags;
  43. int ai_family;
  44. int ai_socktype;
  45. int ai_protocol;
  46. ares_socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */
  47. char *ai_canonname;
  48. struct sockaddr *ai_addr;
  49. struct addrinfo *ai_next;
  50. };
  51. #endif
  52. #ifndef NS_IN6ADDRSZ
  53. #if SIZEOF_STRUCT_IN6_ADDR == 0
  54. /* We cannot have it set to zero, so we pick a fixed value here */
  55. #define NS_IN6ADDRSZ 16
  56. #else
  57. #define NS_IN6ADDRSZ SIZEOF_STRUCT_IN6_ADDR
  58. #endif
  59. #endif
  60. #ifndef NS_INADDRSZ
  61. #define NS_INADDRSZ SIZEOF_STRUCT_IN_ADDR
  62. #endif
  63. #ifndef NS_INT16SZ
  64. #define NS_INT16SZ 2
  65. #endif
  66. #ifndef IF_NAMESIZE
  67. #ifdef IFNAMSIZ
  68. #define IF_NAMESIZE IFNAMSIZ
  69. #else
  70. #define IF_NAMESIZE 256
  71. #endif
  72. #endif
  73. #endif /* ARES_IPV6_H */