Replace ip::address_v4::to_ulong() with ip::address_v4::to_uint() to support boost 1.87, see #197

This commit is contained in:
Andrea Bondavalli 2025-02-27 20:54:39 +01:00
parent efcf95522b
commit 21690a8589
4 changed files with 7 additions and 7 deletions

View File

@ -40,7 +40,7 @@ class IGMP {
bool join(const std::string& interface_ip, const std::string& mcast_ip) {
uint32_t mcast_ip_addr =
ip::make_address(mcast_ip.c_str()).to_v4().to_ulong();
ip::make_address(mcast_ip.c_str()).to_v4().to_uint();
std::scoped_lock<std::mutex> lock{mutex};
auto it = mcast_ref.find(mcast_ip_addr);
@ -74,7 +74,7 @@ class IGMP {
bool leave(const std::string& interface_ip, const std::string& mcast_ip) {
uint32_t mcast_ip_addr =
ip::make_address(mcast_ip.c_str()).to_v4().to_ulong();
ip::make_address(mcast_ip.c_str()).to_v4().to_uint();
std::scoped_lock<std::mutex> lock{mutex};
auto it = mcast_ref.find(mcast_ip_addr);

View File

@ -171,7 +171,7 @@ bool ping(const std::string& ip) {
io_context io_service;
icmp::socket socket{io_service, icmp::v4()};
ip::icmp::endpoint destination(ip::icmp::v4(),
ip::make_address(ip).to_v4().to_ulong());
ip::make_address(ip).to_v4().to_uint());
socket.send_to(boost::asio::buffer(buffer, sizeof buffer), destination);
} catch (...) {
BOOST_LOG_TRIVIAL(error) << "ping:: send_to() failed";

View File

@ -206,7 +206,7 @@ std::pair<bool, RtspSource> RtspClient::process(
<< crc16(reinterpret_cast<const uint8_t*>(res.body.c_str()),
res.body.length());
/*<< std::hex <<
* ip::make_address(address.c_str()).to_ulong();*/
* ip::make_address(address.c_str()).to_uint();*/
rtsp_source.id = ss.str();
rtsp_source.source = "mDNS";
rtsp_source.address = address;

View File

@ -255,7 +255,7 @@ bool SessionManager::parse_sdp(const std::string& sdp, StreamInfo& info) const {
return false;
}
info.stream.m_ui32DestIP =
ip::make_address(fields[2].c_str()).to_v4().to_ulong();
ip::make_address(fields[2].c_str()).to_v4().to_uint();
if (info.stream.m_ui32DestIP == INADDR_NONE) {
BOOST_LOG_TRIVIAL(error) << "session_manager:: invalid IPv4 "
"connection address in SDP at line "
@ -527,12 +527,12 @@ std::error_code SessionManager::add_source(const StreamSource& source) {
ip::make_address(source.address, ec);
if (!ec) {
info.stream.m_ui32DestIP =
ip::make_address(source.address).to_v4().to_ulong();
ip::make_address(source.address).to_v4().to_uint();
} else {
info.stream.m_ui32DestIP =
ip::make_address(config_->get_rtp_mcast_base().c_str())
.to_v4()
.to_ulong() +
.to_uint() +
source.id;
}
info.stream.m_usSrcPort = config_->get_rtp_port();