The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ConnectClass Class Reference

Holds information relevent to <connect allow> and <connect deny> tags in the config file. More...

#include <users.h>

Inheritance diagram for ConnectClass:

Inheritance graph
[legend]
Collaboration diagram for ConnectClass:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ConnectClass (const ConnectClass *source)
 Create a new connect class based on an existing connect class.
 ConnectClass ()
 Create a new connect class with no settings.
 ConnectClass (const std::string &thename, unsigned int timeout, const std::string &hst, unsigned int ping, const std::string &pas, const std::string &hsh, unsigned long sendq, unsigned long recvq, unsigned long maxl, unsigned long maxg, unsigned int maxc, int p=0)
 Create a new connect class to ALLOW connections.
 ConnectClass (const std::string &thename, const std::string &hst)
 Create a new connect class to DENY connections.
 ConnectClass (const std::string &thename, const ConnectClass *source)
void SetDisabled (bool t)
bool GetDisabled ()
void Update (unsigned int timeout, const std::string &hst, unsigned int ping, const std::string &pas, unsigned long sendq, unsigned long recvq, unsigned long maxl, unsigned long maxg, unsigned int maxc, int p, unsigned long llimit)
void Update (const std::string &n, const std::string &hst)
size_t GetMaxChans ()
char GetType ()
 Returns the type, CC_ALLOW or CC_DENY.
std::stringGetName ()
time_t GetRegTimeout ()
 Returns the registration timeout.
const std::stringGetHost ()
 Returns the allowed or denied IP mask.
int GetPort ()
 Get port number.
void SetPort (int p)
 Set port number.
unsigned int GetPingTime ()
 Returns the ping frequency.
const std::stringGetPass ()
 Returns the password or an empty string.
const std::stringGetHash ()
 Returns the hash or an empty string.
unsigned long GetSendqMax ()
 Returns the maximum sendq value.
unsigned long GetRecvqMax ()
 Returns the maximum recvq value.
unsigned long GetMaxLocal ()
 Returusn the maximum number of local sessions.
unsigned long GetMaxGlobal ()
 Returns the maximum number of global sessions.

Public Attributes

unsigned long RefCount
 Reference counter.
bool disabled
 If this is true, any attempt to set a user to this class will fail.
unsigned long limit
 How many users may be in this connect class before they are refused? (0 = disabled = default).

Private Attributes

char type
 Type of line, either CC_ALLOW or CC_DENY.
std::string name
 Connect class name.
unsigned int registration_timeout
 Max time to register the connection in seconds.
std::string host
 Host mask for this line.
unsigned int pingtime
 Number of seconds between pings for this line.
std::string pass
 (Optional) Password for this line
std::string hash
 (Optional) Hash Method for this line
unsigned long sendqmax
 Maximum size of sendq for users in this class (bytes).
unsigned long recvqmax
 Maximum size of recvq for users in this class (bytes).
unsigned long maxlocal
 Local max when connecting by this connection class.
unsigned long maxglobal
 Global max when connecting by this connection class.
unsigned int maxchans
 Max channels for this class.
int port
 Port number this connect class applies to.

Detailed Description

Holds information relevent to <connect allow> and <connect deny> tags in the config file.

Definition at line 77 of file users.h.


Constructor & Destructor Documentation

ConnectClass::ConnectClass const ConnectClass source  )  [inline]
 

Create a new connect class based on an existing connect class.

This is required for std::vector (at least under windows).

Definition at line 136 of file users.h.

ConnectClass::ConnectClass  )  [inline]
 

Create a new connect class with no settings.

Definition at line 146 of file users.h.

ConnectClass::ConnectClass const std::string thename,
unsigned int  timeout,
const std::string hst,
unsigned int  ping,
const std::string pas,
const std::string hsh,
unsigned long  sendq,
unsigned long  recvq,
unsigned long  maxl,
unsigned long  maxg,
unsigned int  maxc,
int  p = 0
[inline]
 

Create a new connect class to ALLOW connections.

Parameters:
thename Name of the connect class
timeout The registration timeout
hst The IP mask to allow
ping The ping frequency
pas The password to be used
hsh The hash to be used
sendq The maximum sendq value
recvq The maximum recvq value
maxl The maximum local sessions
maxg The maximum global sessions

Definition at line 163 of file users.h.

ConnectClass::ConnectClass const std::string thename,
const std::string hst
[inline]
 

Create a new connect class to DENY connections.

Parameters:
thename Name of the connect class
hst The IP mask to deny

Definition at line 173 of file users.h.

ConnectClass::ConnectClass const std::string thename,
const ConnectClass source
[inline]
 

Definition at line 182 of file users.h.


Member Function Documentation

bool ConnectClass::GetDisabled  )  [inline]
 

Definition at line 195 of file users.h.

Referenced by User::SetClass().

const std::string& ConnectClass::GetHash  )  [inline]
 

Returns the hash or an empty string.

Definition at line 311 of file users.h.

const std::string& ConnectClass::GetHost  )  [inline]
 

Returns the allowed or denied IP mask.

Definition at line 276 of file users.h.

Referenced by User::SetClass().

size_t ConnectClass::GetMaxChans  )  [inline]
 

