]> jfr.im git - solanum.git/blobdiff - ircd/hostmask.c
send: add sendto_one_multiline_* API
[solanum.git] / ircd / hostmask.c
index 48b2b1b3e4f0bfe14fb3c1f2db831800886d725d..1a154130d24a63d6383fc88a3cfd1172cb4225e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  charybdis: an advanced internet relay chat daemon (ircd).
+ *  Solanum: a slightly advanced ircd
  *  hostmask.c: Code to efficiently find IP & hostmask based configs.
  *
  *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
@@ -26,6 +26,7 @@
 #include "stdinc.h"
 #include "ircd_defs.h"
 #include "s_conf.h"
+#include "s_newconf.h"
 #include "hostmask.h"
 #include "numeric.h"
 #include "send.h"
@@ -630,7 +631,7 @@ delete_one_address_conf(const char *address, struct ConfItem *aconf)
  *               them, otherwise sets them as illegal.
  */
 void
-clear_out_address_conf(void)
+clear_out_address_conf(enum aconf_category clear_type)
 {
        int i;
        struct AddressRec **store_next;
@@ -641,44 +642,17 @@ clear_out_address_conf(void)
                store_next = &atable[i];
                for (arec = atable[i]; arec; arec = arecn)
                {
+                       enum aconf_category cur_type;
                        arecn = arec->next;
-                       /* We keep the temporary K-lines and destroy the
-                        * permanent ones, just to be confusing :) -A1kmm */
-                       if(arec->aconf->flags & CONF_FLAGS_TEMPORARY ||
-                          (arec->type != CONF_CLIENT && arec->type != CONF_EXEMPTDLINE))
-                       {
-                               *store_next = arec;
-                               store_next = &arec->next;
-                       }
-                       else
-                       {
-                               arec->aconf->status |= CONF_ILLEGAL;
-                               if(!arec->aconf->clients)
-                                       free_conf(arec->aconf);
-                               rb_free(arec);
-                       }
-               }
-               *store_next = NULL;
-       }
-}
 
-void
-clear_out_address_conf_bans(void)
-{
-       int i;
-       struct AddressRec **store_next;
-       struct AddressRec *arec, *arecn;
+                       if (arec->type == CONF_CLIENT || arec->type == CONF_EXEMPTDLINE || arec->type == CONF_SECURE)
+                               cur_type = AC_CONFIG;
+                       else
+                               cur_type = AC_BANDB;
 
-       for (i = 0; i < ATABLE_SIZE; i++)
-       {
-               store_next = &atable[i];
-               for (arec = atable[i]; arec; arec = arecn)
-               {
-                       arecn = arec->next;
                        /* We keep the temporary K-lines and destroy the
                         * permanent ones, just to be confusing :) -A1kmm */
-                       if(arec->aconf->flags & CONF_FLAGS_TEMPORARY ||
-                          (arec->type == CONF_CLIENT || arec->type == CONF_EXEMPTDLINE))
+                       if (arec->aconf->flags & CONF_FLAGS_TEMPORARY || cur_type != clear_type)
                        {
                                *store_next = arec;
                                store_next = &arec->next;
@@ -695,7 +669,6 @@ clear_out_address_conf_bans(void)
        }
 }
 
-
 /*
  * show_iline_prefix()
  *
@@ -752,7 +725,7 @@ report_auth(struct Client *client_p)
                        {
                                aconf = arec->aconf;
 
-                               if(!IsOper(client_p) && IsConfDoSpoofIp(aconf))
+                               if(!IsOperGeneral(client_p) && IsConfDoSpoofIp(aconf))
                                        continue;
 
                                get_printable_conf(aconf, &name, &host, &pass, &user, &port,