feisty meow concerns codebase
2.140
|
Helpful functions for interacting with TCP/IP stacks. More...
#include <tcpip_stack.h>
Public Member Functions | |
tcpip_stack () | |
virtual | ~tcpip_stack () |
bool | healthy () const |
DEFINE_CLASS_NAME ("tcpip_stack") | |
basis::astring | hostname () const |
machine_uid | this_host (int location_type) const |
basis::byte_array | full_resolve (const basis::astring &hostname, basis::astring &full_host) const |
bool | resolve_any (const basis::astring &name, internet_address &resolved) const |
basis::astring | dns_resolve (const basis::astring &hostname) const |
bool | enumerate_adapters (structures::string_array &ip_addresses, bool add_local=false) const |
internet_address | fill_and_resolve (const basis::astring &machine, int port, bool &worked) const |
bool | enumerate_adapters (machine_uid_array &ip_addresses, bool add_local=false) const |
Static Public Member Functions | |
static basis::astring | tcpip_error_name (int error_value) |
static sockaddr | convert (const internet_address &to_convert) |
static internet_address | convert (const sockaddr &to_convert) |
Helpful functions for interacting with TCP/IP stacks.
This class hides details of the platform specifics of the stack.
Definition at line 37 of file tcpip_stack.h.
sockets::tcpip_stack::tcpip_stack | ( | ) |
Definition at line 80 of file tcpip_stack.cpp.
|
virtual |
Definition at line 84 of file tcpip_stack.cpp.
|
static |
Definition at line 258 of file tcpip_stack.cpp.
References sockets::internet_address::ADDRESS_SIZE, FUNCDEF, sockets::internet_address::ip_address, sockets::internet_address::port, and basis::array< contents >::stuff().
|
static |
Definition at line 276 of file tcpip_stack.cpp.
References sockets::internet_address::ADDRESS_SIZE, and sockets::internet_address::fill().
sockets::tcpip_stack::DEFINE_CLASS_NAME | ( | "tcpip_stack" | ) |
astring sockets::tcpip_stack::dns_resolve | ( | const basis::astring & | hostname | ) | const |
Definition at line 331 of file tcpip_stack.cpp.
References FUNCDEF, hostname(), basis::astring::iequals(), basis::array< contents >::length(), and basis::astring::observe().
bool sockets::tcpip_stack::enumerate_adapters | ( | machine_uid_array & | ip_addresses, |
bool | add_local = false |
||
) | const |
Definition at line 240 of file tcpip_stack.cpp.
References sockets::internet_address::convert(), sockets::machine_uid_array::elements(), enumerate_adapters(), fill_and_resolve(), hostname(), sockets::internet_address::hostname, basis::array< contents >::length(), sockets::internet_address::MAXIMUM_HOSTNAME_LENGTH, sockets::machine_uid_array::reset(), and basis::astring::stuff().
bool sockets::tcpip_stack::enumerate_adapters | ( | structures::string_array & | ip_addresses, |
bool | add_local = false |
||
) | const |
Definition at line 194 of file tcpip_stack.cpp.
References FUNCDEF, hostname(), basis::array< contents >::length(), LOG, basis::array< contents >::reset(), structures::string_array::text_form(), and this_host().
Referenced by enumerate_adapters().
internet_address sockets::tcpip_stack::fill_and_resolve | ( | const basis::astring & | machine, |
int | port, | ||
bool & | worked | ||
) | const |
Definition at line 404 of file tcpip_stack.cpp.
References sockets::internet_address::fill(), full_resolve(), basis::astring::iequals(), sockets::internet_address::is_valid_internet_address(), basis::array< contents >::length(), sockets::internet_address::localhost(), sockets::internet_address::nil_address(), and basis::astring::to_lower().
Referenced by enumerate_adapters().
byte_array sockets::tcpip_stack::full_resolve | ( | const basis::astring & | hostname, |
basis::astring & | full_host | ||
) | const |
Definition at line 285 of file tcpip_stack.cpp.
References FUNCDEF, hostname(), basis::astring::iequals(), sockets::internet_address::localhost(), LOG, sockets::internet_address::nil_address(), basis::astring::observe(), basis::astring::reset(), and tcpip_error_name().
Referenced by fill_and_resolve(), resolve_any(), and this_host().
|
inline |
Definition at line 43 of file tcpip_stack.h.
astring sockets::tcpip_stack::hostname | ( | ) | const |
Definition at line 115 of file tcpip_stack.cpp.
References FUNCDEF, LOG, basis::negative(), and tcpip_error_name().
Referenced by dns_resolve(), enumerate_adapters(), full_resolve(), resolve_any(), and this_host().
bool sockets::tcpip_stack::resolve_any | ( | const basis::astring & | name, |
internet_address & | resolved | ||
) | const |
Definition at line 314 of file tcpip_stack.cpp.
References sockets::internet_address::ADDRESS_SIZE, full_resolve(), FUNCDEF, hostname(), sockets::internet_address::hostname, sockets::internet_address::ip_address, basis::array< contents >::length(), sockets::internet_address::MAXIMUM_HOSTNAME_LENGTH, basis::astring::stuff(), and basis::array< contents >::stuff().
|
static |
Definition at line 129 of file tcpip_stack.cpp.
References SOCK_EACCES, SOCK_EADDRINUSE, SOCK_EADDRNOTAVAIL, SOCK_EAFNOSUPPORT, SOCK_EALREADY, SOCK_EBADF, SOCK_ECONNABORTED, SOCK_ECONNREFUSED, SOCK_ECONNRESET, SOCK_EDESTADDRREQ, SOCK_EDQUOT, SOCK_EFAULT, SOCK_EHOSTDOWN, SOCK_EHOSTUNREACH, SOCK_EINPROGRESS, SOCK_EINTR, SOCK_EINVAL, SOCK_EISCONN, SOCK_ELOOP, SOCK_EMFILE, SOCK_EMSGSIZE, SOCK_ENAMETOOLONG, SOCK_ENETDOWN, SOCK_ENETRESET, SOCK_ENETUNREACH, SOCK_ENOBUFS, SOCK_ENOPROTOOPT, SOCK_ENOTCONN, SOCK_ENOTEMPTY, SOCK_ENOTSOCK, SOCK_EOPNOTSUPP, SOCK_EPFNOSUPPORT, SOCK_EPROTONOSUPPORT, SOCK_EPROTOTYPE, SOCK_EREMOTE, SOCK_ESHUTDOWN, SOCK_ESOCKTNOSUPPORT, SOCK_ESTALE, SOCK_ETIMEDOUT, SOCK_ETOOMANYREFS, SOCK_EUSERS, and SOCK_EWOULDBLOCK.
Referenced by full_resolve(), hostname(), sockets::socket_minder::push_receives(), sockets::socket_minder::push_sends(), and sockets::raw_socket::select().
machine_uid sockets::tcpip_stack::this_host | ( | int | location_type | ) | const |
uhhh...
uhhh...
Definition at line 378 of file tcpip_stack.cpp.
References full_resolve(), hostname(), sockets::machine_uid::IPX_LOCATION, basis::array< contents >::length(), sockets::machine_uid::NETBIOS_LOCATION, and sockets::machine_uid::TCPIP_LOCATION.
Referenced by enumerate_adapters().