13#include <netinet/in.h>
34 static struct sockaddr_in
resolve(const
std::
string &
name) throw() ;
35 static
std::
string resolve(struct sockaddr_in address) throw() ;
37 static
std::
string to_string(struct sockaddr_in ip_addr) ;
40 Host(struct sockaddr_in ip_addr);
41 virtual ~
Host() throw();
42 operator struct sockaddr_in() const throw();
44 struct sockaddr_in
ip() const throw() ;
45 const
std::
string &
name() const throw() ;
51 bool operator ==(const
Host &a, const
Host &b) throw();
52 bool operator !=(const
Host &a, const
Host &b) throw();
72 static const std::string & local_name() throw() ;
73 static const
std::
string & full_local_name() throw() ;
74 static const
LocalHost* instance() throw() ;
77 const
std::
string & os_name() const throw() ;
78 const
std::
string & os_release() const throw() ;
79 const
std::
string & os_version() const throw() ;
80 const
std::
string & machine() const throw() ;
81 const
std::
string & description() const throw() ;
std::string ip_string() const
get ip in string mode
static struct sockaddr_in resolve(const std::string &name)
name to ip conversion
const std::string & name() const
get name
static std::string expand(const std::string &name)
expands to full name
struct sockaddr_in ip() const
get ip address
static std::string to_string(struct sockaddr_in ip_addr)
ip to string conversion
bool equals(const Host &other) const
equality method
const std::string & full_name() const
get fully qualified name
std::string m_name
name of the host
Host()
constructor for current host
std::string m_full_name
cached fully qualified host name
Network host - localhost.
std::string m_os_name
name of the operating system
std::string m_version
version of the operating system
static LocalHost * s_instance
singleton for local host
std::string m_machine
machine type
std::string m_release
release of the operating system
std::string m_description
machine description (cached)
const char * getfullhost()
get fully qualified host name