#include <address.h>
Public Member Functions | |
Address () | |
Address (u32 address, u16 port) | |
Address (u8 a, u8 b, u8 c, u8 d, u16 port) | |
Address (const IPv6AddressBytes *ipv6_bytes, u16 port) | |
bool | operator== (const Address &address) |
bool | operator!= (const Address &address) |
void | Resolve (const char *name) |
struct sockaddr_in | getAddress () const |
unsigned short | getPort () const |
void | setAddress (u32 address) |
void | setAddress (u8 a, u8 b, u8 c, u8 d) |
void | setAddress (const IPv6AddressBytes *ipv6_bytes) |
struct sockaddr_in6 | getAddress6 () const |
int | getFamily () const |
bool | isIPv6 () const |
bool | isZero () const |
void | setPort (unsigned short port) |
void | print (std::ostream *s) const |
std::string | serializeString () const |
bool | isLocalhost () const |
Private Attributes | |
unsigned int | m_addr_family = 0 |
union { | |
struct sockaddr_in ipv4 | |
struct sockaddr_in6 ipv6 | |
} | m_address |
u16 | m_port = 0 |
Address::Address | ( | ) |
References m_address.
Address::Address | ( | u32 | address, |
u16 | port | ||
) |
Address::Address | ( | u8 | a, |
u8 | b, | ||
u8 | c, | ||
u8 | d, | ||
u16 | port | ||
) |
Address::Address | ( | const IPv6AddressBytes * | ipv6_bytes, |
u16 | port | ||
) |
struct sockaddr_in Address::getAddress | ( | ) | const |
References itos(), m_addr_family, and m_address.
Referenced by UDPSocket::Bind(), UDPSocket::Send(), and TestSocket::testIPv4Socket().
struct sockaddr_in6 Address::getAddress6 | ( | ) | const |
Referenced by UDPSocket::Bind(), UDPSocket::Send(), and TestSocket::testIPv6Socket().
int Address::getFamily | ( | ) | const |
References m_addr_family.
Referenced by UDPSocket::Bind(), ModApiServer::l_get_player_information(), and UDPSocket::Send().
u16 Address::getPort | ( | ) | const |
References m_port.
Referenced by Server::AsyncRunStep(), UDPSocket::Bind(), con::ConnectionSendThread::connect(), ModApiClient::l_get_server_info(), UDPSocket::Send(), Game::showPauseMenu(), and Server::start().
bool Address::isIPv6 | ( | ) | const |
References m_addr_family.
Referenced by con::ConnectionSendThread::connect(), Game::connectToServer(), Game::createSingleplayerServer(), isLocalhost(), run_dedicated_server(), TestConnection::testConnectSendReceive(), and TestSocket::testIPv4Socket().
bool Address::isLocalhost | ( | ) | const |
References isIPv6(), and m_address.
Referenced by TestAddress::testIsLocalhost().
bool Address::isZero | ( | ) | const |
References m_addr_family, and m_address.
Referenced by Game::connectToServer().
bool Address::operator!= | ( | const Address & | address | ) |
bool Address::operator== | ( | const Address & | address | ) |
References ipv4, ipv6, m_addr_family, m_address, and m_port.
void Address::print | ( | std::ostream * | s | ) | const |
References m_addr_family, m_port, and serializeString().
Referenced by Game::connectToServer(), UDPSocket::Receive(), and UDPSocket::Send().
void Address::Resolve | ( | const char * | name | ) |
References g_settings, Settings::getBool(), m_addr_family, m_address, and setAddress().
Referenced by Game::connectToServer(), Game::createSingleplayerServer(), run_dedicated_server(), TestConnection::testConnectSendReceive(), and TestSocket::testIPv4Socket().
std::string Address::serializeString | ( | ) | const |
Referenced by UDPSocket::Bind(), con::ConnectionSendThread::connect(), Game::connectToServer(), Game::createSingleplayerServer(), Server::handleCommand_FirstSrp(), Server::handleCommand_Init(), Server::handleCommand_SrpBytesA(), Server::handleCommand_SrpBytesM(), ModApiServer::l_get_player_information(), ModApiClient::l_get_server_info(), print(), Server::ProcessData(), con::ConnectionSendThread::processNonReliableCommand(), con::ConnectionSendThread::rawSend(), run_dedicated_server(), con::ConnectionSendThread::serve(), Server::StageTwoClientInit(), and Server::start().
void Address::setAddress | ( | const IPv6AddressBytes * | ipv6_bytes | ) |
References IPv6AddressBytes::bytes, m_addr_family, and m_address.
void Address::setAddress | ( | u32 | address | ) |
References m_addr_family, and m_address.
Referenced by Address(), con::ConnectionSendThread::connect(), Game::connectToServer(), Game::createSingleplayerServer(), Resolve(), and run_dedicated_server().
void Address::setAddress | ( | u8 | a, |
u8 | b, | ||
u8 | c, | ||
u8 | d | ||
) |
References m_addr_family, and m_address.
void Address::setPort | ( | unsigned short | port | ) |
struct sockaddr_in Address::ipv4 |
Referenced by operator==().
struct sockaddr_in6 Address::ipv6 |
Referenced by operator==().
|
private |
Referenced by getAddress(), getFamily(), isIPv6(), isZero(), operator==(), print(), Resolve(), and setAddress().
union { ... } Address::m_address |
Referenced by Address(), getAddress(), isLocalhost(), isZero(), operator==(), Resolve(), and setAddress().
|
private |
Referenced by getPort(), operator==(), print(), and setPort().