#include "inspircd.h"
#include "xline.h"
-#ifndef WINDOWS
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#endif
-
/* $ModDesc: Provides handling of DNS blacklists */
/* Class holding data for a single entry */
{
case DNSBLConfEntry::I_KILL:
{
- ServerInstance->Users->QuitUser(them, std::string("Killed (") + reason + ")");
+ ServerInstance->Users->QuitUser(them, "Killed (" + reason + ")");
break;
}
case DNSBLConfEntry::I_MARK:
void OnSetUserIP(LocalUser* user)
{
- if (user->exempt)
+ if ((user->exempt) || (user->client_sa.sa.sa_family != AF_INET))
return;
+ if (user->MyClass)
+ {
+ if (!user->MyClass->config->getBool("usednsbl", true))
+ return;
+ }
+ else
+ ServerInstance->Logs->Log("m_dnsbl", DEBUG, "User has no connect class in OnSetUserIP");
+
unsigned char a, b, c, d;
char reversedipbuf[128];
std::string reversedip;
- if (user->client_sa.sa.sa_family != AF_INET)
- return;
-
d = (unsigned char) (user->client_sa.in4.sin_addr.s_addr >> 24) & 0xFF;
c = (unsigned char) (user->client_sa.in4.sin_addr.s_addr >> 16) & 0xFF;
b = (unsigned char) (user->client_sa.in4.sin_addr.s_addr >> 8) & 0xFF;
total_hits += (*i)->stats_hits;
total_misses += (*i)->stats_misses;
- results.push_back(std::string(ServerInstance->Config->ServerName.c_str()) + " 304 " + user->nick + " :DNSBLSTATS DNSbl \"" + (*i)->name + "\" had " +
+ results.push_back(ServerInstance->Config->ServerName + " 304 " + user->nick + " :DNSBLSTATS DNSbl \"" + (*i)->name + "\" had " +
ConvToStr((*i)->stats_hits) + " hits and " + ConvToStr((*i)->stats_misses) + " misses");
}
- results.push_back(std::string(ServerInstance->Config->ServerName.c_str()) + " 304 " + user->nick + " :DNSBLSTATS Total hits: " + ConvToStr(total_hits));
- results.push_back(std::string(ServerInstance->Config->ServerName.c_str()) + " 304 " + user->nick + " :DNSBLSTATS Total misses: " + ConvToStr(total_misses));
+ results.push_back(ServerInstance->Config->ServerName + " 304 " + user->nick + " :DNSBLSTATS Total hits: " + ConvToStr(total_hits));
+ results.push_back(ServerInstance->Config->ServerName + " 304 " + user->nick + " :DNSBLSTATS Total misses: " + ConvToStr(total_misses));
return MOD_RES_PASSTHRU;
}