|
Sunshine master
Self-hosted game stream host for Moonlight.
|
Definitions for networking related functions. More...
#include <algorithm>#include <sstream>#include "config.h"#include "logging.h"#include "network.h"#include "utility.h"Functions | |
| std::string | net::addr_to_normalized_string (boost::asio::ip::address address) |
| Get the given address in normalized string form. | |
| std::string | net::addr_to_url_escaped_string (boost::asio::ip::address address) |
| Get the given address in a normalized form for the host portion of a URL. | |
| af_e | net::af_from_enum_string (const std::string_view &view) |
| Convert a config address-family string to the matching enum. | |
| std::string_view | net::af_to_any_address_string (af_e af) |
| Get the wildcard binding address for a given address family. | |
| int | net::encryption_mode_for_address (boost::asio::ip::address address) |
| Get the encryption mode for the given remote endpoint address. | |
| void | net::free_host (ENetHost *host) |
| Destroy an ENet host allocated by host_create(). | |
| net_e | net::from_address (const std::string_view &view) |
| Convert a Boost address family to Sunshine network enum value. | |
| net_e | net::from_enum_string (const std::string_view &view) |
| Convert configuration text to a network enum value. | |
| std::string | net::get_bind_address (af_e af) |
| Get the binding address to use based on config. | |
| host_t | net::host_create (af_e af, ENetAddress &addr, std::uint16_t port) |
| Create an ENet host with the requested address family. | |
| std::uint16_t | net::map_port (int port) |
| Map a specified port based on the base port. | |
| std::string | net::mdns_instance_name (const std::string_view &hostname) |
| Returns a string for use as the instance name for mDNS. | |
| boost::asio::ip::address | net::normalize_address (boost::asio::ip::address address) |
| Convert an address to a normalized form. | |
| std::string_view | net::to_enum_string (net_e net) |
| Convert a network enum value to configuration text. | |
Variables | |
| std::vector< ip::network_v4 > | net::lan_ips_v4 |
| Lan ips v4. | |
| std::vector< ip::network_v6 > | net::lan_ips_v6 |
| Lan ips v6. | |
| std::vector< ip::network_v4 > | net::pc_ips_v4 |
| Pc ips v4. | |
| std::vector< ip::network_v6 > | net::pc_ips_v6 |
| Pc ips v6. | |
Definitions for networking related functions.
| std::string net::addr_to_normalized_string | ( | boost::asio::ip::address | address | ) |
Get the given address in normalized string form.
Normalization converts IPv4-mapped IPv6 addresses into IPv4 addresses.
| address | The address to normalize. |
| std::string net::addr_to_url_escaped_string | ( | boost::asio::ip::address | address | ) |
Get the given address in a normalized form for the host portion of a URL.
Normalization converts IPv4-mapped IPv6 addresses into IPv4 addresses.
| address | The address to normalize and escape. |
| af_e net::af_from_enum_string | ( | const std::string_view & | view | ) |
Convert a config address-family string to the matching enum.
| view | The config option value. |
| std::string_view net::af_to_any_address_string | ( | af_e | af | ) |
Get the wildcard binding address for a given address family.
| af | Address family. |
| int net::encryption_mode_for_address | ( | boost::asio::ip::address | address | ) |
Get the encryption mode for the given remote endpoint address.
| address | The address used to look up the desired encryption mode. |
| void net::free_host | ( | ENetHost * | host | ) |
Destroy an ENet host allocated by host_create().
| host | Host name or address to resolve. |
| net_e net::from_address | ( | const std::string_view & | view | ) |
Convert a Boost address family to Sunshine network enum value.
| view | Boost.Log record view being formatted. |
| net_e net::from_enum_string | ( | const std::string_view & | view | ) |
Convert configuration text to a network enum value.
| view | Boost.Log record view being formatted. |
| std::string net::get_bind_address | ( | af_e | af | ) |
Get the binding address to use based on config.
| af | Address family. |
| host_t net::host_create | ( | af_e | af, |
| ENetAddress & | addr, | ||
| std::uint16_t | port ) |
Create an ENet host with the requested address family.
| af | Address family used for socket creation or binding. |
| addr | Network address to bind, parse, or format. |
| port | TCP or UDP port number. |
| std::uint16_t net::map_port | ( | int | port | ) |
Map a specified port based on the base port.
| port | The port to map as a difference from the base port. |
*Examples**
| std::string net::mdns_instance_name | ( | const std::string_view & | hostname | ) |
Returns a string for use as the instance name for mDNS.
| hostname | The hostname to use for instance name generation. |
| boost::asio::ip::address net::normalize_address | ( | boost::asio::ip::address | address | ) |
Convert an address to a normalized form.
Normalization converts IPv4-mapped IPv6 addresses into IPv4 addresses.
| address | The address to normalize. |
| std::string_view net::to_enum_string | ( | net_e | net | ) |
Convert a network enum value to configuration text.
| net | Network scope to convert or format. |
| std::vector<ip::network_v4> net::lan_ips_v4 |
Lan ips v4.
| std::vector<ip::network_v6> net::lan_ips_v6 |
Lan ips v6.
| std::vector<ip::network_v4> net::pc_ips_v4 |
Pc ips v4.
| std::vector<ip::network_v6> net::pc_ips_v6 |
Pc ips v6.