X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmodules%2Fm_spanningtree%2Ftreesocket.h;h=82a066be6ebd4df8c8e7c013789ef171effc10ba;hb=663a113180ceeab1fe5e86412de3c2afc1e23d4f;hp=52496a4ef27781d8de89166a44c720cf3f2ce3e8;hpb=d5c765053ea023497d11c375aaf60bfc7e0dd55f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index 52496a4ef..82a066be6 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -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 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 ¶ms); + /** Remote MODULES */ + bool Modules(const std::string &prefix, std::deque ¶ms); + bool Stats(const std::string &prefix, std::deque ¶ms); /** 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 ¶ms); + bool OperQuit(const std::string &prefix, std::deque ¶ms); + /** 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