summaryrefslogtreecommitdiff
path: root/src/misc.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-09-09 23:43:11 -0400
committerAdam <Adam@anope.org>2010-09-09 23:43:11 -0400
commit46813ccb8c6ab572b8a9ff0a39afb1d92dc4482b (patch)
tree562da502a102230ce207bbe921fdc978ee71e20c /src/misc.cpp
parentfdd196e50b4616ac377bd0ee0ae5ce6c57b657ee (diff)
Added an asynchronous DNS system and m_dnsbl, which checks clients against DNS blacklists.
Rewrote internal handling of IPs, we now properly support users using IPv6. Fixed a few problems with the UnrealIRCd protocol module.
Diffstat (limited to 'src/misc.cpp')
-rw-r--r--src/misc.cpp63
1 files changed, 0 insertions, 63 deletions
diff --git a/src/misc.cpp b/src/misc.cpp
index 66beff127..05240b77e 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -815,32 +815,6 @@ int myNumToken(const Anope::string &str, char dilim)
/*************************************************************************/
-/**
- * Resolve a host to an IP
- * @param host to convert
- * @return ip address
- */
-Anope::string host_resolve(const Anope::string &host)
-{
- struct hostent *hentp = gethostbyname(host.c_str());
- Anope::string ipreturn;
-
- if (hentp)
- {
- uint32 ip;
- memcpy(&ip, hentp->h_addr, sizeof(hentp->h_length));
- struct in_addr addr;
- addr.s_addr = ip;
- char ipbuf[16];
- ntoa(addr, ipbuf, sizeof(ipbuf));
- ipreturn = ipbuf;
- Log(LOG_DEBUG) << "resolved " << host << " to " << ipbuf;
- }
- return ipreturn;
-}
-
-/*************************************************************************/
-
/** Build a string list from a source string
* @param src The source string
* @return a list of strings
@@ -1199,43 +1173,6 @@ bool str_is_pure_wildcard(const Anope::string &str)
/*************************************************************************/
/**
- * Check if the given string is an IP, and return the IP.
- * @param str String to check
- * @return The IP, if one found. 0 if none.
- */
-uint32 str_is_ip(const Anope::string &str)
-{
- int octets[4] = { -1, -1, -1, -1 };
- std::vector<Anope::string> octets_str = BuildStringVector(str, '.');
-
- if (octets_str.size() != 4)
- return false;
-
- for (unsigned i = 0; i < 4; ++i)
- {
- Anope::string octet = octets_str[i];
-
- if (!octet.is_number_only())
- return 0;
-
- octets[i] = convertTo<int>(octet);
- /* Bail out if the octet is invalid or wrongly terminated */
- if (octets[i] < 0 || octets[i] > 255)
- return 0;
- }
-
- /* Fill the IP - the dirty way */
- uint32 ip = octets[3];
- ip += octets[2] * 256;
- ip += octets[1] * 65536;
- ip += octets[0] * 16777216;
-
- return ip;
-}
-
-/*************************************************************************/
-
-/**
* Check if the given string is an IP or CIDR mask, and fill the given
* ip/cidr params if so.
* @param str String to check