Ceylan::Network::HostDNSEntry Class Reference

Describes the DNS entry corresponding to a specified host. More...

#include <CeylanNetwork.h>

Inheritance diagram for Ceylan::Network::HostDNSEntry:

Inheritance graph
[legend]
Collaboration diagram for Ceylan::Network::HostDNSEntry:

Collaboration graph
[legend]

List of all members.

Public Types

enum  TextOutputFormat { rawText, html }
 Defines what text output formats for TextDisplayable instances are available. More...

Public Member Functions

 HostDNSEntry (const std::string &hostName)
 Creates a DNS description for specified host name.
 HostDNSEntry (const IPAddress &ip)
 Creates a DNS description for specified host name.
virtual ~HostDNSEntry () throw ()
 Basic virtual destructor.
std::string getOfficialHostName () const
 Returns the official name of this host.
std::list< std::string > & getAliasList () const
 Returns the list of alias for this host.
NetworkAddressType getAddressType () const
 Returns the type of the network address of this entry.
std::list< IPAddress * > & getAddresses () const
 Returns the list of known network address of this entry.
virtual const std::string toString (Ceylan::VerbosityLevels level=Ceylan::high) const
 Returns a user-friendly description of the state of this object.

Static Public Member Functions

static const std::string ToString (std::list< TextDisplayable * > displayables, Ceylan::VerbosityLevels level=Ceylan::high)
 Returns a user-friendly description of this list of pointers to text displayable instances.
static TextOutputFormat GetOutputFormat ()
 Returns the current overall text format to be used by TextDisplayable instances.
static void SetOutputFormat (TextOutputFormat newOutputFormat)
 Sets the current overall text format to be used by TextDisplayable instances.

Static Public Attributes

static const Ceylan::Uint16 HostNameMaxLength = 256
 The maximum number of characters of an hostname.

Protected Member Functions

virtual void manageHostEntry ()
 Helper method shared by constructors.

Protected Attributes

SystemSpecificHostEntry * _internalEntry
 The system-specific DNS host entry being used internally.

Static Protected Attributes

static TextOutputFormat _OutputFormat = rawText
 The text format to be used currently by TextDisplayable instances.

Private Member Functions

 HostDNSEntry (const HostDNSEntry &source)
 Copy constructor made private to ensure that it will never be called.
HostDNSEntryoperator= (const HostDNSEntry &source)
 Assignment operator made private to ensure that it will never be called.


Detailed Description

Describes the DNS entry corresponding to a specified host.

Note:
Do not expect this class to be reentrant at all.

Definition at line 104 of file CeylanNetwork.h.


Member Enumeration Documentation

Defines what text output formats for TextDisplayable instances are available.

Enumerator:
rawText 
html 

Definition at line 124 of file CeylanTextDisplayable.h.


Constructor & Destructor Documentation

HostDNSEntry::HostDNSEntry ( const std::string &  hostName  )  [explicit]

Creates a DNS description for specified host name.

Parameters:
hostName the name of host to create a DNS description for.
Exceptions:
NetworkException if the operation is not supported on the platform, or is supported but failed.
See also:
RFC 1884 for the description of IPv6 addresses.

Definition at line 206 of file CeylanNetwork.cc.

References _internalEntry, Ceylan::Network::explainSocketError(), and manageHostEntry().

HostDNSEntry::HostDNSEntry ( const IPAddress ip  )  [explicit]

Creates a DNS description for specified host name.

Parameters:
ip an IPv4 (or, in the future, IPv6) instance.
Exceptions:
NetworkException if the operation is not supported on the platform, or is supported but failed.
See also:
RFC 1884 for the description of IPv6 addresses.

IPAddressvFour

Definition at line 276 of file CeylanNetwork.cc.

References _internalEntry, Ceylan::Network::explainSocketError(), Ceylan::Network::IPAddress::getType(), Ceylan::Network::IPv4, manageHostEntry(), and Ceylan::Network::IPAddress::toString().

HostDNSEntry::~HostDNSEntry (  )  throw () [virtual]

Basic virtual destructor.

Definition at line 343 of file CeylanNetwork.cc.

References _internalEntry.

Ceylan::Network::HostDNSEntry::HostDNSEntry ( const HostDNSEntry source  )  [private]

Copy constructor made private to ensure that it will never be called.

The compiler should complain whenever this undefined constructor is called, implicitly or not.


