]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - docs/man/man3/ircd_connector.3
Added final documentation for inspircd Beta 4
[user/henk/code/inspircd.git] / docs / man / man3 / ircd_connector.3
index 6dc5377cd62fdbb302fd56e45041bb3551a11366..7e39dd73d306e2a2bece83b399ca14fd7e2cf910 100644 (file)
@@ -1,8 +1,8 @@
-.TH "ircd_connector" 3 "2 May 2004" "InspIRCd" \" -*- nroff -*-
+.TH "ircd_connector" 3 "7 May 2005" "InspIRCd" \" -*- nroff -*-
 .ad l
 .nh
 .SH NAME
-ircd_connector \- Each connection has one or more of these each represents ONE outbound connection to another ircd so each inbound has multiple outbounds. 
+ircd_connector \- Each connection has one or more of these each represents ONE outbound connection to another ircd so each inbound has multiple outbounds.  
 
 .PP
 .SH SYNOPSIS
@@ -16,77 +16,107 @@ Inherits \fBExtensible\fP.
 
 .in +1c
 .ti -1c
-.RI "bool \fBMakeOutboundConnection\fP (char *\fBhost\fP, int \fBport\fP)"
+.RI "bool \fBMakeOutboundConnection\fP (char *newhost, int newport)"
 .br
-.RI "\fICreate an outbound connection to a listening socket.\fP"
+.RI "\fICreate an outbound connection to a listening socket. \fP"
 .ti -1c
 .RI "std::string \fBGetServerName\fP ()"
 .br
-.RI "\fIReturn the servername on this established connection.\fP"
+.RI "\fIReturn the servername on this established connection. \fP"
 .ti -1c
 .RI "void \fBSetServerName\fP (std::string serv)"
 .br
-.RI "\fISet the server name of this connection.\fP"
+.RI "\fISet the server name of this connection. \fP"
 .ti -1c
 .RI "int \fBGetDescriptor\fP ()"
 .br
-.RI "\fIGet the file descriptor associated with this connection.\fP"
+.RI "\fIGet the file descriptor associated with this connection. \fP"
 .ti -1c
 .RI "void \fBSetDescriptor\fP (int \fBfd\fP)"
 .br
-.RI "\fISet the file descriptor for this connection.\fP"
+.RI "\fISet the file descriptor for this connection. \fP"
 .ti -1c
 .RI "int \fBGetState\fP ()"
 .br
-.RI "\fIGet the state flags for this connection.\fP"
+.RI "\fIGet the state flags for this connection. \fP"
 .ti -1c
 .RI "void \fBSetState\fP (int \fBstate\fP)"
 .br
-.RI "\fISet the state flags for this connection.\fP"
+.RI "\fISet the state flags for this connection. \fP"
 .ti -1c
 .RI "char * \fBGetServerIP\fP ()"
 .br
-.RI "\fIGet the ip address (not servername) associated with this connection.\fP"
+.RI "\fIGet the ip address (not servername) associated with this connection. \fP"
 .ti -1c
 .RI "std::string \fBGetDescription\fP ()"
 .br
-.RI "\fIGet the server description of this connection.\fP"
+.RI "\fIGet the server description of this connection. \fP"
 .ti -1c
 .RI "void \fBSetDescription\fP (std::string desc)"
 .br
-.RI "\fISet the server description of this connection.\fP"
+.RI "\fISet the server description of this connection. \fP"
 .ti -1c
 .RI "int \fBGetServerPort\fP ()"
 .br
-.RI "\fIGet 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 \fBGetServerIP()\fP.\fP"
+.RI "\fIGet 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 \fBGetServerIP()\fP. \fP"
 .ti -1c
 .RI "void \fBSetServerPort\fP (int p)"
 .br
-.RI "\fISet the port used by this connection.\fP"
+.RI "\fISet the port used by this connection. \fP"
 .ti -1c
-.RI "bool \fBSetHostAndPort\fP (char *\fBhost\fP, int \fBport\fP)"
+.RI "bool \fBSetHostAndPort\fP (char *newhost, int newport)"
 .br
-.RI "\fISet both the host and the port in one operation for this connection.\fP"
+.RI "\fISet both the host and the port in one operation for this connection. \fP"
 .ti -1c
 .RI "void \fBCloseConnection\fP ()"
 .br
