diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/Makefile.am | 6 | ||||
-rw-r--r-- | modules/Makefile.in | 32 | ||||
-rw-r--r-- | modules/m_testline.c | 248 | ||||
-rw-r--r-- | modules/m_testmask.c | 131 |
4 files changed, 2 insertions, 415 deletions
diff --git a/modules/Makefile.am b/modules/Makefile.am index 21eadb4..2b81b97 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -50,8 +50,6 @@ modules_LTLIBRARIES = m_accept.la \ m_svsmode.la \ m_svsnick.la \ m_tburst.la \ - m_testline.la \ - m_testmask.la \ m_time.la \ m_topic.la \ m_trace.la \ @@ -113,8 +111,6 @@ m_svinfo_la_LDFLAGS = $(MODULE_FLAGS) m_svsmode_la_LDFLAGS = $(MODULE_FLAGS) m_svsnick_la_LDFLAGS = $(MODULE_FLAGS) m_tburst_la_LDFLAGS = $(MODULE_FLAGS) -m_testline_la_LDFLAGS = $(MODULE_FLAGS) -m_testmask_la_LDFLAGS = $(MODULE_FLAGS) m_time_la_LDFLAGS = $(MODULE_FLAGS) m_topic_la_LDFLAGS = $(MODULE_FLAGS) m_trace_la_LDFLAGS = $(MODULE_FLAGS) @@ -175,8 +171,6 @@ m_svinfo_la_SOURCES = m_svinfo.c m_svsmode_la_SOURCES = m_svsmode.c m_svsnick_la_SOURCES = m_svsnick.c m_tburst_la_SOURCES = m_tburst.c -m_testline_la_SOURCES = m_testline.c -m_testmask_la_SOURCES = m_testmask.c m_time_la_SOURCES = m_time.c m_topic_la_SOURCES = m_topic.c m_trace_la_SOURCES = m_trace.c diff --git a/modules/Makefile.in b/modules/Makefile.in index e0e7fb2..6fc06fb 100644 --- a/modules/Makefile.in +++ b/modules/Makefile.in @@ -394,18 +394,6 @@ m_tburst_la_OBJECTS = $(am_m_tburst_la_OBJECTS) m_tburst_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(m_tburst_la_LDFLAGS) $(LDFLAGS) -o $@ -m_testline_la_LIBADD = -am_m_testline_la_OBJECTS = m_testline.lo -m_testline_la_OBJECTS = $(am_m_testline_la_OBJECTS) -m_testline_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(m_testline_la_LDFLAGS) $(LDFLAGS) -o $@ -m_testmask_la_LIBADD = -am_m_testmask_la_OBJECTS = m_testmask.lo -m_testmask_la_OBJECTS = $(am_m_testmask_la_OBJECTS) -m_testmask_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(m_testmask_la_LDFLAGS) $(LDFLAGS) -o $@ m_time_la_LIBADD = am_m_time_la_OBJECTS = m_time.lo m_time_la_OBJECTS = $(am_m_time_la_OBJECTS) @@ -545,8 +533,7 @@ SOURCES = $(m_accept_la_SOURCES) $(m_admin_la_SOURCES) \ $(m_services_la_SOURCES) $(m_set_la_SOURCES) \ $(m_stats_la_SOURCES) $(m_svinfo_la_SOURCES) \ $(m_svsmode_la_SOURCES) $(m_svsnick_la_SOURCES) \ - $(m_tburst_la_SOURCES) $(m_testline_la_SOURCES) \ - $(m_testmask_la_SOURCES) $(m_time_la_SOURCES) \ + $(m_tburst_la_SOURCES) $(m_time_la_SOURCES) \ $(m_topic_la_SOURCES) $(m_trace_la_SOURCES) \ $(m_user_la_SOURCES) $(m_userhost_la_SOURCES) \ $(m_users_la_SOURCES) $(m_version_la_SOURCES) \ @@ -575,8 +562,7 @@ DIST_SOURCES = $(m_accept_la_SOURCES) $(m_admin_la_SOURCES) \ $(m_services_la_SOURCES) $(m_set_la_SOURCES) \ $(m_stats_la_SOURCES) $(m_svinfo_la_SOURCES) \ $(m_svsmode_la_SOURCES) $(m_svsnick_la_SOURCES) \ - $(m_tburst_la_SOURCES) $(m_testline_la_SOURCES) \ - $(m_testmask_la_SOURCES) $(m_time_la_SOURCES) \ + $(m_tburst_la_SOURCES) $(m_time_la_SOURCES) \ $(m_topic_la_SOURCES) $(m_trace_la_SOURCES) \ $(m_user_la_SOURCES) $(m_userhost_la_SOURCES) \ $(m_users_la_SOURCES) $(m_version_la_SOURCES) \ @@ -842,8 +828,6 @@ modules_LTLIBRARIES = m_accept.la \ m_svsmode.la \ m_svsnick.la \ m_tburst.la \ - m_testline.la \ - m_testmask.la \ m_time.la \ m_topic.la \ m_trace.la \ @@ -904,8 +888,6 @@ m_svinfo_la_LDFLAGS = $(MODULE_FLAGS) m_svsmode_la_LDFLAGS = $(MODULE_FLAGS) m_svsnick_la_LDFLAGS = $(MODULE_FLAGS) m_tburst_la_LDFLAGS = $(MODULE_FLAGS) -m_testline_la_LDFLAGS = $(MODULE_FLAGS) -m_testmask_la_LDFLAGS = $(MODULE_FLAGS) m_time_la_LDFLAGS = $(MODULE_FLAGS) m_topic_la_LDFLAGS = $(MODULE_FLAGS) m_trace_la_LDFLAGS = $(MODULE_FLAGS) @@ -965,8 +947,6 @@ m_svinfo_la_SOURCES = m_svinfo.c m_svsmode_la_SOURCES = m_svsmode.c m_svsnick_la_SOURCES = m_svsnick.c m_tburst_la_SOURCES = m_tburst.c -m_testline_la_SOURCES = m_testline.c -m_testmask_la_SOURCES = m_testmask.c m_time_la_SOURCES = m_time.c m_topic_la_SOURCES = m_topic.c m_trace_la_SOURCES = m_trace.c @@ -1186,12 +1166,6 @@ m_svsnick.la: $(m_svsnick_la_OBJECTS) $(m_svsnick_la_DEPENDENCIES) $(EXTRA_m_svs m_tburst.la: $(m_tburst_la_OBJECTS) $(m_tburst_la_DEPENDENCIES) $(EXTRA_m_tburst_la_DEPENDENCIES) $(AM_V_CCLD)$(m_tburst_la_LINK) -rpath $(modulesdir) $(m_tburst_la_OBJECTS) $(m_tburst_la_LIBADD) $(LIBS) -m_testline.la: $(m_testline_la_OBJECTS) $(m_testline_la_DEPENDENCIES) $(EXTRA_m_testline_la_DEPENDENCIES) - $(AM_V_CCLD)$(m_testline_la_LINK) -rpath $(modulesdir) $(m_testline_la_OBJECTS) $(m_testline_la_LIBADD) $(LIBS) - -m_testmask.la: $(m_testmask_la_OBJECTS) $(m_testmask_la_DEPENDENCIES) $(EXTRA_m_testmask_la_DEPENDENCIES) - $(AM_V_CCLD)$(m_testmask_la_LINK) -rpath $(modulesdir) $(m_testmask_la_OBJECTS) $(m_testmask_la_LIBADD) $(LIBS) - m_time.la: $(m_time_la_OBJECTS) $(m_time_la_DEPENDENCIES) $(EXTRA_m_time_la_DEPENDENCIES) $(AM_V_CCLD)$(m_time_la_LINK) -rpath $(modulesdir) $(m_time_la_OBJECTS) $(m_time_la_LIBADD) $(LIBS) @@ -1285,8 +1259,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_svsmode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_svsnick.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_tburst.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_testline.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_testmask.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_time.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_topic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_trace.Plo@am__quote@ diff --git a/modules/m_testline.c b/modules/m_testline.c deleted file mode 100644 index b79665c..0000000 --- a/modules/m_testline.c +++ /dev/null @@ -1,248 +0,0 @@ -/* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_testline.c: Tests a hostmask to see what will happen to it. - * - * Copyright (C) 2002 by the past and present ircd coders, and others. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - * - * $Id$ - */ - -#include "stdinc.h" -#include "client.h" -#include "irc_string.h" -#include "ircd_defs.h" -#include "ircd.h" -#include "restart.h" -#include "conf.h" -#include "send.h" -#include "hostmask.h" -#include "numeric.h" -#include "parse.h" -#include "resv.h" -#include "hash.h" -#include "modules.h" - - -/* mo_testline() - * - * inputs - pointer to physical connection request is coming from - * - pointer to source connection request is coming from - * - parc arg count - * - parv actual arguments - * - * output - NONE - * side effects - command to test I/K lines on server - * - * i.e. /quote testline user@host,ip [password] - * - */ -static void -mo_testline(struct Client *client_p, struct Client *source_p, - int parc, char *parv[]) -{ - /* IRCD_BUFSIZE to allow things like *u*s*e*r*n*a*m*e* etc. */ - char given_name[IRCD_BUFSIZE]; - char given_host[IRCD_BUFSIZE]; - char parv1_copy[IRCD_BUFSIZE]; - struct MaskItem *conf = NULL; - struct irc_ssaddr ip; - int host_mask; - enum hostmask_type t; - int matches = 0; - char userhost[HOSTLEN + USERLEN + 2]; - struct split_nuh_item nuh; - - if (EmptyString(parv[1])) - { - sendto_one(source_p, ":%s NOTICE %s :usage: user@host|ip [password]", - me.name, source_p->name); - return; - } - - if (IsChanPrefix(*parv[1])) /* Might be channel resv */ - { - const struct MaskItem *chptr = NULL; - - if ((chptr = match_find_resv(parv[1]))) - { - sendto_one(source_p, form_str(RPL_TESTLINE), - me.name, source_p->name, 'Q', 0, chptr->name, - chptr->reason ? chptr->reason : CONF_NOREASON); - return; - } - } - - strlcpy(parv1_copy, parv[1], sizeof(parv1_copy)); - - nuh.nuhmask = parv[1]; - nuh.nickptr = NULL; - nuh.userptr = given_name; - nuh.hostptr = given_host; - - nuh.nicksize = 0; - nuh.usersize = sizeof(given_name); - nuh.hostsize = sizeof(given_host); - - split_nuh(&nuh); - - t = parse_netmask(given_host, &ip, &host_mask); - - if (t != HM_HOST) - { - conf = find_dline_conf(&ip, -#ifdef IPV6 - (t == HM_IPV6) ? AF_INET6 : AF_INET -#else - AF_INET -#endif - ); - if (conf != NULL) - { - ++matches; - if (conf->type == CONF_EXEMPT) - sendto_one(source_p, - ":%s NOTICE %s :Exempt D-line host [%s] reason [%s]", - me.name, source_p->name, conf->host, conf->reason); - else - sendto_one(source_p, form_str(RPL_TESTLINE), - me.name, source_p->name, - conf->until ? 'd' : 'D', - conf->until ? ((conf->until - CurrentTime) / 60) - : 0L, - conf->host, conf->reason); - } - } - - if (t != HM_HOST) - conf = find_address_conf(given_host, given_name, &ip, -#ifdef IPV6 - (t == HM_IPV6) ? AF_INET6 : AF_INET, -#else - AF_INET, -#endif - parv[2]); - else - conf = find_address_conf(given_host, given_name, NULL, 0, parv[2]); - - if (conf != NULL) - { - snprintf(userhost, sizeof(userhost), "%s@%s", conf->user, conf->host); - - if (conf->type == CONF_CLIENT) - { - sendto_one(source_p, form_str(RPL_TESTLINE), - me.name, source_p->name, 'I', 0L, userhost, - conf->class ? conf->class->name : "<default>"); - ++matches; - } - else if (conf->type == CONF_KLINE) - { - sendto_one(source_p, form_str(RPL_TESTLINE), - me.name, source_p->name, - conf->until ? 'k' : 'K', - conf->until ? ((conf->until - CurrentTime) / 60) - : 0L, - userhost, conf->reason? conf->reason : CONF_NOREASON); - ++matches; - } - } - - conf = find_matching_name_conf(CONF_NRESV, given_name, NULL, NULL, 0); - - if (conf != NULL) - { - sendto_one(source_p, form_str(RPL_TESTLINE), - me.name, source_p->name, 'Q', 0L, - conf->name, - conf->reason ? conf->reason : CONF_NOREASON); - ++matches; - } - - if (matches == 0) - sendto_one(source_p, form_str(RPL_NOTESTLINE), - me.name, source_p->name, parv1_copy); -} - -/* mo_testgecos() - * - * inputs - pointer to physical connection request is coming from - * - pointer to source connection request is coming from - * - parc arg count - * - parv actual arguments - * - * output - always 0 - * side effects - command to test X lines on server - * - * i.e. /quote testgecos gecos - * - */ -static void -mo_testgecos(struct Client *client_p, struct Client *source_p, - int parc, char *parv[]) -{ - struct MaskItem *conf = NULL; - - if (EmptyString(parv[1])) - { - sendto_one(source_p, ":%s NOTICE %s :usage: gecos", - me.name, source_p->name); - return; - } - - if ((conf = find_matching_name_conf(CONF_XLINE, parv[1], NULL, NULL, 0))) - sendto_one(source_p, form_str(RPL_TESTLINE), - me.name, source_p->name, 'X', 0L, - conf->name, conf->reason ? conf->reason : CONF_NOREASON); - else - sendto_one(source_p, form_str(RPL_NOTESTLINE), - me.name, source_p->name, parv[1]); -} - -static struct Message testline_msgtab = { - "TESTLINE", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_testline, m_ignore } -}; - -struct Message testgecos_msgtab = { - "TESTGECOS", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, - { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_testgecos, m_ignore } -}; - -static void -module_init(void) -{ - mod_add_cmd(&testline_msgtab); - mod_add_cmd(&testgecos_msgtab); -} - -static void -module_exit(void) -{ - mod_del_cmd(&testline_msgtab); - mod_del_cmd(&testgecos_msgtab); -} - -struct module module_entry = { - .node = { NULL, NULL, NULL }, - .name = NULL, - .version = "$Revision$", - .handle = NULL, - .modinit = module_init, - .modexit = module_exit, - .flags = 0 -}; diff --git a/modules/m_testmask.c b/modules/m_testmask.c deleted file mode 100644 index 78d02d5..0000000 --- a/modules/m_testmask.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_testmask.c: Counts the birdies err local and remote clients. - * - * Copyright (C) 2005 by Diane Bruce - * Coypright (C) 2005 ircd-hybrid team - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1.Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2.Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3.The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * $Id$ - */ - -#include "stdinc.h" -#include "client.h" -#include "irc_string.h" -#include "ircd_defs.h" -#include "ircd.h" -#include "restart.h" -#include "conf.h" -#include "send.h" -#include "hostmask.h" -#include "numeric.h" -#include "parse.h" -#include "modules.h" - - -/* mo_testmask() - * - * inputs - pointer to physical connection request is coming from - * - pointer to source connection request is coming from - * - parc arg count - * - parv actual arguments - * output - NONE - * side effects - count up clients matching mask - * i.e. /quote testmask user@host - */ -static void -mo_testmask(struct Client *client_p, struct Client *source_p, - int parc, char *parv[]) -{ - struct split_nuh_item nuh; - char given_nick[IRCD_BUFSIZE]; - char given_user[IRCD_BUFSIZE]; - char given_host[IRCD_BUFSIZE]; - unsigned int count[2] = { 0, 0 }; - const dlink_node *ptr = NULL; - - if (EmptyString(parv[1])) - { - sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), - me.name, source_p->name, "TESTMASK"); - return; - } - - nuh.nuhmask = parv[1]; - nuh.nickptr = given_nick; - nuh.userptr = given_user; - nuh.hostptr = given_host; - - nuh.nicksize = sizeof(given_nick); - nuh.usersize = sizeof(given_user); - nuh.hostsize = sizeof(given_host); - - split_nuh(&nuh); - - DLINK_FOREACH(ptr, global_client_list.head) - { - const struct Client *target_p = ptr->data; - - if (!IsClient(target_p) || match(given_nick, target_p->name)) - continue; - - if (!match(given_user, target_p->username)) - if (!match(given_host, target_p->host) || !match(given_host, target_p->sockhost)) - ++count[!MyConnect(target_p)]; - } - - sendto_one(source_p, form_str(RPL_TESTMASK), me.name, - source_p->name, - given_nick, given_user, - given_host, count[0], count[1]); -} - -static struct Message testmask_msgtab = { - "TESTMASK", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, - {m_unregistered, m_not_oper, m_ignore, m_ignore, mo_testmask, m_ignore} -}; - -static void -module_init(void) -{ - mod_add_cmd(&testmask_msgtab); -} - -static void -module_exit(void) -{ - mod_del_cmd(&testmask_msgtab); -} - -struct module module_entry = { - .node = { NULL, NULL, NULL }, - .name = NULL, - .version = "$Revision$", - .handle = NULL, - .modinit = module_init, - .modexit = module_exit, - .flags = 0 -}; |