public:
ModuleCloaking() : cu(this), Hash(this, "hash/md5")
+ {
+ }
+
+ void init()
{
OnRehash(NULL);
Version GetVersion()
{
- // returns the version number of the module to be
- // listed in /MODULES
- return Version("Provides masking of user hostnames", VF_COMMON|VF_VENDOR);
+ std::string testcloak;
+ switch (mode)
+ {
+ case MODE_COMPAT_HOST:
+ testcloak = prefix + "-" + Hash->sumIV(compatkey, xtab[0], "*").substr(0,10);
+ break;
+ case MODE_COMPAT_IPONLY:
+ testcloak = Hash->sumIV(compatkey, xtab[0], "*").substr(0,10);
+ break;
+ case MODE_HALF_CLOAK:
+ testcloak = prefix + SegmentCloak("*", 3);
+ break;
+ case MODE_OPAQUE:
+ default:
+ testcloak = prefix + SegmentCloak("*", 4);
+ }
+ return Version("Provides masking of user hostnames", VF_COMMON|VF_VENDOR, testcloak);
}
void OnRehash(User* user)
if (cloak)
return;
- if (dest->host.find('.') == std::string::npos && dest->host.find(':') == std::string::npos)
- return;
-
std::string ipstr = dest->GetIPString();
std::string chost;