]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Match conversion stuff.
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 22 Aug 2008 16:14:36 +0000 (16:14 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 22 Aug 2008 16:14:36 +0000 (16:14 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10216 e03df62e-2008-0410-955e-edbf42e46eb7

67 files changed:
include/inspircd.h
include/u_listmode.h
src/modules/extra/m_ssl_oper_cert.cpp
src/modules/extra/m_sslinfo.cpp
src/modules/m_alias.cpp
src/modules/m_banexception.cpp
src/modules/m_banredirect.cpp
src/modules/m_cgiirc.cpp
src/modules/m_check.cpp
src/modules/m_cloaking.cpp
src/modules/m_clones.cpp
src/modules/m_conn_umodes.cpp
src/modules/m_customtitle.cpp
src/modules/m_dccallow.cpp
src/modules/m_denychans.cpp
src/modules/m_filter.cpp
src/modules/m_globalload.cpp
src/modules/m_hostchange.cpp
src/modules/m_httpd_acl.cpp
src/modules/m_inviteexception.cpp
src/modules/m_override.cpp
src/modules/m_safelist.cpp
src/modules/m_securelist.cpp
src/modules/m_shun.cpp
src/modules/m_silence.cpp
src/modules/m_spanningtree/admin.cpp
src/modules/m_spanningtree/cachetimer.cpp
src/modules/m_spanningtree/encap.cpp
src/modules/m_spanningtree/handshaketimer.cpp
src/modules/m_spanningtree/hmac.cpp
src/modules/m_spanningtree/main.cpp
src/modules/m_spanningtree/modules.cpp
src/modules/m_spanningtree/motd.cpp
src/modules/m_spanningtree/override_admin.cpp
src/modules/m_spanningtree/override_map.cpp
src/modules/m_spanningtree/override_modules.cpp
src/modules/m_spanningtree/override_motd.cpp
src/modules/m_spanningtree/override_squit.cpp
src/modules/m_spanningtree/override_stats.cpp
src/modules/m_spanningtree/override_time.cpp
src/modules/m_spanningtree/override_whois.cpp
src/modules/m_spanningtree/ping.cpp
src/modules/m_spanningtree/pong.cpp
src/modules/m_spanningtree/postcommand.cpp
src/modules/m_spanningtree/precommand.cpp
src/modules/m_spanningtree/push.cpp
src/modules/m_spanningtree/rconnect.cpp
src/modules/m_spanningtree/resolvers.cpp
src/modules/m_spanningtree/resolvers.h
src/modules/m_spanningtree/rsquit.cpp
src/modules/m_spanningtree/server.cpp
src/modules/m_spanningtree/stats.cpp
src/modules/m_spanningtree/svsjoin.cpp
src/modules/m_spanningtree/svsnick.cpp
src/modules/m_spanningtree/svspart.cpp
src/modules/m_spanningtree/time.cpp
src/modules/m_spanningtree/treeserver.cpp
src/modules/m_spanningtree/treesocket.h
src/modules/m_spanningtree/treesocket1.cpp
src/modules/m_spanningtree/treesocket2.cpp
src/modules/m_spanningtree/uid.cpp
src/modules/m_spanningtree/utils.cpp
src/modules/m_spanningtree/version.cpp
src/modules/m_spanningtree/whois.cpp
src/modules/m_spy.cpp
src/modules/m_tline.cpp
src/wildcard.cpp

index 85800f4da75736f6f1a0db6fc4231446c95de4db..12e22794dddc99edbf85036d8274fc3bcf5c02cc 100644 (file)
@@ -713,20 +713,21 @@ class CoreExport InspIRCd : public classbase
        void SendMode(const std::vector<std::string>& parameters, User *user);
 
        /** Match two strings using pattern matching, optionally, with a map
-        * to check case against (may be NULL).
+        * to check case against (may be NULL). If map is null, match will be case insensitive.
         * @param str The literal string to match against
         * @param mask The glob pattern to match against.
         */
-       static bool Match(const std::string &str, const std::string &mask, unsigned const char *map);
-       static bool Match(const  char *str, const char *mask, unsigned const char *map);
+       static bool Match(const std::string &str, const std::string &mask, unsigned const char *map = NULL);
+       static bool Match(const  char *str, const char *mask, unsigned const char *map = NULL);
 
        /** Match two strings using pattern matching, optionally, with a map
-        * to check case against (may be NULL). Supports CIDR patterns as well as globs.
+        * to check case against (may be NULL). If map is null, match will be case insensitive.
+        * Supports CIDR patterns as well as globs.
         * @param str The literal string to match against
         * @param mask The glob or CIDR pattern to match against.
         */
-       static bool MatchCIDR(const std::string &str, const std::string &mask, unsigned const char *map);
-       static bool MatchCIDR(const  char *str, const char *mask, unsigned const char *map);
+       static bool MatchCIDR(const std::string &str, const std::string &mask, unsigned const char *map = NULL);
+       static bool MatchCIDR(const  char *str, const char *mask, unsigned const char *map = NULL);
 
        /** Call the handler for a given command.
         * @param commandname The command whos handler you wish to call
index cad52fc12c4c578a6deda9806afe91428a158dcd..f98faefd5d97799ff6f303ef4db8932f8addae8d 100644 (file)
@@ -14,8 +14,6 @@
 #ifndef INSPIRCD_LISTMODE_PROVIDER
 #define INSPIRCD_LISTMODE_PROVIDER
 
-#include "wildcard.h"
-
 /** Get the time as a string
  */
 inline std::string stringtime()
@@ -284,7 +282,7 @@ class ListModeBase : public ModeHandler
 
                        for (limitlist::iterator it = chanlimits.begin(); it != chanlimits.end(); it++)
                        {
-                               if (match(channel->name, it->mask))
+                               if (InspIRCd::Match(channel->name, it->mask))
                                {
                                        // We have a pattern matching the channel...
                                        maxsize = el->size();
index 817854fa82f841e016e6dc8749af23976edea3fd..794aabcd263e4e0bf543b7f5c56197ec306046fe 100644 (file)
@@ -20,7 +20,6 @@
 #include "channels.h"
 #include "modules.h"
 #include "transport.h"
-#include "wildcard.h"
 
 /** Handle /FINGERPRINT
  */
@@ -104,7 +103,7 @@ class ModuleOperSSLCert : public Module
                std::string xhost;
                while (hl >> xhost)
                {
-                       if (match(host, xhost) || match(ip, xhost, true))
+                       if (InspIRCd::Match(host, xhost) || InspIRCd::MatchCIDR(ip, xhost))
                        {
                                return true;
                        }
index 82ac7c18e94ec66e798eb58f751ed1c3071d7da5..5c4e5072191c5473ebe8217f26bcefafaae6538c 100644 (file)
@@ -16,7 +16,6 @@
 #include "channels.h"
 #include "modules.h"
 #include "transport.h"
-#include "wildcard.h"
 #include "dns.h"
 
 /* $ModDesc: Provides /sslinfo command used to test who a mask matches */
index 28190cec994b45a7077a85bd4973562f9f0e2955..118c382876a77e7ccc37244695f1ef59670b8ec8 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "wildcard.h"
 
 /* $ModDesc: Provides aliases of commands. */
 
@@ -157,8 +156,15 @@ class ModuleAlias : public Module
                                /* Does it match the pattern? */
                                if (!Aliases[i].format.empty())
                                {
-                                       if (!match(Aliases[i].case_sensitive, compare, Aliases[i].format))
-                                               continue;
+                                       if (Aliases[i].case_sensitive)
+                                       {
+                                               if (InspIRCd::Match(compare, Aliases[i].format))
+                                                       continue;
+                                       }
+                                       else
+                                       {
+                                               throw "not implemented"; // XXX fixme
+                                       }
                                }
 
                                if ((Aliases[i].operonly) && (!IS_OPER(user)))
index 6cd99c73ea312d3f04dc11350e09bf5c9d2108ee..7ad8a1fdd5e5d3749edf6cfb795a85fef733cb4d 100644 (file)
@@ -13,7 +13,6 @@
 
 #include "inspircd.h"
 #include "u_listmode.h"
-#include "wildcard.h"
 
 /* $ModDesc: Provides support for the +e channel mode */
 /* $ModDep: ../../include/u_listmode.h */
@@ -78,7 +77,7 @@ public:
 
                                std::string maskptr = it->mask.substr(2);
 
-                               if (match(user->GetFullRealHost(), maskptr) || match(user->GetFullHost(), maskptr) || (match(mask, maskptr, true)))
+                               if (InspIRCd::Match(user->GetFullRealHost(), maskptr) || InspIRCd::Match(user->GetFullHost(), maskptr) || (InspIRCd::MatchCIDR(mask, maskptr)))
                                {
                                        // They match an entry on the list, so let them pass this.
                                        return 1;
@@ -104,7 +103,7 @@ public:
                                        continue;
 
                                std::string maskptr = it->mask.substr(2);
-                               if (match(str, maskptr))
+                               if (InspIRCd::Match(str, maskptr))
                                        return 1; // matches
                        }
                }
@@ -128,7 +127,7 @@ public:
                        std::string mask = std::string(user->nick) + "!" + user->ident + "@" + user->GetIPString();
                        for (modelist::iterator it = list->begin(); it != list->end(); it++)
                        {
-                               if (match(user->GetFullRealHost(), it->mask) || match(user->GetFullHost(), it->mask) || (match(mask, it->mask, true)))
+                               if (InspIRCd::Match(user->GetFullRealHost(), it->mask) || InspIRCd::Match(user->GetFullHost(), it->mask) || (InspIRCd::MatchCIDR(mask, it->mask)))
                                {
                                        // They match an entry on the list, so let them in.
                                        return 1;
@@ -170,7 +169,7 @@ public:
                                std::string mask = std::string(LM->user->nick) + "!" + LM->user->ident + "@" + LM->user->GetIPString();
                                for (modelist::iterator it = list->begin(); it != list->end(); it++)
                                {
-                                       if (match(LM->user->GetFullRealHost(), it->mask) || match(LM->user->GetFullHost(), it->mask) || (match(mask, it->mask, true)))
+                                       if (InspIRCd::Match(LM->user->GetFullRealHost(), it->mask) || InspIRCd::Match(LM->user->GetFullHost(), it->mask) || (InspIRCd::MatchCIDR(mask, it->mask)))
                                        {
                                                // They match an entry
                                                return (char*)it->mask.c_str();
index 80beaa450425da9c15138d2245294864e6224265..92c25e0bd7101009ce698659a2d0655d5270c5f6 100644 (file)
@@ -294,7 +294,7 @@ class ModuleBanRedirect : public Module
 
                                for(BanRedirectList::iterator redir = redirects->begin(); redir != redirects->end(); redir++)
                                {
-                                       if(ServerInstance->MatchText(user->GetFullRealHost(), redir->banmask) || ServerInstance->MatchText(user->GetFullHost(), redir->banmask) || ServerInstance->MatchText(ipmask, redir->banmask))
+                                       if(InspIRCd::Match(user->GetFullRealHost(), redir->banmask) || InspIRCd::Match(user->GetFullHost(), redir->banmask) || InspIRCd::MatchCIDR(ipmask, redir->banmask))
                                        {
                                                /* tell them they're banned and are being transferred */
                                                Channel* destchan = ServerInstance->FindChan(redir->targetchan);
index a9abb4b15d69a7a0885a48c7cab2806dbfa4875c..564702a16f4d7cc0ac957bf46984bbb7fea35edc 100644 (file)
@@ -68,7 +68,7 @@ class CommandWebirc : public Command
 
                        for(CGIHostlist::iterator iter = Hosts.begin(); iter != Hosts.end(); iter++)
                        {
-                               if(ServerInstance->MatchText(user->host, iter->hostmask) || ServerInstance->MatchText(user->GetIPString(), iter->hostmask))
+                               if(InspIRCd::Match(user->host, iter->hostmask) || InspIRCd::MatchCIDR(user->GetIPString(), iter->hostmask))
                                {
                                        if(iter->type == WEBIRC && parameters[0] == iter->password)
                                        {
@@ -262,7 +262,7 @@ public:
        {
                for(CGIHostlist::iterator iter = Hosts.begin(); iter != Hosts.end(); iter++)
                {
-                       if(ServerInstance->MatchText(user->host, iter->hostmask) || ServerInstance->MatchText(user->GetIPString(), iter->hostmask))
+                       if(InspIRCd::Match(user->host, iter->hostmask) || InspIRCd::MatchCIDR(user->GetIPString(), iter->hostmask))
                        {
                                // Deal with it...
                                if(iter->type == PASS)
index ac9e8f2ac100a44dcb1522b9e0430e59998baaf4..4fd7da90ac0536ab32bec5f46a86008ef96d1a68 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "wildcard.h"
 
 /* $ModDesc: Provides the /check command to retrieve information on a user, channel, or IP address */
 
@@ -131,13 +130,13 @@ class CommandCheck : public Command
                        /* hostname or other */
                        for (user_hash::const_iterator a = ServerInstance->Users->clientlist->begin(); a != ServerInstance->Users->clientlist->end(); a++)
                        {
-                               if (match(a->second->host, parameters[0]) || match(a->second->dhost, parameters[0]))
+                               if (InspIRCd::Match(a->second->host, parameters[0]) || InspIRCd::Match(a->second->dhost, parameters[0]))
                                {
                                        /* host or vhost matches mask */
                                        user->WriteServ(checkstr + " match " + ConvToStr(++x) + " " + a->second->GetFullRealHost());
                                }
                                /* IP address */
-                               else if (match(a->second->GetIPString(), parameters[0], true))
+                               else if (InspIRCd::MatchCIDR(a->second->GetIPString(), parameters[0]))
                                {
                                        /* same IP. */
                                        user->WriteServ(checkstr + " match " + ConvToStr(++x) + " " + a->second->GetFullRealHost());
index 64ba71d95ffc26a9621458a95b22bbe1bb194eea..f5b3d08da3a99f40f8643f486f99f8ced90ab4fb 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "wildcard.h"
 #include "m_hash.h"
 
 /* $ModDesc: Provides masking of user hostnames */
@@ -314,7 +313,7 @@ class ModuleCloaking : public Module
                        snprintf(mask, MAXBUF, "%s!%s@%s", user->nick.c_str(), user->ident.c_str(), tofree->c_str());
                        for (BanList::iterator i = chan->bans.begin(); i != chan->bans.end(); i++)
                        {
-                               if (match(mask,i->data))
+                               if (InspIRCd::Match(mask,i->data))
                                        return -1;
                        }
                }
index 82bdf55500ffb46a23c116c17f50d21ad55c6b0d..097227d39bd55f957b1abab681d3aa9e430516a1 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "wildcard.h"
 
 /* $ModDesc: Provides the /clones command to retrieve information on clones. */
 
index 2489f2a1f3166298627992041c495fc27f600061..097f8c8d6595d77f9ea66eae6e547504c625c9c1 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "wildcard.h"
 
 /* $ModDesc: Sets (and unsets) modes on users when they connect */
 
@@ -64,7 +63,7 @@ class ModuleModesOnConnect : public Module
                {
                        std::string hostn = Conf->ReadValue("connect","allow",j);
                        /* XXX: Fixme: does not respect port, limit, etc */
-                       if ((match(user->GetIPString(),hostn,true)) || (match(user->host,hostn)))
+                       if ((InspIRCd::MatchCIDR(user->GetIPString(),hostn)) || (InspIRCd::Match(user->host,hostn)))
                        {
                                std::string ThisModes = Conf->ReadValue("connect","modes",j);
                                if (!ThisModes.empty())
index 0023ab6dcbae225c3b763c53e4dd28df1ca48b37..85f0972377b42911979cf2b0e539ddd4314c0456 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "wildcard.h"
 
 /* $ModDesc: Provides the TITLE command which allows setting of CUSTOM WHOIS TITLE line */
 
@@ -34,7 +33,7 @@ class CommandTitle : public Command
                std::string xhost;
                while (hl >> xhost)
                {
-                       if (match(host, xhost) || match(ip,xhost, true))
+                       if (InspIRCd::Match(host, xhost) || InspIRCd::MatchCIDR(ip,xhost))
                        {
                                return true;
                        }
index 76658f454291650d561599bcd0080e0c060c8d47..738567ff716473cea9cb73cd89c0fe2e1d162da9 100644 (file)
@@ -139,7 +139,7 @@ class CommandDccallow : public Command
                                                        user->WriteNumeric(996, "%s %s :%s is already on your DCCALLOW list", user->nick.c_str(), user->nick.c_str(), target->nick.c_str());
                                                        return CMD_FAILURE;
                                                }
-                                               else if (ServerInstance->MatchText(user->GetFullHost(), k->hostmask))
+                                               else if (InspIRCd::Match(user->GetFullHost(), k->hostmask))
                                                {
                                                        user->WriteNumeric(996, "%s %s :You cannot add yourself to your own DCCALLOW list!", user->nick.c_str(), user->nick.c_str());
                                                        return CMD_FAILURE;
@@ -312,7 +312,7 @@ class ModuleDCCAllow : public Module
                                        if (u->GetExt("dccallow_list", dl) && dl->size())
                                        {
                                                for (dccallowlist::const_iterator iter = dl->begin(); iter != dl->end(); ++iter)
-                                                       if (ServerInstance->MatchText(user->GetFullHost(), iter->hostmask))
+                                                       if (InspIRCd::Match(user->GetFullHost(), iter->hostmask))
                                                                return 0;
                                        }
 
@@ -338,7 +338,7 @@ class ModuleDCCAllow : public Module
 
                                                for (unsigned int i = 0; i < bfl.size(); i++)
                                                {
-                                                       if (ServerInstance->MatchText(filename, bfl[i].filemask))
+                                                       if (InspIRCd::Match(filename, bfl[i].filemask))
                                                        {
                                                                if (bfl[i].action == "allow")
                                                                        return 0;
index 2717d873a90ca4e56adef6b9dd58521794e21185..45c9cbcd6a274929a1d713a763eb703e6c337646 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "wildcard.h"
 
 /* $ModDesc: Implements config tags which allow blocking of joins to channels */
 
@@ -54,12 +53,12 @@ class ModuleDenyChannels : public Module
 
                                for (int j =0; j < Conf->Enumerate("badchan"); j++)
                                {
-                                       if (match(redirect, Conf->ReadValue("badchan","name",j)))
+                                       if (InspIRCd::Match(redirect, Conf->ReadValue("badchan","name",j)))
                                        {
                                                bool goodchan = false;
                                                for (int k =0; k < Conf->Enumerate("goodchan"); k++)
                                                {
-                                                       if (match(redirect, Conf->ReadValue("goodchan","name",k)))
+                                                       if (InspIRCd::Match(redirect, Conf->ReadValue("goodchan","name",k)))
                                                                goodchan = true;
                                                }
 
@@ -91,7 +90,7 @@ class ModuleDenyChannels : public Module
        {
                for (int j =0; j < Conf->Enumerate("badchan"); j++)
                {
-                       if (match(cname, Conf->ReadValue("badchan","name",j)))
+                       if (InspIRCd::Match(cname, Conf->ReadValue("badchan","name",j)))
                        {
                                if (IS_OPER(user) && Conf->ReadFlag("badchan","allowopers",j))
                                {
@@ -104,7 +103,7 @@ class ModuleDenyChannels : public Module
 
                                        for (int i = 0; i < Conf->Enumerate("goodchan"); i++)
                                        {
-                                               if (match(cname, Conf->ReadValue("goodchan", "name", i)))
+                                               if (InspIRCd::Match(cname, Conf->ReadValue("goodchan", "name", i)))
                                                {
                                                        return 0;
                                                }
index 3609d0d1019352e3925992533c060cc4cb827c9d..480d9975ad12799d30d18e80c1f6da906237fc62 100644 (file)
@@ -45,7 +45,7 @@ class ModuleFilter : public FilterBase
                        if (!FilterBase::AppliesToMe(user, index->second, iflags))
                                continue;
 
-                       if (ServerInstance->MatchText(text,index->first))
+                       if (InspIRCd::Match(text,index->first))
                        {
                                FilterResult* fr = index->second;
                                if (index != filters.begin())
index d24f23aa9d549ff9913ca28ba7006f2f77aaa020..a900083e1f50810495ba9338c7e29fea24565665 100644 (file)
@@ -31,7 +31,7 @@ class CommandGloadmodule : public Command
        {
                std::string servername = parameters.size() > 1 ? parameters[1] : "*";
 
-               if (ServerInstance->MatchText(ServerInstance->Config->ServerName, servername))
+               if (InspIRCd::Match(ServerInstance->Config->ServerName, servername))
                {
                        if (ServerInstance->Modules->Load(parameters[0].c_str()))
                        {
@@ -65,7 +65,7 @@ class CommandGunloadmodule : public Command
        {
                std::string servername = parameters.size() > 1 ? parameters[1] : "*";
 
-               if (ServerInstance->MatchText(ServerInstance->Config->ServerName, servername))
+               if (InspIRCd::Match(ServerInstance->Config->ServerName, servername))
                {
                        if (ServerInstance->Modules->Unload(parameters[0].c_str()))
                        {
@@ -99,7 +99,7 @@ class CommandGreloadmodule : public Command
        {
                std::string servername = parameters.size() > 1 ? parameters[1] : "*";
 
-               if (ServerInstance->MatchText(ServerInstance->Config->ServerName, servername))
+               if (InspIRCd::Match(ServerInstance->Config->ServerName, servername))
                {
                        if (!ServerInstance->Modules->Unload(parameters[0].c_str()))
                        {
index 95c40d65e27037ebe1da5c71adddaa1b7673788f..3d4dde887575afe646e28f1a578f8240b0453931 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "wildcard.h"
 
 /* $ModDesc: Provides masking of user hostnames in a different way to m_cloaking */
 
@@ -97,7 +96,7 @@ class ModuleHostChange : public Module
        {
                for (hostchanges_t::iterator i = hostchanges.begin(); i != hostchanges.end(); i++)
                {
-                       if (((match(user->MakeHost(), i->first, true)) || (match(user->MakeHostIP(), i->first))))
+                       if (((InspIRCd::MatchCIDR(user->MakeHost(), i->first)) || (InspIRCd::MatchCIDR(user->MakeHostIP(), i->first))))
                        {
                                Host* h = i->second;
 
index 0aa4628180b5a705def7a1796ebe1f8b695d2ece..0258deba960924b0b557ed9774b5503946c84d2b 100644 (file)
@@ -14,7 +14,6 @@
 #include "inspircd.h"
 #include "httpd.h"
 #include "protocol.h"
-#include "wildcard.h"
 
 /* $ModDesc: Provides access control lists (passwording of resources, ip restrictions etc) to m_httpd.so dependent modules */
 /* $ModDep: httpd.h */
@@ -173,7 +172,7 @@ class ModuleHTTPAccessList : public Module
 
                        for (std::vector<HTTPACL>::const_iterator this_acl = acl_list.begin(); this_acl != acl_list.end(); ++this_acl)
                        {
-                               if (match(http->GetURI(), this_acl->path))
+                               if (InspIRCd::Match(http->GetURI(), this_acl->path))
                                {
                                        if (!this_acl->blacklist.empty())
                                        {
@@ -183,7 +182,7 @@ class ModuleHTTPAccessList : public Module
 
                                                while (sep.GetToken(entry))
                                                {
-                                                       if (match(http->GetIP(), entry))
+                                                       if (InspIRCd::Match(http->GetIP(), entry))
                                                        {
                                                                ServerInstance->Logs->Log("m_httpd_acl", DEBUG, "Denying access to blacklisted resource %s (matched by pattern %s) from ip %s (matched by entry %s)",
                                                                                http->GetURI().c_str(), this_acl->path.c_str(), http->GetIP().c_str(), entry.c_str());
@@ -201,7 +200,7 @@ class ModuleHTTPAccessList : public Module
 
                                                while (sep.GetToken(entry))
                                                {
-                                                       if (match(http->GetIP(), entry))
+                                                       if (InspIRCd::Match(http->GetIP(), entry))
                                                                allow_access = true;
                                                }
 
index 98b1ab55e9a96fee7fe5379a20890bc56ed69bfd..3ea1c83fc62e5eae0c6d4b6c80f7b4e0ef317dae 100644 (file)
@@ -69,7 +69,7 @@ public:
                                std::string mask = std::string(user->nick) + "!" + user->ident + "@" + user->GetIPString();
                                for (modelist::iterator it = list->begin(); it != list->end(); it++)
                                {
-                                       if(match(user->GetFullRealHost(), it->mask) || match(user->GetFullHost(), it->mask) || (match(mask, it->mask, true)))
+                                       if(InspIRCd::Match(user->GetFullRealHost(), it->mask) || InspIRCd::Match(user->GetFullHost(), it->mask) || (InspIRCd::MatchCIDR(mask, it->mask)))
                                        {
                                                // They match an entry on the list, so let them in.
                                                return 1;
@@ -94,7 +94,7 @@ public:
                                std::string mask = std::string(LM->user->nick) + "!" + LM->user->ident + "@" + LM->user->GetIPString();
                                for (modelist::iterator it = list->begin(); it != list->end(); it++)
                                {
-                                       if (match(LM->user->GetFullRealHost(), it->mask) || match(LM->user->GetFullHost(), it->mask.c_str()) || (match(mask, it->mask, true)))
+                                       if (InspIRCd::Match(LM->user->GetFullRealHost(), it->mask) || InspIRCd::Match(LM->user->GetFullHost(), it->mask.c_str()) || (InspIRCd::MatchCIDR(mask, it->mask)))
                                        {
                                                // They match an entry
                                                return (char*)it->mask.c_str();
index 8d01833d6cc846dcb3431ddad3b73365c72baeba..9e2cbd71999a8676ed5109cf46752f535522a122 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "wildcard.h"
 
 /* $ModDesc: Provides support for unreal-style oper-override */
 
index f719b9e878e3317a0b98c66ef396c60b14ceec01..eb47e329e479225a8954d42117eb8e9d544a057e 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "wildcard.h"
 
 /** Holds a users m_safelist state
  */
@@ -185,7 +184,7 @@ class ModuleSafeList : public Module
 
                                if ((chan) && (chan->modes[CM_PRIVATE]) && (!IS_OPER(user)))
                                {
-                                       bool display = (match(chan->name, ld->glob) || (!chan->topic.empty() && match(chan->topic, ld->glob)));
+                                       bool display = (InspIRCd::Match(chan->name, ld->glob) || (!chan->topic.empty() && InspIRCd::Match(chan->topic, ld->glob)));
                                        if ((users) && (display))
                                        {
                                                int counter = snprintf(buffer, MAXBUF, "322 %s * %ld :", user->nick.c_str(), users);
@@ -195,7 +194,7 @@ class ModuleSafeList : public Module
                                }
                                else if ((chan) && ((((!(chan->IsModeSet('p'))) && (!(chan->IsModeSet('s'))))) || (has_user) || IS_OPER(user)))
                                {
-                                       bool display = (match(chan->name, ld->glob) || (!chan->topic.empty() && match(chan->topic, ld->glob)));
+                                       bool display = (InspIRCd::Match(chan->name, ld->glob) || (!chan->topic.empty() && InspIRCd::Match(chan->topic, ld->glob)));
                                        if ((users) && (display))
                                        {
                                                int counter = snprintf(buffer, MAXBUF, "322 %s %s %ld :[+%s] %s", user->nick.c_str(), chan->name.c_str(), users, chan->ChanModes(has_user || IS_OPER(user)), chan->topic.c_str());
index 0d04a13ae17b3c136667621a9f801263deabb91c..d40904d6129f392128fcd157904e33ceeccba5ad 100644 (file)
@@ -64,7 +64,7 @@ class ModuleSecureList : public Module
                {
                        /* Normally wouldnt be allowed here, are they exempt? */
                        for (std::vector<std::string>::iterator x = allowlist.begin(); x != allowlist.end(); x++)
-                               if (ServerInstance->MatchText(user->MakeHost(), *x))
+                               if (InspIRCd::Match(user->MakeHost(), *x))
                                        return 0;
 
                        /* Not exempt, BOOK EM DANNO! */
index bdf990313098ac615d1f45a657d54a8c56c0c68d..b4cdfac72cdd86ef69045e4b65a516a5ebf72440 100644 (file)
@@ -19,7 +19,7 @@ public:
 
        bool Matches(User *u)
        {
-               if (ServerInstance->MatchText(u->GetFullHost(), matchtext) || ServerInstance->MatchText(u->GetFullRealHost(), matchtext))
+               if (InspIRCd::Match(u->GetFullHost(), matchtext) || InspIRCd::Match(u->GetFullRealHost(), matchtext))
                        return true;
 
                return false;
index cdd968212395a9852e0aa007e54b28ad6ed20723..eae8675a8509215cc0bf70994621fa72bbb9df42 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "wildcard.h"
 
 /* $ModDesc: Provides support for the /SILENCE command */
 
@@ -391,7 +390,7 @@ class ModuleSilence : public Module
                {
                        for (silencelist::const_iterator c = sl->begin(); c != sl->end(); c++)
                        {
-                               if (((((c->second & pattern) > 0)) || ((c->second & SILENCE_ALL) > 0)) && (ServerInstance->MatchText(source->GetFullHost(), c->first)))
+                               if (((((c->second & pattern) > 0)) || ((c->second & SILENCE_ALL) > 0)) && (InspIRCd::Match(source->GetFullHost(), c->first)))
                                        return !(((c->second & SILENCE_EXCLUDE) > 0));
                        }
                }
index 0faff3d57d0fd406d065e66f446c5eec2be03b93..a034d7f52799cee6f3a37a05f678bf631801f0a1 100644 (file)
@@ -25,7 +25,7 @@ bool TreeSocket::Admin(const std::string &prefix, std::deque<std::string> &param
 {
        if (params.size() > 0)
        {
-               if (this->Instance->MatchText(this->Instance->Config->ServerName, params[0]))
+               if (InspIRCd::Match(this->Instance->Config->ServerName, params[0]))
                {
                        /* It's for our server */
                        string_list results;
index 71214dcfaa296178dc007dd5115fa87ca31d8e99..97b9b3b4faf8606f17a12196ceeeff8fc41e6928 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
index 9335c0c7f235940c6e0123e871dc8e512f82d62f..02233e91678cc51db1bcadec52ca1d49d7742b25 100644 (file)
@@ -27,7 +27,7 @@ bool TreeSocket::Encap(const std::string &prefix, std::deque<std::string> &param
 {
        if (params.size() > 1)
        {
-               if (Instance->MatchText(Instance->Config->GetSID(), params[0]))
+               if (InspIRCd::Match(Instance->Config->GetSID(), params[0]))
                {
                        Event event((char*) &params, (Module*)this->Utils->Creator, "encap_received");
                        event.Send(Instance);
index c1e36df38c05b117ad4ab558163a5033137b8b63..44938bafa5c570259547e89e34270de44d9e8a61 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
index 7744ab217ea226cdbba4c97b0e1df04ce4ce2697..418a64724bc7fbcac3b7e8966e0b94471d581064 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "m_hash.h"
index 7085d501d263d149fb03c6dc4830d26583e2cbb0..423400c3dbd8dc5cce7c989cdc32db9ee25e4463 100644 (file)
@@ -17,7 +17,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
@@ -402,7 +401,7 @@ int ModuleSpanningTree::HandleConnect(const std::vector<std::string>& parameters
 {
        for (std::vector<Link>::iterator x = Utils->LinkBlocks.begin(); x < Utils->LinkBlocks.end(); x++)
        {
-               if (ServerInstance->MatchText(x->Name.c_str(),parameters[0]))
+               if (InspIRCd::Match(x->Name.c_str(),parameters[0]))
                {
                        TreeServer* CheckDupe = Utils->FindServer(x->Name.c_str());
                        if (!CheckDupe)
index 17321c5fdf95ac9ce095d1713c189461a06c5641..71cd930415b0b1730ac17ab261fba0cb6ce7a2cd 100644 (file)
@@ -26,7 +26,7 @@ bool TreeSocket::Modules(const std::string &prefix, std::deque<std::string> &par
        if (params.empty())
                return true;
 
-       if (!this->Instance->MatchText(this->Instance->Config->ServerName, params[0]))
+       if (!InspIRCd::Match(this->Instance->Config->ServerName, params[0]))
        {
                /* Pass it on, not for us */
                Utils->DoOneToOne(prefix, "MODULES", params, params[0]);
index 517d4b48c01b7f8ef6756e7c6085156a6cd66e10..6ec09c5fd2a574673982da5b9a0321de89f51ae5 100644 (file)
@@ -27,7 +27,7 @@ bool TreeSocket::Motd(const std::string &prefix, std::deque<std::string> &params
 {
        if (params.size() > 0)
        {
-               if (this->Instance->MatchText(this->Instance->Config->ServerName, params[0]))
+               if (InspIRCd::Match(this->Instance->Config->ServerName, params[0]))
                {
                        /* It's for our server */
                        string_list results;
index 3a4aa2a1fb6ec5430984cbd6a9abbfebd82dca82..46d030c0665b61853794fc5b3e4fd1519edada29 100644 (file)
@@ -17,7 +17,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
@@ -32,7 +31,7 @@ int ModuleSpanningTree::HandleAdmin(const std::vector<std::string>& parameters,
 {
        if (parameters.size() > 0)
        {
-               if (match(ServerInstance->Config->ServerName, parameters[0]))
+               if (InspIRCd::Match(ServerInstance->Config->ServerName, parameters[0]))
                        return 0;
 
                /* Remote ADMIN, the server is within the 1st parameter */
index 48050b7af61eb726caf7dad2d63b24b485fa3678..cccfad4dc5ac2094e8b216f1e51a660a1122e3a0 100644 (file)
@@ -14,7 +14,6 @@
 /* $ModDesc: Provides a spanning tree server link protocol */
 
 #include "inspircd.h"
-#include "wildcard.h"
 
 #include "m_spanningtree/main.h"
 #include "m_spanningtree/utils.h"
index 1d33d104e6d8091fcba8cf3ceda8b576a43426fd..b824612ff7975f1a393498f138f85f672c76a3e4 100644 (file)
@@ -17,7 +17,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
@@ -32,7 +31,7 @@ int ModuleSpanningTree::HandleModules(const std::vector<std::string>& parameters
 {
        if (parameters.size() > 0)
        {
-               if (match(ServerInstance->Config->ServerName, parameters[0]))
+               if (InspIRCd::Match(ServerInstance->Config->ServerName, parameters[0]))
                        return 0;
 
                std::deque<std::string> params;
index e689be1f7ca56048cb51634cd0b6bb502dcf67db..0ed8417fafa8f9e00134106c21dacabf7294e9b8 100644 (file)
@@ -17,7 +17,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
@@ -32,7 +31,7 @@ int ModuleSpanningTree::HandleMotd(const std::vector<std::string>& parameters, U
 {
        if (parameters.size() > 0)
        {
-               if (match(ServerInstance->Config->ServerName, parameters[0]))
+               if (InspIRCd::Match(ServerInstance->Config->ServerName, parameters[0]))
                        return 0;
 
                /* Remote MOTD, the server is within the 1st parameter */
index 812424c81d686faa71203ab0b8dbe442fb4e83bb..d73408a45fb1474b3a493adb1f1ec9d341144b33 100644 (file)
@@ -17,7 +17,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
index d6ae89e4d8e1103a15e5a905c7abb5be0f82f256..2b1b5660c8b0f539df24889cc203d862556b1e95 100644 (file)
@@ -17,7 +17,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
@@ -33,7 +32,7 @@ int ModuleSpanningTree::HandleStats(const std::vector<std::string>& parameters,
 {
        if (parameters.size() > 1)
        {
-               if (match(ServerInstance->Config->ServerName, parameters[1]))
+               if (InspIRCd::Match(ServerInstance->Config->ServerName, parameters[1]))
                        return 0;
 
                /* Remote STATS, the server is within the 2nd parameter */
index 882607161acd0a8dbdf329744b064b0c92eed7de..cb7850047f6b4af5a8c2252396c0728c07d7b455 100644 (file)
@@ -17,7 +17,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
index d10298348b45944b11b675a4e0eee512cc486530..25af17620c55fbd4eb50ffd4f982c3a729beb9c1 100644 (file)
@@ -17,7 +17,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
index a4a188665b445058d7420cb1c7dc0e71e6967499..b884305b2330d09871b8b46d63cdba6ef1f80c54 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "socketengine.h"
index e9bed25b82b153b0dd47f949cdf474614e4279f9..8e21f5a3eb5e2e28a2f5c35a7e73ffb3b0131b05 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "socketengine.h"
index 37109a79d30daa3b31f06f8c07bdfadac102fb19..fa65e742e2da7a85669dc0adda73935edfe83249 100644 (file)
@@ -17,7 +17,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
index beffba6e946a4095c7c9f85843c49837396547c8..6a78e6c880825f4c89d7eee82d353068971f6607 100644 (file)
@@ -17,7 +17,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
index 460cb71dbec26fb36206b7bbdea38c2051de42f5..b2fc045f0f6052a3b08801bef199abfe79762a33 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "socketengine.h"
index 3e514563d027690f4c9a3191ac53c51d34afa978..7fbbf4d58d4389295a8356d53881efdab2275466 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
@@ -48,7 +47,7 @@ CmdResult cmd_rconnect::Handle (const std::vector<std::string>& parameters, User
        }
 
        /* Is this aimed at our server? */
-       if (ServerInstance->MatchText(ServerInstance->Config->ServerName,parameters[0]))
+       if (InspIRCd::Match(ServerInstance->Config->ServerName,parameters[0]))
        {
                /* Yes, initiate the given connect */
                ServerInstance->SNO->WriteToSnoMask('l',"Remote CONNECT from %s matching \002%s\002, connecting server \002%s\002",user->nick.c_str(),parameters[0].c_str(),parameters[1].c_str());
index 1673a02deaab6eb2e793641a0620e7e0bb6dfb8f..3ea6e2bdf1b0b0e0ff3a9bf5b6da4113a0191901 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
index 54fd9c4815ea54ce294ab2b04576a38d6d246107..552815ac04159bf5cf3f0f6479a41d445a4c52ab 100644 (file)
@@ -18,7 +18,6 @@
 #include "commands/cmd_stats.h"
 #include "socket.h"
 #include "inspircd.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
index 1b798deb7ee927f25832a81e8c3b2ab68220edc8..5407189b3be68af0e7fb8f6c6e3178855be81d45 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
index 40e12b03a1302b5ffb02c0bff09a0cc4656ebe87..0ff0e30f62f3485a8478616045465a77dc6c87df 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "socketengine.h"
index 9ac255c37635cbf5079327384c15ad8179fc84dd..8d74a8bbfa7a53da15ebd10169e4bbb8a07e7245 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "socketengine.h"
@@ -35,7 +34,7 @@ bool TreeSocket::Stats(const std::string &prefix, std::deque<std::string> &param
         */
        if (params.size() > 1)
        {
-               if (this->Instance->MatchText(this->Instance->Config->ServerName, params[1]))
+               if (InspIRCd::Match(this->Instance->Config->ServerName, params[1]))
                {
                        /* It's for our server */
                        string_list results;
index 276138200303e57b78ea36a389988ef1b1782f25..d3c47f47bec8780d94e0f3fc0818ffa9f11f8e3a 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "socketengine.h"
index b2cd67128ec624512b5bd00017f868b809df15fb..ef57f6dbb6440b6220069df4dda0e6ff847afc9e 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "socketengine.h"
index c3bc1b081da4c4436078eb2008c0cdf1e9f8c6e6..95d1a1c2337a86eb226afbca6837c016a3fd608b 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "socketengine.h"
index 85377a4784001862b967ccfed46bc5dba18bbfdf..eb90eab8d50290ba96420cac355076c0f6049259 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "socketengine.h"
index 0b21a462d54b5ebdd73a04235b98ec40df5792d5..c3167b9b31a8bd9499901ccda8db398dc752c9a1 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
index fef7b107bf1c8a42701276920e771c2b9aa4c11e..fb0fe1c3173a85eec088b16cdc3a041e5dde0f7c 100644 (file)
@@ -18,7 +18,6 @@
 #include "commands/cmd_stats.h"
 #include "socket.h"
 #include "inspircd.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 
index 3e9558e830b8e43bea616682c898087ad918376e..1f0288a66c65dcf348753ac79486918332f2dceb 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "m_hash.h"
index 6f66598d949fdf5a7554762ead3785e74260c2b4..5b3ace4d4a1134c33aaa490467a5088f44cf47a2 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "socketengine.h"
index ce7718324639d2d058f746d823a9180e30eab4a7..2ebceb3cf97b5e3887b434a2f540579b52235841 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "m_hash.h"
index 5e1d226abc54edb6c2f7aee40b74daf5884dc449..2b72d581c39e6d56c188af5fec68f43a8cefe101 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "socketengine.h"
@@ -91,7 +90,7 @@ TreeServer* SpanningTreeUtilities::FindServerMask(const std::string &ServerName)
 {
        for (server_hash::iterator i = serverlist.begin(); i != serverlist.end(); i++)
        {
-               if (match(i->first,ServerName))
+               if (InspIRCd::Match(i->first,ServerName))
                        return i->second;
        }
        return NULL;
@@ -630,7 +629,7 @@ Link* SpanningTreeUtilities::FindLink(const std::string& name)
 {
        for (std::vector<Link>::iterator x = LinkBlocks.begin(); x < LinkBlocks.end(); x++)
        {
-               if (ServerInstance->MatchText(x->Name.c_str(), name.c_str()))
+               if (InspIRCd::Match(x->Name.c_str(), name.c_str()))
                {
                        return &(*x);
                }
index 5271be1d384f40eeff0c530d4b6fee9dc14017f0..e2129d884cb3d0b774c12ab345edd5bca969cee2 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "socketengine.h"
index 1763f427a60e5c926bd176c3f908ac77b6340812..b38f25a3820d6a30335eb60e5a454f71fb2256d1 100644 (file)
@@ -15,7 +15,6 @@
 #include "commands/cmd_whois.h"
 #include "commands/cmd_stats.h"
 #include "socket.h"
-#include "wildcard.h"
 #include "xline.h"
 #include "transport.h"
 #include "socketengine.h"
index c43cee9566676abe0e7030a73f25ea27a2f73504..193d22234b4397b44020fcc3d4bbcfab7b8cc537 100644 (file)
@@ -14,7 +14,6 @@
 /* $ModDesc: Provides the ability to see the complete names list of channels an oper is not a member of */
 
 #include "inspircd.h"
-#include "wildcard.h"
 
 class ModuleSpy : public Module
 {
index 31bd67e1716813641164aea6b451164f7e324a6f..c249f3b3ba7f5ba8ad05bf8beac92b904822ab07 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "wildcard.h"
 
 /* $ModDesc: Provides /tline command used to test who a mask matches */
 
@@ -37,7 +36,7 @@ class CommandTline : public Command
                for (user_hash::const_iterator u = ServerInstance->Users->clientlist->begin(); u != ServerInstance->Users->clientlist->end(); u++)
                {
                        n_counted++;
-                       if (match(u->second->GetFullRealHost(),parameters[0]))
+                       if (InspIRCd::Match(u->second->GetFullRealHost(),parameters[0]))
                        {
                                n_matched++;
                                n_match_host++;
@@ -45,7 +44,7 @@ class CommandTline : public Command
                        else
                        {
                                std::string host = std::string(u->second->ident) + "@" + u->second->GetIPString();
-                               if (match(host, parameters[0], true))
+                               if (InspIRCd::MatchCIDR(host, parameters[0]))
                                {
                                        n_matched++;
                                        n_match_ip++;
index 199b439653d11306a78722704795915c6eefd5c4..e717b0ad4d5ec4384748376f8c1ea7bd5a5b3ae7 100644 (file)
@@ -28,21 +28,14 @@ static bool match_internal(const unsigned char *str, const unsigned char *mask,
        const unsigned char *cp = NULL;
        const unsigned char *mp = NULL;
 
+       if (!map)
+               map = lowermap; // default to case insensitive search
+
        while ((*string) && (*wild != '*'))
        {
-               if (!map)
+               if (map[*wild] != map[*string] && (*wild != '?'))
                {
-                       if ((*wild != *string) && (*wild != '?'))
-                       {
-                               return false;
-                       }
-               }
-               else
-               {
-                       if (map[*wild] != map[*string] && (*wild != '?'))
-                       {
-                               return false;
-                       }
+                       return false;
                }
 
                ++wild;
@@ -61,10 +54,9 @@ static bool match_internal(const unsigned char *str, const unsigned char *mask,
                        mp = wild;
                        cp = string+1;
                }
-               // if there is no charmap and str == wild OR
-               // there is a map and mapped char == mapped wild AND
-               // wild is NOT ?
-               else if (((!map && *wild == *string) || (map && map[*wild] == map[*string])) && (*wild == '?'))
+
+               // if mapped char == mapped wild AND wild is NOT ?
+               else if (map[*wild] == map[*string] && (*wild == '?'))
                {
                        ++wild;
                        ++string;