Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

connection Class Reference

Please note: classes serverrec and userrec both inherit from class connection. More...

#include <connection.h>

Inheritance diagram for connection:

Inheritance graph
[legend]
Collaboration diagram for connection:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 connection ()
 Default constructor.

bool CreateListener (char *host, int p)
 Create a listening socket on 'host' using port number 'p'.

bool BeginLink (char *targethost, int port, char *password, char *servername, int myport)
 Begin an outbound link to another ircd at targethost.

bool MeshCookie (char *targethost, int port, unsigned long cookie, char *servername)
 Begin an outbound mesh link to another ircd on a network you are already an authenticated member of.

void TerminateLink (char *targethost)
 Terminate a link to 'targethost' by calling the ircd_connector::CloseConnection method.

bool SendPacket (char *message, const char *host)
 Send a message to a server by name, if the server is unavailable directly route the packet via another server If the server still cannot be reached after attempting to route the message remotely, returns false.

bool RecvPacket (std::deque< std::string > &messages, char *host, std::deque< std::string > &sums)
 Returns the next available packet and returns true if data is available.

ircd_connectorFindHost (std::string host)
 Find the ircd_connector oject related to a certain servername given in 'host'.

bool AddIncoming (int fd, char *targethost, int sourceport)
 Add an incoming connection to the connection pool.


Public Attributes

int fd
 File descriptor of the connection.

char host [160]
 Hostname of connection.

char ip [16]
 IP of connection.

long bytes_in
 Stats counter for bytes inbound.

long bytes_out
 Stats counter for bytes outbound.

long cmds_in
 Stats counter for commands inbound.

long cmds_out
 Stats counter for commands outbound.

bool haspassed
 True if server/user has authenticated, false if otherwise.

int port
 Port number For a userrec, this is the port they connected to the network on.

char registered
 Used by userrec to indicate the registration status of the connection.

time_t lastping
 Time the connection was last pinged.

time_t signon
 Time the connection was created, set in the constructor.

time_t idle_lastmsg
 Time that the connection last sent data, used to calculate idle time.

time_t nping
 Used by PING checks with clients.

std::vector< ircd_connectorconnectors
 With a serverrec, this is a list of all established server connections.


Detailed Description

Please note: classes serverrec and userrec both inherit from class connection.

Definition at line 212 of file connection.h.


Constructor & Destructor Documentation

connection::connection  ) 
 

Default constructor.


Member Function Documentation

bool connection::AddIncoming int  fd,
char *  targethost,
int  sourceport
 

Add an incoming connection to the connection pool.

(reserved for core use)

bool connection::BeginLink char *  targethost,
int  port,
char *  password,
char *  servername,
int  myport
 

Begin an outbound link to another ircd at targethost.

bool connection::CreateListener char *  host,
int  p
 

Create a listening socket on 'host' using port number 'p'.

ircd_connector* connection::FindHost std::string  host  ) 
 

Find the ircd_connector oject related to a certain servername given in 'host'.

bool connection::MeshCookie char *  targethost,
int  port,
unsigned long  cookie,
char *  servername
 

Begin an outbound mesh link to another ircd on a network you are already an authenticated member of.

bool connection::RecvPacket std::deque< std::string > &  messages,
char *  host,
std::deque< std::string > &  sums
 

Returns the next available packet and returns true if data is available.

Writes the servername the data came from to 'host'. If no data is available this function returns false. This function will automatically close broken links and reroute pathways, generating split messages on the network.

bool connection::SendPacket char *  message,
const char *  host
 

Send a message to a server by name, if the server is unavailable directly route the packet via another server If the server still cannot be reached after attempting to route the message remotely, returns false.

void connection::TerminateLink char *  targethost  ) 
 

Terminate a link to 'targethost' by calling the ircd_connector::CloseConnection method.


Member Data Documentation

long connection::bytes_in
 

Stats counter for bytes inbound.

Definition at line 229 of file connection.h.

Referenced by userrec::userrec().

long connection::bytes_out
 

Stats counter for bytes outbound.

Definition at line 233 of file connection.h.

Referenced by userrec::FlushWriteBuf(), and userrec::userrec().

long connection::cmds_in
 

Stats counter for commands inbound.

Definition at line 237 of file connection.h.

Referenced by userrec::userrec().

long connection::cmds_out
 

Stats counter for commands outbound.

Definition at line 241 of file connection.h.

Referenced by userrec::FlushWriteBuf(), and userrec::userrec().

std::vector<ircd_connector> connection::connectors
 

With a serverrec, this is a list of all established server connections.

With a userrec this is unused.

Definition at line 276 of file connection.h.

int connection::fd
 

File descriptor of the connection.

Definition at line 217 of file connection.h.

Referenced by ConfigReader::DumpErrors(), Server::PseudoToUser(), Server::SendTo(), serverrec::serverrec(), userrec::userrec(), and Server::UserToPseudo().

bool connection::haspassed
 

True if server/user has authenticated, false if otherwise.

Definition at line 245 of file connection.h.

Referenced by userrec::userrec().

char connection::host[160]
 

Hostname of connection.

Not used if this is a serverrec

Definition at line 221 of file connection.h.

Referenced by userrec::GetFullRealHost(), Server::PseudoToUser(), userrec::userrec(), and Server::UserToPseudo().

time_t connection::idle_lastmsg
 

Time that the connection last sent data, used to calculate idle time.

Definition at line 267 of file connection.h.

Referenced by userrec::userrec().

char connection::ip[16]
 

IP of connection.

Definition at line 225 of file connection.h.

Referenced by userrec::userrec().

time_t connection::lastping
 

Time the connection was last pinged.

Definition at line 259 of file connection.h.

Referenced by serverrec::serverrec(), and userrec::userrec().

time_t connection::nping
 

Used by PING checks with clients.

Definition at line 271 of file connection.h.

Referenced by userrec::userrec().

int connection::port
 

Port number For a userrec, this is the port they connected to the network on.

For a serverrec this is the current listening port of the serverrec object.

Definition at line 251 of file connection.h.

Referenced by userrec::userrec().

char connection::registered
 

Used by userrec to indicate the registration status of the connection.

Definition at line 255 of file connection.h.

Referenced by userrec::userrec().

time_t connection::signon
 

Time the connection was created, set in the constructor.

Definition at line 263 of file connection.h.

Referenced by serverrec::serverrec(), and userrec::userrec().


The documentation for this class was generated from the following file:
Generated on Sun May 15 18:38:01 2005 for InspIRCd by doxygen 1.3.3