]> jfr.im git - solanum.git/blobdiff - modules/m_dline.c
irc_string.h -> match.h, irc_string.h; includes changed
[solanum.git] / modules / m_dline.c
index 317bb24478bc6ffcc9ecb52ae4d4c46fd6766de7..97e0aa65733dde61e70855c47bdbaf1573e12f69 100644 (file)
 #include "class.h"
 #include "client.h"
 #include "common.h"
-#include "irc_string.h"
-#include "sprintf_irc.h"
+#include "match.h"
 #include "ircd.h"
 #include "hostmask.h"
 #include "numeric.h"
 #include "s_conf.h"
 #include "s_newconf.h"
-#include "s_log.h"
+#include "logger.h"
 #include "send.h"
 #include "hash.h"
 #include "s_serv.h"
 #include "msg.h"
 #include "parse.h"
 #include "modules.h"
-#include "reject.h"
 
 static int mo_dline(struct Client *, struct Client *, int, const char **);
 static int mo_undline(struct Client *, struct Client *, int, const char **);
@@ -77,6 +75,7 @@ mo_dline(struct Client *client_p, struct Client *source_p,
        const char *dlhost;
        char *oper_reason;
        char *reason = def;
+       struct rb_sockaddr_storage daddr;
        char cidr_form_host[HOSTLEN + 1];
        struct ConfItem *aconf;
        int bits;
@@ -103,7 +102,7 @@ mo_dline(struct Client *client_p, struct Client *source_p,
        }
 
        dlhost = parv[loc];
-       strlcpy(cidr_form_host, dlhost, sizeof(cidr_form_host));
+       rb_strlcpy(cidr_form_host, dlhost, sizeof(cidr_form_host));
 
        if(!parse_netmask(dlhost, NULL, &bits))
        {
@@ -149,40 +148,39 @@ mo_dline(struct Client *client_p, struct Client *source_p,
                }
        }
 
-       if(ConfigFileEntry.non_redundant_klines)\r
-       {\r
-               struct rb_sockaddr_storage daddr;\r
-               const char *creason;\r
-               int t = AF_INET, ty, b;\r
-               ty = parse_netmask(dlhost, (struct sockaddr *)&daddr, &b);\r
-#ifdef IPV6\r
-               if(ty == HM_IPV6)\r
-                       t = AF_INET6;\r
-               else\r
-#endif\r
-                       t = AF_INET;\r
-                                               \r
-               if((aconf = find_dline((struct sockaddr *)&daddr)) != NULL)\r
-               {\r
-                       int bx;\r
-                       parse_netmask(aconf->host, NULL, &bx);\r
-                       if(b >= bx)\r
-                       {\r
-                               creason = aconf->passwd ? aconf->passwd : "<No Reason>";\r
-                               if(IsConfExemptKline(aconf))\r
-                                       sendto_one_notice(source_p, \r
-                                                         ":[%s] is (E)d-lined by [%s] - %s",\r
-                                                         dlhost, aconf->host, creason);\r
-                               else\r
-                                       sendto_one_notice(source_p, \r
-                                                         ":[%s] already D-lined by [%s] - %s",\r
-                                                         dlhost, aconf->host, creason);\r
-                               return 0;\r
-                       }\r
-               }\r
+       if(ConfigFileEntry.non_redundant_klines)
+       {
+               const char *creason;
+               int t = AF_INET, ty, b;
+               ty = parse_netmask(dlhost, (struct sockaddr *)&daddr, &b);
+#ifdef RB_IPV6
+               if(ty == HM_IPV6)
+                       t = AF_INET6;
+                else
+#endif
+                       t = AF_INET;
+                                               
+               if((aconf = find_dline((struct sockaddr *)&daddr, t)) != NULL)
+               {
+                       int bx;
+                       parse_netmask(aconf->host, NULL, &bx);
+                       if(b >= bx)
+                       {
+                               creason = aconf->passwd ? aconf->passwd : "<No Reason>";
+                               if(IsConfExemptKline(aconf))
+                                       sendto_one(source_p,
+                                                  ":%s NOTICE %s :[%s] is (E)d-lined by [%s] - %s",
+                                                  me.name, parv[0], dlhost, aconf->host, creason);
+                               else
+                                       sendto_one(source_p,
+                                                  ":%s NOTICE %s :[%s] already D-lined by [%s] - %s",
+                                                  me.name, parv[0], dlhost, aconf->host, creason);
+                               return 0;
+                       }
+               }
        }
 
-       set_time();
+       rb_set_time();
        current_date = smalldate();
 
        aconf = make_conf();
@@ -285,7 +283,7 @@ mo_undline(struct Client *client_p, struct Client *source_p, int parc, const cha
                return 0;
        }
 
-       strlcpy(buf, aconf->host, sizeof buf);
+       rb_strlcpy(buf, aconf->host, sizeof buf);
        if(remove_temp_dline(aconf))
        {
                sendto_one(source_p,
@@ -319,7 +317,7 @@ mo_undline(struct Client *client_p, struct Client *source_p, int parc, const cha
 
        while (fgets(buf, sizeof(buf), in))
        {
-               strlcpy(buff, buf, sizeof(buff));
+               rb_strlcpy(buff, buf, sizeof(buff));
 
                if((p = strchr(buff, '\n')) != NULL)
                        *p = '\0';