Files
rippled/include/xrpl/beast/net/IPAddressConversion.h
yinyiqian1 1e73f3f3ff Merge develop into ConfidentialTransfer (#6987)
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: chuanshanjida <chuanshanjida@outlook.com>
Co-authored-by: Ed Hennis <ed@ripple.com>
Co-authored-by: Bart <bthomee@users.noreply.github.com>
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
Co-authored-by: Zhiyuan Wang <96991820+Kassaking7@users.noreply.github.com>
Co-authored-by: Alex Kremer <akremer@ripple.com>
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
Co-authored-by: Sergey Kuznetsov <skuznetsov@ripple.com>
Co-authored-by: JCW <a1q123456@users.noreply.github.com>
Co-authored-by: xrplf-ai-reviewer[bot] <266832837+xrplf-ai-reviewer[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gregory Tsipenyuk <gregtatcam@users.noreply.github.com>
Co-authored-by: chuanshanjida <chuanshanjida@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
2026-04-22 23:34:03 -04:00

61 lines
1.3 KiB
C++

#pragma once
#include <xrpl/beast/net/IPEndpoint.h>
#include <boost/asio.hpp>
namespace beast::IP {
/** Convert to Endpoint.
The port is set to zero.
*/
Endpoint
from_asio(boost::asio::ip::address const& address);
/** Convert to Endpoint. */
Endpoint
from_asio(boost::asio::ip::tcp::endpoint const& endpoint);
/** Convert to asio::ip::address.
The port is ignored.
*/
boost::asio::ip::address
to_asio_address(Endpoint const& endpoint);
/** Convert to asio::ip::tcp::endpoint. */
boost::asio::ip::tcp::endpoint
to_asio_endpoint(Endpoint const& endpoint);
} // namespace beast::IP
namespace beast {
// DEPRECATED
struct IPAddressConversion
{
explicit IPAddressConversion() = default;
static IP::Endpoint
from_asio(boost::asio::ip::address const& address)
{
return IP::from_asio(address);
}
static IP::Endpoint
from_asio(boost::asio::ip::tcp::endpoint const& endpoint)
{
return IP::from_asio(endpoint);
}
static boost::asio::ip::address
to_asio_address(IP::Endpoint const& address)
{
return IP::to_asio_address(address);
}
static boost::asio::ip::tcp::endpoint
to_asio_endpoint(IP::Endpoint const& address)
{
return IP::to_asio_endpoint(address);
}
};
} // namespace beast