anope

- supernets anope source code & configuration
git clone git://git.acid.vegas/anope.git
Log | Files | Refs | Archive | README

os_forbid.h (1047B)

      1 /*
      2  *
      3  * (C) 2011-2022 Anope Team
      4  * Contact us at team@anope.org
      5  *
      6  * Please read COPYING and README for further details.
      7  */
      8 
      9 #ifndef OS_FORBID_H
     10 #define OS_FORBID_H
     11 
     12 enum ForbidType
     13 {
     14 	FT_NICK = 1,
     15 	FT_CHAN,
     16 	FT_EMAIL,
     17 	FT_REGISTER,
     18 	FT_SIZE
     19 };
     20 
     21 struct ForbidData
     22 {
     23 	Anope::string mask;
     24 	Anope::string creator;
     25 	Anope::string reason;
     26 	time_t created;
     27 	time_t expires;
     28 	ForbidType type;
     29 
     30 	virtual ~ForbidData() { }
     31  protected:
     32 	ForbidData() : created(0), expires(0) { }
     33 };
     34 
     35 class ForbidService : public Service
     36 {
     37  public:
     38 	ForbidService(Module *m) : Service(m, "ForbidService", "forbid") { }
     39 
     40 	virtual void AddForbid(ForbidData *d) = 0;
     41 
     42 	virtual void RemoveForbid(ForbidData *d) = 0;
     43 
     44 	virtual ForbidData* CreateForbid() = 0;
     45 
     46 	virtual ForbidData *FindForbid(const Anope::string &mask, ForbidType type) = 0;
     47 
     48 	virtual ForbidData *FindForbidExact(const Anope::string &mask, ForbidType type) = 0;
     49 
     50 	virtual std::vector<ForbidData *> GetForbids() = 0;
     51 };
     52 
     53 static ServiceReference<ForbidService> forbid_service("ForbidService", "forbid");
     54 
     55 #endif