Definition at line 250 of file users.h.

Referenced by Channel::JoinUser().

unsigned long ConnectClass::GetMaxGlobal  )  [inline]
 

Returns the maximum number of global sessions.

Definition at line 339 of file users.h.

Referenced by User::CheckClass().

unsigned long ConnectClass::GetMaxLocal  )  [inline]
 

Returusn the maximum number of local sessions.

Definition at line 332 of file users.h.

Referenced by User::CheckClass().

std::string& ConnectClass::GetName  )  [inline]
 

Definition at line 262 of file users.h.

Referenced by DoConnect(), and User::SetClass().

const std::string& ConnectClass::GetPass  )  [inline]
 

Returns the password or an empty string.

Definition at line 304 of file users.h.

unsigned int ConnectClass::GetPingTime  )  [inline]
 

Returns the ping frequency.

Definition at line 297 of file users.h.

Referenced by User::CheckClass(), InspIRCd::DoBackgroundUserStuff(), and CommandParser::ProcessCommand().

int ConnectClass::GetPort  )  [inline]
 

Get port number.

Definition at line 283 of file users.h.

Referenced by User::SetClass().

unsigned long ConnectClass::GetRecvqMax  )  [inline]
 

Returns the maximum recvq value.

Definition at line 325 of file users.h.

Referenced by User::AddBuffer().

time_t ConnectClass::GetRegTimeout  )  [inline]
 

Returns the registration timeout.

Definition at line 269 of file users.h.

Referenced by InspIRCd::DoBackgroundUserStuff().

unsigned long ConnectClass::GetSendqMax  )  [inline]
 

Returns the maximum sendq value.

Definition at line 318 of file users.h.

Referenced by User::AddWriteBuf(), and ModuleSafeList::OnBufferFlushed().

char ConnectClass::GetType  )  [inline]
 

Returns the type, CC_ALLOW or CC_DENY.

Definition at line 257 of file users.h.

References CC_ALLOW, and CC_DENY.

Referenced by User::CheckClass(), and User::SetClass().

void ConnectClass::SetDisabled bool  t  )  [inline]
 

Definition at line 190 of file users.h.

Referenced by InitConnect().

void ConnectClass::SetPort int  p  )  [inline]
 

Set port number.

Definition at line 290 of file users.h.

Referenced by DoConnect().

void ConnectClass::Update const std::string n,
const std::string hst
[inline]
 

Definition at line 230 of file users.h.

void ConnectClass::Update unsigned int  timeout,
const std::string hst,
unsigned int  ping,
const std::string pas,
unsigned long  sendq,
unsigned long  recvq,
unsigned long  maxl,
unsigned long  maxg,
unsigned int  maxc,
int  p,
unsigned long  llimit
[inline]
 

Definition at line 202 of file users.h.

Referenced by DoConnect().


Member Data Documentation

bool ConnectClass::disabled
 

If this is true, any attempt to set a user to this class will fail.

Default false. This is really private, it's only in the public section thanks to the way this class is written

Definition at line 244 of file users.h.

std::string ConnectClass::hash [private]
 

(Optional) Hash Method for this line

Definition at line 106 of file users.h.

std::string ConnectClass::host [private]
 

Host mask for this line.

Definition at line 94 of file users.h.

unsigned long ConnectClass::limit
 

How many users may be in this connect class before they are refused? (0 = disabled = default).

Definition at line 248 of file users.h.

Referenced by DoConnect(), and User::SetClass().

unsigned int ConnectClass::maxchans [private]
 

Max channels for this class.

Definition at line 126 of file users.h.

unsigned long ConnectClass::maxglobal [private]
 

Global max when connecting by this connection class.

Definition at line 122 of file users.h.

unsigned long ConnectClass::maxlocal [private]
 

Local max when connecting by this connection class.

Definition at line 118 of file users.h.

std::string ConnectClass::name [private]
 

Connect class name.

Definition at line 86 of file users.h.

std::string ConnectClass::pass [private]
 

(Optional) Password for this line

Definition at line 102 of file users.h.

unsigned int ConnectClass::pingtime [private]
 

Number of seconds between pings for this line.

Definition at line 98 of file users.h.

int ConnectClass::port [private]
 

Port number this connect class applies to.

Definition at line 130 of file users.h.

unsigned long ConnectClass::recvqmax [private]
 

Maximum size of recvq for users in this class (bytes).

Definition at line 114 of file users.h.

unsigned long ConnectClass::RefCount
 

Reference counter.

Contains an int as to how many users are connected to this class. :) This will be 0 if no users are connected. If a <connect> is removed from the config, and there are 0 users on it - it will go away in RAM. :)

Definition at line 240 of file users.h.

Referenced by InitConnect(), User::SetClass(), and User::~User().

unsigned int ConnectClass::registration_timeout [private]
 

Max time to register the connection in seconds.

Definition at line 90 of file users.h.

unsigned long ConnectClass::sendqmax [private]
 

Maximum size of sendq for users in this class (bytes).

Definition at line 110 of file users.h.

char ConnectClass::type [private]
 

Type of line, either CC_ALLOW or CC_DENY.

Definition at line 82 of file users.h.


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