#include <GlobalDirectoryServer.hpp>
|
| bool | init (const char *bindHost, Uint16 tcpPort, Uint16 udpPort) |
| | Start the UDP-only directory/relay service.
|
| void | run () |
| void | stop () |
|
| void | pollUdp () |
| void | pruneExpired () |
| void | handleDirectoryControl (const net::UdpReceivedMessage &msg) |
| void | handleRegistration (const net::UdpReceivedMessage &msg, net::discovery::DirectoryMessage kind, const std::uint8_t *data, std::size_t len) |
| void | handleListRequest (const net::UdpReceivedMessage &msg) |
| void | handlePunchRequest (const net::UdpReceivedMessage &msg, const std::uint8_t *data, std::size_t len) |
| void | handleRelayPayload (const net::UdpReceivedMessage &msg) |
| void | sendDirectory (const net::UdpEndpointAddr &dest, const std::vector< std::uint8_t > &payload) |
| void | sendRelay (const net::UdpEndpointAddr &dest, const std::uint8_t *payload, std::size_t len) |
| net::RelayToken | makeRelayToken (std::uint32_t serverId, std::uint32_t clientNonce, Uint64 nowMs) const |
| bool | validateRelayToken (const net::RelayToken &token, std::uint32_t serverId, std::uint32_t clientNonce, Uint64 nowMs) const |
◆ handleDirectoryControl()
◆ handleListRequest()
◆ handlePunchRequest()
| void GlobalDirectoryServer::handlePunchRequest |
( |
const net::UdpReceivedMessage & | msg, |
|
|
const std::uint8_t * | data, |
|
|
std::size_t | len ) |
|
private |
◆ handleRegistration()
◆ handleRelayPayload()
◆ init()
| bool GlobalDirectoryServer::init |
( |
const char * | bindHost, |
|
|
Uint16 | tcpPort, |
|
|
Uint16 | udpPort ) |
Start the UDP-only directory/relay service.
- Parameters
-
| bindHost | Optional bind host. nullptr means all interfaces. |
| tcpPort | Ignored legacy argument, kept so old launch scripts that pass "tcp udp" still work during cutover. |
| udpPort | Public UDP directory/relay port. |
◆ makeRelayToken()
| net::RelayToken GlobalDirectoryServer::makeRelayToken |
( |
std::uint32_t | serverId, |
|
|
std::uint32_t | clientNonce, |
|
|
Uint64 | nowMs ) const |
|
private |
◆ pollUdp()
| void GlobalDirectoryServer::pollUdp |
( |
| ) |
|
|
private |
◆ pruneExpired()
| void GlobalDirectoryServer::pruneExpired |
( |
| ) |
|
|
private |
◆ run()
| void GlobalDirectoryServer::run |
( |
| ) |
|
◆ sendDirectory()
| void GlobalDirectoryServer::sendDirectory |
( |
const net::UdpEndpointAddr & | dest, |
|
|
const std::vector< std::uint8_t > & | payload ) |
|
private |
◆ sendRelay()
| void GlobalDirectoryServer::sendRelay |
( |
const net::UdpEndpointAddr & | dest, |
|
|
const std::uint8_t * | payload, |
|
|
std::size_t | len ) |
|
private |
◆ stop()
| void GlobalDirectoryServer::stop |
( |
| ) |
|
◆ validateRelayToken()
| bool GlobalDirectoryServer::validateRelayToken |
( |
const net::RelayToken & | token, |
|
|
std::uint32_t | serverId, |
|
|
std::uint32_t | clientNonce, |
|
|
Uint64 | nowMs ) const |
|
private |
◆ clientsByRelaySession_
| std::unordered_map<std::uint64_t, ClientEndpoint> GlobalDirectoryServer::clientsByRelaySession_ |
|
private |
◆ nextServerId_
| std::uint32_t GlobalDirectoryServer::nextServerId_ = 1 |
|
private |
◆ relaySecret_
| std::vector<std::uint8_t> GlobalDirectoryServer::relaySecret_ |
|
private |
◆ servers_
| std::unordered_map<std::uint32_t, ServerRecord> GlobalDirectoryServer::servers_ |
|
private |
◆ shouldStop_
| std::atomic<bool> GlobalDirectoryServer::shouldStop_ {false} |
|
private |
◆ udpEndpoint_
The documentation for this class was generated from the following files: