summaryrefslogtreecommitdiff
path: root/include/sockets.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-05-08 09:50:43 -0400
committerAdam <Adam@anope.org>2013-05-08 09:50:43 -0400
commit9b07e163c0e1ceed30e72aead2338b47ef2da1b2 (patch)
tree4c13bd545846700a58c5526c3e4e9a6fdf0afc87 /include/sockets.h
parent6859decfb8ed0430e946ff81eca4f9da879f69c9 (diff)
Make sockaddrs/cidr not throw on invalid ips to give us an easier/cheaper way to test for a valid IP
Diffstat (limited to 'include/sockets.h')
-rw-r--r--include/sockets.h3
1 files changed, 3 insertions, 0 deletions
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;