MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / IsPortInReservedRange

Function IsPortInReservedRange

libi2pd/util.cpp:672–686  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670 }
671
672 bool IsPortInReservedRange (const uint16_t port) noexcept
673 {
674 // https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers (Feb. 3, 2023) + Tor browser (9150)
675 static const std::unordered_set<uint16_t> reservedPorts{
676 9119,9150,9306,9312,9389,9418,9535,9536,9695,
677 9800,9899,10000,10050,10051,10110,10212,
678 10933,11001,11112,11235,11371,12222,12223,
679 13075,13400,13720,13721,13724,13782,13783,
680 13785,13786,15345,17224,17225,17500,18104,
681 19788,19812,19813,19814,19999,20000,24465,
682 24554,26000,27000,27001,27002,27003,27004,
683 27005,27006,27007,27008,27009,28000};
684
685 return (reservedPorts.find(port) != reservedPorts.end());
686 }
687
688 template<typename CheckAddress>
689 static boost::asio::ip::address_v6 GetLocalIPV6Address (CheckAddress checkAddress)

Callers 1

SelectRandomPortMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected