-enum ServerState { LISTENER, CONNECTING, WAIT_AUTH_1, WAIT_AUTH_2, CONNECTED };
-
-/** Every SERVER connection inbound or outbound is represented by
- * an object of type TreeSocket.
- * TreeSockets, being inherited from BufferedSocket, can be tied into
- * the core socket engine, and we cn therefore receive activity events
- * for them, just like activex objects on speed. (yes really, that
- * is a technical term!) Each of these which relates to a locally
- * connected server is assocated with it, by hooking it onto a
- * TreeSocket class using its constructor. In this way, we can
- * maintain a list of servers, some of which are directly connected,
- * some of which are not.
+enum ServerState { CONNECTING, WAIT_AUTH_1, WAIT_AUTH_2, CONNECTED, DYING };
+
+struct CapabData
+{
+ reference<Link> link; /* Link block used for this connection */
+ reference<Autoconnect> ac; /* Autoconnect used to cause this connection, if any */
+ std::string ModuleList; /* Required module list of other server from CAPAB */
+ std::string OptModuleList; /* Optional module list of other server from CAPAB */
+ std::string ChanModes;
+ std::string UserModes;
+ std::map<std::string,std::string> CapKeys; /* CAPAB keys from other server */
+ std::string ourchallenge; /* Challenge sent for challenge/response */
+ std::string theirchallenge; /* Challenge recv for challenge/response */
+ int capab_phase; /* Have sent CAPAB already */
+ bool auth_fingerprint; /* Did we auth using SSL fingerprint */
+ bool auth_challenge; /* Did we auth using challenge/response */
+
+ // Data saved from incoming SERVER command, for later use when our credentials have been accepted by the other party
+ std::string description;
+ std::string sid;
+ std::string name;
+ bool hidden;
+};
+
+/** Every SERVER connection inbound or outbound is represented by an object of
+ * type TreeSocket. During setup, the object can be found in Utils->timeoutlist;
+ * after setup, MyRoot will have been created as a child of Utils->TreeRoot