From 9b07e163c0e1ceed30e72aead2338b47ef2da1b2 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 8 May 2013 09:50:43 -0400 Subject: Make sockaddrs/cidr not throw on invalid ips to give us an easier/cheaper way to test for a valid IP --- include/sockets.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/sockets.h b/include/sockets.h index 0e490ac24..8b1abe5c2 100644 --- a/include/sockets.h +++ b/include/sockets.h @@ -79,6 +79,8 @@ union CoreExport sockaddrs * @throws A socket exception if given an invalid structure */ void ntop(int type, const void *src); + + bool valid() const; }; class CoreExport cidr @@ -91,6 +93,7 @@ class CoreExport cidr cidr(const Anope::string &ip, unsigned char len); Anope::string mask() const; bool match(const sockaddrs &other); + bool valid() const; bool operator<(const cidr &other) const; bool operator==(const cidr &other) const; -- cgit