summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-11-24 20:33:19 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-11-24 20:35:17 (GMT)
commit332d60c56dfaa11fdd135088279d15cd5983b3d4 (patch)
treedd77717a4e1732da929d5ff8a0471fa3f005e201 /3rdParty/Boost/src/boost/asio/ip
parent90c44a10fec26d2a0935b2d62e82b6a5be028373 (diff)
downloadswift-332d60c56dfaa11fdd135088279d15cd5983b3d4.zip
swift-332d60c56dfaa11fdd135088279d15cd5983b3d4.tar.bz2
Upgraded Boost to 1.45.0.
Diffstat (limited to '3rdParty/Boost/src/boost/asio/ip')
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/address.hpp205
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/address_v4.hpp173
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/address_v6.hpp303
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp233
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp11
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp9
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp16
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp13
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/detail/endpoint.hpp142
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp193
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp15
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/host_name.hpp42
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/icmp.hpp11
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/address.hpp55
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/address.ipp188
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/address_v4.hpp55
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/address_v4.ipp164
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/address_v6.hpp55
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/address_v6.ipp286
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/basic_endpoint.hpp57
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/impl/host_name.ipp56
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/multicast.hpp13
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp13
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp21
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/tcp.hpp13
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/udp.hpp11
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/unicast.hpp13
-rw-r--r--3rdParty/Boost/src/boost/asio/ip/v6_only.hpp9
28 files changed, 1524 insertions, 851 deletions
diff --git a/3rdParty/Boost/src/boost/asio/ip/address.hpp b/3rdParty/Boost/src/boost/asio/ip/address.hpp
index 16113f0..8cc3a4b 100644
--- a/3rdParty/Boost/src/boost/asio/ip/address.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/address.hpp
@@ -1,6 +1,6 @@
//
-// address.hpp
-// ~~~~~~~~~~~
+// ip/address.hpp
+// ~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,21 +15,17 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
+#include <boost/asio/detail/config.hpp>
+#include <string>
+#include <boost/system/error_code.hpp>
+#include <boost/asio/ip/address_v4.hpp>
+#include <boost/asio/ip/address_v6.hpp>
-#include <boost/asio/detail/push_options.hpp>
-#include <boost/config.hpp>
#if !defined(BOOST_NO_IOSTREAM)
# include <iosfwd>
#endif // !defined(BOOST_NO_IOSTREAM)
-#include <string>
-#include <boost/throw_exception.hpp>
-#include <boost/asio/detail/pop_options.hpp>
-#include <boost/asio/error.hpp>
-#include <boost/asio/ip/address_v4.hpp>
-#include <boost/asio/ip/address_v6.hpp>
-#include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
@@ -48,63 +44,27 @@ class address
{
public:
/// Default constructor.
- address()
- : type_(ipv4),
- ipv4_address_(),
- ipv6_address_()
- {
- }
+ BOOST_ASIO_DECL address();
/// Construct an address from an IPv4 address.
- address(const boost::asio::ip::address_v4& ipv4_address)
- : type_(ipv4),
- ipv4_address_(ipv4_address),
- ipv6_address_()
- {
- }
+ BOOST_ASIO_DECL address(const boost::asio::ip::address_v4& ipv4_address);
/// Construct an address from an IPv6 address.
- address(const boost::asio::ip::address_v6& ipv6_address)
- : type_(ipv6),
- ipv4_address_(),
- ipv6_address_(ipv6_address)
- {
- }
+ BOOST_ASIO_DECL address(const boost::asio::ip::address_v6& ipv6_address);
/// Copy constructor.
- address(const address& other)
- : type_(other.type_),
- ipv4_address_(other.ipv4_address_),
- ipv6_address_(other.ipv6_address_)
- {
- }
+ BOOST_ASIO_DECL address(const address& other);
/// Assign from another address.
- address& operator=(const address& other)
- {
- type_ = other.type_;
- ipv4_address_ = other.ipv4_address_;
- ipv6_address_ = other.ipv6_address_;
- return *this;
- }
+ BOOST_ASIO_DECL address& operator=(const address& other);
/// Assign from an IPv4 address.
- address& operator=(const boost::asio::ip::address_v4& ipv4_address)
- {
- type_ = ipv4;
- ipv4_address_ = ipv4_address;
- ipv6_address_ = boost::asio::ip::address_v6();
- return *this;
- }
+ BOOST_ASIO_DECL address& operator=(
+ const boost::asio::ip::address_v4& ipv4_address);
/// Assign from an IPv6 address.
- address& operator=(const boost::asio::ip::address_v6& ipv6_address)
- {
- type_ = ipv6;
- ipv4_address_ = boost::asio::ip::address_v4();
- ipv6_address_ = ipv6_address;
- return *this;
- }
+ BOOST_ASIO_DECL address& operator=(
+ const boost::asio::ip::address_v6& ipv6_address);
/// Get whether the address is an IP version 4 address.
bool is_v4() const
@@ -119,127 +79,63 @@ public:
}
/// Get the address as an IP version 4 address.
- boost::asio::ip::address_v4 to_v4() const
- {
- if (type_ != ipv4)
- {
- boost::system::system_error e(
- boost::asio::error::address_family_not_supported);
- boost::throw_exception(e);
- }
- return ipv4_address_;
- }
+ BOOST_ASIO_DECL boost::asio::ip::address_v4 to_v4() const;
/// Get the address as an IP version 6 address.
- boost::asio::ip::address_v6 to_v6() const
- {
- if (type_ != ipv6)
- {
- boost::system::system_error e(
- boost::asio::error::address_family_not_supported);
- boost::throw_exception(e);
- }
- return ipv6_address_;
- }
+ BOOST_ASIO_DECL boost::asio::ip::address_v6 to_v6() const;
/// Get the address as a string in dotted decimal format.
- std::string to_string() const
- {
- if (type_ == ipv6)
- return ipv6_address_.to_string();
- return ipv4_address_.to_string();
- }
+ BOOST_ASIO_DECL std::string to_string() const;
/// Get the address as a string in dotted decimal format.
- std::string to_string(boost::system::error_code& ec) const
- {
- if (type_ == ipv6)
- return ipv6_address_.to_string(ec);
- return ipv4_address_.to_string(ec);
- }
+ BOOST_ASIO_DECL std::string to_string(boost::system::error_code& ec) const;
/// Create an address from an IPv4 address string in dotted decimal form,
/// or from an IPv6 address in hexadecimal notation.
- static address from_string(const char* str)
- {
- boost::system::error_code ec;
- address addr = from_string(str, ec);
- boost::asio::detail::throw_error(ec);
- return addr;
- }
+ BOOST_ASIO_DECL static address from_string(const char* str);
/// Create an address from an IPv4 address string in dotted decimal form,
/// or from an IPv6 address in hexadecimal notation.
- static address from_string(const char* str, boost::system::error_code& ec)
- {
- boost::asio::ip::address_v6 ipv6_address =
- boost::asio::ip::address_v6::from_string(str, ec);
- if (!ec)
- {
- address tmp;
- tmp.type_ = ipv6;
- tmp.ipv6_address_ = ipv6_address;
- return tmp;
- }
-
- boost::asio::ip::address_v4 ipv4_address =
- boost::asio::ip::address_v4::from_string(str, ec);
- if (!ec)
- {
- address tmp;
- tmp.type_ = ipv4;
- tmp.ipv4_address_ = ipv4_address;
- return tmp;
- }
-
- return address();
- }
+ BOOST_ASIO_DECL static address from_string(
+ const char* str, boost::system::error_code& ec);
/// Create an address from an IPv4 address string in dotted decimal form,
/// or from an IPv6 address in hexadecimal notation.
- static address from_string(const std::string& str)
- {
- return from_string(str.c_str());
- }
+ BOOST_ASIO_DECL static address from_string(const std::string& str);
/// Create an address from an IPv4 address string in dotted decimal form,
/// or from an IPv6 address in hexadecimal notation.
- static address from_string(const std::string& str,
- boost::system::error_code& ec)
+ BOOST_ASIO_DECL static address from_string(
+ const std::string& str, boost::system::error_code& ec);
+
+ /// Compare two addresses for equality.
+ BOOST_ASIO_DECL friend bool operator==(const address& a1, const address& a2);
+
+ /// Compare two addresses for inequality.
+ friend bool operator!=(const address& a1, const address& a2)
{
- return from_string(str.c_str(), ec);
+ return !(a1 == a2);
}
- /// Compare two addresses for equality.
- friend bool operator==(const address& a1, const address& a2)
+ /// Compare addresses for ordering.
+ BOOST_ASIO_DECL friend bool operator<(const address& a1, const address& a2);
+
+ /// Compare addresses for ordering.
+ friend bool operator>(const address& a1, const address& a2)
{
- if (a1.type_ != a2.type_)
- return false;
- if (a1.type_ == ipv6)
- return a1.ipv6_address_ == a2.ipv6_address_;
- return a1.ipv4_address_ == a2.ipv4_address_;
+ return a2 < a1;
}
- /// Compare two addresses for inequality.
- friend bool operator!=(const address& a1, const address& a2)
+ /// Compare addresses for ordering.
+ friend bool operator<=(const address& a1, const address& a2)
{
- if (a1.type_ != a2.type_)
- return true;
- if (a1.type_ == ipv6)
- return a1.ipv6_address_ != a2.ipv6_address_;
- return a1.ipv4_address_ != a2.ipv4_address_;
+ return !(a2 < a1);
}
/// Compare addresses for ordering.
- friend bool operator<(const address& a1, const address& a2)
+ friend bool operator>=(const address& a1, const address& a2)
{
- if (a1.type_ < a2.type_)
- return true;
- if (a1.type_ > a2.type_)
- return false;
- if (a1.type_ == ipv6)
- return a1.ipv6_address_ < a2.ipv6_address_;
- return a1.ipv4_address_ < a2.ipv4_address_;
+ return !(a1 < a2);
}
private:
@@ -269,11 +165,7 @@ private:
*/
template <typename Elem, typename Traits>
std::basic_ostream<Elem, Traits>& operator<<(
- std::basic_ostream<Elem, Traits>& os, const address& addr)
-{
- os << addr.to_string();
- return os;
-}
+ std::basic_ostream<Elem, Traits>& os, const address& addr);
#endif // !defined(BOOST_NO_IOSTREAM)
@@ -283,4 +175,9 @@ std::basic_ostream<Elem, Traits>& operator<<(
#include <boost/asio/detail/pop_options.hpp>
+#include <boost/asio/ip/impl/address.hpp>
+#if defined(BOOST_ASIO_HEADER_ONLY)
+# include <boost/asio/ip/impl/address.ipp>
+#endif // defined(BOOST_ASIO_HEADER_ONLY)
+
#endif // BOOST_ASIO_IP_ADDRESS_HPP
diff --git a/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp b/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp
index 47d36b5..21c1a7f 100644
--- a/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp
@@ -1,6 +1,6 @@
//
-// address_v4.hpp
-// ~~~~~~~~~~~~~~
+// ip/address_v4.hpp
+// ~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,24 +15,18 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
+#include <boost/asio/detail/config.hpp>
+#include <string>
+#include <boost/array.hpp>
+#include <boost/asio/detail/socket_types.hpp>
+#include <boost/asio/detail/winsock_init.hpp>
+#include <boost/system/error_code.hpp>
-#include <boost/asio/detail/push_options.hpp>
-#include <boost/config.hpp>
#if !defined(BOOST_NO_IOSTREAM)
# include <iosfwd>
#endif // !defined(BOOST_NO_IOSTREAM)
-#include <climits>
-#include <string>
-#include <stdexcept>
-#include <boost/array.hpp>
-#include <boost/throw_exception.hpp>
-#include <boost/asio/detail/pop_options.hpp>
-#include <boost/asio/error.hpp>
-#include <boost/asio/detail/socket_ops.hpp>
-#include <boost/asio/detail/socket_types.hpp>
-#include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
@@ -60,34 +54,10 @@ public:
}
/// Construct an address from raw bytes.
- explicit address_v4(const bytes_type& bytes)
- {
-#if UCHAR_MAX > 0xFF
- if (bytes[0] > 0xFF || bytes[1] > 0xFF
- || bytes[2] > 0xFF || bytes[3] > 0xFF)
- {
- std::out_of_range ex("address_v4 from bytes_type");
- boost::throw_exception(ex);
- }
-#endif // UCHAR_MAX > 0xFF
-
- using namespace std; // For memcpy.
- memcpy(&addr_.s_addr, bytes.elems, 4);
- }
+ BOOST_ASIO_DECL explicit address_v4(const bytes_type& bytes);
/// Construct an address from a unsigned long in host byte order.
- explicit address_v4(unsigned long addr)
- {
-#if ULONG_MAX > 0xFFFFFFFF
- if (addr > 0xFFFFFFFF)
- {
- std::out_of_range ex("address_v4 from unsigned long");
- boost::throw_exception(ex);
- }
-#endif // ULONG_MAX > 0xFFFFFFFF
-
- addr_.s_addr = boost::asio::detail::socket_ops::host_to_network_long(addr);
- }
+ BOOST_ASIO_DECL explicit address_v4(unsigned long addr);
/// Copy constructor.
address_v4(const address_v4& other)
@@ -103,96 +73,42 @@ public:
}
/// Get the address in bytes, in network byte order.
- bytes_type to_bytes() const
- {
- using namespace std; // For memcpy.
- bytes_type bytes;
- memcpy(bytes.elems, &addr_.s_addr, 4);
- return bytes;
- }
+ BOOST_ASIO_DECL bytes_type to_bytes() const;
/// Get the address as an unsigned long in host byte order
- unsigned long to_ulong() const
- {
- return boost::asio::detail::socket_ops::network_to_host_long(addr_.s_addr);
- }
+ BOOST_ASIO_DECL unsigned long to_ulong() const;
/// Get the address as a string in dotted decimal format.
- std::string to_string() const
- {
- boost::system::error_code ec;
- std::string addr = to_string(ec);
- boost::asio::detail::throw_error(ec);
- return addr;
- }
+ BOOST_ASIO_DECL std::string to_string() const;
/// Get the address as a string in dotted decimal format.
- std::string to_string(boost::system::error_code& ec) const
- {
- char addr_str[boost::asio::detail::max_addr_v4_str_len];
- const char* addr =
- boost::asio::detail::socket_ops::inet_ntop(AF_INET, &addr_, addr_str,
- boost::asio::detail::max_addr_v4_str_len, 0, ec);
- if (addr == 0)
- return std::string();
- return addr;
- }
+ BOOST_ASIO_DECL std::string to_string(boost::system::error_code& ec) const;
/// Create an address from an IP address string in dotted decimal form.
- static address_v4 from_string(const char* str)
- {
- boost::system::error_code ec;
- address_v4 addr = from_string(str, ec);
- boost::asio::detail::throw_error(ec);
- return addr;
- }
+ BOOST_ASIO_DECL static address_v4 from_string(const char* str);
/// Create an address from an IP address string in dotted decimal form.
- static address_v4 from_string(const char* str, boost::system::error_code& ec)
- {
- address_v4 tmp;
- if (boost::asio::detail::socket_ops::inet_pton(
- AF_INET, str, &tmp.addr_, 0, ec) <= 0)
- return address_v4();
- return tmp;
- }
+ BOOST_ASIO_DECL static address_v4 from_string(
+ const char* str, boost::system::error_code& ec);
/// Create an address from an IP address string in dotted decimal form.
- static address_v4 from_string(const std::string& str)
- {
- return from_string(str.c_str());
- }
+ BOOST_ASIO_DECL static address_v4 from_string(const std::string& str);
/// Create an address from an IP address string in dotted decimal form.
- static address_v4 from_string(const std::string& str,
- boost::system::error_code& ec)
- {
- return from_string(str.c_str(), ec);
- }
+ BOOST_ASIO_DECL static address_v4 from_string(
+ const std::string& str, boost::system::error_code& ec);
/// Determine whether the address is a class A address.
- bool is_class_a() const
- {
- return IN_CLASSA(to_ulong());
- }
+ BOOST_ASIO_DECL bool is_class_a() const;
/// Determine whether the address is a class B address.
- bool is_class_b() const
- {
- return IN_CLASSB(to_ulong());
- }
+ BOOST_ASIO_DECL bool is_class_b() const;
/// Determine whether the address is a class C address.
- bool is_class_c() const
- {
- return IN_CLASSC(to_ulong());
- }
+ BOOST_ASIO_DECL bool is_class_c() const;
/// Determine whether the address is a multicast address.
- bool is_multicast() const
- {
- return IN_MULTICAST(to_ulong());
- }
+ BOOST_ASIO_DECL bool is_multicast() const;
/// Compare two addresses for equality.
friend bool operator==(const address_v4& a1, const address_v4& a2)
@@ -250,23 +166,12 @@ public:
/// Obtain an address object that represents the broadcast address that
/// corresponds to the specified address and netmask.
- static address_v4 broadcast(const address_v4& addr, const address_v4& mask)
- {
- return address_v4(addr.to_ulong() | ~mask.to_ulong());
- }
+ BOOST_ASIO_DECL static address_v4 broadcast(
+ const address_v4& addr, const address_v4& mask);
/// Obtain the netmask that corresponds to the address, based on its address
/// class.
- static address_v4 netmask(const address_v4& addr)
- {
- if (addr.is_class_a())
- return address_v4(0xFF000000);
- if (addr.is_class_b())
- return address_v4(0xFFFF0000);
- if (addr.is_class_c())
- return address_v4(0xFFFFFF00);
- return address_v4(0xFFFFFFFF);
- }
+ BOOST_ASIO_DECL static address_v4 netmask(const address_v4& addr);
private:
// The underlying IPv4 address.
@@ -289,22 +194,7 @@ private:
*/
template <typename Elem, typename Traits>
std::basic_ostream<Elem, Traits>& operator<<(
- std::basic_ostream<Elem, Traits>& os, const address_v4& addr)
-{
- boost::system::error_code ec;
- std::string s = addr.to_string(ec);
- if (ec)
- {
- if (os.exceptions() & std::ios::failbit)
- boost::asio::detail::throw_error(ec);
- else
- os.setstate(std::ios_base::failbit);
- }
- else
- for (std::string::iterator i = s.begin(); i != s.end(); ++i)
- os << os.widen(*i);
- return os;
-}
+ std::basic_ostream<Elem, Traits>& os, const address_v4& addr);
#endif // !defined(BOOST_NO_IOSTREAM)
@@ -314,4 +204,9 @@ std::basic_ostream<Elem, Traits>& operator<<(
#include <boost/asio/detail/pop_options.hpp>
+#include <boost/asio/ip/impl/address_v4.hpp>
+#if defined(BOOST_ASIO_HEADER_ONLY)
+# include <boost/asio/ip/impl/address_v4.ipp>
+#endif // defined(BOOST_ASIO_HEADER_ONLY)
+
#endif // BOOST_ASIO_IP_ADDRESS_V4_HPP
diff --git a/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp b/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp
index 5685f08..7165eac 100644
--- a/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp
@@ -1,6 +1,6 @@
//
-// address_v6.hpp
-// ~~~~~~~~~~~~~~
+// ip/address_v6.hpp
+// ~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,26 +15,19 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
+#include <boost/asio/detail/config.hpp>
+#include <string>
+#include <boost/array.hpp>
+#include <boost/asio/detail/socket_types.hpp>
+#include <boost/asio/detail/winsock_init.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/asio/ip/address_v4.hpp>
-#include <boost/asio/detail/push_options.hpp>
-#include <boost/config.hpp>
#if !defined(BOOST_NO_IOSTREAM)
# include <iosfwd>
#endif // !defined(BOOST_NO_IOSTREAM)
-#include <cstring>
-#include <string>
-#include <stdexcept>
-#include <typeinfo>
-#include <boost/array.hpp>
-#include <boost/throw_exception.hpp>
-#include <boost/asio/detail/pop_options.hpp>
-#include <boost/asio/error.hpp>
-#include <boost/asio/detail/socket_ops.hpp>
-#include <boost/asio/detail/socket_types.hpp>
-#include <boost/asio/detail/throw_error.hpp>
-#include <boost/asio/ip/address_v4.hpp>
+#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
@@ -56,46 +49,17 @@ public:
typedef boost::array<unsigned char, 16> bytes_type;
/// Default constructor.
- address_v6()
- : scope_id_(0)
- {
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
- addr_ = tmp_addr;
- }
+ BOOST_ASIO_DECL address_v6();
/// Construct an address from raw bytes and scope ID.
- explicit address_v6(const bytes_type& bytes, unsigned long scope_id = 0)
- : scope_id_(scope_id)
- {
-#if UCHAR_MAX > 0xFF
- for (std::size_t i = 0; i < bytes.size(); ++i)
- {
- if (bytes[i] > 0xFF)
- {
- std::out_of_range ex("address_v6 from bytes_type");
- boost::throw_exception(ex);
- }
- }
-#endif // UCHAR_MAX > 0xFF
-
- using namespace std; // For memcpy.
- memcpy(addr_.s6_addr, bytes.elems, 16);
- }
+ BOOST_ASIO_DECL explicit address_v6(const bytes_type& bytes,
+ unsigned long scope_id = 0);
/// Copy constructor.
- address_v6(const address_v6& other)
- : addr_(other.addr_),
- scope_id_(other.scope_id_)
- {
- }
+ BOOST_ASIO_DECL address_v6(const address_v6& other);
/// Assign from another address.
- address_v6& operator=(const address_v6& other)
- {
- addr_ = other.addr_;
- scope_id_ = other.scope_id_;
- return *this;
- }
+ BOOST_ASIO_DECL address_v6& operator=(const address_v6& other);
/// The scope ID of the address.
/**
@@ -116,217 +80,80 @@ public:
}
/// Get the address in bytes, in network byte order.
- bytes_type to_bytes() const
- {
- using namespace std; // For memcpy.
- bytes_type bytes;
- memcpy(bytes.elems, addr_.s6_addr, 16);
- return bytes;
- }
+ BOOST_ASIO_DECL bytes_type to_bytes() const;
/// Get the address as a string.
- std::string to_string() const
- {
- boost::system::error_code ec;
- std::string addr = to_string(ec);
- boost::asio::detail::throw_error(ec);
- return addr;
- }
+ BOOST_ASIO_DECL std::string to_string() const;
/// Get the address as a string.
- std::string to_string(boost::system::error_code& ec) const
- {
- char addr_str[boost::asio::detail::max_addr_v6_str_len];
- const char* addr =
- boost::asio::detail::socket_ops::inet_ntop(AF_INET6, &addr_, addr_str,
- boost::asio::detail::max_addr_v6_str_len, scope_id_, ec);
- if (addr == 0)
- return std::string();
- return addr;
- }
+ BOOST_ASIO_DECL std::string to_string(boost::system::error_code& ec) const;
/// Create an address from an IP address string.
- static address_v6 from_string(const char* str)
- {
- boost::system::error_code ec;
- address_v6 addr = from_string(str, ec);
- boost::asio::detail::throw_error(ec);
- return addr;
- }
+ BOOST_ASIO_DECL static address_v6 from_string(const char* str);
/// Create an address from an IP address string.
- static address_v6 from_string(const char* str, boost::system::error_code& ec)
- {
- address_v6 tmp;
- if (boost::asio::detail::socket_ops::inet_pton(
- AF_INET6, str, &tmp.addr_, &tmp.scope_id_, ec) <= 0)
- return address_v6();
- return tmp;
- }
+ BOOST_ASIO_DECL static address_v6 from_string(
+ const char* str, boost::system::error_code& ec);
/// Create an address from an IP address string.
- static address_v6 from_string(const std::string& str)
- {
- return from_string(str.c_str());
- }
+ BOOST_ASIO_DECL static address_v6 from_string(const std::string& str);
/// Create an address from an IP address string.
- static address_v6 from_string(const std::string& str,
- boost::system::error_code& ec)
- {
- return from_string(str.c_str(), ec);
- }
+ BOOST_ASIO_DECL static address_v6 from_string(
+ const std::string& str, boost::system::error_code& ec);
/// Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address.
- address_v4 to_v4() const
- {
- if (!is_v4_mapped() && !is_v4_compatible())
- {
- std::bad_cast ex;
- boost::throw_exception(ex);
- }
-
- address_v4::bytes_type v4_bytes = { { addr_.s6_addr[12],
- addr_.s6_addr[13], addr_.s6_addr[14], addr_.s6_addr[15] } };
- return address_v4(v4_bytes);
- }
+ BOOST_ASIO_DECL address_v4 to_v4() const;
/// Determine whether the address is a loopback address.
- bool 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)
- && (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] == 1));
-#else
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_LOOPBACK(&addr_) != 0;
-#endif
- }
+ BOOST_ASIO_DECL bool is_loopback() const;
/// Determine whether the address is unspecified.
- bool 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)
- && (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));
-#else
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_UNSPECIFIED(&addr_) != 0;
-#endif
- }
+ BOOST_ASIO_DECL bool is_unspecified() const;
/// Determine whether the address is link local.
- bool is_link_local() const
- {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_LINKLOCAL(&addr_) != 0;
- }
+ BOOST_ASIO_DECL bool is_link_local() const;
/// Determine whether the address is site local.
- bool is_site_local() const
- {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_SITELOCAL(&addr_) != 0;
- }
+ BOOST_ASIO_DECL bool is_site_local() const;
/// Determine whether the address is a mapped IPv4 address.
- bool is_v4_mapped() const
- {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_V4MAPPED(&addr_) != 0;
- }
+ BOOST_ASIO_DECL bool is_v4_mapped() const;
/// Determine whether the address is an IPv4-compatible address.
- bool is_v4_compatible() const
- {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_V4COMPAT(&addr_) != 0;
- }
+ BOOST_ASIO_DECL bool is_v4_compatible() const;
/// Determine whether the address is a multicast address.
- bool is_multicast() const
- {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MULTICAST(&addr_) != 0;
- }
+ BOOST_ASIO_DECL bool is_multicast() const;
/// Determine whether the address is a global multicast address.
- bool is_multicast_global() const
- {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MC_GLOBAL(&addr_) != 0;
- }
+ BOOST_ASIO_DECL bool is_multicast_global() const;
/// Determine whether the address is a link-local multicast address.
- bool is_multicast_link_local() const
- {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MC_LINKLOCAL(&addr_) != 0;
- }
+ BOOST_ASIO_DECL bool is_multicast_link_local() const;
/// Determine whether the address is a node-local multicast address.
- bool is_multicast_node_local() const
- {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MC_NODELOCAL(&addr_) != 0;
- }
+ BOOST_ASIO_DECL bool is_multicast_node_local() const;
/// Determine whether the address is a org-local multicast address.
- bool is_multicast_org_local() const
- {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MC_ORGLOCAL(&addr_) != 0;
- }
+ BOOST_ASIO_DECL bool is_multicast_org_local() const;
/// Determine whether the address is a site-local multicast address.
- bool is_multicast_site_local() const
- {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MC_SITELOCAL(&addr_) != 0;
- }
+ BOOST_ASIO_DECL bool is_multicast_site_local() const;
/// Compare two addresses for equality.
- friend bool operator==(const address_v6& a1, const address_v6& a2)
- {
- using namespace std; // For memcmp.
- return memcmp(&a1.addr_, &a2.addr_,
- sizeof(boost::asio::detail::in6_addr_type)) == 0
- && a1.scope_id_ == a2.scope_id_;
- }
+ BOOST_ASIO_DECL friend bool operator==(
+ const address_v6& a1, const address_v6& a2);
/// Compare two addresses for inequality.
friend bool operator!=(const address_v6& a1, const address_v6& a2)
{
- using namespace std; // For memcmp.
- return memcmp(&a1.addr_, &a2.addr_,
- sizeof(boost::asio::detail::in6_addr_type)) != 0
- || a1.scope_id_ != a2.scope_id_;
+ return !(a1 == a2);
}
/// Compare addresses for ordering.
- friend bool operator<(const address_v6& a1, const address_v6& a2)
- {
- using namespace std; // For memcmp.
- int memcmp_result = memcmp(&a1.addr_, &a2.addr_,
- sizeof(boost::asio::detail::in6_addr_type));
- if (memcmp_result < 0)
- return true;
- if (memcmp_result > 0)
- return false;
- return a1.scope_id_ < a2.scope_id_;
- }
+ BOOST_ASIO_DECL friend bool operator<(
+ const address_v6& a1, const address_v6& a2);
/// Compare addresses for ordering.
friend bool operator>(const address_v6& a1, const address_v6& a2)
@@ -353,31 +180,13 @@ public:
}
/// Obtain an address object that represents the loopback address.
- static address_v6 loopback()
- {
- address_v6 tmp;
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_LOOPBACK_INIT;
- tmp.addr_ = tmp_addr;
- return tmp;
- }
+ BOOST_ASIO_DECL static address_v6 loopback();
/// Create an IPv4-mapped IPv6 address.
- static address_v6 v4_mapped(const address_v4& addr)
- {
- address_v4::bytes_type v4_bytes = addr.to_bytes();
- bytes_type v6_bytes = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF,
- v4_bytes[0], v4_bytes[1], v4_bytes[2], v4_bytes[3] } };
- return address_v6(v6_bytes);
- }
+ BOOST_ASIO_DECL static address_v6 v4_mapped(const address_v4& addr);
/// Create an IPv4-compatible IPv6 address.
- static address_v6 v4_compatible(const address_v4& addr)
- {
- address_v4::bytes_type v4_bytes = addr.to_bytes();
- bytes_type v6_bytes = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- v4_bytes[0], v4_bytes[1], v4_bytes[2], v4_bytes[3] } };
- return address_v6(v6_bytes);
- }
+ BOOST_ASIO_DECL static address_v6 v4_compatible(const address_v4& addr);
private:
// The underlying IPv6 address.
@@ -403,22 +212,7 @@ private:
*/
template <typename Elem, typename Traits>
std::basic_ostream<Elem, Traits>& operator<<(
- std::basic_ostream<Elem, Traits>& os, const address_v6& addr)
-{
- boost::system::error_code ec;
- std::string s = addr.to_string(ec);
- if (ec)
- {
- if (os.exceptions() & std::ios::failbit)
- boost::asio::detail::throw_error(ec);
- else
- os.setstate(std::ios_base::failbit);
- }
- else
- for (std::string::iterator i = s.begin(); i != s.end(); ++i)
- os << os.widen(*i);
- return os;
-}
+ std::basic_ostream<Elem, Traits>& os, const address_v6& addr);
#endif // !defined(BOOST_NO_IOSTREAM)
@@ -428,4 +222,9 @@ std::basic_ostream<Elem, Traits>& operator<<(
#include <boost/asio/detail/pop_options.hpp>
+#include <boost/asio/ip/impl/address_v6.hpp>
+#if defined(BOOST_ASIO_HEADER_ONLY)
+# include <boost/asio/ip/impl/address_v6.ipp>
+#endif // defined(BOOST_ASIO_HEADER_ONLY)
+
#endif // BOOST_ASIO_IP_ADDRESS_V6_HPP
diff --git a/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp
index f191a4c..10459c4 100644
--- a/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp
@@ -1,6 +1,6 @@
//
-// basic_endpoint.hpp
-// ~~~~~~~~~~~~~~~~~~
+// ip/basic_endpoint.hpp
+// ~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,25 +15,15 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/ip/address.hpp>
+#include <boost/asio/ip/detail/endpoint.hpp>
-#include <boost/asio/detail/push_options.hpp>
-#include <boost/config.hpp>
-#include <boost/throw_exception.hpp>
-#include <boost/detail/workaround.hpp>
-#include <cstring>
#if !defined(BOOST_NO_IOSTREAM)
-# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-# include <ostream>
-# endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-# include <sstream>
+# include <iosfwd>
#endif // !defined(BOOST_NO_IOSTREAM)
-#include <boost/asio/detail/pop_options.hpp>
-#include <boost/asio/error.hpp>
-#include <boost/asio/ip/address.hpp>
-#include <boost/asio/detail/socket_ops.hpp>
-#include <boost/asio/detail/socket_types.hpp>
+#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
@@ -68,11 +58,8 @@ public:
/// Default constructor.
basic_endpoint()
- : data_()
+ : impl_()
{
- data_.v4.sin_family = AF_INET;
- data_.v4.sin_port = 0;
- data_.v4.sin_addr.s_addr = INADDR_ANY;
}
/// Construct an endpoint using a port number, specified in the host's byte
@@ -92,74 +79,35 @@ public:
* @endcode
*/
basic_endpoint(const InternetProtocol& protocol, unsigned short port_num)
- : data_()
+ : impl_(protocol.family(), port_num)
{
- using namespace std; // For memcpy.
- if (protocol.family() == PF_INET)
- {
- data_.v4.sin_family = AF_INET;
- data_.v4.sin_port =
- boost::asio::detail::socket_ops::host_to_network_short(port_num);
- data_.v4.sin_addr.s_addr = INADDR_ANY;
- }
- else
- {
- data_.v6.sin6_family = AF_INET6;
- 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_scope_id = 0;
- }
}
/// Construct an endpoint using a port number and an IP address. This
/// constructor may be used for accepting connections on a specific interface
/// or for making a connection to a remote endpoint.
basic_endpoint(const boost::asio::ip::address& addr, unsigned short port_num)
- : data_()
+ : impl_(addr, port_num)
{
- using namespace std; // For memcpy.
- if (addr.is_v4())
- {
- data_.v4.sin_family = AF_INET;
- data_.v4.sin_port =
- boost::asio::detail::socket_ops::host_to_network_short(port_num);
- data_.v4.sin_addr.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- addr.to_v4().to_ulong());
- }
- else
- {
- data_.v6.sin6_family = AF_INET6;
- data_.v6.sin6_port =
- boost::asio::detail::socket_ops::host_to_network_short(port_num);
- 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);
- data_.v6.sin6_scope_id = v6_addr.scope_id();
- }
}
/// Copy constructor.
basic_endpoint(const basic_endpoint& other)
- : data_(other.data_)
+ : impl_(other.impl_)
{
}
/// Assign from another endpoint.
basic_endpoint& operator=(const basic_endpoint& other)
{
- data_ = other.data_;
+ impl_ = other.impl_;
return *this;
}
/// The protocol associated with the endpoint.
protocol_type protocol() const
{
- if (is_v4())
+ if (impl_.is_v4())
return InternetProtocol::v4();
return InternetProtocol::v6();
}
@@ -167,137 +115,104 @@ public:
/// Get the underlying endpoint in the native type.
data_type* data()
{
- return &data_.base;
+ return impl_.data();
}
/// Get the underlying endpoint in the native type.
const data_type* data() const
{
- return &data_.base;
+ return impl_.data();
}
/// Get the underlying size of the endpoint in the native type.
std::size_t size() const
{
- if (is_v4())
- return sizeof(boost::asio::detail::sockaddr_in4_type);
- else
- return sizeof(boost::asio::detail::sockaddr_in6_type);
+ return impl_.size();
}
/// Set the underlying size of the endpoint in the native type.
void resize(std::size_t size)
{
- if (size > sizeof(boost::asio::detail::sockaddr_storage_type))
- {
- boost::system::system_error e(boost::asio::error::invalid_argument);
- boost::throw_exception(e);
- }
+ impl_.resize(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 impl_.capacity();
}
/// Get the port associated with the endpoint. The port number is always in
/// the host's byte order.
unsigned short port() const
{
- if (is_v4())
- {
- return boost::asio::detail::socket_ops::network_to_host_short(
- data_.v4.sin_port);
- }
- else
- {
- return boost::asio::detail::socket_ops::network_to_host_short(
- data_.v6.sin6_port);
- }
+ return impl_.port();
}
/// Set the port associated with the endpoint. The port number is always in
/// the host's byte order.
void port(unsigned short port_num)
{
- if (is_v4())
- {
- data_.v4.sin_port
- = boost::asio::detail::socket_ops::host_to_network_short(port_num);
- }
- else
- {
- data_.v6.sin6_port
- = boost::asio::detail::socket_ops::host_to_network_short(port_num);
- }
+ impl_.port(port_num);
}
/// Get the IP address associated with the endpoint.
boost::asio::ip::address address() const
{
- using namespace std; // For memcpy.
- if (is_v4())
- {
- return boost::asio::ip::address_v4(
- boost::asio::detail::socket_ops::network_to_host_long(
- data_.v4.sin_addr.s_addr));
- }
- else
- {
- boost::asio::ip::address_v6::bytes_type bytes;
- memcpy(bytes.elems, data_.v6.sin6_addr.s6_addr, 16);
- return boost::asio::ip::address_v6(bytes, data_.v6.sin6_scope_id);
- }
+ return impl_.address();
}
/// Set the IP address associated with the endpoint.
void address(const boost::asio::ip::address& addr)
{
- basic_endpoint<InternetProtocol> tmp_endpoint(addr, port());
- data_ = tmp_endpoint.data_;
+ impl_.address(addr);
}
/// Compare two endpoints for equality.
friend bool operator==(const basic_endpoint<InternetProtocol>& e1,
const basic_endpoint<InternetProtocol>& e2)
{
- return e1.address() == e2.address() && e1.port() == e2.port();
+ return e1.impl_ == e2.impl_;
}
/// Compare two endpoints for inequality.
friend bool operator!=(const basic_endpoint<InternetProtocol>& e1,
const basic_endpoint<InternetProtocol>& e2)
{
- return e1.address() != e2.address() || e1.port() != e2.port();
+ return !(e1 == e2);
}
/// Compare endpoints for ordering.
friend bool operator<(const basic_endpoint<InternetProtocol>& e1,
const basic_endpoint<InternetProtocol>& e2)
{
- if (e1.address() < e2.address())
- return true;
- if (e1.address() != e2.address())
- return false;
- return e1.port() < e2.port();
+ return e1.impl_ < e2.impl_;
}
-private:
- // Helper function to determine whether the endpoint is IPv4.
- bool is_v4() const
+ /// Compare endpoints for ordering.
+ friend bool operator>(const basic_endpoint<InternetProtocol>& e1,
+ const basic_endpoint<InternetProtocol>& e2)
+ {
+ return e2.impl_ < e1.impl_;
+ }
+
+ /// Compare endpoints for ordering.
+ friend bool operator<=(const basic_endpoint<InternetProtocol>& e1,
+ const basic_endpoint<InternetProtocol>& e2)
{
- return data_.base.sa_family == AF_INET;
+ return !(e2 < e1);
}
- // The underlying IP socket address.
- union data_union
+ /// Compare endpoints for ordering.
+ friend bool operator>=(const basic_endpoint<InternetProtocol>& e1,
+ const basic_endpoint<InternetProtocol>& e2)
{
- 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_;
+ return !(e1 < e2);
+ }
+
+private:
+ // The underlying IP endpoint.
+ boost::asio::ip::detail::endpoint impl_;
};
#if !defined(BOOST_NO_IOSTREAM)
@@ -314,64 +229,10 @@ private:
*
* @relates boost::asio::ip::basic_endpoint
*/
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-template <typename InternetProtocol>
-std::ostream& operator<<(std::ostream& os,
- const basic_endpoint<InternetProtocol>& endpoint)
-{
- const address& addr = endpoint.address();
- boost::system::error_code ec;
- std::string a = addr.to_string(ec);
- if (ec)
- {
- if (os.exceptions() & std::ios::failbit)
- boost::asio::detail::throw_error(ec);
- else
- os.setstate(std::ios_base::failbit);
- }
- else
- {
- std::ostringstream tmp_os;
- tmp_os.imbue(std::locale::classic());
- if (addr.is_v4())
- tmp_os << a;
- else
- tmp_os << '[' << a << ']';
- tmp_os << ':' << endpoint.port();
- os << tmp_os.str();
- }
- return os;
-}
-#else // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
template <typename Elem, typename Traits, typename InternetProtocol>
std::basic_ostream<Elem, Traits>& operator<<(
std::basic_ostream<Elem, Traits>& os,
- const basic_endpoint<InternetProtocol>& endpoint)
-{
- const address& addr = endpoint.address();
- boost::system::error_code ec;
- std::string a = addr.to_string(ec);
- if (ec)
- {
- if (os.exceptions() & std::ios::failbit)
- boost::asio::detail::throw_error(ec);
- else
- os.setstate(std::ios_base::failbit);
- }
- else
- {
- std::ostringstream tmp_os;
- tmp_os.imbue(std::locale::classic());
- if (addr.is_v4())
- tmp_os << a;
- else
- tmp_os << '[' << a << ']';
- tmp_os << ':' << endpoint.port();
- os << tmp_os.str();
- }
- return os;
-}
-#endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ const basic_endpoint<InternetProtocol>& endpoint);
#endif // !defined(BOOST_NO_IOSTREAM)
@@ -381,4 +242,6 @@ std::basic_ostream<Elem, Traits>& operator<<(
#include <boost/asio/detail/pop_options.hpp>
+#include <boost/asio/ip/impl/basic_endpoint.hpp>
+
#endif // BOOST_ASIO_IP_BASIC_ENDPOINT_HPP
diff --git a/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp
index 0660ce5..21b83da 100644
--- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp
@@ -1,6 +1,6 @@
//
-// basic_resolver.hpp
-// ~~~~~~~~~~~~~~~~~~
+// ip/basic_resolver.hpp
+// ~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,14 +15,15 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
-
+#include <boost/asio/detail/config.hpp>
#include <boost/asio/basic_io_object.hpp>
+#include <boost/asio/detail/throw_error.hpp>
#include <boost/asio/error.hpp>
#include <boost/asio/ip/basic_resolver_iterator.hpp>
#include <boost/asio/ip/basic_resolver_query.hpp>
#include <boost/asio/ip/resolver_service.hpp>
-#include <boost/asio/detail/throw_error.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
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 f2ac595..84589b5 100644
--- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp
@@ -1,6 +1,6 @@
//
-// basic_resolver_entry.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~
+// ip/basic_resolver_entry.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,11 +15,10 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
+#include <boost/asio/detail/config.hpp>
+#include <string>
#include <boost/asio/detail/push_options.hpp>
-#include <string>
-#include <boost/asio/detail/pop_options.hpp>
namespace boost {
namespace asio {
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 5f4937b..de42699 100644
--- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp
@@ -1,6 +1,6 @@
//
-// basic_resolver_iterator.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// ip/basic_resolver_iterator.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,20 +15,18 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
-
-#include <boost/asio/detail/push_options.hpp>
+#include <boost/asio/detail/config.hpp>
#include <boost/iterator.hpp>
-#include <boost/shared_ptr.hpp>
#include <cstring>
#include <string>
#include <vector>
-#include <boost/asio/detail/pop_options.hpp>
-
+#include <boost/asio/detail/shared_ptr.hpp>
#include <boost/asio/detail/socket_ops.hpp>
#include <boost/asio/detail/socket_types.hpp>
#include <boost/asio/ip/basic_resolver_entry.hpp>
+#include <boost/asio/detail/push_options.hpp>
+
namespace boost {
namespace asio {
namespace ip {
@@ -177,7 +175,7 @@ private:
}
typedef std::vector<basic_resolver_entry<InternetProtocol> > values_type;
- boost::shared_ptr<values_type> values_;
+ boost::asio::detail::shared_ptr<values_type> values_;
std::size_t index_;
};
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 75d3c47..38cba01 100644
--- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp
@@ -1,6 +1,6 @@
//
-// basic_resolver_query.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~
+// ip/basic_resolver_query.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,16 +15,13 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
-
-#include <boost/asio/detail/push_options.hpp>
-#include <boost/config.hpp>
+#include <boost/asio/detail/config.hpp>
#include <string>
-#include <boost/asio/detail/pop_options.hpp>
-
#include <boost/asio/detail/socket_ops.hpp>
#include <boost/asio/ip/resolver_query_base.hpp>
+#include <boost/asio/detail/push_options.hpp>
+
namespace boost {
namespace asio {
namespace ip {
diff --git a/3rdParty/Boost/src/boost/asio/ip/detail/endpoint.hpp b/3rdParty/Boost/src/boost/asio/ip/detail/endpoint.hpp
new file mode 100644
index 0000000..9823e72
--- /dev/null
+++ b/3rdParty/Boost/src/boost/asio/ip/detail/endpoint.hpp
@@ -0,0 +1,142 @@
+//
+// ip/detail/endpoint.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2010 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)
+//
+
+#ifndef BOOST_ASIO_IP_DETAIL_ENDPOINT_HPP
+#define BOOST_ASIO_IP_DETAIL_ENDPOINT_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <string>
+#include <boost/asio/detail/socket_types.hpp>
+#include <boost/asio/detail/winsock_init.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/asio/ip/address.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace ip {
+namespace detail {
+
+// Helper class for implementating an IP endpoint.
+class endpoint
+{
+public:
+ // Default constructor.
+ BOOST_ASIO_DECL endpoint();
+
+ // Construct an endpoint using a family and port number.
+ BOOST_ASIO_DECL endpoint(int family, unsigned short port_num);
+
+ // Construct an endpoint using an address and port number.
+ BOOST_ASIO_DECL endpoint(const boost::asio::ip::address& addr,
+ unsigned short port_num);
+
+ // Copy constructor.
+ endpoint(const endpoint& other)
+ : data_(other.data_)
+ {
+ }
+
+ // Assign from another endpoint.
+ endpoint& operator=(const endpoint& other)
+ {
+ data_ = other.data_;
+ return *this;
+ }
+
+ // Get the underlying endpoint in the native type.
+ boost::asio::detail::socket_addr_type* data()
+ {
+ return &data_.base;
+ }
+
+ // Get the underlying endpoint in the native type.
+ const boost::asio::detail::socket_addr_type* data() const
+ {
+ return &data_.base;
+ }
+
+ // Get the underlying size of the endpoint in the native type.
+ std::size_t size() const
+ {
+ if (is_v4())
+ return sizeof(boost::asio::detail::sockaddr_in4_type);
+ else
+ return sizeof(boost::asio::detail::sockaddr_in6_type);
+ }
+
+ // Set the underlying size of the endpoint in the native type.
+ BOOST_ASIO_DECL void resize(std::size_t size);
+
+ // Get the capacity of the endpoint in the native type.
+ std::size_t capacity() const
+ {
+ return sizeof(boost::asio::detail::sockaddr_storage_type);
+ }
+
+ // Get the port associated with the endpoint.
+ BOOST_ASIO_DECL unsigned short port() const;
+
+ // Set the port associated with the endpoint.
+ BOOST_ASIO_DECL void port(unsigned short port_num);
+
+ // Get the IP address associated with the endpoint.
+ BOOST_ASIO_DECL boost::asio::ip::address address() const;
+
+ // Set the IP address associated with the endpoint.
+ BOOST_ASIO_DECL void address(const boost::asio::ip::address& addr);
+
+ // Compare two endpoints for equality.
+ BOOST_ASIO_DECL friend bool operator==(
+ const endpoint& e1, const endpoint& e2);
+
+ // Compare endpoints for ordering.
+ BOOST_ASIO_DECL friend bool operator<(
+ const endpoint& e1, const endpoint& e2);
+
+ // Determine whether the endpoint is IPv4.
+ bool is_v4() const
+ {
+ return data_.base.sa_family == AF_INET;
+ }
+
+#if !defined(BOOST_NO_IOSTREAM)
+ // Convert to a string.
+ BOOST_ASIO_DECL std::string to_string(boost::system::error_code& ec) const;
+#endif // !defined(BOOST_NO_IOSTREAM)
+
+private:
+ // The underlying IP socket address.
+ 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_;
+};
+
+} // namespace detail
+} // namespace ip
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#if defined(BOOST_ASIO_HEADER_ONLY)
+# include <boost/asio/ip/detail/impl/endpoint.ipp>
+#endif // defined(BOOST_ASIO_HEADER_ONLY)
+
+#endif // BOOST_ASIO_IP_DETAIL_ENDPOINT_HPP
diff --git a/3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp b/3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp
new file mode 100644
index 0000000..4a6e395
--- /dev/null
+++ b/3rdParty/Boost/src/boost/asio/ip/detail/impl/endpoint.ipp
@@ -0,0 +1,193 @@
+//
+// ip/detail/impl/endpoint.ipp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2010 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)
+//
+
+#ifndef BOOST_ASIO_IP_DETAIL_IMPL_ENDPOINT_IPP
+#define BOOST_ASIO_IP_DETAIL_IMPL_ENDPOINT_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <cstring>
+#if !defined(BOOST_NO_IOSTREAM)
+# include <sstream>
+#endif // !defined(BOOST_NO_IOSTREAM)
+#include <boost/asio/detail/socket_ops.hpp>
+#include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/error.hpp>
+#include <boost/asio/ip/detail/endpoint.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace ip {
+namespace detail {
+
+endpoint::endpoint()
+ : data_()
+{
+ data_.v4.sin_family = AF_INET;
+ data_.v4.sin_port = 0;
+ data_.v4.sin_addr.s_addr = INADDR_ANY;
+}
+
+endpoint::endpoint(int family, unsigned short port_num)
+ : data_()
+{
+ using namespace std; // For memcpy.
+ if (family == PF_INET)
+ {
+ data_.v4.sin_family = AF_INET;
+ data_.v4.sin_port =
+ boost::asio::detail::socket_ops::host_to_network_short(port_num);
+ data_.v4.sin_addr.s_addr = INADDR_ANY;
+ }
+ else
+ {
+ data_.v6.sin6_family = AF_INET6;
+ 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_scope_id = 0;
+ }
+}
+
+endpoint::endpoint(const boost::asio::ip::address& addr,
+ unsigned short port_num)
+ : data_()
+{
+ using namespace std; // For memcpy.
+ if (addr.is_v4())
+ {
+ data_.v4.sin_family = AF_INET;
+ data_.v4.sin_port =
+ boost::asio::detail::socket_ops::host_to_network_short(port_num);
+ data_.v4.sin_addr.s_addr =
+ boost::asio::detail::socket_ops::host_to_network_long(
+ addr.to_v4().to_ulong());
+ }
+ else
+ {
+ data_.v6.sin6_family = AF_INET6;
+ data_.v6.sin6_port =
+ boost::asio::detail::socket_ops::host_to_network_short(port_num);
+ 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);
+ data_.v6.sin6_scope_id = v6_addr.scope_id();
+ }
+}
+
+void endpoint::resize(std::size_t size)
+{
+ if (size > sizeof(boost::asio::detail::sockaddr_storage_type))
+ {
+ boost::system::error_code ec(boost::asio::error::invalid_argument);
+ boost::asio::detail::throw_error(ec);
+ }
+}
+
+unsigned short endpoint::port() const
+{
+ if (is_v4())
+ {
+ return boost::asio::detail::socket_ops::network_to_host_short(
+ data_.v4.sin_port);
+ }
+ else
+ {
+ return boost::asio::detail::socket_ops::network_to_host_short(
+ data_.v6.sin6_port);
+ }
+}
+
+void endpoint::port(unsigned short port_num)
+{
+ if (is_v4())
+ {
+ data_.v4.sin_port
+ = boost::asio::detail::socket_ops::host_to_network_short(port_num);
+ }
+ else
+ {
+ data_.v6.sin6_port
+ = boost::asio::detail::socket_ops::host_to_network_short(port_num);
+ }
+}
+
+boost::asio::ip::address endpoint::address() const
+{
+ using namespace std; // For memcpy.
+ if (is_v4())
+ {
+ return boost::asio::ip::address_v4(
+ boost::asio::detail::socket_ops::network_to_host_long(
+ data_.v4.sin_addr.s_addr));
+ }
+ else
+ {
+ boost::asio::ip::address_v6::bytes_type bytes;
+ memcpy(bytes.elems, data_.v6.sin6_addr.s6_addr, 16);
+ return boost::asio::ip::address_v6(bytes, data_.v6.sin6_scope_id);
+ }
+}
+
+void endpoint::address(const boost::asio::ip::address& addr)
+{
+ endpoint tmp_endpoint(addr, port());
+ data_ = tmp_endpoint.data_;
+}
+
+bool operator==(const endpoint& e1, const endpoint& e2)
+{
+ return e1.address() == e2.address() && e1.port() == e2.port();
+}
+
+bool operator<(const endpoint& e1, const endpoint& e2)
+{
+ if (e1.address() < e2.address())
+ return true;
+ if (e1.address() != e2.address())
+ return false;
+ return e1.port() < e2.port();
+}
+
+#if !defined(BOOST_NO_IOSTREAM)
+std::string endpoint::to_string(boost::system::error_code& ec) const
+{
+ std::string a = address().to_string(ec);
+ if (ec)
+ return std::string();
+
+ std::ostringstream tmp_os;
+ tmp_os.imbue(std::locale::classic());
+ if (is_v4())
+ tmp_os << a;
+ else
+ tmp_os << '[' << a << ']';
+ tmp_os << ':' << port();
+
+ return tmp_os.str();
+}
+#endif // !defined(BOOST_NO_IOSTREAM)
+
+} // namespace detail
+} // namespace ip
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_IP_DETAIL_IMPL_ENDPOINT_IPP
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 0c26864..59ce6c3 100644
--- a/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp
@@ -1,6 +1,6 @@
//
-// socket_option.hpp
-// ~~~~~~~~~~~~~~~~~
+// detail/socket_option.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,18 +15,15 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
-
-#include <boost/asio/detail/push_options.hpp>
+#include <boost/asio/detail/config.hpp>
#include <cstddef>
#include <cstring>
-#include <boost/config.hpp>
#include <boost/throw_exception.hpp>
-#include <boost/asio/detail/pop_options.hpp>
-
-#include <boost/asio/ip/address.hpp>
#include <boost/asio/detail/socket_ops.hpp>
#include <boost/asio/detail/socket_types.hpp>
+#include <boost/asio/ip/address.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
diff --git a/3rdParty/Boost/src/boost/asio/ip/host_name.hpp b/3rdParty/Boost/src/boost/asio/ip/host_name.hpp
index fee245b..f40a9df 100644
--- a/3rdParty/Boost/src/boost/asio/ip/host_name.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/host_name.hpp
@@ -1,6 +1,6 @@
//
-// host_name.hpp
-// ~~~~~~~~~~~~~
+// ip/host_name.hpp
+// ~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,45 +15,21 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
-
-#include <boost/asio/detail/push_options.hpp>
+#include <boost/asio/detail/config.hpp>
#include <string>
-#include <boost/asio/detail/pop_options.hpp>
+#include <boost/system/error_code.hpp>
-#include <boost/asio/error.hpp>
-#include <boost/asio/detail/socket_ops.hpp>
-#include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
namespace ip {
/// Get the current host name.
-std::string host_name();
+BOOST_ASIO_DECL std::string host_name();
/// Get the current host name.
-std::string host_name(boost::system::error_code& ec);
-
-inline std::string host_name()
-{
- char name[1024];
- boost::system::error_code ec;
- if (boost::asio::detail::socket_ops::gethostname(name, sizeof(name), ec) != 0)
- {
- boost::asio::detail::throw_error(ec);
- return std::string();
- }
- return std::string(name);
-}
-
-inline std::string host_name(boost::system::error_code& ec)
-{
- char name[1024];
- if (boost::asio::detail::socket_ops::gethostname(name, sizeof(name), ec) != 0)
- return std::string();
- return std::string(name);
-}
+BOOST_ASIO_DECL std::string host_name(boost::system::error_code& ec);
} // namespace ip
} // namespace asio
@@ -61,4 +37,8 @@ inline std::string host_name(boost::system::error_code& ec)
#include <boost/asio/detail/pop_options.hpp>
+#if defined(BOOST_ASIO_HEADER_ONLY)
+# include <boost/asio/ip/impl/host_name.ipp>
+#endif // defined(BOOST_ASIO_HEADER_ONLY)
+
#endif // BOOST_ASIO_IP_HOST_NAME_HPP
diff --git a/3rdParty/Boost/src/boost/asio/ip/icmp.hpp b/3rdParty/Boost/src/boost/asio/ip/icmp.hpp
index 5d2fcab..ca5d434 100644
--- a/3rdParty/Boost/src/boost/asio/ip/icmp.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/icmp.hpp
@@ -1,6 +1,6 @@
//
-// icmp.hpp
-// ~~~~~~~~
+// ip/icmp.hpp
+// ~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,14 +15,15 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
-
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/detail/socket_types.hpp>
#include <boost/asio/basic_raw_socket.hpp>
#include <boost/asio/ip/basic_endpoint.hpp>
#include <boost/asio/ip/basic_resolver.hpp>
#include <boost/asio/ip/basic_resolver_iterator.hpp>
#include <boost/asio/ip/basic_resolver_query.hpp>
-#include <boost/asio/detail/socket_types.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/address.hpp b/3rdParty/Boost/src/boost/asio/ip/impl/address.hpp
new file mode 100644
index 0000000..c19d25d
--- /dev/null
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/address.hpp
@@ -0,0 +1,55 @@
+//
+// ip/impl/address.hpp
+// ~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2010 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)
+//
+
+#ifndef BOOST_ASIO_IP_IMPL_ADDRESS_HPP
+#define BOOST_ASIO_IP_IMPL_ADDRESS_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#if !defined(BOOST_NO_IOSTREAM)
+
+#include <boost/asio/detail/throw_error.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace ip {
+
+template <typename Elem, typename Traits>
+std::basic_ostream<Elem, Traits>& operator<<(
+ std::basic_ostream<Elem, Traits>& os, const address& addr)
+{
+ boost::system::error_code ec;
+ std::string s = addr.to_string(ec);
+ if (ec)
+ {
+ if (os.exceptions() & std::basic_ostream<Elem, Traits>::failbit)
+ boost::asio::detail::throw_error(ec);
+ else
+ os.setstate(std::basic_ostream<Elem, Traits>::failbit);
+ }
+ else
+ for (std::string::iterator i = s.begin(); i != s.end(); ++i)
+ os << os.widen(*i);
+ return os;
+}
+
+} // namespace ip
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // !defined(BOOST_NO_IOSTREAM)
+
+#endif // BOOST_ASIO_IP_IMPL_ADDRESS_HPP
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/address.ipp b/3rdParty/Boost/src/boost/asio/ip/impl/address.ipp
new file mode 100644
index 0000000..70513b7
--- /dev/null
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/address.ipp
@@ -0,0 +1,188 @@
+//
+// ip/impl/address.ipp
+// ~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2010 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)
+//
+
+#ifndef BOOST_ASIO_IP_IMPL_ADDRESS_IPP
+#define BOOST_ASIO_IP_IMPL_ADDRESS_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <typeinfo>
+#include <boost/throw_exception.hpp>
+#include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/error.hpp>
+#include <boost/asio/ip/address.hpp>
+#include <boost/system/system_error.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace ip {
+
+address::address()
+ : type_(ipv4),
+ ipv4_address_(),
+ ipv6_address_()
+{
+}
+
+address::address(const boost::asio::ip::address_v4& ipv4_address)
+ : type_(ipv4),
+ ipv4_address_(ipv4_address),
+ ipv6_address_()
+{
+}
+
+address::address(const boost::asio::ip::address_v6& ipv6_address)
+ : type_(ipv6),
+ ipv4_address_(),
+ ipv6_address_(ipv6_address)
+{
+}
+
+address::address(const address& other)
+ : type_(other.type_),
+ ipv4_address_(other.ipv4_address_),
+ ipv6_address_(other.ipv6_address_)
+{
+}
+
+address& address::operator=(const address& other)
+{
+ type_ = other.type_;
+ ipv4_address_ = other.ipv4_address_;
+ ipv6_address_ = other.ipv6_address_;
+ return *this;
+}
+
+address& address::operator=(const boost::asio::ip::address_v4& ipv4_address)
+{
+ type_ = ipv4;
+ ipv4_address_ = ipv4_address;
+ ipv6_address_ = boost::asio::ip::address_v6();
+ return *this;
+}
+
+address& address::operator=(const boost::asio::ip::address_v6& ipv6_address)
+{
+ type_ = ipv6;
+ ipv4_address_ = boost::asio::ip::address_v4();
+ ipv6_address_ = ipv6_address;
+ return *this;
+}
+
+boost::asio::ip::address_v4 address::to_v4() const
+{
+ if (type_ != ipv4)
+ {
+ std::bad_cast ex;
+ boost::throw_exception(ex);
+ }
+ return ipv4_address_;
+}
+
+boost::asio::ip::address_v6 address::to_v6() const
+{
+ if (type_ != ipv6)
+ {
+ std::bad_cast ex;
+ boost::throw_exception(ex);
+ }
+ return ipv6_address_;
+}
+
+std::string address::to_string() const
+{
+ if (type_ == ipv6)
+ return ipv6_address_.to_string();
+ return ipv4_address_.to_string();
+}
+
+std::string address::to_string(boost::system::error_code& ec) const
+{
+ if (type_ == ipv6)
+ return ipv6_address_.to_string(ec);
+ return ipv4_address_.to_string(ec);
+}
+
+address address::from_string(const char* str)
+{
+ boost::system::error_code ec;
+ address addr = from_string(str, ec);
+ boost::asio::detail::throw_error(ec);
+ return addr;
+}
+
+address address::from_string(const char* str, boost::system::error_code& ec)
+{
+ boost::asio::ip::address_v6 ipv6_address =
+ boost::asio::ip::address_v6::from_string(str, ec);
+ if (!ec)
+ {
+ address tmp;
+ tmp.type_ = ipv6;
+ tmp.ipv6_address_ = ipv6_address;
+ return tmp;
+ }
+
+ boost::asio::ip::address_v4 ipv4_address =
+ boost::asio::ip::address_v4::from_string(str, ec);
+ if (!ec)
+ {
+ address tmp;
+ tmp.type_ = ipv4;
+ tmp.ipv4_address_ = ipv4_address;
+ return tmp;
+ }
+
+ return address();
+}
+
+address address::from_string(const std::string& str)
+{
+ return from_string(str.c_str());
+}
+
+address address::from_string(const std::string& str,
+ boost::system::error_code& ec)
+{
+ return from_string(str.c_str(), ec);
+}
+
+bool operator==(const address& a1, const address& a2)
+{
+ if (a1.type_ != a2.type_)
+ return false;
+ if (a1.type_ == address::ipv6)
+ return a1.ipv6_address_ == a2.ipv6_address_;
+ return a1.ipv4_address_ == a2.ipv4_address_;
+}
+
+bool operator<(const address& a1, const address& a2)
+{
+ if (a1.type_ < a2.type_)
+ return true;
+ if (a1.type_ > a2.type_)
+ return false;
+ if (a1.type_ == address::ipv6)
+ return a1.ipv6_address_ < a2.ipv6_address_;
+ return a1.ipv4_address_ < a2.ipv4_address_;
+}
+
+} // namespace ip
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_IP_IMPL_ADDRESS_IPP
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/address_v4.hpp b/3rdParty/Boost/src/boost/asio/ip/impl/address_v4.hpp
new file mode 100644
index 0000000..7e798e8
--- /dev/null
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/address_v4.hpp
@@ -0,0 +1,55 @@
+//
+// ip/impl/address_v4.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2010 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)
+//
+
+#ifndef BOOST_ASIO_IP_IMPL_ADDRESS_V4_HPP
+#define BOOST_ASIO_IP_IMPL_ADDRESS_V4_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#if !defined(BOOST_NO_IOSTREAM)
+
+#include <boost/asio/detail/throw_error.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace ip {
+
+template <typename Elem, typename Traits>
+std::basic_ostream<Elem, Traits>& operator<<(
+ std::basic_ostream<Elem, Traits>& os, const address_v4& addr)
+{
+ boost::system::error_code ec;
+ std::string s = addr.to_string(ec);
+ if (ec)
+ {
+ if (os.exceptions() & std::basic_ostream<Elem, Traits>::failbit)
+ boost::asio::detail::throw_error(ec);
+ else
+ os.setstate(std::basic_ostream<Elem, Traits>::failbit);
+ }
+ else
+ for (std::string::iterator i = s.begin(); i != s.end(); ++i)
+ os << os.widen(*i);
+ return os;
+}
+
+} // namespace ip
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // !defined(BOOST_NO_IOSTREAM)
+
+#endif // BOOST_ASIO_IP_IMPL_ADDRESS_V4_HPP
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/address_v4.ipp b/3rdParty/Boost/src/boost/asio/ip/impl/address_v4.ipp
new file mode 100644
index 0000000..3cdcbf1
--- /dev/null
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/address_v4.ipp
@@ -0,0 +1,164 @@
+//
+// ip/impl/address_v4.ipp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2010 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)
+//
+
+#ifndef BOOST_ASIO_IP_IMPL_ADDRESS_V4_IPP
+#define BOOST_ASIO_IP_IMPL_ADDRESS_V4_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <climits>
+#include <stdexcept>
+#include <boost/throw_exception.hpp>
+#include <boost/asio/error.hpp>
+#include <boost/asio/detail/socket_ops.hpp>
+#include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/ip/address_v4.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace ip {
+
+address_v4::address_v4(const address_v4::bytes_type& bytes)
+{
+#if UCHAR_MAX > 0xFF
+ if (bytes[0] > 0xFF || bytes[1] > 0xFF
+ || bytes[2] > 0xFF || bytes[3] > 0xFF)
+ {
+ std::out_of_range ex("address_v4 from bytes_type");
+ boost::throw_exception(ex);
+ }
+#endif // UCHAR_MAX > 0xFF
+
+ using namespace std; // For memcpy.
+ memcpy(&addr_.s_addr, bytes.elems, 4);
+}
+
+address_v4::address_v4(unsigned long addr)
+{
+#if ULONG_MAX > 0xFFFFFFFF
+ if (addr > 0xFFFFFFFF)
+ {
+ std::out_of_range ex("address_v4 from unsigned long");
+ boost::throw_exception(ex);
+ }
+#endif // ULONG_MAX > 0xFFFFFFFF
+
+ addr_.s_addr = boost::asio::detail::socket_ops::host_to_network_long(addr);
+}
+
+address_v4::bytes_type address_v4::to_bytes() const
+{
+ using namespace std; // For memcpy.
+ bytes_type bytes;
+ memcpy(bytes.elems, &addr_.s_addr, 4);
+ return bytes;
+}
+
+unsigned long address_v4::to_ulong() const
+{
+ return boost::asio::detail::socket_ops::network_to_host_long(addr_.s_addr);
+}
+
+std::string address_v4::to_string() const
+{
+ boost::system::error_code ec;
+ std::string addr = to_string(ec);
+ boost::asio::detail::throw_error(ec);
+ return addr;
+}
+
+std::string address_v4::to_string(boost::system::error_code& ec) const
+{
+ char addr_str[boost::asio::detail::max_addr_v4_str_len];
+ const char* addr =
+ boost::asio::detail::socket_ops::inet_ntop(AF_INET, &addr_, addr_str,
+ boost::asio::detail::max_addr_v4_str_len, 0, ec);
+ if (addr == 0)
+ return std::string();
+ return addr;
+}
+
+address_v4 address_v4::from_string(const char* str)
+{
+ boost::system::error_code ec;
+ address_v4 addr = from_string(str, ec);
+ boost::asio::detail::throw_error(ec);
+ return addr;
+}
+
+address_v4 address_v4::from_string(
+ const char* str, boost::system::error_code& ec)
+{
+ address_v4 tmp;
+ if (boost::asio::detail::socket_ops::inet_pton(
+ AF_INET, str, &tmp.addr_, 0, ec) <= 0)
+ return address_v4();
+ return tmp;
+}
+
+address_v4 address_v4::from_string(const std::string& str)
+{
+ return from_string(str.c_str());
+}
+
+address_v4 address_v4::from_string(
+ const std::string& str, boost::system::error_code& ec)
+{
+ return from_string(str.c_str(), ec);
+}
+
+bool address_v4::is_class_a() const
+{
+ return IN_CLASSA(to_ulong());
+}
+
+bool address_v4::is_class_b() const
+{
+ return IN_CLASSB(to_ulong());
+}
+
+bool address_v4::is_class_c() const
+{
+ return IN_CLASSC(to_ulong());
+}
+
+bool address_v4::is_multicast() const
+{
+ return IN_MULTICAST(to_ulong());
+}
+
+address_v4 address_v4::broadcast(const address_v4& addr, const address_v4& mask)
+{
+ return address_v4(addr.to_ulong() | ~mask.to_ulong());
+}
+
+address_v4 address_v4::netmask(const address_v4& addr)
+{
+ if (addr.is_class_a())
+ return address_v4(0xFF000000);
+ if (addr.is_class_b())
+ return address_v4(0xFFFF0000);
+ if (addr.is_class_c())
+ return address_v4(0xFFFFFF00);
+ return address_v4(0xFFFFFFFF);
+}
+
+} // namespace ip
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_IP_IMPL_ADDRESS_V4_IPP
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/address_v6.hpp b/3rdParty/Boost/src/boost/asio/ip/impl/address_v6.hpp
new file mode 100644
index 0000000..8b39e3e
--- /dev/null
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/address_v6.hpp
@@ -0,0 +1,55 @@
+//
+// ip/impl/address_v6.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2010 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)
+//
+
+#ifndef BOOST_ASIO_IP_IMPL_ADDRESS_V6_HPP
+#define BOOST_ASIO_IP_IMPL_ADDRESS_V6_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#if !defined(BOOST_NO_IOSTREAM)
+
+#include <boost/asio/detail/throw_error.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace ip {
+
+template <typename Elem, typename Traits>
+std::basic_ostream<Elem, Traits>& operator<<(
+ std::basic_ostream<Elem, Traits>& os, const address_v6& addr)
+{
+ boost::system::error_code ec;
+ std::string s = addr.to_string(ec);
+ if (ec)
+ {
+ if (os.exceptions() & std::basic_ostream<Elem, Traits>::failbit)
+ boost::asio::detail::throw_error(ec);
+ else
+ os.setstate(std::basic_ostream<Elem, Traits>::failbit);
+ }
+ else
+ for (std::string::iterator i = s.begin(); i != s.end(); ++i)
+ os << os.widen(*i);
+ return os;
+}
+
+} // namespace ip
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // !defined(BOOST_NO_IOSTREAM)
+
+#endif // BOOST_ASIO_IP_IMPL_ADDRESS_V6_HPP
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/address_v6.ipp b/3rdParty/Boost/src/boost/asio/ip/impl/address_v6.ipp
new file mode 100644
index 0000000..a06dfe5
--- /dev/null
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/address_v6.ipp
@@ -0,0 +1,286 @@
+//
+// ip/impl/address_v6.ipp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2010 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)
+//
+
+#ifndef BOOST_ASIO_IP_IMPL_ADDRESS_V6_IPP
+#define BOOST_ASIO_IP_IMPL_ADDRESS_V6_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <cstring>
+#include <stdexcept>
+#include <typeinfo>
+#include <boost/throw_exception.hpp>
+#include <boost/asio/detail/socket_ops.hpp>
+#include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/error.hpp>
+#include <boost/asio/ip/address_v6.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace ip {
+
+address_v6::address_v6()
+ : 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)
+{
+#if UCHAR_MAX > 0xFF
+ for (std::size_t i = 0; i < bytes.size(); ++i)
+ {
+ if (bytes[i] > 0xFF)
+ {
+ std::out_of_range ex("address_v6 from bytes_type");
+ boost::throw_exception(ex);
+ }
+ }
+#endif // UCHAR_MAX > 0xFF
+
+ using namespace std; // For memcpy.
+ memcpy(addr_.s6_addr, bytes.elems, 16);
+}
+
+address_v6::address_v6(const address_v6& other)
+ : addr_(other.addr_),
+ scope_id_(other.scope_id_)
+{
+}
+
+address_v6& address_v6::operator=(const address_v6& other)
+{
+ addr_ = other.addr_;
+ scope_id_ = other.scope_id_;
+ return *this;
+}
+
+address_v6::bytes_type address_v6::to_bytes() const
+{
+ using namespace std; // For memcpy.
+ bytes_type bytes;
+ memcpy(bytes.elems, addr_.s6_addr, 16);
+ return bytes;
+}
+
+std::string address_v6::to_string() const
+{
+ boost::system::error_code ec;
+ std::string addr = to_string(ec);
+ boost::asio::detail::throw_error(ec);
+ return addr;
+}
+
+std::string address_v6::to_string(boost::system::error_code& ec) const
+{
+ char addr_str[boost::asio::detail::max_addr_v6_str_len];
+ const char* addr =
+ boost::asio::detail::socket_ops::inet_ntop(AF_INET6, &addr_, addr_str,
+ boost::asio::detail::max_addr_v6_str_len, scope_id_, ec);
+ if (addr == 0)
+ return std::string();
+ return addr;
+}
+
+address_v6 address_v6::from_string(const char* str)
+{
+ boost::system::error_code ec;
+ address_v6 addr = from_string(str, ec);
+ boost::asio::detail::throw_error(ec);
+ return addr;
+}
+
+address_v6 address_v6::from_string(
+ const char* str, boost::system::error_code& ec)
+{
+ address_v6 tmp;
+ if (boost::asio::detail::socket_ops::inet_pton(
+ AF_INET6, str, &tmp.addr_, &tmp.scope_id_, ec) <= 0)
+ return address_v6();
+ return tmp;
+}
+
+address_v6 address_v6::from_string(const std::string& str)
+{
+ return from_string(str.c_str());
+}
+
+address_v6 address_v6::from_string(
+ const std::string& str, boost::system::error_code& ec)
+{
+ return from_string(str.c_str(), ec);
+}
+
+address_v4 address_v6::to_v4() const
+{
+ if (!is_v4_mapped() && !is_v4_compatible())
+ {
+ std::bad_cast ex;
+ boost::throw_exception(ex);
+ }
+
+ address_v4::bytes_type v4_bytes = { { addr_.s6_addr[12],
+ addr_.s6_addr[13], addr_.s6_addr[14], addr_.s6_addr[15] } };
+ return address_v4(v4_bytes);
+}
+
+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)
+ && (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] == 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)
+ && (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));
+#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;
+}
+
+bool address_v6::is_site_local() const
+{
+ using namespace boost::asio::detail;
+ return IN6_IS_ADDR_SITELOCAL(&addr_) != 0;
+}
+
+bool address_v6::is_v4_mapped() const
+{
+ using namespace boost::asio::detail;
+ return IN6_IS_ADDR_V4MAPPED(&addr_) != 0;
+}
+
+bool address_v6::is_v4_compatible() const
+{
+ using namespace boost::asio::detail;
+ return IN6_IS_ADDR_V4COMPAT(&addr_) != 0;
+}
+
+bool address_v6::is_multicast() const
+{
+ using namespace boost::asio::detail;
+ return IN6_IS_ADDR_MULTICAST(&addr_) != 0;
+}
+
+bool address_v6::is_multicast_global() const
+{
+ using namespace boost::asio::detail;
+ return IN6_IS_ADDR_MC_GLOBAL(&addr_) != 0;
+}
+
+bool address_v6::is_multicast_link_local() const
+{
+ using namespace boost::asio::detail;
+ return IN6_IS_ADDR_MC_LINKLOCAL(&addr_) != 0;
+}
+
+bool address_v6::is_multicast_node_local() const
+{
+ using namespace boost::asio::detail;
+ return IN6_IS_ADDR_MC_NODELOCAL(&addr_) != 0;
+}
+
+bool address_v6::is_multicast_org_local() const
+{
+ using namespace boost::asio::detail;
+ return IN6_IS_ADDR_MC_ORGLOCAL(&addr_) != 0;
+}
+
+bool address_v6::is_multicast_site_local() const
+{
+ using namespace boost::asio::detail;
+ return IN6_IS_ADDR_MC_SITELOCAL(&addr_) != 0;
+}
+
+bool operator==(const address_v6& a1, const address_v6& a2)
+{
+ using namespace std; // For memcmp.
+ return memcmp(&a1.addr_, &a2.addr_,
+ sizeof(boost::asio::detail::in6_addr_type)) == 0
+ && a1.scope_id_ == a2.scope_id_;
+}
+
+bool operator<(const address_v6& a1, const address_v6& a2)
+{
+ using namespace std; // For memcmp.
+ int memcmp_result = memcmp(&a1.addr_, &a2.addr_,
+ sizeof(boost::asio::detail::in6_addr_type));
+ if (memcmp_result < 0)
+ return true;
+ if (memcmp_result > 0)
+ return false;
+ return a1.scope_id_ < a2.scope_id_;
+}
+
+address_v6 address_v6::loopback()
+{
+ address_v6 tmp;
+ boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_LOOPBACK_INIT;
+ tmp.addr_ = tmp_addr;
+ return tmp;
+}
+
+address_v6 address_v6::v4_mapped(const address_v4& addr)
+{
+ address_v4::bytes_type v4_bytes = addr.to_bytes();
+ bytes_type v6_bytes = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF,
+ v4_bytes[0], v4_bytes[1], v4_bytes[2], v4_bytes[3] } };
+ return address_v6(v6_bytes);
+}
+
+address_v6 address_v6::v4_compatible(const address_v4& addr)
+{
+ address_v4::bytes_type v4_bytes = addr.to_bytes();
+ bytes_type v6_bytes = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ v4_bytes[0], v4_bytes[1], v4_bytes[2], v4_bytes[3] } };
+ return address_v6(v6_bytes);
+}
+
+} // namespace ip
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_IP_IMPL_ADDRESS_V6_IPP
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/basic_endpoint.hpp b/3rdParty/Boost/src/boost/asio/ip/impl/basic_endpoint.hpp
new file mode 100644
index 0000000..474c193
--- /dev/null
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/basic_endpoint.hpp
@@ -0,0 +1,57 @@
+//
+// ip/impl/basic_endpoint.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2010 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)
+//
+
+#ifndef BOOST_ASIO_IP_IMPL_BASIC_ENDPOINT_HPP
+#define BOOST_ASIO_IP_IMPL_BASIC_ENDPOINT_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#if !defined(BOOST_NO_IOSTREAM)
+
+#include <boost/asio/detail/throw_error.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace ip {
+
+template <typename Elem, typename Traits, typename InternetProtocol>
+std::basic_ostream<Elem, Traits>& operator<<(
+ std::basic_ostream<Elem, Traits>& os,
+ const basic_endpoint<InternetProtocol>& endpoint)
+{
+ boost::asio::ip::detail::endpoint tmp_ep(endpoint.address(), endpoint.port());
+ boost::system::error_code ec;
+ std::string s = tmp_ep.to_string(ec);
+ if (ec)
+ {
+ if (os.exceptions() & std::basic_ostream<Elem, Traits>::failbit)
+ boost::asio::detail::throw_error(ec);
+ else
+ os.setstate(std::basic_ostream<Elem, Traits>::failbit);
+ }
+ else
+ for (std::string::iterator i = s.begin(); i != s.end(); ++i)
+ os << os.widen(*i);
+ return os;
+}
+
+} // namespace ip
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // !defined(BOOST_NO_IOSTREAM)
+
+#endif // BOOST_ASIO_IP_IMPL_BASIC_ENDPOINT_HPP
diff --git a/3rdParty/Boost/src/boost/asio/ip/impl/host_name.ipp b/3rdParty/Boost/src/boost/asio/ip/impl/host_name.ipp
new file mode 100644
index 0000000..a5ba582
--- /dev/null
+++ b/3rdParty/Boost/src/boost/asio/ip/impl/host_name.ipp
@@ -0,0 +1,56 @@
+//
+// ip/impl/host_name.ipp
+// ~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2010 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)
+//
+
+#ifndef BOOST_ASIO_IP_IMPL_HOST_NAME_IPP
+#define BOOST_ASIO_IP_IMPL_HOST_NAME_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/detail/socket_ops.hpp>
+#include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/winsock_init.hpp>
+#include <boost/asio/ip/host_name.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace ip {
+
+std::string host_name()
+{
+ char name[1024];
+ boost::system::error_code ec;
+ if (boost::asio::detail::socket_ops::gethostname(name, sizeof(name), ec) != 0)
+ {
+ boost::asio::detail::throw_error(ec);
+ return std::string();
+ }
+ return std::string(name);
+}
+
+std::string host_name(boost::system::error_code& ec)
+{
+ char name[1024];
+ if (boost::asio::detail::socket_ops::gethostname(name, sizeof(name), ec) != 0)
+ return std::string();
+ return std::string(name);
+}
+
+} // namespace ip
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_IP_IMPL_HOST_NAME_IPP
diff --git a/3rdParty/Boost/src/boost/asio/ip/multicast.hpp b/3rdParty/Boost/src/boost/asio/ip/multicast.hpp
index 3aab7f0..e4d9f88 100644
--- a/3rdParty/Boost/src/boost/asio/ip/multicast.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/multicast.hpp
@@ -1,6 +1,6 @@
//
-// multicast.hpp
-// ~~~~~~~~~~~~~
+// ip/multicast.hpp
+// ~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,15 +15,12 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
-
-#include <boost/asio/detail/push_options.hpp>
+#include <boost/asio/detail/config.hpp>
#include <cstddef>
-#include <boost/config.hpp>
-#include <boost/asio/detail/pop_options.hpp>
-
#include <boost/asio/ip/detail/socket_option.hpp>
+#include <boost/asio/detail/push_options.hpp>
+
namespace boost {
namespace asio {
namespace ip {
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 7fe1650..0173e11 100644
--- a/3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp
@@ -1,6 +1,6 @@
//
-// resolver_query_base.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~
+// ip/resolver_query_base.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,15 +15,12 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
-
-#include <boost/asio/detail/push_options.hpp>
-#include <boost/config.hpp>
+#include <boost/asio/detail/config.hpp>
#include <boost/detail/workaround.hpp>
-#include <boost/asio/detail/pop_options.hpp>
-
#include <boost/asio/detail/socket_types.hpp>
+#include <boost/asio/detail/push_options.hpp>
+
namespace boost {
namespace asio {
namespace ip {
diff --git a/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp b/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp
index ba59f6d..b13e0ad 100644
--- a/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp
@@ -1,6 +1,6 @@
//
-// resolver_service.hpp
-// ~~~~~~~~~~~~~~~~~~~~
+// ip/resolver_service.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,14 +15,14 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
-
-#include <boost/asio/error.hpp>
+#include <boost/asio/detail/config.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/asio/detail/resolver_service.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/basic_resolver_iterator.hpp>
#include <boost/asio/ip/basic_resolver_query.hpp>
-#include <boost/asio/detail/resolver_service.hpp>
-#include <boost/asio/detail/service_base.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
@@ -73,13 +73,14 @@ public:
explicit resolver_service(boost::asio::io_service& io_service)
: boost::asio::detail::service_base<
resolver_service<InternetProtocol> >(io_service),
- service_impl_(boost::asio::use_service<service_impl_type>(io_service))
+ service_impl_(io_service)
{
}
/// Destroy all user-defined handler objects owned by the service.
void shutdown_service()
{
+ service_impl_.shutdown_service();
}
/// Construct a new resolver implementation.
@@ -131,8 +132,8 @@ public:
}
private:
- // The service that provides the platform-specific implementation.
- service_impl_type& service_impl_;
+ // The platform-specific implementation.
+ service_impl_type service_impl_;
};
} // namespace ip
diff --git a/3rdParty/Boost/src/boost/asio/ip/tcp.hpp b/3rdParty/Boost/src/boost/asio/ip/tcp.hpp
index 541c95c..2026148 100644
--- a/3rdParty/Boost/src/boost/asio/ip/tcp.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/tcp.hpp
@@ -1,6 +1,6 @@
//
-// tcp.hpp
-// ~~~~~~~
+// ip/tcp.hpp
+// ~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,17 +15,18 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
-
+#include <boost/asio/detail/config.hpp>
#include <boost/asio/basic_socket_acceptor.hpp>
#include <boost/asio/basic_socket_iostream.hpp>
#include <boost/asio/basic_stream_socket.hpp>
+#include <boost/asio/detail/socket_option.hpp>
+#include <boost/asio/detail/socket_types.hpp>
#include <boost/asio/ip/basic_endpoint.hpp>
#include <boost/asio/ip/basic_resolver.hpp>
#include <boost/asio/ip/basic_resolver_iterator.hpp>
#include <boost/asio/ip/basic_resolver_query.hpp>
-#include <boost/asio/detail/socket_option.hpp>
-#include <boost/asio/detail/socket_types.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
diff --git a/3rdParty/Boost/src/boost/asio/ip/udp.hpp b/3rdParty/Boost/src/boost/asio/ip/udp.hpp
index e592e06..4d78692 100644
--- a/3rdParty/Boost/src/boost/asio/ip/udp.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/udp.hpp
@@ -1,6 +1,6 @@
//
-// udp.hpp
-// ~~~~~~~
+// ip/udp.hpp
+// ~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,14 +15,15 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
-
+#include <boost/asio/detail/config.hpp>
#include <boost/asio/basic_datagram_socket.hpp>
+#include <boost/asio/detail/socket_types.hpp>
#include <boost/asio/ip/basic_endpoint.hpp>
#include <boost/asio/ip/basic_resolver.hpp>
#include <boost/asio/ip/basic_resolver_iterator.hpp>
#include <boost/asio/ip/basic_resolver_query.hpp>
-#include <boost/asio/detail/socket_types.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
diff --git a/3rdParty/Boost/src/boost/asio/ip/unicast.hpp b/3rdParty/Boost/src/boost/asio/ip/unicast.hpp
index c97e6fd..1f331de 100644
--- a/3rdParty/Boost/src/boost/asio/ip/unicast.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/unicast.hpp
@@ -1,6 +1,6 @@
//
-// unicast.hpp
-// ~~~~~~~~~~~
+// ip/unicast.hpp
+// ~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,15 +15,12 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
-
-#include <boost/asio/detail/push_options.hpp>
+#include <boost/asio/detail/config.hpp>
#include <cstddef>
-#include <boost/config.hpp>
-#include <boost/asio/detail/pop_options.hpp>
-
#include <boost/asio/ip/detail/socket_option.hpp>
+#include <boost/asio/detail/push_options.hpp>
+
namespace boost {
namespace asio {
namespace ip {
diff --git a/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp b/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp
index 9adcbff..e9aab31 100644
--- a/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp
+++ b/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp
@@ -1,6 +1,6 @@
//
-// v6_only.hpp
-// ~~~~~~~~~~~
+// ip/v6_only.hpp
+// ~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
@@ -15,10 +15,11 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-#include <boost/asio/detail/push_options.hpp>
-
+#include <boost/asio/detail/config.hpp>
#include <boost/asio/detail/socket_option.hpp>
+#include <boost/asio/detail/push_options.hpp>
+
namespace boost {
namespace asio {
namespace ip {