]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/utils.h
Allow multiple autoconnects in a single <autoconnect> tag, fix infinite failover
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / utils.h
index 9936ebacf52c3576cdc7c7269e6e51b063a84506..a80b60e46a005b2288e8993c1ea4d24292e5dcfc 100644 (file)
@@ -20,6 +20,7 @@
 class TreeServer;
 class TreeSocket;
 class Link;
+class Autoconnect;
 class ModuleSpanningTree;
 class SpanningTreeUtilities;
 
@@ -44,11 +45,14 @@ class ServerSocketListener : public ListenSocketBase
        SpanningTreeUtilities *Utils;
 
  public:
-       ServerSocketListener(InspIRCd* Instance, SpanningTreeUtilities *u, int port, char* addr) : ListenSocketBase(Instance, port, addr)
+       ServerSocketListener(SpanningTreeUtilities *u, int port, char* addr) : ListenSocketBase(port, addr)
        {
                this->Utils = u;
+               Hook = NULL;
        }
 
+       Module* Hook;
+
        virtual void OnAcceptReady(int nfd);
 };
 
@@ -64,10 +68,6 @@ typedef std::map<irc::string, Module*> hookmodules;
  */
 class SpanningTreeUtilities : public classbase
 {
- private:
-       /** Creator server
-        */
-       InspIRCd* ServerInstance;
  public:
        /** Creator module
         */
@@ -83,6 +83,10 @@ class SpanningTreeUtilities : public classbase
         */
        bool AnnounceTSChange;
 
+       /** Allow modules marked as VF_OPTCOMMON to be mismatched when linking
+        */
+       bool AllowOptCommon;
+
        /** Make snomasks +CQ quiet during bursts and splits
         */
        bool quiet_bursts;
@@ -117,7 +121,10 @@ class SpanningTreeUtilities : public classbase
        std::map<TreeSocket*, std::pair<std::string, int> > timeoutlist;
        /** Holds the data from the <link> tags in the conf
         */
-       std::vector<Link> LinkBlocks;
+       std::vector<reference<Link> > LinkBlocks;
+       /** Holds the data from the <autoconnect> tags in the conf
+        */
+       std::vector<reference<Autoconnect> > AutoconnectBlocks;
 
        /** List of module pointers which can provide I/O abstraction
         */
@@ -141,7 +148,11 @@ class SpanningTreeUtilities : public classbase
 
        /** Initialise utility class
         */
-       SpanningTreeUtilities(InspIRCd* Instance, ModuleSpanningTree* Creator);
+       SpanningTreeUtilities(ModuleSpanningTree* Creator);
+
+       /** Prepare for class destruction
+        */
+       bool cull();
 
        /** Destroy class and free listeners etc
         */
@@ -203,10 +214,6 @@ class SpanningTreeUtilities : public classbase
         */
        bool IsServer(const std::string &ServerName);
 
-       /** Attempt to connect to the failover link of link x
-        */
-       void DoFailOver(Link* x);
-
        /** Find a link tag from a server name
         */
        Link* FindLink(const std::string& name);