X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fxline.h;h=648cccbb040afb049c62f07d58b7dd971eef9cc9;hb=5e9a6b9186a8cbaaf65ae7d9cd9c0c033c91b497;hp=bec693da6ec29d08518970a426bcc9d5600d9ce8;hpb=89dc9ab19899e8bde4761da2e3f86194cf34fc21;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/xline.h b/include/xline.h index bec693da6..648cccbb0 100644 --- a/include/xline.h +++ b/include/xline.h @@ -2,12 +2,9 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev. - * E-mail: - * - * - * - * Written by Craig Edwards, Craig McLure, and others. + * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * See: http://www.inspircd.org/wiki/index.php/Credits + * * This program is free but copyrighted software; see * the file COPYING for details. * @@ -42,6 +39,7 @@ class XLine : public classbase { source = strdup(src); reason = strdup(re); + expiry = set_time + duration; } virtual ~XLine() @@ -64,6 +62,10 @@ class XLine : public classbase /** Reason for the ban */ char* reason; + + /** Expiry time + */ + time_t expiry; }; /** KLine class @@ -186,10 +188,10 @@ class InspIRCd; bool InitXLine(ServerConfig* conf, const char* tag); bool DoneXLine(ServerConfig* conf, const char* tag); -bool DoZLine(ServerConfig* conf, const char* tag, char** entries, void** values, int* types); -bool DoQLine(ServerConfig* conf, const char* tag, char** entries, void** values, int* types); -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); +bool DoZLine(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types); +bool DoQLine(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types); +bool DoKLine(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types); +bool DoELine(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types); typedef std::pair IdentHostPair; @@ -204,57 +206,57 @@ class XLineManager /** This functor is used by the std::sort() function to keep glines in order */ - static bool 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 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 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 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 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 */ /** Temporary KLines */ - std::vector klines; + std::vector klines; /** Temporary Glines */ - std::vector glines; + std::vector glines; /** Temporary Zlines */ - std::vector zlines; + std::vector zlines; /** Temporary QLines */ - std::vector qlines; + std::vector qlines; /** Temporary ELines */ - std::vector elines; + std::vector elines; /* Seperate lists for perm XLines that isnt checked by expiry functions */ /** Permenant KLines */ - std::vector pklines; + std::vector pklines; /** Permenant GLines */ - std::vector pglines; + std::vector pglines; /** Permenant ZLines */ - std::vector pzlines; + std::vector pzlines; /** Permenant QLines */ - std::vector pqlines; + std::vector pqlines; /** Permenant ELines */ - std::vector pelines; + std::vector pelines; /** Constructor * @param Instance A pointer to the creator object @@ -342,31 +344,31 @@ class XLineManager * @return nick The nick to check against * @return The reason for the line if there is a match, or NULL if there is no match */ - char* matches_qline(const char* nick); + QLine* matches_qline(const char* nick); /** Check if a hostname matches a GLine * @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(userrec* user); + GLine* matches_gline(userrec* user); /** Check if a IP matches a ZLine * @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); + ZLine* matches_zline(const char* ipaddr); /** Check if a hostname matches a KLine * @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(userrec* user); + KLine* matches_kline(userrec* user); /** Check if a hostname matches a ELine * @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(userrec* user); + ELine* matches_exception(userrec* user); /** Expire any pending non-permenant lines */