From 3b0c5ae46774e8523cb02d6ecb7c2c25ec21e97b Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 25 Nov 2008 16:26:58 +0000 Subject: In preparation for the upcomming IPv6 nameservers patch, the internal ares_addr union is now changed into an internal struct which also holds the address family. --- ares/ares_private.h | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'ares/ares_private.h') diff --git a/ares/ares_private.h b/ares/ares_private.h index a883e50f1..a7be3f0ea 100644 --- a/ares/ares_private.h +++ b/ares/ares_private.h @@ -115,6 +115,16 @@ # define writev(s,ptr,cnt) ares_writev(s,ptr,cnt) #endif +struct ares_addr { + int family; + union { + struct in_addr addr4; + struct in6_addr addr6; + } addr; +}; +#define addrV4 addr.addr4 +#define addrV6 addr.addr6 + struct query; struct send_request { @@ -213,17 +223,17 @@ struct query_server_info { #define PATTERN_MASK 0x1 #define PATTERN_CIDR 0x2 -union ares_addr { - struct in_addr addr4; - struct in6_addr addr6; -}; - struct apattern { - union ares_addr addr; union { - union ares_addr addr; - unsigned short bits; + struct in_addr addr4; + struct in6_addr addr6; + } addr; + union + { + struct in_addr addr4; + struct in6_addr addr6; + unsigned short bits; } mask; int family; unsigned short type; -- cgit v1.2.3