-.RI "\fIClose the connection by calling close() on its file descriptor This function call updates no other data.\fP"
+.RI "\fIClose the connection by calling close() on its file descriptor This function call updates no other data. \fP"
+.ti -1c
+.RI "void \fBAddBuffer\fP (std::string a)"
+.br
+.RI "\fIThis 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. \fP"
+.ti -1c
+.RI "bool \fBBufferIsComplete\fP ()"
+.br
+.RI "\fIThis method returns true if the buffer contains at least one carriage return character, e.g. \fP"
+.ti -1c
+.RI "void \fBClearBuffer\fP ()"
+.br
+.RI "\fIThis method clears the server's buffer by setting it to an empty string. \fP"
+.ti -1c
+.RI "std::string \fBGetBuffer\fP ()"
+.br
+.RI "\fIThis 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(). \fP"
+.ti -1c
+.RI "void \fBSetVersionString\fP (std::string newversion)"
+.br
+.RI "\fIThis method sets the version string of the remote server. \fP"
+.ti -1c
+.RI "std::string \fBGetVersionString\fP ()"
+.br
+.RI "\fIThis method returns the version string of the remote server. \fP"
 .in -1c
 .SS "Public Attributes"
 
 .in +1c
 .ti -1c
+.RI "std::string \fBircdbuffer\fP"
+.br
+.RI "\fIIRCD 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 
+.br
+ seperator. \fP"
+.ti -1c
 .RI "char \fBhost\fP [MAXBUF]"
 .br
-.RI "\fIWhen MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference.\fP"
+.RI "\fIWhen MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. \fP"
 .ti -1c
 .RI "int \fBport\fP"
 .br
-.RI "\fIWhen MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference.\fP"
+.RI "\fIWhen MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. \fP"
 .ti -1c
 .RI "std::vector< std::string > \fBroutes\fP"
 .br
-.RI "\fI\fBServer\fP 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.\fP"
+.RI "\fI\fBServer\fP 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. \fP"
 .in -1c
 .SS "Private Member Functions"
 
@@ -94,7 +124,7 @@ Inherits \fBExtensible\fP.
 .ti -1c
 .RI "bool \fBSetHostAddress\fP (char *\fBhost\fP, int \fBport\fP)"
 .br
-.RI "\fIPRIVATE function to set the host address and port to connect to.\fP"
+.RI "\fIPRIVATE function to set the host address and port to connect to. \fP"
 .in -1c
 .SS "Private Attributes"
 
@@ -102,104 +132,134 @@ Inherits \fBExtensible\fP.
 .ti -1c
 .RI "sockaddr_in \fBaddr\fP"
 .br
-.RI "\fISockaddr of the outbound ip and port.\fP"
+.RI "\fISockaddr of the outbound ip and port. \fP"
 .ti -1c
 .RI "int \fBfd\fP"
 .br
-.RI "\fIFile descriptor of the connection.\fP"
+.RI "\fIFile descriptor of the connection. \fP"
 .ti -1c
 .RI "std::string \fBservername\fP"
 .br
-.RI "\fI\fBServer\fP name.\fP"
+.RI "\fI\fBServer\fP name. \fP"
 .ti -1c
 .RI "std::string \fBdescription\fP"
 .br
-.RI "\fI\fBServer\fP 'GECOS'.\fP"
+.RI "\fI\fBServer\fP 'GECOS'. \fP"
 .ti -1c
 .RI "int \fBstate\fP"
 .br
-.RI "\fIState.\fP"
+.RI "\fIState. \fP"
+.ti -1c
+.RI "std::string \fBversion\fP"
+.br
+.RI "\fIThis string holds the ircd's version response. \fP"
 .in -1c
 .SH "Detailed Description"
 .PP 
-Each connection has one or more of these each represents ONE outbound connection to another ircd so each inbound has multiple outbounds.
+Each connection has one or more of these each represents ONE outbound connection to another ircd so each inbound has multiple outbounds. 
 
 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. 
 .PP
-Definition at line 41 of file connection.h.
+Definition at line 54 of file connection.h.
 .SH "Member Function Documentation"
 .PP 
+.SS "void ircd_connector::AddBuffer (std::string a)"
+.PP
+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.
+.SS "bool ircd_connector::BufferIsComplete ()"
+.PP
+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.
+.SS "void ircd_connector::ClearBuffer ()"
+.PP
+This method clears the server's buffer by setting it to an empty string. 
 .SS "void ircd_connector::CloseConnection ()"
 .PP
-Close the connection by calling close() on its file descriptor This function call updates no other data.
+Close the connection by calling close() on its file descriptor This function call updates no other data. 
+.SS "std::string ircd_connector::GetBuffer ()"
+.PP
+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(). 
 .SS "std::string ircd_connector::GetDescription ()"
 .PP
-Get the server description of this connection.
+Get the server description of this connection. 
 .SS "int ircd_connector::GetDescriptor ()"
 .PP
-Get the file descriptor associated with this connection.
+Get the file descriptor associated with this connection. 
 .SS "char* ircd_connector::GetServerIP ()"
 .PP
-Get the ip address (not servername) associated with this connection.
+Get the ip address (not servername) associated with this connection. 
 .SS "std::string ircd_connector::GetServerName ()"
 .PP
-Return the servername on this established connection.
+Return the servername on this established connection. 
 .SS "int ircd_connector::GetServerPort ()"
 .PP
-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 \fBGetServerIP()\fP.
+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 \fBGetServerIP()\fP. 
 .SS "int ircd_connector::GetState ()"
 .PP
