]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/users.h
Applied patch by psychon to make AddExtBanChar correctly take a single char
[user/henk/code/inspircd.git] / include / users.h
index c07e157ab7f6b26d804c703fad847095d4e1fe90..2934652540815374f54dd8e865a4a33d3bebfc8a 100644 (file)
@@ -143,7 +143,7 @@ public:
                registration_timeout(source->registration_timeout), flood(source->flood), host(source->host),
                pingtime(source->pingtime), pass(source->pass), hash(source->hash), threshold(source->threshold), sendqmax(source->sendqmax),
                recvqmax(source->recvqmax), maxlocal(source->maxlocal), maxglobal(source->maxglobal), maxchans(source->maxchans),
-               port(source->port), RefCount(0), disabled(false), limit(0)
+               port(source->port), RefCount(0), disabled(false), limit(source->limit)
        {
        }
 
@@ -191,7 +191,7 @@ public:
                                registration_timeout(source->registration_timeout), flood(source->flood), host(source->host),
                                pingtime(source->pingtime), pass(source->pass), hash(source->hash), threshold(source->threshold), sendqmax(source->sendqmax),
                                recvqmax(source->recvqmax), maxlocal(source->maxlocal), maxglobal(source->maxglobal), maxchans(source->maxchans),
-                               port(source->port), RefCount(0), disabled(false), limit(0)
+                               port(source->port), RefCount(0), disabled(false), limit(source->limit)
        {
        }
 
@@ -542,12 +542,12 @@ class CoreExport User : public connection
         * The following RFC characters o, w, s, i have constants defined via an
         * enum, such as UM_SERVERNOTICE and UM_OPETATOR.
         */
-       char modes[64];
+       unsigned char modes[64];
 
        /** What snomasks are set on this user.
         * This functions the same as the above modes.
         */
-       char snomasks[64];
+       unsigned char snomasks[64];
 
        /** Channels this user is on, and the permissions they have there
         */
@@ -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