LLDB mainline
|
#include <SocketAddress.h>
Classes | |
union | sockaddr_tag |
Public Member Functions | |
SocketAddress () | |
SocketAddress (const struct addrinfo *addr_info) | |
SocketAddress (const struct sockaddr &s) | |
SocketAddress (const struct sockaddr_in &s) | |
SocketAddress (const struct sockaddr_in6 &s) | |
SocketAddress (const struct sockaddr_storage &s) | |
~SocketAddress () | |
const SocketAddress & | operator= (const struct addrinfo *addr_info) |
const SocketAddress & | operator= (const struct sockaddr &s) |
const SocketAddress & | operator= (const struct sockaddr_in &s) |
const SocketAddress & | operator= (const struct sockaddr_in6 &s) |
const SocketAddress & | operator= (const struct sockaddr_storage &s) |
bool | operator== (const SocketAddress &rhs) const |
bool | operator!= (const SocketAddress &rhs) const |
void | Clear () |
socklen_t | GetLength () const |
sa_family_t | GetFamily () const |
void | SetFamily (sa_family_t family) |
std::string | GetIPAddress () const |
uint16_t | GetPort () const |
bool | SetPort (uint16_t port) |
bool | getaddrinfo (const char *host, const char *service, int ai_family=PF_UNSPEC, int ai_socktype=0, int ai_protocol=0, int ai_flags=0) |
bool | SetToLocalhost (sa_family_t family, uint16_t port) |
bool | SetToAnyAddress (sa_family_t family, uint16_t port) |
bool | IsValid () const |
bool | IsAnyAddr () const |
bool | IsLocalhost () const |
struct sockaddr & | sockaddr () |
const struct sockaddr & | sockaddr () const |
struct sockaddr_in & | sockaddr_in () |
const struct sockaddr_in & | sockaddr_in () const |
struct sockaddr_in6 & | sockaddr_in6 () |
const struct sockaddr_in6 & | sockaddr_in6 () const |
struct sockaddr_storage & | sockaddr_storage () |
const struct sockaddr_storage & | sockaddr_storage () const |
operator struct sockaddr * () | |
operator const struct sockaddr * () const | |
operator struct sockaddr_in * () | |
operator const struct sockaddr_in * () const | |
operator struct sockaddr_in6 * () | |
operator const struct sockaddr_in6 * () const | |
operator const struct sockaddr_storage * () const | |
operator struct sockaddr_storage * () | |
Static Public Member Functions | |
static std::vector< SocketAddress > | GetAddressInfo (const char *hostname, const char *servname, int ai_family, int ai_socktype, int ai_protocol, int ai_flags=0) |
static socklen_t | GetMaxLength () |
Protected Types | |
typedef union lldb_private::SocketAddress::sockaddr_tag | sockaddr_t |
Protected Attributes | |
sockaddr_t | m_socket_addr |
Definition at line 34 of file SocketAddress.h.
|
protected |
SocketAddress::SocketAddress | ( | ) |
Definition at line 75 of file SocketAddress.cpp.
References Clear().
Referenced by GetAddressInfo().
SocketAddress::SocketAddress | ( | const struct addrinfo * | addr_info | ) |
Definition at line 91 of file SocketAddress.cpp.
SocketAddress::SocketAddress | ( | const struct sockaddr & | s | ) |
Definition at line 77 of file SocketAddress.cpp.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa.
SocketAddress::SocketAddress | ( | const struct sockaddr_in & | s | ) |
Definition at line 79 of file SocketAddress.cpp.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv4.
SocketAddress::SocketAddress | ( | const struct sockaddr_in6 & | s | ) |
Definition at line 83 of file SocketAddress.cpp.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv6.
SocketAddress::SocketAddress | ( | const struct sockaddr_storage & | s | ) |
Definition at line 87 of file SocketAddress.cpp.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_storage.
|
default |
void SocketAddress::Clear | ( | ) |
Definition at line 98 of file SocketAddress.cpp.
References m_socket_addr.
Referenced by getaddrinfo(), operator=(), SetToAnyAddress(), SetToLocalhost(), and SocketAddress().
|
static |
Definition at line 223 of file SocketAddress.cpp.
References getaddrinfo(), and SocketAddress().
Referenced by lldb_private::TCPSocket::Connect(), getaddrinfo(), and lldb_private::TCPSocket::Listen().
bool SocketAddress::getaddrinfo | ( | const char * | host, |
const char * | service, | ||
int | ai_family = PF_UNSPEC , |
||
int | ai_socktype = 0 , |
||
int | ai_protocol = 0 , |
||
int | ai_flags = 0 |
||
) |
Definition at line 210 of file SocketAddress.cpp.
References Clear(), GetAddressInfo(), and IsValid().
Referenced by GetAddressInfo().
sa_family_t SocketAddress::GetFamily | ( | ) | const |
Definition at line 126 of file SocketAddress.cpp.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa.
Referenced by GetIPAddress(), GetLength(), GetPort(), IsAnyAddr(), IsLocalhost(), operator==(), and SetPort().
std::string SocketAddress::GetIPAddress | ( | ) | const |
Definition at line 138 of file SocketAddress.cpp.
References GetFamily(), m_socket_addr, lldb_private::SocketAddress::sockaddr_tag::sa_ipv4, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv6.
Referenced by lldb_private::TCPSocket::Accept(), lldb_private::TCPSocket::GetLocalIPAddress(), lldb_private::UDPSocket::GetRemoteConnectionURI(), and lldb_private::TCPSocket::GetRemoteIPAddress().
socklen_t SocketAddress::GetLength | ( | ) | const |
Definition at line 115 of file SocketAddress.cpp.
References GetFamily(), GetFamilyLength(), m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa.
Referenced by lldb_private::UDPSocket::Connect(), IsValid(), lldb_private::TCPSocket::Listen(), operator==(), and lldb_private::UDPSocket::Send().
|
static |
Definition at line 124 of file SocketAddress.cpp.
Referenced by lldb_private::TCPSocket::GetLocalIPAddress(), lldb_private::TCPSocket::GetLocalPortNumber(), lldb_private::TCPSocket::GetRemoteIPAddress(), and lldb_private::TCPSocket::GetRemotePortNumber().
uint16_t SocketAddress::GetPort | ( | ) | const |
Definition at line 155 of file SocketAddress.cpp.
References GetFamily(), m_socket_addr, lldb_private::SocketAddress::sockaddr_tag::sa_ipv4, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv6.
Referenced by lldb_private::TCPSocket::GetLocalPortNumber(), lldb_private::UDPSocket::GetRemoteConnectionURI(), and lldb_private::TCPSocket::GetRemotePortNumber().
bool SocketAddress::IsAnyAddr | ( | ) | const |
Definition at line 293 of file SocketAddress.cpp.
References GetFamily(), m_socket_addr, lldb_private::SocketAddress::sockaddr_tag::sa_ipv4, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv6.
Referenced by lldb_private::TCPSocket::Accept().
bool SocketAddress::IsLocalhost | ( | ) | const |
Definition at line 299 of file SocketAddress.cpp.
References GetFamily(), m_socket_addr, lldb_private::SocketAddress::sockaddr_tag::sa_ipv4, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv6.
Referenced by lldb_private::TCPSocket::Listen().
bool SocketAddress::IsValid | ( | ) | const |
Definition at line 102 of file SocketAddress.cpp.
References GetLength().
Referenced by getaddrinfo().
|
inline |
Definition at line 156 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa.
|
inline |
Definition at line 160 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv4.
|
inline |
Definition at line 164 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv6.
|
inline |
Definition at line 168 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_storage.
|
inline |
Definition at line 154 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa.
|
inline |
Definition at line 158 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv4.
|
inline |
Definition at line 162 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv6.
|
inline |
Definition at line 172 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_storage.
bool SocketAddress::operator!= | ( | const SocketAddress & | rhs | ) | const |
Definition at line 322 of file SocketAddress.cpp.
const SocketAddress & SocketAddress::operator= | ( | const struct addrinfo * | addr_info | ) |
Definition at line 179 of file SocketAddress.cpp.
References Clear(), and m_socket_addr.
const SocketAddress & SocketAddress::operator= | ( | const struct sockaddr & | s | ) |
Definition at line 189 of file SocketAddress.cpp.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa.
const SocketAddress & SocketAddress::operator= | ( | const struct sockaddr_in & | s | ) |
Definition at line 194 of file SocketAddress.cpp.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv4.
const SocketAddress & SocketAddress::operator= | ( | const struct sockaddr_in6 & | s | ) |
Definition at line 199 of file SocketAddress.cpp.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv6.
const SocketAddress & SocketAddress::operator= | ( | const struct sockaddr_storage & | s | ) |
Definition at line 204 of file SocketAddress.cpp.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_storage.
bool SocketAddress::operator== | ( | const SocketAddress & | rhs | ) | const |
Definition at line 306 of file SocketAddress.cpp.
References GetFamily(), GetLength(), m_socket_addr, lldb_private::SocketAddress::sockaddr_tag::sa_ipv4, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv6.
void SocketAddress::SetFamily | ( | sa_family_t | family | ) |
Definition at line 130 of file SocketAddress.cpp.
References GetFamilyLength(), m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa.
Referenced by SetToAnyAddress(), and SetToLocalhost().
bool SocketAddress::SetPort | ( | uint16_t | port | ) |
Definition at line 165 of file SocketAddress.cpp.
References GetFamily(), m_socket_addr, lldb_private::SocketAddress::sockaddr_tag::sa_ipv4, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv6.
Referenced by lldb_private::UDPSocket::Connect(), lldb_private::TCPSocket::Listen(), SetToAnyAddress(), and SetToLocalhost().
bool SocketAddress::SetToAnyAddress | ( | sa_family_t | family, |
uint16_t | port | ||
) |
Definition at line 271 of file SocketAddress.cpp.
References Clear(), m_socket_addr, lldb_private::SocketAddress::sockaddr_tag::sa_ipv4, lldb_private::SocketAddress::sockaddr_tag::sa_ipv6, SetFamily(), and SetPort().
Referenced by lldb_private::UDPSocket::Connect(), and lldb_private::TCPSocket::Listen().
bool SocketAddress::SetToLocalhost | ( | sa_family_t | family, |
uint16_t | port | ||
) |
Definition at line 249 of file SocketAddress.cpp.
References Clear(), m_socket_addr, lldb_private::SocketAddress::sockaddr_tag::sa_ipv4, lldb_private::SocketAddress::sockaddr_tag::sa_ipv6, SetFamily(), and SetPort().
Referenced by lldb_private::UDPSocket::Connect().
|
inline |
Definition at line 119 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa.
Referenced by lldb_private::TCPSocket::Listen().
|
inline |
Definition at line 123 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa.
|
inline |
Definition at line 125 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv4.
|
inline |
Definition at line 129 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv4.
|
inline |
Definition at line 133 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv6.
|
inline |
Definition at line 137 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_ipv6.
|
inline |
Definition at line 141 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_storage.
|
inline |
Definition at line 145 of file SocketAddress.h.
References m_socket_addr, and lldb_private::SocketAddress::sockaddr_tag::sa_storage.
|
protected |
Definition at line 183 of file SocketAddress.h.
Referenced by Clear(), GetFamily(), GetIPAddress(), GetLength(), GetPort(), IsAnyAddr(), IsLocalhost(), operator const struct sockaddr *(), operator const struct sockaddr_in *(), operator const struct sockaddr_in6 *(), operator const struct sockaddr_storage *(), operator struct sockaddr *(), operator struct sockaddr_in *(), operator struct sockaddr_in6 *(), operator struct sockaddr_storage *(), operator=(), operator==(), SetFamily(), SetPort(), SetToAnyAddress(), SetToLocalhost(), sockaddr(), sockaddr_in(), sockaddr_in6(), sockaddr_storage(), and SocketAddress().