-Get the state flags for this connection.
-.SS "bool ircd_connector::MakeOutboundConnection (char * host, int port)"
+Get the state flags for this connection. 
+.SS "std::string ircd_connector::GetVersionString ()"
+.PP
+This method returns the version string of the remote server. If the server has no version string an empty string is returned.
+.SS "bool ircd_connector::MakeOutboundConnection (char * newhost, int newport)"
 .PP
-Create an outbound connection to a listening socket.
+Create an outbound connection to a listening socket. 
 .SS "void ircd_connector::SetDescription (std::string desc)"
 .PP
-Set the server description of this connection.
+Set the server description of this connection. 
 .SS "void ircd_connector::SetDescriptor (int fd)"
 .PP
-Set the file descriptor for this connection.
+Set the file descriptor for this connection. 
 .SS "bool ircd_connector::SetHostAddress (char * host, int port)\fC [private]\fP"
 .PP
-PRIVATE function to set the host address and port to connect to.
-.SS "bool ircd_connector::SetHostAndPort (char * host, int port)"
+PRIVATE function to set the host address and port to connect to. 
+.SS "bool ircd_connector::SetHostAndPort (char * newhost, int newport)"
 .PP
-Set both the host and the port in one operation for this connection.
+Set both the host and the port in one operation for this connection. 
 .SS "void ircd_connector::SetServerName (std::string serv)"
 .PP
-Set the server name of this connection.
+Set the server name of this connection. 
 .SS "void ircd_connector::SetServerPort (int p)"
 .PP
-Set the port used by this connection.
+Set the port used by this connection. 
 .SS "void ircd_connector::SetState (int state)"
 .PP
-Set the state flags for this connection.
+Set the state flags for this connection. 
+.SS "void ircd_connector::SetVersionString (std::string newversion)"
+.PP
+This method sets the version string of the remote server. 
 .SH "Member Data Documentation"
 .PP 
-.SS "sockaddr_in ircd_connector::addr\fC [private]\fP"
+.SS "sockaddr_in \fBircd_connector::addr\fP\fC [private]\fP"
 .PP
-Sockaddr of the outbound ip and port.Definition at line 46 of file connection.h.
-.SS "std::string ircd_connector::description\fC [private]\fP"
+Sockaddr of the outbound ip and port. Definition at line 59 of file connection.h.
+.SS "std::string \fBircd_connector::description\fP\fC [private]\fP"
 .PP
-\fBServer\fP 'GECOS'.Definition at line 58 of file connection.h.
-.SS "int ircd_connector::fd\fC [private]\fP"
+\fBServer\fP 'GECOS'. Definition at line 71 of file connection.h.
+.SS "int \fBircd_connector::fd\fP\fC [private]\fP"
 .PP
-File descriptor of the connection.Definition at line 50 of file connection.h.
-.SS "char ircd_connector::host[MAXBUF]"
+File descriptor of the connection. Definition at line 63 of file connection.h.
+.SS "char \fBircd_connector::host\fP[MAXBUF]"
+.PP
+When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. Definition at line 99 of file connection.h.
+.SS "std::string \fBircd_connector::ircdbuffer\fP"
+.PP
+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 
+.br
+ seperator. Definition at line 92 of file connection.h.
+.SS "int \fBircd_connector::port\fP"
 .PP
-When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference.Definition at line 75 of file connection.h.
-.SS "int ircd_connector::port"
+When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. Definition at line 105 of file connection.h.
+.SS "std::vector<std::string> \fBircd_connector::routes\fP"
 .PP
-When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference.Definition at line 81 of file connection.h.
-.SS "std::vector<std::string> ircd_connector::routes"
+\fBServer\fP 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 111 of file connection.h.
+.SS "std::string \fBircd_connector::servername\fP\fC [private]\fP"
 .PP
-\fBServer\fP 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 87 of file connection.h.
-.SS "std::string ircd_connector::servername\fC [private]\fP"
+\fBServer\fP name. Definition at line 67 of file connection.h.
+.SS "int \fBircd_connector::state\fP\fC [private]\fP"
 .PP
-\fBServer\fP name.Definition at line 54 of file connection.h.
-.SS "int ircd_connector::state\fC [private]\fP"
+State. STATE_NOAUTH_INBOUND, STATE_NOAUTH_OUTBOUND STATE_SYNC, STATE_DISCONNECTED, STATE_CONNECTEDDefinition at line 76 of file connection.h.
+.SS "std::string \fBircd_connector::version\fP\fC [private]\fP"
 .PP
-State.STATE_NOAUTH_INBOUND, STATE_NOAUTH_OUTBOUND STATE_SYNC, STATE_DISCONNECTED, STATE_CONNECTEDDefinition at line 63 of file connection.h.
+This string holds the ircd's version response. Definition at line 84 of file connection.h.
 
 .SH "Author"
 .PP