#include <connection.h>
Inheritance diagram for ircd_connector:
Public Member Functions | |
bool | MakeOutboundConnection (char *newhost, int newport) |
Create an outbound connection to a listening socket. | |
std::string | GetServerName () |
Return the servername on this established connection. | |
void | SetServerName (std::string serv) |
Set the server name of this connection. | |
int | GetDescriptor () |
Get the file descriptor associated with this connection. | |
void | SetDescriptor (int fd) |
Set the file descriptor for this connection. | |
int | GetState () |
Get the state flags for this connection. | |
void | SetState (int state) |
Set the state flags for this connection. | |
char * | GetServerIP () |
Get the ip address (not servername) associated with this connection. | |
std::string | GetDescription () |
Get the server description of this connection. | |
void | SetDescription (std::string desc) |
Set the server description of this connection. | |
int | GetServerPort () |
Get the port number being used for this connection If the connection is outbound this will be the remote port otherwise it will be the local port, so it can always be gautanteed as open at the address given in GetServerIP(). | |
void | SetServerPort (int p) |
Set the port used by this connection. | |
bool | SetHostAndPort (char *newhost, int newport) |
Set both the host and the port in one operation for this connection. | |
void | CloseConnection () |
Close the connection by calling close() on its file descriptor This function call updates no other data. | |
void | AddBuffer (std::string a) |
This method adds text to the ircd connection's buffer There is no limitation on how much text of what line width may be added to this buffer. | |
bool | BufferIsComplete () |
This method returns true if the buffer contains at least one carriage return character, e.g. | |
void | ClearBuffer () |
This method clears the server's buffer by setting it to an empty string. | |
std::string | GetBuffer () |
This method retrieves the first string from the tail end of the buffer and advances the tail end of the buffer past the returned string, in a similar manner to strtok(). | |
void | SetVersionString (std::string newversion) |
This method sets the version string of the remote server. | |
std::string | GetVersionString () |
This method returns the version string of the remote server. | |
Public Attributes | |
std::string | ircdbuffer |
IRCD Buffer for input characters, holds as many lines as are pending - Note that the final line may not be complete and should only be read when there is a seperator. | |
char | host [MAXBUF] |
When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. | |
int | port |
When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. | |
std::vector< std::string > | routes |
Server names of servers that this server is linked to So for A->B->C, if this was the record for B it would contain A and C whilever both servers are connected to B. | |
Private Member Functions | |
bool | SetHostAddress (char *host, int port) |
PRIVATE function to set the host address and port to connect to. | |
Private Attributes | |
sockaddr_in | addr |
Sockaddr of the outbound ip and port. | |
int | fd |
File descriptor of the connection. | |
std::string | servername |
Server name. | |
std::string | description |
Server 'GECOS'. | |
char | state |
State. | |
std::string | version |
This string holds the ircd's version response. |
A listening socket that accepts server type connections is represented by one class serverrec. Class serverrec will instantiate several objects of type ircd_connector to represent each established connection, inbound or outbound. So, to determine all linked servers you must walk through all the serverrecs that the core defines, and in each one iterate through until you find connection(s) relating to the server you want information on. The core and module API provide functions for this.
Definition at line 56 of file connection.h.
|
This method adds text to the ircd connection's buffer There is no limitation on how much text of what line width may be added to this buffer. It is the sending server's responsibility to ensure sent data is kept within reasonable quanities. |
|
This method returns true if the buffer contains at least one carriage return character, e.g. one line can be read from the buffer successfully. |
|
This method clears the server's buffer by setting it to an empty string.
|
|
Close the connection by calling close() on its file descriptor This function call updates no other data.
|
|
This method retrieves the first string from the tail end of the buffer and advances the tail end of the buffer past the returned string, in a similar manner to strtok().
|
|
Get the server description of this connection.
|
|
Get the file descriptor associated with this connection.
|
|
Get the ip address (not servername) associated with this connection.
|
|
Return the servername on this established connection.
|
|
Get the port number being used for this connection If the connection is outbound this will be the remote port otherwise it will be the local port, so it can always be gautanteed as open at the address given in GetServerIP().
|
|
Get the state flags for this connection.
|
|
This method returns the version string of the remote server. If the server has no version string an empty string is returned. |
|
Create an outbound connection to a listening socket.
|
|
Set the server description of this connection.
|
|
Set the file descriptor for this connection.
|
|
PRIVATE function to set the host address and port to connect to.
|
|
Set both the host and the port in one operation for this connection.
|
|
Set the server name of this connection.
|
|
Set the port used by this connection.
|
|
Set the state flags for this connection.
|
|
This method sets the version string of the remote server.
|
|
Sockaddr of the outbound ip and port.
Definition at line 61 of file connection.h. |
|
Server 'GECOS'.
Definition at line 73 of file connection.h. |
|
File descriptor of the connection.
Definition at line 65 of file connection.h. |
|
When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference.
Definition at line 101 of file connection.h. |
|
IRCD Buffer for input characters, holds as many lines as are pending - Note that the final line may not be complete and should only be read when there is a
Definition at line 94 of file connection.h. |
|
When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference.
Definition at line 107 of file connection.h. |
|
Server names of servers that this server is linked to So for A->B->C, if this was the record for B it would contain A and C whilever both servers are connected to B.
Definition at line 113 of file connection.h. |
|
Server name.
Definition at line 69 of file connection.h. |
|
State. STATE_NOAUTH_INBOUND, STATE_NOAUTH_OUTBOUND STATE_SYNC, STATE_DISCONNECTED, STATE_CONNECTED Definition at line 78 of file connection.h. |
|
This string holds the ircd's version response.
Definition at line 86 of file connection.h. |