E-MailRelay
Public Types | Public Member Functions | List of all members
GNet::DnsBlockResult Class Reference

A result structure for GNet::DnsBlock, as delivered by the DnsBlockCallback interface. More...

#include <gdnsblock.h>

Public Types

enum class  Type {
  Inactive , Local , TimeoutAllow , TimeoutDeny ,
  Allow , Deny
}
 

Public Member Functions

 DnsBlockResult ()
 Constructor. More...
 
void reset (std::size_t threshold, const Address &)
 Initialiser. More...
 
void add (const DnsBlockServerResult &)
 Appends the server result. More...
 
DnsBlockServerResultat (std::size_t)
 Returns a reference to the given per-server result. More...
 
Type & type ()
 Returns a settable reference to the overall result type. More...
 
void log () const
 Logs the results. More...
 
void warn () const
 Emits warnings. More...
 
bool allow () const
 Returns true if the type is Inactive, Local, TimeoutAllow or Allow. More...
 
bool deny () const
 Returns true if the type is TimeoutDeny or Deny. More...
 
const std::vector< DnsBlockServerResult > & list () const
 Returns a reference to the per-server results. More...
 
G::StringArray deniers () const
 Returns the list of denying servers. More...
 
G::StringArray laggards () const
 Returns the list of slow or unresponsive servers. More...
 

Detailed Description

A result structure for GNet::DnsBlock, as delivered by the DnsBlockCallback interface.

The principal attribute is the type(), which indicates whether the connection should be allowed or denied.

Definition at line 77 of file gdnsblock.h.

Member Enumeration Documentation

◆ Type

enum class GNet::DnsBlockResult::Type
strong

Definition at line 80 of file gdnsblock.h.

Constructor & Destructor Documentation

◆ DnsBlockResult()

GNet::DnsBlockResult::DnsBlockResult ( )
inline

Constructor.

Definition at line 252 of file gdnsblock.h.

Member Function Documentation

◆ add()

void GNet::DnsBlockResult::add ( const DnsBlockServerResult server_result)
inline

Appends the server result.

Definition at line 277 of file gdnsblock.h.

◆ allow()

bool GNet::DnsBlockResult::allow ( ) const

Returns true if the type is Inactive, Local, TimeoutAllow or Allow.

Definition at line 299 of file gdnsblock.cpp.

◆ at()

GNet::DnsBlockServerResult & GNet::DnsBlockResult::at ( std::size_t  i)
inline

Returns a reference to the given per-server result.

Definition at line 283 of file gdnsblock.h.

◆ deniers()

G::StringArray GNet::DnsBlockResult::deniers ( ) const

Returns the list of denying servers.

Definition at line 321 of file gdnsblock.cpp.

◆ deny()

bool GNet::DnsBlockResult::deny ( ) const

Returns true if the type is TimeoutDeny or Deny.

Definition at line 304 of file gdnsblock.cpp.

◆ laggards()

G::StringArray GNet::DnsBlockResult::laggards ( ) const

Returns the list of slow or unresponsive servers.

Definition at line 327 of file gdnsblock.cpp.

◆ list()

const std::vector< GNet::DnsBlockServerResult > & GNet::DnsBlockResult::list ( ) const
inline

Returns a reference to the per-server results.

Definition at line 271 of file gdnsblock.h.

◆ log()

void GNet::DnsBlockResult::log ( ) const

Logs the results.

Definition at line 259 of file gdnsblock.cpp.

◆ reset()

void GNet::DnsBlockResult::reset ( std::size_t  threshold,
const Address address 
)
inline

Initialiser.

Definition at line 258 of file gdnsblock.h.

◆ type()

GNet::DnsBlockResult::Type & GNet::DnsBlockResult::type ( )
inline

Returns a settable reference to the overall result type.

Definition at line 265 of file gdnsblock.h.

◆ warn()

void GNet::DnsBlockResult::warn ( ) const

Emits warnings.

Definition at line 283 of file gdnsblock.cpp.


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