mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-10-23 12:09:03 +01:00
Merge b079fb63c7
into 1891bd5ba5
This commit is contained in:
commit
48c067ca4b
2 changed files with 12 additions and 0 deletions
|
@ -669,6 +669,17 @@ namespace net
|
||||||
return IsYggdrasilAddress (addr.to_v6 ().to_bytes ().data ());
|
return IsYggdrasilAddress (addr.to_v6 ().to_bytes ().data ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool IsMyceliumAddress (const uint8_t addr[16])
|
||||||
|
{
|
||||||
|
return addr[0] == 0x04 || addr[0] == 0x05;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsMyceliumAddress (const boost::asio::ip::address& addr)
|
||||||
|
{
|
||||||
|
if (!addr.is_v6 ()) return false;
|
||||||
|
return IsMyceliumAddress (addr.to_v6 ().to_bytes ().data ());
|
||||||
|
}
|
||||||
|
|
||||||
bool IsPortInReservedRange (const uint16_t port) noexcept
|
bool IsPortInReservedRange (const uint16_t port) noexcept
|
||||||
{
|
{
|
||||||
// https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers (Feb. 3, 2023) + Tor browser (9150)
|
// https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers (Feb. 3, 2023) + Tor browser (9150)
|
||||||
|
|
|
@ -295,6 +295,7 @@ namespace util
|
||||||
bool IsLocalAddress (const boost::asio::ip::address& addr);
|
bool IsLocalAddress (const boost::asio::ip::address& addr);
|
||||||
bool IsInReservedRange (const boost::asio::ip::address& host);
|
bool IsInReservedRange (const boost::asio::ip::address& host);
|
||||||
bool IsYggdrasilAddress (const boost::asio::ip::address& addr);
|
bool IsYggdrasilAddress (const boost::asio::ip::address& addr);
|
||||||
|
bool IsMyceliumAddress (const boost::asio::ip::address& addr);
|
||||||
bool IsPortInReservedRange (const uint16_t port) noexcept;
|
bool IsPortInReservedRange (const uint16_t port) noexcept;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue