E-MailRelay
Static Public Member Functions | List of all members
GNet::Local Class Reference

A static class for getting information about the local machine's network name and address. More...

#include <glocal.h>

Static Public Member Functions

static std::string hostname ()
 Returns the local hostname. Returns "localhost" on error. More...
 
static std::string canonicalName ()
 Returns the canonical network name assiciated with hostname(). More...
 
static void canonicalName (const std::string &override)
 Sets the canonicalName() override. More...
 
static bool isLocal (const Address &, std::string &reason)
 Returns true if the given address appears to be 'local', or a helpful error message if not. More...
 
static bool isLocal (const Address &)
 Overload without an explanation. More...
 

Detailed Description

A static class for getting information about the local machine's network name and address.

Definition at line 38 of file glocal.h.

Member Function Documentation

◆ canonicalName() [1/2]

std::string GNet::Local::canonicalName ( )
static

Returns the canonical network name assiciated with hostname().

Defaults to "<hostname>.localnet" if DNS does not provide a canonical network name.

Definition at line 53 of file glocal.cpp.

◆ canonicalName() [2/2]

void GNet::Local::canonicalName ( const std::string &  override)
static

Sets the canonicalName() override.

Definition at line 58 of file glocal.cpp.

◆ hostname()

std::string GNet::Local::hostname ( )
static

Returns the local hostname. Returns "localhost" on error.

Definition at line 31 of file glocal.cpp.

◆ isLocal() [1/2]

bool GNet::Local::isLocal ( const Address address)
static

Overload without an explanation.

Definition at line 70 of file glocal.cpp.

◆ isLocal() [2/2]

bool GNet::Local::isLocal ( const Address address,
std::string &  reason 
)
static

Returns true if the given address appears to be 'local', or a helpful error message if not.

Definition at line 64 of file glocal.cpp.


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