Basic network management, which is an optional Ceylan feature. More...
Classes | |
class | AnonymousProtocolAwareStreamSocket |
Anonymous connection-based server-side stream socket linked with a protocol server, which manages higher-level message exchanges for that connection. More... | |
class | AnonymousStreamSocket |
Anonymous connection-based server-side stream socket. More... | |
class | ClientStreamSocket |
Client-side implementation of connection-based socket. More... | |
class | IPAddressException |
Exception dedicated to the IP addressing. More... | |
class | IPAddress |
Handles abstract IP (Internet Protocol) addresses. More... | |
class | IPAddressvFour |
Handles IPv4 addresses. More... | |
class | MultiplexedProtocolBasedStreamServer |
Server-side implementation of a server listening socket and its connection-triggered sockets, each one corresponding to a connected client managed by a dedicated protocol server. More... | |
class | MultiplexedServerStreamSocket |
Server-side implementation of a server listening socket and its connection-triggered sockets, each one corresponding to a connected client. More... | |
class | NetworkException |
Exception class for network services. More... | |
class | HostDNSEntry |
Describes the DNS entry corresponding to a specified host. More... | |
class | SequentialServerStreamSocket |
Server, based on stream sockets, that can serve any number of clients, although not in parallel : clients are taken care of sequentially, one after the other, each one thanks to a dedicated anonymous stream socket. More... | |
class | ServerStreamSocket |
Server-side implementation of connection-based socket. More... | |
class | Socket |
Simple general socket I/O class, both for connection-based (stream) sockets and packet-based (datagram) sockets, both for client-side and server-side sockets. More... | |
class | StreamSocket |
Simple connection-based socket I/O class. More... | |
Typedefs | |
typedef int | SocketError |
The numerical error code that may be returned by specific network primitives, namely Windows socket ones. | |
typedef Ceylan::Uint32 | Port |
Port number, as specified for sockets. | |
Enumerations | |
enum | NetworkAddressType { IPv4, IPv6 } |
Records the known types of network addresses. More... | |
Functions | |
CEYLAN_DLL const std::string | getLocalHostName () |
Returns local host's name, not including the domain name. | |
CEYLAN_DLL void | setLocalHostName (const std::string &newHostName) |
Sets local host's name. | |
CEYLAN_DLL const std::string | getLocalHostDomainName () |
Returns local host's domain name. | |
CEYLAN_DLL void | setLocalHostDomainName (const std::string &newHostName) |
Sets local host's domain name. | |
CEYLAN_DLL const std::string | getMostPreciseLocalHostName () |
Returns most precise available local host name. | |
CEYLAN_DLL const std::string | getFQDNFromIP (const IPAddress &ip) |
Returns the fully qualified domain name (FQDN) of specified host. | |
CEYLAN_DLL const std::string | getFQDNFromIPv4 (const std::string &ipString) |
Returns the fully qualified domain name (FQDN) of specified host. | |
CEYLAN_DLL const std::string | getFQDNFromHostname (const std::string &hostname) |
Returns the fully qualified domain name (FQDN) of specified host. | |
CEYLAN_DLL const std::string | getFQDNFromDNSEntry (const HostDNSEntry &entry) |
Returns the fully qualified domain name (FQDN) from specified DNS entry instance. | |
CEYLAN_DLL bool | isAValidHostName (const std::string &hostnameString) |
Returns whether specified string is a valid host name. | |
CEYLAN_DLL std::string | interpretSocketError (SocketError errorCode) |
Returns a string describing the error associated with the specified error code. | |
CEYLAN_DLL SocketError | getSocketError () |
Returns the latest socket error. | |
CEYLAN_DLL std::string | explainSocketError () |
Returns the diagnosis string corresponding to latest socket error. |
Basic network management, which is an optional Ceylan feature.
typedef Ceylan::Uint32 Ceylan::Network::Port |
Port number, as specified for sockets.
Definition at line 69 of file CeylanSocket.h.
typedef int Ceylan::Network::SocketError |
The numerical error code that may be returned by specific network primitives, namely Windows socket ones.
Definition at line 418 of file CeylanNetwork.h.
Records the known types of network addresses.
Definition at line 77 of file CeylanNetwork.h.
std::string Ceylan::Network::explainSocketError | ( | ) |
Returns the diagnosis string corresponding to latest socket error.
Definition at line 1448 of file CeylanNetwork.cc.
References getSocketError(), and interpretSocketError().
Referenced by Ceylan::Network::Socket::close(), Ceylan::Network::StreamSocket::createSocket(), Ceylan::System::FDRead(), Ceylan::System::FDWrite(), Ceylan::Network::HostDNSEntry::HostDNSEntry(), Ceylan::System::InputStream::Select(), Ceylan::Network::StreamSocket::setBlocking(), and Ceylan::Network::StreamSocket::setNagleAlgorithmTo().
const string Ceylan::Network::getFQDNFromDNSEntry | ( | const HostDNSEntry & | entry | ) |
Returns the fully qualified domain name (FQDN) from specified DNS entry instance.
entry | a previously created HostDNSEntry. |
Definition at line 1054 of file CeylanNetwork.cc.
References Ceylan::countChars(), dataUtils::e, Ceylan::Network::HostDNSEntry::getAliasList(), Ceylan::Network::HostDNSEntry::getOfficialHostName(), and Ceylan::Network::HostDNSEntry::toString().
Referenced by getFQDNFromHostname(), and getFQDNFromIP().
const string Ceylan::Network::getFQDNFromHostname | ( | const std::string & | hostname | ) |
Returns the fully qualified domain name (FQDN) of specified host.
hostName | the name of host to create a DNS description for. It is a host name (ex: "esperide.com"), not a stringified IP address. |
Definition at line 1042 of file CeylanNetwork.cc.
References getFQDNFromDNSEntry().
Referenced by getMostPreciseLocalHostName().
const string Ceylan::Network::getFQDNFromIP | ( | const IPAddress & | ip | ) |
Returns the fully qualified domain name (FQDN) of specified host.
ip | an IPAddress instance, be it IPv4 or IPv6. |
NetworkException | if the search or the conversion failed. |
Definition at line 1020 of file CeylanNetwork.cc.
References getFQDNFromDNSEntry().
Referenced by getFQDNFromIPv4().
const string Ceylan::Network::getFQDNFromIPv4 | ( | const std::string & | ipString | ) |
Returns the fully qualified domain name (FQDN) of specified host.
ipString | a string describing the IPv4 address, such as "82.225.152.215". |
Definition at line 1031 of file CeylanNetwork.cc.
References getFQDNFromIP().
const string Ceylan::Network::getLocalHostDomainName | ( | ) |
Returns local host's domain name.
NetworkException | if the operation failed. |
Definition at line 859 of file CeylanNetwork.cc.
References Ceylan::System::explainError().
Referenced by getMostPreciseLocalHostName().
const string Ceylan::Network::getLocalHostName | ( | ) |
Returns local host's name, not including the domain name.
Definition at line 776 of file CeylanNetwork.cc.
References Ceylan::System::explainError(), Ceylan::Network::HostDNSEntry::HostNameMaxLength, and Ceylan::toString().
Referenced by getMostPreciseLocalHostName().
const string Ceylan::Network::getMostPreciseLocalHostName | ( | ) |
Returns most precise available local host name.
Tries to gather most useful information about host name, including FQDN.
If the FQDN does not teach anything (ex: 'localhost.localdomain'), the local host name will be returned, and the domain name, if relevant, will be appended to it, after a dot (hence may return 'rainbow', or 'rainbow.esperide.com' for example).
Definition at line 909 of file CeylanNetwork.cc.
References Ceylan::countChars(), dataUtils::e, Ceylan::System::explainError(), generalUtils::false, getFQDNFromHostname(), getLocalHostDomainName(), getLocalHostName(), Ceylan::Exception::toString(), and generalUtils::true.
Referenced by Ceylan::Log::ObjectIdentifier::ObjectIdentifier().
SocketError Ceylan::Network::getSocketError | ( | ) |
Returns the latest socket error.
Definition at line 1428 of file CeylanNetwork.cc.
Referenced by Ceylan::Network::AnonymousStreamSocket::AnonymousStreamSocket(), explainSocketError(), Ceylan::System::FDRead(), Ceylan::System::FDWrite(), and Ceylan::System::InputStream::Select().
string Ceylan::Network::interpretSocketError | ( | SocketError | errorCode | ) |
Returns a string describing the error associated with the specified error code.
errorCode | the socket error that should be translated. |
Definition at line 1129 of file CeylanNetwork.cc.
References Ceylan::toString().
Referenced by explainSocketError().
bool Ceylan::Network::isAValidHostName | ( | const std::string & | hostnameString | ) |
Returns whether specified string is a valid host name.
Definition at line 1099 of file CeylanNetwork.cc.
References Ceylan::RegExp::matches(), and generalUtils::true.
Referenced by Ceylan::Log::ObjectIdentifier::generateFromChannelName().
void Ceylan::Network::setLocalHostDomainName | ( | const std::string & | newHostName | ) |
Sets local host's domain name.
Definition at line 888 of file CeylanNetwork.cc.
References Ceylan::System::explainError().
void Ceylan::Network::setLocalHostName | ( | const std::string & | newHostName | ) |
Sets local host's name.
NetworkException | if the renaming failed, including if the operation is not supported on the running platform. |
Definition at line 819 of file CeylanNetwork.cc.
References Ceylan::System::explainError().