Stun Server
Compliant with the latest RFCs including 5389, 5769, and 5780
discover the local host's own external IP address
|
#include <socketaddress.h>
Public Member Functions | |
CSocketAddress () | |
CSocketAddress (const sockaddr &addr) | |
CSocketAddress (const sockaddr_storage &addr) | |
void | CommonConstructor (const sockaddr &addr) |
CSocketAddress (const sockaddr_in &addr) | |
CSocketAddress (const sockaddr_in6 &addr6) | |
CSocketAddress (uint32_t ipHostByteOrder, uint16_t port) | |
uint16_t | GetPort () const |
uint16_t | GetPort_NBO () const |
void | SetPort (uint16_t) |
uint16_t | GetIPLength () const |
size_t | GetIP (void *pAddr, size_t length) const |
size_t | GetIP_NBO (void *pAddr, size_t length) const |
uint16_t | GetFamily () const |
void | ApplyStunXorMap (const StunTransactionId &id) |
const sockaddr * | GetSockAddr () const |
socklen_t | GetSockAddrLength () const |
bool | IsIPAddressZero () const |
bool | IsSameIP (const CSocketAddress &other) const |
bool | IsSameIP_and_Port (const CSocketAddress &other) const |
void | ToString (std::string *pStr) const |
HRESULT | ToStringBuffer (char *pszAddrBytes, size_t length) const |
Static Public Member Functions | |
static HRESULT | GetLocalHost (uint16_t family, CSocketAddress *pAddr) |
Private Member Functions | |
size_t | GetIPImpl (void *pAddr, size_t length, bool fNetworkByteOrder) const |
Private Attributes | |
simple_sockaddr | _address |
Definition at line 32 of file socketaddress.h.
CSocketAddress::CSocketAddress | ( | ) |
Definition at line 22 of file socketaddress.cpp.
CSocketAddress::CSocketAddress | ( | const sockaddr & | addr | ) |
Definition at line 28 of file socketaddress.cpp.
CSocketAddress::CSocketAddress | ( | const sockaddr_storage & | addr | ) |
Definition at line 33 of file socketaddress.cpp.
CSocketAddress::CSocketAddress | ( | const sockaddr_in & | addr | ) |
Definition at line 63 of file socketaddress.cpp.
CSocketAddress::CSocketAddress | ( | const sockaddr_in6 & | addr6 | ) |
Definition at line 57 of file socketaddress.cpp.
CSocketAddress::CSocketAddress | ( | uint32_t | ipHostByteOrder, |
uint16_t | port | ||
) |
Definition at line 69 of file socketaddress.cpp.
void CSocketAddress::ApplyStunXorMap | ( | const StunTransactionId & | id | ) |
Definition at line 180 of file socketaddress.cpp.
void CSocketAddress::CommonConstructor | ( | const sockaddr & | addr | ) |
Definition at line 39 of file socketaddress.cpp.
uint16_t CSocketAddress::GetFamily | ( | ) | const |
Definition at line 174 of file socketaddress.cpp.
size_t CSocketAddress::GetIP | ( | void * | pAddr, |
size_t | length | ||
) | const |
Definition at line 163 of file socketaddress.cpp.
size_t CSocketAddress::GetIP_NBO | ( | void * | pAddr, |
size_t | length | ||
) | const |
Definition at line 169 of file socketaddress.cpp.
|
private |
Definition at line 126 of file socketaddress.cpp.
uint16_t CSocketAddress::GetIPLength | ( | ) | const |
Definition at line 108 of file socketaddress.cpp.
|
static |
Definition at line 337 of file socketaddress.cpp.
uint16_t CSocketAddress::GetPort | ( | ) | const |
Definition at line 79 of file socketaddress.cpp.
uint16_t CSocketAddress::GetPort_NBO | ( | ) | const |
Definition at line 96 of file socketaddress.cpp.
const sockaddr * CSocketAddress::GetSockAddr | ( | ) | const |
Definition at line 212 of file socketaddress.cpp.
socklen_t CSocketAddress::GetSockAddrLength | ( | ) | const |
Definition at line 217 of file socketaddress.cpp.
bool CSocketAddress::IsIPAddressZero | ( | ) | const |
Definition at line 261 of file socketaddress.cpp.
bool CSocketAddress::IsSameIP | ( | const CSocketAddress & | other | ) | const |
Definition at line 229 of file socketaddress.cpp.
bool CSocketAddress::IsSameIP_and_Port | ( | const CSocketAddress & | other | ) | const |
Definition at line 255 of file socketaddress.cpp.
void CSocketAddress::SetPort | ( | uint16_t | port | ) |
Definition at line 84 of file socketaddress.cpp.
void CSocketAddress::ToString | ( | std::string * | pStr | ) | const |
Definition at line 284 of file socketaddress.cpp.
HRESULT CSocketAddress::ToStringBuffer | ( | char * | pszAddrBytes, |
size_t | length | ||
) | const |
Definition at line 290 of file socketaddress.cpp.
|
private |
Definition at line 34 of file socketaddress.h.