diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/commands.h | 5 | ||||
-rw-r--r-- | include/connection.h | 4 | ||||
-rw-r--r-- | include/wildcard.h | 2 | ||||
-rw-r--r-- | include/xline.h | 35 |
4 files changed, 42 insertions, 4 deletions
diff --git a/include/commands.h b/include/commands.h index a9046d4d1..53f80fd73 100644 --- a/include/commands.h +++ b/include/commands.h @@ -57,6 +57,11 @@ void handle_links(char **parameters, int pcnt, userrec *user); void handle_map(char **parameters, int pcnt, userrec *user); void handle_oper(char **parameters, int pcnt, userrec *user); void handle_nick(char **parameters, int pcnt, userrec *user); +void handle_kline(char **parameters, int pcnt, userrec *user); +void handle_gline(char **parameters, int pcnt, userrec *user); +void handle_zline(char **parameters, int pcnt, userrec *user); +void handle_qline(char **parameters, int pcnt, userrec *user); + /** Special functions for processing server to server traffic */ diff --git a/include/connection.h b/include/connection.h index 12d6dc754..bb402b5d2 100644 --- a/include/connection.h +++ b/include/connection.h @@ -171,7 +171,7 @@ class connection : public classbase /** IP of connection. Reserved for future use. */ - long ip; + char ip[32]; /** Inbuf of connection. Only used for userrec */ @@ -229,7 +229,7 @@ class connection : public classbase /** Unused, will be removed in a future alpha/beta */ - char internal_addr[1024]; + char internal_addr[MAXBUF]; /** Unused, will be removed in a future alpha/beta */ diff --git a/include/wildcard.h b/include/wildcard.h index ab6e6d71e..fc73c2d2a 100644 --- a/include/wildcard.h +++ b/include/wildcard.h @@ -3,5 +3,5 @@ void Delete(char* str,int pos); void Insert(char* substr,char* str,int pos); -bool match(char* literal, char* mask); +bool match(const char* literal, const char* mask); diff --git a/include/xline.h b/include/xline.h index 0532ad207..f66583ae6 100644 --- a/include/xline.h +++ b/include/xline.h @@ -17,6 +17,7 @@ */ class XLine : public classbase { + public: /** The time the line was added. */ @@ -40,37 +41,69 @@ class XLine : public classbase }; +/** KLine class + */ class KLine : public XLine { + public: /** Hostmask (ident@host) to match against * May contain wildcards. */ char hostmask[MAXBUF]; }; +/** GLine class + */ class GLine : public XLine { + public: /** Hostmask (ident@host) to match against * May contain wildcards. */ char hostmask[MAXBUF]; }; +/** ZLine class + */ class ZLine : public XLine { + public: /** IP Address (xx.yy.zz.aa) to match against - * May contain wildcards and may be CIDR + * May contain wildcards. */ char ipaddr[MAXBUF]; }; +/** QLine class + */ class QLine : public XLine { + public: /** Nickname to match against. * May contain wildcards. */ char nick[MAXBUF]; }; +void read_xline_defaults(); + +void add_gline(long duration, char* source, char* reason, char* hostmask); +void add_qline(long duration, char* source, char* reason, char* nickname); +void add_zline(long duration, char* source, char* reason, char* ipaddr); +void add_kline(long duration, char* source, char* reason, char* hostmask); + +bool del_gline(char* hostmask); +bool del_qline(char* nickname); +bool del_zline(char* ipaddr); +bool del_kline(char* hostmask); + +char* matches_qline(const char* nick); +char* matches_gline(const char* host); +char* matches_zline(const char* ipaddr); +char* matches_kline(const char* host); + +void expire_lines(); +void apply_lines(); + #endif |