12#include <boost/asio.hpp>
73 net_e from_enum_string(
const std::string_view &view);
80 std::string_view to_enum_string(net_e net);
88 net_e from_address(
const std::string_view &view);
98 host_t host_create(af_e af, ENetAddress &addr, std::uint16_t port);
105 af_e af_from_enum_string(
const std::string_view &view);
113 af_e get_effective_address_family(af_e af);
120 std::string_view af_to_any_address_string(af_e af);
127 std::string get_bind_address(af_e af);
134 std::string get_bind_address_url_host();
142 boost::asio::ip::address normalize_address(boost::asio::ip::address address);
150 std::string addr_to_normalized_string(boost::asio::ip::address address);
158 std::string addr_to_url_escaped_string(boost::asio::ip::address address);
165 int encryption_mode_for_address(boost::asio::ip::address address);
172 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.
Definition network.cpp:243
void free_host(ENetHost *host)
Destroy an ENet host allocated by host_create().
Definition network.cpp:231
af_e
Enumerates supported af options.
Definition network.h:62
@ IPV4
IPv4 only.
Definition network.h:63
@ BOTH
IPv4 and IPv6.
Definition network.h:64
util::safe_ptr< ENetHost, &free_host > host_t
Owning ENet host pointer released with enet_host_destroy.
Definition network.h:40
util::safe_ptr< ENetPacket, &enet_packet_destroy > packet_t
Owning ENet packet pointer released with enet_packet_destroy.
Definition network.h:48
ENetPeer * peer_t
Raw ENet peer handle owned by an ENet host.
Definition network.h:44
net_e
Enumerates supported net options.
Definition network.h:53
@ PC
PC.
Definition network.h:54
@ WAN
WAN.
Definition network.h:56
@ LAN
LAN.
Definition network.h:55
Declarations for utility functions.
uniq_ptr< T, Destroy< T *, void, function > > safe_ptr
Unique pointer using a compile-time C-style destroy function.
Definition utility.h:1590