summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2012-12-23 13:16:26 (GMT)
committerRemko Tronçon <git@el-tramo.be>2012-12-23 14:43:26 (GMT)
commit491ddd570a752cf9bda85933bed0c6942e39b1f9 (patch)
tree10c25c1be8cc08d0497df1dccd56a10fbb30beee /3rdParty/Boost/src/boost/asio/ip
parentda7d7a0ca71b80281aa9ff2526290b61ccb0cc60 (diff)
downloadswift-491ddd570a752cf9bda85933bed0c6942e39b1f9.zip
swift-491ddd570a752cf9bda85933bed0c6942e39b1f9.tar.bz2
Update Boost to 1.52.0.
Change-Id: I1e56bea2600bf2ed9c5b3aba8c4f9d2a0f350e77
Diffstat (limited to '3rdParty/Boost/src/boost/asio/ip')
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/address.hpp21
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/address_v4.hpp43
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/address_v6.hpp24
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp28
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp29
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp12
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp27
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp67
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/detail/endpoint.hpp7
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp22
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp45
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/host_name.hpp2
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/icmp.hpp14
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/address.hpp2
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/address.ipp42
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/address_v4.hpp2
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/address_v4.ipp26
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/address_v6.hpp2
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/address_v6.ipp91
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/basic_endpoint.hpp2
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/host_name.ipp2
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/multicast.hpp2
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp2
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp32
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/tcp.hpp12
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/udp.hpp12
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/unicast.hpp2
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/v6_only.hpp2
28 files changed, 362 insertions, 212 deletions
diff --git a/3rdParty/Boost/src/boost/asio/ip/address.hpp b/3rdParty/Boost/src/boost/asio/ip/address.hpp
index 4ecae7a..9e62c04 100644
--- a/3rdParty/Boost/src/boost/asio/ip/address.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/address.hpp
@@ -2,7 +2,7 @@
// ip/address.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -55,9 +55,19 @@ public:
/// Copy constructor.
BOOST_ASIO_DECL address(const address& other);
+#if defined(BOOST_ASIO_HAS_MOVE)
+ /// Move constructor.
+ BOOST_ASIO_DECL address(address&& other);
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
/// Assign from another address.
BOOST_ASIO_DECL address& operator=(const address& other);
+#if defined(BOOST_ASIO_HAS_MOVE)
+ /// Move-assign from another address.
+ BOOST_ASIO_DECL address& operator=(address&& other);
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
/// Assign from an IPv4 address.
BOOST_ASIO_DECL address& operator=(
const boost::asio::ip::address_v4& ipv4_address);
@@ -108,6 +118,15 @@ public:
BOOST_ASIO_DECL static address from_string(
const std::string& str, boost::system::error_code& ec);
+ /// Determine whether the address is a loopback address.
+ BOOST_ASIO_DECL bool is_loopback() const;
+
+ /// Determine whether the address is unspecified.
+ BOOST_ASIO_DECL bool is_unspecified() const;
+
+ /// Determine whether the address is a multicast address.
+ BOOST_ASIO_DECL bool is_multicast() const;
+
/// Compare two addresses for equality.
BOOST_ASIO_DECL friend bool operator==(const address& a1, const address& a2);
diff --git a/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp b/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp
index 5728a17..8d11921 100644
--- a/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp
@@ -2,7 +2,7 @@
// ip/address_v4.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
#include <boost/asio/detail/config.hpp>
#include <string>
-#include <boost/array.hpp>
+#include <boost/asio/detail/array.hpp>
#include <boost/asio/detail/socket_types.hpp>
#include <boost/asio/detail/winsock_init.hpp>
#include <boost/system/error_code.hpp>
@@ -45,7 +45,15 @@ class address_v4
{
public:
/// The type used to represent an address as an array of bytes.
- typedef boost::array<unsigned char, 4> bytes_type;
+ /**
+ * @note This type is defined in terms of the C++0x template @c std::array
+ * when it is available. Otherwise, it uses @c boost:array.
+ */
+#if defined(GENERATING_DOCUMENTATION)
+ typedef array<unsigned char, 4> bytes_type;
+#else
+ typedef boost::asio::detail::array<unsigned char, 4> bytes_type;
+#endif
/// Default constructor.
address_v4()
@@ -65,6 +73,14 @@ public:
{
}
+#if defined(BOOST_ASIO_HAS_MOVE)
+ /// Move constructor.
+ address_v4(address_v4&& other)
+ : addr_(other.addr_)
+ {
+ }
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
/// Assign from another address.
address_v4& operator=(const address_v4& other)
{
@@ -72,6 +88,15 @@ public:
return *this;
}
+#if defined(BOOST_ASIO_HAS_MOVE)
+ /// Move-assign from another address.
+ address_v4& operator=(address_v4&& other)
+ {
+ addr_ = other.addr_;
+ return *this;
+ }
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
/// Get the address in bytes, in network byte order.
BOOST_ASIO_DECL bytes_type to_bytes() const;
@@ -98,6 +123,12 @@ public:
BOOST_ASIO_DECL static address_v4 from_string(
const std::string& str, boost::system::error_code& ec);
+ /// Determine whether the address is a loopback address.
+ BOOST_ASIO_DECL bool is_loopback() const;
+
+ /// Determine whether the address is unspecified.
+ BOOST_ASIO_DECL bool is_unspecified() const;
+
/// Determine whether the address is a class A address.
BOOST_ASIO_DECL bool is_class_a() const;
@@ -149,19 +180,19 @@ public:
/// Obtain an address object that represents any address.
static address_v4 any()
{
- return address_v4(static_cast<unsigned long>(INADDR_ANY));
+ return address_v4();
}
/// Obtain an address object that represents the loopback address.
static address_v4 loopback()
{
- return address_v4(static_cast<unsigned long>(INADDR_LOOPBACK));
+ return address_v4(0x7F000001);
}
/// Obtain an address object that represents the broadcast address.
static address_v4 broadcast()
{
- return address_v4(static_cast<unsigned long>(INADDR_BROADCAST));
+ return address_v4(0xFFFFFFFF);
}
/// Obtain an address object that represents the broadcast address that
diff --git a/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp b/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp
index 9155bea..e35a176 100644
--- a/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp
@@ -2,7 +2,7 @@
// ip/address_v6.hpp
// ~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
#include <boost/asio/detail/config.hpp>
#include <string>
-#include <boost/array.hpp>
+#include <boost/asio/detail/array.hpp>
#include <boost/asio/detail/socket_types.hpp>
#include <boost/asio/detail/winsock_init.hpp>
#include <boost/system/error_code.hpp>
@@ -46,7 +46,15 @@ class address_v6
{
public:
/// The type used to represent an address as an array of bytes.
- typedef boost::array<unsigned char, 16> bytes_type;
+ /**
+ * @note This type is defined in terms of the C++0x template @c std::array
+ * when it is available. Otherwise, it uses @c boost:array.
+ */
+#if defined(GENERATING_DOCUMENTATION)
+ typedef array<unsigned char, 16> bytes_type;
+#else
+ typedef boost::asio::detail::array<unsigned char, 16> bytes_type;
+#endif
/// Default constructor.
BOOST_ASIO_DECL address_v6();
@@ -58,9 +66,19 @@ public:
/// Copy constructor.
BOOST_ASIO_DECL address_v6(const address_v6& other);
+#if defined(BOOST_ASIO_HAS_MOVE)
+ /// Move constructor.
+ BOOST_ASIO_DECL address_v6(address_v6&& other);
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
/// Assign from another address.
BOOST_ASIO_DECL address_v6& operator=(const address_v6& other);
+#if defined(BOOST_ASIO_HAS_MOVE)
+ /// Move-assign from another address.
+ BOOST_ASIO_DECL address_v6& operator=(address_v6&& other);
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
/// The scope ID of the address.
/**
* Returns the scope ID associated with the IPv6 address.
diff --git a/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp
index 0047adc..9eefe4c 100644
--- a/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp
@@ -2,7 +2,7 @@
// ip/basic_endpoint.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -78,8 +78,9 @@ public:
* boost::asio::ip::udp::endpoint ep(boost::asio::ip::udp::v6(), 9876);
* @endcode
*/
- basic_endpoint(const InternetProtocol& protocol, unsigned short port_num)
- : impl_(protocol.family(), port_num)
+ basic_endpoint(const InternetProtocol& internet_protocol,
+ unsigned short port_num)
+ : impl_(internet_protocol.family(), port_num)
{
}
@@ -97,6 +98,14 @@ public:
{
}
+#if defined(BOOST_ASIO_HAS_MOVE)
+ /// Move constructor.
+ basic_endpoint(basic_endpoint&& other)
+ : impl_(other.impl_)
+ {
+ }
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
/// Assign from another endpoint.
basic_endpoint& operator=(const basic_endpoint& other)
{
@@ -104,6 +113,15 @@ public:
return *this;
}
+#if defined(BOOST_ASIO_HAS_MOVE)
+ /// Move-assign from another endpoint.
+ basic_endpoint& operator=(basic_endpoint&& other)
+ {
+ impl_ = other.impl_;
+ return *this;
+ }
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
/// The protocol associated with the endpoint.
protocol_type protocol() const
{
@@ -131,9 +149,9 @@ public:
}
/// Set the underlying size of the endpoint in the native type.
- void resize(std::size_t size)
+ void resize(std::size_t new_size)
{
- impl_.resize(size);
+ impl_.resize(new_size);
}
/// Get the capacity of the endpoint in the native type.
diff --git a/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp
index f27515a..6265890 100644
--- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp
@@ -2,7 +2,7 @@
// ip/basic_resolver.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
#include <boost/asio/detail/config.hpp>
#include <boost/asio/basic_io_object.hpp>
+#include <boost/asio/detail/handler_type_requirements.hpp>
#include <boost/asio/detail/throw_error.hpp>
#include <boost/asio/error.hpp>
#include <boost/asio/ip/basic_resolver_iterator.hpp>
@@ -99,7 +100,7 @@ public:
{
boost::system::error_code ec;
iterator i = this->service.resolve(this->implementation, q, ec);
- boost::asio::detail::throw_error(ec);
+ boost::asio::detail::throw_error(ec, "resolve");
return i;
}
@@ -152,9 +153,16 @@ public:
* the handler.
*/
template <typename ResolveHandler>
- void async_resolve(const query& q, ResolveHandler handler)
+ void async_resolve(const query& q,
+ BOOST_ASIO_MOVE_ARG(ResolveHandler) handler)
{
- return this->service.async_resolve(this->implementation, q, handler);
+ // If you get an error on the following line it means that your handler does
+ // not meet the documented type requirements for a ResolveHandler.
+ BOOST_ASIO_RESOLVE_HANDLER_CHECK(
+ ResolveHandler, handler, iterator) type_check;
+
+ return this->service.async_resolve(this->implementation, q,
+ BOOST_ASIO_MOVE_CAST(ResolveHandler)(handler));
}
/// Perform reverse resolution of an endpoint to a list of entries.
@@ -179,7 +187,7 @@ public:
{
boost::system::error_code ec;
iterator i = this->service.resolve(this->implementation, e, ec);
- boost::asio::detail::throw_error(ec);
+ boost::asio::detail::throw_error(ec, "resolve");
return i;
}
@@ -236,9 +244,16 @@ public:
* the handler.
*/
template <typename ResolveHandler>
- void async_resolve(const endpoint_type& e, ResolveHandler handler)
+ void async_resolve(const endpoint_type& e,
+ BOOST_ASIO_MOVE_ARG(ResolveHandler) handler)
{
- return this->service.async_resolve(this->implementation, e, handler);
+ // If you get an error on the following line it means that your handler does
+ // not meet the documented type requirements for a ResolveHandler.
+ BOOST_ASIO_RESOLVE_HANDLER_CHECK(
+ ResolveHandler, handler, iterator) type_check;
+
+ return this->service.async_resolve(this->implementation, e,
+ BOOST_ASIO_MOVE_CAST(ResolveHandler)(handler));
}
};
diff --git a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp
index 980b488..d170ab0 100644
--- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp
@@ -2,7 +2,7 @@
// ip/basic_resolver_entry.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -49,11 +49,11 @@ public:
}
/// Construct with specified endpoint, host name and service name.
- basic_resolver_entry(const endpoint_type& endpoint,
- const std::string& host_name, const std::string& service_name)
- : endpoint_(endpoint),
- host_name_(host_name),
- service_name_(service_name)
+ basic_resolver_entry(const endpoint_type& ep,
+ const std::string& host, const std::string& service)
+ : endpoint_(ep),
+ host_name_(host),
+ service_name_(service)
{
}
diff --git a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp
index 465c278..6e52a85 100644
--- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp
@@ -2,7 +2,7 @@
// ip/basic_resolver_iterator.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,8 +16,9 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
-#include <boost/iterator.hpp>
+#include <cstddef>
#include <cstring>
+#include <iterator>
#include <string>
#include <vector>
#include <boost/asio/detail/shared_ptr.hpp>
@@ -45,15 +46,23 @@ namespace ip {
*/
template <typename InternetProtocol>
class basic_resolver_iterator
-#if defined(GENERATING_DOCUMENTATION)
- : public std::iterator<
-#else // defined(GENERATING_DOCUMENTATION)
- : public boost::iterator<
-#endif // defined(GENERATING_DOCUMENTATION)
- std::forward_iterator_tag,
- const basic_resolver_entry<InternetProtocol> >
{
public:
+ /// The type used for the distance between two iterators.
+ typedef std::ptrdiff_t difference_type;
+
+ /// The type of the value pointed to by the iterator.
+ typedef basic_resolver_entry<InternetProtocol> value_type;
+
+ /// The type of the result of applying operator->() to the iterator.
+ typedef const basic_resolver_entry<InternetProtocol>* pointer;
+
+ /// The type of the result of applying operator*() to the iterator.
+ typedef const basic_resolver_entry<InternetProtocol>& reference;
+
+ /// The iterator category.
+ typedef std::forward_iterator_tag iterator_category;
+
/// Default constructor creates an end iterator.
basic_resolver_iterator()
: index_(0)
diff --git a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp
index 8fd63bc..0f7a54d 100644
--- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp
@@ -2,7 +2,7 @@
// ip/basic_resolver_query.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -48,8 +48,8 @@ public:
* This constructor is typically used to perform name resolution for local
* service binding.
*
- * @param service_name A string identifying the requested service. This may
- * be a descriptive name or a numeric string corresponding to a port number.
+ * @param service A string identifying the requested service. This may be a
+ * descriptive name or a numeric string corresponding to a port number.
*
* @param resolve_flags A set of flags that determine how name resolution
* should be performed. The default flags are suitable for local service
@@ -60,11 +60,11 @@ public:
* <tt>c:\\windows\\system32\\drivers\\etc\\services</tt>. Operating systems
* may use additional locations when resolving service names.
*/
- basic_resolver_query(const std::string& service_name,
+ basic_resolver_query(const std::string& service,
resolver_query_base::flags resolve_flags = passive | address_configured)
: hints_(),
host_name_(),
- service_name_(service_name)
+ service_name_(service)
{
typename InternetProtocol::endpoint endpoint;
hints_.ai_flags = static_cast<int>(resolve_flags);
@@ -85,8 +85,8 @@ public:
* @param protocol A protocol object, normally representing either the IPv4 or
* IPv6 version of an internet protocol.
*
- * @param service_name A string identifying the requested service. This may
- * be a descriptive name or a numeric string corresponding to a port number.
+ * @param service A string identifying the requested service. This may be a
+ * descriptive name or a numeric string corresponding to a port number.
*
* @param resolve_flags A set of flags that determine how name resolution
* should be performed. The default flags are suitable for local service
@@ -98,11 +98,11 @@ public:
* may use additional locations when resolving service names.
*/
basic_resolver_query(const protocol_type& protocol,
- const std::string& service_name,
+ const std::string& service,
resolver_query_base::flags resolve_flags = passive | address_configured)
: hints_(),
host_name_(),
- service_name_(service_name)
+ service_name_(service)
{
hints_.ai_flags = static_cast<int>(resolve_flags);
hints_.ai_family = protocol.family();
@@ -119,16 +119,16 @@ public:
* This constructor is typically used to perform name resolution for
* communication with remote hosts.
*
- * @param host_name A string identifying a location. May be a descriptive name
- * or a numeric address string. If an empty string and the passive flag has
- * been specified, the resolved endpoints are suitable for local service
- * binding. If an empty string and passive is not specified, the resolved
- * endpoints will use the loopback address.
+ * @param host A string identifying a location. May be a descriptive name or
+ * a numeric address string. If an empty string and the passive flag has been
+ * specified, the resolved endpoints are suitable for local service binding.
+ * If an empty string and passive is not specified, the resolved endpoints
+ * will use the loopback address.
*
- * @param service_name A string identifying the requested service. This may
- * be a descriptive name or a numeric string corresponding to a port number.
- * May be an empty string, in which case all resolved endpoints will have a
- * port number of 0.
+ * @param service A string identifying the requested service. This may be a
+ * descriptive name or a numeric string corresponding to a port number. May
+ * be an empty string, in which case all resolved endpoints will have a port
+ * number of 0.
*
* @param resolve_flags A set of flags that determine how name resolution
* should be performed. The default flags are suitable for communication with
@@ -145,12 +145,11 @@ public:
* <tt>c:\\windows\\system32\\drivers\\etc\\services</tt>. Operating systems
* may use additional locations when resolving service names.
*/
- basic_resolver_query(const std::string& host_name,
- const std::string& service_name,
+ basic_resolver_query(const std::string& host, const std::string& service,
resolver_query_base::flags resolve_flags = address_configured)
: hints_(),
- host_name_(host_name),
- service_name_(service_name)
+ host_name_(host),
+ service_name_(service)
{
typename InternetProtocol::endpoint endpoint;
hints_.ai_flags = static_cast<int>(resolve_flags);
@@ -171,16 +170,16 @@ public:
* @param protocol A protocol object, normally representing either the IPv4 or
* IPv6 version of an internet protocol.
*
- * @param host_name A string identifying a location. May be a descriptive name
- * or a numeric address string. If an empty string and the passive flag has
- * been specified, the resolved endpoints are suitable for local service
- * binding. If an empty string and passive is not specified, the resolved
- * endpoints will use the loopback address.
+ * @param host A string identifying a location. May be a descriptive name or
+ * a numeric address string. If an empty string and the passive flag has been
+ * specified, the resolved endpoints are suitable for local service binding.
+ * If an empty string and passive is not specified, the resolved endpoints
+ * will use the loopback address.
*
- * @param service_name A string identifying the requested service. This may
- * be a descriptive name or a numeric string corresponding to a port number.
- * May be an empty string, in which case all resolved endpoints will have a
- * port number of 0.
+ * @param service A string identifying the requested service. This may be a
+ * descriptive name or a numeric string corresponding to a port number. May
+ * be an empty string, in which case all resolved endpoints will have a port
+ * number of 0.
*
* @param resolve_flags A set of flags that determine how name resolution
* should be performed. The default flags are suitable for communication with
@@ -198,11 +197,11 @@ public:
* may use additional locations when resolving service names.
*/
basic_resolver_query(const protocol_type& protocol,
- const std::string& host_name, const std::string& service_name,
+ const std::string& host, const std::string& service,
resolver_query_base::flags resolve_flags = address_configured)
: hints_(),
- host_name_(host_name),
- service_name_(service_name)
+ host_name_(host),
+ service_name_(service)
{
hints_.ai_flags = static_cast<int>(resolve_flags);
hints_.ai_family = protocol.family();
diff --git a/3rdParty/Boost/src/boost/asio/ip/detail/endpoint.hpp b/3rdParty/Boost/src/boost/asio/ip/detail/endpoint.hpp
index fe95a00..04335ef 100644
--- a/3rdParty/Boost/src/boost/asio/ip/detail/endpoint.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/detail/endpoint.hpp
@@ -2,7 +2,7 @@
// ip/detail/endpoint.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -78,12 +78,12 @@ public:
}
// Set the underlying size of the endpoint in the native type.
- BOOST_ASIO_DECL void resize(std::size_t size);
+ BOOST_ASIO_DECL void resize(std::size_t new_size);
// Get the capacity of the endpoint in the native type.
std::size_t capacity() const
{
- return sizeof(boost::asio::detail::sockaddr_storage_type);
+ return sizeof(data_);
}
// Get the port associated with the endpoint.
@@ -122,7 +122,6 @@ private:
union data_union
{
boost::asio::detail::socket_addr_type base;
- boost::asio::detail::sockaddr_storage_type storage;
boost::asio::detail::sockaddr_in4_type v4;
boost::asio::detail::sockaddr_in6_type v6;
} data_;
diff --git a/3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp b/3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp
index 0443d38..24bfce2 100644
--- a/3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp
+++ b/3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp
@@ -2,7 +2,7 @@
// ip/detail/impl/endpoint.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -57,8 +57,14 @@ endpoint::endpoint(int family, unsigned short port_num)
data_.v6.sin6_port =
boost::asio::detail::socket_ops::host_to_network_short(port_num);
data_.v6.sin6_flowinfo = 0;
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
- data_.v6.sin6_addr = tmp_addr;
+ data_.v6.sin6_addr.s6_addr[0] = 0; data_.v6.sin6_addr.s6_addr[1] = 0;
+ data_.v6.sin6_addr.s6_addr[2] = 0, data_.v6.sin6_addr.s6_addr[3] = 0;
+ data_.v6.sin6_addr.s6_addr[4] = 0, data_.v6.sin6_addr.s6_addr[5] = 0;
+ data_.v6.sin6_addr.s6_addr[6] = 0, data_.v6.sin6_addr.s6_addr[7] = 0;
+ data_.v6.sin6_addr.s6_addr[8] = 0, data_.v6.sin6_addr.s6_addr[9] = 0;
+ data_.v6.sin6_addr.s6_addr[10] = 0, data_.v6.sin6_addr.s6_addr[11] = 0;
+ data_.v6.sin6_addr.s6_addr[12] = 0, data_.v6.sin6_addr.s6_addr[13] = 0;
+ data_.v6.sin6_addr.s6_addr[14] = 0, data_.v6.sin6_addr.s6_addr[15] = 0;
data_.v6.sin6_scope_id = 0;
}
}
@@ -85,14 +91,14 @@ endpoint::endpoint(const boost::asio::ip::address& addr,
data_.v6.sin6_flowinfo = 0;
boost::asio::ip::address_v6 v6_addr = addr.to_v6();
boost::asio::ip::address_v6::bytes_type bytes = v6_addr.to_bytes();
- memcpy(data_.v6.sin6_addr.s6_addr, bytes.elems, 16);
+ memcpy(data_.v6.sin6_addr.s6_addr, bytes.data(), 16);
data_.v6.sin6_scope_id = v6_addr.scope_id();
}
}
-void endpoint::resize(std::size_t size)
+void endpoint::resize(std::size_t new_size)
{
- if (size > sizeof(boost::asio::detail::sockaddr_storage_type))
+ if (new_size > sizeof(boost::asio::detail::sockaddr_storage_type))
{
boost::system::error_code ec(boost::asio::error::invalid_argument);
boost::asio::detail::throw_error(ec);
@@ -139,7 +145,11 @@ boost::asio::ip::address endpoint::address() const
else
{
boost::asio::ip::address_v6::bytes_type bytes;
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+ memcpy(bytes.data(), data_.v6.sin6_addr.s6_addr, 16);
+#else // defined(BOOST_ASIO_HAS_STD_ARRAY)
memcpy(bytes.elems, data_.v6.sin6_addr.s6_addr, 16);
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
return boost::asio::ip::address_v6(bytes, data_.v6.sin6_scope_id);
}
}
diff --git a/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp b/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp
index 6fde8c3..041a9f8 100644
--- a/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp
@@ -2,7 +2,7 @@
// detail/socket_option.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,6 +18,7 @@
#include <boost/asio/detail/config.hpp>
#include <cstddef>
#include <cstring>
+#include <stdexcept>
#include <boost/throw_exception.hpp>
#include <boost/asio/detail/socket_ops.hpp>
#include <boost/asio/detail/socket_types.hpp>
@@ -385,35 +386,22 @@ class multicast_request
public:
// Default constructor.
multicast_request()
+ : ipv4_value_(), // Zero-initialisation gives the "any" address.
+ ipv6_value_() // Zero-initialisation gives the "any" address.
{
- ipv4_value_.imr_multiaddr.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
- ipv4_value_.imr_interface.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
-
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
- ipv6_value_.ipv6mr_multiaddr = tmp_addr;
- ipv6_value_.ipv6mr_interface = 0;
}
// Construct with multicast address only.
explicit multicast_request(const boost::asio::ip::address& multicast_address)
+ : ipv4_value_(), // Zero-initialisation gives the "any" address.
+ ipv6_value_() // Zero-initialisation gives the "any" address.
{
if (multicast_address.is_v6())
{
- ipv4_value_.imr_multiaddr.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
- ipv4_value_.imr_interface.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
-
using namespace std; // For memcpy.
boost::asio::ip::address_v6 ipv6_address = multicast_address.to_v6();
boost::asio::ip::address_v6::bytes_type bytes = ipv6_address.to_bytes();
- memcpy(ipv6_value_.ipv6mr_multiaddr.s6_addr, bytes.elems, 16);
+ memcpy(ipv6_value_.ipv6mr_multiaddr.s6_addr, bytes.data(), 16);
ipv6_value_.ipv6mr_interface = 0;
}
else
@@ -424,10 +412,6 @@ public:
ipv4_value_.imr_interface.s_addr =
boost::asio::detail::socket_ops::host_to_network_long(
boost::asio::ip::address_v4::any().to_ulong());
-
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
- ipv6_value_.ipv6mr_multiaddr = tmp_addr;
- ipv6_value_.ipv6mr_interface = 0;
}
}
@@ -436,6 +420,7 @@ public:
const boost::asio::ip::address_v4& multicast_address,
const boost::asio::ip::address_v4& network_interface
= boost::asio::ip::address_v4::any())
+ : ipv6_value_() // Zero-initialisation gives the "any" address.
{
ipv4_value_.imr_multiaddr.s_addr =
boost::asio::detail::socket_ops::host_to_network_long(
@@ -443,28 +428,18 @@ public:
ipv4_value_.imr_interface.s_addr =
boost::asio::detail::socket_ops::host_to_network_long(
network_interface.to_ulong());
-
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
- ipv6_value_.ipv6mr_multiaddr = tmp_addr;
- ipv6_value_.ipv6mr_interface = 0;
}
// Construct with multicast address and IPv6 network interface index.
explicit multicast_request(
const boost::asio::ip::address_v6& multicast_address,
unsigned long network_interface = 0)
+ : ipv4_value_() // Zero-initialisation gives the "any" address.
{
- ipv4_value_.imr_multiaddr.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
- ipv4_value_.imr_interface.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
-
using namespace std; // For memcpy.
boost::asio::ip::address_v6::bytes_type bytes =
multicast_address.to_bytes();
- memcpy(ipv6_value_.ipv6mr_multiaddr.s6_addr, bytes.elems, 16);
+ memcpy(ipv6_value_.ipv6mr_multiaddr.s6_addr, bytes.data(), 16);
ipv6_value_.ipv6mr_interface = network_interface;
}
diff --git a/3rdParty/Boost/src/boost/asio/ip/host_name.hpp b/3rdParty/Boost/src/boost/asio/ip/host_name.hpp
index 33860c9..9e024e1 100644
--- a/3rdParty/Boost/src/boost/asio/ip/host_name.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/host_name.hpp
@@ -2,7 +2,7 @@
// ip/host_name.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/3rdParty/Boost/src/boost/asio/ip/icmp.hpp b/3rdParty/Boost/src/boost/asio/ip/icmp.hpp
index 14bb944..62748b6 100644
--- a/3rdParty/Boost/src/boost/asio/ip/icmp.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/icmp.hpp
@@ -2,7 +2,7 @@
// ip/icmp.hpp
// ~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -46,12 +46,6 @@ public:
/// The type of a ICMP endpoint.
typedef basic_endpoint<icmp> endpoint;
- /// (Deprecated: use resolver::query.) The type of a resolver query.
- typedef basic_resolver_query<icmp> resolver_query;
-
- /// (Deprecated: use resolver::iterator.) The type of a resolver iterator.
- typedef basic_resolver_iterator<icmp> resolver_iterator;
-
/// Construct to represent the IPv4 ICMP protocol.
static icmp v4()
{
@@ -102,9 +96,9 @@ public:
private:
// Construct with a specific family.
- explicit icmp(int protocol, int family)
- : protocol_(protocol),
- family_(family)
+ explicit icmp(int protocol_id, int protocol_family)
+ : protocol_(protocol_id),
+ family_(protocol_family)
{
}
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/address.hpp b/3rdParty/Boost/src/boost/asio/ip/impl/address.hpp
index 94dfb17..a875e1b 100644
--- a/3rdParty/Boost/src/boost/asio/ip/impl/address.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/address.hpp
@@ -2,7 +2,7 @@
// ip/impl/address.hpp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/address.ipp b/3rdParty/Boost/src/boost/asio/ip/impl/address.ipp
index 11f06fc..5353758 100644
--- a/3rdParty/Boost/src/boost/asio/ip/impl/address.ipp
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/address.ipp
@@ -2,7 +2,7 @@
// ip/impl/address.ipp
// ~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -57,6 +57,15 @@ address::address(const address& other)
{
}
+#if defined(BOOST_ASIO_HAS_MOVE)
+address::address(address&& other)
+ : type_(other.type_),
+ ipv4_address_(other.ipv4_address_),
+ ipv6_address_(other.ipv6_address_)
+{
+}
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
address& address::operator=(const address& other)
{
type_ = other.type_;
@@ -65,6 +74,16 @@ address& address::operator=(const address& other)
return *this;
}
+#if defined(BOOST_ASIO_HAS_MOVE)
+address& address::operator=(address&& other)
+{
+ type_ = other.type_;
+ ipv4_address_ = other.ipv4_address_;
+ ipv6_address_ = other.ipv6_address_;
+ return *this;
+}
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
address& address::operator=(const boost::asio::ip::address_v4& ipv4_address)
{
type_ = ipv4;
@@ -159,6 +178,27 @@ address address::from_string(const std::string& str,
return from_string(str.c_str(), ec);
}
+bool address::is_loopback() const
+{
+ return (type_ == ipv4)
+ ? ipv4_address_.is_loopback()
+ : ipv6_address_.is_loopback();
+}
+
+bool address::is_unspecified() const
+{
+ return (type_ == ipv4)
+ ? ipv4_address_.is_unspecified()
+ : ipv6_address_.is_unspecified();
+}
+
+bool address::is_multicast() const
+{
+ return (type_ == ipv4)
+ ? ipv4_address_.is_multicast()
+ : ipv6_address_.is_multicast();
+}
+
bool operator==(const address& a1, const address& a2)
{
if (a1.type_ != a2.type_)
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/address_v4.hpp b/3rdParty/Boost/src/boost/asio/ip/impl/address_v4.hpp
index d27d48d..87b0e19 100644
--- a/3rdParty/Boost/src/boost/asio/ip/impl/address_v4.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/address_v4.hpp
@@ -2,7 +2,7 @@
// ip/impl/address_v4.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/address_v4.ipp b/3rdParty/Boost/src/boost/asio/ip/impl/address_v4.ipp
index 8bdef19..31f6e27 100644
--- a/3rdParty/Boost/src/boost/asio/ip/impl/address_v4.ipp
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/address_v4.ipp
@@ -2,7 +2,7 @@
// ip/impl/address_v4.ipp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -42,7 +42,7 @@ address_v4::address_v4(const address_v4::bytes_type& bytes)
#endif // UCHAR_MAX > 0xFF
using namespace std; // For memcpy.
- memcpy(&addr_.s_addr, bytes.elems, 4);
+ memcpy(&addr_.s_addr, bytes.data(), 4);
}
address_v4::address_v4(unsigned long addr)
@@ -62,7 +62,11 @@ address_v4::bytes_type address_v4::to_bytes() const
{
using namespace std; // For memcpy.
bytes_type bytes;
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+ memcpy(bytes.data(), &addr_.s_addr, 4);
+#else // defined(BOOST_ASIO_HAS_STD_ARRAY)
memcpy(bytes.elems, &addr_.s_addr, 4);
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
return bytes;
}
@@ -119,24 +123,34 @@ address_v4 address_v4::from_string(
return from_string(str.c_str(), ec);
}
+bool address_v4::is_loopback() const
+{
+ return (to_ulong() & 0xFF000000) == 0x7F000000;
+}
+
+bool address_v4::is_unspecified() const
+{
+ return to_ulong() == 0;
+}
+
bool address_v4::is_class_a() const
{
- return IN_CLASSA(to_ulong());
+ return (to_ulong() & 0x80000000) == 0;
}
bool address_v4::is_class_b() const
{
- return IN_CLASSB(to_ulong());
+ return (to_ulong() & 0xC0000000) == 0x80000000;
}
bool address_v4::is_class_c() const
{
- return IN_CLASSC(to_ulong());
+ return (to_ulong() & 0xE0000000) == 0xC0000000;
}
bool address_v4::is_multicast() const
{
- return IN_MULTICAST(to_ulong());
+ return (to_ulong() & 0xF0000000) == 0xE0000000;
}
address_v4 address_v4::broadcast(const address_v4& addr, const address_v4& mask)
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/address_v6.hpp b/3rdParty/Boost/src/boost/asio/ip/impl/address_v6.hpp
index 11e1797..6993ef0 100644
--- a/3rdParty/Boost/src/boost/asio/ip/impl/address_v6.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/address_v6.hpp
@@ -2,7 +2,7 @@
// ip/impl/address_v6.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/address_v6.ipp b/3rdParty/Boost/src/boost/asio/ip/impl/address_v6.ipp
index 5a3dddd..9bf9e96 100644
--- a/3rdParty/Boost/src/boost/asio/ip/impl/address_v6.ipp
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/address_v6.ipp
@@ -2,7 +2,7 @@
// ip/impl/address_v6.ipp
// ~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -32,15 +32,14 @@ namespace asio {
namespace ip {
address_v6::address_v6()
- : scope_id_(0)
+ : addr_(),
+ scope_id_(0)
{
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
- addr_ = tmp_addr;
}
address_v6::address_v6(const address_v6::bytes_type& bytes,
- unsigned long scope_id)
- : scope_id_(scope_id)
+ unsigned long scope)
+ : scope_id_(scope)
{
#if UCHAR_MAX > 0xFF
for (std::size_t i = 0; i < bytes.size(); ++i)
@@ -54,7 +53,7 @@ address_v6::address_v6(const address_v6::bytes_type& bytes,
#endif // UCHAR_MAX > 0xFF
using namespace std; // For memcpy.
- memcpy(addr_.s6_addr, bytes.elems, 16);
+ memcpy(addr_.s6_addr, bytes.data(), 16);
}
address_v6::address_v6(const address_v6& other)
@@ -63,6 +62,14 @@ address_v6::address_v6(const address_v6& other)
{
}
+#if defined(BOOST_ASIO_HAS_MOVE)
+address_v6::address_v6(address_v6&& other)
+ : addr_(other.addr_),
+ scope_id_(other.scope_id_)
+{
+}
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
address_v6& address_v6::operator=(const address_v6& other)
{
addr_ = other.addr_;
@@ -70,11 +77,24 @@ address_v6& address_v6::operator=(const address_v6& other)
return *this;
}
+#if defined(BOOST_ASIO_HAS_MOVE)
+address_v6& address_v6::operator=(address_v6&& other)
+{
+ addr_ = other.addr_;
+ scope_id_ = other.scope_id_;
+ return *this;
+}
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
address_v6::bytes_type address_v6::to_bytes() const
{
using namespace std; // For memcpy.
bytes_type bytes;
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+ memcpy(bytes.data(), addr_.s6_addr, 16);
+#else // defined(BOOST_ASIO_HAS_STD_ARRAY)
memcpy(bytes.elems, addr_.s6_addr, 16);
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
return bytes;
}
@@ -141,7 +161,6 @@ address_v4 address_v6::to_v4() const
bool address_v6::is_loopback() const
{
-#if defined(__BORLANDC__)
return ((addr_.s6_addr[0] == 0) && (addr_.s6_addr[1] == 0)
&& (addr_.s6_addr[2] == 0) && (addr_.s6_addr[3] == 0)
&& (addr_.s6_addr[4] == 0) && (addr_.s6_addr[5] == 0)
@@ -150,15 +169,10 @@ bool address_v6::is_loopback() const
&& (addr_.s6_addr[10] == 0) && (addr_.s6_addr[11] == 0)
&& (addr_.s6_addr[12] == 0) && (addr_.s6_addr[13] == 0)
&& (addr_.s6_addr[14] == 0) && (addr_.s6_addr[15] == 1));
-#else
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_LOOPBACK(&addr_) != 0;
-#endif
}
bool address_v6::is_unspecified() const
{
-#if defined(__BORLANDC__)
return ((addr_.s6_addr[0] == 0) && (addr_.s6_addr[1] == 0)
&& (addr_.s6_addr[2] == 0) && (addr_.s6_addr[3] == 0)
&& (addr_.s6_addr[4] == 0) && (addr_.s6_addr[5] == 0)
@@ -167,70 +181,70 @@ bool address_v6::is_unspecified() const
&& (addr_.s6_addr[10] == 0) && (addr_.s6_addr[11] == 0)
&& (addr_.s6_addr[12] == 0) && (addr_.s6_addr[13] == 0)
&& (addr_.s6_addr[14] == 0) && (addr_.s6_addr[15] == 0));
-#else
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_UNSPECIFIED(&addr_) != 0;
-#endif
}
bool address_v6::is_link_local() const
{
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_LINKLOCAL(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0xfe) && ((addr_.s6_addr[1] & 0xc0) == 0x80));
}
bool address_v6::is_site_local() const
{
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_SITELOCAL(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0xfe) && ((addr_.s6_addr[1] & 0xc0) == 0xc0));
}
bool address_v6::is_v4_mapped() const
{
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_V4MAPPED(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0) && (addr_.s6_addr[1] == 0)
+ && (addr_.s6_addr[2] == 0) && (addr_.s6_addr[3] == 0)
+ && (addr_.s6_addr[4] == 0) && (addr_.s6_addr[5] == 0)
+ && (addr_.s6_addr[6] == 0) && (addr_.s6_addr[7] == 0)
+ && (addr_.s6_addr[8] == 0) && (addr_.s6_addr[9] == 0)
+ && (addr_.s6_addr[10] == 0xff) && (addr_.s6_addr[11] == 0xff));
}
bool address_v6::is_v4_compatible() const
{
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_V4COMPAT(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0) && (addr_.s6_addr[1] == 0)
+ && (addr_.s6_addr[2] == 0) && (addr_.s6_addr[3] == 0)
+ && (addr_.s6_addr[4] == 0) && (addr_.s6_addr[5] == 0)
+ && (addr_.s6_addr[6] == 0) && (addr_.s6_addr[7] == 0)
+ && (addr_.s6_addr[8] == 0) && (addr_.s6_addr[9] == 0)
+ && (addr_.s6_addr[10] == 0) && (addr_.s6_addr[11] == 0)
+ && !((addr_.s6_addr[12] == 0)
+ && (addr_.s6_addr[13] == 0)
+ && (addr_.s6_addr[14] == 0)
+ && ((addr_.s6_addr[15] == 0) || (addr_.s6_addr[15] == 1))));
}
bool address_v6::is_multicast() const
{
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MULTICAST(&addr_) != 0;
+ return (addr_.s6_addr[0] == 0xff);
}
bool address_v6::is_multicast_global() const
{
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MC_GLOBAL(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0xff) && ((addr_.s6_addr[1] & 0x0f) == 0x0e));
}
bool address_v6::is_multicast_link_local() const
{
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MC_LINKLOCAL(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0xff) && ((addr_.s6_addr[1] & 0x0f) == 0x02));
}
bool address_v6::is_multicast_node_local() const
{
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MC_NODELOCAL(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0xff) && ((addr_.s6_addr[1] & 0x0f) == 0x01));
}
bool address_v6::is_multicast_org_local() const
{
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MC_ORGLOCAL(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0xff) && ((addr_.s6_addr[1] & 0x0f) == 0x08));
}
bool address_v6::is_multicast_site_local() const
{
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MC_SITELOCAL(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0xff) && ((addr_.s6_addr[1] & 0x0f) == 0x05));
}
bool operator==(const address_v6& a1, const address_v6& a2)
@@ -256,8 +270,7 @@ bool operator<(const address_v6& a1, const address_v6& a2)
address_v6 address_v6::loopback()
{
address_v6 tmp;
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_LOOPBACK_INIT;
- tmp.addr_ = tmp_addr;
+ tmp.addr_.s6_addr[15] = 1;
return tmp;
}
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/basic_endpoint.hpp b/3rdParty/Boost/src/boost/asio/ip/impl/basic_endpoint.hpp
index 9d39c87..681d76e 100644
--- a/3rdParty/Boost/src/boost/asio/ip/impl/basic_endpoint.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/basic_endpoint.hpp
@@ -2,7 +2,7 @@
// ip/impl/basic_endpoint.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/host_name.ipp b/3rdParty/Boost/src/boost/asio/ip/impl/host_name.ipp
index 734341e..cbac039 100644
--- a/3rdParty/Boost/src/boost/asio/ip/impl/host_name.ipp
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/host_name.ipp
@@ -2,7 +2,7 @@
// ip/impl/host_name.ipp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/3rdParty/Boost/src/boost/asio/ip/multicast.hpp b/3rdParty/Boost/src/boost/asio/ip/multicast.hpp
index 2a02627..a0a3c41 100644
--- a/3rdParty/Boost/src/boost/asio/ip/multicast.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/multicast.hpp
@@ -2,7 +2,7 @@
// ip/multicast.hpp
// ~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp b/3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp
index 96ad512..4e281a6 100644
--- a/3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp
@@ -2,7 +2,7 @@
// ip/resolver_query_base.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp b/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp
index db0554b..74915d2 100644
--- a/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp
@@ -2,7 +2,7 @@
// ip/resolver_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -77,12 +77,6 @@ public:
{
}
- /// Destroy all user-defined handler objects owned by the service.
- void shutdown_service()
- {
- service_impl_.shutdown_service();
- }
-
/// Construct a new resolver implementation.
void construct(implementation_type& impl)
{
@@ -109,11 +103,12 @@ public:
}
/// Asynchronously resolve a query to a list of entries.
- template <typename Handler>
+ template <typename ResolveHandler>
void async_resolve(implementation_type& impl, const query_type& query,
- Handler handler)
+ BOOST_ASIO_MOVE_ARG(ResolveHandler) handler)
{
- service_impl_.async_resolve(impl, query, handler);
+ service_impl_.async_resolve(impl, query,
+ BOOST_ASIO_MOVE_CAST(ResolveHandler)(handler));
}
/// Resolve an endpoint to a list of entries.
@@ -126,12 +121,25 @@ public:
/// Asynchronously resolve an endpoint to a list of entries.
template <typename ResolveHandler>
void async_resolve(implementation_type& impl, const endpoint_type& endpoint,
- ResolveHandler handler)
+ BOOST_ASIO_MOVE_ARG(ResolveHandler) handler)
{
- return service_impl_.async_resolve(impl, endpoint, handler);
+ return service_impl_.async_resolve(impl, endpoint,
+ BOOST_ASIO_MOVE_CAST(ResolveHandler)(handler));
}
private:
+ // Destroy all user-defined handler objects owned by the service.
+ void shutdown_service()
+ {
+ service_impl_.shutdown_service();
+ }
+
+ // Perform any fork-related housekeeping.
+ void fork_service(boost::asio::io_service::fork_event event)
+ {
+ service_impl_.fork_service(event);
+ }
+
// The platform-specific implementation.
service_impl_type service_impl_;
};
diff --git a/3rdParty/Boost/src/boost/asio/ip/tcp.hpp b/3rdParty/Boost/src/boost/asio/ip/tcp.hpp
index 4163a8d..0256e6f 100644
--- a/3rdParty/Boost/src/boost/asio/ip/tcp.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/tcp.hpp
@@ -2,7 +2,7 @@
// ip/tcp.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -49,12 +49,6 @@ public:
/// The type of a TCP endpoint.
typedef basic_endpoint<tcp> endpoint;
- /// (Deprecated: use resolver::query.) The type of a resolver query.
- typedef basic_resolver_query<tcp> resolver_query;
-
- /// (Deprecated: use resolver::iterator.) The type of a resolver iterator.
- typedef basic_resolver_iterator<tcp> resolver_iterator;
-
/// Construct to represent the IPv4 TCP protocol.
static tcp v4()
{
@@ -146,8 +140,8 @@ public:
private:
// Construct with a specific family.
- explicit tcp(int family)
- : family_(family)
+ explicit tcp(int protocol_family)
+ : family_(protocol_family)
{
}
diff --git a/3rdParty/Boost/src/boost/asio/ip/udp.hpp b/3rdParty/Boost/src/boost/asio/ip/udp.hpp
index 40f5d3a..acf61ef 100644
--- a/3rdParty/Boost/src/boost/asio/ip/udp.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/udp.hpp
@@ -2,7 +2,7 @@
// ip/udp.hpp
// ~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -46,12 +46,6 @@ public:
/// The type of a UDP endpoint.
typedef basic_endpoint<udp> endpoint;
- /// (Deprecated: use resolver::query.) The type of a resolver query.
- typedef basic_resolver_query<udp> resolver_query;
-
- /// (Deprecated: use resolver::iterator.) The type of a resolver iterator.
- typedef basic_resolver_iterator<udp> resolver_iterator;
-
/// Construct to represent the IPv4 UDP protocol.
static udp v4()
{
@@ -102,8 +96,8 @@ public:
private:
// Construct with a specific family.
- explicit udp(int family)
- : family_(family)
+ explicit udp(int protocol_family)
+ : family_(protocol_family)
{
}
diff --git a/3rdParty/Boost/src/boost/asio/ip/unicast.hpp b/3rdParty/Boost/src/boost/asio/ip/unicast.hpp
index dc7d8e9..5ff0dc8 100644
--- a/3rdParty/Boost/src/boost/asio/ip/unicast.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/unicast.hpp
@@ -2,7 +2,7 @@
// ip/unicast.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
diff --git a/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp b/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp
index e67a548..0441991 100644
--- a/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp
@@ -2,7 +2,7 @@
// ip/v6_only.hpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)