Member Function Documentation

list< IPAddress * > & HostDNSEntry::getAddresses (  )  const

Returns the list of known network address of this entry.

Note:
Ownership of the list is transferred to the caller, who will have to deallocate it when finished with it.

Definition at line 516 of file CeylanNetwork.cc.

References _internalEntry, getAddressType(), Ceylan::Network::IPv4, Ceylan::Network::IPv6, and Ceylan::toString().

Referenced by Ceylan::Network::ClientStreamSocket::connect(), and toString().

NetworkAddressType HostDNSEntry::getAddressType (  )  const

Returns the type of the network address of this entry.

Note:
It is actually the type of the official address, since there can be several addresses of several types in the address (alias) list.

Definition at line 455 of file CeylanNetwork.cc.

References _internalEntry, Ceylan::Network::IPv4, and Ceylan::Network::IPv6.

Referenced by getAddresses(), and toString().

list< string > & HostDNSEntry::getAliasList (  )  const

Returns the list of alias for this host.

Note:
Ownership of the list is transferred to the caller, who will have to deallocate it when finished with it.

Definition at line 400 of file CeylanNetwork.cc.

References _internalEntry.

Referenced by Ceylan::Network::getFQDNFromDNSEntry(), and toString().

string HostDNSEntry::getOfficialHostName (  )  const

Returns the official name of this host.

Exceptions:
NetworkException if the operation failed.

Definition at line 370 of file CeylanNetwork.cc.

References _internalEntry.

Referenced by Ceylan::Network::getFQDNFromDNSEntry(), and toString().

TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat (  )  [static, inherited]

void HostDNSEntry::manageHostEntry (  )  [protected, virtual]

Helper method shared by constructors.

Definition at line 709 of file CeylanNetwork.cc.

References _internalEntry.

Referenced by HostDNSEntry().

HostDNSEntry& Ceylan::Network::HostDNSEntry::operator= ( const HostDNSEntry source  )  [private]

Assignment operator made private to ensure that it will never be called.

The compiler should complain whenever this undefined operator is called, implicitly or not.

void TextDisplayable::SetOutputFormat ( TextOutputFormat  newOutputFormat  )  [static, inherited]

Sets the current overall text format to be used by TextDisplayable instances.

Parameters:
newOutputFormat the new output format.

Definition at line 72 of file CeylanTextDisplayable.cc.

References Ceylan::TextDisplayable::_OutputFormat.

Referenced by Ceylan::Log::LogHolder::LogHolder().

const std::string TextDisplayable::ToString ( std::list< TextDisplayable * >  displayables,
Ceylan::VerbosityLevels  level = Ceylan::high 
) [static, inherited]

Returns a user-friendly description of this list of pointers to text displayable instances.

Parameters:
displayables a list of pointers to TextDisplayable instances/
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
toString, Ceylan::VerbosityLevels

Definition at line 45 of file CeylanTextDisplayable.cc.

References Ceylan::formatStringList().

const string HostDNSEntry::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const [virtual]

Returns a user-friendly description of the state of this object.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
TextDisplayable

Implements Ceylan::TextDisplayable.

Definition at line 642 of file CeylanNetwork.cc.

References dataUtils::e, Ceylan::formatStringList(), getAddresses(), getAddressType(), getAliasList(), getOfficialHostName(), Ceylan::Network::IPv4, and Ceylan::Network::IPv6.

Referenced by Ceylan::Network::getFQDNFromDNSEntry(), and Ceylan::Network::ClientStreamSocket::toString().


Member Data Documentation

SystemSpecificHostEntry* Ceylan::Network::HostDNSEntry::_internalEntry [protected]

The system-specific DNS host entry being used internally.

Definition at line 245 of file CeylanNetwork.h.

Referenced by getAddresses(), getAddressType(), getAliasList(), getOfficialHostName(), HostDNSEntry(), manageHostEntry(), and ~HostDNSEntry().

TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited]

The text format to be used currently by TextDisplayable instances.

Note:
Defaults to raw text.

Definition at line 158 of file CeylanTextDisplayable.h.

Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().

The maximum number of characters of an hostname.

Definition at line 225 of file CeylanNetwork.h.

Referenced by Ceylan::Network::getLocalHostName().


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

Generated on Thu Jun 4 20:40:42 2009 for Ceylan by  doxygen 1.5.8