Example #1
0
std::string rev_order_av4_str(const boost::asio::ip::address_v4& a, const std::string& d)
{
    return str(boost::format("%1%.%2%.%3%.%4%.%5%")
            % static_cast<int>(a.to_bytes()[3])
            % static_cast<int>(a.to_bytes()[2])
            % static_cast<int>(a.to_bytes()[1])
            % static_cast<int>(a.to_bytes()[0])
            % d
               );
}
Example #2
0
	size_t operator()(const boost::asio::ip::address_v4& p_ip) const
	{
		return p_ip.to_ulong();
	}
Example #3
0
CIPv4Address::CIPv4Address(boost::asio::ip::address_v4 v4addr, unsigned short port)
{
	m_sockaddr_in.sin_family = AF_INET;
	m_sockaddr_in.sin_port = htons (port);
	memcpy(&m_sockaddr_in.sin_addr.s_addr, &v4addr.to_bytes()[0], sizeof(m_sockaddr_in.sin_addr.s_addr));
}
Example #4
0
   uri::string_type operator () (const boost::asio::ip::address_v4 &host) const {
 	return host.to_string();
   }
Example #5
0
//	////////////////////////////////////////////////////////////////////////////
HostEntry HostAddressToEntry(const boost::asio::ip::address_v4 &host_address)
{

	return(HostAddressToEntry(host_address.to_bytes().data(),
		sizeof(boost::asio::ip::address_v4::bytes_type), AF_INET));
}
Example #6
0
		inline void _helper_impl<mutable_helper_tag, ipv4_frame>::set_destination(boost::asio::ip::address_v4 _destination) const
		{
			this->frame().destination.s_addr = htonl(_destination.to_ulong());
		}
Example #7
0
		inline void _helper_impl<mutable_helper_tag, ipv4_frame>::set_source(boost::asio::ip::address_v4 _source) const
		{
			this->frame().source.s_addr = htonl(_source.to_ulong());
		}
Example #8
0
Worker::Worker(boost::asio::io_service& io_srv, boost::asio::ip::address_v4 ip): io_srv_(io_srv), ip_(ip),
	cudp(io_srv_, ip_.to_string()), cicmp(io_srv_, ip_.to_string()), ctcp(io_srv, ip.to_string())
{
}