feisty meow concerns codebase  2.140
sockets::range_limiter Class Reference

provides a mechanism for restricting access to a resource by the client's IP address. More...

#include <range_limiter.h>

Public Types

enum  capabilities { ALLOW , DENY }
 

Public Member Functions

 range_limiter ()
 
 range_limiter (const basis::astring &source_file, const basis::astring &section)
 
 ~range_limiter ()
 
bool is_allowed (const machine_uid &host)
 
bool is_allowed (const basis::astring &hostname)
 
capabilities get_default ()
 
void set_default (capabilities rights)
 
bool add (const machine_uid &address, capabilities rights)
 
bool add (const basis::astring &hostname, capabilities rights)
 
bool add (const machine_uid &first, const machine_uid &second, capabilities rights)
 
bool remove (const machine_uid &address)
 
bool remove (const basis::astring &hostname)
 
bool remove (const machine_uid &first, const machine_uid &second)
 
bool load (const basis::astring &file_name, const basis::astring &section)
 
bool save (const basis::astring &file_name, const basis::astring &section)
 

Detailed Description

provides a mechanism for restricting access to a resource by the client's IP address.

Definition at line 36 of file range_limiter.h.

Member Enumeration Documentation

◆ capabilities

Enumerator
ALLOW 
DENY 

Definition at line 48 of file range_limiter.h.

Constructor & Destructor Documentation

◆ range_limiter() [1/2]

sockets::range_limiter::range_limiter ( )

Definition at line 45 of file range_limiter.cpp.

◆ range_limiter() [2/2]

sockets::range_limiter::range_limiter ( const basis::astring source_file,
const basis::astring section 
)

Definition at line 50 of file range_limiter.cpp.

References load().

◆ ~range_limiter()

sockets::range_limiter::~range_limiter ( )

Definition at line 57 of file range_limiter.cpp.

References basis::WHACK().

Member Function Documentation

◆ add() [1/3]

bool sockets::range_limiter::add ( const basis::astring hostname,
capabilities  rights 
)

Definition at line 87 of file range_limiter.cpp.

◆ add() [2/3]

bool sockets::range_limiter::add ( const machine_uid address,
capabilities  rights 
)

Definition at line 81 of file range_limiter.cpp.

References sockets::machine_uid::valid().

◆ add() [3/3]

bool sockets::range_limiter::add ( const machine_uid first,
const machine_uid second,
capabilities  rights 
)

Definition at line 93 of file range_limiter.cpp.

References sockets::machine_uid::valid().

◆ get_default()

range_limiter::capabilities sockets::range_limiter::get_default ( )

Definition at line 71 of file range_limiter.cpp.

References DENY.

◆ is_allowed() [1/2]

bool sockets::range_limiter::is_allowed ( const basis::astring hostname)

Definition at line 65 of file range_limiter.cpp.

◆ is_allowed() [2/2]

bool sockets::range_limiter::is_allowed ( const machine_uid host)

Definition at line 59 of file range_limiter.cpp.

References sockets::machine_uid::valid().

◆ load()

bool sockets::range_limiter::load ( const basis::astring file_name,
const basis::astring section 
)

Definition at line 118 of file range_limiter.cpp.

Referenced by range_limiter().

◆ remove() [1/3]

bool sockets::range_limiter::remove ( const basis::astring hostname)

Definition at line 106 of file range_limiter.cpp.

◆ remove() [2/3]

bool sockets::range_limiter::remove ( const machine_uid address)

Definition at line 100 of file range_limiter.cpp.

References sockets::machine_uid::valid().

◆ remove() [3/3]

bool sockets::range_limiter::remove ( const machine_uid first,
const machine_uid second 
)

Definition at line 112 of file range_limiter.cpp.

References sockets::machine_uid::valid().

◆ save()

bool sockets::range_limiter::save ( const basis::astring file_name,
const basis::astring section 
)

Definition at line 124 of file range_limiter.cpp.

◆ set_default()

void sockets::range_limiter::set_default ( capabilities  rights)

Definition at line 76 of file range_limiter.cpp.


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