summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-17 13:25:06 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-17 13:25:06 +0200
commit7e47e4184196952d7bd2ed2c79232fc374f9e664 (patch)
treec992c47cb7ea33187a3257cffe0c46664c0d09fe /src
parentd256e357ee65a8535738fa4a370da4086023043a (diff)
m_spanningtree Add server-to-server SINFO command handler and builder
Don't send SINFO to 1202 protocol servers
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree/commands.h14
-rw-r--r--src/modules/m_spanningtree/compat.cpp4
-rw-r--r--src/modules/m_spanningtree/main.cpp2
-rw-r--r--src/modules/m_spanningtree/sinfo.cpp36
4 files changed, 55 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/commands.h b/src/modules/m_spanningtree/commands.h
index 7ecdaeadc..2554c689e 100644
--- a/src/modules/m_spanningtree/commands.h
+++ b/src/modules/m_spanningtree/commands.h
@@ -347,6 +347,19 @@ class CommandEndBurst : public ServerOnlyServerCommand<CommandEndBurst>
CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters);
};
+class CommandSInfo : public ServerOnlyServerCommand<CommandSInfo>
+{
+ public:
+ CommandSInfo(Module* Creator) : ServerOnlyServerCommand<CommandSInfo>(Creator, "SINFO", 2) { }
+ CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters);
+
+ class Builder : public CmdBuilder
+ {
+ public:
+ Builder(TreeServer* server, const char* type, const std::string& value);
+ };
+};
+
class SpanningTreeCommands
{
public:
@@ -380,5 +393,6 @@ class SpanningTreeCommands
CommandVersion version;
CommandBurst burst;
CommandEndBurst endburst;
+ CommandSInfo sinfo;
SpanningTreeCommands(ModuleSpanningTree* module);
};
diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp
index 9d3c52bd2..5893a09fd 100644
--- a/src/modules/m_spanningtree/compat.cpp
+++ b/src/modules/m_spanningtree/compat.cpp
@@ -244,6 +244,10 @@ void TreeSocket::WriteLine(const std::string& original_line)
line.erase(d, e-d);
}
}
+ else if (command == "SINFO")
+ {
+ return;
+ }
}
ServerInstance->Logs->Log(MODNAME, LOG_RAWIO, "S[%d] O %s", this->GetFd(), line.c_str());
this->WriteData(line);
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 5bf4583a4..59937cc6a 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -51,7 +51,7 @@ SpanningTreeCommands::SpanningTreeCommands(ModuleSpanningTree* module)
away(module), addline(module), delline(module), encap(module), idle(module),
nick(module), ping(module), pong(module), push(module), save(module),
server(module), squit(module), snonotice(module), version(module),
- burst(module), endburst(module)
+ burst(module), endburst(module), sinfo(module)
{
}
diff --git a/src/modules/m_spanningtree/sinfo.cpp b/src/modules/m_spanningtree/sinfo.cpp
new file mode 100644
index 000000000..71bd48b44
--- /dev/null
+++ b/src/modules/m_spanningtree/sinfo.cpp
@@ -0,0 +1,36 @@
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
+ *
+ * Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com>
+ *
+ * This file is part of InspIRCd. InspIRCd is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation, version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "inspircd.h"
+
+#include "treeserver.h"
+#include "commands.h"
+
+CmdResult CommandSInfo::HandleServer(TreeServer* server, std::vector<std::string>& params)
+{
+ const std::string& key = params.front();
+ const std::string& value = params.back();
+
+ return CMD_SUCCESS;
+}
+
+CommandSInfo::Builder::Builder(TreeServer* server, const char* key, const std::string& val)
+ : CmdBuilder(server->GetID(), "SINFO")
+{
+ push(key).push_last(val);
+}