]> 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 0237c13a0b08a61a0e8d64605f8166f44684dace..97e0aa65733dde61e70855c47bdbaf1573e12f69 100644 (file)
  */
 
 #include "stdinc.h"
-#include "tools.h"
 #include "channel.h"
 #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 "commio.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"
@@ -78,7 +75,7 @@ mo_dline(struct Client *client_p, struct Client *source_p,
        const char *dlhost;
        char *oper_reason;
        char *reason = def;
-       struct irc_sockaddr_storage daddr;
+       struct rb_sockaddr_storage daddr;
        char cidr_form_host[HOSTLEN + 1];
        struct ConfItem *aconf;
        int bits;
@@ -105,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))
        {
@@ -156,7 +153,7 @@ mo_dline(struct Client *client_p, struct Client *source_p,
                const char *creason;
                int t = AF_INET, ty, b;
                ty = parse_netmask(dlhost, (struct sockaddr *)&daddr, &b);
-#ifdef IPV6
+#ifdef RB_IPV6
                if(ty == HM_IPV6)
                        t = AF_INET6;
                 else
@@ -183,12 +180,12 @@ mo_dline(struct Client *client_p, struct Client *source_p,
                }
        }
 
-       set_time();
+       rb_set_time();
        current_date = smalldate();
 
        aconf = make_conf();
        aconf->status = CONF_DLINE;
-       DupString(aconf->host, dlhost);
+       aconf->host = rb_strdup(dlhost);
 
        /* Look for an oper reason */
        if((oper_reason = strchr(reason, '|')) != NULL)
@@ -197,16 +194,16 @@ mo_dline(struct Client *client_p, struct Client *source_p,
                oper_reason++;
 
                if(!EmptyString(oper_reason))
-                       DupString(aconf->spasswd, oper_reason);
+                       aconf->spasswd = rb_strdup(oper_reason);
        }
 
        if(tdline_time > 0)
        {
-               ircsnprintf(dlbuffer, sizeof(dlbuffer), 
+               rb_snprintf(dlbuffer, sizeof(dlbuffer), 
                         "Temporary D-line %d min. - %s (%s)",
                         (int) (tdline_time / 60), reason, current_date);
-               DupString(aconf->passwd, dlbuffer);
-               aconf->hold = CurrentTime + tdline_time;
+               aconf->passwd = rb_strdup(dlbuffer);
+               aconf->hold = rb_current_time() + tdline_time;
                add_temp_dline(aconf);
 
                if(EmptyString(oper_reason))
@@ -235,8 +232,8 @@ mo_dline(struct Client *client_p, struct Client *source_p,
        }
        else
        {
-               ircsnprintf(dlbuffer, sizeof(dlbuffer), "%s (%s)", reason, current_date);
-               DupString(aconf->passwd, dlbuffer);
+               rb_snprintf(dlbuffer, sizeof(dlbuffer), "%s (%s)", reason, current_date);
+               aconf->passwd = rb_strdup(dlbuffer);
                add_conf_by_address(aconf->host, CONF_DLINE, NULL, aconf);
                write_confitem(DLINE_TYPE, source_p, NULL, aconf->host, reason,
                               oper_reason, current_date, 0);
@@ -262,7 +259,7 @@ mo_undline(struct Client *client_p, struct Client *source_p, int parc, const cha
        int pairme = NO, error_on_write = NO;
        mode_t oldumask;
 
-       ircsnprintf(temppath, sizeof(temppath), "%s.tmp", ConfigFileEntry.dlinefile);
+       rb_snprintf(temppath, sizeof(temppath), "%s.tmp", ConfigFileEntry.dlinefile);
 
        if(!IsOperUnkline(source_p))
        {
@@ -286,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,
@@ -320,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';
@@ -451,16 +448,16 @@ flush_write(struct Client *source_p, FILE * out, char *buf, char *temppath)
 static int
 remove_temp_dline(struct ConfItem *aconf)
 {
-       dlink_node *ptr;
+       rb_dlink_node *ptr;
        int i;
 
        for (i = 0; i < LAST_TEMP_TYPE; i++)
        {
-               DLINK_FOREACH(ptr, temp_dlines[i].head)
+               RB_DLINK_FOREACH(ptr, temp_dlines[i].head)
                {
                        if (aconf == ptr->data)
                        {
-                               dlinkDestroy(ptr, &temp_dlines[i]);
+                               rb_dlinkDestroy(ptr, &temp_dlines[i]);
                                delete_one_address_conf(aconf->host, aconf);
                                return YES;
                        }