15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2010 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef NET_BASE_ADDRESS_FAMILY_H_ 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NET_BASE_ADDRESS_FAMILY_H_ 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace net { 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Enum wrapper around the address family types supported by host resolver 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// procedures. 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)enum AddressFamily { 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) ADDRESS_FAMILY_UNSPECIFIED, // AF_UNSPEC 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) ADDRESS_FAMILY_IPV4, // AF_INET 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) ADDRESS_FAMILY_IPV6, // AF_INET6 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}; 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// HostResolverFlags is a bitflag enum used by host resolver procedures to 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// determine the value of addrinfo.ai_flags and work around getaddrinfo 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// peculiarities. 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)enum { 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) HOST_RESOLVER_CANONNAME = 1 << 0, // AI_CANONNAME 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Hint to the resolver proc that only loopback addresses are configured. 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) HOST_RESOLVER_LOOPBACK_ONLY = 1 << 1, 255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Indicate the address family was set because no IPv6 support was detected. 265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6 = 1 << 2, 27d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles) // The resolver should only invoke getaddrinfo, not DnsClient. 28d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles) HOST_RESOLVER_SYSTEM_ONLY = 1 << 3 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}; 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef int HostResolverFlags; 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace net 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif // NET_BASE_ADDRESS_FAMILY_H_ 35