X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fusers.h;h=2934652540815374f54dd8e865a4a33d3bebfc8a;hb=48103a05e75dc208bcd01b62b19ae01158c01b50;hp=f098500e34861eed81f79a81d2d74ae78a2e2a38;hpb=2be353eececbfb9ab811ac74134ed7437b641369;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/users.h b/include/users.h index f098500e3..293465254 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; @@ -689,9 +698,10 @@ class CoreExport User : public connection */ User(InspIRCd* Instance, const std::string &uid = ""); - /** Check if the user matches a G or K line, and disconnect them if they do + /** Check if the user matches a G or K line, and disconnect them if they do. + * Returns true if the user matched a ban, false else. */ - void CheckLines(); + bool CheckLines(); /** Returns the full displayed host of the user * This member function returns the hostname of the user as seen by other users