]> jfr.im git - solanum.git/blobdiff - include/hostmask.h
Add umode +I to allow users to hide their idle time (#220)
[solanum.git] / include / hostmask.h
index 8e97cf74bfbc7aa10c83e1fc86bece16131ab382..b8d5fecababba84e4bbae53a182664c2225a7602 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  charybdis: an advanced Internet Relay Chat Daemon(ircd).
+ *  Solanum: a slightly advanced ircd
  *  hostmask.h: A header for the hostmask code.
  *
  *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
 #define INCLUDE_hostmask_h 1
 enum
 {
+       HM_ERROR,
        HM_HOST,
-       HM_IPV4
-#ifdef RB_IPV6
-               , HM_IPV6
-#endif
+       HM_IPV4,
+       HM_IPV6,
+};
+
+enum aconf_category
+{
+       AC_CONFIG,
+       AC_BANDB,
 };
 
 int parse_netmask(const char *, struct rb_sockaddr_storage *, int *);
+int parse_netmask_strict(const char *, struct rb_sockaddr_storage *, int *);
 struct ConfItem *find_conf_by_address(const char *host, const char *sockhost,
                                      const char *orighost, struct sockaddr *,
                                      int, int, const char *, const char *);
 struct ConfItem *find_exact_conf_by_address(const char *address, int type,
                                            const char *username);
+struct ConfItem *find_exact_conf_by_address_filtered(const char *address, int type,
+               const char *username, bool (*filter)(struct ConfItem *));
 void add_conf_by_address(const char *, int, const char *, const char *, struct ConfItem *);
 void delete_one_address_conf(const char *, struct ConfItem *);
-void clear_out_address_conf(void);
-void clear_out_address_conf_bans(void);
+void clear_out_address_conf(enum aconf_category);
 void init_host_hash(void);
 struct ConfItem *find_address_conf(const char *host, const char *sockhost,
                                const char *, const char *, struct sockaddr *,
@@ -51,15 +58,14 @@ struct ConfItem *find_address_conf(const char *host, const char *sockhost,
 
 struct ConfItem *find_dline(struct sockaddr *, int);
 
-#define find_kline(x)  (find_conf_by_address((x)->host, (x)->sockhost, \
-                        (x)->orighost, \
+#define find_kline(x)  ((IsConfDoSpoofIp((x)->localClient->att_conf) && IsConfKlineSpoof((x)->localClient->att_conf)) ? \
+               find_conf_by_address((x)->orighost, NULL, NULL, NULL, CONF_KILL, AF_INET, (x)->username, NULL) : \
+               find_conf_by_address((x)->host, (x)->sockhost, (x)->orighost, \
                         (struct sockaddr *)&(x)->localClient->ip, CONF_KILL,\
                         GET_SS_FAMILY(&(x)->localClient->ip), (x)->username, NULL))
 
 void report_auth(struct Client *);
-#ifdef RB_IPV6
 int match_ipv6(struct sockaddr *, struct sockaddr *, int);
-#endif
 int match_ipv4(struct sockaddr *, struct sockaddr *, int);
 
 /* Hashtable stuff... */