]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/connection.h
Added some netsplit handling stuff (untested)
[user/henk/code/inspircd.git] / include / connection.h
index 2dd11633bc1b181ff25bae426eaf477673ab4aa8..3316bd6c0fd09a8f7546f4c3299edbe31aa1214a 100644 (file)
@@ -36,7 +36,7 @@ class ircd_connector : public classbase
         */
        sockaddr_in addr;
        
-       /** File descriptor of the outbound connection
+       /** File descriptor of the connection
         */
        int fd;
        
@@ -44,11 +44,9 @@ class ircd_connector : public classbase
         */
        std::string servername;
        
-       /** 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.
+       /** Server 'GECOS'
         */
-       std::vector<std::string> routes;
+       std::string description;
        
        /** State. STATE_NOAUTH_INBOUND, STATE_NOAUTH_OUTBOUND
         * STATE_SYNC, STATE_DISCONNECTED, STATE_CONNECTED
@@ -58,6 +56,15 @@ class ircd_connector : public classbase
        bool SetHostAddress(char* host, int port);
 
  public:
+       char host[MAXBUF];
+       int port;
+       
+       /** 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.
+        */
+       std::vector<std::string> routes;
+       
  
        bool MakeOutboundConnection(char* host, int port);
        std::string GetServerName();
@@ -66,6 +73,12 @@ class ircd_connector : public classbase
        void SetDescriptor(int fd);
        int GetState();
        void SetState(int state);
+       char* GetServerIP();
+       std::string GetDescription();
+       void SetDescription(std::string desc);
+       int GetServerPort();
+       bool SetHostAndPort(char* host, int port);
+       void CloseConnection();
 };
 
 
@@ -109,11 +122,12 @@ class connection : public classbase
        connection();
        bool CreateListener(char* host, int p);
        bool BeginLink(char* targethost, int port, char* password, char* servername);
+       bool MeshCookie(char* targethost, int port, long cookie, char* servername);
        void TerminateLink(char* targethost);
-       bool SendPacket(char *message, char* host);
+       bool SendPacket(char *message, const char* host);
        bool RecvPacket(std::deque<std::string> &messages, char* host);
        ircd_connector* FindHost(std::string host);
-       bool AddIncoming(int fd,char* targethost);
+       bool AddIncoming(int fd,char* targethost, int sourceport);
        long GenKey();
 };