14#include <boost/asio.hpp>
22 void free_host(ENetHost *host);
35 using host_t = util::safe_ptr<ENetHost, free_host>;
36 using peer_t = ENetPeer *;
37 using packet_t = util::safe_ptr<ENetPacket, enet_packet_destroy>;
50 net_e from_enum_string(
const std::string_view &view);
51 std::string_view to_enum_string(net_e net);
61 net_e from_address(
const std::string_view &view);
71 net_e from_address(
const std::string_view &view, std::span<const interface_address_t> links);
81 net_e from_address_ranges(
const std::string_view &view);
87 std::vector<interface_address_t> interface_addresses();
94 raw_address_t to_raw_address(
const boost::asio::ip::address &address);
98 host_t host_create(af_e af, ENetAddress &addr, std::uint16_t port, boost::system::error_code *error =
nullptr);
101 bool prevent_socket_inheritance(boost::asio::ip::udp::socket::native_handle_type socket, boost::system::error_code &error);
116 bool udp_port_available(af_e af, std::uint16_t port);
123 af_e af_from_enum_string(
const std::string_view &view);
130 std::string_view af_to_any_address_string(af_e af);
138 boost::asio::ip::address normalize_address(boost::asio::ip::address address);
146 std::string addr_to_normalized_string(boost::asio::ip::address address);
154 std::string addr_to_url_escaped_string(boost::asio::ip::address address);
161 int encryption_mode_for_address(boost::asio::ip::address address);
168 std::string mdns_instance_name(
const std::string_view &hostname);
std::uint16_t map_port(int port)
Map a specified port based on the base port.
Whether an address shares a subnet with one of this host's interfaces.
Declarations for utility functions.