2
// resolver_query_base.hpp
3
// ~~~~~~~~~~~~~~~~~~~~~~~
5
// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7
// Distributed under the Boost Software License, Version 1.0. (See accompanying
8
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11
#ifndef ASIO_IP_RESOLVER_QUERY_BASE_HPP
12
#define ASIO_IP_RESOLVER_QUERY_BASE_HPP
14
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
16
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18
#include "asio/detail/push_options.hpp"
20
#include "asio/detail/push_options.hpp"
21
#include <boost/config.hpp>
22
#include <boost/detail/workaround.hpp>
23
#include "asio/detail/pop_options.hpp"
25
#include "asio/detail/socket_types.hpp"
30
/// The resolver_query_base class is used as a base for the
31
/// basic_resolver_query class templates to provide a common place to define
32
/// the flag constants.
33
class resolver_query_base
36
#if defined(GENERATING_DOCUMENTATION)
37
/// Determine the canonical name of the host specified in the query.
38
static const int canonical_name = implementation_defined;
40
/// Indicate that returned endpoint is intended for use as a locally bound
42
static const int passive = implementation_defined;
44
/// Host name should be treated as a numeric string defining an IPv4 or IPv6
45
/// address and no name resolution should be attempted.
46
static const int numeric_host = implementation_defined;
48
/// Service name should be treated as a numeric string defining a port number
49
/// and no name resolution should be attempted.
50
static const int numeric_service = implementation_defined;
52
/// If the query protocol family is specified as IPv6, return IPv4-mapped
53
/// IPv6 addresses on finding no IPv6 addresses.
54
static const int v4_mapped = implementation_defined;
56
/// If used with v4_mapped, return all matching IPv6 and IPv4 addresses.
57
static const int all_matching = implementation_defined;
59
/// Only return IPv4 addresses if a non-loopback IPv4 address is configured
60
/// for the system. Only return IPv6 addresses if a non-loopback IPv6 address
61
/// is configured for the system.
62
static const int address_configured = implementation_defined;
64
BOOST_STATIC_CONSTANT(int, canonical_name = AI_CANONNAME);
65
BOOST_STATIC_CONSTANT(int, passive = AI_PASSIVE);
66
BOOST_STATIC_CONSTANT(int, numeric_host = AI_NUMERICHOST);
67
# if defined(AI_NUMERICSERV)
68
BOOST_STATIC_CONSTANT(int, numeric_service = AI_NUMERICSERV);
70
BOOST_STATIC_CONSTANT(int, numeric_service = 0);
72
// Note: QNX Neutrino 6.3 defines AI_V4MAPPED, AI_ALL and AI_ADDRCONFIG but
73
// does not implement them. Therefore they are specifically excluded here.
74
# if defined(AI_V4MAPPED) && !defined(__QNXNTO__)
75
BOOST_STATIC_CONSTANT(int, v4_mapped = AI_V4MAPPED);
77
BOOST_STATIC_CONSTANT(int, v4_mapped = 0);
79
# if defined(AI_ALL) && !defined(__QNXNTO__)
80
BOOST_STATIC_CONSTANT(int, all_matching = AI_ALL);
82
BOOST_STATIC_CONSTANT(int, all_matching = 0);
84
# if defined(AI_ADDRCONFIG) && !defined(__QNXNTO__)
85
BOOST_STATIC_CONSTANT(int, address_configured = AI_ADDRCONFIG);
87
BOOST_STATIC_CONSTANT(int, address_configured = 0);
92
/// Protected destructor to prevent deletion through this type.
93
~resolver_query_base()
97
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
99
// Workaround to enable the empty base optimisation with Borland C++.
107
#include "asio/detail/pop_options.hpp"
109
#endif // ASIO_IP_RESOLVER_QUERY_BASE_HPP