]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/xline.h
Now supports multiple commands seperated with \n. NOTE: These \n's are translated...
[user/henk/code/inspircd.git] / include / xline.h
index 9c42a32e576b2835211fab3ba6febcb39deaebd5..bfa810c971544d8c14bfa55d76307142938ce51a 100644 (file)
 
 // include the common header files
 
-#include <typeinfo>
-#include <iostream>
 #include <string>
 #include <deque>
-#include <sstream>
 #include <vector>
 #include "users.h"
 #include "channels.h"
@@ -70,6 +67,7 @@ class KLine : public XLine
        /** Hostmask (ident@host) to match against
         * May contain wildcards.
         */
+       char identmask[20];
        char hostmask[200];
 };
 
@@ -81,6 +79,7 @@ class GLine : public XLine
        /** Hostmask (ident@host) to match against
         * May contain wildcards.
         */
+       char identmask[20];
        char hostmask[200];
 };
 
@@ -92,6 +91,7 @@ class ELine : public XLine
         /** Hostmask (ident@host) to match against
          * May contain wildcards.
          */
+       char identmask[20];
         char hostmask[200];
 };
 
@@ -136,6 +136,8 @@ bool DoQLine(ServerConfig* conf, const char* tag, char** entries, void** values,
 bool DoKLine(ServerConfig* conf, const char* tag, char** entries, void** values, int* types);
 bool DoELine(ServerConfig* conf, const char* tag, char** entries, void** values, int* types);
 
+typedef std::pair<std::string, std::string> IdentHostPair;
+
 /** XLineManager is a class used to manage glines, klines, elines, zlines and qlines.
  */
 class XLineManager
@@ -147,23 +149,23 @@ class XLineManager
 
        /** This functor is used by the std::sort() function to keep glines in order
         */
-       static bool XLineManager::GSortComparison ( const GLine one, const GLine two );
+       static bool GSortComparison ( const GLine one, const GLine two );
 
        /** This functor is used by the std::sort() function to keep elines in order
         */
-       static bool XLineManager::ESortComparison ( const ELine one, const ELine two );
+       static bool ESortComparison ( const ELine one, const ELine two );
 
        /** This functor is used by the std::sort() function to keep zlines in order
         */
-       static bool XLineManager::ZSortComparison ( const ZLine one, const ZLine two );
+       static bool ZSortComparison ( const ZLine one, const ZLine two );
 
        /** This functor is used by the std::sort() function to keep klines in order
         */
-       static bool XLineManager::KSortComparison ( const KLine one, const KLine two );
+       static bool KSortComparison ( const KLine one, const KLine two );
 
        /** This functor is used by the std::sort() function to keep qlines in order
         */
-       static bool XLineManager::QSortComparison ( const QLine one, const QLine two );
+       static bool QSortComparison ( const QLine one, const QLine two );
  public:
        /* Lists for temporary lines with an expiry time */
 
@@ -204,6 +206,8 @@ class XLineManager
         */
        XLineManager(InspIRCd* Instance);
 
+       IdentHostPair IdentSplit(const std::string &ident_and_host);
+
        /** Add a new GLine
         * @param duration The duration of the line
         * @param source The source of the line
@@ -286,28 +290,28 @@ class XLineManager
        char* matches_qline(const char* nick);
 
        /** Check if a hostname matches a GLine
-        * @return host The host to check against
+        * @param user The user to check against
         * @return The reason for the line if there is a match, or NULL if there is no match
         */
-       char* matches_gline(const char* host);
+       char* matches_gline(userrec* user);
 
        /** Check if a IP matches a ZLine
-        * @return ipaddr The IP to check against
+        * @param ipaddr The IP to check against
         * @return The reason for the line if there is a match, or NULL if there is no match
         */
        char* matches_zline(const char* ipaddr);
 
        /** Check if a hostname matches a KLine
-        * @return host The host to check against
+        * @param user The user to check against
         * @return The reason for the line if there is a match, or NULL if there is no match
         */
-       char* matches_kline(const char* host);
+       char* matches_kline(userrec* user);
 
        /** Check if a hostname matches a ELine
-        * @return host The host to check against
+        * @param user The user to check against
         * @return The reason for the line if there is a match, or NULL if there is no match
         */
-       char* matches_exception(const char* host);
+       char* matches_exception(userrec* user);
 
        /** Expire any pending non-permenant lines
         */