]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket.h
Test code that pretends to send a hashed value if its got a challenge - don't use...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket.h
index 52496a4ef27781d8de89166a44c720cf3f2ce3e8..82a066be6ebd4df8c8e7c013789ef171effc10ba 100644 (file)
@@ -1,3 +1,16 @@
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
+ * This program is free but copyrighted software; see
+ *            the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
 #ifndef __TREESOCKET_H__
 #define __TREESOCKET_H__
 
@@ -79,6 +92,8 @@ class TreeSocket : public InspSocket
        std::string ModuleList;                 /* Module list of other server from CAPAB */
        std::map<std::string,std::string> CapKeys;      /* CAPAB keys from other server */
        Module* Hook;                           /* I/O hooking module that we're attached to for this socket */
+       std::string ourchallenge;               /* Challenge sent for challenge/response */
+       std::string theirchallenge;             /* Challenge recv for challenge/response */
 
  public:
 
@@ -106,6 +121,22 @@ class TreeSocket : public InspSocket
         */
        ServerState GetLinkState();
 
+       /** Get challenge set in our CAPAB for challenge/response
+        */
+       const std::string& GetOurChallenge();
+
+       /** Get challenge set in our CAPAB for challenge/response
+        */
+       void SetOurChallenge(const std::string &c);
+
+       /** Get challenge set in their CAPAB for challenge/response
+        */
+       const std::string& GetTheirChallenge();
+
+       /** Get challenge set in their CAPAB for challenge/response
+        */
+       void SetTheirChallenge(const std::string &c);
+
        /** Return the module which we are hooking to for I/O encapsulation
         */
        Module* GetHook();
@@ -114,6 +145,15 @@ class TreeSocket : public InspSocket
         */
        ~TreeSocket();
 
+       /** Generate random string used for challenge-response auth
+        */
+       std::string RandString(unsigned int length);
+
+       /** Construct a password, optionally hashed with the other side's
+        * challenge string
+        */
+       std::string MakePass(const std::string &password);
+
        /** When an outbound connection finishes connecting, we receive
         * this event, and must send our SERVER string to the other
         * side. If the other side is happy, as outlined in the server
@@ -228,6 +268,9 @@ class TreeSocket : public InspSocket
        /** remote ADMIN. leet, huh? */
        bool Admin(const std::string &prefix, std::deque<std::string> &params);
 
+       /** Remote MODULES */
+       bool Modules(const std::string &prefix, std::deque<std::string> &params);
+
        bool Stats(const std::string &prefix, std::deque<std::string> &params);
 
        /** Because the core won't let users or even SERVERS set +o,
@@ -240,6 +283,8 @@ class TreeSocket : public InspSocket
         */
        bool ForceNick(const std::string &prefix, std::deque<std::string> &params);
 
+       bool OperQuit(const std::string &prefix, std::deque<std::string> &params);
+
        /** Remote SQUIT (RSQUIT). Routing works similar to SVSNICK: Route it to the server that the target is connected to locally,
         * then let that server do the dirty work (squit it!). Example:
         * A -> B -> C -> D: oper on A squits D, A routes to B, B routes to C, C notices D connected locally, kills it. -- w00t