LLDB mainline
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes | List of all members
lldb_private::SocketAddress Class Reference

#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 SocketAddressoperator= (const struct addrinfo *addr_info)
 
const SocketAddressoperator= (const struct sockaddr &s)
 
const SocketAddressoperator= (const struct sockaddr_in &s)
 
const SocketAddressoperator= (const struct sockaddr_in6 &s)
 
const SocketAddressoperator= (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< SocketAddressGetAddressInfo (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
 

Detailed Description

Definition at line 34 of file SocketAddress.h.

Member Typedef Documentation

◆ sockaddr_t

Constructor & Destructor Documentation

◆ SocketAddress() [1/6]

SocketAddress::SocketAddress ( )

Definition at line 75 of file SocketAddress.cpp.

References Clear().

Referenced by GetAddressInfo().

◆ SocketAddress() [2/6]

SocketAddress::SocketAddress ( const struct addrinfo *  addr_info)

Definition at line 91 of file SocketAddress.cpp.

◆ SocketAddress() [3/6]

SocketAddress::SocketAddress ( const struct sockaddr s)

◆ SocketAddress() [4/6]

SocketAddress::SocketAddress ( const struct sockaddr_in s)

◆ SocketAddress() [5/6]

SocketAddress::SocketAddress ( const struct sockaddr_in6 s)

◆ SocketAddress() [6/6]

SocketAddress::SocketAddress ( const struct sockaddr_storage s)

◆ ~SocketAddress()

SocketAddress::~SocketAddress ( )
default

Member Function Documentation

◆ Clear()

void SocketAddress::Clear ( )

Definition at line 98 of file SocketAddress.cpp.

References m_socket_addr.

Referenced by getaddrinfo(), operator=(), SetToAnyAddress(), SetToLocalhost(), and SocketAddress().

◆ GetAddressInfo()

std::vector< SocketAddress > SocketAddress::GetAddressInfo ( const char *  hostname,
const char *  servname,
int  ai_family,
int  ai_socktype,
int  ai_protocol,
int  ai_flags = 0 
)
static

◆ getaddrinfo()

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().

◆ GetFamily()

sa_family_t SocketAddress::GetFamily ( ) const

◆ GetIPAddress()

std::string SocketAddress::GetIPAddress ( ) const

◆ GetLength()

socklen_t SocketAddress::GetLength ( ) const

◆ GetMaxLength()

socklen_t SocketAddress::GetMaxLength ( )
static

◆ GetPort()

uint16_t SocketAddress::GetPort ( ) const

◆ IsAnyAddr()

bool SocketAddress::IsAnyAddr ( ) const

◆ IsLocalhost()

bool SocketAddress::IsLocalhost ( ) const

◆ IsValid()

bool SocketAddress::IsValid ( ) const

Definition at line 102 of file SocketAddress.cpp.

References GetLength().

Referenced by getaddrinfo().

◆ operator const struct sockaddr *()

lldb_private::SocketAddress::operator const struct sockaddr * ( ) const
inline

◆ operator const struct sockaddr_in *()

lldb_private::SocketAddress::operator const struct sockaddr_in * ( ) const
inline

◆ operator const struct sockaddr_in6 *()

lldb_private::SocketAddress::operator const struct sockaddr_in6 * ( ) const
inline

◆ operator const struct sockaddr_storage *()

lldb_private::SocketAddress::operator const struct sockaddr_storage * ( ) const
inline

◆ operator struct sockaddr *()

lldb_private::SocketAddress::operator struct sockaddr * ( )
inline

◆ operator struct sockaddr_in *()

lldb_private::SocketAddress::operator struct sockaddr_in * ( )
inline

◆ operator struct sockaddr_in6 *()

lldb_private::SocketAddress::operator struct sockaddr_in6 * ( )
inline

◆ operator struct sockaddr_storage *()

lldb_private::SocketAddress::operator struct sockaddr_storage * ( )
inline

◆ operator!=()

bool SocketAddress::operator!= ( const SocketAddress rhs) const

Definition at line 322 of file SocketAddress.cpp.

◆ operator=() [1/5]

const SocketAddress & SocketAddress::operator= ( const struct addrinfo *  addr_info)

Definition at line 179 of file SocketAddress.cpp.

References Clear(), and m_socket_addr.

◆ operator=() [2/5]

const SocketAddress & SocketAddress::operator= ( const struct sockaddr s)

◆ operator=() [3/5]

const SocketAddress & SocketAddress::operator= ( const struct sockaddr_in s)

◆ operator=() [4/5]

const SocketAddress & SocketAddress::operator= ( const struct sockaddr_in6 s)

◆ operator=() [5/5]

const SocketAddress & SocketAddress::operator= ( const struct sockaddr_storage s)

◆ operator==()

bool SocketAddress::operator== ( const SocketAddress rhs) const

◆ SetFamily()

void SocketAddress::SetFamily ( sa_family_t  family)

◆ SetPort()

bool SocketAddress::SetPort ( uint16_t  port)

◆ SetToAnyAddress()

bool SocketAddress::SetToAnyAddress ( sa_family_t  family,
uint16_t  port 
)

◆ SetToLocalhost()

bool SocketAddress::SetToLocalhost ( sa_family_t  family,
uint16_t  port 
)

◆ sockaddr() [1/2]

struct sockaddr & lldb_private::SocketAddress::sockaddr ( )
inline

◆ sockaddr() [2/2]

const struct sockaddr & lldb_private::SocketAddress::sockaddr ( ) const
inline

◆ sockaddr_in() [1/2]

struct sockaddr_in & lldb_private::SocketAddress::sockaddr_in ( )
inline

◆ sockaddr_in() [2/2]

const struct sockaddr_in & lldb_private::SocketAddress::sockaddr_in ( ) const
inline

◆ sockaddr_in6() [1/2]

struct sockaddr_in6 & lldb_private::SocketAddress::sockaddr_in6 ( )
inline

◆ sockaddr_in6() [2/2]

const struct sockaddr_in6 & lldb_private::SocketAddress::sockaddr_in6 ( ) const
inline

◆ sockaddr_storage() [1/2]

struct sockaddr_storage & lldb_private::SocketAddress::sockaddr_storage ( )
inline

◆ sockaddr_storage() [2/2]

const struct sockaddr_storage & lldb_private::SocketAddress::sockaddr_storage ( ) const
inline

Member Data Documentation

◆ m_socket_addr

sockaddr_t lldb_private::SocketAddress::m_socket_addr
protected

The documentation for this class was generated from the following files: