From f463b772b020b272f3322799c9a55b755cdf3067 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 9 Feb 2011 20:09:26 -0500 Subject: [PATCH] Removed a lot of the old capab flags we dont/have never used --- docs/IRCD | 67 +++------------------------------ include/servers.h | 26 ------------- modules/protocol/bahamut.cpp | 4 -- modules/protocol/inspircd11.cpp | 4 -- modules/protocol/inspircd12.cpp | 4 -- modules/protocol/inspircd20.cpp | 4 -- modules/protocol/plexus.cpp | 4 -- modules/protocol/ratbox.cpp | 4 -- modules/protocol/unreal32.cpp | 4 -- src/protocol.cpp | 1 + src/servers.cpp | 22 ----------- 11 files changed, 7 insertions(+), 137 deletions(-) diff --git a/docs/IRCD b/docs/IRCD index ce44d893f..1e25ce162 100644 --- a/docs/IRCD +++ b/docs/IRCD @@ -175,74 +175,19 @@ How To Add IRCd Support 5) CAPAB/PROTOCTL - Most IRCD send a CAPAB or PROTOCTL line so that they can work out what - the other end of the connection is capable of doing. Anope has a function - to read these lines and set itself up to to handle these events better. - When adding support for your ircd, take the following steps. + Most IRCDs send a CAPAB or PROTOCTL line so that they can work out what + the other end of the connection is capable of doing. The protocol module should + handle all of these without the cores knowledge with the exception of the following: - 1) In the module constructor you must tell Anope what the uplink is capable of that - isn't already passed in the CAPAB/PROTOCTL, you do this by something similar to: - - CapabType c[] = { CAPAB_NOQUIT, CAPAB_NICKIP, CAPAB_ZIP, CAPAB_TOKEN, CAPAB_SSJ3, CAPAB_NICK2, CAPAB_VL, CAPAB_TLKEXT, CAPAB_CHANMODE, CAPAB_SJB64, CAPAB_NICKCHARS }; - for (unsigned i = 0; i < 11; ++i) - Capab.SetFlag(c[i]); - - Anything else given to Anope in the CAPAB/PROTOCTL message will be handled later by CapabParse. - - The available CAPAB options are: - -------------------------------------------------------------------------- Define | Description - ----------------|------------|-----------|-------------------------------- + ----------------|--------------------------------------------------------- CAPAB_NOQUIT | NOQUIT protocol support CAPAB_TSMODE | Chanmodes are timestamped CAPAB_UNCONNECT | UNCONNECT protocol support - CAPAB_NICKIP | IP sent in the NICK line - CAPAB_NSJOIN | Smart SJOIN support - CAPAB_ZIP | Support for gzipped links - CAPAB_BURST | Supports BURST command - CAPAB_TS3 | Support for TS3 protocol - CAPAB_TS5 | Support for TS5 protocol - CAPAB_DKEY | DH-Key exchange using DKEY - CAPAB_DOZIP | Link traffic will be gzipped - CAPAB_DODKEY | Do DKEY with this link - CAPAB_QS | Supports quit storm removal - CAPAB_SCS | String Cache System support - CAPAB_PT4 | Support for PT4 protocol - CAPAB_UID | Support for UIDs - CAPAB_KNOCK | Supports KNOCK - CAPAB_CLIENT | Supports CLIENT - CAPAB_IPV6 | Support for IPv6 addresses - CAPAB_SSJ5 | Smart Join protocol 5 support - CAPAB_SN2 | Support for SN2 protocol - CAPAB_VHOST | Supports VHOST protocol - CAPAB_TOKEN | Supports s2s tokens - CAPAB_SSJ3 | Smart Join protocol 3 support - CAPAB_NICK2 | Support for extended NICK (v2) - CAPAB_UMODE2 | Supports UMODE2 command - CAPAB_VL | VLine information in info field - CAPAB_TLKEXT | Not 8, but 10 params in TKL's - CAPAB_CHANMODE | Channel modes are passed here - CAPAB_SJB64 | SJOIN timestamps are base64 encoded - CAPAB_NICKCHARS | Character set used by the IRCD for nicks + CAPAB_QS | Quitstorm - same as NOQUIT - 2) Ensure that the CAPAB/PROTOCTL event his handled correctly. - - A) In the function module constructor make sure that you have the - following two lines: - - Message message_capab("CAPAB", event_capab); - - B) Add the function to handle the event - - bool event_capab(const Anope::string &source, const std::vector ¶ms) - { - CapabParse(params); - return true; - } - - This function should call the CapabParse function which parses - the received CAPAB/PROTOCTL line. + You can override the default OnCapab method in IRCdMessage if required. 6) IRCDProto Class diff --git a/include/servers.h b/include/servers.h index c9d85804b..f1a39e169 100644 --- a/include/servers.h +++ b/include/servers.h @@ -18,33 +18,7 @@ enum CapabType CAPAB_NOQUIT, CAPAB_TSMODE, CAPAB_UNCONNECT, - CAPAB_NICKIP, - CAPAB_NSJOIN, - CAPAB_ZIP, - CAPAB_BURST, - CAPAB_TS3, - CAPAB_TS5, - CAPAB_DKEY, - CAPAB_DOZIP, - CAPAB_DODKEY, CAPAB_QS, - CAPAB_SCS, - CAPAB_PT4, - CAPAB_UID, - CAPAB_KNOCK, - CAPAB_CLIENT, - CAPAB_IPV6, - CAPAB_SSJ5, - CAPAB_SN2, - CAPAB_VHOST, - CAPAB_TOKEN, - CAPAB_SSJ3, - CAPAB_NICK2, - CAPAB_VL, - CAPAB_TLKEXT, - CAPAB_CHANMODE, - CAPAB_SJB64, - CAPAB_NICKCHARS, CAPAB_END }; diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index b98bb0175..ecb493dba 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -603,10 +603,6 @@ class ProtoBahamut : public Module this->SetAuthor("Anope"); this->SetType(PROTOCOL); - CapabType c[] = { CAPAB_NOQUIT, CAPAB_TSMODE, CAPAB_UNCONNECT, CAPAB_BURST, CAPAB_DKEY, CAPAB_DOZIP }; - for (unsigned i = 0; i < 6; ++i) - Capab.SetFlag(c[i]); - AddModes(); pmodule_ircd_var(myIrcd); diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp index 66300cde3..b945370bf 100644 --- a/modules/protocol/inspircd11.cpp +++ b/modules/protocol/inspircd11.cpp @@ -904,10 +904,6 @@ class ProtoInspIRCd : public Module this->SetAuthor("Anope"); this->SetType(PROTOCOL); - CapabType c[] = { CAPAB_NOQUIT, CAPAB_SSJ3, CAPAB_NICK2, CAPAB_VL, CAPAB_TLKEXT }; - for (unsigned i = 0; i < 5; ++i) - Capab.SetFlag(c[i]); - AddModes(); pmodule_ircd_var(myIrcd); diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp index 9efc80b51..dbb69a3c1 100644 --- a/modules/protocol/inspircd12.cpp +++ b/modules/protocol/inspircd12.cpp @@ -726,10 +726,6 @@ class ProtoInspIRCd : public Module this->SetAuthor("Anope"); this->SetType(PROTOCOL); - CapabType c[] = { CAPAB_NOQUIT, CAPAB_SSJ3, CAPAB_NICK2, CAPAB_VL, CAPAB_TLKEXT }; - for (unsigned i = 0; i < 5; ++i) - Capab.SetFlag(c[i]); - pmodule_ircd_var(myIrcd); pmodule_ircd_proto(&this->ircd_proto); pmodule_ircd_message(&this->ircd_message); diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index dcfdbf298..2307de9df 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -701,10 +701,6 @@ class ProtoInspIRCd : public Module this->SetAuthor("Anope"); this->SetType(PROTOCOL); - CapabType c[] = { CAPAB_NOQUIT, CAPAB_SSJ3, CAPAB_NICK2, CAPAB_VL, CAPAB_TLKEXT }; - for (unsigned i = 0; i < 5; ++i) - Capab.SetFlag(c[i]); - pmodule_ircd_var(myIrcd); pmodule_ircd_proto(&this->ircd_proto); pmodule_ircd_message(&this->ircd_message); diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp index 8243e605a..a1fad8d5b 100644 --- a/modules/protocol/plexus.cpp +++ b/modules/protocol/plexus.cpp @@ -661,10 +661,6 @@ class ProtoPlexus : public Module this->SetAuthor("Anope"); this->SetType(PROTOCOL); - CapabType c[] = { CAPAB_ZIP, CAPAB_TS5, CAPAB_QS, CAPAB_UID, CAPAB_KNOCK }; - for (unsigned i = 0; i < 5; ++i) - Capab.SetFlag(c[i]); - AddModes(); pmodule_ircd_var(myIrcd); diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp index 9d8864d10..c7797c166 100644 --- a/modules/protocol/ratbox.cpp +++ b/modules/protocol/ratbox.cpp @@ -580,10 +580,6 @@ class ProtoRatbox : public Module this->SetAuthor("Anope"); this->SetType(PROTOCOL); - CapabType c[] = { CAPAB_ZIP, CAPAB_TS5, CAPAB_QS, CAPAB_UID, CAPAB_KNOCK, CAPAB_TSMODE }; - for (unsigned i = 0; i < 6; ++i) - Capab.SetFlag(c[i]); - AddModes(); pmodule_ircd_var(myIrcd); diff --git a/modules/protocol/unreal32.cpp b/modules/protocol/unreal32.cpp index d02987038..35af8ad70 100644 --- a/modules/protocol/unreal32.cpp +++ b/modules/protocol/unreal32.cpp @@ -1065,10 +1065,6 @@ class ProtoUnreal : public Module this->SetAuthor("Anope"); this->SetType(PROTOCOL); - CapabType c[] = { CAPAB_NOQUIT, CAPAB_NICKIP, CAPAB_ZIP, CAPAB_TOKEN, CAPAB_SSJ3, CAPAB_NICK2, CAPAB_VL, CAPAB_TLKEXT, CAPAB_CHANMODE, CAPAB_NICKCHARS }; - for (unsigned i = 0; i < 10; ++i) - Capab.SetFlag(c[i]); - AddModes(); pmodule_ircd_var(myIrcd); diff --git a/src/protocol.cpp b/src/protocol.cpp index 56d559768..a035d2f22 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -574,6 +574,7 @@ bool IRCdMessage::OnCapab(const Anope::string &, const std::vector