]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspsocket.h
Add <auditorium showops> which determines if auditorium works like ircnet +a (anonymo...
[user/henk/code/inspircd.git] / include / inspsocket.h
index 1a959bd2d61e1da150f0dd05977dccd94457384a..03b674b7aa0608cabf6bcd55888dbb2d38011523 100644 (file)
@@ -69,6 +69,8 @@ class InspSocket : public EventHandler
 {
  public:
 
+       std::string cbindip;
+
        bool IsIOHooked;
 
        InspIRCd* Instance;
@@ -97,18 +99,6 @@ class InspSocket : public EventHandler
         */
        InspSocketState state;
 
-       /**
-        * The host being connected to,
-        * in sockaddr form
-        */
-        insp_sockaddr addr;
-
-       /** 
-        * The host being connected to,
-        * in in_addr form
-        */
-        insp_inaddr addy;
-
        /**
         * This value is true if the
         * socket has timed out.
@@ -131,18 +121,6 @@ class InspSocket : public EventHandler
         */
        char IP[MAXBUF];
 
-       /**
-        * Client sockaddr structure used
-        * by accept()
-        */
-       insp_sockaddr client;
-
-       /**
-        * Server sockaddr structure used
-        * by accept()
-        */
-       insp_sockaddr server;
-
        /**
         * Used by accept() to indicate the
         * sizes of the sockaddr_in structures
@@ -173,7 +151,7 @@ class InspSocket : public EventHandler
         */
        bool WaitingForWriteEvent;
 
-       bool BindAddr();
+       bool BindAddr(const std::string &ip);
 
        /**
         * The default constructor does nothing
@@ -201,9 +179,10 @@ class InspSocket : public EventHandler
         * @param port The port number to connect to, or bind to
         * @param listening true to listen on the given host:port pair, or false to connect to them
         * @param maxtime Number of seconds to wait, if connecting, before the connection times out and an OnTimeout() event is generated
+        * @param connectbindip When creating an outbound connection, the IP to bind the connection to. If not defined, the port is not bound.
         * @return On exit, GetState() returns I_ERROR if an error occured, and errno can be used to read the socket error.
         */
-       InspSocket(InspIRCd* SI, const std::string &ipaddr, int port, bool listening, unsigned long maxtime);
+       InspSocket(InspIRCd* SI, const std::string &ipaddr, int port, bool listening, unsigned long maxtime, const std::string &connectbindip = "");
 
        /**
         * This method is called when an outbound