X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fxline.h;h=0aa831670582eba64814083a5fe5047bcb96a940;hb=6b23783b71e98bae6aced7144c6730f028873cb6;hp=8c18ab37e95b4f4a011ff1241af3ea766c6267a3;hpb=066e5ca3665835e50dddaaf612212ffb94c68a85;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/xline.h b/include/xline.h index 8c18ab37e..0aa831670 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. * @@ -25,11 +22,12 @@ #include "users.h" #include "channels.h" -const int APPLY_GLINES = 1; -const int APPLY_KLINES = 2; -const int APPLY_QLINES = 4; -const int APPLY_ZLINES = 8; -const int APPLY_ALL = APPLY_GLINES | APPLY_KLINES | APPLY_QLINES | APPLY_ZLINES; +const int APPLY_GLINES = 1; +const int APPLY_KLINES = 2; +const int APPLY_QLINES = 4; +const int APPLY_ZLINES = 8; +const int APPLY_PERM_ONLY = 16; +const int APPLY_ALL = APPLY_GLINES | APPLY_KLINES | APPLY_QLINES | APPLY_ZLINES; /** XLine is the base class for ban lines such as G lines and K lines. */ @@ -42,6 +40,7 @@ class XLine : public classbase { source = strdup(src); reason = strdup(re); + expiry = set_time + duration; } virtual ~XLine() @@ -64,6 +63,10 @@ class XLine : public classbase /** Reason for the ban */ char* reason; + + /** Expiry time + */ + time_t expiry; }; /** KLine class @@ -184,12 +187,16 @@ class ServerConfig; 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 DoneZLine(ServerConfig* conf, const char* tag); +bool DoneQLine(ServerConfig* conf, const char* tag); +bool DoneKLine(ServerConfig* conf, const char* tag); +bool DoneELine(ServerConfig* conf, const char* tag); + +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; @@ -342,31 +349,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, bool permonly = false); /** 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, bool permonly = false); /** 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, bool permonly = false); /** 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, bool permonly = false); /** 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, bool permonly = false); /** Expire any pending non-permenant lines */ @@ -375,6 +382,7 @@ class XLineManager /** Apply any new lines * @param What The types of lines to apply, from the set * APPLY_GLINES | APPLY_KLINES | APPLY_QLINES | APPLY_ZLINES | APPLY_ALL + * | APPLY_LOCAL_ONLY */ void apply_lines(const int What);