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
#ifndef INSPIRCD_LISTMODE_PROVIDER
#define INSPIRCD_LISTMODE_PROVIDER
-#include "wildcard.h"
-
/** Get the time as a string
*/
inline std::string stringtime()
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();
#include "channels.h"
#include "modules.h"
#include "transport.h"
-#include "wildcard.h"
/** Handle /FINGERPRINT
*/
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;
}
#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 */
*/
#include "inspircd.h"
-#include "wildcard.h"
/* $ModDesc: Provides aliases of commands. */
/* 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)))
#include "inspircd.h"
#include "u_listmode.h"
-#include "wildcard.h"
/* $ModDesc: Provides support for the +e channel mode */
/* $ModDep: ../../include/u_listmode.h */
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;
continue;
std::string maskptr = it->mask.substr(2);
- if (match(str, maskptr))
+ if (InspIRCd::Match(str, maskptr))
return 1; // matches
}
}
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;
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();
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);
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)
{
{
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)
*/
#include "inspircd.h"
-#include "wildcard.h"
/* $ModDesc: Provides the /check command to retrieve information on a user, channel, or IP address */
/* 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());
*/
#include "inspircd.h"
-#include "wildcard.h"
#include "m_hash.h"
/* $ModDesc: Provides masking of user hostnames */
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;
}
}
*/
#include "inspircd.h"
-#include "wildcard.h"
/* $ModDesc: Provides the /clones command to retrieve information on clones. */
*/
#include "inspircd.h"
-#include "wildcard.h"
/* $ModDesc: Sets (and unsets) modes on users when they connect */
{
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())
*/
#include "inspircd.h"
-#include "wildcard.h"
/* $ModDesc: Provides the TITLE command which allows setting of CUSTOM WHOIS TITLE line */
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;
}
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;
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;
}
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;
*/
#include "inspircd.h"
-#include "wildcard.h"
/* $ModDesc: Implements config tags which allow blocking of joins to channels */
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;
}
{
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))
{
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;
}
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())
{
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()))
{
{
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()))
{
{
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()))
{
*/
#include "inspircd.h"
-#include "wildcard.h"
/* $ModDesc: Provides masking of user hostnames in a different way to m_cloaking */
{
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;
#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 */
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())
{
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());
while (sep.GetToken(entry))
{
- if (match(http->GetIP(), entry))
+ if (InspIRCd::Match(http->GetIP(), entry))
allow_access = true;
}
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;
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();
*/
#include "inspircd.h"
-#include "wildcard.h"
/* $ModDesc: Provides support for unreal-style oper-override */
*/
#include "inspircd.h"
-#include "wildcard.h"
/** Holds a users m_safelist state
*/
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);
}
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());
{
/* 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! */
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;
*/
#include "inspircd.h"
-#include "wildcard.h"
/* $ModDesc: Provides support for the /SILENCE command */
{
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));
}
}
{
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;
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
{
if (params.size() > 1)
{
- if (Instance->MatchText(Instance->Config->GetSID(), params[0]))
+ if (InspIRCd::Match(Instance->Config->GetSID(), params[0]))
{
Event event((char*) ¶ms, (Module*)this->Utils->Creator, "encap_received");
event.Send(Instance);
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
#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"
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
{
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)
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]);
{
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;
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
{
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 */
/* $ModDesc: Provides a spanning tree server link protocol */
#include "inspircd.h"
-#include "wildcard.h"
#include "m_spanningtree/main.h"
#include "m_spanningtree/utils.h"
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
{
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;
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
{
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 */
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
{
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 */
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
#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"
#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"
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
#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"
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
}
/* 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());
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
#include "commands/cmd_stats.h"
#include "socket.h"
#include "inspircd.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
#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"
#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"
*/
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;
#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"
#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"
#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"
#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"
#include "commands/cmd_whois.h"
#include "commands/cmd_stats.h"
#include "socket.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
#include "commands/cmd_stats.h"
#include "socket.h"
#include "inspircd.h"
-#include "wildcard.h"
#include "xline.h"
#include "transport.h"
#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"
#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"
#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"
#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"
{
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;
{
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);
}
#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"
#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"
/* $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
{
*/
#include "inspircd.h"
-#include "wildcard.h"
/* $ModDesc: Provides /tline command used to test who a mask matches */
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++;
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++;
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;
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;