diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-07-12 08:57:44 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-07-12 08:57:44 +0000 |
commit | c92f8ebd92337a009410cc263d4a1392136629d2 (patch) | |
tree | e6af48e7a66330bac2455b377bfbee8b34ce4355 /include | |
parent | 328b3ef85647685811c680e67005ec82a0c66c11 (diff) |
Add User::GetCIDRMask(int range), will be used for CIDR throttling, etc. Also probably opens up the way for /gline nickname to place CIDR bans instead of regular bans, which could be helpful. Much thanks to Om for his help.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9959 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r-- | include/users.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/users.h b/include/users.h index f098500e3..3edb9a99e 100644 --- a/include/users.h +++ b/include/users.h @@ -661,6 +661,15 @@ class CoreExport User : public connection */ const char* GetIPString(bool translate4in6 = true); + /** Get a CIDR mask from the IP of this user, using a static internal buffer. + * e.g., GetCIDRMask(16) for 223.254.214.52 returns 223.254.0.0/16 + * This may be used for CIDR clone detection, etc. + * + * (XXX, brief note: when we do the sockets rewrite, this should move down a + * level so it may be used on more derived objects. -- w00t) + */ + const char *GetCIDRMask(int range); + /* Write error string */ std::string WriteError; |