]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/utils.h
In the grand tradition of huge fucking commits:
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / utils.h
index cb783a81a16bcf2393d1bcc4f9e28b67a48ba91f..aeb89c6be93cec200be86beebe420c9704a2793b 100644 (file)
 #ifndef __ST__UTIL__
 #define __ST__UTIL__
 
-#include "configreader.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 #include "inspircd.h"
 
 /* Foward declarations */
@@ -89,6 +85,9 @@ class SpanningTreeUtilities
        /** Hash of currently connected servers by name
         */
        server_hash serverlist;
+       /** Hash of currently known server ids
+        */
+       server_hash sidlist;
        /** Hash of servers currently bursting but not initialized as connected
         */
        std::map<irc::string,TreeSocket*> burstingserverlist;
@@ -123,6 +122,10 @@ class SpanningTreeUtilities
         */
        bool ChallengeResponse;
 
+       /** Ping frequency of server to server links
+        */
+       int PingFreq;
+
        /** Initialise utility class
         */
        SpanningTreeUtilities(InspIRCd* Instance, ModuleSpanningTree* Creator);
@@ -155,10 +158,13 @@ class SpanningTreeUtilities
        void AddThisServer(TreeServer* server, TreeServerList &list);
        /** Compile a list of servers which contain members of channel c
         */
-       void GetListOfServersForChannel(chanrec* c, TreeServerList &list, char status, const CUList &exempt_list);
+       void GetListOfServersForChannel(Channel* c, TreeServerList &list, char status, const CUList &exempt_list);
        /** Find a server by name
         */
        TreeServer* FindServer(const std::string &ServerName);
+       /** Find server by SID
+        */
+       TreeServer* FindServerID(const std::string &id);
        /** Find a remote bursting server by name
         */
        TreeServer* FindRemoteBurstServer(TreeServer* Server);
@@ -189,6 +195,11 @@ class SpanningTreeUtilities
        void AddBurstingServer(const std::string &ServerName, TreeSocket* s);
 
        void DelBurstingServer(TreeSocket* s);
+
+       /** Return true if str looks like a server ID
+        * @param string to check against
+        */
+       bool IsSID(const std::string &str);
 };
 
 #endif