irc-dev-cvs Mailing List for IRC-Dev ircd development (Page 7)
Brought to you by:
zolty
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(22) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(30) |
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(27) |
Dec
(17) |
2004 |
Jan
|
Feb
(4) |
Mar
|
Apr
(4) |
May
(8) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(14) |
Dec
(2) |
2005 |
Jan
(18) |
Feb
(2) |
Mar
(12) |
Apr
(18) |
May
(16) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
(3) |
Oct
(9) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(5) |
Oct
|
Nov
(3) |
Dec
(2) |
2008 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(8) |
Aug
(14) |
Sep
(4) |
Oct
(11) |
Nov
(1) |
Dec
|
From: Toni G. <zo...@us...> - 2005-01-05 16:31:14
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-01-05 16:31:03 UTC Log message: Directory /cvsroot/irc-dev/ircd-ircdev/doc/en/api added to the repository |
From: Toni G. <zo...@us...> - 2005-01-05 11:58:59
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-01-05 11:58:46 UTC Modified files: ChangeLog ChangeLog.es Makefile.in configure configure.in doc/ircd.sample-en.conf doc/ircd.sample-es.conf include/patchlevel.h include/res.h include/s_bsd.h include/sys.h include/uping.h ircd/.cvsignore ircd/IPcheck.c ircd/gline.c ircd/ircd.c ircd/ircd_auth.c ircd/ircd_lexer.l ircd/ircd_parser.y ircd/ircd_res.c ircd/ircd_string.c ircd/listener.c ircd/match.c ircd/os_generic.c ircd/s_auth.c ircd/s_bsd.c ircd/s_conf.c ircd/s_user.c ircd/uping.c ircd/whocmds.c Added files: ircd/test/.cvsignore ircd/test/Makefile.in ircd/test/ircd_in_addr_t.c ircd/test/test_stub.c Removed files: ircd/test/Makefile Log message: Author: zoltan <zo...@ir...> Log message: 2005-01-05 Toni García <zo...@ir...> 1.0.alpha15 * Parchear Soporte de IPv6 ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.15 ircd-ircdev/ChangeLog:1.16 --- ircd-ircdev/ChangeLog:1.15 Tue Dec 28 03:15:43 2004 +++ ircd-ircdev/ChangeLog Wed Jan 5 03:58:33 2005 @@ -1,10 +1,13 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.15 2004/12/28 11:15:43 zolty Exp $ +# $Id: ChangeLog,v 1.16 2005/01/05 11:58:33 zolty Exp $ # # Insert new changes at beginning of the change list. # +2005-01-05 Toni García <zo...@ir...> 1.0.alpha15 + * Fix IPv6 support + 2004-11-28 Toni García <zo...@ir...> 1.0.alpha14 * Implementation IRC capabilities draft * Undernet synchorinization Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.15 ircd-ircdev/ChangeLog.es:1.16 --- ircd-ircdev/ChangeLog.es:1.15 Tue Dec 28 03:15:43 2004 +++ ircd-ircdev/ChangeLog.es Wed Jan 5 03:58:33 2005 @@ -1,10 +1,13 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.15 2004/12/28 11:15:43 zolty Exp $ +# $Id: ChangeLog.es,v 1.16 2005/01/05 11:58:33 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2005-01-05 Toni García <zo...@ir...> 1.0.alpha15 + * Parchear Soporte de IPv6 + 2004-11-28 Toni García <zo...@ir...> 1.0.alpha14 * Implementacion del estándar "IRC Capabilities" * Sincronizacion Undernet Index: ircd-ircdev/Makefile.in diff -u ircd-ircdev/Makefile.in:1.5 ircd-ircdev/Makefile.in:1.6 --- ircd-ircdev/Makefile.in:1.5 Wed Nov 24 08:11:30 2004 +++ ircd-ircdev/Makefile.in Wed Jan 5 03:58:33 2005 @@ -29,8 +29,8 @@ @SET_MAKE@ #### End of system configuration section. #### -SUBDIRS = doc ircd -IRCD_MAKEFILES = Makefile doc/Makefile ircd/Makefile +SUBDIRS = doc ircd ircd/test +IRCD_MAKEFILES = Makefile doc/Makefile ircd/Makefile ircd/test/Makefile all: build @@ -140,6 +140,9 @@ ircd/Makefile: ircd/Makefile.in config.status ./config.status +ircd/test/Makefile: ircd/test/Makefile.in config.status + ./config.status + config.status: configure ./config.status --recheck Index: ircd-ircdev/configure diff -u ircd-ircdev/configure:1.9 ircd-ircdev/configure:1.10 --- ircd-ircdev/configure:1.9 Wed Nov 24 08:11:30 2004 +++ ircd-ircdev/configure Wed Jan 5 03:58:33 2005 @@ -10187,7 +10187,7 @@ _ACEOF - ac_config_files="$ac_config_files Makefile ircd/Makefile doc/Makefile" + ac_config_files="$ac_config_files Makefile ircd/Makefile ircd/test/Makefile doc/Makefile" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -10719,6 +10719,7 @@ # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "ircd/Makefile" ) CONFIG_FILES="$CONFIG_FILES ircd/Makefile" ;; + "ircd/test/Makefile" ) CONFIG_FILES="$CONFIG_FILES ircd/test/Makefile" ;; "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; Index: ircd-ircdev/configure.in diff -u ircd-ircdev/configure.in:1.8 ircd-ircdev/configure.in:1.9 --- ircd-ircdev/configure.in:1.8 Wed Nov 24 08:11:31 2004 +++ ircd-ircdev/configure.in Wed Jan 5 03:58:34 2005 @@ -22,7 +22,7 @@ dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl -dnl $Id: configure.in,v 1.8 2004/11/24 16:11:31 zolty Exp $ +dnl $Id: configure.in,v 1.9 2005/01/05 11:58:34 zolty Exp $ dnl dnl Make sure we are in the correct directory (someone could have run @@ -749,7 +749,7 @@ [Maximum number of network connections]) dnl Finally really generate all output files: -AC_OUTPUT(Makefile ircd/Makefile doc/Makefile, [echo timestamp > stamp-h]) +AC_OUTPUT(Makefile ircd/Makefile ircd/test/Makefile doc/Makefile, [echo timestamp > stamp-h]) dnl Report configuration echo "IRC-Dev ircd is now hopefully configured for your system." Index: ircd-ircdev/doc/ircd.sample-en.conf diff -u ircd-ircdev/doc/ircd.sample-en.conf:1.9 ircd-ircdev/doc/ircd.sample-en.conf:1.10 --- ircd-ircdev/doc/ircd.sample-en.conf:1.9 Mon Dec 27 03:25:29 2004 +++ ircd-ircdev/doc/ircd.sample-en.conf Wed Jan 5 03:58:34 2005 @@ -53,8 +53,8 @@ # First some information about the server. # General { # name = "servername"; -# vhost = "virtualhost"; -# resolver = "ipaddress"; +# vhost = "ipv4vhost"; +# vhost = "ipv6vhost"; # description = "description"; # numeric = numericnumber; # }; @@ -66,8 +66,9 @@ # it. See "Port" block for listener virtual hosting. If in doubt, # leave it out. # -# You may need to specify the "resolver" address if your compile -# defaults to using IPv6 but your resolvers are all IPv4 hosts. +# You may specify both an IPv4 virtual host and an IPv6 virtual host, +# to indicate which address should be used for outbound connections +# of the respective type. # # Note that "numeric" field has to be unique on the network your server # is running on, must be between 0 and 4095, and is not updated on a rehash. Index: ircd-ircdev/doc/ircd.sample-es.conf diff -u ircd-ircdev/doc/ircd.sample-es.conf:1.5 ircd-ircdev/doc/ircd.sample-es.conf:1.6 --- ircd-ircdev/doc/ircd.sample-es.conf:1.5 Tue Dec 28 03:15:44 2004 +++ ircd-ircdev/doc/ircd.sample-es.conf Wed Jan 5 03:58:34 2005 @@ -59,8 +59,8 @@ # Primero una información sobre el servidor. # General { # name = "nombreservidor"; -# vhost = "virtualhost"; -# resolver = "direccionip"; +# vhost = "ipv4vhost"; +# vhost = "ipv6vhost"; # description = "descripcion"; # numeric = númerodenúmerico; # }; @@ -72,8 +72,9 @@ # "Connect" no la elimina. Veáse el bloque "Port" para la escucha con # virtual hosting. En caso de duda no pongas nada. # -# Puede que necesites especificar la dirección del resolvedor DNS si tu -# has compilado con IPv6 pero tus resolvedores son hosts de IPv4. +# Puedes especificar un virtualhost de IPv4 y un virtualhost de IPv6, +# para indicar cuál de las direcciones se debe utilizar para las +# conexiones salientes del tipo respectivo. # # Observe que el campo "numeric" tiene que ser único en la red si tu # servidor esta funcionando, y debe estar entre 0 y 4095, y no se Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.15 ircd-ircdev/include/patchlevel.h:1.16 --- ircd-ircdev/include/patchlevel.h:1.15 Tue Dec 28 03:15:44 2004 +++ ircd-ircdev/include/patchlevel.h Wed Jan 5 03:58:34 2005 @@ -17,10 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: patchlevel.h,v 1.15 2004/12/28 11:15:44 zolty Exp $ + * $Id: patchlevel.h,v 1.16 2005/01/05 11:58:34 zolty Exp $ * */ -#define PATCHLEVEL ".alpha14" +#define PATCHLEVEL ".alpha15" #define RELEASE "1.0" Index: ircd-ircdev/include/res.h diff -u ircd-ircdev/include/res.h:1.5 ircd-ircdev/include/res.h:1.6 --- ircd-ircdev/include/res.h:1.5 Wed Nov 24 08:00:43 2004 +++ ircd-ircdev/include/res.h Wed Jan 5 03:58:35 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief IRC resolver API. - * @version $Id: res.h,v 1.5 2004/11/24 16:00:43 zolty Exp $ + * @version $Id: res.h,v 1.6 2005/01/05 11:58:35 zolty Exp $ */ #ifndef INCLUDED_res_h @@ -148,9 +148,30 @@ extern void gethost_byname(const char *name, const struct DNSQuery *query); extern void gethost_byaddr(const struct irc_in_addr *addr, const struct DNSQuery *query); -extern int irc_in_addr_valid(const struct irc_in_addr *addr); -extern int irc_in_addr_cmp(const struct irc_in_addr *a, const struct irc_in_addr *b); -extern int irc_in_addr_is_ipv4(const struct irc_in_addr *addr); -extern int irc_in_addr_is_loopback(const struct irc_in_addr *addr); +/** Evaluate to non-zero if \a ADDR is a valid address (not all 0s and not all 1s). */ +#define irc_in_addr_valid(ADDR) (((ADDR)->in6_16[0] && ~(ADDR)->in6_16[0]) \ + || (ADDR)->in6_16[1] != (ADDR)->in6_16[0] \ + || (ADDR)->in6_16[2] != (ADDR)->in6_16[0] \ + || (ADDR)->in6_16[3] != (ADDR)->in6_16[0] \ + || (ADDR)->in6_16[4] != (ADDR)->in6_16[0] \ + || (ADDR)->in6_16[5] != (ADDR)->in6_16[0] \ + || (ADDR)->in6_16[6] != (ADDR)->in6_16[0] \ + || (ADDR)->in6_16[7] != (ADDR)->in6_16[0]) +/** Evaluate to non-zero if \a ADDR (of type struct irc_in_addr) is an IPv4 address. */ +#define irc_in_addr_is_ipv4(ADDR) (!(ADDR)->in6_16[0] && !(ADDR)->in6_16[1] && !(ADDR)->in6_16[2] \ + && !(ADDR)->in6_16[3] && !(ADDR)->in6_16[4] && (ADDR)->in6_16[6] \ + && (!(ADDR)->in6_16[5] || (ADDR)->in6_16[5] == 65535)) +/** Evaluate to non-zero if \a A is a different IP than \a B. */ +#define irc_in_addr_cmp(A,B) (irc_in_addr_is_ipv4(A) ? ((A)->in6_16[6] != (B)->in6_16[6] \ + || (A)->in6_16[7] != (B)->in6_16[7] || !irc_in_addr_is_ipv4(B)) \ + : memcmp((A), (B), sizeof(struct irc_in_addr))) +/** Evaluate to non-zero if \a ADDR is a loopback address. */ +#define irc_in_addr_is_loopback(ADDR) (!(ADDR)->in6_16[0] && !(ADDR)->in6_16[1] && !(ADDR)->in6_16[2] \ + && !(ADDR)->in6_16[3] && !(ADDR)->in6_16[4] \ + && ((!(ADDR)->in6_16[5] \ + && ((!(ADDR)->in6_16[6] && (ADDR)->in6_16[7] == htons(1)) \ + || (ntohs((ADDR)->in6_16[6]) & 0xff00) == 0x7f00)) \ + || (((ADDR)->in6_16[5] == 65535) \ + && (ntohs((ADDR)->in6_16[6]) & 0xff00) == 0x7f00))) #endif Index: ircd-ircdev/include/s_bsd.h diff -u ircd-ircdev/include/s_bsd.h:1.4 ircd-ircdev/include/s_bsd.h:1.5 --- ircd-ircdev/include/s_bsd.h:1.4 Wed Nov 24 08:00:43 2004 +++ ircd-ircdev/include/s_bsd.h Wed Jan 5 03:58:35 2005 @@ -21,7 +21,7 @@ */ /** @file s_bsd.h * @brief Wrapper functions to avoid direct use of BSD APIs. - * @version $Id: s_bsd.h,v 1.4 2004/11/24 16:00:43 zolty Exp $ + * @version $Id: s_bsd.h,v 1.5 2005/01/05 11:58:35 zolty Exp $ */ #ifndef INCLUDED_s_bsd_h #define INCLUDED_s_bsd_h @@ -73,7 +73,8 @@ extern int HighestFd; extern struct Client* LocalClientArray[MAXCONNECTIONS]; -extern struct irc_sockaddr VirtualHost; +extern struct irc_sockaddr VirtualHost_v4; +extern struct irc_sockaddr VirtualHost_v6; /* * Proto types Index: ircd-ircdev/include/sys.h diff -u ircd-ircdev/include/sys.h:1.2 ircd-ircdev/include/sys.h:1.3 --- ircd-ircdev/include/sys.h:1.2 Sun Feb 22 08:13:21 2004 +++ ircd-ircdev/include/sys.h Wed Jan 5 03:58:35 2005 @@ -18,20 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: sys.h,v 1.2 2004/02/22 16:13:21 zolty Exp $ + * $Id: sys.h,v 1.3 2005/01/05 11:58:35 zolty Exp $ * */ #ifndef INCLUDED_sys_h #define INCLUDED_sys_h -#if WORDS_BIGENDIAN -# define BIT_ZERO_ON_LEFT -#else -# define BIT_ZERO_ON_RIGHT -#endif - -#define HAVE_RELIABLE_SIGNALS - /* * safety margin so we can always have one spare fd, for motd/authd or * whatever else. -24 allows "safety" margin of 10 listen ports, 8 servers @@ -39,23 +31,6 @@ */ #define MAXCLIENTS (MAXCONNECTIONS-24) -#ifdef HAVECURSES -#define DOCURSES -#else -#undef DOCURSES -#endif - -#ifdef HAVETERMCAP -#define DOTERMCAP -#else -#undef DOTERMCAP -#endif - -#ifndef CONFIG_SETUGID -#undef IRC_UID -#undef IRC_GID -#endif - /* Define FD_SETSIZE to what we want before including sys/types.h on BSD */ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__) #if ((!defined(USE_POLL)) && (!defined(FD_SETSIZE))) @@ -63,16 +38,7 @@ #endif #endif -#define LIMIT_FMT "%d" - #define IRCD_MAX(a, b) ((a) > (b) ? (a) : (b)) #define IRCD_MIN(a, b) ((a) < (b) ? (a) : (b)) -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef TRUE -#define TRUE 1 -#endif - #endif /* INCLUDED_sys_h */ Index: ircd-ircdev/include/uping.h diff -u ircd-ircdev/include/uping.h:1.3 ircd-ircdev/include/uping.h:1.4 --- ircd-ircdev/include/uping.h:1.3 Wed Nov 24 08:00:44 2004 +++ ircd-ircdev/include/uping.h Wed Jan 5 03:58:35 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief UDP ping implementation. - * @version $Id: uping.h,v 1.3 2004/11/24 16:00:44 zolty Exp $ + * @version $Id: uping.h,v 1.4 2005/01/05 11:58:35 zolty Exp $ */ #ifndef INCLUDED_uping_h #define INCLUDED_uping_h @@ -79,7 +79,6 @@ extern void uping_read(struct UPing* pptr); extern void uping_end(struct UPing* pptr); extern void uping_cancel(struct Client *sptr, struct Client *acptr); -extern void uping_echo(void); extern struct UPing* uping_begin(void); extern int uping_server(struct Client* sptr, struct ConfItem* aconf, int port, int count); Index: ircd-ircdev/ircd/.cvsignore diff -u ircd-ircdev/ircd/.cvsignore:1.3 ircd-ircdev/ircd/.cvsignore:1.4 --- ircd-ircdev/ircd/.cvsignore:1.3 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/.cvsignore Wed Jan 5 03:58:35 2005 @@ -4,6 +4,7 @@ ircd chkconf table_gen +umkpasswd chattr.tab.c autom4te.cache lex.yy.c Index: ircd-ircdev/ircd/IPcheck.c diff -u ircd-ircdev/ircd/IPcheck.c:1.6 ircd-ircdev/ircd/IPcheck.c:1.7 --- ircd-ircdev/ircd/IPcheck.c:1.6 Tue Dec 28 03:15:45 2004 +++ ircd-ircdev/ircd/IPcheck.c Wed Jan 5 03:58:35 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Code to count users connected from particular IP addresses. - * @version $Id: IPcheck.c,v 1.6 2004/12/28 11:15:45 zolty Exp $ + * @version $Id: IPcheck.c,v 1.7 2005/01/05 11:58:35 zolty Exp $ */ #include "config.h" @@ -330,12 +330,15 @@ */ int ip_registry_check_remote(struct Client* cptr, int is_burst) { - struct IPRegistryEntry* entry = ip_registry_find(&cli_ip(cptr)); + struct IPRegistryEntry* entry; /* * Mark that we did add/update an IPregistry entry */ SetIPChecked(cptr); + if (!irc_in_addr_valid(&cli_ip(cptr))) + return 1; + entry = ip_registry_find(&cli_ip(cptr)); if (0 == entry) { entry = ip_registry_new_entry(); ip_registry_canonicalize(&entry->addr, &cli_ip(cptr)); Index: ircd-ircdev/ircd/gline.c diff -u ircd-ircdev/ircd/gline.c:1.9 ircd-ircdev/ircd/gline.c:1.10 --- ircd-ircdev/ircd/gline.c:1.9 Tue Dec 28 03:15:45 2004 +++ ircd-ircdev/ircd/gline.c Wed Jan 5 03:58:35 2005 @@ -23,7 +23,7 @@ */ /** @file * @brief Implementation of Gline manipulation functions. - * @version $Id: gline.c,v 1.9 2004/12/28 11:15:45 zolty Exp $ + * @version $Id: gline.c,v 1.10 2005/01/05 11:58:35 zolty Exp $ */ #include "config.h" @@ -47,14 +47,12 @@ #include "msg.h" #include "numnicks.h" #include "numeric.h" -#include "sys.h" /* FALSE bleah */ #include "whocmds.h" /* #include <assert.h> -- Now using assert in ircd_log.h */ #include <string.h> #include <stdio.h> #include <stdlib.h> -#include <arpa/inet.h> /* for inet_ntoa */ #define CHECK_APPROVED 0 /**< Mask is acceptable */ #define CHECK_OVERRIDABLE 1 /**< Mask is acceptable, but not by default */ @@ -250,7 +248,7 @@ /* let the ops know about it */ sendto_opmask_butone(0, SNO_GLINE, "G-line active for %s", - get_client_name(acptr, TRUE)); + get_client_name(acptr, SHOW_IP)); /* and get rid of him */ if ((tval = exit_client_msg(cptr, acptr, &me, "G-lined (%s)", Index: ircd-ircdev/ircd/ircd.c diff -u ircd-ircdev/ircd/ircd.c:1.9 ircd-ircdev/ircd/ircd.c:1.10 --- ircd-ircdev/ircd/ircd.c:1.9 Tue Dec 28 03:15:45 2004 +++ ircd-ircdev/ircd/ircd.c Wed Jan 5 03:58:35 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Entry point and other initialization functions for the daemon. - * @version $Id: ircd.c,v 1.9 2004/12/28 11:15:45 zolty Exp $ + * @version $Id: ircd.c,v 1.10 2005/01/05 11:58:35 zolty Exp $ */ #include "config.h" @@ -246,79 +246,64 @@ */ static void try_connections(struct Event* ev) { struct ConfItem* aconf; - struct Client* cptr; struct ConfItem** pconf; - int connecting; - int confrq; time_t next = 0; struct ConnectionClass* cltmp; - struct ConfItem* con_conf = 0; struct Jupe* ajupe; - const char* con_class = NULL; + int hold; assert(ET_EXPIRE == ev_type(ev)); assert(0 != ev_timer(ev)); - connecting = FALSE; Debug((DEBUG_NOTICE, "Connection check at : %s", myctime(CurrentTime))); for (aconf = GlobalConfList; aconf; aconf = aconf->next) { - /* Also when already connecting! (update holdtimes) --SRB */ - if (!(aconf->status & CONF_SERVER) || aconf->address.port == 0 || aconf->hold == 0) - continue; - - /* Also skip juped servers */ - if ((ajupe = jupe_find(aconf->name)) && JupeIsActive(ajupe)) - continue; - - /* Skip this entry if the use of it is still on hold until - * future. Otherwise handle this entry (and set it on hold until next - * time). Will reset only hold times, if already made one successfull - * connection... [this algorithm is a bit fuzzy... -- msa >;) ] + /* Only consider server items with non-zero port and non-zero + * connect times that are not actively juped. */ - if (aconf->hold > CurrentTime && (next > aconf->hold || next == 0)) { - next = aconf->hold; + if (!(aconf->status & CONF_SERVER) + || aconf->address.port == 0 + || aconf->hold == 0 + || ((ajupe = jupe_find(aconf->name)) && JupeIsActive(ajupe))) continue; - } + /* Update next possible connection check time. */ + if (next > aconf->hold || next == 0) + next = aconf->hold; + + /* Update the next time we can consider this entry. */ cltmp = aconf->conn_class; - confrq = get_con_freq(cltmp); - if(confrq == 0) - aconf->hold = next = 0; - else - aconf->hold = CurrentTime + confrq; + hold = aconf->hold > CurrentTime; /* before we update aconf->hold */ + aconf->hold = ConFreq(cltmp) ? CurrentTime + ConFreq(cltmp) : 0; - /* Found a CONNECT config with port specified, scan clients and see if - * this server is already connected? + /* Do not try to connect if its use is still on hold until future, + * too many links in its connection class, it is already linked, + * or if connect rules forbid a link now. */ - cptr = FindServer(aconf->name); - - if (!cptr && (Links(cltmp) < MaxLinks(cltmp)) && - (!connecting /*|| (ConClass(cltmp) > con_class)*/)) { - /* - * Check connect rules to see if we're allowed to try - */ - if (0 == conf_eval_crule(aconf->name, CRULE_MASK)) { - con_class = ConClass(cltmp); - con_conf = aconf; - /* We connect only one at time... */ - connecting = TRUE; - } + if (hold + || (Links(cltmp) >= MaxLinks(cltmp)) + || FindServer(aconf->name) + || conf_eval_crule(aconf->name, CRULE_MASK)) { + continue; } - if ((next > aconf->hold) || (next == 0)) - next = aconf->hold; - } - if (connecting) { - if (con_conf->next) { /* are we already last? */ - /* Put the current one at the end and make sure we try all connections */ - for (pconf = &GlobalConfList; (aconf = *pconf); pconf = &(aconf->next)) - if (aconf == con_conf) + + /* Ensure it is at the end of the list for future checks. */ + if (aconf->next) { + /* Find aconf's location in the list and splice it out. */ + for (pconf = &GlobalConfList; *pconf; pconf = &(*pconf)->next) + if (*pconf == aconf) *pconf = aconf->next; - (*pconf = con_conf)->next = 0; + /* Reinsert it at the end of the list (where pconf is now). */ + *pconf = aconf; + aconf->next = 0; } - if (connect_server(con_conf, 0)) + /* Activate the connection itself. */ + if (connect_server(aconf, 0)) sendto_opmask_butone(0, SNO_OLDSNO, "Connection to %s activated.", - con_conf->name); + aconf->name); + + /* And stop looking for further candidates. */ + break; } if (next == 0) Index: ircd-ircdev/ircd/ircd_auth.c diff -u ircd-ircdev/ircd/ircd_auth.c:1.2 ircd-ircdev/ircd/ircd_auth.c:1.3 --- ircd-ircdev/ircd/ircd_auth.c:1.2 Tue Dec 28 03:15:45 2004 +++ ircd-ircdev/ircd/ircd_auth.c Wed Jan 5 03:58:35 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief IAuth client implementation for an IRC server. - * @version $Id: ircd_auth.c,v 1.2 2004/12/28 11:15:45 zolty Exp $ + * @version $Id: ircd_auth.c,v 1.3 2005/01/05 11:58:35 zolty Exp $ */ #include "config.h" #include "client.h" @@ -51,7 +51,6 @@ #include <unistd.h> #include <sys/socket.h> #include <netinet/in.h> -#include <arpa/inet.h> #ifdef HAVE_STDINT_H #include <stdint.h> #endif @@ -448,6 +447,7 @@ */ static void iauth_reconnect(struct IAuth *iauth) { + struct irc_sockaddr *local; IOResult result; int fd; @@ -459,7 +459,8 @@ gethost_byname(i_host(iauth), &i_query(iauth)); return; } - fd = os_socket(&VirtualHost, SOCK_STREAM, "IAuth"); + local = irc_in_addr_is_ipv4(&i_addr(iauth).addr) ? &VirtualHost_v4 : &VirtualHost_v6; + fd = os_socket(local, SOCK_STREAM, "IAuth"); if (fd < 0) return; if (!os_set_sockbufs(fd, SERVER_TCP_WINDOW, SERVER_TCP_WINDOW)) { Index: ircd-ircdev/ircd/ircd_lexer.l diff -u ircd-ircdev/ircd/ircd_lexer.l:1.6 ircd-ircdev/ircd/ircd_lexer.l:1.7 --- ircd-ircdev/ircd/ircd_lexer.l:1.6 Tue Dec 28 03:15:45 2004 +++ ircd-ircdev/ircd/ircd_lexer.l Wed Jan 5 03:58:35 2005 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: ircd_lexer.l,v 1.6 2004/12/28 11:15:45 zolty Exp $ + * $Id: ircd_lexer.l,v 1.7 2005/01/05 11:58:35 zolty Exp $ * */ @@ -78,7 +78,6 @@ TOKEN(OPER), TOKEN(LOCAL), TOKEN(VHOST), - TOKEN(RESOLVER), TOKEN(MASK), TOKEN(HIDDEN), TOKEN(MOTD), Index: ircd-ircdev/ircd/ircd_parser.y diff -u ircd-ircdev/ircd/ircd_parser.y:1.8 ircd-ircdev/ircd/ircd_parser.y:1.9 --- ircd-ircdev/ircd/ircd_parser.y:1.8 Tue Dec 28 03:15:45 2004 +++ ircd-ircdev/ircd/ircd_parser.y Wed Jan 5 03:58:35 2005 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: ircd_parser.y,v 1.8 2004/12/28 11:15:45 zolty Exp $ + * $Id: ircd_parser.y,v 1.9 2005/01/05 11:58:35 zolty Exp $ * */ %{ @@ -67,7 +67,6 @@ extern struct ServerConf* serverConfList; extern struct s_map* GlobalServiceMapList; extern struct qline* GlobalQuarantineList; - extern struct irc_sockaddr ResolverAddr; int yylex(void); /* Now all the globals we need :/... */ @@ -138,7 +137,6 @@ %token NO %token OPER %token VHOST -%token RESOLVER %token HIDDEN %token MOTD %token JUPE @@ -275,7 +273,7 @@ parse_error("Your General block must contain a numeric (between 1 and 4095)."); } ';' ; generalitems: generalitem generalitems | generalitem; -generalitem: generalnumeric | generalname | generalvhost | generalresolver | generaldesc | error; +generalitem: generalnumeric | generalname | generalvhost | generaldesc | error; generalnumeric: NUMERIC '=' NUMBER ';' { if (localConf.numeric == 0) @@ -303,12 +301,13 @@ generalvhost: VHOST '=' QSTRING ';' { - ircd_aton(&VirtualHost.addr, $3); -}; - -generalresolver: RESOLVER '=' QSTRING ';' -{ - ircd_aton(&ResolverAddr.addr, $3); + struct irc_in_addr addr; + if (!ircd_aton(&addr, $3)) + parse_error("Invalid virtual host '%s'.", $3); + else if (irc_in_addr_is_ipv4(&addr)) + memcpy(&VirtualHost_v4.addr, &addr, sizeof(addr)); + else + memcpy(&VirtualHost_v6.addr, &addr, sizeof(addr)); }; adminblock: ADMIN '{' adminitems '}' Index: ircd-ircdev/ircd/ircd_res.c diff -u ircd-ircdev/ircd/ircd_res.c:1.2 ircd-ircdev/ircd/ircd_res.c:1.3 --- ircd-ircdev/ircd/ircd_res.c:1.2 Tue Dec 28 03:15:45 2004 +++ ircd-ircdev/ircd/ircd_res.c Wed Jan 5 03:58:35 2005 @@ -41,7 +41,7 @@ */ /** @file * @brief IRC resolver functions. - * @version $Id: ircd_res.c,v 1.2 2004/12/28 11:15:45 zolty Exp $ + * @version $Id: ircd_res.c,v 1.3 2005/01/05 11:58:35 zolty Exp $ */ #include "client.h" #include "ircd_alloc.h" @@ -72,8 +72,10 @@ #error this code needs to be able to address individual octets #endif -/** Resolver UDP socket. */ -static struct Socket res_socket; +/** IPv4 resolver UDP socket. */ +static struct Socket res_socket_v4; +/** IPv6 resolver UDP socket. */ +static struct Socket res_socket_v6; /** Next DNS lookup timeout. */ static struct Timer res_timeout; /** Check for whether the resolver has been initialized yet. */ @@ -162,8 +164,6 @@ extern int irc_nscount; extern char irc_domain[HOSTLEN]; -struct irc_sockaddr ResolverAddr; - /** Check whether \a inp is a nameserver we use. * @param[in] inp Nameserver address. * @return Non-zero if we trust \a inp; zero if not. @@ -193,17 +193,24 @@ if (!request_list.next) request_list.next = request_list.prev = &request_list; - if (!s_active(&res_socket)) + if (!s_active(&res_socket_v4)) { - struct irc_sockaddr *local; - int fd; - local = irc_in_addr_valid(&ResolverAddr.addr) ? &ResolverAddr : &VirtualHost; - fd = os_socket(local, SOCK_DGRAM, "Resolver UDP socket"); - if (fd < 0) return; - if (!socket_add(&res_socket, res_readreply, NULL, SS_DATAGRAM, - SOCK_EVENT_READABLE, fd)) return; - timer_init(&res_timeout); + int fd = os_socket(&VirtualHost_v4, SOCK_DGRAM, "Resolver UDPv4 socket"); + if (fd >= 0) + socket_add(&res_socket_v4, res_readreply, NULL, + SS_DATAGRAM, SOCK_EVENT_READABLE, fd); + } + + if (!s_active(&res_socket_v6)) + { + int fd = os_socket(&VirtualHost_v6, SOCK_DGRAM, "Resolver UDPv6 socket"); + if (fd >= 0) + socket_add(&res_socket_v6, res_readreply, NULL, + SS_DATAGRAM, SOCK_EVENT_READABLE, fd); } + + if (s_active(&res_socket_v4) || s_active(&res_socket_v6)) + timer_init(&res_timeout); } /** Append local domain to hostname if needed. @@ -387,9 +394,11 @@ if (max_queries == 0) max_queries = 1; - for (i = 0; i < max_queries; i++) - if (os_sendto_nonb(s_fd(&res_socket), msg, len, NULL, 0, &irc_nsaddr_list[i]) == IO_SUCCESS) + for (i = 0; i < max_queries; i++) { + int fd = irc_in_addr_is_ipv4(&irc_nsaddr_list[i].addr) ? s_fd(&res_socket_v4) : s_fd(&res_socket_v6); + if (os_sendto_nonb(fd, msg, len, NULL, 0, &irc_nsaddr_list[i]) == IO_SUCCESS) ++sent; + } return(sent); } @@ -755,7 +764,7 @@ unsigned int rc; int answer_count; - assert(ev_socket(ev) == &res_socket); + assert((ev_socket(ev) == &res_socket_v4) || (ev_socket(ev) == &res_socket_v6)); sock = ev_socket(ev); if (IO_SUCCESS != os_recvfrom_nonb(s_fd(sock), buf, sizeof(buf), &rc, &lsin) @@ -941,55 +950,3 @@ ":Resolver: requests %d(%d)", request_count, request_mem); return request_mem; } - -/** Check whether an address looks valid. - * This means not all 0s and not all 1s. - * @param[in] addr Address to check for validity. - * @return Non-zero if the address looks valid. - */ -int irc_in_addr_valid(const struct irc_in_addr *addr) -{ - unsigned int ii; - unsigned short val; - - val = addr->in6_16[0]; - if (val != 0 && val != 0xffff) - return 1; - for (ii = 1; ii < 8; ii++) - if (addr->in6_16[ii] != val) - return 1; - return 0; -} - -/** Compare two IP addresses. - * @param[in] a First address to compare. - * @param[in] b Second address to compare. - * @return Non-zero if the two addresses differ, zero if they are identical. - */ -int irc_in_addr_cmp(const struct irc_in_addr *a, const struct irc_in_addr *b) -{ - if (irc_in_addr_is_ipv4(a)) - return a->in6_16[6] != b->in6_16[6] - || a->in6_16[7] != b->in6_16[7] - || !irc_in_addr_is_ipv4(b); - else - return memcmp(a, b, sizeof(*a)); -} - -/** Indicate whether an IP address is a loopback address. - * @param[in] addr Address to check. - * @return Non-zero if the address is loopback; zero if not. - */ -int irc_in_addr_is_loopback(const struct irc_in_addr *addr) -{ - if (addr->in6_16[0] != 0 - || addr->in6_16[1] != 0 - || addr->in6_16[2] != 0 - || addr->in6_16[3] != 0 - || addr->in6_16[4] != 0) - return 0; - if ((addr->in6_16[5] == 0xffff) || (addr->in6_16[5] == 0 && addr->in6_16[6] != 0)) - return (ntohs(addr->in6_16[6]) & 0xff00) == 0x7f00; - else - return addr->in6_16[5] == 0 && addr->in6_16[6] == 0 && htons(addr->in6_16[7]) == 1; -} Index: ircd-ircdev/ircd/ircd_string.c diff -u ircd-ircdev/ircd/ircd_string.c:1.5 ircd-ircdev/ircd/ircd_string.c:1.6 --- ircd-ircdev/ircd/ircd_string.c:1.5 Tue Dec 28 03:15:46 2004 +++ ircd-ircdev/ircd/ircd_string.c Wed Jan 5 03:58:35 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of string operations. - * @version $Id: ircd_string.c,v 1.5 2004/12/28 11:15:46 zolty Exp $ + * @version $Id: ircd_string.c,v 1.6 2005/01/05 11:58:35 zolty Exp $ */ #include "config.h" @@ -453,22 +453,6 @@ return ircd_ntoa_r(buf, in); } -/* This doesn't really belong here, but otherwise umkpasswd breaks. */ -/** Check whether an IP address looks like an IPv4 address. - * @param[in] addr Address to check. - * @return Non-zero if the address is a valid IPv4 address, zero if not. - */ -int irc_in_addr_is_ipv4(const struct irc_in_addr *addr) -{ - return addr->in6_16[0] == 0 - && addr->in6_16[1] == 0 - && addr->in6_16[2] == 0 - && addr->in6_16[3] == 0 - && addr->in6_16[4] == 0 - && (addr->in6_16[5] == 0 || addr->in6_16[5] == 0xffff) - && addr->in6_16[6] != 0; -} - /** Convert an IP address to printable ASCII form. * @param[out] buf Output buffer to write to. * @param[in] in Address to format. @@ -539,8 +523,6 @@ if (ii < 7) APPEND(':'); } - if (max_zeros + max_start == 8) - APPEND(':'); #undef APPEND /* Nul terminate and return number of characters used. */ @@ -653,24 +635,31 @@ case '.': { uint32_t ip4; unsigned int len; - len = ircd_aton_ip4(input + pos, &ip4); + len = ircd_aton_ip4(part_start, &ip4); if (!len || (ii > 6)) return 0; ip->in6_16[ii++] = htons(ntohl(ip4) >> 16); ip->in6_16[ii++] = htons(ntohl(ip4) & 65535); - pos += len; - break; + if (colon < 8) { + unsigned int jj; + /* Shift stuff after "::" up and fill middle with zeros. */ + for (jj = 0; jj < ii - colon; jj++) + ip->in6_16[7 - jj] = ip->in6_16[ii - jj - 1]; + for (jj = 0; jj < 8 - ii; jj++) + ip->in6_16[colon + jj] = 0; + } + return part_start - input + len; } default: { - unsigned int jj; - if (colon >= 8) - return 0; - /* Shift stuff after "::" up and fill middle with zeros. */ ip->in6_16[ii++] = htons(part); - for (jj = 0; jj < ii - colon; jj++) - ip->in6_16[7 - jj] = ip->in6_16[ii - jj - 1]; - for (jj = 0; jj < 8 - ii; jj++) - ip->in6_16[colon + jj] = 0; + if (colon < 8) { + unsigned int jj; + /* Shift stuff after "::" up and fill middle with zeros. */ + for (jj = 0; jj < ii - colon; jj++) + ip->in6_16[7 - jj] = ip->in6_16[ii - jj - 1]; + for (jj = 0; jj < 8 - ii; jj++) + ip->in6_16[colon + jj] = 0; + } return pos; } } Index: ircd-ircdev/ircd/listener.c diff -u ircd-ircdev/ircd/listener.c:1.6 ircd-ircdev/ircd/listener.c:1.7 --- ircd-ircdev/ircd/listener.c:1.6 Tue Dec 28 03:15:46 2004 +++ ircd-ircdev/ircd/listener.c Wed Jan 5 03:58:35 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation for handling listening sockets. - * @version $Id: listener.c,v 1.6 2004/12/28 11:15:46 zolty Exp $ + * @version $Id: listener.c,v 1.7 2005/01/05 11:58:35 zolty Exp $ */ #include "config.h" @@ -53,7 +53,6 @@ #include <unistd.h> #include <netdb.h> #include <sys/socket.h> -#include <arpa/inet.h> /** List of listening sockets. */ struct Listener* ListenerPollList = 0; Index: ircd-ircdev/ircd/match.c diff -u ircd-ircdev/ircd/match.c:1.4 ircd-ircdev/ircd/match.c:1.5 --- ircd-ircdev/ircd/match.c:1.4 Wed Nov 24 08:06:15 2004 +++ ircd-ircdev/ircd/match.c Wed Jan 5 03:58:35 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Functions to match strings against IRC mask strings. - * @version $Id: match.c,v 1.4 2004/11/24 16:06:15 zolty Exp $ + * @version $Id: match.c,v 1.5 2005/01/05 11:58:35 zolty Exp $ */ #include "config.h" @@ -852,7 +852,6 @@ #include <string.h> #include <sys/socket.h> #include <netinet/in.h> -#include <arpa/inet.h> /** Parse an input string as an IPv4 address. * @param[in] in Text form of address. @@ -862,15 +861,13 @@ static int ipmask_parse_ipv4(const char *in, struct in_addr *out) { int class; - char ipname[16]; int ad[4] = { 0 }; int bits = 0; class = sscanf(in, "%d.%d.%d.%d/%d", &ad[0], &ad[1], &ad[2], &ad[3], &bits); if (class != 5) bits = class * 8; - ircd_snprintf(0, ipname, sizeof(ipname), "%d.%d.%d.%d", ad[0], ad[1], ad[2], ad[3]); - out->s_addr = inet_addr(ipname); + out->s_addr = ntohl((ad[0] << 24) | (ad[1] << 16) | (ad[2] << 8) | ad[3]); return bits; } Index: ircd-ircdev/ircd/os_generic.c diff -u ircd-ircdev/ircd/os_generic.c:1.4 ircd-ircdev/ircd/os_generic.c:1.5 --- ircd-ircdev/ircd/os_generic.c:1.4 Tue Dec 28 03:15:46 2004 +++ ircd-ircdev/ircd/os_generic.c Wed Jan 5 03:58:35 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of OS-dependent operations. - * @version $Id: os_generic.c,v 1.4 2004/12/28 11:15:46 zolty Exp $ + * @version $Id: os_generic.c,v 1.5 2005/01/05 11:58:35 zolty Exp $ */ #include "config.h" @@ -110,28 +110,18 @@ socklen_t slen; int family; + assert(irc != 0); slen = sizeof(sin6); - if (0 <= compat_fd) { - if (0 == getsockname(compat_fd, (struct sockaddr*)&sin6, &slen)) - family = sin6.sin6_family; - else if (irc_in_addr_is_ipv4(&VirtualHost.addr)) - family = AF_INET; - else - family = AF_INET6; - } else { - if (irc_in_addr_is_ipv4(&irc->addr)) - family = AF_INET; - else - family = AF_INET6; - } + if ((0 <= compat_fd) + && (0 == getsockname(compat_fd, (struct sockaddr*)&sin6, &slen))) + family = sin6.sin6_family; + else if ((irc == &VirtualHost_v4) || irc_in_addr_is_ipv4(&irc->addr)) + family = AF_INET; + else + family = AF_INET6; - memset(v6, 0, sizeof(*v6)); - if (!irc) { - memset(v6, 0, sizeof(v6)); - v6->sin6_family = AF_INET6; - return sizeof(*v6); - } - else if ((family == AF_INET) && irc_in_addr_is_ipv4(&irc->addr)) { + memset(v6, 0, sizeof(*v6)); + if (family == AF_INET) { struct sockaddr_in *v4 = (struct sockaddr_in*)v6; v4->sin_family = AF_INET; memcpy(&v4->sin_addr, &irc->addr.in6_16[6], sizeof(v4->sin_addr)); @@ -160,6 +150,7 @@ int sockaddr_from_irc(struct sockaddr_in *v4, const struct irc_sockaddr *irc, int compat_fd) { + assert(irc != 0); v4->sin_family = AF_INET; if (irc) { assert(!irc->addr.in6_16[0] && !irc->addr.in6_16[1] && !irc->addr.in6_16[2] && !irc->addr.in6_16[3] && !irc->addr.in6_16[4] && (!irc->addr.in6_16[5] || irc->addr.in6_16[5] == 0xffff)); @@ -520,6 +511,7 @@ errno = 0; size = sockaddr_from_irc(&addr, peer, fd); + assert((addr.sn_family == AF_INET) == irc_in_addr_is_ipv4(&peer->addr)); if (-1 < (res = sendto(fd, buf, length, flags, (struct sockaddr*)&addr, size))) { if (count_out) *count_out = (unsigned) res; @@ -621,6 +613,7 @@ struct sockaddr_native addr; int size, fd; + assert(local != 0); size = sockaddr_from_irc(&addr, local, -1); fd = socket(addr.sn_family, type, 0); if (fd < 0) { Index: ircd-ircdev/ircd/s_auth.c diff -u ircd-ircdev/ircd/s_auth.c:1.6 ircd-ircdev/ircd/s_auth.c:1.7 --- ircd-ircdev/ircd/s_auth.c:1.6 Tue Dec 28 03:15:46 2004 +++ ircd-ircdev/ircd/s_auth.c Wed Jan 5 03:58:35 2005 @@ -22,7 +22,7 @@ */ /** @file * @brief Implementation of DNS and ident lookups. - * @version $Id: s_auth.c,v 1.6 2004/12/28 11:15:46 zolty Exp $ + * @version $Id: s_auth.c,v 1.7 2005/01/05 11:58:35 zolty Exp $ */ #include "config.h" @@ -49,7 +49,6 @@ #include "struct.h" #include "sys.h" /* TRUE bleah */ -#include <arpa/inet.h> /* inet_netof */ #include <netdb.h> /* struct hostent */ #include <string.h> #include <stdlib.h> Index: ircd-ircdev/ircd/s_bsd.c diff -u ircd-ircdev/ircd/s_bsd.c:1.7 ircd-ircdev/ircd/s_bsd.c:1.8 --- ircd-ircdev/ircd/s_bsd.c:1.7 Tue Dec 28 03:15:46 2004 +++ ircd-ircdev/ircd/s_bsd.c Wed Jan 5 03:58:35 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Functions that now (or in the past) relied on BSD APIs. - * @version $Id: s_bsd.c,v 1.7 2004/12/28 11:15:46 zolty Exp $ + * @version $Id: s_bsd.c,v 1.8 2005/01/05 11:58:35 zolty Exp $ */ #include "config.h" @@ -60,7 +60,6 @@ #include "uping.h" #include "version.h" -#include <arpa/inet.h> /* #include <assert.h> -- Now using assert in ircd_log.h */ #include <errno.h> #include <fcntl.h> @@ -82,8 +81,10 @@ struct Client* LocalClientArray[MAXCONNECTIONS]; /** Maximum file descriptor in current use. */ int HighestFd = -1; -/** Default local address for outbound connections. */ -struct irc_sockaddr VirtualHost; +/** Default local address for outbound IPv4 connections. */ +struct irc_sockaddr VirtualHost_v4; +/** Default local address for outbound IPv6 connections. */ +struct irc_sockaddr VirtualHost_v6; /** Temporary buffer for reading data from a peer. */ static char readbuf[SERVER_TCP_WINDOW]; @@ -237,8 +238,10 @@ */ if (irc_in_addr_valid(&aconf->origin.addr)) local = &aconf->origin; + else if (irc_in_addr_is_ipv4(&aconf->address.addr)) + local = &VirtualHost_v4; else - local = &VirtualHost; + local = &VirtualHost_v6; cli_fd(cptr) = os_socket(local, SOCK_STREAM, cli_name(cptr)); if (cli_fd(cptr) < 0) return 0; Index: ircd-ircdev/ircd/s_conf.c diff -u ircd-ircdev/ircd/s_conf.c:1.8 ircd-ircdev/ircd/s_conf.c:1.9 --- ircd-ircdev/ircd/s_conf.c:1.8 Tue Dec 28 03:15:46 2004 +++ ircd-ircdev/ircd/s_conf.c Wed Jan 5 03:58:35 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief ircd configuration file driver - * @version $Id: s_conf.c,v 1.8 2004/12/28 11:15:46 zolty Exp $ + * @version $Id: s_conf.c,v 1.9 2005/01/05 11:58:35 zolty Exp $ */ #include "config.h" @@ -59,7 +59,6 @@ #include "sys.h" /* #include <assert.h> -- Now using assert in ircd_log.h */ -#include <arpa/inet.h> #include <errno.h> #include <fcntl.h> #include <netdb.h> Index: ircd-ircdev/ircd/s_user.c diff -u ircd-ircdev/ircd/s_user.c:1.9 ircd-ircdev/ircd/s_user.c:1.10 --- ircd-ircdev/ircd/s_user.c:1.9 Tue Dec 28 03:15:47 2004 +++ ircd-ircdev/ircd/s_user.c Wed Jan 5 03:58:35 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Miscellaneous user-related helper functions. - * @version $Id: s_user.c,v 1.9 2004/12/28 11:15:47 zolty Exp $ + * @version $Id: s_user.c,v 1.10 2005/01/05 11:58:35 zolty Exp $ */ #include "config.h" @@ -1706,7 +1706,7 @@ /** Check whether \a sptr is allowed to send a message to \a acptr. * If \a sptr is a remote user, it means some server has an outdated * SILENCE list for \a acptr, so send the missing SILENCE mask(s) back - * in the direction of \a sptr. + * in the direction of \a sptr. Skip the check if \a sptr is a server. * @param[in] sptr Client trying to send a message. * @param[in] acptr Destination of message. * @return Non-zero if \a sptr is SILENCEd by \a acptr, zero if not. @@ -1718,7 +1718,7 @@ size_t buf_used, slen; char buf[BUFSIZE]; - if (!(user = cli_user(acptr)) + if (IsServer(sptr) || !(user = cli_user(acptr)) || !(found = find_ban(sptr, user->silence))) return 0; assert(!(found->flags & BAN_EXCEPTION)); Index: ircd-ircdev/ircd/test/.cvsignore diff -u /dev/null ircd-ircdev/ircd/test/.cvsignore:1.1 --- /dev/null Wed Jan 5 03:58:51 2005 +++ ircd-ircdev/ircd/test/.cvsignore Wed Jan 5 03:58:36 2005 @@ -0,0 +1,4 @@ +Makefile +ircd_chattr_t +ircd_in_addr_t +ircd_string_t Index: ircd-ircdev/ircd/test/Makefile diff -u ircd-ircdev/ircd/test/Makefile:1.1.1.1 ircd-ircdev/ircd/test/Makefile:removed --- ircd-ircdev/ircd/test/Makefile:1.1.1.1 Mon Sep 8 03:34:31 2003 +++ ircd-ircdev/ircd/test/Makefile Wed Jan 5 03:58:51 2005 @@ -1,20 +0,0 @@ - -CPPFLAGS = -I../../include -I../../config -CFLAGS = -g -Wall - -TESTPROGS = \ - ircd_chattr_t \ - ircd_string_t - -all: ${TESTPROGS} - -ircd_chattr_t: ircd_chattr_t.o ../ircd_string.o - ${CC} -o $@ $^ - -ircd_string_t: ircd_string_t.o ../ircd_string.o - ${CC} -o $@ $^ - -.PHONY: clean - -clean: - rm -f core *.o ${TESTPROGS} Index: ircd-ircdev/ircd/test/Makefile.in diff -u /dev/null ircd-ircdev/ircd/test/Makefile.in:1.1 --- /dev/null Wed Jan 5 03:58:52 2005 +++ ircd-ircdev/ircd/test/Makefile.in Wed Jan 5 03:58:36 2005 @@ -0,0 +1,54 @@ +# IRC-Dev IRCD - An advanced and innovative IRC Daemon, ircd/test/Makefile + +# Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> +# Copyright (C) 1997 Carlo Wood +# Copyright (C) 1990 Jarkko Oikarinen + +# 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: Makefile.in,v 1.1 2005/01/05 11:58:36 zolty Exp $ + +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +CPPFLAGS = -I${top_srcdir}/include -I../.. +CFLAGS = -g -Wall + +TESTPROGS = \ + ircd_chattr_t \ + ircd_string_t \ + ircd_in_addr_t + +all: ${TESTPROGS} + +build: ${TESTPROGS} + +depend: + +ircd_chattr_t: ircd_chattr_t.o test_stub.o ../ircd_string.o + ${CC} -o $@ $^ + +ircd_string_t: ircd_string_t.o test_stub.o ../ircd_string.o + ${CC} -o $@ $^ + +ircd_in_addr_t: ircd_in_addr_t.o test_stub.o ../ircd_alloc.o ../ircd_string.o ../match.o ../numnicks.o + ${CC} -o $@ $^ + +.PHONY: distclean clean + +distclean: clean + rm -f Makefile + +clean: + rm -f core *.o ${TESTPROGS} Index: ircd-ircdev/ircd/test/ircd_in_addr_t.c diff -u /dev/null ircd-ircdev/ircd/test/ircd_in_addr_t.c:1.1 --- /dev/null Wed Jan 5 03:58:52 2005 +++ ircd-ircdev/ircd/test/ircd_in_addr_t.c Wed Jan 5 03:58:36 2005 @@ -0,0 +1,92 @@ +/* ircd_in_addr_t.c - Test file for IP address manipulation */ + +#include "ircd_log.h" +#include "ircd_string.h" +#include "numnicks.h" +#include "res.h" +#include <stdio.h> +#include <string.h> +#include <netinet/in.h> + +/** Structure to describe a test for IP address parsing and unparsing. */ +struct address_test { + const char *text; /**< Textual address to parse. */ + const char *canonical; /**< Canonical form of address. */ + struct irc_in_addr expected; /**< Parsed address. */ + const char *base64_v4; /**< v4-only compatible base64 encoding. */ + const char *base64_v6; /**< v6-compatible base64 encoding. */ + unsigned int is_valid : 1; /**< is address valid? */ + unsigned int is_ipv4 : 1; /**< is address ipv4? */ + unsigned int is_loopback : 1; /**< is address loopback? */ +}; + +/** Array of addresses to test with. */ +static struct address_test test_addrs[] = { + { "::", "0::", + {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, + "AAAAAA", "_", 0, 0, 0 }, + { "::1", "0::1", + {{ 0, 0, 0, 0, 0, 0, 0, 1 }}, + "AAAAAA", "_AAB", 1, 0, 1 }, + { "127.0.0.1", "127.0.0.1", + {{ 0, 0, 0, 0, 0, 0, 0x7f00, 1 }}, + "B]AAAB", "B]AAAB", 1, 1, 1 }, + { "::ffff:127.0.0.3", "127.0.0.3", + {{ 0, 0, 0, 0, 0, 0xffff, 0x7f00, 3 }}, + "B]AAAD", "B]AAAD", 1, 1, 1 }, + { "2002:7f00:3::1", "2002:7f00:3::1", + {{ 0x2002, 0x7f00, 3, 0, 0, 0, 0, 1 }}, + "B]AAAD", "CACH8AAAD_AAB", 1, 0, 0 }, + { "8352:0344:0:0:0:0:2001:1204", "8352:344::2001:1204", + {{ 0x8352, 0x344, 0, 0, 0, 0, 0x2001, 0x1204 }}, + "AAAAAA", "INSANE_CABBIE", 1, 0, 0 }, + { 0 }, +}; + +/** Perform tests for a single IP address. + * @param[in] addr Address test structure. + */ +static void +test_address(struct address_test *addr) +{ + struct irc_in_addr parsed; + unsigned int ii, len, val; + char unparsed[64], base64_v4[64], base64_v6[64]; + + /* Convert expected address to network order. */ + for (ii = 0; ii < 8; ++ii) + addr->expected.in6_16[ii] = htons(addr->expected.in6_16[ii]); + /* Make sure the text form is parsed as expected. */ + len = ircd_aton(&parsed, addr->text); + assert(len == strlen(addr->text)); + assert(!irc_in_addr_cmp(&parsed, &addr->expected)); + /* Make sure it converts back to ASCII. */ + ircd_ntoa_r(unparsed, &parsed); + assert(!strcmp(unparsed, addr->canonical)); + /* Check IP-to-base64 conversion. */ + iptobase64(base64_v4, &parsed, sizeof(base64_v4), 0); + iptobase64(base64_v6, &parsed, sizeof(base64_v6), 1); + if (addr->base64_v4) + assert(!strcmp(base64_v4, addr->base64_v4)); + if (addr->base64_v6) + assert(!strcmp(base64_v6, addr->base64_v6)); + /* Check testable attributes. */ + val = irc_in_addr_valid(&parsed); + assert(!!val == addr->is_valid); + val = irc_in_addr_is_ipv4(&parsed); + assert(!!val == addr->is_ipv4); + val = irc_in_addr_is_loopback(&parsed); + assert(!!val == addr->is_loopback); + printf("Passed: %s (%s/%s)\n", addr->text, base64_v4, base64_v6); +} + +int +main(int argc, char *argv[]) +{ + unsigned int ii; + + for (ii = 0; test_addrs[ii].text; ++ii) + test_address(&test_addrs[ii]); + + return 0; +} Index: ircd-ircdev/ircd/test/test_stub.c diff -u /dev/null ircd-ircdev/ircd/test/test_stub.c:1.1 --- /dev/null Wed Jan 5 03:58:52 2005 +++ ircd-ircdev/ircd/test/test_stub.c Wed Jan 5 03:58:36 2005 @@ -0,0 +1,39 @@ +/* test_stub.c - support stubs for test programs */ + +#include "client.h" +#include "ircd_log.h" +#include "s_debug.h" +#include <stdarg.h> +#include <stdio.h> + +struct Client me; +int log_inassert; + +void +log_write(enum LogSys subsys, enum LogLevel severity, unsigned int flags, + const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + vfprintf(stderr, fmt, args); + va_end(args); +} + +void +debug(int level, const char *form, ...) +{ + va_list args; + + va_start(args, form); + vfprintf(stdout, form, args); + va_end(args); +} + +int +exit_client(struct Client *cptr, struct Client *bcptr, struct Client *sptr, + const char *comment) +{ + Debug((DEBUG_LIST, "exit_client(%p, %p, %p, \"%s\")\n", cptr, bcptr, sptr, comment)); + return 0; +} Index: ircd-ircdev/ircd/uping.c diff -u ircd-ircdev/ircd/uping.c:1.5 ircd-ircdev/ircd/uping.c:1.6 --- ircd-ircdev/ircd/uping.c:1.5 Tue Dec 28 03:15:47 2004 +++ ircd-ircdev/ircd/uping.c Wed Jan 5 03:58:35 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief UDP ping implementation. - * @version $Id: uping.c,v 1.5 2004/12/28 11:15:47 zolty Exp $ + * @version $Id: uping.c,v 1.6 2005/01/05 11:58:35 zolty Exp $ */ #include "config.h" @@ -45,7 +45,6 @@ #include "send.h" #include "sys.h" -#include <arpa/inet.h> /* #include <assert.h> -- Now using assert in ircd_log.h */ #include <errno.h> #include <netdb.h> @@ -59,8 +58,8 @@ #define UPINGTIMEOUT 60 /**< Timeout waiting for ping responses */ static struct UPing* pingList = 0; /**< Linked list of UPing structs */ -static int UPingFileDescriptor = -1; /**< UDP listener socket for upings */ -static struct Socket upingSock; /**< Socket struct for upings */ +static struct Socket upingSock_v4; /**< Socket struct for IPv4 upings */ +static struct Socket upingSock_v6; /**< Socket struct for IPv6 upings */ /** Start iteration of uping list. * @return Start of uping list. @@ -92,71 +91,77 @@ } /** Callback for uping listener socket. + * Reads a uping from the socket and respond, but not more than 10 + * times per second. * @param[in] ev I/O event for uping socket. */ static void uping_echo_callback(struct Event* ev) { + struct Socket *sock; + struct irc_sockaddr from; + unsigned int len = 0; + static time_t last = 0; + static int counter = 0; + char buf[BUFSIZE + 1]; + assert(ev_type(ev) == ET_READ || ev_type(ev) == ET_ERROR); + sock = ev_socket(ev); + assert(sock == &upingSock_v4 || sock == &upingSock_v6); - uping_echo(); + Debug((DEBUG_DEBUG, "UPING: uping_echo")); + + if (IO_SUCCESS != os_recvfrom_nonb(s_fd(sock), buf, BUFSIZE, &len, &from)) + return; + /* + * count em even if we're getting flooded so we can tell we're getting + * flooded. + */ + ++ServerStats->uping_recv; + if (len < 19) + return; + else if (CurrentTime != last) { + counter = 0; + last = CurrentTime; + } else if (++counter > 10) + return; + os_sendto_nonb(s_fd(sock), buf, len, NULL, 0, &from); } /** Initialize a UDP socket for upings. - * @returns File descriptor of UDP socket (-1 on error). + * @returns 0 on success, -1 on error. */ int uping_init(void) { struct irc_sockaddr from; int fd; - memcpy(&from, &VirtualHost, sizeof(from)); + memcpy(&from, &VirtualHost_v4, sizeof(from)); from.port = atoi(UDP_PORT); - fd = os_socket(&from, SOCK_DGRAM, "UDP listener socket"); + fd = os_socket(&from, SOCK_DGRAM, "IPv4 uping listener"); if (fd < 0) return -1; - if (!socket_add(&upingSock, uping_echo_callback, 0, SS_DATAGRAM, - SOCK_EVENT_READABLE, fd)) { + if (!socket_add(&upingSock_v4, uping_echo_callback, 0, SS_DATAGRAM, + SOCK_EVENT_READABLE, fd)) { Debug((DEBUG_ERROR, "UPING: Unable to queue fd to event system")); close(fd); return -1; } - UPingFileDescriptor = fd; - return fd; -} - -/** Read a uping from the socket and respond (but not more than 10 - * times per second). - */ -void uping_echo() -{ - struct irc_sockaddr from; - unsigned int len = 0; - static time_t last = 0; - static int counter = 0; - char buf[BUFSIZE + 1]; - - Debug((DEBUG_DEBUG, "UPING: uping_echo")); + memcpy(&from, &VirtualHost_v6, sizeof(from)); + from.port = atoi(UDP_PORT); - if (IO_SUCCESS != os_recvfrom_nonb(UPingFileDescriptor, buf, BUFSIZE, &len, &from)) - return; - /* - * count em even if we're getting flooded so we can tell we're getting - * flooded. - */ - ++ServerStats->uping_recv; - if (CurrentTime == last) { - if (++counter > 10) - return; - } - else { - counter = 0; - last = CurrentTime; + fd = os_socket(&from, SOCK_DGRAM, "IPv6 uping listener"); + if (fd < 0) + return -1; + if (!socket_add(&upingSock_v6, uping_echo_callback, 0, SS_DATAGRAM, + SOCK_EVENT_READABLE, fd)) { + Debug((DEBUG_ERROR, "UPING: Unable to queue fd to event system")); + close(fd); + return -1; } - if (len < 19) - return; - os_sendto_nonb(UPingFileDescriptor, buf, len, NULL, 0, &from); + + return 0; } @@ -367,6 +372,7 @@ { int fd; struct UPing* pptr; + struct irc_sockaddr *local; assert(0 != sptr); assert(0 != aconf); @@ -380,7 +386,8 @@ if (IsUPing(sptr)) uping_cancel(sptr, sptr); /* Cancel previous ping request */ - fd = os_socket(NULL, SOCK_DGRAM, "UDP ping socket"); + local = irc_in_addr_is_ipv4(&aconf->address.addr) ? &VirtualHost_v4 : &VirtualHost_v6; + fd = os_socket(local, SOCK_DGRAM, "Outbound uping socket"); if (fd < 0) return 0; Index: ircd-ircdev/ircd/whocmds.c diff -u ircd-ircdev/ircd/whocmds.c:1.5 ircd-ircdev/ircd/whocmds.c:1.6 --- ircd-ircdev/ircd/whocmds.c:1.5 Wed Nov 24 08:06:16 2004 +++ ircd-ircdev/ircd/whocmds.c Wed Jan 5 03:58:35 2005 @@ -21,7 +21,7 @@ */ /** @file * @brief Support functions for /WHO-like commands. - * @version $Id: whocmds.c,v 1.5 2004/11/24 16:06:16 zolty Exp $ + * @version $Id: whocmds.c,v 1.6 2005/01/05 11:58:35 zolty Exp $ */ #include "config.h" @@ -53,7 +53,6 @@ #include "whowas.h" #include "msg.h" -#include <arpa/inet.h> /* inet_ntoa */ #include <fcntl.h> #include <stdio.h> #include <stdlib.h> ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2004-12-28 11:16:27
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-12-28 11:15:58 UTC Modified files: ChangeLog ChangeLog.es INSTALL INSTALL.es TODO.es doc/.cvsignore doc/ircd.sample-es.conf include/channel.h include/client.h include/handlers.h include/ircd_log.h include/msg.h include/numeric.h include/numnicks.h include/patchlevel.h include/send.h ircd/IPcheck.c ircd/Makefile.in ircd/channel.c ircd/class.c ircd/client.c ircd/dbuf.c ircd/destruct_event.c ircd/engine_devpoll.c ircd/engine_epoll.c ircd/engine_kqueue.c ircd/engine_poll.c ircd/engine_select.c ircd/fileio.c ircd/gline.c ircd/hash.c ircd/ircd.c ircd/ircd_alloc.c ircd/ircd_auth.c ircd/ircd_crypt.c ircd/ircd_crypt_native.c ircd/ircd_crypt_plain.c ircd/ircd_crypt_smd5.c ircd/ircd_events.c ircd/ircd_features.c ircd/ircd_lexer.l ircd/ircd_log.c ircd/ircd_parser.y ircd/ircd_relay.c ircd/ircd_reply.c ircd/ircd_res.c ircd/ircd_signal.c ircd/ircd_snprintf.c ircd/ircd_string.c ircd/jupe.c ircd/list.c ircd/listener.c ircd/m_account.c ircd/m_admin.c ircd/m_asll.c ircd/m_away.c ircd/m_burst.c ircd/m_clearmode.c ircd/m_close.c ircd/m_connect.c ircd/m_cprivmsg.c ircd/m_create.c ircd/m_defaults.c ircd/m_destruct.c ircd/m_desynch.c ircd/m_die.c ircd/m_endburst.c ircd/m_error.c ircd/m_get.c ircd/m_gline.c ircd/m_help.c ircd/m_info.c ircd/m_invite.c ircd/m_ison.c ircd/m_join.c ircd/m_jupe.c ircd/m_kick.c ircd/m_kill.c ircd/m_links.c ircd/m_list.c ircd/m_lusers.c ircd/m_map.c ircd/m_mode.c ircd/m_motd.c ircd/m_names.c ircd/m_nick.c ircd/m_notice.c ircd/m_oper.c ircd/m_opmode.c ircd/m_part.c ircd/m_pass.c ircd/m_ping.c ircd/m_pong.c ircd/m_privmsg.c ircd/m_privs.c ircd/m_proto.c ircd/m_pseudo.c ircd/m_quit.c ircd/m_rehash.c ircd/m_reset.c ircd/m_restart.c ircd/m_rping.c ircd/m_rpong.c ircd/m_server.c ircd/m_set.c ircd/m_settime.c ircd/m_silence.c ircd/m_squit.c ircd/m_stats.c ircd/m_time.c ircd/m_tmpl.c ircd/m_topic.c ircd/m_trace.c ircd/m_uping.c ircd/m_user.c ircd/m_userhost.c ircd/m_userip.c ircd/m_users.c ircd/m_version.c ircd/m_wallchops.c ircd/m_wallops.c ircd/m_wallusers.c ircd/m_wallvoices.c ircd/m_watch.c ircd/m_who.c ircd/m_whois.c ircd/m_whowas.c ircd/memdebug.c ircd/motd.c ircd/msgq.c ircd/numnicks.c ircd/os_generic.c ircd/packet.c ircd/parse.c ircd/s_auth.c ircd/s_bsd.c ircd/s_conf.c ircd/s_debug.c ircd/s_err.c ircd/s_misc.c ircd/s_serv.c ircd/s_user.c ircd/send.c ircd/umkpasswd.c ircd/uping.c ircd/version.c.SH ircd/watch.c ircd/whowas.c ircd/test/ircd_chattr_t.c Added files: ircd-patch doc/en/Authors include/capab.h ircd/m_cap.c Removed files: tools/crypter Log message: Author: zoltan <zo...@ir...> Log message: 2004-11-28 Toni García <zo...@ir...> 1.0.alpha14 * Implementacion del estándar "IRC Capabilities" * Sincronizacion Undernet ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.14 ircd-ircdev/ChangeLog:1.15 --- ircd-ircdev/ChangeLog:1.14 Wed Nov 24 08:11:30 2004 +++ ircd-ircdev/ChangeLog Tue Dec 28 03:15:43 2004 @@ -1,10 +1,14 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.14 2004/11/24 16:11:30 zolty Exp $ +# $Id: ChangeLog,v 1.15 2004/12/28 11:15:43 zolty Exp $ # # Insert new changes at beginning of the change list. # +2004-11-28 Toni García <zo...@ir...> 1.0.alpha14 + * Implementation IRC capabilities draft + * Undernet synchorinization + 2004-11-24 Toni García <zo...@ir...> 1.0.alpha13 * Doxygen commentarys * Silence exceptions Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.14 ircd-ircdev/ChangeLog.es:1.15 --- ircd-ircdev/ChangeLog.es:1.14 Wed Nov 24 08:11:30 2004 +++ ircd-ircdev/ChangeLog.es Tue Dec 28 03:15:43 2004 @@ -1,10 +1,14 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.14 2004/11/24 16:11:30 zolty Exp $ +# $Id: ChangeLog.es,v 1.15 2004/12/28 11:15:43 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2004-11-28 Toni García <zo...@ir...> 1.0.alpha14 + * Implementacion del estándar "IRC Capabilities" + * Sincronizacion Undernet + 2004-11-24 Toni García <zo...@ir...> 1.0.alpha13 * Comentarios para Doxygen * Excepciones de Silences Index: ircd-ircdev/INSTALL diff -u ircd-ircdev/INSTALL:1.1.1.1 ircd-ircdev/INSTALL:1.2 --- ircd-ircdev/INSTALL:1.1.1.1 Mon Sep 8 03:34:25 2003 +++ ircd-ircdev/INSTALL Tue Dec 28 03:15:43 2004 @@ -29,7 +29,8 @@ Once ircd-ircdev is compiled, install it by running "make install". Next, you will have to configure your IRC server by setting up your ircd.conf -file. Use the included doc/<language>/ircd.conf.sample as a starting point. +file. Use the included doc/ircd.sample-en.conf as a starting point; it is +installed in $HOME/lib/ircd.sample-en.conf by default. Setting up ircd.conf can be a bit tricky, so if this is your first time doing it, begin with a bare-bones configuration and extend it as you go. Index: ircd-ircdev/INSTALL.es diff -u ircd-ircdev/INSTALL.es:1.1.1.1 ircd-ircdev/INSTALL.es:1.2 --- ircd-ircdev/INSTALL.es:1.1.1.1 Mon Sep 8 03:34:26 2003 +++ ircd-ircdev/INSTALL.es Tue Dec 28 03:15:43 2004 @@ -31,8 +31,9 @@ Una vez que se compile el ircd-ircdev, instalalo ejecutando "make install". Después, usted tendrá que configurar su servidor de IRC configurando el archivo -"ircd.conf". Utilice el doc/es/ircd.conf.sample incluido como punto de partida. La -creación del "ircd.conf" puede ser un poco díficil, así que si ésta es su primera +"ircd.conf". Utilice el doc/ircd.sample-es.conf incluido como punto de partida; +es instalado en $HOME/lib/ircd.sample-es.conf por defecto. +La creación del "ircd.conf" puede ser un poco díficil, así que si ésta es su primera vez que lo hace, comienza con una configuración mínima y la amplía mientras que usted va aprendiendo. Index: ircd-ircdev/TODO.es diff -u ircd-ircdev/TODO.es:1.10 ircd-ircdev/TODO.es:1.11 --- ircd-ircdev/TODO.es:1.10 Wed Nov 24 08:22:22 2004 +++ ircd-ircdev/TODO.es Tue Dec 28 03:15:43 2004 @@ -1,7 +1,7 @@ # # TODO para ircd-ircdev # -# $Id: TODO.es,v 1.10 2004/11/24 16:22:22 zolty Exp $ +# $Id: TODO.es,v 1.11 2004/12/28 11:15:43 zolty Exp $ # # Insertar las nuevas entradas al principio de la lista TODO. # @@ -62,6 +62,7 @@ - [G] Soporte SSL para client<->server. - [U] Soporte de modos de canal +A y +u y todo lo relacionado con el (.12). - [G] Mirar si el aviso de invites lo haga con wallchops o con raw. + - [D] Documentar para Doxygen el Watch y el DDB BUGS CONOCIDOS -------------------------------------------------------------------------------------- Index: ircd-ircdev/doc/.cvsignore diff -u ircd-ircdev/doc/.cvsignore:1.1.1.1 ircd-ircdev/doc/.cvsignore:1.2 --- ircd-ircdev/doc/.cvsignore:1.1.1.1 Mon Sep 8 03:34:26 2003 +++ ircd-ircdev/doc/.cvsignore Tue Dec 28 03:15:44 2004 @@ -1,2 +1,3 @@ Makefile stamp-m +doxygen Index: ircd-ircdev/doc/en/Authors diff -u /dev/null ircd-ircdev/doc/en/Authors:1.1 --- /dev/null Tue Dec 28 03:15:58 2004 +++ ircd-ircdev/doc/en/Authors Tue Dec 28 03:15:44 2004 @@ -0,0 +1,200 @@ +IRC was conceived of and written by Jarkko Oikarinen <jt...@to...>. +IRC was originally written in University of Oulu, Computing Center. +Jan 1991 - IRC 2.6 jt...@to... + - Multiple Channels and protocol changes + +Contributions were made by a cast of dozens, including the following: + +Markku Jarvinen <mt...@tu...>: Emacs-like editing facility for the client + +Kimmo Suominen <ki...@ka...>: HP-UX port + +Jeff Trim <jt...@or...>: enhancements and advice + +Vijay Subramaniam <vi...@ll...>: advice and ruthless publicity + +Karl Kleinpaste <ka...@ci...>: user's manual + +Greg Lindahl <gl...@vi...>: AUTOMATON code, the Wumpus GM automaton, +myriad bug fixes + +Bill Wisner <wi...@ha...>: numerous bug fixes and code +enhancements + +Tom Davis <con...@ze...> and Tim Russell <ru...@ze...>: +VMS modifications + +Markku Savela <ms...@te...>: advice, support, and being the +incentive to do some of our *own* coding. :) + +Tom Hopkins <ho...@bu...>: bug fixes, quarantine lines, +consolidation of various patches. + +Christopher Davis <ck...@cs...>: EFnet/Anet gateway coding, +many automata ;), documentation fixing. + +Helen Rose <hr...@cs...>: documentation updating, and fixing. + +Tom Hinds <ro...@bu...>: emacs client updating. + +Tim Miller <ce...@bu...>: various server and client-breaking +features. + +Darren Reed <av...@co...>: various bug fixes and enhancements. +Introduced nickname and channelname hash tables into the server. + +The version 2.2 release was coordinated by Mike Bolotski +<mi...@sa...>. + +The version 2.4 release was coordinated by Markku Savela and +Chelsea Ashley Dyerman + +The version 2.5.2 release was coordinated by Christopher Davis, Helen Rose, +and Tom Hopkins. + +The versions 2.6.2, 2.7 and 2.8 releases were coordinated by Darren Reed. + +Contributions for the 2.8 release from the following people: +Matthew Green <ph...@co...> +Chuck Kane <ck...@ec...> +Matt Lyle <ma...@oc...> +Vesa Ruokonen <ruo...@lu...> + +Markku Savela <Mar...@vt...> / April 1990 +Fixed various bugs in 2.2PL1 release server (2.2msa.4) and changed +sockets to use non-blocking mode (2.2msa.9). [I have absolutely +nothing to do with clients :-] + +Chelsea Ashley Dyerman <ch...@ea...> / April 1990 +Rewrote the Makefiles, restructuring of source tree. Added libIrcd.a to +the Makefile macros, numerous reformatting of server text messages, and +added mkversion.sh to keep track of compilation statistics. Numerous +bug fixes and enhancements, and co-coordinator of the 2.4 release. + +Jarle Lyngaas (nm...@al...) added Note functions to ircd. + +Armin Gruner <gr...@in...> / May, June 1990: +* Patched KILL-line feature for ircd.conf, works now. + Enhancement: Time intervals can be specified in passwd-field. + Result: KILL-Line is only active during these intervals +* Patched PRIVMSG handling, now OPER can specify masks for sending + private messages, advantage: msg to all at a specified server or host. +* Little tests on irc 2.5 alpha, fixed some little typos in client code. + Change: common/debug.c has been moved to ircd/s_debug.c, and a + irc/c_debug.c has been created, for the benefit that wrong server msg + are displayed if client does not recognize them. (strange, if a server + sends an 'unknown command', isn't it?) + +Tom Hopkins <ho...@bu...> / September, October 1990: +* Patched msa's K lines for servers (Q lines). +* Consolidated several patches, including Stealth's logging patch. +* Fixed several minor bugs. +* Has done lots of other stuff that I can't seem to remember, but he + always works on code, so he has to have done alot more than three + lines worth. :) + +Thanks go to those persons not mentioned here who have added their advice, +opinions, and code to IRC. + +Various modifications, bugreports, cleanups and testing by: + +Hugo Calendar <hu...@uc...> +Bo Adler <ad...@cs...> +Michael Sandrof <ms...@an...> +Jon Solomon <js...@cs...> +Jan Peterson <jl...@ha...> +Nathan Glasser <na...@br...> +Helen Rose <hr...@ef...> +Mike Pelletier <st...@ca...> +Basalat Ali Raja <gw...@ta...> +Eric P. Scott <ep...@to...> +Dan Goodwin <fo...@wp...> +Noah Friedman <fri...@ai...> + + +UNDERNET (1991 - 1999) +-------- + +The Undernet versions (TSpre8, u2.9 and u2.10) are based on ircd-2.8.10 and +contain thousands of hours of work by Carlo Wood <ca...@al...> +(Run on IRC). The number of protocol enhancements, changes and additions +that have been added are too many to summarize. All patches are kept in the +cvs repository at http://coder-com.undernet.org/. Discussions on this +server code are currently on the mailing list cod...@un..., or in +#coder-com on undernet. + +The current maintainer is Bleep. + +Various additions and bugfixes have been contributed by: + +Aaron <agi...@sc...> +Bleep <to...@in...> +CaptJay <ca...@su...> +CapVideo <ma...@pu...> +Chaos <si...@tr...> +Cym <cy...@ac...> +Derrick <di...@se...> +Ensor <dh...@ra...> +flux <cml...@uc...> +Ghostwolf <fo...@tr...> +Gte- <gt...@at...> +Isomer <is...@co...> +Jamey <wo...@du...> +Jarle <ja...@II...> +Kev <kl...@mi...> +Nemesi <co...@ti...> +Niels <ni...@ho...> +Run <ca...@al...> +record <jeg...@cl...> +smg <sm...@lm...> +SeKs <in...@st...> +Simon- <si...@pe...> +Starfox <st...@qu...> +Trio <tr...@b6...> +WildThang <dvm...@an...> +Xorath <vo...@wh...> + +UNDERNET (2000 - 2004) +-------- + +The Undernet versions (P9, P10, u2.10.11 and u2.10.12) are based on +ircu2.10.07 and contain many hours of work by Coder Commitee. +The number of protocol enhancements, changes and additions +that have been added are too many to summarize. All patches are kept in the +cvs repository at http://coder-com.undernet.org/. Discussions on this +server code are currently on the mailing list cod...@un..., or in +#coder-com on undernet. + +The current maintainer is Isomer. + +Various additions, testings and bugfixes have been contributed by: + +A1kmm <irc...@mw...> +Bleep <to...@in...> +Gte- <gt...@at...> +Isomer <is...@co...> +Kev <kl...@mi...> +Delete <de...@cy...> +Ghostwolf <fo...@wt...> +Braden <db...@ya...> +net <ne...@as...> +Steven <st...@do...> +OmniDynmc <om...@dy...> +Dianora <db...@db...> +Sengaia <se...@un...> +Cyberdude <Cyb...@un...> +Maniac- <ma...@ce...> +Vampire- <va...@p1...> +mbuna <mb...@bu...> +beware <ste...@to...> +n3tguy <ne...@sp...> +reed <re...@re...> +Math <ma...@ro...> +hikari <sh...@un...> +Bleep <tom...@co...> +froo <fr...@qu...> +splidge <sp...@qu...> +Zarjazz <za...@qu...> +Spike <ek...@pa...> +Jeekay <je...@ne...> +Entrope <en...@ga...> Index: ircd-ircdev/doc/ircd.sample-es.conf diff -u ircd-ircdev/doc/ircd.sample-es.conf:1.4 ircd-ircdev/doc/ircd.sample-es.conf:1.5 --- ircd-ircdev/doc/ircd.sample-es.conf:1.4 Mon Dec 27 03:25:29 2004 +++ ircd-ircdev/doc/ircd.sample-es.conf Tue Dec 28 03:15:44 2004 @@ -824,7 +824,6 @@ # "CONFIG_OPERCMDS" = "FALSE"; # "HIS_SNOTICES" = "TRUE"; # "HIS_SNOTICES_OPER_ONLY" = "TRUE"; -# "HIS_DESYNCS" = "TRUE"; # "HIS_DEBUG_OPER_ONLY" = "TRUE"; # "HIS_WALLOPS" = "TRUE"; # "HIS_MAP" = "TRUE"; Index: ircd-ircdev/include/capab.h diff -u /dev/null ircd-ircdev/include/capab.h:1.1 --- /dev/null Tue Dec 28 03:15:59 2004 +++ ircd-ircdev/include/capab.h Tue Dec 28 03:15:44 2004 @@ -0,0 +1,660 @@ +/* + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, include/capab.h + * + * Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 2004 Kevin L. Mitchell <kl...@mi...> + * + * 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 + * + */ +/** @file + * @brief Interface and public definitions for capabilities extension + * @version $Id: capab.h,v 1.1 2004/12/28 11:15:44 zolty Exp $ + */ +#ifndef INCLUDED_capab_h +#define INCLUDED_capab_h + +#ifndef INCLUDED_client_h +#include "client.h" +#endif + +#define CAPFL_HIDDEN 0x0001 /**< Do not advertize this capability */ +#define CAPFL_PROHIBIT 0x0002 /**< Client may not set this capability */ +#define CAPFL_PROTO 0x0004 /**< Cap must be acknowledged by client */ + +/* XXX You can safely ignore all of these; they're only for testing purposes, + * XXX and don't result in any behavioral change. + */ +#define CAPLIST \ + _CAP(USERPFX, 0, "undernet.org/userpfx"), \ + _CAP(FOO, CAPFL_HIDDEN, "x-foo"), \ + _CAP(BAR, CAPFL_PROHIBIT, "x-bar"), \ + _CAP(BINK, CAPFL_PROTO, "x-bink"), \ + _CAP(CAP000, 0, "x-cap000"), \ + _CAP(CAP001, 0, "x-cap001"), \ + _CAP(CAP002, 0, "x-cap002"), \ + _CAP(CAP003, 0, "x-cap003"), \ + _CAP(CAP004, 0, "x-cap004"), \ + _CAP(CAP005, 0, "x-cap005"), \ + _CAP(CAP006, 0, "x-cap006"), \ + _CAP(CAP007, 0, "x-cap007"), \ + _CAP(CAP008, 0, "x-cap008"), \ + _CAP(CAP009, 0, "x-cap009"), \ + _CAP(CAP010, 0, "x-cap010"), \ + _CAP(CAP011, 0, "x-cap011"), \ + _CAP(CAP012, 0, "x-cap012"), \ + _CAP(CAP013, 0, "x-cap013"), \ + _CAP(CAP014, 0, "x-cap014"), \ + _CAP(CAP015, 0, "x-cap015"), \ + _CAP(CAP016, 0, "x-cap016"), \ + _CAP(CAP017, 0, "x-cap017"), \ + _CAP(CAP018, 0, "x-cap018"), \ + _CAP(CAP019, 0, "x-cap019"), \ + _CAP(CAP020, 0, "x-cap020"), \ + _CAP(CAP021, 0, "x-cap021"), \ + _CAP(CAP022, 0, "x-cap022"), \ + _CAP(CAP023, 0, "x-cap023"), \ + _CAP(CAP024, 0, "x-cap024"), \ + _CAP(CAP025, 0, "x-cap025"), \ + _CAP(CAP026, 0, "x-cap026"), \ + _CAP(CAP027, 0, "x-cap027"), \ + _CAP(CAP028, 0, "x-cap028"), \ + _CAP(CAP029, 0, "x-cap029"), \ + _CAP(CAP030, 0, "x-cap030"), \ + _CAP(CAP031, 0, "x-cap031"), \ + _CAP(CAP032, 0, "x-cap032"), \ + _CAP(CAP033, 0, "x-cap033"), \ + _CAP(CAP034, 0, "x-cap034"), \ + _CAP(CAP035, 0, "x-cap035"), \ + _CAP(CAP036, 0, "x-cap036"), \ + _CAP(CAP037, 0, "x-cap037"), \ + _CAP(CAP038, 0, "x-cap038"), \ + _CAP(CAP039, 0, "x-cap039"), \ + _CAP(CAP040, 0, "x-cap040"), \ + _CAP(CAP041, 0, "x-cap041"), \ + _CAP(CAP042, 0, "x-cap042"), \ + _CAP(CAP043, 0, "x-cap043"), \ + _CAP(CAP044, 0, "x-cap044"), \ + _CAP(CAP045, 0, "x-cap045"), \ + _CAP(CAP046, 0, "x-cap046"), \ + _CAP(CAP047, 0, "x-cap047"), \ + _CAP(CAP048, 0, "x-cap048"), \ + _CAP(CAP049, 0, "x-cap049"), \ + _CAP(CAP050, 0, "x-cap050"), \ + _CAP(CAP051, 0, "x-cap051"), \ + _CAP(CAP052, 0, "x-cap052"), \ + _CAP(CAP053, 0, "x-cap053"), \ + _CAP(CAP054, 0, "x-cap054"), \ + _CAP(CAP055, 0, "x-cap055"), \ + _CAP(CAP056, 0, "x-cap056"), \ + _CAP(CAP057, 0, "x-cap057"), \ + _CAP(CAP058, 0, "x-cap058"), \ + _CAP(CAP059, 0, "x-cap059"), \ + _CAP(CAP060, 0, "x-cap060"), \ + _CAP(CAP061, 0, "x-cap061"), \ + _CAP(CAP062, 0, "x-cap062"), \ + _CAP(CAP063, 0, "x-cap063"), \ + _CAP(CAP064, 0, "x-cap064"), \ + _CAP(CAP065, 0, "x-cap065"), \ + _CAP(CAP066, 0, "x-cap066"), \ + _CAP(CAP067, 0, "x-cap067"), \ + _CAP(CAP068, 0, "x-cap068"), \ + _CAP(CAP069, 0, "x-cap069"), \ + _CAP(CAP070, 0, "x-cap070"), \ + _CAP(CAP071, 0, "x-cap071"), \ + _CAP(CAP072, 0, "x-cap072"), \ + _CAP(CAP073, 0, "x-cap073"), \ + _CAP(CAP074, 0, "x-cap074"), \ + _CAP(CAP075, 0, "x-cap075"), \ + _CAP(CAP076, 0, "x-cap076"), \ + _CAP(CAP077, 0, "x-cap077"), \ + _CAP(CAP078, 0, "x-cap078"), \ + _CAP(CAP079, 0, "x-cap079"), \ + _CAP(CAP080, 0, "x-cap080"), \ + _CAP(CAP081, 0, "x-cap081"), \ + _CAP(CAP082, 0, "x-cap082"), \ + _CAP(CAP083, 0, "x-cap083"), \ + _CAP(CAP084, 0, "x-cap084"), \ + _CAP(CAP085, 0, "x-cap085"), \ + _CAP(CAP086, 0, "x-cap086"), \ + _CAP(CAP087, 0, "x-cap087"), \ + _CAP(CAP088, 0, "x-cap088"), \ + _CAP(CAP089, 0, "x-cap089"), \ + _CAP(CAP090, 0, "x-cap090"), \ + _CAP(CAP091, 0, "x-cap091"), \ + _CAP(CAP092, 0, "x-cap092"), \ + _CAP(CAP093, 0, "x-cap093"), \ + _CAP(CAP094, 0, "x-cap094"), \ + _CAP(CAP095, 0, "x-cap095"), \ + _CAP(CAP096, 0, "x-cap096"), \ + _CAP(CAP097, 0, "x-cap097"), \ + _CAP(CAP098, 0, "x-cap098"), \ + _CAP(CAP099, 0, "x-cap099"), \ + _CAP(CAP100, 0, "x-cap100"), \ + _CAP(CAP101, 0, "x-cap101"), \ + _CAP(CAP102, 0, "x-cap102"), \ + _CAP(CAP103, 0, "x-cap103"), \ + _CAP(CAP104, 0, "x-cap104"), \ + _CAP(CAP105, 0, "x-cap105"), \ + _CAP(CAP106, 0, "x-cap106"), \ + _CAP(CAP107, 0, "x-cap107"), \ + _CAP(CAP108, 0, "x-cap108"), \ + _CAP(CAP109, 0, "x-cap109"), \ + _CAP(CAP110, 0, "x-cap110"), \ + _CAP(CAP111, 0, "x-cap111"), \ + _CAP(CAP112, 0, "x-cap112"), \ + _CAP(CAP113, 0, "x-cap113"), \ + _CAP(CAP114, 0, "x-cap114"), \ + _CAP(CAP115, 0, "x-cap115"), \ + _CAP(CAP116, 0, "x-cap116"), \ + _CAP(CAP117, 0, "x-cap117"), \ + _CAP(CAP118, 0, "x-cap118"), \ + _CAP(CAP119, 0, "x-cap119"), \ + _CAP(CAP120, 0, "x-cap120"), \ + _CAP(CAP121, 0, "x-cap121"), \ + _CAP(CAP122, 0, "x-cap122"), \ + _CAP(CAP123, 0, "x-cap123"), \ + _CAP(CAP124, 0, "x-cap124"), \ + _CAP(CAP125, 0, "x-cap125"), \ + _CAP(CAP126, 0, "x-cap126"), \ + _CAP(CAP127, 0, "x-cap127"), \ + _CAP(CAP128, 0, "x-cap128"), \ + _CAP(CAP129, 0, "x-cap129"), \ + _CAP(CAP130, 0, "x-cap130"), \ + _CAP(CAP131, 0, "x-cap131"), \ + _CAP(CAP132, 0, "x-cap132"), \ + _CAP(CAP133, 0, "x-cap133"), \ + _CAP(CAP134, 0, "x-cap134"), \ + _CAP(CAP135, 0, "x-cap135"), \ + _CAP(CAP136, 0, "x-cap136"), \ + _CAP(CAP137, 0, "x-cap137"), \ + _CAP(CAP138, 0, "x-cap138"), \ + _CAP(CAP139, 0, "x-cap139"), \ + _CAP(CAP140, 0, "x-cap140"), \ + _CAP(CAP141, 0, "x-cap141"), \ + _CAP(CAP142, 0, "x-cap142"), \ + _CAP(CAP143, 0, "x-cap143"), \ + _CAP(CAP144, 0, "x-cap144"), \ + _CAP(CAP145, 0, "x-cap145"), \ + _CAP(CAP146, 0, "x-cap146"), \ + _CAP(CAP147, 0, "x-cap147"), \ + _CAP(CAP148, 0, "x-cap148"), \ + _CAP(CAP149, 0, "x-cap149"), \ + _CAP(CAP150, 0, "x-cap150"), \ + _CAP(CAP151, 0, "x-cap151"), \ + _CAP(CAP152, 0, "x-cap152"), \ + _CAP(CAP153, 0, "x-cap153"), \ + _CAP(CAP154, 0, "x-cap154"), \ + _CAP(CAP155, 0, "x-cap155"), \ + _CAP(CAP156, 0, "x-cap156"), \ + _CAP(CAP157, 0, "x-cap157"), \ + _CAP(CAP158, 0, "x-cap158"), \ + _CAP(CAP159, 0, "x-cap159"), \ + _CAP(CAP160, 0, "x-cap160"), \ + _CAP(CAP161, 0, "x-cap161"), \ + _CAP(CAP162, 0, "x-cap162"), \ + _CAP(CAP163, 0, "x-cap163"), \ + _CAP(CAP164, 0, "x-cap164"), \ + _CAP(CAP165, 0, "x-cap165"), \ + _CAP(CAP166, 0, "x-cap166"), \ + _CAP(CAP167, 0, "x-cap167"), \ + _CAP(CAP168, 0, "x-cap168"), \ + _CAP(CAP169, 0, "x-cap169"), \ + _CAP(CAP170, 0, "x-cap170"), \ + _CAP(CAP171, 0, "x-cap171"), \ + _CAP(CAP172, 0, "x-cap172"), \ + _CAP(CAP173, 0, "x-cap173"), \ + _CAP(CAP174, 0, "x-cap174"), \ + _CAP(CAP175, 0, "x-cap175"), \ + _CAP(CAP176, 0, "x-cap176"), \ + _CAP(CAP177, 0, "x-cap177"), \ + _CAP(CAP178, 0, "x-cap178"), \ + _CAP(CAP179, 0, "x-cap179"), \ + _CAP(CAP180, 0, "x-cap180"), \ + _CAP(CAP181, 0, "x-cap181"), \ + _CAP(CAP182, 0, "x-cap182"), \ + _CAP(CAP183, 0, "x-cap183"), \ + _CAP(CAP184, 0, "x-cap184"), \ + _CAP(CAP185, 0, "x-cap185"), \ + _CAP(CAP186, 0, "x-cap186"), \ + _CAP(CAP187, 0, "x-cap187"), \ + _CAP(CAP188, 0, "x-cap188"), \ + _CAP(CAP189, 0, "x-cap189"), \ + _CAP(CAP190, 0, "x-cap190"), \ + _CAP(CAP191, 0, "x-cap191"), \ + _CAP(CAP192, 0, "x-cap192"), \ + _CAP(CAP193, 0, "x-cap193"), \ + _CAP(CAP194, 0, "x-cap194"), \ + _CAP(CAP195, 0, "x-cap195"), \ + _CAP(CAP196, 0, "x-cap196"), \ + _CAP(CAP197, 0, "x-cap197"), \ + _CAP(CAP198, 0, "x-cap198"), \ + _CAP(CAP199, 0, "x-cap199"), \ + _CAP(CAP200, 0, "x-cap200"), \ + _CAP(CAP201, 0, "x-cap201"), \ + _CAP(CAP202, 0, "x-cap202"), \ + _CAP(CAP203, 0, "x-cap203"), \ + _CAP(CAP204, 0, "x-cap204"), \ + _CAP(CAP205, 0, "x-cap205"), \ + _CAP(CAP206, 0, "x-cap206"), \ + _CAP(CAP207, 0, "x-cap207"), \ + _CAP(CAP208, 0, "x-cap208"), \ + _CAP(CAP209, 0, "x-cap209"), \ + _CAP(CAP210, 0, "x-cap210"), \ + _CAP(CAP211, 0, "x-cap211"), \ + _CAP(CAP212, 0, "x-cap212"), \ + _CAP(CAP213, 0, "x-cap213"), \ + _CAP(CAP214, 0, "x-cap214"), \ + _CAP(CAP215, 0, "x-cap215"), \ + _CAP(CAP216, 0, "x-cap216"), \ + _CAP(CAP217, 0, "x-cap217"), \ + _CAP(CAP218, 0, "x-cap218"), \ + _CAP(CAP219, 0, "x-cap219"), \ + _CAP(CAP220, 0, "x-cap220"), \ + _CAP(CAP221, 0, "x-cap221"), \ + _CAP(CAP222, 0, "x-cap222"), \ + _CAP(CAP223, 0, "x-cap223"), \ + _CAP(CAP224, 0, "x-cap224"), \ + _CAP(CAP225, 0, "x-cap225"), \ + _CAP(CAP226, 0, "x-cap226"), \ + _CAP(CAP227, 0, "x-cap227"), \ + _CAP(CAP228, 0, "x-cap228"), \ + _CAP(CAP229, 0, "x-cap229"), \ + _CAP(CAP230, 0, "x-cap230"), \ + _CAP(CAP231, 0, "x-cap231"), \ + _CAP(CAP232, 0, "x-cap232"), \ + _CAP(CAP233, 0, "x-cap233"), \ + _CAP(CAP234, 0, "x-cap234"), \ + _CAP(CAP235, 0, "x-cap235"), \ + _CAP(CAP236, 0, "x-cap236"), \ + _CAP(CAP237, 0, "x-cap237"), \ + _CAP(CAP238, 0, "x-cap238"), \ + _CAP(CAP239, 0, "x-cap239"), \ + _CAP(CAP240, 0, "x-cap240"), \ + _CAP(CAP241, 0, "x-cap241"), \ + _CAP(CAP242, 0, "x-cap242"), \ + _CAP(CAP243, 0, "x-cap243"), \ + _CAP(CAP244, 0, "x-cap244"), \ + _CAP(CAP245, 0, "x-cap245"), \ + _CAP(CAP246, 0, "x-cap246"), \ + _CAP(CAP247, 0, "x-cap247"), \ + _CAP(CAP248, 0, "x-cap248"), \ + _CAP(CAP249, 0, "x-cap249"), \ + _CAP(CAP250, 0, "x-cap250"), \ + _CAP(CAP251, 0, "x-cap251"), \ + _CAP(CAP252, 0, "x-cap252"), \ + _CAP(CAP253, 0, "x-cap253"), \ + _CAP(CAP254, 0, "x-cap254"), \ + _CAP(CAP255, 0, "x-cap255"), \ + _CAP(CAP256, 0, "x-cap256"), \ + _CAP(CAP257, 0, "x-cap257"), \ + _CAP(CAP258, 0, "x-cap258"), \ + _CAP(CAP259, 0, "x-cap259"), \ + _CAP(CAP260, 0, "x-cap260"), \ + _CAP(CAP261, 0, "x-cap261"), \ + _CAP(CAP262, 0, "x-cap262"), \ + _CAP(CAP263, 0, "x-cap263"), \ + _CAP(CAP264, 0, "x-cap264"), \ + _CAP(CAP265, 0, "x-cap265"), \ + _CAP(CAP266, 0, "x-cap266"), \ + _CAP(CAP267, 0, "x-cap267"), \ + _CAP(CAP268, 0, "x-cap268"), \ + _CAP(CAP269, 0, "x-cap269"), \ + _CAP(CAP270, 0, "x-cap270"), \ + _CAP(CAP271, 0, "x-cap271"), \ + _CAP(CAP272, 0, "x-cap272"), \ + _CAP(CAP273, 0, "x-cap273"), \ + _CAP(CAP274, 0, "x-cap274"), \ + _CAP(CAP275, 0, "x-cap275"), \ + _CAP(CAP276, 0, "x-cap276"), \ + _CAP(CAP277, 0, "x-cap277"), \ + _CAP(CAP278, 0, "x-cap278"), \ + _CAP(CAP279, 0, "x-cap279"), \ + _CAP(CAP280, 0, "x-cap280"), \ + _CAP(CAP281, 0, "x-cap281"), \ + _CAP(CAP282, 0, "x-cap282"), \ + _CAP(CAP283, 0, "x-cap283"), \ + _CAP(CAP284, 0, "x-cap284"), \ + _CAP(CAP285, 0, "x-cap285"), \ + _CAP(CAP286, 0, "x-cap286"), \ + _CAP(CAP287, 0, "x-cap287"), \ + _CAP(CAP288, 0, "x-cap288"), \ + _CAP(CAP289, 0, "x-cap289"), \ + _CAP(CAP290, 0, "x-cap290"), \ + _CAP(CAP291, 0, "x-cap291"), \ + _CAP(CAP292, 0, "x-cap292"), \ + _CAP(CAP293, 0, "x-cap293"), \ + _CAP(CAP294, 0, "x-cap294"), \ + _CAP(CAP295, 0, "x-cap295"), \ + _CAP(CAP296, 0, "x-cap296"), \ + _CAP(CAP297, 0, "x-cap297"), \ + _CAP(CAP298, 0, "x-cap298"), \ + _CAP(CAP299, 0, "x-cap299"), \ + _CAP(CAP300, 0, "x-cap300"), \ + _CAP(CAP301, 0, "x-cap301"), \ + _CAP(CAP302, 0, "x-cap302"), \ + _CAP(CAP303, 0, "x-cap303"), \ + _CAP(CAP304, 0, "x-cap304"), \ + _CAP(CAP305, 0, "x-cap305"), \ + _CAP(CAP306, 0, "x-cap306"), \ + _CAP(CAP307, 0, "x-cap307"), \ + _CAP(CAP308, 0, "x-cap308"), \ + _CAP(CAP309, 0, "x-cap309"), \ + _CAP(CAP310, 0, "x-cap310"), \ + _CAP(CAP311, 0, "x-cap311"), \ + _CAP(CAP312, 0, "x-cap312"), \ + _CAP(CAP313, 0, "x-cap313"), \ + _CAP(CAP314, 0, "x-cap314"), \ + _CAP(CAP315, 0, "x-cap315"), \ + _CAP(CAP316, 0, "x-cap316"), \ + _CAP(CAP317, 0, "x-cap317"), \ + _CAP(CAP318, 0, "x-cap318"), \ + _CAP(CAP319, 0, "x-cap319"), \ + _CAP(CAP320, 0, "x-cap320"), \ + _CAP(CAP321, 0, "x-cap321"), \ + _CAP(CAP322, 0, "x-cap322"), \ + _CAP(CAP323, 0, "x-cap323"), \ + _CAP(CAP324, 0, "x-cap324"), \ + _CAP(CAP325, 0, "x-cap325"), \ + _CAP(CAP326, 0, "x-cap326"), \ + _CAP(CAP327, 0, "x-cap327"), \ + _CAP(CAP328, 0, "x-cap328"), \ + _CAP(CAP329, 0, "x-cap329"), \ + _CAP(CAP330, 0, "x-cap330"), \ + _CAP(CAP331, 0, "x-cap331"), \ + _CAP(CAP332, 0, "x-cap332"), \ + _CAP(CAP333, 0, "x-cap333"), \ + _CAP(CAP334, 0, "x-cap334"), \ + _CAP(CAP335, 0, "x-cap335"), \ + _CAP(CAP336, 0, "x-cap336"), \ + _CAP(CAP337, 0, "x-cap337"), \ + _CAP(CAP338, 0, "x-cap338"), \ + _CAP(CAP339, 0, "x-cap339"), \ + _CAP(CAP340, 0, "x-cap340"), \ + _CAP(CAP341, 0, "x-cap341"), \ + _CAP(CAP342, 0, "x-cap342"), \ + _CAP(CAP343, 0, "x-cap343"), \ + _CAP(CAP344, 0, "x-cap344"), \ + _CAP(CAP345, 0, "x-cap345"), \ + _CAP(CAP346, 0, "x-cap346"), \ + _CAP(CAP347, 0, "x-cap347"), \ + _CAP(CAP348, 0, "x-cap348"), \ + _CAP(CAP349, 0, "x-cap349"), \ + _CAP(CAP350, 0, "x-cap350"), \ + _CAP(CAP351, 0, "x-cap351"), \ + _CAP(CAP352, 0, "x-cap352"), \ + _CAP(CAP353, 0, "x-cap353"), \ + _CAP(CAP354, 0, "x-cap354"), \ + _CAP(CAP355, 0, "x-cap355"), \ + _CAP(CAP356, 0, "x-cap356"), \ + _CAP(CAP357, 0, "x-cap357"), \ + _CAP(CAP358, 0, "x-cap358"), \ + _CAP(CAP359, 0, "x-cap359"), \ + _CAP(CAP360, 0, "x-cap360"), \ + _CAP(CAP361, 0, "x-cap361"), \ + _CAP(CAP362, 0, "x-cap362"), \ + _CAP(CAP363, 0, "x-cap363"), \ + _CAP(CAP364, 0, "x-cap364"), \ + _CAP(CAP365, 0, "x-cap365"), \ + _CAP(CAP366, 0, "x-cap366"), \ + _CAP(CAP367, 0, "x-cap367"), \ + _CAP(CAP368, 0, "x-cap368"), \ + _CAP(CAP369, 0, "x-cap369"), \ + _CAP(CAP370, 0, "x-cap370"), \ + _CAP(CAP371, 0, "x-cap371"), \ + _CAP(CAP372, 0, "x-cap372"), \ + _CAP(CAP373, 0, "x-cap373"), \ + _CAP(CAP374, 0, "x-cap374"), \ + _CAP(CAP375, 0, "x-cap375"), \ + _CAP(CAP376, 0, "x-cap376"), \ + _CAP(CAP377, 0, "x-cap377"), \ + _CAP(CAP378, 0, "x-cap378"), \ + _CAP(CAP379, 0, "x-cap379"), \ + _CAP(CAP380, 0, "x-cap380"), \ + _CAP(CAP381, 0, "x-cap381"), \ + _CAP(CAP382, 0, "x-cap382"), \ + _CAP(CAP383, 0, "x-cap383"), \ + _CAP(CAP384, 0, "x-cap384"), \ + _CAP(CAP385, 0, "x-cap385"), \ + _CAP(CAP386, 0, "x-cap386"), \ + _CAP(CAP387, 0, "x-cap387"), \ + _CAP(CAP388, 0, "x-cap388"), \ + _CAP(CAP389, 0, "x-cap389"), \ + _CAP(CAP390, 0, "x-cap390"), \ + _CAP(CAP391, 0, "x-cap391"), \ + _CAP(CAP392, 0, "x-cap392"), \ + _CAP(CAP393, 0, "x-cap393"), \ + _CAP(CAP394, 0, "x-cap394"), \ + _CAP(CAP395, 0, "x-cap395"), \ + _CAP(CAP396, 0, "x-cap396"), \ + _CAP(CAP397, 0, "x-cap397"), \ + _CAP(CAP398, 0, "x-cap398"), \ + _CAP(CAP399, 0, "x-cap399"), \ + _CAP(CAP400, 0, "x-cap400"), \ + _CAP(CAP401, 0, "x-cap401"), \ + _CAP(CAP402, 0, "x-cap402"), \ + _CAP(CAP403, 0, "x-cap403"), \ + _CAP(CAP404, 0, "x-cap404"), \ + _CAP(CAP405, 0, "x-cap405"), \ + _CAP(CAP406, 0, "x-cap406"), \ + _CAP(CAP407, 0, "x-cap407"), \ + _CAP(CAP408, 0, "x-cap408"), \ + _CAP(CAP409, 0, "x-cap409"), \ + _CAP(CAP410, 0, "x-cap410"), \ + _CAP(CAP411, 0, "x-cap411"), \ + _CAP(CAP412, 0, "x-cap412"), \ + _CAP(CAP413, 0, "x-cap413"), \ + _CAP(CAP414, 0, "x-cap414"), \ + _CAP(CAP415, 0, "x-cap415"), \ + _CAP(CAP416, 0, "x-cap416"), \ + _CAP(CAP417, 0, "x-cap417"), \ + _CAP(CAP418, 0, "x-cap418"), \ + _CAP(CAP419, 0, "x-cap419"), \ + _CAP(CAP420, 0, "x-cap420"), \ + _CAP(CAP421, 0, "x-cap421"), \ + _CAP(CAP422, 0, "x-cap422"), \ + _CAP(CAP423, 0, "x-cap423"), \ + _CAP(CAP424, 0, "x-cap424"), \ + _CAP(CAP425, 0, "x-cap425"), \ + _CAP(CAP426, 0, "x-cap426"), \ + _CAP(CAP427, 0, "x-cap427"), \ + _CAP(CAP428, 0, "x-cap428"), \ + _CAP(CAP429, 0, "x-cap429"), \ + _CAP(CAP430, 0, "x-cap430"), \ + _CAP(CAP431, 0, "x-cap431"), \ + _CAP(CAP432, 0, "x-cap432"), \ + _CAP(CAP433, 0, "x-cap433"), \ + _CAP(CAP434, 0, "x-cap434"), \ + _CAP(CAP435, 0, "x-cap435"), \ + _CAP(CAP436, 0, "x-cap436"), \ + _CAP(CAP437, 0, "x-cap437"), \ + _CAP(CAP438, 0, "x-cap438"), \ + _CAP(CAP439, 0, "x-cap439"), \ + _CAP(CAP440, 0, "x-cap440"), \ + _CAP(CAP441, 0, "x-cap441"), \ + _CAP(CAP442, 0, "x-cap442"), \ + _CAP(CAP443, 0, "x-cap443"), \ + _CAP(CAP444, 0, "x-cap444"), \ + _CAP(CAP445, 0, "x-cap445"), \ + _CAP(CAP446, 0, "x-cap446"), \ + _CAP(CAP447, 0, "x-cap447"), \ + _CAP(CAP448, 0, "x-cap448"), \ + _CAP(CAP449, 0, "x-cap449"), \ + _CAP(CAP450, 0, "x-cap450"), \ + _CAP(CAP451, 0, "x-cap451"), \ + _CAP(CAP452, 0, "x-cap452"), \ + _CAP(CAP453, 0, "x-cap453"), \ + _CAP(CAP454, 0, "x-cap454"), \ + _CAP(CAP455, 0, "x-cap455"), \ + _CAP(CAP456, 0, "x-cap456"), \ + _CAP(CAP457, 0, "x-cap457"), \ + _CAP(CAP458, 0, "x-cap458"), \ + _CAP(CAP459, 0, "x-cap459"), \ + _CAP(CAP460, 0, "x-cap460"), \ + _CAP(CAP461, 0, "x-cap461"), \ + _CAP(CAP462, 0, "x-cap462"), \ + _CAP(CAP463, 0, "x-cap463"), \ + _CAP(CAP464, 0, "x-cap464"), \ + _CAP(CAP465, 0, "x-cap465"), \ + _CAP(CAP466, 0, "x-cap466"), \ + _CAP(CAP467, 0, "x-cap467"), \ + _CAP(CAP468, 0, "x-cap468"), \ + _CAP(CAP469, 0, "x-cap469"), \ + _CAP(CAP470, 0, "x-cap470"), \ + _CAP(CAP471, 0, "x-cap471"), \ + _CAP(CAP472, 0, "x-cap472"), \ + _CAP(CAP473, 0, "x-cap473"), \ + _CAP(CAP474, 0, "x-cap474"), \ + _CAP(CAP475, 0, "x-cap475"), \ + _CAP(CAP476, 0, "x-cap476"), \ + _CAP(CAP477, 0, "x-cap477"), \ + _CAP(CAP478, 0, "x-cap478"), \ + _CAP(CAP479, 0, "x-cap479"), \ + _CAP(CAP480, 0, "x-cap480"), \ + _CAP(CAP481, 0, "x-cap481"), \ + _CAP(CAP482, 0, "x-cap482"), \ + _CAP(CAP483, 0, "x-cap483"), \ + _CAP(CAP484, 0, "x-cap484"), \ + _CAP(CAP485, 0, "x-cap485"), \ + _CAP(CAP486, 0, "x-cap486"), \ + _CAP(CAP487, 0, "x-cap487"), \ + _CAP(CAP488, 0, "x-cap488"), \ + _CAP(CAP489, 0, "x-cap489"), \ + _CAP(CAP490, 0, "x-cap490"), \ + _CAP(CAP491, 0, "x-cap491"), \ + _CAP(CAP492, 0, "x-cap492"), \ + _CAP(CAP493, 0, "x-cap493"), \ + _CAP(CAP494, 0, "x-cap494"), \ + _CAP(CAP495, 0, "x-cap495"), \ + _CAP(CAP496, 0, "x-cap496"), \ + _CAP(CAP497, 0, "x-cap497"), \ + _CAP(CAP498, 0, "x-cap498"), \ + _CAP(CAP499, 0, "x-cap499"), \ + _CAP(CAP500, 0, "x-cap500"), \ + _CAP(CAP501, 0, "x-cap501"), \ + _CAP(CAP502, 0, "x-cap502"), \ + _CAP(CAP503, 0, "x-cap503"), \ + _CAP(CAP504, 0, "x-cap504"), \ + _CAP(CAP505, 0, "x-cap505"), \ + _CAP(CAP506, 0, "x-cap506"), \ + _CAP(CAP507, 0, "x-cap507"), \ + _CAP(CAP508, 0, "x-cap508"), \ + _CAP(CAP509, 0, "x-cap509"), \ + _CAP(CAP510, 0, "x-cap510"), \ + _CAP(CAP511, 0, "x-cap511"), \ + _CAP(CAP512, 0, "x-cap512"), \ + _CAP(CAP513, 0, "x-cap513"), \ + _CAP(CAP514, 0, "x-cap514"), \ + _CAP(CAP515, 0, "x-cap515"), \ + _CAP(CAP516, 0, "x-cap516"), \ + _CAP(CAP517, 0, "x-cap517"), \ + _CAP(CAP518, 0, "x-cap518"), \ + _CAP(CAP519, 0, "x-cap519"), \ + _CAP(CAP520, 0, "x-cap520"), \ + _CAP(CAP521, 0, "x-cap521"), \ + _CAP(CAP522, 0, "x-cap522"), \ + _CAP(CAP523, 0, "x-cap523"), \ + _CAP(CAP524, 0, "x-cap524"), \ + _CAP(CAP525, 0, "x-cap525"), \ + _CAP(CAP526, 0, "x-cap526"), \ + _CAP(CAP527, 0, "x-cap527"), \ + _CAP(CAP528, 0, "x-cap528"), \ + _CAP(CAP529, 0, "x-cap529"), \ + _CAP(CAP530, 0, "x-cap530"), \ + _CAP(CAP531, 0, "x-cap531"), \ + _CAP(CAP532, 0, "x-cap532"), \ + _CAP(CAP533, 0, "x-cap533"), \ + _CAP(CAP534, 0, "x-cap534"), \ + _CAP(CAP535, 0, "x-cap535"), \ + _CAP(CAP536, 0, "x-cap536"), \ + _CAP(CAP537, 0, "x-cap537"), \ + _CAP(CAP538, 0, "x-cap538"), \ + _CAP(CAP539, 0, "x-cap539"), \ + _CAP(CAP540, 0, "x-cap540"), \ + _CAP(CAP541, 0, "x-cap541"), \ + _CAP(CAP542, 0, "x-cap542"), \ + _CAP(CAP543, 0, "x-cap543"), \ + _CAP(CAP544, 0, "x-cap544"), \ + _CAP(CAP545, 0, "x-cap545"), \ + _CAP(CAP546, 0, "x-cap546"), \ + _CAP(CAP547, 0, "x-cap547"), \ + _CAP(CAP548, 0, "x-cap548"), \ + _CAP(CAP549, 0, "x-cap549"), \ + _CAP(CAP550, 0, "x-cap550"), \ + _CAP(CAP551, 0, "x-cap551"), \ + _CAP(CAP552, 0, "x-cap552"), \ + _CAP(CAP553, 0, "x-cap553"), \ + _CAP(CAP554, 0, "x-cap554"), \ + _CAP(CAP555, 0, "x-cap555"), \ + _CAP(CAP556, 0, "x-cap556"), \ + _CAP(CAP557, 0, "x-cap557"), \ + _CAP(CAP558, 0, "x-cap558"), \ + _CAP(CAP559, 0, "x-cap559"), \ + _CAP(CAP560, 0, "x-cap560"), \ + _CAP(CAP561, 0, "x-cap561"), \ + _CAP(CAP562, 0, "x-cap562"), \ + _CAP(CAP563, 0, "x-cap563"), \ + _CAP(CAP564, 0, "x-cap564"), \ + _CAP(CAP565, 0, "x-cap565"), \ + _CAP(CAP566, 0, "x-cap566"), \ + _CAP(CAP567, 0, "x-cap567"), \ + _CAP(CAP568, 0, "x-cap568"), \ + _CAP(CAP569, 0, "x-cap569"), \ + _CAP(CAP570, 0, "x-cap570"), \ + _CAP(CAP571, 0, "x-cap571"), \ + _CAP(CAP572, 0, "x-cap572"), \ + _CAP(CAP573, 0, "x-cap573"), \ + _CAP(CAP574, 0, "x-cap574"), \ + _CAP(CAP575, 0, "x-cap575"), \ + _CAP(CAP576, 0, "x-cap576"), \ + _CAP(CAP577, 0, "x-cap577"), \ + _CAP(CAP578, 0, "x-cap578"), \ + _CAP(CAP579, 0, "x-cap579"), \ + _CAP(CAP580, 0, "x-cap580"), \ + _CAP(CAP581, 0, "x-cap581"), \ + _CAP(CAP582, 0, "x-cap582"), \ + _CAP(CAP583, 0, "x-cap583"), \ + _CAP(CAP584, 0, "x-cap584"), \ + _CAP(CAP585, 0, "x-cap585"), \ + _CAP(CAP586, 0, "x-cap586"), \ + _CAP(CAP587, 0, "x-cap587"), \ + _CAP(CAP588, 0, "x-cap588"), \ + _CAP(CAP589, 0, "x-cap589"), \ + _CAP(CAP590, 0, "x-cap590"), \ + _CAP(CAP591, 0, "x-cap591"), \ + _CAP(CAP592, 0, "x-cap592"), \ + _CAP(CAP593, 0, "x-cap593"), \ + _CAP(CAP594, 0, "x-cap594"), \ + _CAP(CAP595, 0, "x-cap595"), \ + _CAP(CAP596, 0, "x-cap596"), \ + _CAP(CAP597, 0, "x-cap597"), \ + _CAP(CAP598, 0, "x-cap598"), \ + _CAP(CAP599, 0, "x-cap599") + +/** Client capabilities */ +enum Capab { +#define _CAP(cap, flags, name) CAP_ ## cap + CAPLIST, +#undef _CAP + _CAP_LAST_CAP +}; + +DECLARE_FLAGSET(CapSet, _CAP_LAST_CAP); + +#define CapHas(cs, cap) FlagHas(cs, cap) +#define CapSet(cs, cap) FlagSet(cs, cap) +#define CapClr(cs, cap) FlagClr(cs, cap) + +#endif /* INCLUDED_capab_h */ Index: ircd-ircdev/include/channel.h diff -u ircd-ircdev/include/channel.h:1.6 ircd-ircdev/include/channel.h:1.7 --- ircd-ircdev/include/channel.h:1.6 Wed Nov 24 08:00:43 2004 +++ ircd-ircdev/include/channel.h Tue Dec 28 03:15:44 2004 @@ -22,7 +22,7 @@ */ /** @file * @brief Channel management and maintenance. - * @version $Id: channel.h,v 1.6 2004/11/24 16:00:43 zolty Exp $ + * @version $Id: channel.h,v 1.7 2004/12/28 11:15:44 zolty Exp $ */ #ifndef INCLUDED_channel_h #define INCLUDED_channel_h @@ -489,7 +489,7 @@ extern int joinbuf_flush(struct JoinBuf *jbuf); extern struct Ban *make_ban(const char *banstr); extern struct Ban *find_ban(struct Client *cptr, struct Ban *banlist); -extern int apply_ban(struct Ban **banlist, struct Ban *newban); +extern int apply_ban(struct Ban **banlist, struct Ban *newban, int free); extern void free_ban(struct Ban *ban); #endif /* INCLUDED_channel_h */ Index: ircd-ircdev/include/client.h diff -u ircd-ircdev/include/client.h:1.7 ircd-ircdev/include/client.h:1.8 --- ircd-ircdev/include/client.h:1.7 Wed Nov 24 08:00:43 2004 +++ ircd-ircdev/include/client.h Tue Dec 28 03:15:44 2004 @@ -21,7 +21,7 @@ */ /** @file * @brief Structures and functions for handling local clients. - * @version $Id: client.h,v 1.7 2004/11/24 16:00:43 zolty Exp $ + * @version $Id: client.h,v 1.8 2004/12/28 11:15:44 zolty Exp $ */ #ifndef INCLUDED_client_h #define INCLUDED_client_h @@ -146,6 +146,7 @@ FLAG_CLOSING, /**< set when closing to suppress errors */ FLAG_UPING, /**< has active UDP ping request */ FLAG_HUB, /**< server is a hub */ + FLAG_IPV6, /**< server understands P10 IPv6 addrs */ FLAG_SERVICE, /**< server is a service */ FLAG_GOTID, /**< successful ident lookup achieved */ FLAG_DOID, /**< I-lines say must use ident return */ @@ -180,6 +181,8 @@ /** Declare flagset type for user flags. */ DECLARE_FLAGSET(Flags, FLAG_LAST_FLAG); +#include "capab.h" /* client capabilities */ + /** Represents a local connection. * This contains a lot of stuff irrelevant to server connections, but * those are so rare as to not be worth special-casing. @@ -214,6 +217,7 @@ struct DNSReply* con_dns_reply; /**< DNS reply received during client registration. */ struct ListingArgs* con_listing; /**< Current LIST status. */ + unsigned long con_unreg; /**< Indicate what still needs to be done */ unsigned int con_max_sendq; /**< cached max send queue for client */ unsigned int con_ping_freq; /**< cached ping freq */ unsigned short con_lastsq; /**< # 2k blocks when sendqueued @@ -232,6 +236,9 @@ client */ struct Timer con_proc; /**< process latent messages from client */ + struct Privs con_privs; /**< Oper privileges */ + struct CapSet con_capab; /**< Client capabilities */ + struct CapSet con_active; /**< Active client capabilities */ struct AuthRequest* con_auth; /**< auth request for client */ struct IAuthRequest* con_iauth; /**< iauth request for client */ }; @@ -258,12 +265,18 @@ unsigned int cli_hopcount; /**< number of servers to this 0 = local */ struct irc_in_addr cli_ip; /**< Real IP of client */ short cli_status; /**< Client type */ - struct Privs cli_privs; /**< Oper privileges */ char cli_name[HOSTLEN + 1]; /**< Unique name of the client, nick or host */ char cli_username[USERLEN + 1]; /**< username here now for auth stuff */ char cli_info[REALLEN + 1]; /**< Free form additional client information */ }; +#define CLIREG_NICK 0x0001 /**< Client must set nickname */ +#define CLIREG_USER 0x0002 /**< Client must set username */ +#define CLIREG_COOKIE 0x0004 /**< Client must return cookie */ +#define CLIREG_CAP 0x0008 /**< Client in capability negotiation */ + +#define CLIREG_INIT (CLIREG_NICK | CLIREG_USER | CLIREG_COOKIE) + /** Magic constant to identify valid Client structures. */ #define CLIENT_MAGIC 0x4ca08286 @@ -310,7 +323,13 @@ /** Return non-zero if the client is local. */ #define cli_local(cli) (cli_from(cli) == cli) /** Get oper privileges for client. */ -#define cli_privs(cli) ((cli)->cli_privs) +#define cli_privs(cli) con_privs(cli_connect(cli)) +/** Get client capabilities for client */ +#define cli_capab(cli) con_capab(cli_connect(cli)) +/** Get active client capabilities for client */ +#define cli_active(cli) con_active(cli_connect(cli)) +/** Get flags for remaining registration tasks */ +#define cli_unreg(cli) con_unreg(cli_connect(cli)) /** Get client name. */ #define cli_name(cli) ((cli)->cli_name) /** Get client username (ident). */ @@ -437,6 +456,8 @@ #define con_dns_reply(con) ((con)->con_dns_reply) /** Get the LIST status for the connection. */ #define con_listing(con) ((con)->con_listing) +/** Get remining steps before registration completes. */ +#define con_unreg(con) ((con)->con_unreg) /** Get the maximum permitted SendQ size for the connection. */ #define con_max_sendq(con) ((con)->con_max_sendq) /** Get the ping frequency for the connection. */ @@ -457,6 +478,12 @@ #define con_socket(con) ((con)->con_socket) /** Get the Timer for processing more data from the connection. */ #define con_proc(con) ((con)->con_proc) +/** Get the oper privilege set for the connection. */ +#define con_privs(con) (&(con)->con_privs) +/** Get the peer's capabilities for the connection. */ +#define con_capab(con) (&(con)->con_capab) +/** Get the active capabilities for the connection. */ +#define con_active(con) (&(con)->con_active) /** Get the auth request for the connection. */ #define con_auth(con) ((con)->con_auth) /** Get the iauth request for the connection. */ @@ -579,6 +606,8 @@ #define SendWallops(x) HasFlag(x, FLAG_WALLOP) /** Return non-zero if the client claims to be a hub. */ #define IsHub(x) HasFlag(x, FLAG_HUB) +/** Return non-zero if the client understands IPv6 addresses in P10. */ +#define IsIPv6(x) HasFlag(x, FLAG_IPV6) /** Return non-zero if the client claims to be a services server. */ #define IsService(x) HasFlag(x, FLAG_SERVICE) /** Return non-zero if the client has an account stamp. */ @@ -629,6 +658,8 @@ #define SetServNotice(x) SetFlag(x, FLAG_SERVNOTICE) /** Mark a client as being a hub server. */ #define SetHub(x) SetFlag(x, FLAG_HUB) +/** Mark a client as being an IPv6-grokking server. */ +#define SetIPv6(x) SetFlag(x, FLAG_IPV6) /** Mark a client as being a services server. */ #define SetService(x) SetFlag(x, FLAG_SERVICE) /** Mark a client as having an account stamp. */ @@ -720,7 +751,16 @@ #define SNO_NOISY (SNO_SERVKILL|SNO_UNAUTH) /** Test whether a privilege has been granted to a client. */ -#define HasPriv(cli, priv) FlagHas(&cli_privs(cli), priv) +#define HasPriv(cli, priv) FlagHas(cli_privs(cli), priv) +/** Grant a privilege to a client. */ +#define SetPriv(cli, priv) FlagSet(cli_privs(cli), priv) +/** Revoke a privilege from a client. */ +#define ClrPriv(cli, priv) FlagClr(cli_privs(cli), priv) + +/** Test whether a client has a capability */ +#define HasCap(cli, cap) CapHas(cli_capab(cli), (cap)) +/** Test whether a client has the capability active */ +#define CapActive(cli, cap) CapHas(cli_active(cli), (cap)) #define HIDE_IP 0 /**< Do not show IP address in get_client_name() */ #define SHOW_IP 1 /**< Show ident and IP address in get_client_name() */ Index: ircd-ircdev/include/handlers.h diff -u ircd-ircdev/include/handlers.h:1.8 ircd-ircdev/include/handlers.h:1.9 --- ircd-ircdev/include/handlers.h:1.8 Wed Nov 24 08:00:43 2004 +++ ircd-ircdev/include/handlers.h Tue Dec 28 03:15:44 2004 @@ -21,7 +21,7 @@ */ /** @file * @brief Declarations for all protocol message handler functions. - * @version $Id: handlers.h,v 1.8 2004/11/24 16:00:43 zolty Exp $ + * @version $Id: handlers.h,v 1.9 2004/12/28 11:15:44 zolty Exp $ */ #ifndef INCLUDED_handlers_h #define INCLUDED_handlers_h @@ -93,6 +93,7 @@ */ extern int m_admin(struct Client*, struct Client*, int, char*[]); extern int m_away(struct Client*, struct Client*, int, char*[]); +extern int m_cap(struct Client*, struct Client*, int, char*[]); extern int m_cnotice(struct Client*, struct Client*, int, char*[]); extern int m_cprivmsg(struct Client*, struct Client*, int, char*[]); extern int m_gline(struct Client*, struct Client*, int, char*[]); @@ -154,9 +155,7 @@ extern int mo_clearmode(struct Client*, struct Client*, int, char*[]); extern int mo_close(struct Client*, struct Client*, int, char*[]); extern int mo_connect(struct Client*, struct Client*, int, char*[]); -#if defined(DDB) extern int mo_dbq(struct Client*, struct Client*, int, char*[]); -#endif extern int mo_die(struct Client*, struct Client*, int, char*[]); extern int mo_get(struct Client*, struct Client*, int, char*[]); extern int mo_gline(struct Client*, struct Client*, int, char*[]); @@ -194,9 +193,7 @@ /* * Server commands */ -#if defined(UNDERNET) extern int ms_account(struct Client*, struct Client*, int, char*[]); -#endif extern int ms_admin(struct Client*, struct Client*, int, char*[]); extern int ms_asll(struct Client*, struct Client*, int, char*[]); extern int ms_away(struct Client*, struct Client*, int, char*[]); @@ -204,10 +201,8 @@ extern int ms_clearmode(struct Client*, struct Client*, int, char*[]); extern int ms_connect(struct Client*, struct Client*, int, char*[]); extern int ms_create(struct Client*, struct Client*, int, char*[]); -#if defined(DDB) extern int ms_db(struct Client*, struct Client*, int, char*[]); extern int ms_dbq(struct Client*, struct Client*, int, char*[]); -#endif extern int ms_destruct(struct Client*, struct Client*, int, char*[]); extern int ms_desynch(struct Client*, struct Client*, int, char*[]); extern int ms_end_of_burst(struct Client*, struct Client*, int, char*[]); Index: ircd-ircdev/include/ircd_log.h diff -u ircd-ircdev/include/ircd_log.h:1.3 ircd-ircdev/include/ircd_log.h:1.4 --- ircd-ircdev/include/ircd_log.h:1.3 Wed Nov 24 08:00:43 2004 +++ ircd-ircdev/include/ircd_log.h Tue Dec 28 03:15:44 2004 @@ -21,7 +21,7 @@ */ /** @file * @brief IRC logging interface. - * @version $Id: ircd_log.h,v 1.3 2004/11/24 16:00:43 zolty Exp $ + * @version $Id: ircd_log.h,v 1.4 2004/12/28 11:15:44 zolty Exp $ */ #ifndef INCLUDED_ircd_log_h #define INCLUDED_ircd_log_h @@ -30,6 +30,10 @@ #include <stdarg.h> /* va_list */ #define INCLUDED_stdarg_h #endif +#ifndef INCLUDED_stdlib_h +#include <stdlib.h> /* abort */ +#define INCLUDED_stdlib_h +#endif struct Client; @@ -111,4 +115,47 @@ extern int log_feature_mark(int flag); extern void log_feature_report(struct Client *to, int flag); +extern int log_inassert; + #endif /* INCLUDED_ircd_log_h */ + +/* The rest of this file implements our own custom version of assert. + * This version will log the assertion failure using the LS_SYSTEM log + * stream, thus putting the assertion failure message into a useful + * place, rather than elsewhere, as is currently the case... + */ + +/* We've been included twice; clean up before creating assert() again */ +#ifdef _ircd_log_assert +# undef _ircd_log_assert +# undef assert +#endif + +/* gcc has a nice way of hinting that an expression is expected to + * produce a specific result, which can improve optimization. + * Unfortunately, all the world's not gcc (at least, not yet), and not + * all gcc's support it. I don't know exactly when it appeared, but + * it does appear to be in all versions from 3 and up. So, we'll + * create a dummy define if (we think) this version of gcc doesn't + * have it... + */ +#ifndef _log_builtin_expect +# define _log_builtin_expect +# if __GNUC__ < 3 +# define __builtin_expect(expr, expect) (expr) +# endif +#endif + +/* let's try not to clash with the system assert()... */ +#ifndef assert +# ifdef NDEBUG +# define assert(expr) ((void)0) +# else +# define assert(expr) \ + ((void)(__builtin_expect(!!(expr), 1) ? 0 : \ + (__builtin_expect(log_inassert, 0) ? (abort(), 0) : \ + ((log_inassert = 1), /* inhibit looping in assert() */ \ + log_write(LS_SYSTEM, L_CRIT, 0, "Assertion failure at %s:%d: " \ + "\"%s\"", __FILE__, __LINE__, #expr), abort(), 0)))) +# endif +#endif Index: ircd-ircdev/include/msg.h diff -u ircd-ircdev/include/msg.h:1.7 ircd-ircdev/include/msg.h:1.8 --- ircd-ircdev/include/msg.h:1.7 Wed Nov 24 08:00:43 2004 +++ ircd-ircdev/include/msg.h Tue Dec 28 03:15:44 2004 @@ -21,7 +21,7 @@ */ /** @file * @brief Command and token declarations and structures. - * @version $Id: msg.h,v 1.7 2004/11/24 16:00:43 zolty Exp $ + * @version $Id: msg.h,v 1.8 2004/12/28 11:15:44 zolty Exp $ */ #ifndef INCLUDED_msg_h #define INCLUDED_msg_h @@ -362,17 +362,18 @@ #define MSG_PRIVS "PRIVS" /* PRIV */ #define TOK_PRIVS "PRIVS" +#define MSG_CAP "CAP" +#define TOK_CAP "CAP" +#define CMD_CAP MSG_CAP, TOK_CAP + #define MSG_WATCH "WATCH" /* WATC */ #define TOK_WATCH "WATCH" - -#if defined(DDB) #define MSG_DB "DB" /* DB */ #define TOK_DB "DB" #define MSG_DBQ "DBQ" /* DBQ */ #define TOK_DBQ "DBQ" -#endif /* defined(DDB) */ /* Index: ircd-ircdev/include/numeric.h diff -u ircd-ircdev/include/numeric.h:1.7 ircd-ircdev/include/numeric.h:1.8 --- ircd-ircdev/include/numeric.h:1.7 Wed Nov 24 08:00:43 2004 +++ ircd-ircdev/include/numeric.h Tue Dec 28 03:15:44 2004 @@ -21,7 +21,7 @@ */ /** @file * @brief Declarations of numeric replies and supporting functions. - * @version $Id: numeric.h,v 1.7 2004/11/24 16:00:43 zolty Exp $ + * @version $Id: numeric.h,v 1.8 2004/12/28 11:15:44 zolty Exp $ */ #ifndef INCLUDED_numeric_h #define INCLUDED_numeric_h @@ -331,6 +331,7 @@ /* ERR_NOCOLORSONCHAN 408 Dalnet */ #define ERR_NOORIGIN 409 +#define ERR_UNKNOWNCAPCMD 410 #define ERR_NORECIPIENT 411 #define ERR_NOTEXTTOSEND 412 #define ERR_NOTOPLEVEL 413 Index: ircd-ircdev/include/numnicks.h diff -u ircd-ircdev/include/numnicks.h:1.3 ircd-ircdev/include/numnicks.h:1.4 --- ircd-ircdev/include/numnicks.h:1.3 Wed Nov 24 08:00:43 2004 +++ ircd-ircdev/include/numnicks.h Tue Dec 28 03:15:44 2004 @@ -21,7 +21,7 @@ */ /** @file * @brief Interface for numeric nickname functions. - * @version $Id: numnicks.h,v 1.3 2004/11/24 16:00:43 zolty Exp $ + * @version $Id: numnicks.h,v 1.4 2004/12/28 11:15:44 zolty Exp $ */ #ifndef INCLUDED_numnicks_h #define INCLUDED_numnicks_h @@ -88,7 +88,7 @@ extern unsigned int base64toint(const char* str); extern const char* inttobase64(char* buf, unsigned int v, unsigned int count); -extern const char* iptobase64(char* buf, const struct irc_in_addr* addr, unsigned int count); +extern const char* iptobase64(char* buf, const struct irc_in_addr* addr, unsigned int count, int v6_ok); extern void base64toip(const char* s, struct irc_in_addr* addr); #endif /* INCLUDED_numnicks_h */ Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.14 ircd-ircdev/include/patchlevel.h:1.15 --- ircd-ircdev/include/patchlevel.h:1.14 Wed Nov 24 08:00:43 2004 +++ ircd-ircdev/include/patchlevel.h Tue Dec 28 03:15:44 2004 @@ -17,10 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: patchlevel.h,v 1.14 2004/11/24 16:00:43 zolty Exp $ + * $Id: patchlevel.h,v 1.15 2004/12/28 11:15:44 zolty Exp $ * */ -#define PATCHLEVEL ".alpha13" +#define PATCHLEVEL ".alpha14" #define RELEASE "1.0" Index: ircd-ircdev/include/send.h diff -u ircd-ircdev/include/send.h:1.4 ircd-ircdev/include/send.h:1.5 --- ircd-ircdev/include/send.h:1.4 Wed Nov 24 08:00:44 2004 +++ ircd-ircdev/include/send.h Tue Dec 28 03:15:44 2004 @@ -21,7 +21,7 @@ */ /** @file send.h * @brief Send messages to certain targets. - * @version $Id: send.h,v 1.4 2004/11/24 16:00:44 zolty Exp $ + * @version $Id: send.h,v 1.5 2004/12/28 11:15:44 zolty Exp $ */ #ifndef INCLUDED_send_h #define INCLUDED_send_h @@ -66,6 +66,12 @@ const char *tok, struct Client *to, const char *pattern, ...); +/* Send command to servers by flags except one */ +extern void sendcmdto_flag_serv_butone(struct Client *from, const char *cmd, + const char *tok, struct Client *one, + int require, int forbid, + const char *pattern, ...); + /* Send command to all servers except one */ extern void sendcmdto_serv_butone(struct Client *from, const char *cmd, const char *tok, struct Client *one, Index: ircd-ircdev/ircd-patch diff -u /dev/null ircd-ircdev/ircd-patch:1.1 --- /dev/null Tue Dec 28 03:16:00 2004 +++ ircd-ircdev/ircd-patch Tue Dec 28 03:15:43 2004 @@ -0,0 +1,229 @@ +#!/bin/sh +# +# IRC-Dev IRCD - An advanced and innovative IRC Daemon, ircd-patch + +# Copyright (C) 2002-2... [truncated message content] |
From: Toni G. <zo...@us...> - 2004-12-27 11:25:49
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-12-27 11:25:40 UTC Modified files: doc/ircd.sample-en.conf doc/ircd.sample-es.conf Log message: Actualizacion ircd.conf ---------------------- diff included ---------------------- Index: ircd-ircdev/doc/ircd.sample-en.conf diff -u ircd-ircdev/doc/ircd.sample-en.conf:1.8 ircd-ircdev/doc/ircd.sample-en.conf:1.9 --- ircd-ircdev/doc/ircd.sample-en.conf:1.8 Wed Nov 17 03:45:49 2004 +++ ircd-ircdev/doc/ircd.sample-en.conf Mon Dec 27 03:25:29 2004 @@ -1,6 +1,6 @@ # ircd.conf - configuration file for IRC-Dev's IRCD. # -# Last Updated: 17, Nov 2004. +# Last Updated: 27, Dec 2004. # # Written by Niels <ni...@un...>, based on the original example.conf, # server code and some real-life (ahem) experience. @@ -54,17 +54,20 @@ # General { # name = "servername"; # vhost = "virtualhost"; +# resolver = "ipaddress"; # description = "description"; # numeric = numericnumber; # }; # -# The "vhost" field must contain either a * or a valid IPv4 address in -# dotted quad notation. (127.0.0.1) The address MUST be the address -# of a physical interface on the host. This address is used for outgoing -# connections only, see "Port" block for listener virtual hosting. -# If in doubt put a * or the IP of your primary interface here. -# The server must be compiled with virtual hosting turned on to get this -# to work correctly. +# If present, "virtual" must contain a valid address in dotted +# quad or IPv6 numeric notation (127.0.0.1 or ::1). The address MUST +# be the address of a physical interface on the host. This address is +# used for outgoing connections if the "Connect" block does not override +# it. See "Port" block for listener virtual hosting. If in doubt, +# leave it out. +# +# You may need to specify the "resolver" address if your compile +# defaults to using IPv6 but your resolvers are all IPv4 hosts. # # Note that "numeric" field has to be unique on the network your server # is running on, must be between 0 and 4095, and is not updated on a rehash. @@ -102,20 +105,14 @@ # usermode = "+i"; # }; # +# The "maxlinks" field should be set at either 0 or 1. +# # The "connectfreq" field applies only to servers, and specifies the # frequency that the server tries to autoconnect. setting this to 0 will # cause the server to attempt to connect repeatedly with no delay until the # "maxlinks" condition is satisfied. This is a Bad Thing(tm). # Note that times can be specified as a number, or by giving something # like: 1 minutes 20 seconds, or 1*60+20. -# Client { -# host = "user@host"; -# ip = "ip@host"; -# password = "password"; -# class = "classname"; -# }; -# -# The "maxlinks" field should be set at either 0 or 1. # # Recommended server classes: # All your server uplinks you are not a hub for. @@ -135,6 +132,23 @@ sendq = 9000000; }; +# Client { +# username = "ident"; +# host = "host"; +# ip = "127.0.0.0/8"; +# password = "password"; +# class = "classname"; +# maxlinks = 3; +# }; +# +# Everything in a "Client" block is optional. If a "username" mask is +# given, it must match the client's username from the IDENT protocol. +# If a "host" mask is given, the client's hostname must resolve and +# match the host mask. If a CIDR-style "IP" mask is given, the client +# must have an IP matching that range. If "maxlinks" is given, it is +# limits the number of matching clients allowed from a particular IP +# address. +# # Recommended client classes: # Client classes. 10 = locals; 2 = for all .net and .com that are not # in Europe; 1 = for everybody. @@ -148,7 +162,7 @@ Client { class = "Other"; - host = "*@*"; + username = "*"; }; Class { name = "Telefonica"; @@ -313,7 +327,7 @@ class = "Local"; }; -# You can put a digit (0..9) in the password value, which will make ircd +# You can put an expression in the maxlinks, which will make ircd # only accept a client when the total number of connections to the network # from the same IP number doesn't exceed this number. # The following example would accept at most one connection per IP number @@ -321,12 +335,12 @@ # that have "dial??.*" as host mask: # Client { # host = "*@*.ono.com"; -# password = "1"; +# maxlinks = "1"; # class = "Other"; # }; # Client { # host = "*@dial??.*"; -# password = "2"; +# maxlinks = "2"; # class = "Other"; # }; # @@ -372,7 +386,7 @@ file = "irc-dev.motd"; }; -# [Server] +# [Uworld] # # One of the many nice features of IRC-Dev is "Uworld", a program # connected to the net as a server. This allows it to broadcast any mode @@ -381,16 +395,9 @@ # There is only one slight problem: the TimeStamp protocol prevents this. # So there is a configuration option to allow them anyway from a certain # server. -# Server { +# UWorld { # # The servername or wildcard mask for it that this applies to. # name = "relservername"; -# # The mask of servers they are allowed to introduce(for hub=yes;) or -# # not allowed to introduce(for leaf=yes). -# mask = "servermask"; -# # No is assumed for these unless you set it to yes. -# uworld = no; -# leaf = no; -# hub = yes; # }; # # Note: (1) These lines are agreed on by every server admin on IRC-Dev; @@ -400,7 +407,7 @@ # If you're on IRC-Dev, you MUST have these lines. I cannnot stress # this enough. If all of the servers don't have the same lines, the # servers will try to undo the mode hacks that Uworld does. Make SURE that -# all of the servers have the EXACT same Ulines. +# all of the servers have the EXACT same Uworld blocks. # # If your server starts on a bit larger network, you'll probably get # assigned one or two uplinks to which your server can connect. @@ -410,28 +417,11 @@ # You can also force a server(even one that doesn't connect to you) # to be a leaf with "leaf = yes;" -Server { +UWorld { name = "luz.irc-dev.net"; - mask = "*"; - uworld = yes; - hub = yes; }; -Server { +Uworld { name = "services.irc-dev.net"; - mask = "*"; - uworld = yes; - hub = yes; -}; -Server { - name = "gmsis2.irc-dev.net"; - mask = "*"; - hub = yes; -}; -# An example just to make sure IRCnet doesn't get on IRC-Dev.Net... -Server { - name = "*"; - mask = "eris.berkeley.edu"; - hub = yes; }; # It is possible to Jupe nicks. @@ -519,6 +509,8 @@ # password = "passwd"; # port = portno; # class = "classname"; +# maxhops = 2; +# hub = "*.eu.irc-dev.net"; # }; # # The "port" field defines the default port the server tries to connect @@ -526,6 +518,12 @@ # the port used when the server attempts to auto-connect to the remote # server. (See "Class" blocks for more informationa about auto-connects). # +# The "maxhops" field causes an SQUIT if a hub tries to introduce +# servers farther away than that; the element "leaf," is an alias for +# "maxhops = 0,". The "hub" field limits the names of servers that may +# be introduced by a hub; the element "hub;" is an alias for +# "hub = "*";". +# # Our primary uplink. Connect { name = "devel.irc-dev.net"; @@ -533,6 +531,7 @@ password = "passwd"; port = 4400; class = "Server"; + hub; }; @@ -704,6 +703,15 @@ nick = "X...@ch..."; }; +# You can ask a separate server whether to allow users to connect. +IAuth { + pass = "ircd-iauth"; + host = "127.0.0.1"; + port = 7700; + connectfreq = 30; + timeout = 60; +}; + # [Features] # IRC servers have a large number of options and features. Most of these # are set at compile time through the use of #define's--see "make config" @@ -755,10 +763,9 @@ # "MAXBANS" = "45"; # "MAXSILES" = "15"; # "MAXWATCHS" = "128"; -# "HANGONGOODLINK = "300"; +# "HANGONGOODLINK" = "300"; # "HANGONRETRYDELAY" = "10"; # "CONNECTTIMEOUT" = "90"; -# "TIMESEC" = "60"; # "MAXIMUM_LINKS" = "1"; # "PINGFREQUENCY" = "120"; # "CONNECTFREQUENCY" = "600"; @@ -772,20 +779,16 @@ # "MPATH" = "ircd.motd"; # "RPATH" = "remote.motd"; # "PPATH" = "ircd.pid"; -# "VIRTUAL_HOST" = "FALSE"; # "TOS_SERVER" = "0x08"; # "TOS_CLIENT" = "0x08"; # "POLLS_PER_LOOP" = "200"; -# "IRCD_RES_TIMEOUTS = "4"; # "IRCD_RES_RETRIES = "2"; +# "IRCD_RES_TIMEOUT = "4"; # "AUTH_TIMEOUT = "9"; # "ANNOUNCE_INVITES = "FALSE"; -# "CRYPT_OPER_PASSWORD" = "TRUE"; # "CONFIG_OPERCMDS" = "FALSE"; -# "LIST_CHAN" = "TRUE"; # "HIS_SNOTICES" = "TRUE"; # "HIS_SNOTICES_OPER_ONLY" = "TRUE"; -# "HIS_DESYNCS" = "TRUE"; # "HIS_DEBUG_OPER_ONLY" = "TRUE"; # "HIS_WALLOPS" = "TRUE"; # "HIS_MAP" = "TRUE"; @@ -803,6 +806,7 @@ # "HIS_STATS_j" = "TRUE"; # "HIS_STATS_k" = "TRUE"; # "HIS_STATS_l" = "TRUE"; +# "HIS_STATS_L" = "TRUE"; # "HIS_STATS_m" = "TRUE"; # "HIS_STATS_M" = "TRUE"; # "HIS_STATS_o" = "TRUE"; Index: ircd-ircdev/doc/ircd.sample-es.conf diff -u ircd-ircdev/doc/ircd.sample-es.conf:1.3 ircd-ircdev/doc/ircd.sample-es.conf:1.4 --- ircd-ircdev/doc/ircd.sample-es.conf:1.3 Wed Nov 17 03:45:49 2004 +++ ircd-ircdev/doc/ircd.sample-es.conf Mon Dec 27 03:25:29 2004 @@ -1,6 +1,6 @@ # ircd.conf - archivo de configuración para el IRCD de IRC-Dev. # -# Ultima actualización: 17, Nov 2004. +# Ultima actualización: 27, Dec 2004. # # Escrito por Niels <ni...@un...>, basado en el archivo example.conf # original, en el código del servidor y la experiencia de la vida real. @@ -60,18 +60,20 @@ # General { # name = "nombreservidor"; # vhost = "virtualhost"; +# resolver = "direccionip"; # description = "descripcion"; # numeric = númerodenúmerico; # }; # -# El campo "vhost" debe contener un * o una dirección IPv4 válida en la -# notación de 4 números (127.0.0.1). La dirección DEBE ser la dirección -# de una interfaz física en el host. Esta dirección se utiliza solamente -# para las conexiones salientes, veáse el bloque "Port" para la escucha -# con virtual hosting. -# En caso de duda, pon un * o la IP de tu interface primaria aquí. -# El servidor debe estar compilado con "virtual hosting" activado para -# conseguir que esto trabaje correctamente. +# Si esta presente, el campo "vhost" debe contener una dirección válida +# en la notación de 4 números o notación numérica de IPv6 (127.0.0.1 o ::1). +# La dirección DEBE ser la dirección de una interfaz física en el host. +# Esta dirección se utiliza para las conexiones salientes si el bloque +# "Connect" no la elimina. Veáse el bloque "Port" para la escucha con +# virtual hosting. En caso de duda no pongas nada. +# +# Puede que necesites especificar la dirección del resolvedor DNS si tu +# has compilado con IPv6 pero tus resolvedores son hosts de IPv4. # # Observe que el campo "numeric" tiene que ser único en la red si tu # servidor esta funcionando, y debe estar entre 0 y 4095, y no se @@ -112,6 +114,8 @@ # usermode = "+i"; # }; # +# El campo "maxlinks" se debe fijar en 0 o 1. +# # El campo "connectfreq" se aplica solamente a los servidores, y especifica # la frecuencia con la cual el servidor intentará hacer el "autoconnect". # Ajustando a 0 causará que el servidor intentará repetidamente sin pausa @@ -119,14 +123,6 @@ # Esto es una mala idea (Bad Thing(tm)). # Observe que los tiempos se pueden especificar como número, dando algo # como este: 1 minutes 20 seconds, or 1*60+20. -# Client { -# host = "user@host"; -# ip = "ip@host"; -# password = "contraseña"; -# class = "nombreclase"; -# }; -# -# El campo "maxlinks" se debe fijar en 0 o 1. # # Clases de servidores recomendadas: # Todos los uplinks del servidor si tu no eres un "hub". @@ -146,6 +142,22 @@ sendq = 9000000; }; +# Client { +# username = "ident"; +# host = "host"; +# ip = "127.0.0.0/8"; +# password = "contraseña"; +# class = "nombreclase"; +# maxlinks = 3; +# }; +# +# Todo en un bloque "Client" es opcional. Si se da una máscara de "username", +# eso será comparado con el "username" del cliente del protocolo IDENT. +# Si se da una máscara de "host", el hostname del cliente debe ser resuelto y +# comparado con la máscara. Si se da una máscara de "IP" en CIDR, el cliente +# debe tener una IP dentro de ese rango. Si se da el campo "maxlinks", este +# es el límite de clientes permitidos desde una dirección IP particular. +# # Clases de clientes recomendadas: # Clases de clientes. 10 = locales; 2 = para todos los .net y .com que no # estén en Europa; 1 = para todos los demás. @@ -159,7 +171,7 @@ Client { class = "Otros"; - host = "*@*"; + username = "*"; }; Class { name = "Telefonica"; @@ -329,7 +341,8 @@ class = "Local"; }; -# Puedes poner un número (0..9) en el campo "password", que hará que el + +# Puedes poner una expresión en el campo "maxlinks", que hará que el # ircd sólo acepte un cliente cuando el numero total de conexiones a la # red desde la misma IP numérica no exceda de ese número. # El siguiente ejemplo aceptaría al menos una conexión por IP numérica @@ -337,12 +350,12 @@ # internet por modem que tengan "*.dial??.*" como máscara de host: # Client { # host = "*@*.ono.com"; -# password = "1"; +# maxlinks = "1"; # class = "Otros"; # }; # Client { # host = "*@dial??.*"; -# password = "2"; +# maxlinks = "2"; # class = "Otros"; # }; # @@ -389,7 +402,7 @@ file := "irc-dev.motd"; }; -# [Server] +# [Uworld] # # Una de las características más atractivas de IRC-Dev, es "Uworld", un # programa conectado a la red como servidor. Esto le permite realizar @@ -398,16 +411,9 @@ # Sólo hay un pequeño problema: El protocolo del TimeStamp (TS) hace # que no sea posible. Por esto, hay una opción de configuración para # permitir esos cambios desde cierto servidor. -# Server { +# Uworld { # # El nombre del servidor o la máscara para el que esto se aplica. # name = "relnombreservidor"; -# # La máscara de servidores se permite para introducir (para hub = yes;) -# # o no se permite (para leaf = yes;). -# mask = "máscaraservidor"; -# # No son asumidos estos valores a menos que lo fijes a "yes". -# uworld = no; -# leaf = no; -# hub = yes; # }; # # Nota: (1) Estas líneas son puestas por cada administrador de un servidor @@ -418,8 +424,8 @@ # Si estás en IRC-Dev, DEBES tener estas líneas. No puedo tener estrés # por esto. Si todos los servidores no tienen las mismas lineas, los # servidores intentarán deshacer los "hack" de cambios de modos que hará -# Uworld. ASEGURATE que todos los servidores tengan EXACTAMENTE las mismas -# "Ulines". +# Uworld. ASEGURATE que todos los servidores tengan EXACTAMENTE los mismos +# bloques "Uworld". # # Si tu servidor arranca en una red más grande, es probable que se te # asignen uno o dos servidores a los que tu servidor pueda conectar. @@ -430,28 +436,11 @@ # Puedes tambien forzar un servidor (uno que que no conecte con usted) # a ser un "leaf" con "leaf = yes;" -Server { +Uworld { name = "luz.irc-dev.net"; - mask = "*"; - uworld = yes; - hub = yes; }; -Server { +Uworld { name = "services.irc-dev.net"; - mask = "*"; - uworld = yes; - hub = yes; -}; -Server { - name = "gmsis2.irc-dev.net"; - mask = "*"; - hub = yes; -}; -# Un ejemplo para estar seguro que IRCnet no consiga en IRC-Dev.Net... -Server { - name = "*"; - mask = "eris.berkeley.edu"; - hub = yes; }; # Esto es posible para prohibir (Jupe) nicks. @@ -545,6 +534,8 @@ # password = "contraseña"; # port = númeropuerto; # class = "nombreclase"; +# maxhops = 2; +# hub = "*.eu.irc-dev.net"; # }; # # El campo "port" define el puerto por defecto que el servidor intentará @@ -553,6 +544,11 @@ # de autoconectar con el servidor remoto. (Véase los bloques "Class" para # más informacion sobre "auto-connects"). # +# El campo "maxhops" causa un SQUIT si un hub intenta introducir servidores +# más lejos que eso, el elemento "leaf"; es un alias para "maxhops = 0;". +# El campo "hub" limita los nombres de los servidores que pueden introducir +# por un hub, el elemento "hub;" es un alias para "hub = "*";". +# # Nuestro uplink primario. Connect { name = "devel.irc-dev.net"; @@ -560,6 +556,7 @@ password = "passwd"; port = 4400; class = "Servidor"; + hub; }; @@ -739,6 +736,15 @@ nick = "X...@ch..."; }; +# Puedes pedir un servidor separado para permitir a los usuarios conectar. +IAuth { + pass = "ircd-iauth"; + host = "127.0.0.1"; + port = 7700; + connectfreq = 30; + timeout = 60; +}; + # [Features] # Los servidores de IRC tienen una gran cantidad de opciones y # características. La mayoria de éstos se ajustan en tiempo de compilación @@ -753,8 +759,8 @@ # características se enumeran abajo, y al final cómo ajustar el "logging". # # Gracias especiales a Kev por escribir la documentación de F:lines. Eso -# puede ser encontrado en doc/*/features.txt y la documentación de registro -# de eventos (logging) se puede encontrar en doc/*/log.txt. Los valores por +# puede ser encontrado en doc/es/features.txt y la documentación de registro +# de eventos (logging) se puede encontrar en doc/es/log.txt. Los valores por # defecto usados por la red de IRC-Dev están abajo. # Features @@ -792,10 +798,9 @@ # "MAXBANS" = "45"; # "MAXSILES" = "15"; # "MAXWATCHS" = "128"; -# "HANGONGOODLINK = "300"; +# "HANGONGOODLINK" = "300"; # "HANGONRETRYDELAY" = "10"; # "CONNECTTIMEOUT" = "90"; -# "TIMESEC" = "60"; # "MAXIMUM_LINKS" = "1"; # "PINGFREQUENCY" = "120"; # "CONNECTFREQUENCY" = "600"; @@ -808,18 +813,15 @@ # "IPCHECK_CLONE_DELAY = "600"; # "MPATH" = "ircd.motd"; # "RPATH" = "remote.motd"; -# "PPATH" = "ircd.pid";# "LIST_CHAN" = "TRUE"; -# "VIRTUAL_HOST" = "FALSE"; +# "PPATH" = "ircd.pid"; # "TOS_SERVER" = "0x08"; # "TOS_CLIENT" = "0x08"; # "POLLS_PER_LOOP" = "200"; -# "IRCD_RES_TIMEOUTS = "4"; # "IRCD_RES_RETRIES = "2"; +# "IRCD_RES_TIMEOUT = "4"; # "AUTH_TIMEOUT = "9"; # "ANNOUNCE_INVITES = "FALSE"; -# "CRYPT_OPER_PASSWORD" = "TRUE"; # "CONFIG_OPERCMDS" = "FALSE"; -# "LIST_CHAN" = "TRUE"; # "HIS_SNOTICES" = "TRUE"; # "HIS_SNOTICES_OPER_ONLY" = "TRUE"; # "HIS_DESYNCS" = "TRUE"; @@ -840,6 +842,7 @@ # "HIS_STATS_j" = "TRUE"; # "HIS_STATS_k" = "TRUE"; # "HIS_STATS_l" = "TRUE"; +# "HIS_STATS_L" = "TRUE"; # "HIS_STATS_m" = "TRUE"; # "HIS_STATS_M" = "TRUE"; # "HIS_STATS_o" = "TRUE"; ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2004-11-24 16:22:41
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-11-24 16:22:32 UTC Modified files: TODO.es Log message: Actualizacion TODO list ---------------------- diff included ---------------------- Index: ircd-ircdev/TODO.es diff -u ircd-ircdev/TODO.es:1.9 ircd-ircdev/TODO.es:1.10 --- ircd-ircdev/TODO.es:1.9 Mon May 24 08:51:11 2004 +++ ircd-ircdev/TODO.es Wed Nov 24 08:22:22 2004 @@ -1,7 +1,7 @@ # # TODO para ircd-ircdev # -# $Id: TODO.es,v 1.9 2004/05/24 15:51:11 zolty Exp $ +# $Id: TODO.es,v 1.10 2004/11/24 16:22:22 zolty Exp $ # # Insertar las nuevas entradas al principio de la lista TODO. # @@ -51,20 +51,16 @@ PRIORIDAD BAJA -------------------------------------------------------------------------------------- - - [G] Enlazar la libreria de adns al ircd. - [G] ¿Ampliacion comando OPER para elegir clase? - [G] Estudiar sobre la conveniencia de mezclar numericos (3 y 5). Puede romper la estandarizacion del protocolo P10. - [G] Posibilidad de BURST de topics. - [G] S-lines (Spoof Lines). - - [G] Implementar la libreria libevent cuando este terminado (Da soporte IPv6). - [G] Soporte Zlib para server<->server y client<->server (requiere negociado). - [G] Soporte RC4 para server<->server. - [G] Soporte SSL para client<->server. - [U] Soporte de modos de canal +A y +u y todo lo relacionado con el (.12). - - [G] Soporte de cache de MAP (.12). - - [G] Nuevo soporte de memoria (.12). - [G] Mirar si el aviso de invites lo haga con wallchops o con raw. BUGS CONOCIDOS ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2004-11-24 16:13:49
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-11-24 16:13:37 UTC Modified files: Doxyfile .cvsignore Log message: Author: zoltan <zo...@ir...> Log message: 2004-11-24 Toni García <zo...@ir...> 1.0.alpha13 * Comentarios para Doxygen * Excepciones de Silences * Soporte total de IPv6 * Sincronizacion Undernet ---------------------- diff included ---------------------- Index: ircd-ircdev/.cvsignore diff -u ircd-ircdev/.cvsignore:1.2 ircd-ircdev/.cvsignore:1.3 --- ircd-ircdev/.cvsignore:1.2 Sat Nov 1 09:19:35 2003 +++ ircd-ircdev/.cvsignore Wed Nov 24 08:13:27 2004 @@ -6,3 +6,5 @@ config.status config.cache autom4te.cache +.project +ircu.tags Index: ircd-ircdev/Doxyfile diff -u ircd-ircdev/Doxyfile:1.1 ircd-ircdev/Doxyfile:1.2 --- ircd-ircdev/Doxyfile:1.1 Sun Feb 22 08:16:22 2004 +++ ircd-ircdev/Doxyfile Wed Nov 24 08:13:27 2004 @@ -105,7 +105,7 @@ # comments will behave just like the Qt-style comments (thus requiring an # explict @brief command for a brief description. -JAVADOC_AUTOBRIEF = NO +JAVADOC_AUTOBRIEF = YES # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// @@ -318,7 +318,7 @@ # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. -QUIET = NO +QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank @@ -361,7 +361,7 @@ # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = . +INPUT = ircd include # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp @@ -599,7 +599,7 @@ # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. -GENERATE_TREEVIEW = NO +GENERATE_TREEVIEW = YES # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree @@ -614,7 +614,7 @@ # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. -GENERATE_LATEX = YES +GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be @@ -732,7 +732,7 @@ # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages -GENERATE_MAN = YES +GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be @@ -875,7 +875,7 @@ # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. -PREDEFINED = +PREDEFINED = DEBUGMODE FORCEINLINE IPV6 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. @@ -945,7 +945,7 @@ # option is superceded by the HAVE_DOT option below. This is only a fallback. It is # recommended to install and use dot, since it yields more powerful graphs. -CLASS_DIAGRAMS = YES +CLASS_DIAGRAMS = NO # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented @@ -958,7 +958,7 @@ # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) -HAVE_DOT = YES +HAVE_DOT = NO # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2004-11-24 16:11:56
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-11-24 16:11:41 UTC Modified files: ChangeLog ChangeLog.es Makefile.in acinclude.m4 aclocal.m4 config.h.in configure configure.in Log message: Author: zoltan <zo...@ir...> Log message: 2004-11-24 Toni García <zo...@ir...> 1.0.alpha13 * Comentarios para Doxygen * Excepciones de Silences * Soporte total de IPv6 * Sincronizacion Undernet ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.13 ircd-ircdev/ChangeLog:1.14 --- ircd-ircdev/ChangeLog:1.13 Wed Nov 17 03:45:48 2004 +++ ircd-ircdev/ChangeLog Wed Nov 24 08:11:30 2004 @@ -1,10 +1,16 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.13 2004/11/17 11:45:48 zolty Exp $ +# $Id: ChangeLog,v 1.14 2004/11/24 16:11:30 zolty Exp $ # # Insert new changes at beginning of the change list. # +2004-11-24 Toni García <zo...@ir...> 1.0.alpha13 + * Doxygen commentarys + * Silence exceptions + * IPv6 full support + * Undernet synchronization + 2004-11-17 Toni García <zo...@ir...> 1.0.alpha12 * Undernet synchronization Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.13 ircd-ircdev/ChangeLog.es:1.14 --- ircd-ircdev/ChangeLog.es:1.13 Wed Nov 17 03:45:48 2004 +++ ircd-ircdev/ChangeLog.es Wed Nov 24 08:11:30 2004 @@ -1,12 +1,18 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.13 2004/11/17 11:45:48 zolty Exp $ +# $Id: ChangeLog.es,v 1.14 2004/11/24 16:11:30 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2004-11-24 Toni García <zo...@ir...> 1.0.alpha13 + * Comentarios para Doxygen + * Excepciones de Silences + * Soporte total de IPv6 + * Sincronizacion Undernet + 2004-11-17 Toni García <zo...@ir...> 1.0.alpha12 - * Sincronizacion Undernet + * Sincronizacion Undernet 2004-11-16 Toni García <zo...@ir...> 1.0.alpha11 * IRCD IRC-Dev Ha Vuelto!! @@ -24,6 +30,7 @@ * Fix de warnings de compilacion * Comando USERS * Sincronizacion Undernet + 2004-04-23 Roberto Muñoz <r5...@te...> * Soporte @+ en WHOIS, WHO y NAMES Index: ircd-ircdev/Makefile.in diff -u ircd-ircdev/Makefile.in:1.4 ircd-ircdev/Makefile.in:1.5 --- ircd-ircdev/Makefile.in:1.4 Fri May 21 08:39:33 2004 +++ ircd-ircdev/Makefile.in Wed Nov 24 08:11:30 2004 @@ -26,12 +26,11 @@ SHELL = @SHPROG@ RM = @RMPROG@ AWK = @AWK@ -adns_subdir = @ADNS_SUBDIR@ @SET_MAKE@ #### End of system configuration section. #### -SUBDIRS = doc ${adns_subdir} ircd -IRCD_MAKEFILES = Makefile doc/Makefile libs/adns/Makefile ircd/Makefile +SUBDIRS = doc ircd +IRCD_MAKEFILES = Makefile doc/Makefile ircd/Makefile all: build Index: ircd-ircdev/acinclude.m4 diff -u ircd-ircdev/acinclude.m4:1.1.1.1 ircd-ircdev/acinclude.m4:1.2 --- ircd-ircdev/acinclude.m4:1.1.1.1 Mon Sep 8 03:34:25 2003 +++ ircd-ircdev/acinclude.m4 Wed Nov 24 08:11:30 2004 @@ -55,7 +55,7 @@ exit(1); }], unet_cv_sys_nonblocking_posix=yes, unet_cv_sys_nonblocking_posix=no)]) if test $unet_cv_sys_nonblocking_posix = yes; then - AC_DEFINE(NBLOCK_POSIX) + AC_DEFINE([NBLOCK_POSIX],,[Define if you have POSIX non-blocking sockets.]) else AC_CACHE_CHECK([for bsd non-blocking], unet_cv_sys_nonblocking_bsd, [AC_TRY_RUN([#include <sys/types.h> @@ -82,9 +82,9 @@ exit(1); }], unet_cv_sys_nonblocking_bsd=yes, unet_cv_sys_nonblocking_bsd=no)]) if test $unet_cv_sys_nonblocking_bsd = yes; then - AC_DEFINE(NBLOCK_BSD) + AC_DEFINE([NBLOCK_BSD],,[Define if you have BSD non-blocking sockets.]) else - AC_DEFINE(NBLOCK_SYSV) + AC_DEFINE([NBLOCK_SYSV],,[Define if you have SysV non-blocking sockets.]) fi fi]) @@ -102,7 +102,7 @@ [sigaction(SIGTERM, (struct sigaction *)0L, (struct sigaction *)0L)], unet_cv_sys_signal_posix=yes, unet_cv_sys_signal_posix=no)]) if test $unet_cv_sys_signal_posix = yes; then - AC_DEFINE(POSIX_SIGNALS) + AC_DEFINE([POSIX_SIGNALS],,[Define if you have POSIX signals.]) else AC_CACHE_CHECK([for bsd reliable signals], unet_cv_sys_signal_bsd, [AC_TRY_RUN([#include <signal.h> @@ -121,9 +121,9 @@ exit (0); }], unet_cv_sys_signal_bsd=yes, unet_cv_sys_signal_bsd=no)]) if test $unet_cv_sys_signal_bsd = yes; then - AC_DEFINE(BSD_RELIABLE_SIGNALS) + AC_DEFINE([BSD_RELIABLE_SIGNALS],,[Define if you have (reliable) BSD signals.]) else - AC_DEFINE(SYSV_UNRELIABLE_SIGNALS) + AC_DEFINE([SYSV_UNRELIABLE_SIGNALS],,[Define if you have (unreliable) SysV signals.]) fi fi]) @@ -138,26 +138,37 @@ AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(void *) +AC_CHECK_SIZEOF(int64_t) +AC_CHECK_SIZEOF(long long) if test "$ac_cv_sizeof_int" = 2 ; then AC_CHECK_TYPE(int16_t, int) - AC_CHECK_TYPE(u_int16_t, unsigned int) + AC_CHECK_TYPE(uint16_t, unsigned int) elif test "$ac_cv_sizeof_short" = 2 ; then AC_CHECK_TYPE(int16_t, short) - AC_CHECK_TYPE(u_int16_t, unsigned short) + AC_CHECK_TYPE(uint16_t, unsigned short) else AC_MSG_ERROR([Cannot find a type with size of 16 bits]) fi if test "$ac_cv_sizeof_int" = 4 ; then AC_CHECK_TYPE(int32_t, int) - AC_CHECK_TYPE(u_int32_t, unsigned int) + AC_CHECK_TYPE(uint32_t, unsigned int) elif test "$ac_cv_sizeof_short" = 4 ; then AC_CHECK_TYPE(int32_t, short) - AC_CHECK_TYPE(u_int32_t, unsigned short) + AC_CHECK_TYPE(uint32_t, unsigned short) elif test "$ac_cv_sizeof_long" = 4 ; then AC_CHECK_TYPE(int32_t, long) - AC_CHECK_TYPE(u_int32_t, unsigned long) + AC_CHECK_TYPE(uint32_t, unsigned long) else AC_MSG_ERROR([Cannot find a type with size of 32 bits]) +fi +if test "$ac_cv_sizeof_int64_t" = 8 ; then + AC_CHECK_TYPE(int64_t) + AC_CHECK_TYPE(uint64_t) +elif test "$ac_cv_sizeof_long_long" = 8 ; then + AC_CHECK_TYPE(int64_t, long long) + AC_CHECK_TYPE(uint64_t, unsigned long long) +else + AC_MSG_ERROR([Cannot find a type with size of 64 bits]) fi]) dnl Written by John Hawkinson <jh...@mi...>. This code is in the Public Index: ircd-ircdev/aclocal.m4 diff -u ircd-ircdev/aclocal.m4:1.2 ircd-ircdev/aclocal.m4:1.3 --- ircd-ircdev/aclocal.m4:1.2 Sat Nov 1 09:19:35 2003 +++ ircd-ircdev/aclocal.m4 Wed Nov 24 08:11:30 2004 @@ -1,6 +1,6 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p4 +dnl aclocal.m4 generated automatically by aclocal 1.4-p6 -dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -67,7 +67,7 @@ exit(1); }], unet_cv_sys_nonblocking_posix=yes, unet_cv_sys_nonblocking_posix=no)]) if test $unet_cv_sys_nonblocking_posix = yes; then - AC_DEFINE(NBLOCK_POSIX) + AC_DEFINE([NBLOCK_POSIX],,[Define if you have POSIX non-blocking sockets.]) else AC_CACHE_CHECK([for bsd non-blocking], unet_cv_sys_nonblocking_bsd, [AC_TRY_RUN([#include <sys/types.h> @@ -94,9 +94,9 @@ exit(1); }], unet_cv_sys_nonblocking_bsd=yes, unet_cv_sys_nonblocking_bsd=no)]) if test $unet_cv_sys_nonblocking_bsd = yes; then - AC_DEFINE(NBLOCK_BSD) + AC_DEFINE([NBLOCK_BSD],,[Define if you have BSD non-blocking sockets.]) else - AC_DEFINE(NBLOCK_SYSV) + AC_DEFINE([NBLOCK_SYSV],,[Define if you have SysV non-blocking sockets.]) fi fi]) @@ -114,7 +114,7 @@ [sigaction(SIGTERM, (struct sigaction *)0L, (struct sigaction *)0L)], unet_cv_sys_signal_posix=yes, unet_cv_sys_signal_posix=no)]) if test $unet_cv_sys_signal_posix = yes; then - AC_DEFINE(POSIX_SIGNALS) + AC_DEFINE([POSIX_SIGNALS],,[Define if you have POSIX signals.]) else AC_CACHE_CHECK([for bsd reliable signals], unet_cv_sys_signal_bsd, [AC_TRY_RUN([#include <signal.h> @@ -133,9 +133,9 @@ exit (0); }], unet_cv_sys_signal_bsd=yes, unet_cv_sys_signal_bsd=no)]) if test $unet_cv_sys_signal_bsd = yes; then - AC_DEFINE(BSD_RELIABLE_SIGNALS) + AC_DEFINE([BSD_RELIABLE_SIGNALS],,[Define if you have (reliable) BSD signals.]) else - AC_DEFINE(SYSV_UNRELIABLE_SIGNALS) + AC_DEFINE([SYSV_UNRELIABLE_SIGNALS],,[Define if you have (unreliable) SysV signals.]) fi fi]) @@ -150,26 +150,37 @@ AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(void *) +AC_CHECK_SIZEOF(int64_t) +AC_CHECK_SIZEOF(long long) if test "$ac_cv_sizeof_int" = 2 ; then AC_CHECK_TYPE(int16_t, int) - AC_CHECK_TYPE(u_int16_t, unsigned int) + AC_CHECK_TYPE(uint16_t, unsigned int) elif test "$ac_cv_sizeof_short" = 2 ; then AC_CHECK_TYPE(int16_t, short) - AC_CHECK_TYPE(u_int16_t, unsigned short) + AC_CHECK_TYPE(uint16_t, unsigned short) else AC_MSG_ERROR([Cannot find a type with size of 16 bits]) fi if test "$ac_cv_sizeof_int" = 4 ; then AC_CHECK_TYPE(int32_t, int) - AC_CHECK_TYPE(u_int32_t, unsigned int) + AC_CHECK_TYPE(uint32_t, unsigned int) elif test "$ac_cv_sizeof_short" = 4 ; then AC_CHECK_TYPE(int32_t, short) - AC_CHECK_TYPE(u_int32_t, unsigned short) + AC_CHECK_TYPE(uint32_t, unsigned short) elif test "$ac_cv_sizeof_long" = 4 ; then AC_CHECK_TYPE(int32_t, long) - AC_CHECK_TYPE(u_int32_t, unsigned long) + AC_CHECK_TYPE(uint32_t, unsigned long) else AC_MSG_ERROR([Cannot find a type with size of 32 bits]) +fi +if test "$ac_cv_sizeof_int64_t" = 8 ; then + AC_CHECK_TYPE(int64_t) + AC_CHECK_TYPE(uint64_t) +elif test "$ac_cv_sizeof_long_long" = 8 ; then + AC_CHECK_TYPE(int64_t, long long) + AC_CHECK_TYPE(uint64_t, unsigned long long) +else + AC_MSG_ERROR([Cannot find a type with size of 64 bits]) fi]) dnl Written by John Hawkinson <jh...@mi...>. This code is in the Public @@ -226,825 +237,6 @@ AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl))) ]) -# lib-prefix.m4 serial 3 (gettext-0.12.2) -dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Bruno Haible. - -dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and -dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't -dnl require excessive bracketing. -ifdef([AC_HELP_STRING], -[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], -[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) - -dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed -dnl to access previously installed libraries. The basic assumption is that -dnl a user will want packages to use other packages he previously installed -dnl with the same --prefix option. -dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate -dnl libraries, but is otherwise very convenient. -AC_DEFUN([AC_LIB_PREFIX], -[ - AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_LIB_ARG_WITH([lib-prefix], -[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib - --without-lib-prefix don't search for libraries in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi -]) - if test $use_additional = yes; then - dnl Potentially add $additional_includedir to $CPPFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's already present in $CPPFLAGS, - dnl 3. if it's /usr/local/include and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - for x in $CPPFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $CPPFLAGS. - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" - fi - fi - fi - fi - dnl Potentially add $additional_libdir to $LDFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's already present in $LDFLAGS, - dnl 3. if it's /usr/local/lib and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - for x in $LDFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LDFLAGS. - LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" - fi - fi - fi - fi - fi -]) - -dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, -dnl acl_final_exec_prefix, containing the values to which $prefix and -dnl $exec_prefix will expand at the end of the configure script. -AC_DEFUN([AC_LIB_PREPARE_PREFIX], -[ - dnl Unfortunately, prefix and exec_prefix get only finally determined - dnl at the end of configure. - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' - else - acl_final_exec_prefix="$exec_prefix" - fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" -]) - -dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the -dnl variables prefix and exec_prefix bound to the values they will have -dnl at the end of the configure script. -AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], -[ - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - $1 - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" -]) - -# lib-link.m4 serial 4 (gettext-0.12) -dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Bruno Haible. - -dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and -dnl augments the CPPFLAGS variable. -AC_DEFUN([AC_LIB_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - ac_cv_lib[]Name[]_libs="$LIB[]NAME" - ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" - ac_cv_lib[]Name[]_cppflags="$INC[]NAME" - ]) - LIB[]NAME="$ac_cv_lib[]Name[]_libs" - LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" - INC[]NAME="$ac_cv_lib[]Name[]_cppflags" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the - dnl results of this search when this library appears as a dependency. - HAVE_LIB[]NAME=yes - undefine([Name]) - undefine([NAME]) -]) - -dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) -dnl searches for libname and the libraries corresponding to explicit and -dnl implicit dependencies, together with the specified include files and -dnl the ability to compile and link the specified testcode. If found, it -dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and -dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and -dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs -dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. -AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - - dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME - dnl accordingly. - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - - dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, - dnl because if the user has installed lib[]Name and not disabled its use - dnl via --without-lib[]Name-prefix, he wants to use it. - ac_save_CPPFLAGS="$CPPFLAGS" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - - AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ - ac_save_LIBS="$LIBS" - LIBS="$LIBS $LIB[]NAME" - AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) - LIBS="$ac_save_LIBS" - ]) - if test "$ac_cv_lib[]Name" = yes; then - HAVE_LIB[]NAME=yes - AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) - AC_MSG_CHECKING([how to link with lib[]$1]) - AC_MSG_RESULT([$LIB[]NAME]) - else - HAVE_LIB[]NAME=no - dnl If $LIB[]NAME didn't lead to a usable library, we don't need - dnl $INC[]NAME either. - CPPFLAGS="$ac_save_CPPFLAGS" - LIB[]NAME= - LTLIB[]NAME= - fi - AC_SUBST([HAVE_LIB]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - undefine([Name]) - undefine([NAME]) -]) - -dnl Determine the platform dependent parameters needed to use rpath: -dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, -dnl hardcode_direct, hardcode_minus_L. -AC_DEFUN([AC_LIB_RPATH], -[ - AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS - AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld - AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host - AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir - AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done - ]) - wl="$acl_cv_wl" - libext="$acl_cv_libext" - shlibext="$acl_cv_shlibext" - hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - hardcode_direct="$acl_cv_hardcode_direct" - hardcode_minus_L="$acl_cv_hardcode_minus_L" - dnl Determine whether the user wants rpath handling at all. - AC_ARG_ENABLE(rpath, - [ --disable-rpath do not hardcode runtime library paths], - :, enable_rpath=yes) -]) - -dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. -AC_DEFUN([AC_LIB_LINKFLAGS_BODY], -[ - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_LIB_ARG_WITH([lib$1-prefix], -[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib - --without-lib$1-prefix don't search for lib$1 in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi -]) - dnl Search the library and its dependencies in $additional_libdir and - dnl $LDFLAGS. Using breadth-first-seach. - LIB[]NAME= - LTLIB[]NAME= - INC[]NAME= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='$1 $2' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - dnl See if it was already located by an earlier AC_LIB_LINKFLAGS - dnl or AC_LIB_HAVE_LINKFLAGS call. - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" - else - dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined - dnl that this library doesn't exist. So just drop it. - : - fi - else - dnl Search the library lib$name in $additional_libdir and $LDFLAGS - dnl and the already constructed $LIBNAME/$LTLIBNAME. - found_dir= - found_la= - found_so= - found_a= - if test $use_additional = yes; then - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then - found_dir="$additional_libdir" - found_so="$additional_libdir/lib$name.$shlibext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then - found_dir="$dir" - found_so="$dir/lib$name.$shlibext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - else - if test -f "$dir/lib$name.$libext"; then - found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - dnl Found the library. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - dnl Linking with a shared library. We attempt to hardcode its - dnl directory into the executable's runpath, unless it's the - dnl standard /usr/lib. - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then - dnl No hardcoding is needed. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - dnl The hardcoding into $LIBNAME is system dependent. - if test "$hardcode_direct" = yes; then - dnl Using DIR/libNAME.so during linking hardcodes DIR into the - dnl resulting binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - dnl Rely on "-L$found_dir". - dnl But don't add it if it's already contained in the LDFLAGS - dnl or the already constructed $LIBNAME - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" - fi - if test "$hardcode_minus_L" != no; then - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH - dnl here, because this doesn't fit in flags passed to the - dnl compiler. So give up. No hardcoding. This affects only - dnl very old systems. - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - dnl Linking with a static library. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" - else - dnl We shouldn't come here, but anyway it's good to have a - dnl fallback. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" - fi - fi - dnl Assume the include files are nearby. - additional_includedir= - case "$found_dir" in - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - dnl Potentially add $additional_includedir to $INCNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's /usr/local/include and we are using GCC on Linux, - dnl 3. if it's already present in $CPPFLAGS or the already - dnl constructed $INCNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INC[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $INCNAME. - INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - dnl Look for dependencies. - if test -n "$found_la"; then - dnl Read the .la file. It defines the variables - dnl dlname, library_names, old_library, dependency_libs, current, - dnl age, revision, installed, dlopen, dlpreopen, libdir. - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - dnl We use only dependency_libs. - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's /usr/local/lib and we are using GCC on Linux, - dnl 3. if it's already present in $LDFLAGS or the already - dnl constructed $LIBNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LIBNAME. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LTLIBNAME. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - dnl Handle this in the next round. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - dnl Handle this in the next round. Throw away the .la's - dnl directory; it is already contained in a preceding -L - dnl option. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - dnl Most likely an immediate library name. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" - ;; - esac - done - fi - else - dnl Didn't find the library; assume it is in the system directories - dnl known to the linker and runtime loader. (All the system - dnl directories known to the linker should also be known to the - dnl runtime loader, otherwise the system is severely misconfigured.) - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$hardcode_libdir_separator"; then - dnl Weird platform: only the last -rpath option counts, the user must - dnl pass all path elements in one option. We can arrange that for a - dnl single library, but not when more than one $LIBNAMEs are used. - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" - done - dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - else - dnl The -rpath options are cumulative. - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - dnl When using libtool, the option that works for both libraries and - dnl executables is -R. The -R options are cumulative. - for found_dir in $ltrpathdirs; do - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" - done - fi -]) - -dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, -dnl unless already present in VAR. -dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes -dnl contains two or three consecutive elements that belong together. -AC_DEFUN([AC_LIB_APPENDTOVAR], -[ - for element in [$2]; do - haveit= - for x in $[$1]; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - [$1]="${[$1]}${[$1]:+ }$element" - fi - done -]) - -# lib-ld.m4 serial 2 (gettext-0.12) -dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. - -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. -AC_DEFUN([AC_LIB_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then - acl_cv_prog_gnu_ld=yes -else - acl_cv_prog_gnu_ld=no -fi]) -with_gnu_ld=$acl_cv_prog_gnu_ld -]) - -dnl From libtool-1.4. Sets the variable LD. -AC_DEFUN([AC_LIB_PROG_LD], -[AC_ARG_WITH(gnu-ld, -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(acl_cv_path_LD, -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$acl_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_LIB_PROG_LD_GNU -]) - # serial 1 @@ -1063,7 +255,7 @@ # program @code{ansi2knr}, which comes with Ghostscript. # @end defmac -AC_DEFUN(AM_PROG_CC_STDC, +AC_DEFUN([AM_PROG_CC_STDC], [AC_REQUIRE([AC_PROG_CC]) AC_BEFORE([$0], [AC_C_INLINE]) AC_BEFORE([$0], [AC_C_CONST]) Index: ircd-ircdev/config.h.in diff -u ircd-ircdev/config.h.in:1.4 ircd-ircdev/config.h.in:1.5 --- ircd-ircdev/config.h.in:1.4 Sun Feb 22 08:16:22 2004 +++ ircd-ircdev/config.h.in Wed Nov 24 08:11:30 2004 @@ -1,6 +1,6 @@ /* config.h.in. Generated from configure.in by autoheader. */ /* - * IRC-Dev IRCD - An advanced and innovative IRC Daemon, config.h + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, acconfig.h * * Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> * Copyright (C) 2000 Kevin L. Mitchell <kl...@mi...> @@ -19,12 +19,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: config.h.in,v 1.4 2004/02/22 16:16:22 zolty Exp $ + * $Id: config.h.in,v 1.5 2004/11/24 16:11:30 zolty Exp $ * */ #ifndef INCLUDED_config_h #define INCLUDED_config_h + /* Define if you have the setrlimit function */ #undef HAVE_SETRLIMIT @@ -86,6 +87,9 @@ #undef MAXCONNECTIONS +/* Define if you have (reliable) BSD signals. */ +#undef BSD_RELIABLE_SIGNALS + /* Configuration file name */ #undef CPATH @@ -98,9 +102,15 @@ /* Path to data directory */ #undef DPATH +/* Define to implement epoll system calls */ +#undef EPOLL_NEED_BODY + /* Force inlining for a few critical functions */ #undef FORCEINLINE +/* Define to 1 if you have the <crypt.h> header file. */ +#undef HAVE_CRYPT_H + /* Define to 1 if you have the `getrusage' function. */ #undef HAVE_GETRUSAGE @@ -153,6 +163,12 @@ /* Define to 1 if you have the <sys/event.h> header file. */ #undef HAVE_SYS_EVENT_H +/* Define to 1 if you have the <sys/param.h> header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#undef HAVE_SYS_SOCKET_H + /* Define to 1 if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H @@ -168,12 +184,30 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H +/* Define if we have va_copy */ +#undef HAVE_VA_COPY + +/* Define if we have __va_copy */ +#undef HAVE___VA_COPY + +/* Enable IPv6 support */ +#undef IPV6 + /* Path to debugging log file */ #undef LPATH /* Maximum number of network connections */ #undef MAXCONNECTIONS +/* Define if you have BSD non-blocking sockets. */ +#undef NBLOCK_BSD + +/* Define if you have POSIX non-blocking sockets. */ +#undef NBLOCK_POSIX + +/* Define if you have SysV non-blocking sockets. */ +#undef NBLOCK_SYSV + /* Disable assertions */ #undef NDEBUG @@ -192,12 +226,21 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION +/* Define if you have POSIX signals. */ +#undef POSIX_SIGNALS + /* The size of a `int', as computed by sizeof. */ #undef SIZEOF_INT +/* The size of a `int64_t', as computed by sizeof. */ +#undef SIZEOF_INT64_T + /* The size of a `long', as computed by sizeof. */ #undef SIZEOF_LONG +/* The size of a `long long', as computed by sizeof. */ +#undef SIZEOF_LONG_LONG + /* The size of a `short', as computed by sizeof. */ #undef SIZEOF_SHORT @@ -210,6 +253,9 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Define if you have (unreliable) SysV signals. */ +#undef SYSV_UNRELIABLE_SIGNALS + /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ #undef TIME_WITH_SYS_TIME @@ -245,15 +291,24 @@ /* Define to `long' if <sys/types.h> does not define. */ #undef int32_t +/* Define to `long long' if <sys/types.h> does not define. */ +#undef int64_t + /* Define to `unsigned' if <sys/types.h> does not define. */ #undef size_t +/* Define to `unsigned int' if <sys/types.h> does not define. */ +#undef socklen_t + +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef uid_t + /* Define to `unsigned short' if <sys/types.h> does not define. */ -#undef u_int16_t +#undef uint16_t /* Define to `unsigned long' if <sys/types.h> does not define. */ -#undef u_int32_t +#undef uint32_t -/* Define to `int' if <sys/types.h> doesn't define. */ -#undef uid_t +/* Define to `unsigned long long' if <sys/types.h> does not define. */ +#undef uint64_t #endif /* INCLUDED_config_h */ Index: ircd-ircdev/configure diff -u ircd-ircdev/configure:1.8 ircd-ircdev/configure:1.9 --- ircd-ircdev/configure:1.8 Fri May 21 08:39:33 2004 +++ ircd-ircdev/configure Wed Nov 24 08:11:30 2004 @@ -310,7 +310,7 @@ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AWK SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S LEX LEXLIB LEX_OUTPUT_ROOT YACC RMPROG SHPROG OSDEP_C ENGINE_C RES_C ADNS_SUBDIR INSTALL_RULE SYMLINK IRCDMODE IRCDOWN IRCDGRP DPATH LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AWK SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S RMPROG SHPROG LEX LEXLIB LEX_OUTPUT_ROOT YACC ENGINE_C INSTALL_RULE SYMLINK IRCDMODE IRCDOWN IRCDGRP DPATH LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -861,6 +861,8 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-leak-detect Turn on the leak detector(requires patched boehm) + --without-ipv6 disable IPv6 support (default is autodetect) --with-symlink=name Name to give the symlink; if name is "no," no symlink will be created. --with-mode=mode Permissions (in octal) to give the binary @@ -3750,7 +3752,11 @@ -for ac_header in poll.h sys/devpoll.h sys/event.h sys/epoll.h inttypes.h + + + + +for ac_header in crypt.h poll.h inttypes.h stdint.h sys/devpoll.h sys/epoll.h sys/event.h sys/param.h sys/socket.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -5979,10 +5985,9 @@ _ACEOF -if test "$ac_cv_sizeof_int" = 2 ; then - echo "$as_me:$LINENO: checking for int16_t" >&5 -echo $ECHO_N "checking for int16_t... $ECHO_C" >&6 -if test "${ac_cv_type_int16_t+set}" = set; then +echo "$as_me:$LINENO: checking for int64_t" >&5 +echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5995,9 +6000,9 @@ int main () { -if ((int16_t *) 0) +if ((int64_t *) 0) return 0; -if (sizeof (int16_t)) +if (sizeof (int64_t)) return 0; ; return 0; @@ -6024,33 +6029,31 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_int16_t=yes + ac_cv_type_int64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int16_t=no +ac_cv_type_int64_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_int16_t" >&5 -echo "${ECHO_T}$ac_cv_type_int16_t" >&6 -if test $ac_cv_type_int16_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define int16_t int -_ACEOF - -fi +echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_int64_t" >&6 - echo "$as_me:$LINENO: checking for u_int16_t" >&5 -echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int16_t+set}" = set; then +echo "$as_me:$LINENO: checking size of int64_t" >&5 +echo $ECHO_N "checking size of int64_t... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test "$ac_cv_type_int64_t" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6060,10 +6063,9 @@ int main () { -if ((u_int16_t *) 0) - return 0; -if (sizeof (u_int16_t)) - return 0; +static int test_array [1 - 2 * !(((long) (sizeof (int64_t))) >= 0)]; +test_array [0] = 0 + ; return 0; } @@ -6089,34 +6091,9 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_u_int16_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_u_int16_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 -if test $ac_cv_type_u_int16_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define u_int16_t unsigned int -_ACEOF - -fi - -elif test "$ac_cv_sizeof_short" = 2 ; then - echo "$as_me:$LINENO: checking for int16_t" >&5 -echo $ECHO_N "checking for int16_t... $ECHO_C" >&6 -if test "${ac_cv_type_int16_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6126,10 +6103,9 @@ int main () { -if ((int16_t *) 0) - return 0; -if (sizeof (int16_t)) - return 0; +static int test_array [1 - 2 * !(((long) (sizeof (int64_t))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } @@ -6155,33 +6131,25 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_int16_t=yes + ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int16_t=no +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_int16_t" >&5 -echo "${ECHO_T}$ac_cv_type_int16_t" >&6 -if test $ac_cv_type_int16_t = yes; then - : + done else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -cat >>confdefs.h <<_ACEOF -#define int16_t short -_ACEOF - -fi - - echo "$as_me:$LINENO: checking for u_int16_t" >&5 -echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int16_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6191,10 +6159,9 @@ int main () { -if ((u_int16_t *) 0) - return 0; -if (sizeof (u_int16_t)) - return 0; +static int test_array [1 - 2 * !(((long) (sizeof (int64_t))) < 0)]; +test_array [0] = 0 + ; return 0; } @@ -6220,39 +6187,9 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_u_int16_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_u_int16_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 -if test $ac_cv_type_u_int16_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define u_int16_t unsigned short -_ACEOF - -fi - -else - { { echo "$as_me:$LINENO: error: Cannot find a type with size of 16 bits" >&5 -echo "$as_me: error: Cannot find a type with size of 16 bits" >&2;} - { (exit 1); exit 1; }; } -fi -if test "$ac_cv_sizeof_int" = 4 ; then - echo "$as_me:$LINENO: checking for int32_t" >&5 -echo $ECHO_N "checking for int32_t... $ECHO_C" >&6 -if test "${ac_cv_type_int32_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6262,10 +6199,9 @@ int main () { -if ((int32_t *) 0) - return 0; -if (sizeof (int32_t)) - return 0; +static int test_array [1 - 2 * !(((long) (sizeof (int64_t))) >= $ac_mid)]; +test_array [0] = 0 + ; return 0; } @@ -6291,32 +6227,32 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_int32_t=yes + ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int32_t=no +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5 -echo "${ECHO_T}$ac_cv_type_int32_t" >&6 -if test $ac_cv_type_int32_t = yes; then - : + done else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -cat >>confdefs.h <<_ACEOF -#define int32_t int -_ACEOF - +ac_lo= ac_hi= fi - - echo "$as_me:$LINENO: checking for u_int32_t" >&5 -echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 -if test "${ac_cv_type_u_int32_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6327,10 +6263,9 @@ int main () { -if ((u_int32_t *) 0) - return 0; -if (sizeof (u_int32_t)) - return 0; +static int test_array [1 - 2 * !(((long) (sizeof (int64_t))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } @@ -6356,32 +6291,28 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_u_int32_t=yes + ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_u_int32_t=no +ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 -if test $ac_cv_type_u_int32_t = yes; then - : +done +case $ac_lo in +?*) ac_cv_sizeof_int64_t=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int64_t), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int64_t), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac else - -cat >>confdefs.h <<_ACEOF -#define u_int32_t unsigned int -_ACEOF - -fi - -elif test "$ac_cv_sizeof_short" = 4 ; then - echo "$as_me:$LINENO: checking for int32_t" >&5 -echo $ECHO_N "checking for int32_t... $ECHO_C" >&6 -if test "${ac_cv_type_int32_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6390,62 +6321,79 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +long longval () { return (long) (sizeof (int64_t)); } +unsigned long ulongval () { return (long) (sizeof (int64_t)); } +#include <stdio.h> +#include <stdlib.h> int main () { -if ((int32_t *) 0) - return 0; -if (sizeof (int32_t)) - return 0; + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (int64_t))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (int64_t)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (int64_t)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\""... [truncated message content] |
From: Toni G. <zo...@us...> - 2004-11-24 16:10:42
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-11-24 16:10:11 UTC Added files: include/ircd_md5.h Log message: Author: zoltan <zo...@ir...> Log message: 2004-11-24 Toni García <zo...@ir...> 1.0.alpha13 * Comentarios para Doxygen * Excepciones de Silences * Soporte total de IPv6 * Sincronizacion Undernet ---------------------- diff included ---------------------- Index: ircd-ircdev/include/ircd_md5.h diff -u /dev/null ircd-ircdev/include/ircd_md5.h:1.1 --- /dev/null Wed Nov 24 08:10:28 2004 +++ ircd-ircdev/include/ircd_md5.h Wed Nov 24 08:10:01 2004 @@ -0,0 +1,62 @@ +/* + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, include/ircd_md5.h + * + * Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 2002 hikari + * + * 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 + * + */ +/* + * This code implements the MD5 message-digest algorithm. + * The algorithm is due to Ron Rivest. This code was + * written by Colin Plumb in 1993, no copyright is claimed. + * This code is in the public domain; do with it what you wish. + * + * Equivalent code is available from RSA Data Security, Inc. + * This code has been tested against that, and is equivalent, + * except that you don't need to include two pages of legalese + * with every copy. + * + * ircuified 2002 by hikari + */ +/** @file + * @brief MD5 implementation for ircu. + * @version $Id: ircd_md5.h,v 1.1 2004/11/24 16:10:01 zolty Exp $ + */ +#ifndef ircd_md5_h +#define ircd_md5_h + +/** Typedef for an unsigned 32-bit integer. */ +typedef unsigned int uint32; + +/** MD5 context structure. */ +struct MD5Context { + uint32 buf[4]; /**< Current digest state/value. */ + uint32 bits[2]; /**< Number of bits hashed so far. */ + unsigned char in[64]; /**< Residual input buffer. */ +}; + +void MD5Init(struct MD5Context *); +void MD5Update(struct MD5Context *, unsigned const char *, unsigned); +void MD5Final(unsigned char digest[16], struct MD5Context *); +void MD5Transform(uint32 buf[4], uint32 const in[16]); + +char *crypt_md5(const char *pw, const char *salt); + +/** Helper typedef for the MD5 context structure. */ +typedef struct MD5Context MD5_CTX; + +#endif /* ircd_md5_h */ ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2004-11-24 16:07:04
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-11-24 16:06:26 UTC Modified files: ircd/IPcheck.c ircd/Makefile.in ircd/channel.c ircd/class.c ircd/client.c ircd/crule.c ircd/dbuf.c ircd/destruct_event.c ircd/engine_devpoll.c ircd/engine_epoll.c ircd/engine_kqueue.c ircd/engine_poll.c ircd/engine_select.c ircd/fileio.c ircd/gline.c ircd/hash.c ircd/ircd.c ircd/ircd_lexer.l ircd/ircd_parser.y ircd/jupe.c ircd/list.c ircd/listener.c ircd/match.c ircd/motd.c ircd/msgq.c ircd/numnicks.c ircd/opercmds.c ircd/os_generic.c ircd/packet.c ircd/parse.c ircd/querycmds.c ircd/random.c ircd/send.c ircd/table_gen.c ircd/uping.c ircd/userload.c ircd/version.c.SH ircd/whocmds.c ircd/whowas.c Added files: ircd/memdebug.c ircd/umkpasswd.c Removed files: ircd/chkconf.c ircd/fda.c ircd/fda_t.c ircd/iauth.c ircd/ircd_xopen.c ircd/os_bsd.c ircd/os_linux.c ircd/os_openbsd.c ircd/os_solaris.c ircd/res_adns.c ircd/res_libresolv.c ircd/support.c Log message: Author: zoltan <zo...@ir...> Log message: 2004-11-24 Toni García <zo...@ir...> 1.0.alpha13 * Comentarios para Doxygen * Excepciones de Silences * Soporte total de IPv6 * Sincronizacion Undernet ---------------------- diff included ---------------------- Index: ircd-ircdev/ircd/IPcheck.c diff -u ircd-ircdev/ircd/IPcheck.c:1.4 ircd-ircdev/ircd/IPcheck.c:1.5 --- ircd-ircdev/ircd/IPcheck.c:1.4 Fri May 21 08:39:34 2004 +++ ircd-ircdev/ircd/IPcheck.c Wed Nov 24 08:06:14 2004 @@ -18,14 +18,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: IPcheck.c,v 1.4 2004/05/21 15:39:34 zolty Exp $ - * + */ +/** @file + * @brief Code to count users connected from particular IP addresses. + * @version $Id: IPcheck.c,v 1.5 2004/11/24 16:06:14 zolty Exp $ */ #include "config.h" #include "IPcheck.h" #include "client.h" #include "ircd.h" +#include "match.h" #include "msg.h" #include "numnicks.h" /* NumNick, NumServ (GODMODE) */ #include "ircd_alloc.h" @@ -38,67 +41,97 @@ #include <assert.h> #include <string.h> +/** Stores free target information for a particular user. */ struct IPTargetEntry { - int count; - unsigned char targets[MAXTARGETS]; + int count; /**< Number of free targets targets. */ + unsigned char targets[MAXTARGETS]; /**< Array of recent targets. */ }; +/** Stores recent information about a particular IP address. */ struct IPRegistryEntry { - struct IPRegistryEntry* next; - struct IPTargetEntry* target; - unsigned int addr; - int last_connect; - unsigned short connected; - unsigned char attempts; + struct IPRegistryEntry* next; /**< Next entry in the hash chain. */ + struct IPTargetEntry* target; /**< Recent targets, if any. */ + struct irc_in_addr addr; /**< IP address for this user. */ + int last_connect; /**< Last connection attempt timestamp. */ + unsigned short connected; /**< Number of currently connected clients. */ + unsigned char attempts; /**< Number of recent connection attempts. */ }; -/* - * Hash table for IPv4 address registry - * - * Hash table size must be a power of 2 - * Use 64K hash table to conserve memory - */ +/** Size of hash table (must be a power of two). */ #define IP_REGISTRY_TABLE_SIZE 0x10000 -#define MASK_16 0xffff - -#define NOW ((unsigned short)(CurrentTime & MASK_16)) +/** Report current time for tracking in IPRegistryEntry::last_connect. */ +#define NOW ((unsigned short)(CurrentTime & 0xffff)) +/** Time from \a x until now, in seconds. */ #define CONNECTED_SINCE(x) (NOW - (x)) +/** Macro for easy access to configured IPcheck clone limit. */ #define IPCHECK_CLONE_LIMIT feature_int(FEAT_IPCHECK_CLONE_LIMIT) +/** Macro for easy access to configured IPcheck clone period. */ #define IPCHECK_CLONE_PERIOD feature_int(FEAT_IPCHECK_CLONE_PERIOD) +/** Macro for easy access to configured IPcheck clone delay. */ #define IPCHECK_CLONE_DELAY feature_int(FEAT_IPCHECK_CLONE_DELAY) - +/** Hash table for storing IPRegistryEntry entries. */ static struct IPRegistryEntry* hashTable[IP_REGISTRY_TABLE_SIZE]; -static struct IPRegistryEntry* freeList = 0; - +/** List of allocated but unused IPRegistryEntry structs. */ +static struct IPRegistryEntry* freeList; +/** Periodic timer to look for too-old registry entries. */ static struct Timer expireTimer; -static unsigned int ip_registry_hash(unsigned int ip) -{ - return ((ip >> 16) ^ ip) & (IP_REGISTRY_TABLE_SIZE - 1); -} - -static struct IPRegistryEntry* ip_registry_find(unsigned int ip) +/** Calculate hash value for an IP address. + * If this looks like an IPv6 address, only consider the first 64 bits + * of the address. Otherwise, only consider the final 32 bits. + * @param[in] ip Address to hash. + * @return Hash value for address. + */ +static unsigned int ip_registry_hash(const struct irc_in_addr *ip) +{ + unsigned int res; + + if (ip->in6_16[0] || ip->in6_16[1] || ip->in6_16[2] || ip->in6_16[3] || ip->in6_16[4]) { + /* Only use the first 64 bits of address, since the last 64 bits + * tend to be under user control. */ + res = ip->in6_16[0] ^ ip->in6_16[1] ^ ip->in6_16[2] ^ ip->in6_16[3]; + } else { + /* Looks like an IPv4 address. */ + res = ip->in6_16[6] ^ ip->in6_16[7]; + } + return res & (IP_REGISTRY_TABLE_SIZE - 1); +} + +/** Find an IP registry entry if one exists for the IP address. + * If \a ip looks like an IPv6 address, only consider the first 64 bits + * of the address. Otherwise, only consider the final 32 bits. + * @param[in] ip IP address to search for. + * @return Matching registry entry, or NULL if none exists. + */ +static struct IPRegistryEntry* ip_registry_find(const struct irc_in_addr *ip) { struct IPRegistryEntry* entry = hashTable[ip_registry_hash(ip)]; for ( ; entry; entry = entry->next) { - if (entry->addr == ip) + int bits = (ip->in6_16[0] || ip->in6_16[1] || ip->in6_16[2] || ip->in6_16[3] || ip->in6_16[4]) ? 64 : 128; + if (ipmask_check(ip, &entry->addr, bits)) break; } return entry; } +/** Add an IP registry entry to the hash table. + * @param[in] entry Registry entry to add. + */ static void ip_registry_add(struct IPRegistryEntry* entry) { - unsigned int bucket = ip_registry_hash(entry->addr); + unsigned int bucket = ip_registry_hash(&entry->addr); entry->next = hashTable[bucket]; hashTable[bucket] = entry; } - + +/** Remove an IP registry entry from the hash table. + * @param[in] entry Registry entry to add. + */ static void ip_registry_remove(struct IPRegistryEntry* entry) { - unsigned int bucket = ip_registry_hash(entry->addr); + unsigned int bucket = ip_registry_hash(&entry->addr); if (hashTable[bucket] == entry) hashTable[bucket] = entry->next; else { @@ -111,7 +144,11 @@ } } } - + +/** Allocate a new IP registry entry. + * For members that have a sensible default value, that is used. + * @return Newly allocated registry entry. + */ static struct IPRegistryEntry* ip_registry_new_entry() { struct IPRegistryEntry* entry = freeList; @@ -128,6 +165,10 @@ return entry; } +/** Deallocate memory for \a entry. + * The entry itself is prepended to #freeList. + * @param[in] entry IP registry entry to release. + */ static void ip_registry_delete_entry(struct IPRegistryEntry* entry) { if (entry->target) @@ -136,6 +177,9 @@ freeList = entry; } +/** Update free target count for \a entry. + * @param[in,out] entry IP registry entry to update. + */ static unsigned int ip_registry_update_free_targets(struct IPRegistryEntry* entry) { unsigned int free_targets = STARTTARGETS; @@ -149,6 +193,11 @@ return free_targets; } +/** Check whether all or part of \a entry needs to be expired. + * If the entry is at least 600 seconds stale, free the entire thing. + * If it is at least 120 seconds stale, expire its free targets list. + * @param[in] entry Registry entry to check for expiration. + */ static void ip_registry_expire_entry(struct IPRegistryEntry* entry) { /* @@ -171,7 +220,9 @@ } } -/* Callback to run an expiry of the IPcheck registry */ +/** Periodic timer callback to check for expired registry entries. + * @param[in] ev Timer event (ignored). + */ static void ip_registry_expire(struct Event* ev) { int i; @@ -190,50 +241,28 @@ } } -/* - * IPcheck_init() - * - * Initializes the registry timer - */ +/** Initialize the IPcheck subsystem. */ void IPcheck_init(void) { timer_add(timer_init(&expireTimer), ip_registry_expire, 0, TT_PERIODIC, 60); } -/* - * IPcheck_local_connect - * - * Event: - * A new connection was accept()-ed with IP number `cptr->ip.s_addr'. - * - * Action: - * Update the IPcheck registry. - * Return: - * 1 : You're allowed to connect. - * 0 : You're not allowed to connect. - * - * Throttling: - * - * A connection should be rejected when a connection from the same IP number was - * received IPCHECK_CLONE_LIMIT times before this connect attempt, with - * reconnect intervals of IPCHECK_CLONE_PERIOD seconds or less. - * - * Free target inheritance: - * - * When the client is accepted, then the number of Free Targets - * of the cptr is set to the value stored in the found IPregistry - * structure, or left at STARTTARGETS. This can be done by changing - * cptr->nexttarget to be `now - (TARGET_DELAY * (FREE_TARGETS - 1))', - * where FREE_TARGETS may range from 0 till STARTTARGETS. +/** Check whether a new connection from a local client should be allowed. + * A connection is rejected if someone from the "same" address (see + * ip_registry_find()) connects IPCHECK_CLONE_LIMIT times, each time + * separated by no more than IPCHECK_CLONE_PERIOD seconds. + * @param[in] addr Address of client. + * @param[out] next_target_out Receives time to grant another free target. + * @return Non-zero if the connection is permitted, zero if denied. */ -int ip_registry_check_local(unsigned int addr, time_t* next_target_out) +int ip_registry_check_local(const struct irc_in_addr *addr, time_t* next_target_out) { struct IPRegistryEntry* entry = ip_registry_find(addr); unsigned int free_targets = STARTTARGETS; - + if (0 == entry) { entry = ip_registry_new_entry(); - entry->addr = addr; /* The IP number of registry entry */ + memcpy(&entry->addr, addr, sizeof(entry->addr)); ip_registry_add(entry); return 1; } @@ -276,20 +305,17 @@ return 1; } -/* - * IPcheck_remote_connect - * - * Event: - * A remote client connected to Undernet, with IP number `cptr->ip.s_addr' - * and hostname `hostname'. - * - * Action: - * Update the IPcheck registry. - * Return 0 on failure, 1 on success. +/** Check whether a connection from a remote client should be allowed. + * This is much more relaxed than ip_registry_check_local(): The only + * cause for rejection is when the IPRegistryEntry::connected counter + * would overflow. + * @param[in] cptr Client that has connected. + * @param[in] is_burst Non-zero if client was introduced during a burst. + * @return Non-zero if the client should be accepted, zero if they must be killed. */ int ip_registry_check_remote(struct Client* cptr, int is_burst) { - struct IPRegistryEntry* entry = ip_registry_find((cli_ip(cptr)).s_addr); + struct IPRegistryEntry* entry = ip_registry_find(&cli_ip(cptr)); /* * Mark that we did add/update an IPregistry entry @@ -297,7 +323,7 @@ SetIPChecked(cptr); if (0 == entry) { entry = ip_registry_new_entry(); - entry->addr = (cli_ip(cptr)).s_addr; + memcpy(&entry->addr, &cli_ip(cptr), sizeof(entry->addr)); if (is_burst) entry->attempts = 0; ip_registry_add(entry); @@ -325,40 +351,32 @@ return 1; } -/* - * IPcheck_connect_fail - * - * Event: - * This local client failed to connect due to legal reasons. - * - * Action: - * Neutralize the effect of calling IPcheck_local_connect, in such - * a way that the client won't be penalized when trying to reconnect - * again. +/** Handle a client being rejected during connection through no fault + * of their own. This "undoes" the effect of ip_registry_check_local() + * so the client's address is not penalized for the failure. + * @param[in] addr Address of rejected client. */ -void ip_registry_connect_fail(unsigned int addr) +void ip_registry_connect_fail(const struct irc_in_addr *addr) { struct IPRegistryEntry* entry = ip_registry_find(addr); - if (entry) + if (entry) { if (0 == --entry->attempts) - ++entry->attempts; /* check for overflow */ + ++entry->attempts; } } -/* - * IPcheck_connect_succeeded - * - * Event: - * A client succeeded to finish the registration. - * - * Finish IPcheck registration of a successfully, locally connected client. +/** Handle a client that has successfully connected. + * This copies free target information to \a cptr from his address's + * registry entry and sends him a NOTICE describing the parameters for + * the entry. + * @param[in,out] cptr Client that has successfully connected. */ void ip_registry_connect_succeeded(struct Client *cptr) { const char* tr = ""; unsigned int free_targets = STARTTARGETS; - struct IPRegistryEntry* entry = ip_registry_find((cli_ip(cptr)).s_addr); + struct IPRegistryEntry* entry = ip_registry_find(&cli_ip(cptr)); if (!entry) { Debug((DEBUG_ERROR, "Missing registry entry for: %s", cli_sock_ip(cptr))); @@ -374,20 +392,14 @@ free_targets, STARTTARGETS, tr); } -/* - * IPcheck_disconnect - * - * Event: - * A local client disconnected or a remote client left Undernet. - * - * Action: - * Update the IPcheck registry. - * Remove all expired IPregistry structures from the hash bucket - * that belongs to this clients IP number. +/** Handle a client that decided to disconnect (or was killed after + * completing his connection). This updates the free target + * information for his IP registry entry. + * @param[in] cptr Client that has exited. */ void ip_registry_disconnect(struct Client *cptr) { - struct IPRegistryEntry* entry = ip_registry_find((cli_ip(cptr)).s_addr); + struct IPRegistryEntry* entry = ip_registry_find(&cli_ip(cptr)); if (0 == entry) { /* * trying to find an entry for a server causes this to happen, @@ -458,59 +470,31 @@ } } -/* - * IPcheck_nr - * - * Returns number of clients with the same IP number +/** Find number of clients from a particular IP address. + * @param[in] addr Address to look up. + * @return Number of clients known to be connected from that address. */ -int ip_registry_count(unsigned int addr) +int ip_registry_count(const struct irc_in_addr *addr) { struct IPRegistryEntry* entry = ip_registry_find(addr); return (entry) ? entry->connected : 0; } -/* - * IPcheck_local_connect - * - * Event: - * A new connection was accept()-ed with IP number `cptr->ip.s_addr'. - * - * Action: - * Update the IPcheck registry. - * Return: - * 1 : You're allowed to connect. - * 0 : You're not allowed to connect. - * - * Throttling: - * - * A connection should be rejected when a connection from the same IP number was - * received IPCHECK_CLONE_LIMIT times before this connect attempt, with - * reconnect intervals of IPCHECK_CLONE_PERIOD seconds or less. - * - * Free target inheritance: - * - * When the client is accepted, then the number of Free Targets - * of the cptr is set to the value stored in the found IPregistry - * structure, or left at STARTTARGETS. This can be done by changing - * cptr->nexttarget to be `now - (TARGET_DELAY * (FREE_TARGETS - 1))', - * where FREE_TARGETS may range from 0 till STARTTARGETS. +/** Check whether a client is allowed to connect locally. + * @param[in] a Address of client. + * @param[out] next_target_out Receives time to grant another free target. + * @return Non-zero if the connection is permitted, zero if denied. */ -int IPcheck_local_connect(struct in_addr a, time_t* next_target_out) +int IPcheck_local_connect(const struct irc_in_addr *a, time_t* next_target_out) { assert(0 != next_target_out); - return ip_registry_check_local(a.s_addr, next_target_out); + return ip_registry_check_local(a, next_target_out); } -/* - * IPcheck_remote_connect - * - * Event: - * A remote client connected to Undernet, with IP number `cptr->ip.s_addr' - * and hostname `hostname'. - * - * Action: - * Update the IPcheck registry. - * Return 0 on failure, 1 on success. +/** Check whether a client is allowed to connect remotely. + * @param[in] cptr Client that has connected. + * @param[in] is_burst Non-zero if client was introduced during a burst. + * @return Non-zero if the client should be accepted, zero if they must be killed. */ int IPcheck_remote_connect(struct Client *cptr, int is_burst) { @@ -518,29 +502,21 @@ return ip_registry_check_remote(cptr, is_burst); } -/* - * IPcheck_connect_fail - * - * Event: - * This local client failed to connect due to legal reasons. - * - * Action: - * Neutralize the effect of calling IPcheck_local_connect, in such - * a way that the client won't be penalized when trying to reconnect - * again. - */ -void IPcheck_connect_fail(struct in_addr a) -{ - ip_registry_connect_fail(a.s_addr); -} - -/* - * IPcheck_connect_succeeded - * - * Event: - * A client succeeded to finish the registration. - * - * Finish IPcheck registration of a successfully, locally connected client. +/** Handle a client being rejected during connection through no fault + * of their own. This "undoes" the effect of ip_registry_check_local() + * so the client's address is not penalized for the failure. + * @param[in] a Address of rejected client. + */ +void IPcheck_connect_fail(const struct irc_in_addr *a) +{ + ip_registry_connect_fail(a); +} + +/** Handle a client that has successfully connected. + * This copies free target information to \a cptr from his address's + * registry entry and sends him a NOTICE describing the parameters for + * the entry. + * @param[in,out] cptr Client that has successfully connected. */ void IPcheck_connect_succeeded(struct Client *cptr) { @@ -548,16 +524,10 @@ ip_registry_connect_succeeded(cptr); } -/* - * IPcheck_disconnect - * - * Event: - * A local client disconnected or a remote client left Undernet. - * - * Action: - * Update the IPcheck registry. - * Remove all expired IPregistry structures from the hash bucket - * that belongs to this clients IP number. +/** Handle a client that decided to disconnect (or was killed after + * completing his connection). This updates the free target + * information for his IP registry entry. + * @param[in] cptr Client that has exited. */ void IPcheck_disconnect(struct Client *cptr) { @@ -565,13 +535,12 @@ ip_registry_disconnect(cptr); } -/* - * IPcheck_nr - * - * Returns number of clients with the same IP number +/** Find number of clones of a client. + * @param[in] cptr Client whose address to look up. + * @return Number of clients known to be connected from that address. */ unsigned short IPcheck_nr(struct Client *cptr) { assert(0 != cptr); - return ip_registry_count(cli_ip(cptr).s_addr); + return ip_registry_count(&cli_ip(cptr)); } Index: ircd-ircdev/ircd/Makefile.in diff -u ircd-ircdev/ircd/Makefile.in:1.12 ircd-ircdev/ircd/Makefile.in:1.13 --- ircd-ircdev/ircd/Makefile.in:1.12 Wed Nov 17 03:45:49 2004 +++ ircd-ircdev/ircd/Makefile.in Wed Nov 24 08:06:14 2004 @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA -# $Id: Makefile.in,v 1.12 2004/11/17 11:45:49 zolty Exp $ +# $Id: Makefile.in,v 1.13 2004/11/24 16:06:14 zolty Exp $ #### Start of system configuration section. #### @@ -35,8 +35,6 @@ RM = @RMPROG@ AWK = @AWK@ LN_S = @LN_S@ -LEX = @LEX@ -YACC = @YACC@ MV = mv CHMOD = chmod CHOWN = chown @@ -44,9 +42,9 @@ MKDIR = mkdir TOUCH = touch GREP = grep -OSDEP_C = @OSDEP_C@ +LEX = @LEX@ +YACC = @YACC@ ENGINE_C = @ENGINE_C@ -RES_C = @RES_C@ @SET_MAKE@ BINDIR = @bindir@ @@ -62,7 +60,6 @@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = -I. -I.. -I${top_srcdir}/include @CPPFLAGS@ -#CPPFLAGS = -I. -I.. -I${top_srcdir}/include -I${top_srcdir}/libs/adns/src @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ @@ -70,13 +67,6 @@ PURIFY = RINGLOG_O = -OSDEP_SRC = \ - os_bsd.c \ - os_linux.c \ - os_openbsd.c \ - os_generic.c \ - os_solaris.c - ENGINE_SRC = \ engine_devpoll.c \ engine_epoll.c \ @@ -84,9 +74,16 @@ engine_kqueue.c \ engine_select.c -RES_SRC = \ - res_adns.c \ - res_libresolv.c +CRYPTO_SRC = \ + ircd_md5.c \ + ircd_crypt_plain.c \ + ircd_crypt_smd5.c \ + ircd_crypt_native.c + +UMKPASSWD_SRC = ${CRYPTO_SRC} \ + ircd_alloc.c \ + ircd_string.c \ + umkpasswd.c IRCD_SRC = \ IPcheck.c \ @@ -97,22 +94,24 @@ dbuf.c \ ddb.c \ destruct_event.c \ - fda.c \ fileio.c \ gline.c \ hash.c \ ircd.c \ ircd_alloc.c \ + ircd_auth.c \ + ircd_crypt.c \ ircd_events.c \ ircd_features.c \ ircd_log.c \ ircd_relay.c \ ircd_reply.c \ + ircd_res.c \ + ircd_reslib.c \ ircd_signal.c \ ircd_snprintf.c \ ircd_string.c \ ircd_tea.c \ - ircd_xopen.c \ jupe.c \ lex.yy.c \ list.c \ @@ -194,10 +193,12 @@ m_whois.c \ m_whowas.c \ match.c \ + memdebug.c \ motd.c \ msgq.c \ numnicks.c \ opercmds.c \ + os_generic.c \ packet.c \ parse.c \ querycmds.c \ @@ -213,7 +214,6 @@ s_stats.c \ s_user.c \ send.c \ - support.c \ uping.c \ userload.c \ watch.c \ @@ -221,13 +221,13 @@ whowas.c \ y.tab.c -CHKCONF_SRC = chkconf.c - -SRC = ${IRCD_SRC} ${OSDEP_C} ${ENGINE_C} ${RES_C} +SRC = ${IRCD_SRC} ${ENGINE_C} ${CRYPTO_SRC} OBJS = ${SRC:%.c=%.o} -DEP_SRC = ${IRCD_SRC} ${OSDEP_SRC} ${ENGINE_SRC} ${CHKCONF_SRC} +UMKPASSWD_OBJS = ${UMKPASSWD_SRC:%.c=%.o} + +DEP_SRC = ${IRCD_SRC} ${ENGINE_SRC} ${CRYPTO_SRC} all: ( cd ..; make -f Makefile ) @@ -240,7 +240,7 @@ build: ircd ircd: ${OBJS} ../include/patchlevel.h version.o - ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} ${OBJS} version.o ${RINGLOG_O} ${LDFLAGS} ${LIBS} \ + ${PURIFY} ${CC} ${OBJS} version.o ${RINGLOG_O} ${LDFLAGS} ${LIBS} \ -o ircd ${CHMOD} ${IRCDMODE} ircd @@ -254,14 +254,13 @@ # must be a better solution...perhaps sum all of the .c files and include # only that one sum? # -version.c: version.c.SH s_serv.c s_user.c channel.c s_bsd.c s_misc.c ircd.c \ - ../include/version.h ../include/patchlevel.h - ${SHELL} ${srcdir}/version.c.SH ${srcdir} +version.c: version.c.SH umkpasswd + ${SHELL} ${srcdir}/version.c.SH ${top_srcdir} ircd_string.o: ircd_string.c chattr.tab.c table_gen: table_gen.o - ${CC} ${CFLAGS} ${LDFLAGS} -o $@ table_gen.o + ${CC} ${LDFLAGS} -o $@ table_gen.o chattr.tab.c: table_gen ./table_gen > chattr.tab.c @@ -272,13 +271,8 @@ y.tab.c y.tab.h: ircd_parser.y ${YACC} -d ${srcdir}/ircd_parser.y -chkcrule.o: crule.c - ${CC} ${CFLAGS} ${CPPFLAGS} -DCR_CHKCONF -o chkcrule.o -c \ - ${srcdir}/crule.c - -chkconf: chkconf.o fda.o match.o chkcrule.o ircd_alloc.o fileio.o ircd_string.o - ${CC} chkconf.o fda.o match.o chkcrule.o ircd_alloc.o fileio.o \ - ircd_string.o ${CFLAGS} ${LDFLAGS} ${LIBS} -o chkconf +umkpasswd: ${UMKPASSWD_OBJS} + ${CC} ${LDFLAGS} ${UMKPASSWD_OBJS} ${LIBS} -o $@ mkbindir: @test -d ${BINDIR} || mkdir ${BINDIR} @@ -300,8 +294,9 @@ ${RM} -f ${SYMLINK}; \ ${LN_S} ircd.`cat /tmp/ircd.tag` ${SYMLINK}; ) @${RM} /tmp/ircd.tag -# ${INSTALL} -s -m 700 -o ${IRCDOWN} -g ${IRCDGRP} chkconf ${BINDIR} + ${INSTALL} -s -m 700 -o ${IRCDOWN} -g ${IRCDGRP} umkpasswd ${BINDIR} ${INSTALL} -m 600 -o ${IRCDOWN} -g ${IRCDGRP} ${top_srcdir}/doc/ircd.sample-en.conf ${DPATH} + ${INSTALL} -m 600 -o ${IRCDOWN} -g ${IRCDGRP} ${top_srcdir}/doc/ircd.sample-es.conf ${DPATH} # ( cd ${DPATH}; \ # ${TOUCH} ${MPATH}; \ # ${TOUCH} ${RPATH}; \ @@ -318,8 +313,8 @@ fi @echo "Installing new ircd as ${BINDIR}/ircd :" ${INSTALL} -m ${IRCDMODE} -o ${IRCDOWN} -g ${IRCDGRP} ircd ${BINDIR}/ircd -# ${INSTALL} -s -m 700 -o ${IRCDOWN} -g ${IRCDGRP} chkconf ${BINDIR} - ${INSTALL} -m 600 -o ${IRCDOWN} -g ${IRCDGRP} ${top_srcdir}/doc/en/ircd.sample-en.conf ${DPATH} + ${INSTALL} -m 600 -o ${IRCDOWN} -g ${IRCDGRP} ${top_srcdir}/doc/ircd.sample-en.conf ${DPATH} + ${INSTALL} -m 600 -o ${IRCDOWN} -g ${IRCDGRP} ${top_srcdir}/doc/ircd.sample-es.conf ${DPATH} # ( cd ${DPATH}; \ # ${TOUCH} ${MPATH}; \ # ${TOUCH} ${RPATH}; \ @@ -328,13 +323,13 @@ uninstall: @if [ "${BINDIR}" != "${DPATH}" ]; then \ - echo "${RM} -f ${BINDIR}/${SYMLINK} ${BINDIR}/ircd.9* ${BINDIR}/chkconf"; \ - ${RM} -f ${BINDIR}/${SYMLINK} ${BINDIR}/ircd.9* ${BINDIR}/chkconf; \ + echo "${RM} -f ${BINDIR}/${SYMLINK} ${BINDIR}/ircd.9*"; \ + ${RM} -f ${BINDIR}/${SYMLINK} ${BINDIR}/ircd.9*; \ fi @echo "Please remove the contents of ${DPATH} manually" clean: - ${RM} -f *.o *.bak ircd version.c chkconf ircd_osdep.c chattr.tab.c table_gen y.tab.* lex.yy.* + ${RM} -f *.o *.bak ircd version.c umkpasswd ircd_osdep.c chattr.tab.c table_gen y.tab.* lex.yy.* distclean: clean ${RM} -f Makefile stamp-m @@ -371,7 +366,7 @@ # ../config/config.h: # @cd ../config; ${MAKE} config.h -# DO NOT DELETE THIS LINE -- make depend depends on it. +# DO NOT DELETE THIS LINE (or the blank line after it) -- make depend depends on them. IPcheck.o: IPcheck.c ../config.h ../include/IPcheck.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ @@ -390,7 +385,7 @@ ../include/msg.h ../include/numeric.h ../include/numnicks.h \ ../include/querycmds.h ../include/s_bsd.h ../include/s_conf.h \ ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \ - ../include/send.h ../include/support.h ../include/sys.h \ + ../include/send.h ../include/sys.h \ ../include/whowas.h class.o: class.c ../config.h ../include/class.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ @@ -430,7 +425,7 @@ ../include/ircd_snprintf.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/match.h ../include/numeric.h \ ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \ - ../include/s_stats.h ../include/send.h ../include/support.h \ + ../include/s_stats.h ../include/send.h \ ../include/msg.h ../include/numnicks.h ../include/sys.h \ ../include/whocmds.h hash.o: hash.c ../config.h ../include/hash.h ../include/client.h \ @@ -438,7 +433,7 @@ ../include/ircd_events.h ../include/ircd_handler.h ../include/channel.h \ ../include/ircd_chattr.h ../include/ircd_string.h ../include/ircd.h \ ../include/struct.h ../include/msg.h ../include/send.h \ - ../include/support.h ../include/sys.h ../include/watch.h + ../include/sys.h ../include/watch.h ircd.o: ircd.c ../config.h ../include/ircd.h ../include/struct.h \ ../include/ircd_defs.h ../include/IPcheck.h ../include/class.h \ ../include/client.h ../include/dbuf.h ../include/msgq.h \ @@ -471,7 +466,7 @@ ../include/msg.h ../include/numeric.h ../include/numnicks.h \ ../include/random.h ../include/s_bsd.h ../include/s_debug.h \ ../include/s_misc.h ../include/s_stats.h ../include/send.h \ - ../include/support.h ../include/sys.h ../include/whowas.h + ../include/sys.h ../include/whowas.h ircd_log.o: ircd_log.c ../config.h ../include/ircd_log.h \ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ @@ -506,7 +501,6 @@ ../include/ircd_chattr.h ../include/ircd_defs.h ../include/ircd_log.h \ chattr.tab.c ircd_tea.o: ircd_tea.c ../config.h -ircd_xopen.o: ircd_xopen.c ../config.h ../include/ircd_xopen.h jupe.o: jupe.c ../config.h ../include/jupe.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ @@ -515,7 +509,7 @@ ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/match.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_bsd.h \ - ../include/s_misc.h ../include/send.h ../include/support.h \ + ../include/s_misc.h ../include/send.h \ ../include/sys.h lex.yy.o: lex.yy.c ../include/ircd.h ../include/struct.h \ ../include/ircd_defs.h y.tab.h @@ -527,7 +521,7 @@ ../include/match.h ../include/numeric.h ../include/res.h \ ../include/s_auth.h ../include/s_bsd.h ../include/s_conf.h \ ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \ - ../include/send.h ../include/support.h ../include/whowas.h + ../include/send.h ../include/whowas.h listener.o: listener.c ../config.h ../include/listener.h \ ../include/ircd_defs.h ../include/ircd_events.h ../include/client.h \ ../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \ @@ -567,7 +561,7 @@ ../include/ircd_chattr.h ../include/ircd_snprintf.h ../include/list.h \ ../include/match.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/s_conf.h ../include/s_misc.h \ - ../include/send.h ../include/support.h + ../include/send.h m_clearmode.o: m_clearmode.c ../config.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ ../include/ircd_events.h ../include/ircd_handler.h ../include/channel.h \ @@ -576,7 +570,7 @@ ../include/ircd_log.h ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/list.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \ - ../include/send.h ../include/support.h + ../include/send.h m_close.o: m_close.c ../config.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ @@ -661,7 +655,7 @@ ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \ ../include/msg.h ../include/numeric.h ../include/numnicks.h \ ../include/s_conf.h ../include/s_misc.h ../include/send.h \ - ../include/support.h + m_help.o: m_help.c ../config.h ../include/client.h ../include/ircd_defs.h \ ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ @@ -703,7 +697,7 @@ ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/match.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \ - ../include/s_misc.h ../include/send.h ../include/support.h + ../include/s_misc.h ../include/send.h m_kick.o: m_kick.c ../config.h ../include/channel.h \ ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ @@ -795,10 +789,10 @@ ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ ../include/struct.h ../include/ircd_features.h ../include/ircd_log.h \ ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/ircd_xopen.h ../include/msg.h \ + ../include/ircd_chattr.h ../include/msg.h \ ../include/numeric.h ../include/numnicks.h ../include/querycmds.h \ ../include/s_conf.h ../include/s_debug.h ../include/s_user.h \ - ../include/s_misc.h ../include/send.h ../include/support.h + ../include/s_misc.h ../include/send.h m_opmode.o: m_opmode.c ../config.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ ../include/ircd_events.h ../include/ircd_handler.h ../include/channel.h \ @@ -1051,7 +1045,7 @@ ../include/ircd_features.h ../include/ircd_log.h \ ../include/ircd_reply.h ../include/ircd_string.h ../include/match.h \ ../include/numeric.h ../include/numnicks.h ../include/send.h \ - ../include/support.h ../include/whocmds.h + ../include/whocmds.h m_whois.o: m_whois.c ../config.h ../include/channel.h \ ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ @@ -1145,7 +1139,7 @@ ../include/packet.h ../include/parse.h ../include/querycmds.h \ ../include/res.h ../include/s_auth.h ../include/s_conf.h \ ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \ - ../include/send.h ../include/support.h ../include/sys.h \ + ../include/send.h ../include/sys.h \ ../include/uping.h ../include/version.h s_conf.o: s_conf.c ../config.h ../include/s_conf.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ @@ -1159,7 +1153,7 @@ ../include/numeric.h ../include/numnicks.h ../include/opercmds.h \ ../include/parse.h ../include/res.h ../include/s_bsd.h \ ../include/s_debug.h ../include/s_misc.h ../include/send.h \ - ../include/support.h ../include/sys.h + ../include/sys.h s_debug.o: s_debug.c ../config.h ../include/s_debug.h \ ../include/ircd_defs.h ../include/channel.h ../include/class.h \ ../include/client.h ../include/dbuf.h ../include/msgq.h \ @@ -1185,7 +1179,7 @@ ../include/parse.h ../include/querycmds.h ../include/res.h \ ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \ ../include/s_stats.h ../include/s_user.h ../include/send.h \ - ../include/support.h ../include/sys.h ../include/uping.h \ + ../include/sys.h ../include/uping.h \ ../include/userload.h ../include/watch.h s_numeric.o: s_numeric.c ../config.h ../include/s_numeric.h \ ../include/channel.h ../include/ircd_defs.h ../include/client.h \ @@ -1200,7 +1194,7 @@ ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ ../include/ircd_reply.h ../include/ircd_string.h \ ../include/ircd_chattr.h ../include/ircd_snprintf.h \ - ../include/ircd_xopen.h ../include/jupe.h ../include/list.h \ + ../include/jupe.h ../include/list.h \ ../include/match.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/parse.h ../include/querycmds.h \ ../include/ircd_features.h ../include/s_bsd.h ../include/s_conf.h \ @@ -1230,7 +1224,7 @@ ../include/numeric.h ../include/numnicks.h ../include/parse.h \ ../include/querycmds.h ../include/random.h ../include/s_bsd.h \ ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \ - ../include/s_serv.h ../include/send.h ../include/support.h \ + ../include/s_serv.h ../include/send.h \ ../include/supported.h ../include/sys.h ../include/userload.h \ ../include/version.h ../include/watch.h ../include/whowas.h \ ../include/handlers.h @@ -1243,7 +1237,7 @@ ../include/match.h ../include/msg.h ../include/numnicks.h \ ../include/parse.h ../include/s_bsd.h ../include/s_debug.h \ ../include/s_misc.h ../include/s_user.h ../include/sys.h -support.o: support.c ../config.h ../include/support.h ../include/fileio.h \ +support.o: support.c ../config.h ../include/fileio.h \ ../include/ircd.h ../include/struct.h ../include/ircd_defs.h \ ../include/ircd_chattr.h ../include/ircd_snprintf.h ../include/s_bsd.h \ ../include/s_debug.h ../include/send.h ../include/sys.h @@ -1280,7 +1274,7 @@ ../include/numeric.h ../include/numnicks.h ../include/querycmds.h \ ../include/random.h ../include/s_bsd.h ../include/s_conf.h \ ../include/s_misc.h ../include/s_user.h ../include/send.h \ - ../include/support.h ../include/sys.h ../include/userload.h \ + ../include/sys.h ../include/userload.h \ ../include/version.h ../include/whowas.h ../include/msg.h whowas.o: whowas.c ../config.h ../include/whowas.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ @@ -1288,7 +1282,7 @@ ../include/struct.h ../include/ircd_alloc.h ../include/ircd_chattr.h \ ../include/ircd_features.h ../include/ircd_string.h ../include/list.h \ ../include/numeric.h ../include/s_debug.h ../include/s_misc.h \ - ../include/s_user.h ../include/send.h ../include/support.h \ + ../include/s_user.h ../include/send.h \ ../include/sys.h ../include/msg.h y.tab.o: y.tab.c ../config.h ../include/s_conf.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ @@ -1302,7 +1296,7 @@ ../include/numeric.h ../include/numnicks.h ../include/opercmds.h \ ../include/parse.h ../include/res.h ../include/s_bsd.h \ ../include/s_debug.h ../include/s_misc.h ../include/send.h \ - ../include/support.h ../include/sys.h + ../include/sys.h os_bsd.o: os_bsd.c ../config.h ../include/ircd_osdep.h ../include/msgq.h \ ../include/ircd_defs.h os_linux.o: os_linux.c ../config.h ../include/ircd_osdep.h \ Index: ircd-ircdev/ircd/channel.c diff -u ircd-ircdev/ircd/channel.c:1.8 ircd-ircdev/ircd/channel.c:1.9 --- ircd-ircdev/ircd/channel.c:1.8 Wed Nov 17 03:45:50 2004 +++ ircd-ircdev/ircd/channel.c Wed Nov 24 08:06:14 2004 @@ -18,8 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: channel.c,v 1.8 2004/11/17 11:45:50 zolty Exp $ - * + */ +/** @file + * @brief Channel management and maintanance + * @version $Id: channel.c,v 1.9 2004/11/24 16:06:14 zolty Exp $ */ #include "config.h" @@ -50,7 +52,6 @@ #include "s_user.h" #include "send.h" #include "struct.h" -#include "support.h" #include "sys.h" #include "whowas.h" @@ -59,32 +60,20 @@ #include <stdlib.h> #include <string.h> +/** Linked list containing the full list of all channels */ struct Channel* GlobalChannelList = 0; +/** Number of struct Membership*'s allocated */ static unsigned int membershipAllocCount; +/** Freelist for struct Membership*'s */ static struct Membership* membershipFreeList; - -void del_invite(struct Client *, struct Channel *); - -const char* const PartFmt1 = ":%s " MSG_PART " %s"; -const char* const PartFmt2 = ":%s " MSG_PART " %s :%s"; -const char* const PartFmt1serv = "%s%s " TOK_PART " %s"; -const char* const PartFmt2serv = "%s%s " TOK_PART " %s :%s"; - - -static struct SLink* next_ban; -static struct SLink* prev_ban; -static struct SLink* removed_bans_list; - -/* - * Use a global variable to remember if an oper set a mode on a local channel. Ugly, - * but the only way to do it without changing set_mode intensively. - */ -int LocalChanOperMode = 0; +/** Freelist for struct Ban*'s */ +static struct Ban* free_bans; #if !defined(NDEBUG) -/* - * return the length (>=0) of a chain of links. +/** return the length (>=0) of a chain of links. + * @param lp pointer to the start of the linked list + * @return the number of items in the list */ static int list_length(struct SLink *lp) { @@ -96,6 +85,71 @@ } #endif +/** Set the mask for a ban, checking for IP masks. + * @param[in,out] ban Ban structure to modify. + * @param[in] banstr Mask to ban. + */ +static void +set_ban_mask(struct Ban *ban, const char *banstr) +{ + char *sep; + MyFree(ban->banstr); + if (!banstr) + return; + DupString(ban->banstr, banstr); + sep = strrchr(banstr, '@'); + if (sep) { + ban->nu_len = sep - banstr; + if (ipmask_parse(sep + 1, &ban->address, &ban->addrbits)) + ban->flags |= BAN_IPMASK; + } +} + +/** Allocate a new Ban structure. + * @param[in] banstr Ban mask to use. + * @return Newly allocated ban. + */ +struct Ban * +make_ban(const char *banstr) +{ + struct Ban *ban; + if (free_bans) { + ban = free_bans; + free_bans = free_bans->next; + } + else if (!(ban = MyMalloc(sizeof(*ban)))) + return NULL; + memset(ban, 0, sizeof(*ban)); + set_ban_mask(ban, banstr); + return ban; +} + +/** Deallocate a ban structure. + * @param[in] ban Ban to deallocate. + */ +void +free_ban(struct Ban *ban) +{ + MyFree(ban->who); + MyFree(ban->banstr); + ban->next = free_bans; + free_bans = ban; +} + +/** return the struct Membership* that represents a client on a channel + * This function finds a struct Membership* which holds the state about + * a client on a specific channel. The code is smart enough to iterate + * over the channels a user is in, or the users in a channel to find the + * user depending on which is likely to be more efficient. + * + * @param chptr pointer to the channel struct + * @param cptr pointer to the client struct + * + * @returns pointer to the struct Membership representing this client on + * this channel. Returns NULL if the client is not on the channel. + * Returns NULL if the client is actually a server. + * @see find_channel_member() + */ struct Membership* find_member_link(struct Channel* chptr, const struct Client* cptr) { struct Membership *m; @@ -136,11 +190,20 @@ return 0; } -/* - * find_chasing - Find the client structure for a nick name (user) +/** Find the client structure for a nick name (user) + * Find the client structure for a nick name (user) * using history mechanism if necessary. If the client is not found, an error * message (NO SUCH NICK) is generated. If the client was found * through the history, chasing will be 1 and otherwise 0. + * + * This function was used extensively in the P09 days, and since we now have + * numeric nicks is no longer quite as important. + * + * @param sptr Pointer to the client that has requested the search + * @param user a string represeting the client to be found + * @param chasing a variable set to 0 if the user was found directly, + * 1 otherwise + * @returns a pointer the client, or NULL if the client wasn't found. */ struct Client* find_chasing(struct Client* sptr, const char* user, int* chasing) { @@ -160,42 +223,18 @@ return who; } -/* - * Create a string of form "foo!bar@fubar" given foo, bar and fubar - * as the parameters. If NULL, they become "*". - */ -#define NUH_BUFSIZE (NICKLEN + USERLEN + HOSTLEN + 3) -static char *make_nick_user_host(char *namebuf, const char *nick, - const char *name, const char *host) -{ - ircd_snprintf(0, namebuf, NUH_BUFSIZE, "%s!%s@%s", nick, name, host); - return namebuf; -} - -/* - * Create a string of form "foo!bar@123.456.789.123" given foo, bar and the - * IP-number as the parameters. If NULL, they become "*". - */ -#define NUI_BUFSIZE (NICKLEN + USERLEN + 16 + 3) -static char *make_nick_user_ip(char *ipbuf, char *nick, char *name, - struct in_addr ip) -{ - ircd_snprintf(0, ipbuf, NUI_BUFSIZE, "%s!%s@%s", nick, name, - ircd_ntoa((const char*) &ip)); - return ipbuf; -} - -/* - * Subtract one user from channel i (and free channel - * block, if channel became empty). +/** Decrement the count of users, and free if empty. + * Subtract one user from channel i (and free channel * block, if channel + * became empty). + * + * @param chptr The channel to subtract one from. * * defined(UNDERNET) - * Returns: true (1) if channel still has members. + * @returns true (1) if channel still has members. * false (0) if the channel is now empty. * !defined(UNDERNET) * Returns: true (1) if channel still exists * false (0) if the channel was destroyed - * !defined(UNDERNET) */ int sub1_from_channel(struct Channel* chptr) { @@ -241,13 +280,24 @@ return 0; } +/** Destroy an empty channel + * This function destroys an empty channel, removing it from hashtables, + * and removing any resources it may have consumed. + * + * @param chptr The channel to destroy + * + * @returns 0 (success) + * + * FIXME: Change to return void, this function never fails. + */ int destruct_channel(struct Channel* chptr) { - struct SLink *tmp; - struct SLink *obtmp; + struct Ban *ban, *next; assert(0 == chptr->members); +#if 0 +/* FIXME-ZOLTAN BORRAR!! ¿? */ /* Channel became (or was) empty: Remove channel */ if (is_listed(chptr)) { @@ -263,20 +313,19 @@ } } } +*/ +#endif + /* * Now, find all invite links from channel structure */ - while ((tmp = chptr->invites)) - del_invite(tmp->value.cptr, chptr); + while (chptr->invites) + del_invite(chptr->invites->value.cptr, chptr); - tmp = chptr->banlist; - while (tmp) + for (ban = chptr->banlist; ban; ban = next) { - obtmp = tmp; - tmp = tmp->next; - MyFree(obtmp->value.ban.banstr); - MyFree(obtmp->value.ban.who); - free_link(obtmp); + next = ban->next; + free_ban(ban); } if (chptr->prev) chptr->prev->next = chptr->next; @@ -294,149 +343,13 @@ return 0; } -/* - * add_banid - * - * `cptr' must be the client adding the ban. - * - * If `change' is true then add `banid' to channel `chptr'. - * Returns 0 if the ban was added. - * Returns -2 if the ban already existed and was marked CHFL_BURST_BAN_WIPEOUT. - * Return -1 otherwise. - * - * Those bans that overlapped with `banid' are flagged with CHFL_BAN_OVERLAPPED - * when `change' is false, otherwise they will be removed from the banlist. - * Subsequently calls to next_overlapped_ban() or next_removed_overlapped_ban() - * respectively will return these bans until NULL is returned. - * - * If `firsttime' is true, the ban list as returned by next_overlapped_ban() - * is reset (unless a non-zero value is returned, in which case the - * CHFL_BAN_OVERLAPPED flag might not have been reset!). +/** returns Membership * if a person is joined and not a zombie + * @param cptr Client + * @param chptr Channel + * @returns pointer to the client's struct Membership * on the channel if that + * user is a full member of the channel, or NULL otherwise. * - * --Run - */ -int add_banid(struct Client *cptr, struct Channel *chptr, char *banid, - int change, int firsttime) -{ - struct SLink* ban; - struct SLink** banp; - int cnt = 0; - int removed_bans = 0; - int len = strlen(banid); - - if (firsttime) - { - next_ban = NULL; - assert(0 == prev_ban); - assert(0 == removed_bans_list); - } - if (MyUser(cptr)) - collapse(banid); - for (banp = &chptr->banlist; *banp;) - { - len += strlen((*banp)->value.ban.banstr); - ++cnt; - if (((*banp)->flags & CHFL_BURST_BAN_WIPEOUT)) - { - if (!strcmp((*banp)->value.ban.banstr, banid)) - { - (*banp)->flags &= ~CHFL_BURST_BAN_WIPEOUT; - return -2; - } - } - else if (!mmatch((*banp)->value.ban.banstr, banid)) - return -1; - if (!mmatch(banid, (*banp)->value.ban.banstr)) - { - struct SLink *tmp = *banp; - if (change) - { - if (MyUser(cptr)) - { - cnt--; - len -= strlen(tmp->value.ban.banstr); - } - *banp = tmp->next; - /* These will be sent to the user later as -b */ - tmp->next = removed_bans_list; - removed_bans_list = tmp; - removed_bans = 1; - } - else if (!(tmp->flags & CHFL_BURST_BAN_WIPEOUT)) - { - tmp->flags |= CHFL_BAN_OVERLAPPED; - if (!next_ban) - next_ban = tmp; - banp = &tmp->next; - } - else - banp = &tmp->next; - } - else - { - if (firsttime) - (*banp)->flags &= ~CHFL_BAN_OVERLAPPED; - banp = &(*banp)->next; - } - } - if (MyUser(cptr) && !removed_bans && - (len > (feature_int(FEAT_AVBANLEN) * feature_int(FEAT_MAXBANS)) || - (cnt >= feature_int(FEAT_MAXBANS)))) - { - send_reply(cptr, ERR_BANLISTFULL, chptr->chname, banid); - return -1; - } - if (change) - { - char* ip_start; - struct Membership* member; - ban = make_link(); - ban->next = chptr->banlist; - - ban->value.ban.banstr = (char*) MyMalloc(strlen(banid) + 1); - assert(0 != ban->value.ban.banstr); - strcpy(ban->value.ban.banstr, banid); - - if (feature_bool(FEAT_HIS_BANWHO) && IsServer(cptr)) - DupString(ban->value.ban.who, cli_name(&me)); - else - DupString(ban->value.ban.who, cli_name(cptr)); - assert(0 != ban->value.ban.who); - - ban->value.ban.when = TStime(); - ban->flags = CHFL_BAN; /* This bit is never used I think... */ - if ((ip_start = strrchr(banid, '@')) && check_if_ipmask(ip_start + 1)) - ban->flags |= CHFL_BAN_IPMASK; - chptr->banlist = ban; - - /* - * Erase ban-valid-bit - */ - for (member = chptr->members; member; member = member->next_member) - ClearBanValid(member); /* `ban' == channel member ! */ - } - return 0; -} - -struct SLink *next_removed_overlapped_ban(void) -{ - struct SLink *tmp = removed_bans_list; - if (prev_ban) - { - if (prev_ban->value.ban.banstr) /* Can be set to NULL in set_mode() */ - MyFree(prev_ban->value.ban.banstr); - MyFree(prev_ban->value.ban.who); - free_link(prev_ban); - prev_ban = 0; - } - if (tmp) - removed_bans_list = removed_bans_list->next; - prev_ban = tmp; - return tmp; -} - -/* - * find_channel_member - returns Membership * if a person is joined and not a zombie + * @see find_member_link() */ struct Membership* find_channel_member(struct Client* cptr, struct Channel* chptr) { @@ -447,84 +360,97 @@ return (member && !IsZombie(member)) ? member : 0; } -/* - * is_banned - a non-zero value if banned else 0. +/** Searches for a ban from a banlist that matches a user. + * @param[in] cptr The client to test. + * @param[in] banlist The list of bans to test. + * @return Pointer to a matching ban, or NULL if none exit. */ -static int is_banned(struct Client *cptr, struct Channel *chptr, - struct Membership* member) +struct Ban *find_ban(struct Client *cptr, struct Ban *banlist) { - struct SLink* tmp; + char nu[NICKLEN + USERLEN + 2]; #if defined(UNDERNET) - char tmphost[HOSTLEN + 1]; - char nu_realhost[NUH_BUFSIZE]; + char tmphost[HOSTLEN + 1]; #endif - char nu_host[NUH_BUFSIZE]; - char nu_ip[NUI_BUFSIZE]; - char* s; - char* sr = NULL; - char* ip_s = NULL; + char *sr; + struct Ban *found; - if (!IsUser(cptr)) - return 0; - - if (member && IsBanValid(member)) - return IsBanned(member); - - s = make_nick_user_host(nu_host, cli_name(cptr), (cli_user(cptr))->username, - (cli_user(cptr))->host); + /* Build nick!user and alternate host names. */ + ircd_snprintf(0, nu, sizeof(nu), "%s!%s", + cli_name(cptr), cli_user(cptr)->username); #if defined(UNDERNET) - if (IsAccount(cptr)) + if (!IsAccount(cptr)) + sr = NULL; + else if (HasHiddenHost(cptr)) + sr = cli_user(cptr)->realhost; + else { - if (HasHiddenHost(cptr)) - { - sr = make_nick_user_host(nu_realhost, cli_name(cptr), - cli_user(cptr)->username, - cli_user(cptr)->realhost); - } - else - { - ircd_snprintf(0, tmphost, HOSTLEN, "%s.%s", - cli_user(cptr)->account, feature_str(FEAT_HIDDEN_HOST)); - sr = make_nick_user_host(nu_realhost, cli_name(cptr), - cli_user(cptr)->username, - tmphost); - } - } -#endif /* defined(UNDERNET) */ - - for (tmp = chptr->banlist; tmp; tmp = tmp->next) { - if ((tmp->flags & CHFL_BAN_IPMASK)) { - if (!ip_s) - ip_s = make_nick_user_ip(nu_ip, cli_name(cptr), - (cli_user(cptr))->username, cli_ip(cptr)); - if (match(tmp->value.ban.banstr, ip_s) == 0) - break; - } - if (match(tmp->value.ban.banstr, s) == 0) - break; - else if (sr && match(tmp->value.ban.banstr, sr) == 0) - break; + ircd_snprintf(0, tmphost, HOSTLEN, "%s.%s", + cli_user(cptr)->account, feature_str(FEAT_HIDDEN_HOST)); + sr = tmphost; } +#else + sr = cli_user(cptr)->realhost; +#endif - if (member) { - SetBanValid(member); - if (tmp) { - SetBanned(member); - return 1; - } - else { - ClearBanned(member); - return 0; - } - } + /* Walk through ban list. */ + for (found = NULL; banlist; banlist = banlist->next) { + int res; + /* If we have found a positive ban already, only consider exceptions. */ + if (found && !(banlist->flags & BAN_EXCEPTION)) + continue; + /* Compare nick!user portion of ban. */ + banlist->banstr[banlist->nu_len] = '\0'; + res = match(banlist->banstr, nu); + banlist->banstr[banlist->nu_len] = '@'; + if (res) + continue; + /* Compare host portion of ban. */ + if (!((banlist->flags & BAN_IPMASK) + && ipmask_check(&cli_ip(cptr), &banlist->address, banlist->addrbits)) + && match(banlist->banstr + banlist->nu_len + 1, cli_user(cptr)->host) + && !(sr && match(banlist->banstr + banlist->nu_len + 1, sr) == 0)) + continue; + /* If an exception matches, no ban can match. */ + if (banlist->flags & BAN_EXCEPTION) + return NULL; + /* Otherwise, remember this ban but keep searching for an exception. */ + found = banlist; + } + return found; +} + +/** + * This function returns true if the user is banned on the said channel. + * This function will check the ban cache if applicable, otherwise will + * do the comparisons and cache the result. + * + * @param[in] member The Membership to test for banned-ness. + * @return Non-zero if the member is banned, zero if not. + */ +static int is_banned(struct Membership* member) +{ + if (IsBanValid(member)) + return IsBanned(member); - return (tmp != NULL); + SetBanValid(member); + if (find_ban(member->user, member->channel->banlist)) { + SetBanned(member); + return 1; + } else { + ClearBanned(member); + return 0; + } } -/* +/** add a user to a channel. * adds a user to a channel by adding another link to the channels member * chain. + * + * @param chptr The channel to add to. + * @param who The user to add. + * @param flags The flags the user gets initially. + * @param oplevel The oplevel the user starts with. */ void add_user_to_channel(struct Channel* chptr, struct Client* who, unsigned int flags, int oplevel) @@ -569,6 +495,12 @@ } } +/** Remove a person from a channel, given their Membership* + * + * @param member A member of a channel. + * + * @returns true if there are more people in the channel. + */ static int remove_member_from_channel(struct Membership* member) { struct Channel* chptr; @@ -589,7 +521,7 @@ */ if (IsDelayedJoin(member)) CheckDelayedJoins(chptr); - + /* * unlink client channel list */ @@ -608,6 +540,11 @@ return sub1_from_channel(chptr); } +/** Check if all the remaining members on the channel are zombies + * + * @returns False if the channel has any non zombie members, True otherwise. + * @see \ref zombie + */ static int channel_all_zombies(struct Channel* chptr) { struct Membership* member; @@ -618,8 +555,16 @@ } return 1; } - + +/** Remove a user from a channel + * This is the generic entry point for removing a user from a channel, this + * function will remove the client from the channel, and destory the channel + * if there are no more normal users left. + * + * @param cptr The client + * @param chptr The channel + */ void remove_user_from_channel(struct Client* cptr, struct Channel* chptr) { @@ -640,6 +585,12 @@ } } +/** Remove a user from all channels they are on. + * + * This function removes a user from all channels they are on. + * + * @param cptr The client to remove. + */ void remove_user_from_all_channels(struct Client* cptr) { struct Membership* chan; @@ -650,6 +601,14 @@ remove_user_from_channel(cptr, chan->channel); } +/** Check if this user is a legitimate chanop + * + * @param cptr Client to check + * @param chptr Channel to check + * + * @returns True if the user is a chanop (And not a zombie), False otherwise. + * @see \ref zombie + */ int is_chan_op(struct Client *cptr, struct Channel *chptr) { struct Membership* member; @@ -660,6 +619,16 @@ return 0; } +/** Check if a user is a Zombie on a specific channel. + * + * @param cptr The client to check. + * @param chptr The channel to check. + * + * @returns True if the client (cptr) is a zombie on the channel (chptr), + * False otherwise. + * + * @see \ref zombie + */ int is_zombie(struct Client *cptr, struct Channel *chptr) { struct Membership* member; @@ -671,6 +640,14 @@ return 0; } +/** Returns if a user has voice on a channel. + * + * @param cptr The client + * @param chptr The channel + * + * @returns True if the client (cptr) is voiced on (chptr) and is not a zombie. + * @see \ref zombie + */ int has_voice(struct Client* cptr, struct Channel* chptr) { struct Membership* member; @@ -682,6 +659,26 @@ return 0; } +/** Can this member send to a channel + * + * A user can speak on a channel iff: + * <ol> + * <li> They didn't use the Apass to gain ops. + * <li> They are op'd or voice'd. + * <li> You aren't banned. + * <li> The channel isn't +m + * <li> The channel isn't +n or you are on the channel. + * </ol> + * + * This function will optionally reveal a user on a delayed join channel if + * they are allowed to send to the channel. + * + * @param member The membership of the user + * @param reveal If true, the user will be "revealed" on a delayed + * joined channel. + * + * @returns True if the client can speak on the channel. + */ int member_can_send_to_channel(struct Membership* member, int reveal) { assert(0 != member); @@ -705,7 +702,7 @@ * but because of the amount of CPU time that is_banned chews * we only check it for our clients. */ - if (MyUser(member->user) && is_banned(member->user, member->channel, member)) + if (MyUser(member->user) && is_banned(member)) return 0; if (IsDelayedJoin(member) && reveal) @@ -714,6 +711,21 @@ return 1; } +/** Check if a client can send to a channel. + * + * Has the added check over member_can_send_to_channel() of servers can + * always speak. + * + * @param cptr The client to check + * @param chptr The channel to check + * @param reveal If the user should be revealed (see + * member_can_send_to_channel()) + * + * @returns true if the client is allowed to speak on the channel, false + * otherwise + * + * @see member_can_send_to_channel() + */ int client_can_send_to_channel(struct Client *cptr, struct Channel *chptr, int reveal) { struct Membership *member; @@ -738,15 +750,19 @@ ) return 0; else - return !is_banned(cptr, chptr, NULL); + return !find_ban(cptr, chptr->banlist); } return member_can_send_to_channel(member, reveal); } -/* - * find_no_nickchange_channel - * if a member and not (opped or voiced) and (banned or moderated) - * return the name of the first channel banned on +/** Returns the name of a channel that prevents the user from changing nick. + * if a member and not (opped or voiced) and (banned or moderated), return + * the name of the first channel banned on. + * + * @param cptr The client + * + * @returns the name of the first channel banned on, or NULL if the user + * can change nicks. */ const char* find_no_nickchange_channel(struct Client* cptr) { @@ -755,7 +771,7 @@ for (member = (cli_user(cptr))->channel; member; member = member->next_channel) { if (!IsVoicedOrOpped(member) && - (is_banned(cptr, member->channel, member) || + (is_banned(member) || (member->channel->mode.mode & MODE_MODERATED))) return member->channel->chname; } @@ -764,9 +780,20 @@ } -/* +/** Fill mbuf/pbuf with modes from chptr * write the "simple" list of channel modes for channel chptr onto buffer mbuf - * with the parameters in pbuf. + * with the parameters in pbuf as visible by cptr. + * + * This function will hide keys from non-op'd, non-server clients. + * + * @param cptr The client to generate the mode for. + * @param mbuf The buffer to write the modes into. + * @param pbuf The buffer to write the mode parameters into. + * @param buflen The length of the buffers. + * @param chptr The channel to get the modes from. + * @param member The membership of this client on this channel (or NULL + * if this client isn't on this channel) + * */ void channel_modes(struct Client *cptr, char *mbuf, char *pbuf, int buflen, struct Channel *chptr, struct Membership *member) @@ -824,7 +851,7 @@ previous_parameter = 1; } if (*chptr->mode.upass) { - *mbuf++ = 'u'; + *mbuf++ = 'U'; if (previous_parameter) strcat(pbuf, " "); if (IsServer(cptr) || (member && IsChanOp(member) ... [truncated message content] |
From: Toni G. <zo...@us...> - 2004-11-24 16:05:43
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-11-24 16:05:11 UTC Modified files: ircd/ircd_alloc.c ircd/ircd_events.c ircd/ircd_features.c ircd/ircd_log.c ircd/ircd_relay.c ircd/ircd_reply.c ircd/ircd_signal.c ircd/ircd_snprintf.c ircd/ircd_string.c Added files: ircd/ircd_auth.c ircd/ircd_crypt.c ircd/ircd_crypt_native.c ircd/ircd_crypt_plain.c ircd/ircd_crypt_smd5.c ircd/ircd_md5.c ircd/ircd_res.c ircd/ircd_reslib.c Log message: Author: zoltan <zo...@ir...> Log message: 2004-11-24 Toni García <zo...@ir...> 1.0.alpha13 * Comentarios para Doxygen * Excepciones de Silences * Soporte total de IPv6 * Sincronizacion Undernet ---------------------- diff included ---------------------- Index: ircd-ircdev/ircd/ircd_alloc.c diff -u ircd-ircdev/ircd/ircd_alloc.c:1.2 ircd-ircdev/ircd/ircd_alloc.c:1.3 --- ircd-ircdev/ircd/ircd_alloc.c:1.2 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/ircd_alloc.c Wed Nov 24 08:05:00 2004 @@ -18,146 +18,86 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: ircd_alloc.c,v 1.2 2004/02/22 16:11:42 zolty Exp $ - * + */ +/** @file + * @brief IRC daemon memory allocation functions. + * @version $Id: ircd_alloc.c,v 1.3 2004/11/24 16:05:00 zolty Exp $ */ #include "config.h" #include "ircd_alloc.h" #include "ircd_string.h" #include "s_debug.h" -#include <string.h> #include <assert.h> +#include <string.h> -#if !defined(MDEBUG) -/* - * RELEASE: allocation functions - */ - -static void nomem_handler(void) -{ - Debug((DEBUG_FATAL, "Out of memory, exiting")); - exit(2); -} +static void nomem_handler(void); +/** Variable holding out-of-memory callback. */ static OutOfMemoryHandler noMemHandler = nomem_handler; -void set_nomem_handler(OutOfMemoryHandler handler) -{ - noMemHandler = handler; -} - -#if defined(FROBONFREE) || defined(FROBONMALLOC) +/** Default handler for out-of-memory conditions. */ static void -memfrob(void *ptr, size_t size) -{ - unsigned char *p = ptr, *ep = p + size - 4; - while (p <= ep) - { - *(unsigned long*)p = 0xDEADBEEF; - p += 4; - } - switch (ep - p) - { - case 3: - *(unsigned short*)p = 0xDEAD; - p[2] = 0xBE; - return; - case 2: - *(unsigned short*)p = 0xDEAD; - return; - case 1: - *p++ = 0xDE; - return; - } - return; -} -#endif - -void* MyMalloc(size_t size) +nomem_handler(void) { - void* p = -#ifdef FROBONFREE - malloc(size + sizeof(size_t)); +#ifdef MDEBUG + assert(0); #else - malloc(size); -#endif - if (!p) - (*noMemHandler)(); -#ifdef FROBONFREE - *(size_t*)p = size; - p = ((size_t*)p) + 1; -#endif -#ifdef FROBONMALLOC - memfrob(p, size); + Debug((DEBUG_FATAL, "Out of memory, exiting")); + exit(2); #endif - return p; } -void* MyRealloc(void* x, size_t size) +/** Set callback function for out-of-memory conditions. */ +void +set_nomem_handler(OutOfMemoryHandler handler) { -#ifdef FROBONFREE - size_t old_size = ((size_t*)x)[-1]; - if (old_size > size) - memfrob(((char*)x) + size, old_size - size); - x = realloc(((size_t*)x) - 1, size + sizeof(size_t)); -#else - x = realloc(x, size); -#endif - if (!x) - (*noMemHandler)(); - /* Both are needed in all cases to work with realloc... */ -#if defined(FROBONMALLOC) && defined(FROBONFREE) - if (old_size < size) - memfrob(((char*)x) + old_size, size - old_size); -#endif -#ifdef FROBONFREE - *(size_t*)x = size; - x = ((size_t*)x) + 1; -#endif - return x; + noMemHandler = handler; } -void* MyCalloc(size_t nelem, size_t size) +/** Allocate memory. + * @param[in] size Number of bytes to allocate. + * @param[in] x Type of allocation (ignored). + * @param[in] y Name of file doing allocation (ignored). + * @param[in] z Line number doing allocation (ignored). + * @return Newly allocated block of memory. + */ +void* DoMalloc(size_t size, const char* x, const char* y, int z) { - void* p = -#ifdef FROBONFREE - malloc(nelem * size + sizeof(size_t)); -#else - malloc(nelem * size); -#endif - if (!p) + void* t = malloc(size); + if (!t) (*noMemHandler)(); -#ifdef FROBONFREE - *((size_t*)p) = nelem * size; - p = ((size_t*)p) + 1; -#endif - memset(p, 0, size * nelem); - return p; + return t; } -#ifdef FROBONFREE -void -MyFrobulatingFree(void *p) +/** Allocate zero-initialized memory. + * @param[in] size Number of bytes to allocate. + * @param[in] x Type of allocation (ignored). + * @param[in] y Name of file doing allocation (ignored). + * @param[in] z Line number doing allocation (ignored). + * @return Newly allocated block of memory. + */ +void* DoMallocZero(size_t size, const char* x, const char* y, int z) { - size_t *stp = (size_t*)p; - if (p == NULL) - return; - memfrob(p, stp[-1]); - free(stp - 1); + void* t = malloc(size); + if (!t) + (*noMemHandler)(); + memset(t, 0, size); + return t; } -#endif -#else /* defined(MDEBUG) */ -/* - * DEBUG: allocation functions +/** Resize an allocated block of memory. + * @param[in] orig Original block to resize. + * @param[in] size Minimum size for new block. + * @param[in] file Name of file doing reallocation (ignored). + * @param[in] line Line number doing reallocation (ignored). */ -void set_nomem_handler(OutOfMemoryHandler handler) +void* DoRealloc(void *orig, size_t size, const char *file, int line) { - assert(0 != handler); - fda_set_nomem_handler(handler); + void* t = realloc(orig, size); + if (!t) + (*noMemHandler)(); + return t; } -#endif /* defined(MDEBUG) */ - Index: ircd-ircdev/ircd/ircd_auth.c diff -u /dev/null ircd-ircdev/ircd/ircd_auth.c:1.1 --- /dev/null Wed Nov 24 08:05:12 2004 +++ ircd-ircdev/ircd/ircd_auth.c Wed Nov 24 08:05:00 2004 @@ -0,0 +1,825 @@ +/* + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, ircd/ircd_iauth.c + * + * Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 2004 Michael Poole <md...@tr...> + * Copyright (C) 2001 Perry Lorier <is...@co...> + * + * 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 + * + */ +/** @file + * @brief IAuth client implementation for an IRC server. + * @version $Id: ircd_auth.c,v 1.1 2004/11/24 16:05:00 zolty Exp $ + */ +#include "config.h" +#include "client.h" +#include "ircd_alloc.h" +#include "ircd_auth.h" +#include "ircd_events.h" +#include "ircd_features.h" +#include "ircd_log.h" +#include "ircd_osdep.h" +#include "ircd_snprintf.h" +#include "ircd_string.h" +#include "ircd.h" +#include "msg.h" +#include "msgq.h" +#include "res.h" +#include "s_bsd.h" +#include "s_debug.h" +#include "s_misc.h" +#include "s_user.h" +#include "send.h" + +#include <assert.h> +#include <errno.h> +#include <netdb.h> +#include <string.h> +#include <unistd.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#ifdef HAVE_STDINT_H +#include <stdint.h> +#endif + +/** Describes state of a single pending IAuth request. */ +struct IAuthRequest { + struct IAuthRequest *iar_prev; /**< previous request struct */ + struct IAuthRequest *iar_next; /**< next request struct */ + struct Client *iar_client; /**< client being authenticated */ + char iar_timed; /**< if non-zero, using parent i_request_timer */ +}; + +/** Enumeration of IAuth connection flags. */ +enum IAuthFlag +{ + IAUTH_BLOCKED, /**< socket buffer full */ + IAUTH_CONNECTED, /**< server greeting/handshake done */ + IAUTH_ABORT, /**< abort connection asap */ + IAUTH_ICLASS, /**< tell iauth about all local users */ + IAUTH_CLOSING, /**< candidate to be disposed */ + IAUTH_LAST_FLAG /**< total number of flags */ +}; +/** Declare a bitset structure indexed by IAuthFlag. */ +DECLARE_FLAGSET(IAuthFlags, IAUTH_LAST_FLAG); + +/** Describes state of an IAuth connection. */ +struct IAuth { + struct IAuthRequest i_list_head; /**< doubly linked list of requests */ + struct MsgQ i_sendQ; /**< messages queued to send */ + struct Socket i_socket; /**< connection to server */ + struct Timer i_reconn_timer; /**< when to reconnect the connection */ + struct Timer i_request_timer; /**< when the current request times out */ + struct IAuthFlags i_flags; /**< connection state/status/flags */ + struct DNSQuery i_query; /**< DNS lookup for iauth server */ + unsigned int i_recvM; /**< messages received */ + unsigned int i_sendM; /**< messages sent */ + unsigned int i_recvK; /**< kilobytes received */ + unsigned int i_sendK; /**< kilobytes sent */ + unsigned short i_recvB; /**< bytes received modulo 1024 */ + unsigned short i_sendB; /**< bytes sent modulo 1024 */ + time_t i_reconnect; /**< seconds to wait before reconnecting */ + time_t i_timeout; /**< seconds to wait for a request */ + unsigned int i_count; /**< characters used in i_buffer */ + char i_buffer[BUFSIZE+1]; /**< partial unprocessed line from server */ + char i_passwd[PASSWDLEN+1]; /**< password for connection */ + char i_host[HOSTLEN+1]; /**< iauth server hostname */ + struct irc_sockaddr i_addr; /**< iauth server ip address and port */ + struct IAuth *i_next; /**< next connection in list */ +}; + +/** Return flags element of \a iauth. */ +#define i_flags(iauth) ((iauth)->i_flags) +/** Return whether flag \a flag is set on \a iauth. */ +#define IAuthGet(iauth, flag) FlagHas(&i_flags(iauth), flag) +/** Set flag \a flag on \a iauth. */ +#define IAuthSet(iauth, flag) FlagSet(&i_flags(iauth), flag) +/** Clear flag \a flag from \a iauth. */ +#define IAuthClr(iauth, flag) FlagClr(&i_flags(iauth), flag) +/** Get blocked state for \a iauth. */ +#define i_GetBlocked(iauth) IAuthGet(iauth, IAUTH_BLOCKED) +/** Set blocked state for \a iauth. */ +#define i_SetBlocked(iauth) IAuthSet(iauth, IAUTH_BLOCKED) +/** Clear blocked state for \a iauth. */ +#define i_ClrBlocked(iauth) IAuthClr(iauth, IAUTH_BLOCKED) +/** Get connected flag for \a iauth. */ +#define i_GetConnected(iauth) IAuthGet(iauth, IAUTH_CONNECTED) +/** Set connected flag for \a iauth. */ +#define i_SetConnected(iauth) IAuthSet(iauth, IAUTH_CONNECTED) +/** Clear connected flag for \a iauth. */ +#define i_ClrConnected(iauth) IAuthClr(iauth, IAUTH_CONNECTED) +/** Get abort flag for \a iauth. */ +#define i_GetAbort(iauth) IAuthGet(iauth, IAUTH_ABORT) +/** Set abort flag for \a iauth. */ +#define i_SetAbort(iauth) IAuthSet(iauth, IAUTH_ABORT) +/** Clear abort flag for \a iauth. */ +#define i_ClrAbort(iauth) IAuthClr(iauth, IAUTH_ABORT) +/** Get IClass flag for \a iauth. */ +#define i_GetIClass(iauth) IAuthGet(iauth, IAUTH_ICLASS) +/** Set IClass flag for \a iauth. */ +#define i_SetIClass(iauth) IAuthSet(iauth, IAUTH_ICLASS) +/** Clear IClass flag for \a iauth. */ +#define i_ClrIClass(iauth) IAuthClr(iauth, IAUTH_ICLASS) +/** Get closing flag for \a iauth. */ +#define i_GetClosing(iauth) IAuthGet(iauth, IAUTH_CLOSING) +/** Set closing flag for \a iauth. */ +#define i_SetClosing(iauth) IAuthSet(iauth, IAUTH_CLOSING) +/** Clear closing flag for \a iauth. */ +#define i_ClrClosing(iauth) IAuthClr(iauth, IAUTH_CLOSING) + +/** Return head of request linked list for \a iauth. */ +#define i_list_head(iauth) ((iauth)->i_list_head) +/** Return socket event generator for \a iauth. */ +#define i_socket(iauth) ((iauth)->i_socket) +/** Return reconnect timer for \a iauth. */ +#define i_reconn_timer(iauth) ((iauth)->i_reconn_timer) +/** Return request timeout timer for \a iauth. */ +#define i_request_timer(iauth) ((iauth)->i_request_timer) +/** Return DNS query for \a iauth. */ +#define i_query(iauth) ((iauth)->i_query) +/** Return received bytes (modulo 1024) for \a iauth. */ +#define i_recvB(iauth) ((iauth)->i_recvB) +/** Return received kilobytes (modulo 1024) for \a iauth. */ +#define i_recvK(iauth) ((iauth)->i_recvK) +/** Return received megabytes for \a iauth. */ +#define i_recvM(iauth) ((iauth)->i_recvM) +/** Return sent bytes (modulo 1024) for \a iauth. */ +#define i_sendB(iauth) ((iauth)->i_sendB) +/** Return sent kilobytes (modulo 1024) for \a iauth. */ +#define i_sendK(iauth) ((iauth)->i_sendK) +/** Return sent megabytes for \a iauth. */ +#define i_sendM(iauth) ((iauth)->i_sendM) +/** Return outbound message queue for \a iauth. */ +#define i_sendQ(iauth) ((iauth)->i_sendQ) +/** Return reconnection interval for \a iauth. */ +#define i_reconnect(iauth) ((iauth)->i_reconnect) +/** Return request timeout interval for \a iauth. */ +#define i_timeout(iauth) ((iauth)->i_timeout) +/** Return length of unprocessed message data for \a iauth. */ +#define i_count(iauth) ((iauth)->i_count) +/** Return start of unprocessed message data for \a iauth. */ +#define i_buffer(iauth) ((iauth)->i_buffer) +/** Return password we send for \a iauth. */ +#define i_passwd(iauth) ((iauth)->i_passwd) +/** Return server hostname for \a iauth. */ +#define i_host(iauth) ((iauth)->i_host) +/** Return address of IAuth server for \a iauth. */ +#define i_addr(iauth) ((iauth)->i_addr) +/** Return server port for \a iauth. */ +#define i_port(iauth) ((iauth)->i_addr.port) +/** Return next IAuth connection after \a iauth. */ +#define i_next(iauth) ((iauth)->i_next) + +/** Command table entry. */ +struct IAuthCmd { + const char *iac_name; /**< Name of command. */ + void (*iac_func)(struct IAuth *iauth, int, char *[]); /**< Handler function. */ +}; + +/** Active %IAuth connection(s). */ +struct IAuth *iauth_active; + +static void iauth_write(struct IAuth *iauth); +static void iauth_reconnect(struct IAuth *iauth); +static void iauth_disconnect(struct IAuth *iauth); +static void iauth_sock_callback(struct Event *ev); +static void iauth_send_request(struct IAuth *iauth, struct IAuthRequest *iar); +static void iauth_dispose_request(struct IAuth *iauth, struct IAuthRequest *iar); +static void iauth_cmd_doneauth(struct IAuth *iauth, int argc, char *argv[]); +static void iauth_cmd_badauth(struct IAuth *iauth, int argc, char *argv[]); + +/** Table of responses we might get from the IAuth server. */ +static const struct IAuthCmd iauth_cmdtab[] = { + { "DoneAuth", iauth_cmd_doneauth }, + { "BadAuth", iauth_cmd_badauth }, + { NULL, NULL } +}; + +/** Start (or update) a connection to an %IAuth server. + * If a connection already exists for the specified server name and + * port, update it with the other parameters; otherwise allocate a new + * IAuth record. + * @param[in] host %IAuth server hostname. + * @param[in] port %IAuth server port. + * @param[in] passwd Password to send. + * @param[in] reconnect Reconnect interval. + * @param[in] timeout Request timeout interval. + * @return IAuth structure for that connection. + */ +struct IAuth *iauth_connect(char *host, unsigned short port, char *passwd, time_t reconnect, time_t timeout) +{ + struct IAuth *iauth; + + for (iauth = iauth_active; iauth; iauth = i_next(iauth)) { + if (!ircd_strncmp(i_host(iauth), host, HOSTLEN) + && (i_port(iauth) == port)) { + i_ClrClosing(iauth); + i_reconnect(iauth) = reconnect; + if (t_active(&i_reconn_timer(iauth)) && (t_expire(&i_reconn_timer(iauth)) > CurrentTime + i_reconnect(iauth))) + timer_chg(&i_reconn_timer(iauth), TT_RELATIVE, i_reconnect(iauth)); + break; + } + } + if (NULL == iauth) { + if (iauth_active && !i_GetClosing(iauth_active)) { + log_write(LS_CONFIG, L_WARNING, 0, "Creating extra active IAuth connection to %s:%d.", host, port); + } + iauth = MyCalloc(1, sizeof(*iauth)); + i_list_head(iauth).iar_prev = &i_list_head(iauth); + i_list_head(iauth).iar_next = &i_list_head(iauth); + msgq_init(&i_sendQ(iauth)); + ircd_strncpy(i_host(iauth), host, HOSTLEN); + memset(&i_addr(iauth), 0, sizeof(i_addr(iauth))); + i_port(iauth) = port; + iauth_active = iauth; + i_reconnect(iauth) = reconnect; + iauth_reconnect(iauth); + } + if (passwd) + ircd_strncpy(i_passwd(iauth), passwd, PASSWDLEN); + else + i_passwd(iauth)[0] = '\0'; + i_timeout(iauth) = timeout; + i_SetIClass(iauth); + return iauth; +} + +/** Mark all %IAuth connections as closing. */ +void iauth_mark_closing(void) +{ + struct IAuth *iauth; + for (iauth = iauth_active; iauth; iauth = i_next(iauth)) + i_SetClosing(iauth); +} + +/** Close a particular %IAuth connection. + * @param[in] iauth %Connection to close. + */ +void iauth_close(struct IAuth *iauth) +{ + /* Figure out what to do with the closing connection's requests. */ + if (i_list_head(iauth).iar_next != &i_list_head(iauth)) { + struct IAuthRequest *iar; + if (iauth_active || i_next(iauth)) { + /* If iauth_active != NULL, send requests to it; otherwise if + * i_next(iauth) != NULL, we can hope it or some later + * connection will be active. + */ + struct IAuth *target = iauth_active ? iauth_active : i_next(iauth); + + /* Append iauth->i_list_head to end of target->i_list_head. */ + iar = i_list_head(iauth).iar_next; + iar->iar_prev = i_list_head(target).iar_prev; + i_list_head(target).iar_prev->iar_next = iar; + iar = i_list_head(iauth).iar_prev; + iar->iar_next = &i_list_head(target); + i_list_head(target).iar_prev = iar; + + /* If the target is not closing, send the requests. */ + for (iar = i_list_head(iauth).iar_next; + iar != &i_list_head(target); + iar = iar->iar_next) { + if (!i_GetClosing(target)) + iauth_send_request(target, iar); + } + } else { + /* No active connections - approve the requests and drop them. */ + while ((iar = i_list_head(iauth).iar_next) != &i_list_head(iauth)) { + struct Client *client = iar->iar_client; + iauth_dispose_request(iauth, iar); + register_user(client, client, cli_name(client), cli_username(client)); + } + } + } + /* Make sure the connection closes with an empty request list. */ + i_list_head(iauth).iar_prev = &i_list_head(iauth); + i_list_head(iauth).iar_next = &i_list_head(iauth); + /* Cancel the timer, if it is active. */ + if (t_active(&i_reconn_timer(iauth))) + timer_del(&i_reconn_timer(iauth)); + if (t_active(&i_request_timer(iauth))) + timer_del(&i_request_timer(iauth)); + /* Disconnect from the server. */ + if (s_fd(&i_socket(iauth)) != -1) + iauth_disconnect(iauth); + /* Free memory. */ + MyFree(iauth); +} + +/** Close all %IAuth connections marked as closing. */ +void iauth_close_unused(void) +{ + struct IAuth *prev, *iauth, *next; + + for (prev = NULL, iauth = iauth_active; iauth; iauth = next) { + next = i_next(iauth); + if (i_GetClosing(iauth)) { + /* Update iauth_active linked list. */ + if (prev) + i_next(prev) = next; + else + iauth_active = next; + /* Close and destroy the connection. */ + iauth_close(iauth); + } else { + prev = iauth; + } + } +} + +/** Send a line to an %IAuth server. + * @param[in] iauth %Connection to send on. + * @param[in] format Format string for message. + */ +static void iauth_send(struct IAuth *iauth, const char *format, ...) +{ + va_list vl; + struct MsgBuf *mb; + + va_start(vl, format); + mb = msgq_vmake(0, format, vl); + va_end(vl); + msgq_add(&i_sendQ(iauth), mb, 0); + msgq_clean(mb); +} + +/** Report a protocol violation from the %IAuth server. + * @param[in] iauth %Connection that experienced the violation. + * @param[in] format Format string for message to operators. + */ +static void iauth_protocol_violation(struct IAuth *iauth, const char *format, ...) +{ + struct VarData vd; + assert(iauth != 0); + assert(format != 0); + vd.vd_format = format; + va_start(vd.vd_args, format); + sendwallto_group_butone(&me, WALL_DESYNCH, NULL, "IAuth protocol violation: %v", &vd); + va_end(vd.vd_args); +} + +/** Send on-connect burst to an %IAuth server. + * @param[in] iauth %Connection that has completed. + */ +static void iauth_on_connect(struct IAuth *iauth) +{ + struct IAuthRequest *iar; + if (EmptyString(i_passwd(iauth))) + iauth_send(iauth, "Server %s", cli_name(&me)); + else + iauth_send(iauth, "Server %s %s", cli_name(&me), i_passwd(iauth)); + if (i_GetIClass(iauth)) { + /* TODO: report local users to iauth */ + iauth_send(iauth, "EndUsers"); + } + i_SetConnected(iauth); + for (iar = i_list_head(iauth).iar_next; + iar != &i_list_head(iauth); + iar = iar->iar_next) + iauth_send_request(iauth, iar); + iauth_write(iauth); +} + +/** Complete disconnection of an %IAuth connection. + * @param[in] iauth %Connection to fully close. + */ +static void iauth_disconnect(struct IAuth *iauth) +{ + close(s_fd(&i_socket(iauth))); + socket_del(&i_socket(iauth)); + s_fd(&i_socket(iauth)) = -1; +} + +/** DNS completion callback for an %IAuth connection. + * @param[in] vptr Pointer to the IAuth struct. + * @param[in] he DNS reply parameters. + */ +static void iauth_dns_callback(void *vptr, struct DNSReply *he) +{ + struct IAuth *iauth = vptr; + if (!he) { + sendto_opmask_butone(0, SNO_OLDSNO, "IAuth connection to %s failed: host lookup failed", i_host(iauth)); + } else { + memcpy(&i_addr(iauth).addr, &he->addr, sizeof(i_addr(iauth).addr)); + if (!irc_in_addr_valid(&i_addr(iauth).addr)) { + sendto_opmask_butone(0, SNO_OLDSNO, "IAuth connection to %s failed: host came back as unresolved", i_host(iauth)); + return; + } + iauth_reconnect(iauth); + } +} + +/** Timer callback for reconnecting to %IAuth. + * @param[in] ev Timer event for reconnect. + */ +static void iauth_reconnect_ev(struct Event *ev) +{ + if (ev_type(ev) == ET_EXPIRE) + iauth_reconnect(t_data(ev_timer(ev))); +} + +/** Schedule a reconnection for \a iauth. + * @param[in] iauth %Connection that needs to be reconnected. + */ +static void iauth_schedule_reconnect(struct IAuth *iauth) +{ + struct Timer *timer; + assert(!t_active(&i_reconn_timer(iauth))); + timer = timer_init(&i_reconn_timer(iauth)); + timer_add(timer, iauth_reconnect_ev, iauth, TT_RELATIVE, i_reconnect(iauth)); +} + +/** Initiate a (re-)connection to \a iauth. + * @param[in] iauth %Connection that should be initiated. + */ +static void iauth_reconnect(struct IAuth *iauth) +{ + IOResult result; + int fd; + + Debug((DEBUG_INFO, "IAuth attempt connection to %s port %p.", i_host(iauth), i_port(iauth))); + if (!irc_in_addr_valid(&i_addr(iauth).addr) + && !ircd_aton(&i_addr(iauth).addr, i_host(iauth))) { + i_query(iauth).vptr = iauth; + i_query(iauth).callback = iauth_dns_callback; + gethost_byname(i_host(iauth), &i_query(iauth)); + return; + } + fd = os_socket(&VirtualHost, SOCK_STREAM, "IAuth"); + if (fd < 0) + return; + if (!os_set_sockbufs(fd, SERVER_TCP_WINDOW, SERVER_TCP_WINDOW)) { + close(fd); + sendto_opmask_butone(0, SNO_OLDSNO, "IAuth reconnect unable to set socket buffers: %s", strerror(errno)); + return; + } + result = os_connect_nonb(fd, &i_addr(iauth)); + if (result == IO_FAILURE) { + close(fd); + sendto_opmask_butone(0, SNO_OLDSNO, "IAuth reconnect unable to initiate connection: %s", strerror(errno)); + return; + } + if (!socket_add(&i_socket(iauth), iauth_sock_callback, iauth, + (result == IO_SUCCESS) ? SS_CONNECTED : SS_CONNECTING, + SOCK_EVENT_READABLE | SOCK_EVENT_WRITABLE, fd)) { + close(fd); + sendto_opmask_butone(0, SNO_OLDSNO, "IAuth reconnect unable to add socket: %s", strerror(errno)); + return; + } +} + +/** Read input from \a iauth. + * Reads up to SERVER_TCP_WINDOW bytes per pass. + * @param[in] iauth Readable connection. + */ +static void iauth_read(struct IAuth *iauth) +{ + char *src, *endp, *old_buffer, *argv[MAXPARA + 1]; + unsigned int length, argc, ii; + char readbuf[SERVER_TCP_WINDOW]; + + length = 0; + if (IO_FAILURE == os_recv_nonb(s_fd(&i_socket(iauth)), readbuf, sizeof(readbuf), &length)) + return; + i_recvB(iauth) += length; + if (i_recvB(iauth) > 1023) { + i_recvK(iauth) += i_recvB(iauth) >> 10; + i_recvB(iauth) &= 1023; + } + old_buffer = i_buffer(iauth); + endp = old_buffer + i_count(iauth); + for (src = readbuf; length > 0; --length) { + *endp = *src++; + if (IsEol(*endp)) { + /* Skip blank lines. */ + if (endp == old_buffer) + continue; + /* NUL-terminate line and split parameters. */ + *endp = '\0'; + for (argc = 0, endp = old_buffer; *endp && (argc < MAXPARA); ) { + while (*endp == ' ') + *endp++ = '\0'; + if (*endp == '\0') + break; + if (*endp == ':') + { + argv[argc++] = endp + 1; + break; + } + argv[argc++] = endp; + for (; *endp && *endp != ' '; ++endp) ; + } + argv[argc] = NULL; + /* Count line and reset endp to start of buffer. */ + i_recvM(iauth)++; + endp = old_buffer; + /* Look up command and try to dispatch. */ + if (argc > 0) { + for (ii = 0; iauth_cmdtab[ii].iac_name; ++ii) { + if (!ircd_strcmp(iauth_cmdtab[ii].iac_name, argv[0])) { + iauth_cmdtab[ii].iac_func(iauth, argc, argv); + if (i_GetAbort(iauth)) + iauth_disconnect(iauth); + break; + } + } + } + } + else if (endp < old_buffer + BUFSIZE) + endp++; + } + i_count(iauth) = endp - old_buffer; +} + +/** Send queued output to \a iauth. + * @param[in] iauth Writable connection with queued data. + */ +static void iauth_write(struct IAuth *iauth) +{ + unsigned int bytes_tried, bytes_sent; + IOResult iores; + + if (i_GetBlocked(iauth)) + return; + while (MsgQLength(&i_sendQ(iauth)) > 0) { + iores = os_sendv_nonb(s_fd(&i_socket(iauth)), &i_sendQ(iauth), &bytes_tried, &bytes_sent); + switch (iores) { + case IO_SUCCESS: + msgq_delete(&i_sendQ(iauth), bytes_sent); + i_sendB(iauth) += bytes_sent; + if (i_sendB(iauth) > 1023) { + i_sendK(iauth) += i_sendB(iauth) >> 10; + i_sendB(iauth) &= 1023; + } + if (bytes_tried == bytes_sent) + break; + /* If bytes_sent < bytes_tried, fall through to IO_BLOCKED. */ + case IO_BLOCKED: + i_SetBlocked(iauth); + socket_events(&i_socket(iauth), SOCK_ACTION_ADD | SOCK_EVENT_WRITABLE); + return; + case IO_FAILURE: + iauth_disconnect(iauth); + return; + } + } + /* We were able to flush all events, so remove notification. */ + socket_events(&i_socket(iauth), SOCK_ACTION_DEL | SOCK_EVENT_WRITABLE); +} + +/** Handle socket activity for an %IAuth connection. + * @param[in] ev &Socket event; the IAuth connection is the user data pointer for the socket. + */ +static void iauth_sock_callback(struct Event *ev) +{ + struct IAuth *iauth; + + assert(0 != ev_socket(ev)); + iauth = (struct IAuth*) s_data(ev_socket(ev)); + assert(0 != iauth); + + switch (ev_type(ev)) { + case ET_CONNECT: + socket_state(ev_socket(ev), SS_CONNECTED); + iauth_on_connect(iauth); + break; + case ET_DESTROY: + if (!i_GetClosing(iauth)) + iauth_schedule_reconnect(iauth); + break; + case ET_READ: + iauth_read(iauth); + break; + case ET_WRITE: + i_ClrBlocked(iauth); + iauth_write(iauth); + break; + case ET_EOF: + iauth_disconnect(iauth); + break; + case ET_ERROR: + sendto_opmask_butone(0, SNO_OLDSNO, "IAuth socket error: %s", strerror(ev_data(ev))); + log_write(LS_SOCKET, L_ERROR, 0, "IAuth socket error: %s", strerror(ev_data(ev))); + iauth_disconnect(iauth); + break; + default: + assert(0 && "Unrecognized event type"); + break; + } +} + +/* Functions related to IAuthRequest structs */ + +/** Handle timeout while waiting for a response. + * @param[in] ev Timer event that expired. + */ +static void iauth_request_ev(struct Event *ev) +{ + /* TODO: this could probably be more intelligent */ + if (ev_type(ev) == ET_EXPIRE) { + sendto_opmask_butone(0, SNO_OLDSNO, "IAuth request timed out; reconnecting"); + iauth_reconnect(t_data(ev_timer(ev))); + } +} + +/** Send a authorization request to an %IAuth server. + * @param[in] iauth %Connection to send request on. + * @param[in] iar Request to send. + */ +static void iauth_send_request(struct IAuth *iauth, struct IAuthRequest *iar) +{ + struct Client *client; + + /* If iauth is not connected, we must defer the request. */ + if (!i_GetConnected(iauth)) { + Debug((DEBUG_SEND, "IAuth deferring request for %s because we are not connected.", cli_name(iar->iar_client))); + return; + } + + /* If no timed request, set up expiration timer. */ + if (!t_active(&i_request_timer(iauth))) { + struct Timer *timer = timer_init(&i_request_timer(iauth)); + timer_add(timer, iauth_request_ev, iauth, TT_RELATIVE, i_timeout(iauth)); + iar->iar_timed = 1; + } else + iar->iar_timed = 0; + + /* Send the FullAuth request. */ + client = iar->iar_client; + assert(iar->iar_client != NULL); + iauth_send(iauth, "FullAuth %x %s %s %s %s %s :%s", + client, cli_name(client), cli_username(client), + cli_user(client)->host, cli_sock_ip(client), + cli_passwd(client), cli_info(client)); + + /* Write to the socket if we can. */ + iauth_write(iauth); +} + +/** Start independent authorization check for a client. + * @param[in] iauth %Connection to send request on. + * @param[in] cptr Client to check. + * @return Zero, or CPTR_KILLED in case of memory allocation failure. + */ +int iauth_start_client(struct IAuth *iauth, struct Client *cptr) +{ + struct IAuthRequest *iar; + + /* Allocate and initialize IAuthRequest struct. */ + if (!(iar = MyCalloc(1, sizeof(*iar)))) + return exit_client(cptr, cptr, &me, "IAuth memory allocation failed"); + iar->iar_next = &i_list_head(iauth); + iar->iar_prev = i_list_head(iauth).iar_prev; + iar->iar_client = cptr; + iar->iar_prev->iar_next = iar; + iar->iar_next->iar_prev = iar; + + /* Send request. */ + iauth_send_request(iauth, iar); + + return 0; +} + +/** Handle a client that is disconnecting. + * If there is a pending %IAuth request for the client, close it. + * @param[in] cptr Client that is disconnecting. + */ +void iauth_exit_client(struct Client *cptr) +{ + if (cli_iauth(cptr)) { + iauth_dispose_request(iauth_active, cli_iauth(cptr)); + cli_iauth(cptr) = NULL; + } else if (IsIAuthed(cptr) && i_GetIClass(iauth_active)) { + /* TODO: report quit to iauth */ + } +} + +/** Find pending request with a particular ID. + * @param[in] iauth %Connection context for the ID. + * @param[in] id Identifier to look up. + * @return IAuthRequest with that ID, or NULL. + */ +static struct IAuthRequest *iauth_find_request(struct IAuth *iauth, char *id) +{ + struct IAuthRequest *curr; + struct Client *target; + target = (struct Client*)strtoul(id, NULL, 16); + for (curr = i_list_head(iauth).iar_next; + curr != &i_list_head(iauth); + curr = curr->iar_next) { + assert(curr->iar_client != NULL); + if (target == curr->iar_client) + return curr; + } + return NULL; +} + +/** Unlink and free a request. + * @param[in] iauth Connection that owns the request. + * @param[in] iar Request to free. + */ +static void iauth_dispose_request(struct IAuth *iauth, struct IAuthRequest *iar) +{ + assert(iar->iar_client != NULL); + if (iar->iar_timed) + timer_del(&i_request_timer(iauth)); + cli_iauth(iar->iar_client) = NULL; + iar->iar_prev->iar_next = iar->iar_next; + iar->iar_next->iar_prev = iar->iar_prev; + MyFree(iar); +} + +/** Handle a DoneAuth response from %IAuth. + * THis means the client is authorized, so let them in. + * @param[in] iauth Connection that sent the message. + * @param[in] argc Argument count. + * @param[in] argv Argument list. + */ +static void iauth_cmd_doneauth(struct IAuth *iauth, int argc, char *argv[]) +{ + struct IAuthRequest *iar; + struct Client *client; + char *id; + char *username; + char *hostname; + char *c_class; +#if defined(UNDERNET) + char *account; +#endif + + if (argc < 5) { + iauth_protocol_violation(iauth, "Only %d parameters for DoneAuth (expected >=5)", argc); + return; + } + id = argv[1]; + username = argv[2]; + hostname = argv[3]; + c_class = argv[4]; +#if defined(UNDERNET) + account = (argc > 5) ? argv[5] : 0; +#endif + iar = iauth_find_request(iauth, id); + if (!iar) { + iauth_protocol_violation(iauth, "Got unexpected DoneAuth for id %s", id); + return; + } + client = iar->iar_client; + ircd_strncpy(cli_username(client), username, USERLEN); + ircd_strncpy(cli_user(client)->host, hostname, HOSTLEN); +#if defined(UNDERNET) + if (account) { + ircd_strncpy(cli_user(client)->account, account, ACCOUNTLEN); + SetAccount(client); + } +#endif + SetIAuthed(client); + iauth_dispose_request(iauth, iar); + register_user(client, client, cli_name(client), username); +} + +/** Handle a BadAuth response from %IAuth. + * This means the client is not authorized, so dump them. + * @param[in] iauth Connection that sent the message. + * @param[in] argc Argument count. + * @param[in] argv Argument list. + */ +static void iauth_cmd_badauth(struct IAuth *iauth, int argc, char *argv[]) +{ + struct IAuthRequest *iar; + struct Client *client; + char *id; + char *reason; + + if (argc < 3) { + iauth_protocol_violation(iauth, "Only %d parameters for BadAuth (expected >=3)", argc); + return; + } + id = argv[1]; + reason = argv[2]; + if (EmptyString(reason)) { + iauth_protocol_violation(iauth, "Empty BadAuth reason for id %s", id); + return; + } + iar = iauth_find_request(iauth, id); + if (!iar) { + iauth_protocol_violation(iauth, "Got unexpected BadAuth for id %s", id); + return; + } + client = iar->iar_client; + iauth_dispose_request(iauth, iar); + exit_client(client, client, &me, reason); +} Index: ircd-ircdev/ircd/ircd_crypt.c diff -u /dev/null ircd-ircdev/ircd/ircd_crypt.c:1.1 --- /dev/null Wed Nov 24 08:05:12 2004 +++ ircd-ircdev/ircd/ircd_crypt.c Wed Nov 24 08:05:00 2004 @@ -0,0 +1,241 @@ +/* + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, ircd/ircd_crypt.c + * + * Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 2002 hikari + * + * 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 + * + */ +/** + * @file + * @brief Core password encryption routines. + * @version $Id: ircd_crypt.c,v 1.1 2004/11/24 16:05:00 zolty Exp $ + * + * This is a new look crypto API for ircu, it can handle different + * password formats by the grace of magic tokens at the begining of the + * password e.g. $SMD5 for Salted MD5, $CRYPT for native crypt(), etc. + * + * Currently crypt routines are implemented for: the native crypt() + * function, Salted MD5 and a plain text mechanism which should only + * be used for testing. I intend to add Blowish, 3DES and possibly + * SHA1 support as well at some point, but I'll need to check the + * possible problems that'll cause with stupid crypto laws. + * + * It's also designed to be "ready" for the modularisation of ircu, so + * someone get round to doing it, because I'm not doing it ;) + * + * The plan for Stage B is to semi-modularise the authentication + * mechanism to allow authentication against some other sources than + * the conf file (whatever takes someones fancy, kerberos, ldap, sql, etc). + * + * -- blessed be, hikari. + */ +#include "config.h" +#include "ircd_crypt.h" +#include "ircd_alloc.h" +#include "ircd_features.h" +#include "ircd_string.h" +#include "s_debug.h" + +/* while we're not modular, we need their init functions */ +#include "ircd_crypt_native.h" +#include "ircd_crypt_plain.h" +#include "ircd_crypt_smd5.h" + +#include <assert.h> +#include <unistd.h> +#include <string.h> + +/* evil global */ +crypt_mechs_t* crypt_mechs_root; + +/** Add a crypt mechanism to the list + * @param mechanism Pointer to the mechanism details struct + * @return 0 on success, anything else on fail. + * + * This routine registers a new crypt mechanism in the loaded mechanisms list, + * making it availabe for comparing passwords. +*/ +int ircd_crypt_register_mech(crypt_mech_t* mechanism) +{ +crypt_mechs_t* crypt_mech; + + Debug((DEBUG_INFO, "ircd_crypt_register_mech: resistering mechanism: %s", mechanism->shortname)); + + /* try to allocate some memory for the new mechanism */ + if ((crypt_mech = (crypt_mechs_t*)MyMalloc(sizeof(crypt_mechs_t))) == NULL) + { + /* aww poot, we couldn't get any memory, scream a little then back out */ + Debug((DEBUG_MALLOC, "ircd_crypt_register_mech: could not allocate memory for %s", mechanism->shortname)); + return -1; + } + + /* ok, we have memory, initialise it */ + memset(crypt_mech, 0, sizeof(crypt_mechs_t)); + + /* assign the data */ + crypt_mech->mech = mechanism; + crypt_mech->next = crypt_mech->prev = NULL; + + /* first of all, is there anything there already? */ + if(crypt_mechs_root->next == NULL) + { + /* nope, just add ourself */ + crypt_mechs_root->next = crypt_mechs_root->prev = crypt_mech; + } else { + /* nice and simple, put ourself at the end */ + crypt_mech->prev = crypt_mechs_root->prev; + crypt_mech->next = NULL; + crypt_mechs_root->prev = crypt_mech->prev->next = crypt_mech; + } + + /* we're done */ + Debug((DEBUG_INFO, "ircd_crypt_register_mech: resistered mechanism: %s, crypt_function is at 0x%X.", crypt_mech->mech->shortname, &crypt_mech->mech->crypt_function)); + Debug((DEBUG_INFO, "ircd_crypt_register_mech: %s: %s", crypt_mech->mech->shortname, crypt_mech->mech->description)); + return 0; +} + +/** Remove a crypt mechanism from the list + * @param mechanism Pointer to the mechanism we want to remove + * @return 0 on success, anything else on fail. +*/ +int ircd_crypt_unregister_mech(crypt_mech_t* mechanism) +{ + +return 0; +} + +/** Wrapper for generating a hashed password passed on the supplied password + * @param key Pointer to the password we want crypted + * @param salt Pointer to the password we're comparing to (for the salt) + * @return Pointer to the generated password (must be MyFree()'d). + * + * This is a wrapper function which attempts to establish the password + * format and funnel it off to the correct mechanism handler function. The + * returned password is compared in the oper_password_match() routine. +*/ +char* ircd_crypt(const char* key, const char* salt) +{ +char *hashed_pass = NULL; +const char *temp_hashed_pass, *mysalt; +crypt_mechs_t* crypt_mech; + + assert(NULL != key); + assert(NULL != salt); + + Debug((DEBUG_DEBUG, "ircd_crypt: key is %s", key)); + Debug((DEBUG_DEBUG, "ircd_crypt: salt is %s", salt)); + + crypt_mech = crypt_mechs_root->next; + + /* by examining the first n characters of a password string we + * can discover what kind of password it is. hopefully. */ + for (;crypt_mech;) + { + if (strlen(salt) < crypt_mech->mech->crypt_token_size) + { + /* try the next mechanism instead */ + Debug((DEBUG_DEBUG, "ircd_crypt: salt is too short, will try next mech at 0x%X", crypt_mech->next)); + crypt_mech = crypt_mech->next; + continue; + } + + Debug((DEBUG_DEBUG, "ircd_crypt: comparing %s with %s", + salt, crypt_mech->mech->crypt_token)); + + if(0 == ircd_strncmp(crypt_mech->mech->crypt_token, salt, crypt_mech->mech->crypt_token_size)) + { + Debug((DEBUG_DEBUG, "ircd_crypt: type is %s", + crypt_mech->mech->shortname)); + + /* before we send this all off to the crypt_function, we need to remove + the tag from it */ + + /* make sure we won't end up with a password comprised entirely of + a single \0 */ + if(strlen(salt) < crypt_mech->mech->crypt_token_size + 1) + return NULL; + + mysalt = salt + crypt_mech->mech->crypt_token_size; + + if(NULL == (temp_hashed_pass = crypt_mech->mech->crypt_function(key, mysalt))) + return NULL; + + Debug((DEBUG_DEBUG, "ircd_crypt: untagged pass is %s", temp_hashed_pass)); + + /* ok, now we need to prefix the password we just got back + with the right tag */ + if(NULL == (hashed_pass = (char *)MyMalloc(sizeof(char)*strlen(temp_hashed_pass) + crypt_mech->mech->crypt_token_size + 1))) + { + Debug((DEBUG_MALLOC, "ircd_crypt: unable to allocate memory for temp_hashed_pass")); + return NULL; + } + memset(hashed_pass, 0, sizeof(char)*strlen(temp_hashed_pass) + +crypt_mech->mech->crypt_token_size + 1); + ircd_strncpy(hashed_pass, crypt_mech->mech->crypt_token, + crypt_mech->mech->crypt_token_size); + ircd_strncpy(hashed_pass + crypt_mech->mech->crypt_token_size, temp_hashed_pass, strlen(temp_hashed_pass)); + Debug((DEBUG_DEBUG, "ircd_crypt: tagged pass is %s", hashed_pass)); + } else { + Debug((DEBUG_DEBUG, "ircd_crypt: will try next mechansim at 0x%X", + crypt_mech->next)); + crypt_mech = crypt_mech->next; + continue; + } + return hashed_pass; + } + + /* try to use native crypt for an old-style (untagged) password */ + if (strlen(salt) > 2) + { + temp_hashed_pass = (char*)ircd_crypt_native(key, salt); + if (!ircd_strcmp(temp_hashed_pass, salt)) + return strdup(temp_hashed_pass); + } + + return NULL; +} + +/** Some basic init. + * This function loads initalises the crypt mechanisms linked list and + * currently loads the default mechanisms (Salted MD5, Crypt() and PLAIN). + * The last step is only needed while ircu is not properly modular. + * + * When ircu is modular this will be the entry function for the ircd_crypt + * module. + * +*/ +void ircd_crypt_init(void) +{ + + if((crypt_mechs_root = MyMalloc(sizeof(crypt_mechs_t))) == NULL) + { + /* awooga - can't allocate memory for the root structure */ + Debug((DEBUG_MALLOC, "init_crypt: Could not allocate memory for crypt_mechs_root")); + return; + } + + crypt_mechs_root->mech = NULL; + crypt_mechs_root->next = crypt_mechs_root->prev = NULL; + +/* temporary kludge until we're modular. manualy call the + register funtions for crypt mechanisms */ + ircd_register_crypt_smd5(); + ircd_register_crypt_plain(); + ircd_register_crypt_native(); + +return; +} Index: ircd-ircdev/ircd/ircd_crypt_native.c diff -u /dev/null ircd-ircdev/ircd/ircd_crypt_native.c:1.1 --- /dev/null Wed Nov 24 08:05:12 2004 +++ ircd-ircdev/ircd/ircd_crypt_native.c Wed Nov 24 08:05:00 2004 @@ -0,0 +1,88 @@ +/* + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, ircd/ircd_crypt_native.c + * + * Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 1990-1991 Armin Gruner + * + * 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 + * + */ +/** + * @file + * @brief Native crypt() function routines + * @version $Id: ircd_crypt_native.c,v 1.1 2004/11/24 16:05:00 zolty Exp $ + * + * Routines for handling passwords encrypted with the system's native crypt() + * function (typicaly a DES encryption routine, but can be anything nowdays). + * + */ +#define _XOPEN_SOURCE +#define _XOPEN_VERSION 4 + +#include "config.h" +#include "ircd_crypt.h" +#include "ircd_crypt_native.h" +#include "s_debug.h" +#include "ircd_alloc.h" + +#include <assert.h> +#include <unistd.h> +#ifdef HAVE_CRYPT_H +#include <crypt.h> +#endif + +/** Simple routine that just calls crypt() with the supplied password and salt + * @param key The password we're encrypting. + * @param salt The salt we're using to encrypt key + * @return The encrypted password. + * + * Well this bit is (kinda) intact from the original oper password routines :) + * It's a very simple wrapper routine that just calls crypt and returns the + * result. + * -- hikari + */ +const char* ircd_crypt_native(const char* key, const char* salt) +{ + assert(NULL != key); + assert(NULL != salt); + + Debug((DEBUG_DEBUG, "ircd_crypt_native: key is %s", key)); + Debug((DEBUG_DEBUG, "ircd_crypt_native: salt is %s", salt)); + + return (const char*)crypt(key, salt); +} + +/* register ourself with the list of crypt mechanisms -- hikari */ +void ircd_register_crypt_native(void) +{ +crypt_mech_t* crypt_mech; + + if ((crypt_mech = (crypt_mech_t*)MyMalloc(sizeof(crypt_mech_t))) == NULL) + { + Debug((DEBUG_MALLOC, "Could not allocate space for crypt_native")); + return; + } + + crypt_mech->mechname = "native"; + crypt_mech->shortname = "crypt_native"; + crypt_mech->description = "System native crypt() function mechanism."; + crypt_mech->crypt_function = &ircd_crypt_native; + crypt_mech->crypt_token = "$CRYPT$"; + crypt_mech->crypt_token_size = 7; + + ircd_crypt_register_mech(crypt_mech); + +return; +} Index: ircd-ircdev/ircd/ircd_crypt_plain.c diff -u /dev/null ircd-ircdev/ircd/ircd_crypt_plain.c:1.1 --- /dev/null Wed Nov 24 08:05:12 2004 +++ ircd-ircdev/ircd/ircd_crypt_plain.c Wed Nov 24 08:05:00 2004 @@ -0,0 +1,86 @@ +/* + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, ircd/ircd_crypt_plain.c + * + * Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 2002 hikari + * + * 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 + * + */ +/** + * @file + * @brief Routines for PLAIN passwords. + * @version $Id: ircd_crypt_plain.c,v 1.1 2004/11/24 16:05:00 zolty Exp $ + * + * PLAIN text encryption. Oxymoron and a half that. + */ +#include "config.h" +#include "ircd_crypt.h" +#include "ircd_crypt_plain.h" +#include "s_debug.h" +#include "ircd_alloc.h" + +#include <assert.h> +#include <unistd.h> + +/** Just sends back the supplied password. + * @param key The password + * @param salt The salt + * @return The password + * + * Yes I know it's an oxymoron, but still, it's handy for testing. + * + * What you need more help with seeing what this does? + * + */ +const char* ircd_crypt_plain(const char* key, const char* salt) +{ + assert(NULL != salt); + assert(NULL != key); + + Debug((DEBUG_DEBUG, "ircd_crypt_plain: key is %s", key)); + Debug((DEBUG_DEBUG, "ircd_crypt_plain: salt is %s", salt)); + + /* yes, that's it. we just send key back out again, + pointless I know */ + return key; +} + +/** register ourself with the list of crypt mechanisms + * Registers the PLAIN mechanism in the list of available crypt mechanisms. + * When we're modular this will be the entry function for the module. + * + * -- hikari */ +void ircd_register_crypt_plain(void) +{ +crypt_mech_t* crypt_mech; + + if ((crypt_mech = (crypt_mech_t*)MyMalloc(sizeof(crypt_mech_t))) == NULL) + { + Debug((DEBUG_MALLOC, "Could not allocate space for crypt_plain")); + return; + } + + crypt_mech->mechname = "plain"; + crypt_mech->shortname = "crypt_plain"; + crypt_mech->description = "Plain text \"crypt\" mechanism."; + crypt_mech->crypt_function = &ircd_crypt_plain; + crypt_mech->crypt_token = "$PLAIN$"; + crypt_mech->crypt_token_size = 7; + + ircd_crypt_register_mech(crypt_mech); + +return; +} Index: ircd-ircdev/ircd/ircd_crypt_smd5.c diff -u /dev/null ircd-ircdev/ircd/ircd_crypt_smd5.c:1.1 --- /dev/null Wed Nov 24 08:05:14 2004 +++ ircd-ircdev/ircd/ircd_crypt_smd5.c Wed Nov 24 08:05:00 2004 @@ -0,0 +1,234 @@ +/* + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, ircd/ircd_crypt_smd5.c + * + * Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 2002 hikari + * + * 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 + * + */ +/** + * @file + * @brief Routines for Salted MD5 passwords + * @version $Id: ircd_crypt_smd5.c,v 1.1 2004/11/24 16:05:00 zolty Exp $ + * + * ircd_crypt_smd5 is largely taken from md5_crypt.c from the Linux PAM + * source code. it's been modified to fit in with ircu and some of the + * undeeded code has been removed. the source file md5_crypt.c has the + * following licence, so if any of our opers or admins are in Denmark + * they better go buy them a drink ;) -- hikari + * + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * <ph...@lo...> wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp + * ---------------------------------------------------------------------------- + * + */ +#include "config.h" +#include "ircd_crypt.h" +#include "ircd_crypt_smd5.h" +#include "ircd_md5.h" +#include "s_debug.h" +#include "ircd_alloc.h" + +#include <assert.h> +#include <string.h> +#include <unistd.h> + +static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ +"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + +/** Converts a binary value into a BASE64 encoded string. + * @param s Pointer to the output string + * @param v The unsigned long we're working on + * @param n The number of bytes we're working with + * + * This is used to produce the normal MD5 hash everyone is familar with. + * It takes the value v and converts n bytes of it it into an ASCII string in + * 6-bit chunks, the resulting string is put at the address pointed to by s. + * + */ +static void to64(char *s, unsigned long v, int n) +{ + while (--n >= 0) { + *s++ = itoa64[v & 0x3f]; + v >>= 6; + } +} + +/** Produces a Salted MD5 crypt of a password using the supplied salt + * @param key The password we're encrypting + * @param salt The salt we're using to encrypt it + * @return The Salted MD5 password of key and salt + * + * Erm does exactly what the brief comment says. If you think I'm writing a + * description of how MD5 works, you have another thing comming. Go and read + * Applied Cryptopgraphy by Bruce Schneier. The only difference is we use a + * salt at the begining of the password to perturb it so that the same password + * doesn't always produce the same hash. + * + */ +const char* ircd_crypt_smd5(const char* key, const char* salt) +{ +const char *magic = "$1$"; +static char passwd[120]; +char *p; +const char *sp, *ep; +unsigned char final[16]; +int sl, pl, i, j; +MD5_CTX ctx, ctx1; +unsigned long l; + + assert(NULL != key); + assert(NULL != salt); + + Debug((DEBUG_DEBUG, "ircd_crypt_smd5: key = %s", key)); + Debug((DEBUG_DEBUG, "ircd_crypt_smd5: salt = %s", salt)); + + /* Refine the Salt first */ + ep = sp = salt; + + for (ep = sp; *ep && *ep != '$' && ep < (sp + 8); ep++) + continue; + + /* get the length of the true salt */ + sl = ep - sp; + + MD5Init(&ctx); + + /* The password first, since that is what is most unknown */ + MD5Update(&ctx,(unsigned const char *)key,strlen(key)); + + /* Then our magic string */ + MD5Update(&ctx,(unsigned const char *)magic,strlen(magic)); + + /* Then the raw salt */ + MD5Update(&ctx,(unsigned const char *)sp,sl); + + /* Then just as many characters of the MD5(key,salt,key) */ + MD5Init(&ctx1); + MD5Update(&ctx1,(unsigned const char *)key,strlen(key)); + MD5Update(&ctx1,(unsigned const char *)sp,sl); + MD5Update(&ctx1,(unsigned const char *)key,strlen(key)); + MD5Final(final,&ctx1); + for (pl = strlen(key); pl > 0; pl -= 16) + MD5Update(&ctx,(unsigned const char *)final,pl>16 ? 16 : pl); + + /* Don't leave anything around in vm they could use. */ + memset(final, 0, sizeof final); + + /* Then something really weird... */ + for (j = 0, i = strlen(key); i; i >>= 1) + if (i & 1) + MD5Update(&ctx, (unsigned const char *)final+j, 1); + else + MD5Update(&ctx, (unsigned const char *)key+j, 1); + + /* Now make the output string. */ + memset(passwd, 0, 120); + strncpy(passwd, sp, sl); + strcat(passwd, "$"); + + MD5Final(final,&ctx); + + /* + * and now, just to make sure things don't run too fast + * On a 60 Mhz Pentium this takes 34 msec, so you would + * need 30 seconds to build a 1000 entry dictionary... + */ + for (i = 0; i < 1000; i++) { + MD5Init(&ctx1); + + if (i & 1) + MD5Update(&ctx1,(unsigned const char *)key,strlen(key)); + else + MD5Update(&ctx1,(unsigned const char *)final,16); + + if (i % 3) + MD5Update(&ctx1,(unsigned const char *)sp,sl); + + if (i % 7) + MD5Update(&ctx1,(unsigned const char *)key,strlen(key)); + + if (i & 1) + MD5Update(&ctx1,(unsigned const char *)final,16); + else + MD5Update(&ctx1,(unsigned const char *)key,strlen(key)); + + MD5Final(final,&ctx1); + } + + p = passwd + strlen(passwd); + + Debug((DEBUG_DEBUG, "passwd = %s", passwd)); + + /* Turn the encrypted binary data into a BASE64 encoded string we can read + * and display -- hikari */ + l = (final[0] << 16) | (final[6] << 8) | final[12]; + to64(p, l, 4); + p += 4; + l = (final[1] << 16) | (final[7] << 8) | final[13]; + to64(p, l, 4); + p += 4; + l = (final[2] << 16) | (final[8] << 8) | final[14]; + to64(p, l, 4); + p += 4; + l = (final[3] << 16) | (final[9] << 8) | final[15]; + to64(p, l, 4); + p += 4; + l = (final[4] << 16) | (final[10] << 8) | final[5]; + to64(p, l, 4); + p += 4; + l = final[11]; + to64(p, l, 2); + p += 2; + *p = '\0'; + + /* Don't leave anything around in vm they could use. */ + memset(final, 0, sizeof final); + +return passwd; +} + +/* end borrowed code */ + +/** Register ourself with the list of crypt mechanisms + * Registers the SMD5 mechanism in the list of available crypt mechanisms. When + * we're modular this will be the entry function for the module. + * + */ +void ircd_register_crypt_smd5(void) +{ +crypt_mech_t* crypt_mech; + + if ((crypt_mech = (crypt_mech_t*)MyMalloc(sizeof(crypt_mech_t))) == NULL) + { + Debug((DEBUG_MALLOC, "Could not allocate space for crypt_smd5")); + return; + } + + crypt_mech->mechname = "smd5"; + crypt_mech->shortname = "crypt_smd5"; + crypt_mech->description = "Salted MD5 password hash mechanism."; + crypt_mech->crypt_function = &ircd_crypt_smd5; + crypt_mech->crypt_token = "$SMD5$"; + crypt_mech->crypt_token_size = 6 ; + + ircd_crypt_register_mech(crypt_mech); + +return; +} Index: ircd-ircdev/ircd/ircd_events.c diff -u ircd-ircdev/ircd/ircd_events.c:1.3 ircd-ircdev/ircd/ircd_events.c:1.4 --- ircd-ircdev/ircd/ircd_events.c:1.3 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/ircd_events.c Wed Nov 24 08:05:00 2004 @@ -18,8 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: ircd_events.c,v 1.3 2004/02/22 16:11:42 zolty Exp $ - * + */ +/** @file + * @brief Implementation of event loop mid-layer. + * @version $Id: ircd_events.c,v 1.4 2004/11/24 16:05:00 zolty Exp $ */ #include "config.h" @@ -36,13 +38,14 @@ #include <stdlib.h> #include <unistd.h> -#define SIGS_PER_SOCK 10 /* number of signals to process per socket +#define SIGS_PER_SOCK 10 /**< number of signals to process per socket readable event */ #ifdef USE_KQUEUE extern struct Engine engine_kqueue; #define ENGINE_KQUEUE &engine_kqueue, #else +/** Address of kqueue engine (if used). */ #define ENGINE_KQUEUE #endif /* USE_KQUEUE */ @@ -50,6 +53,7 @@ extern struct Engine engine_devpoll; #define ENGINE_DEVPOLL &engine_devpoll, #else +/** Address of /dev/poll engine (if used). */ #define ENGINE_DEVPOLL #endif /* USE_DEVPOLL */ @@ -57,18 +61,21 @@ extern struct Engine engine_epoll; #define ENGINE_EPOLL &engine_epoll, #else +/** Address of epoll engine (if used). */ #define ENGINE_EPOLL #endif /* USE_EPOLL */ #ifdef USE_POLL extern struct Engine engine_poll; +/** Address of fallback (poll) engine. */ #define ENGINE_FALLBACK &engine_poll, #else extern struct Engine engine_select; +/** Address of fallback (select) engine. */ #define ENGINE_FALLBACK &engine_select, #endif /* USE_POLL */ -/* list of engines to try */ +/** list of engines to try */ static const struct Engine *evEngines[] = { ENGINE_KQUEUE ENGINE_EPOLL @@ -77,22 +84,25 @@ 0 }; -/* signal routines pipe data */ +/** Signal routines pipe data. + * This is used if an engine does not implement signal handling itself + * (when Engine::eng_signal is NULL). + */ static struct { - int fd; /* signal routine's fd */ - struct Socket sock; /* and its struct Socket */ + int fd; /**< signal routine's fd */ + struct Socket sock; /**< and its struct Socket */ } sigInfo = { -1 }; -/* All the thread info */ +/** All the thread info */ static struct { - struct Generators gens; /* List of all generators */ - struct Event* events_free; /* struct Event free list */ - unsigned int events_alloc; /* count of allocated struct Events */ - const struct Engine* engine; /* core engine being used */ + struct Generators gens; /**< List of all generators */ + struct Event* events_free; /**< struct Event free list */ + unsigned int events_alloc; /**< count of allocated struct Events */ + const struct Engine* engine; /**< core engine being used */ #ifdef IRCD_THREADED - struct GenHeader* genq_head; /* head of generator event queue */ - struct GenHeader* genq_tail; /* tail of generator event queue */ - unsigned int genq_count; /* count of generators on queue */ + struct GenHeader* genq_head; /**< head of generator event queue */ + struct GenHeader* genq_tail; /**< tail of generator event queue */ + unsigned int genq_count; /**< count of generators on queue */ #en... [truncated message content] |
From: Toni G. <zo...@us...> - 2004-11-24 16:03:58
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-11-24 16:03:38 UTC Modified files: ircd/s_auth.c ircd/s_bsd.c ircd/s_conf.c ircd/s_debug.c ircd/s_err.c ircd/s_misc.c ircd/s_numeric.c ircd/s_serv.c ircd/s_stats.c ircd/s_user.c Log message: Author: zoltan <zo...@ir...> Log message: 2004-11-24 Toni García <zo...@ir...> 1.0.alpha13 * Comentarios para Doxygen * Excepciones de Silences * Soporte total de IPv6 * Sincronizacion Undernet ---------------------- diff included ---------------------- Index: ircd-ircdev/ircd/s_auth.c diff -u ircd-ircdev/ircd/s_auth.c:1.4 ircd-ircdev/ircd/s_auth.c:1.5 --- ircd-ircdev/ircd/s_auth.c:1.4 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/s_auth.c Wed Nov 24 08:03:18 2004 @@ -19,8 +19,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: s_auth.c,v 1.4 2004/02/22 16:11:42 zolty Exp $ - * + */ +/** @file + * @brief Implementation of DNS and ident lookups. + * @version $Id: s_auth.c,v 1.5 2004/11/24 16:03:18 zolty Exp $ */ #include "config.h" @@ -59,27 +61,27 @@ #include <sys/file.h> #include <sys/ioctl.h> -/* - * a bit different approach - * this replaces the original sendheader macros - */ +/** Array of message text (with length) pairs for AUTH status + * messages. Indexed using #ReportType. */ static struct { const char* message; unsigned int length; } HeaderMessages [] = { - /* 123456789012345678901234567890123456789012345678901234567890 */ - { "NOTICE AUTH :*** Looking up your hostname\r\n", 43 }, - { "NOTICE AUTH :*** Found your hostname\r\n", 38 }, - { "NOTICE AUTH :*** Found your hostname, cached\r\n", 46 }, - { "NOTICE AUTH :*** Couldn't look up your hostname\r\n", 49 }, - { "NOTICE AUTH :*** Checking Ident\r\n", 33 }, - { "NOTICE AUTH :*** Got ident response\r\n", 37 }, - { "NOTICE AUTH :*** No ident response\r\n", 36 }, - { "NOTICE AUTH :*** Your forward and reverse DNS do not match, " \ - "ignoring hostname.\r\n", 80 }, - { "NOTICE AUTH :*** Invalid hostname\r\n", 35 } +#define MSG(STR) { STR, sizeof(STR) - 1 } + MSG("NOTICE AUTH :*** Looking up your hostname\r\n"), + MSG("NOTICE AUTH :*** Found your hostname\r\n"), + MSG("NOTICE AUTH :*** Found your hostname, cached\r\n"), + MSG("NOTICE AUTH :*** Couldn't look up your hostname\r\n"), + MSG("NOTICE AUTH :*** Checking Ident\r\n"), + MSG("NOTICE AUTH :*** Got ident response\r\n"), + MSG("NOTICE AUTH :*** No ident response\r\n"), + MSG("NOTICE AUTH :*** Your forward and reverse DNS do not match, " + "ignoring hostname.\r\n"), + MSG("NOTICE AUTH :*** Invalid hostname\r\n") +#undef MSG }; +/** Enum used to index messages in the HeaderMessages[] array. */ typedef enum { REPORT_DO_DNS, REPORT_FIN_DNS, @@ -92,22 +94,21 @@ REPORT_INVAL_DNS } ReportType; +/** Sends response \a r (from #ReportType) to client \a c. */ #define sendheader(c, r) \ send(cli_fd(c), HeaderMessages[(r)].message, HeaderMessages[(r)].length, 0) -struct AuthRequest* AuthPollList = 0; /* GLOBAL - auth queries pending io */ -static struct AuthRequest* AuthIncompleteList = 0; - static void release_auth_client(struct Client* client); -static void unlink_auth_request(struct AuthRequest* request, - struct AuthRequest** list); void free_auth_request(struct AuthRequest* auth); -/* auth_verify_hostname - verify that a hostname is valid, i.e., only - * contains characters valid for a hostname and that a hostname is not - * too long. +/** Verify that a hostname is valid, i.e., only contains characters + * valid for a hostname and that a hostname is not too long. + * @param host Hostname to check. + * @param maxlen Maximum length of hostname, not including NUL terminator. + * @return Non-zero if the hostname is valid. */ -static int auth_verify_hostname(char *host, int maxlen) +static int +auth_verify_hostname(char *host, int maxlen) { int i; @@ -120,8 +121,9 @@ return 1; /* it's a valid hostname */ } -/* - * auth_timeout - timeout a given auth request +/** Timeout a given auth request. + * @param ev A timer event whose associated data is the expired struct + * AuthRequest. */ static void auth_timeout_callback(struct Event* ev) { @@ -130,7 +132,7 @@ assert(0 != ev_timer(ev)); assert(0 != t_data(ev_timer(ev))); - auth = (struct AuthRequest *)t_data(ev_timer(ev)); + auth = (struct AuthRequest*) t_data(ev_timer(ev)); if (ev_type(ev) == ET_DESTROY) { /* being destroyed */ auth->flags &= ~AM_TIMEOUT; @@ -147,8 +149,9 @@ } } -/* - * auth_sock_callback - called when an event occurs on the socket +/** Handle socket I/O activity. + * @param ev A socket event whos associated data is the active struct + * AuthRequest. */ static void auth_sock_callback(struct Event* ev) { @@ -157,7 +160,7 @@ assert(0 != ev_socket(ev)); assert(0 != s_data(ev_socket(ev))); - auth = (struct AuthRequest *)s_data(ev_socket(ev)); + auth = (struct AuthRequest*) s_data(ev_socket(ev)); switch (ev_type(ev)) { case ET_DESTROY: /* being destroyed */ @@ -185,22 +188,19 @@ break; default: -#ifndef NDEBUG - abort(); /* unrecognized event */ -#endif + assert(0 && "Unrecognized event in auth_socket_callback()."); break; } } -/* - * destroy_auth_request - stop an auth request completely +/** Stop an auth request completely. + * @param auth The struct AuthRequest to cancel. + * @param send_reports If non-zero, report the failure to the user and + * resolver log. */ void destroy_auth_request(struct AuthRequest* auth, int send_reports) { - struct AuthRequest** authList; - if (IsDoingAuth(auth)) { - authList = &AuthPollList; if (-1 < auth->fd) { close(auth->fd); auth->fd = -1; @@ -209,8 +209,7 @@ if (send_reports && IsUserPort(auth->client)) sendheader(auth->client, REPORT_FAIL_ID); - } else - authList = &AuthIncompleteList; + } if (IsDNSPending(auth)) { delete_resolver_queries(auth); @@ -224,12 +223,12 @@ release_auth_client(auth->client); } - unlink_auth_request(auth, authList); free_auth_request(auth); } -/* - * make_auth_request - allocate a new auth request +/** Allocate a new auth request. + * @param client The client being looked up. + * @return The newly allocated auth request. */ static struct AuthRequest* make_auth_request(struct Client* client) { @@ -246,8 +245,8 @@ return auth; } -/* - * free_auth_request - cleanup auth request allocations +/** Clean up auth request allocations (event loop objects, etc). + * @param auth The request to clean up. */ void free_auth_request(struct AuthRequest* auth) { @@ -260,37 +259,10 @@ timer_del(&auth->timeout); } -/* - * unlink_auth_request - remove auth request from a list - */ -static void unlink_auth_request(struct AuthRequest* request, - struct AuthRequest** list) -{ - if (request->next) - request->next->prev = request->prev; - if (request->prev) - request->prev->next = request->next; - else - *list = request->next; -} - -/* - * link_auth_request - add auth request to a list - */ -static void link_auth_request(struct AuthRequest* request, - struct AuthRequest** list) -{ - request->prev = 0; - request->next = *list; - if (*list) - (*list)->prev = request; - *list = request; -} - -/* - * release_auth_client - release auth client from auth system - * this adds the client into the local client lists so it can be read by - * the main io processing loop +/** Release auth client from auth system. This adds the client into + * the local client lists so it can be read by the main io processing + * loop. + * @param client The client to release. */ static void release_auth_client(struct Client* client) { @@ -306,13 +278,14 @@ Debug((DEBUG_INFO, "Auth: release_auth_client %s@%s[%s]", cli_username(client), cli_sockhost(client), cli_sock_ip(client))); } - + +/** Terminate a client's connection due to auth failure. + * @param auth The client to terminate. + */ static void auth_kill_client(struct AuthRequest* auth) { assert(0 != auth); - unlink_auth_request(auth, (IsDoingAuth(auth)) ? &AuthPollList : &AuthIncompleteList); - if (IsDNSPending(auth)) delete_resolver_queries(auth); IPcheck_disconnect(auth->client); @@ -322,18 +295,16 @@ free_auth_request(auth); } -/* - * auth_dns_callback - called when resolver query finishes - * if the query resulted in a successful search, hp will contain - * a non-null pointer, otherwise hp will be null. - * set the client on it's way to a connection completion, regardless - * of success of failure +/** Handle a complete DNS lookup. Send the client on it's way to a + * connection completion, regardless of success or failure -- unless + * there was a mismatch and KILL_IPMISMATCH is set. + * @param vptr The pending struct AuthRequest. + * @param hp Pointer to the DNS reply (or NULL, if lookup failed). */ -static void auth_dns_callback(void* vptr, struct hostent* hp) +static void auth_dns_callback(void* vptr, struct DNSReply* hp) { struct AuthRequest* auth = (struct AuthRequest*) vptr; - - assert(0 != auth); + assert(auth); /* * need to do this here so auth_kill_client doesn't * try have the resolver delete the query it's about @@ -342,30 +313,28 @@ ClearDNSPending(auth); if (hp) { - int i; /* * Verify that the host to ip mapping is correct both ways and that * the ip#(s) for the socket is listed for the host. */ - for (i = 0; hp->h_addr_list[i]; ++i) { - if (0 == memcmp(hp->h_addr_list[i], &(cli_ip(auth->client)), - sizeof(struct in_addr))) - break; - } - if (!hp->h_addr_list[i]) { + if (irc_in_addr_cmp(&hp->addr, &cli_ip(auth->client))) { if (IsUserPort(auth->client)) sendheader(auth->client, REPORT_IP_MISMATCH); sendto_opmask_butone(0, SNO_IPMISMATCH, "IP# Mismatch: %s != %s[%s]", - cli_sock_ip(auth->client), hp->h_name, - ircd_ntoa(hp->h_addr_list[0])); + cli_sock_ip(auth->client), hp->h_name, + ircd_ntoa(&hp->addr)); if (feature_bool(FEAT_KILL_IPMISMATCH)) { auth_kill_client(auth); return; } - } else if (!auth_verify_hostname(hp->h_name, HOSTLEN)) { + } + else if (!auth_verify_hostname(hp->h_name, HOSTLEN)) + { if (IsUserPort(auth->client)) sendheader(auth->client, REPORT_INVAL_DNS); - } else { + } + else + { cli_dns_reply(auth->client) = hp; ircd_strncpy(cli_sockhost(auth->client), hp->h_name, HOSTLEN); if (IsUserPort(auth->client)) @@ -383,13 +352,13 @@ } if (!IsDoingAuth(auth)) { release_auth_client(auth->client); - unlink_auth_request(auth, &AuthIncompleteList); free_auth_request(auth); } } -/* - * authsenderr - handle auth send errors +/** Handle auth send errors. + * @param auth The request that saw the failure. + * @param kill If non-zero, a critical error; close the client's connection. */ static void auth_error(struct AuthRequest* auth, int kill) { @@ -415,66 +384,47 @@ } ClearAuth(auth); - unlink_auth_request(auth, &AuthPollList); - if (IsDNSPending(auth)) - link_auth_request(auth, &AuthIncompleteList); - else { + if (!IsDNSPending(auth)) { release_auth_client(auth->client); free_auth_request(auth); } } -/* - * start_auth_query - Flag the client to show that an attempt to - * contact the ident server on the client's host. The connect and - * subsequently the socket are all put into 'non-blocking' mode. - * Should the connect or any later phase of the identifing process fail, - * it is aborted and the user is given a username of "unknown". +/** Flag the client to show an attempt to contact the ident server on + * the client's host. Should the connect or any later phase of the + * identifing process fail, it is aborted and the user is given a + * username of "unknown". + * @param auth The request for which to start the ident lookup. + * @return Non-zero on success; zero if unable to start the lookup. */ static int start_auth_query(struct AuthRequest* auth) { - struct sockaddr_in remote_addr; - struct sockaddr_in local_addr; + struct irc_sockaddr remote_addr; + struct irc_sockaddr local_addr; int fd; IOResult result; assert(0 != auth); assert(0 != auth->client); - if ((fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) { - ++ServerStats->is_abad; - return 0; - } - if ((MAXCONNECTIONS - 10) < fd) { - close(fd); - return 0; - } - if (!os_set_nonblocking(fd)) { - close(fd); - return 0; - } - if (IsUserPort(auth->client)) - sendheader(auth->client, REPORT_DO_ID); - /* + /* * get the local address of the client and bind to that to * make the auth request. This used to be done only for * ifdef VIRTTUAL_HOST, but needs to be done for all clients * since the ident request must originate from that same address-- * and machines with multiple IP addresses are common now */ - memset(&local_addr, 0, sizeof(struct sockaddr_in)); + memset(&local_addr, 0, sizeof(local_addr)); os_get_sockname(cli_fd(auth->client), &local_addr); - local_addr.sin_port = htons(0); - - if (bind(fd, (struct sockaddr*) &local_addr, sizeof(struct sockaddr_in))) { - close(fd); + local_addr.port = 0; + fd = os_socket(&local_addr, SOCK_STREAM, "auth query"); + if (fd < 0) return 0; - } - - remote_addr.sin_addr.s_addr = (cli_ip(auth->client)).s_addr; - remote_addr.sin_port = htons(113); - remote_addr.sin_family = AF_INET; + if (IsUserPort(auth->client)) + sendheader(auth->client, REPORT_DO_ID); + memcpy(&remote_addr.addr, &cli_ip(auth->client), sizeof(remote_addr.addr)); + remote_addr.port = 113; if ((result = os_connect_nonb(fd, &remote_addr)) == IO_FAILURE || !socket_add(&auth->socket, auth_sock_callback, (void*) auth, @@ -500,7 +450,7 @@ return 1; } - +/** Enum used to index ident reply fields in a human-readable way. */ enum IdentReplyFields { IDENT_PORT_NUMBERS, IDENT_REPLY_TYPE, @@ -509,6 +459,10 @@ USERID_TOKEN_COUNT }; +/** Parse an ident reply line and extract the userid from it. + * @param reply The ident reply line. + * @return The userid, or NULL on parse failure. + */ static char* check_ident_reply(char* reply) { char* token; @@ -577,11 +531,9 @@ return token; } -/* - * start_auth - starts auth (identd) and dns queries for a client +/** Starts auth (identd) and dns queries for a client. + * @param client The client for which to start queries. */ -enum { LOOPBACK = 127 }; - void start_auth(struct Client* client) { struct AuthRequest* auth = 0; @@ -594,7 +546,7 @@ Debug((DEBUG_INFO, "Beginning auth request on client %p", client)); if (!feature_bool(FEAT_NODNS)) { - if (LOOPBACK == inet_netof(cli_ip(client))) + if (irc_in_addr_is_loopback(&cli_ip(client))) strcpy(cli_sockhost(client), cli_name(&me)); else { struct DNSQuery query; @@ -605,7 +557,7 @@ if (IsUserPort(auth->client)) sendheader(client, REPORT_DO_DNS); - gethost_byaddr((const char*) &(cli_ip(client)), &query); + gethost_byaddr(&cli_ip(client), &query); SetDNSPending(auth); } } @@ -613,11 +565,9 @@ if (start_auth_query(auth)) { Debug((DEBUG_LIST, "identd query for %p initiated successfully", auth->client)); - link_auth_request(auth, &AuthPollList); } else if (IsDNSPending(auth)) { Debug((DEBUG_LIST, "identd query for %p not initiated successfully; " "waiting on DNS", auth->client)); - link_auth_request(auth, &AuthIncompleteList); } else { Debug((DEBUG_LIST, "identd query for %p not initiated successfully; " "no DNS pending; releasing immediately", auth->client)); @@ -626,17 +576,17 @@ } } -/* - * send_auth_query - send the ident server a query giving "theirport , ourport" - * The write is only attempted *once* so it is deemed to be a fail if the +/** Send the ident server a query giving "theirport , ourport". The + * write is only attempted *once* so it is deemed to be a fail if the * entire write doesn't write all the data given. This shouldnt be a - * problem since the socket should have a write buffer far greater than - * this message to store it in should problems arise. -avalon + * problem since the socket should have a write buffer far greater + * than this message to store it in should problems arise. -avalon + * @param auth The request to send. */ void send_auth_query(struct AuthRequest* auth) { - struct sockaddr_in us; - struct sockaddr_in them; + struct irc_sockaddr us; + struct irc_sockaddr them; char authbuf[32]; unsigned int count; @@ -649,8 +599,8 @@ return; } ircd_snprintf(0, authbuf, sizeof(authbuf), "%u , %u\r\n", - (unsigned int) ntohs(them.sin_port), - (unsigned int) ntohs(us.sin_port)); + (unsigned int) them.port, + (unsigned int) us.port); if (IO_SUCCESS == os_send_nonb(auth->fd, authbuf, strlen(authbuf), &count)) { ClearAuthConnect(auth); @@ -661,11 +611,10 @@ } -/* - * read_auth_reply - read the reply (if any) from the ident server - * we connected to. - * We only give it one shot, if the reply isn't good the first time - * fail the authentication entirely. --Bleep +/** Read the reply (if any) from the ident server we connected to. We + * only give it one shot, if the reply isn't good the first time fail + * the authentication entirely. --Bleep + * @param auth The request to read. */ void read_auth_reply(struct AuthRequest* auth) { @@ -692,7 +641,7 @@ Debug((DEBUG_LIST, "Deleting auth [%p] socket %p", auth, &auth->socket)); socket_del(&auth->socket); ClearAuth(auth); - + if (!EmptyString(username)) { ircd_strncpy(cli_username(auth->client), username, USERLEN); /* @@ -707,11 +656,8 @@ else { ++ServerStats->is_abad; } - unlink_auth_request(auth, &AuthPollList); - if (IsDNSPending(auth)) - link_auth_request(auth, &AuthIncompleteList); - else { + if (!IsDNSPending(auth)) { release_auth_client(auth->client); free_auth_request(auth); } Index: ircd-ircdev/ircd/s_bsd.c diff -u ircd-ircdev/ircd/s_bsd.c:1.5 ircd-ircdev/ircd/s_bsd.c:1.6 --- ircd-ircdev/ircd/s_bsd.c:1.5 Wed Nov 17 03:45:50 2004 +++ ircd-ircdev/ircd/s_bsd.c Wed Nov 24 08:03:28 2004 @@ -18,8 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: s_bsd.c,v 1.5 2004/11/17 11:45:50 zolty Exp $ - * + */ +/** @file + * @brief Functions that now (or in the past) relied on BSD APIs. + * @version $Id: s_bsd.c,v 1.6 2004/11/24 16:03:28 zolty Exp $ */ #include "config.h" @@ -54,18 +56,15 @@ #include "s_user.h" #include "send.h" #include "struct.h" -#include "support.h" #include "sys.h" #include "uping.h" #include "version.h" #include <arpa/inet.h> -#include <arpa/nameser.h> #include <assert.h> #include <errno.h> #include <fcntl.h> #include <netdb.h> -#include <resolv.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -79,13 +78,13 @@ #include <sys/poll.h> #endif /* USE_POLL */ -#ifndef INADDR_NONE -#define INADDR_NONE 0xffffffff -#endif - +/** Array of my own clients, indexed by file descriptor. */ struct Client* LocalClientArray[MAXCONNECTIONS]; +/** Maximum file descriptor in current use. */ int HighestFd = -1; -struct sockaddr_in VirtualHost; +/** Default local address for outbound connections. */ +struct irc_sockaddr VirtualHost; +/** Temporary buffer for reading data from a peer. */ static char readbuf[SERVER_TCP_WINDOW]; /* @@ -135,19 +134,14 @@ * been reassigned to a normal connection... */ -/* - * report_error - * - * This a replacement for perror(). Record error to log and - * also send a copy to all *LOCAL* opers online. - * - * text is a *format* string for outputting error. It must - * contain only two '%s', the first will be replaced - * by the sockhost from the cptr, and the latter will - * be taken from sys_errlist[errno]. - * - * cptr if not NULL, is the *LOCAL* client associated with - * the error. +/** Replacement for perror(). Record error to log. Send a copy to all + * *LOCAL* opers, but only if no errors were sent to them in the last + * 20 seconds. + * @param text A *format* string for outputting error. It must contain + * only two '%s', the first will be replaced by the sockhost from the + * cptr, and the latter will be taken from sys_errlist[errno]. + * @param who The client associated with the error. + * @param err The errno value to display. */ void report_error(const char* text, const char* who, int err) { @@ -173,19 +167,19 @@ } -/* - * connect_dns_callback - called when resolver query finishes - * if the query resulted in a successful search, reply will contain - * a non-null pointer, otherwise reply will be null. - * if successful start the connection, otherwise notify opers +/** Called when resolver query finishes. If the DNS lookup was + * successful, start the connection; otherwise notify opers of the + * failure. + * @param vptr The struct ConfItem representing the Connect block. + * @param hp A pointer to the DNS lookup results (NULL on failure). */ -static void connect_dns_callback(void* vptr, struct hostent* hp) +static void connect_dns_callback(void* vptr, struct DNSReply* hp) { struct ConfItem* aconf = (struct ConfItem*) vptr; assert(aconf); aconf->dns_pending = 0; if (hp) { - memcpy(&aconf->ipnum, hp->h_addr, sizeof(struct in_addr)); + memcpy(&aconf->address, &hp->addr, sizeof(aconf->address)); MyFree(hp); connect_server(aconf, 0); } @@ -194,9 +188,8 @@ aconf->name); } -/* - * close_connections - closes all connections - * close stderr if specified +/** Closes all file descriptors. + * @param close_stderr If non-zero, also close stderr. */ void close_connections(int close_stderr) { @@ -209,9 +202,7 @@ close(i); } -/* - * init_connection_limits - initialize process fd limit to - * MAXCONNECTIONS +/** Initialize process fd limit to MAXCONNECTIONS. */ int init_connection_limits(void) { @@ -229,12 +220,14 @@ return 0; } -/* - * connect_inet - set up address and port and make a connection +/** Set up address and port and make a connection. + * @param aconf Provides the connection information. + * @param cptr Client structure for the peer. + * @return Non-zero on success; zero on failure. */ static int connect_inet(struct ConfItem* aconf, struct Client* cptr) { - static struct sockaddr_in sin, *locaddr = 0; + const struct irc_sockaddr *local; IOResult result; assert(0 != aconf); assert(0 != cptr); @@ -242,61 +235,19 @@ * Might as well get sockhost from here, the connection is attempted * with it so if it fails its useless. */ - cli_fd(cptr) = socket(AF_INET, SOCK_STREAM, 0); - if (-1 == cli_fd(cptr)) { - cli_error(cptr) = errno; - report_error(SOCKET_ERROR_MSG, cli_name(cptr), errno); - return 0; - } - if (cli_fd(cptr) >= MAXCLIENTS) { - report_error(CONNLIMIT_ERROR_MSG, cli_name(cptr), 0); - close(cli_fd(cptr)); - cli_fd(cptr) = -1; - return 0; - } - /* - * Bind to a local IP# (with unknown port - let unix decide) so - * we have some chance of knowing the IP# that gets used for a host - * with more than one IP#. - * - * No we don't bind it, not all OS's can handle connecting with - * an already bound socket, different ip# might occur anyway - * leading to a freezing select() on this side for some time. - * I had this on my Linux 1.1.88 --Run - */ - - /* - * No, we do bind it if we have virtual host support. If we don't - * explicitly bind it, it will default to IN_ADDR_ANY and we lose - * due to the other server not allowing our base IP --smg - */ - if (aconf->origin.s_addr != INADDR_NONE) { - memset(&sin, 0, sizeof(sin)); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = aconf->origin.s_addr; - locaddr = &sin; - } else if (feature_bool(FEAT_VIRTUAL_HOST)) - locaddr = &VirtualHost; - - if (locaddr && - bind(cli_fd(cptr), (struct sockaddr*) locaddr, - sizeof(struct sockaddr_in))) { - report_error(BIND_ERROR_MSG, cli_name(cptr), errno); - close(cli_fd(cptr)); - cli_fd(cptr) = -1; + if (irc_in_addr_valid(&aconf->origin.addr)) + local = &aconf->origin; + else + local = &VirtualHost; + cli_fd(cptr) = os_socket(local, SOCK_STREAM, cli_name(cptr)); + if (cli_fd(cptr) < 0) return 0; - } - memset(&sin, 0, sizeof(sin)); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = aconf->ipnum.s_addr; - sin.sin_port = htons(aconf->port); /* * save connection info in client */ - (cli_ip(cptr)).s_addr = aconf->ipnum.s_addr; - cli_port(cptr) = aconf->port; - ircd_ntoa_r(cli_sock_ip(cptr), (const char*) &(cli_ip(cptr))); + memcpy(&cli_ip(cptr), &aconf->address.addr, sizeof(cli_ip(cptr))); + ircd_ntoa_r(cli_sock_ip(cptr), &cli_ip(cptr)); /* * we want a big buffer for server connections */ @@ -307,17 +258,7 @@ cli_fd(cptr) = -1; return 0; } - /* - * ALWAYS set sockets non-blocking - */ - if (!os_set_nonblocking(cli_fd(cptr))) { - cli_error(cptr) = errno; - report_error(NONB_ERROR_MSG, cli_name(cptr), errno); - close(cli_fd(cptr)); - cli_fd(cptr) = -1; - return 0; - } - if ((result = os_connect_nonb(cli_fd(cptr), &sin)) == IO_FAILURE) { + if ((result = os_connect_nonb(cli_fd(cptr), &aconf->address)) == IO_FAILURE) { cli_error(cptr) = errno; report_error(CONNECT_ERROR_MSG, cli_name(cptr), errno); close(cli_fd(cptr)); @@ -338,28 +279,13 @@ return 1; } -/* - * deliver_it - * Attempt to send a sequence of bytes to the connection. - * Returns - * - * < 0 Some fatal error occurred, (but not EWOULDBLOCK). - * This return is a request to close the socket and - * clean up the link. - * - * >= 0 No real error occurred, returns the number of - * bytes actually transferred. EWOULDBLOCK and other - * possibly similar conditions should be mapped to - * zero return. Upper level routine will have to - * decide what to do with those unwritten bytes... - * - * *NOTE* alarm calls have been preserved, so this should - * work equally well whether blocking or non-blocking - * mode is used... - * - * We don't use blocking anymore, that is impossible with the - * net.loads today anyway. Commented out the alarms to save cpu. - * --Run +/** Attempt to send a sequence of bytes to the connection. + * As a side effect, updates \a cptr's FLAG_BLOCKED setting + * and sendB/sendK fields. + * @param cptr Client that should receive data. + * @param buf Message buffer to send to client. + * @return Negative on connection-fatal error; otherwise + * number of bytes sent. */ unsigned int deliver_it(struct Client *cptr, struct MsgQ *buf) { @@ -373,18 +299,7 @@ cli_sendB(cptr) += bytes_written; cli_sendB(&me) += bytes_written; - if (cli_sendB(cptr) > 1023) { - cli_sendK(cptr) += (cli_sendB(cptr) >> 10); - cli_sendB(cptr) &= 0x03ff; /* 2^10 = 1024, 3ff = 1023 */ - } - if (cli_sendB(&me) > 1023) { - cli_sendK(&me) += (cli_sendB(&me) >> 10); - cli_sendB(&me) &= 0x03ff; - } - /* - * XXX - hrmm.. set blocked here? the socket didn't - * say it was blocked - */ + /* A partial write implies that future writes will block. */ if (bytes_written < bytes_count) SetFlag(cptr, FLAG_BLOCKED); break; @@ -399,26 +314,25 @@ return bytes_written; } - +/** Free the client's DNS reply, if any. + * @param cptr Client to operate on. + */ void release_dns_reply(struct Client* cptr) { assert(0 != cptr); assert(MyConnect(cptr)); if (cli_dns_reply(cptr)) { + MyFree(cli_dns_reply(cptr)->h_name); MyFree(cli_dns_reply(cptr)); cli_dns_reply(cptr) = 0; } } -/* - * completed_connection - * - * Complete non-blocking connect()-sequence. Check access and +/** Complete non-blocking connect()-sequence. Check access and * terminate connection, if trouble detected. - * - * Return TRUE, if successfully completed - * FALSE, if failed and ClientExit + * @param cptr Client to which we have connected, with all Confitem structs attached. + * @return Zero on failure (caller should exit_client()), non-zero on success. */ static int completed_connection(struct Client* cptr) { @@ -480,11 +394,9 @@ return (IsDead(cptr)) ? 0 : 1; } -/* - * close_connection - * - * Close the physical connection. This function must make - * MyConnect(cptr) == FALSE, and set cptr->from == NULL. +/** Close the physical connection. Side effects: MyConnect(cptr) + * becomes false and cptr->from becomes NULL. + * @param cptr Client to disconnect. */ void close_connection(struct Client *cptr) { @@ -494,22 +406,12 @@ ServerStats->is_sv++; ServerStats->is_sbs += cli_sendB(cptr); ServerStats->is_sbr += cli_receiveB(cptr); - ServerStats->is_sks += cli_sendK(cptr); - ServerStats->is_skr += cli_receiveK(cptr); ServerStats->is_sti += CurrentTime - cli_firsttime(cptr); - if (ServerStats->is_sbs > 1023) { - ServerStats->is_sks += (ServerStats->is_sbs >> 10); - ServerStats->is_sbs &= 0x3ff; - } - if (ServerStats->is_sbr > 1023) { - ServerStats->is_skr += (ServerStats->is_sbr >> 10); - ServerStats->is_sbr &= 0x3ff; - } /* * If the connection has been up for a long amount of time, schedule * a 'quick' reconnect, else reset the next-connect cycle. */ - if ((aconf = find_conf_exact(cli_name(cptr), 0, cli_sockhost(cptr), CONF_SERVER))) { + if ((aconf = find_conf_exact(cli_name(cptr), cptr, CONF_SERVER))) { /* * Reschedule a faster reconnect, if this was a automaticly * connected configuration entry. (Note that if we have had @@ -528,17 +430,7 @@ ServerStats->is_cl++; ServerStats->is_cbs += cli_sendB(cptr); ServerStats->is_cbr += cli_receiveB(cptr); - ServerStats->is_cks += cli_sendK(cptr); - ServerStats->is_ckr += cli_receiveK(cptr); ServerStats->is_cti += CurrentTime - cli_firsttime(cptr); - if (ServerStats->is_cbs > 1023) { - ServerStats->is_cks += (ServerStats->is_cbs >> 10); - ServerStats->is_cbs &= 0x3ff; - } - if (ServerStats->is_cbr > 1023) { - ServerStats->is_ckr += (ServerStats->is_cbr >> 10); - ServerStats->is_cbr &= 0x3ff; - } } else ServerStats->is_ni++; @@ -571,6 +463,10 @@ } } +/** Close all unregistered connections. + * @param source Oper who requested the close. + * @return Number of closed connections. + */ int net_close_unregistered_connections(struct Client* source) { int i; @@ -588,16 +484,15 @@ return count; } -/*---------------------------------------------------------------------------- - * add_connection - * - * Creates a client which has just connected to us on the given fd. +/** Creates a client which has just connected to us on the given fd. * The sockhost field is initialized with the ip# of the host. * The client is not added to the linked list of clients, it is * passed off to the auth handler for dns and ident queries. - *--------------------------------------------------------------------------*/ + * @param listener Listening socket that received the connection. + * @param fd File descriptor of new connection. + */ void add_connection(struct Listener* listener, int fd) { - struct sockaddr_in addr; + struct irc_sockaddr addr; struct Client *new_client; time_t next_target = 0; @@ -606,14 +501,13 @@ /* 12345678901234567890123456789012345679012345678901234567890123456 */ const char* const register_message = "ERROR :Unable to complete your registration\r\n"; - + assert(0 != listener); - /* * Removed preliminary access check. Full check is performed in m_server and * m_user instead. Also connection time out help to get rid of unwanted - * connections. + * connections. */ if (!os_get_peername(fd, &addr) || !os_set_nonblocking(fd)) { ++ServerStats->is_ref; @@ -636,25 +530,25 @@ * * If they're throttled, murder them, but tell them why first. */ - if (!IPcheck_local_connect(addr.sin_addr, &next_target) && !listener->server) { + if (!IPcheck_local_connect(&addr.addr, &next_target) && !listener->server) + { ++ServerStats->is_ref; - write(fd, throttle_message, strlen(throttle_message)); - close(fd); - return; + write(fd, throttle_message, strlen(throttle_message)); + close(fd); + return; } - new_client = make_client(0, ((listener->server) ? + new_client = make_client(0, ((listener->server) ? STAT_UNKNOWN_SERVER : STAT_UNKNOWN_USER)); /* * Copy ascii address to 'sockhost' just in case. Then we have something - * valid to put into error messages... + * valid to put into error messages... */ SetIPChecked(new_client); - ircd_ntoa_r(cli_sock_ip(new_client), (const char*) &addr.sin_addr); + ircd_ntoa_r(cli_sock_ip(new_client), &addr.addr); strcpy(cli_sockhost(new_client), cli_sock_ip(new_client)); - (cli_ip(new_client)).s_addr = addr.sin_addr.s_addr; - cli_port(new_client) = ntohs(addr.sin_port); + memcpy(&cli_ip(new_client), &addr.addr, sizeof(cli_ip(new_client))); if (next_target) cli_nexttarget(new_client) = next_target; @@ -677,11 +571,9 @@ start_auth(new_client); } -/* - * update_write - * - * Determines whether to tell the events engine we're interested in - * writable events +/** Determines whether to tell the events engine we're interested in + * writable events. + * @param cptr Client for which to decide this. */ void update_write(struct Client* cptr) { @@ -695,16 +587,16 @@ SOCK_ACTION_ADD : SOCK_ACTION_DEL) | SOCK_EVENT_WRITABLE); } -/* - * read_packet - * - * Read a 'packet' of data from a connection and process it. Read in 8k - * chunks to give a better performance rating (for server connections). - * Do some tricky stuff for client connections to make sure they don't do - * any flooding >:-) -avalon +/** Read a 'packet' of data from a connection and process it. Read in + * 8k chunks to give a better performance rating (for server + * connections). Do some tricky stuff for client connections to make + * sure they don't do any flooding >:-) -avalon + * @param cptr Client from which to read data. + * @param socket_ready If non-zero, more data can be read from the client's socket. + * @return Positive number on success, zero on connection-fatal failure, negative + * if user is killed. */ -static int -read_packet(struct Client *cptr, int socket_ready) +static int read_packet(struct Client *cptr, int socket_ready) { unsigned int dolen = 0; unsigned int length = 0; @@ -714,7 +606,8 @@ DBufLength(&(cli_recvQ(cptr))) > feature_int(FEAT_CLIENT_FLOOD))) { switch (os_recv_nonb(cli_fd(cptr), readbuf, sizeof(readbuf), &length)) { case IO_SUCCESS: - if (length) { + if (length) + { if (!IsServer(cptr)) cli_lasttime(cptr) = CurrentTime; if (cli_lasttime(cptr) > cli_since(cptr)) @@ -814,18 +707,10 @@ return 1; } -/* - * connect_server - start or complete a connection to another server - * returns true (1) if successful, false (0) otherwise - * - * aconf must point to a valid C:line - * m_connect calls this with a valid by client and a null reply - * try_connections calls this with a null by client, and a null reply - * connect_dns_callback call this with a null by client, and a valid reply - * - * XXX - if this comes from an m_connect message and a dns query needs to - * be done, we loose the information about who started the connection and - * it's considered an auto connect. +/** Start a connection to another server. + * @param aconf Connect block data for target server. + * @param by Client who requested the connection (if any). + * @return Non-zero on success; zero on failure. */ int connect_server(struct ConfItem* aconf, struct Client* by) { @@ -838,7 +723,7 @@ return 0; } Debug((DEBUG_NOTICE, "Connect to %s[@%s]", aconf->name, - ircd_ntoa((const char*) &aconf->ipnum))); + ircd_ntoa(&aconf->address.addr))); if ((cptr = FindClient(aconf->name))) { if (IsServer(cptr) || IsMe(cptr)) { @@ -859,22 +744,21 @@ } } /* - * If we dont know the IP# for this host and itis a hostname and + * If we dont know the IP# for this host and it is a hostname and * not a ip# string, then try and find the appropriate host record. */ - if (INADDR_NONE == aconf->ipnum.s_addr) { - if (INADDR_NONE == (aconf->ipnum.s_addr = inet_addr(aconf->host))) { - char buf[HOSTLEN + 1]; - struct DNSQuery query; - - query.vptr = aconf; - query.callback = connect_dns_callback; - host_from_uh(buf, aconf->host, HOSTLEN); - buf[HOSTLEN] = '\0'; + if (!irc_in_addr_valid(&aconf->address.addr) + && !ircd_aton(&aconf->address.addr, aconf->host)) { + char buf[HOSTLEN + 1]; + struct DNSQuery query; + + query.vptr = aconf; + query.callback = connect_dns_callback; + host_from_uh(buf, aconf->host, HOSTLEN); + buf[HOSTLEN] = '\0'; - gethost_byname(buf, &query); - aconf->dns_pending = 1; - } + gethost_byname(buf, &query); + aconf->dns_pending = 1; return 0; } cptr = make_client(NULL, STAT_UNKNOWN_SERVER); @@ -939,7 +823,6 @@ if (cli_fd(cptr) > HighestFd) HighestFd = cli_fd(cptr); - LocalClientArray[cli_fd(cptr)] = cptr; Count_newunknown(UserStats); @@ -955,18 +838,7 @@ completed_connection(cptr) : 1; } -/* - * Setup local socket structure to use for binding to. - */ -void set_virtual_host(struct in_addr addr) -{ - memset(&VirtualHost, 0, sizeof(VirtualHost)); - VirtualHost.sin_family = AF_INET; - VirtualHost.sin_addr.s_addr = addr.s_addr; -} - -/* - * Find the real hostname for the host running the server (or one which +/** Find the real hostname for the host running the server (or one which * matches the server's name) and its primary IP#. Hostname is stored * in the client structure passed as a pointer. */ @@ -979,8 +851,9 @@ SetYXXServerName(&me, conf->numeric); } -/* - * Process events on a client socket +/** Process events on a client socket. + * @param ev Socket event structure that has a struct Connection as + * its associated data. */ static void client_sock_callback(struct Event* ev) { @@ -992,7 +865,7 @@ assert(0 != ev_socket(ev)); assert(0 != s_data(ev_socket(ev))); - con = (struct Connection *)s_data(ev_socket(ev)); + con = (struct Connection*) s_data(ev_socket(ev)); assert(0 != con_client(con) || ev_type(ev) == ET_DESTROY); @@ -1038,7 +911,7 @@ case ET_WRITE: /* socket is writable */ ClrFlag(cptr, FLAG_BLOCKED); if (cli_listing(cptr) && MsgQLength(&(cli_sendQ(cptr))) < 2048) - list_next_channels(cptr, 64); + list_next_channels(cptr); Debug((DEBUG_SEND, "Sending queued data to %C", cptr)); send_queued(cptr); break; @@ -1052,9 +925,7 @@ break; default: -#ifndef NDEBUG - abort(); /* unrecognized event */ -#endif + assert(0 && "Unrecognized socket event in client_sock_callback()"); break; } @@ -1068,8 +939,9 @@ } } -/* - * Process a timer on client socket +/** Process a timer on client socket. + * @param ev Timer event that has a struct Connection as its + * associated data. */ static void client_timer_callback(struct Event* ev) { @@ -1080,7 +952,7 @@ assert(0 != t_data(ev_timer(ev))); assert(ET_DESTROY == ev_type(ev) || ET_EXPIRE == ev_type(ev)); - con = (struct Connection *)t_data(ev_timer(ev)); + con = (struct Connection*) t_data(ev_timer(ev)); assert(0 != con_client(con) || ev_type(ev) == ET_DESTROY); Index: ircd-ircdev/ircd/s_conf.c diff -u ircd-ircdev/ircd/s_conf.c:1.6 ircd-ircdev/ircd/s_conf.c:1.7 --- ircd-ircdev/ircd/s_conf.c:1.6 Wed Nov 17 03:45:50 2004 +++ ircd-ircdev/ircd/s_conf.c Wed Nov 24 08:03:28 2004 @@ -18,8 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: s_conf.c,v 1.6 2004/11/17 11:45:50 zolty Exp $ - * + */ +/** @file + * @brief ircd configuration file driver + * @version $Id: s_conf.c,v 1.7 2004/11/24 16:03:28 zolty Exp $ */ #include "config.h" @@ -34,6 +36,7 @@ #include "hash.h" #include "ircd.h" #include "ircd_alloc.h" +#include "ircd_auth.h" #include "ircd_chattr.h" #include "ircd_log.h" #include "ircd_reply.h" @@ -53,7 +56,6 @@ #include "s_misc.h" #include "send.h" #include "struct.h" -#include "support.h" #include "sys.h" #include <assert.h> @@ -67,27 +69,28 @@ #include <sys/stat.h> #include <unistd.h> -#ifndef INADDR_NONE -#define INADDR_NONE 0xffffffff -#endif - -struct ConfItem* GlobalConfList = 0; -int GlobalConfCount = 0; -struct s_map *GlobalServiceMapList = 0; -struct qline *GlobalQuarantineList = 0; +/** Global list of all ConfItem structures. */ +struct ConfItem *GlobalConfList; +/** Count of items in #GlobalConfList. */ +int GlobalConfCount; +/** Global list of service mappings. */ +struct s_map *GlobalServiceMapList; +/** Global list of channel quarantines. */ +struct qline *GlobalQuarantineList; -void yyparse(void); -int conf_fd, lineno; +/** Current line number in scanner input. */ +int lineno; +/** Configuration information for #me. */ struct LocalConf localConf; +/** Global list of connection rules. */ struct CRuleConf* cruleConfList; -/* struct ServerConf* serverConfList; */ +/** Global list of K-lines. */ struct DenyConf* denyConfList; -/* - * output the reason for being k lined from a file - Mmmm - * sptr is client being dumped - * filename is the file that is to be output to the K lined client +/** Tell a user that they are banned, dumping the message from a file. + * @param sptr Client being rejected + * @param filename Send this file's contents to \a sptr */ static void killcomment(struct Client* sptr, const char* filename) { @@ -120,7 +123,10 @@ fbclose(file); } -struct ConfItem* make_conf(void) +/** Allocate a new struct ConfItem and link it to #GlobalConfList. + * @return Newly allocated structure. + */ +struct ConfItem* make_conf(int type) { struct ConfItem* aconf; @@ -130,31 +136,21 @@ ++GlobalConfCount; #endif memset(aconf, 0, sizeof(struct ConfItem)); - aconf->status = CONF_ILLEGAL; - aconf->ipnum.s_addr = INADDR_NONE; + aconf->status = type; + aconf->next = GlobalConfList; + GlobalConfList = aconf; return aconf; } -void delist_conf(struct ConfItem *aconf) -{ - if (aconf == GlobalConfList) - GlobalConfList = GlobalConfList->next; - else { - struct ConfItem *bconf; - - for (bconf = GlobalConfList; aconf != bconf->next; bconf = bconf->next) - ; - bconf->next = aconf->next; - } - aconf->next = 0; -} - +/** Free a struct ConfItem and any resources it owns. + * @param aconf Item to free. + */ void free_conf(struct ConfItem *aconf) { Debug((DEBUG_DEBUG, "free_conf: %s %s %d", aconf->host ? aconf->host : "*", aconf->name ? aconf->name : "*", - aconf->port)); + aconf->address.port)); if (aconf->dns_pending) delete_resolver_queries(aconf); MyFree(aconf->host); @@ -168,8 +164,9 @@ #endif } -/* - * detach_conf - Disassociate configuration from the client. +/** Disassociate configuration from the client. + * @param cptr Client to operate on. + * @param aconf ConfItem to detach. */ static void detach_conf(struct Client* cptr, struct ConfItem* aconf) { @@ -199,28 +196,57 @@ } } -/* - * conf_dns_callback - called when resolver query finishes - * if the query resulted in a successful search, hp will contain - * a non-null pointer, otherwise hp will be null. - * if successful save hp in the conf item it was called with +/** Parse a user\@host mask into username and host or IP parts. + * If \a host contains no username part, set \a aconf->username to + * NULL. If the host part of \a host looks like an IP mask, set \a + * aconf->addrbits and \a aconf->address to match. Otherwise, set + * \a aconf->host, and set \a aconf->addrbits to -1. + * @param[in,out] aconf Configuration item to set. + * @param[in] host user\@host mask to parse. */ -static void conf_dns_callback(void* vptr, struct hostent* hp) +void conf_parse_userhost(struct ConfItem *aconf, char *host) +{ + char *host_part; + unsigned char addrbits; + + MyFree(aconf->username); + MyFree(aconf->host); + host_part = strchr(host, '@'); + if (host_part) { + *host_part = '\0'; + DupString(aconf->username, host); + host_part++; + } else { + aconf->username = NULL; + host_part = host; + } + DupString(aconf->host, host_part); + if (ipmask_parse(aconf->host, &aconf->address.addr, &addrbits)) + aconf->addrbits = addrbits; + else + aconf->addrbits = -1; + MyFree(host); +} + +/** Copies a completed DNS query into its ConfItem. + * @param vptr Pointer to struct ConfItem for the block. + * @param hp DNS reply, or NULL if the lookup failed. + */ +static void conf_dns_callback(void* vptr, struct DNSReply* hp) { struct ConfItem* aconf = (struct ConfItem*) vptr; assert(aconf); aconf->dns_pending = 0; if (hp) { - memcpy(&aconf->ipnum, hp->h_addr, sizeof(struct in_addr)); + memcpy(&aconf->address.addr, &hp->addr, sizeof(aconf->address.addr)); MyFree(hp); } } -/* - * conf_dns_lookup - do a nameserver lookup of the conf host - * if the conf entry is currently doing a ns lookup do nothing, otherwise - * if the lookup returns a null pointer, set the conf dns_pending flag +/** Start a nameserver lookup of the conf host. If the conf entry is + * currently doing a lookup, do nothing. + * @param aconf ConfItem for which to start a request. */ static void conf_dns_lookup(struct ConfItem* aconf) { @@ -238,56 +264,41 @@ } -/* - * lookup_confhost - * - * Do (start) DNS lookups of all hostnames in the conf line and convert - * an IP addresses in a.b.c.d number for to IP#s. +/** Start lookups of all addresses in the conf line. The origin must + * be a numeric IP address. If the remote host field is not an IP + * address, start a DNS lookup for it. + * @param aconf Connection to do lookups for. */ -void lookup_confhost(struct ConfItem *aconf) +void +lookup_confhost(struct ConfItem *aconf) { - char *tmp, *tmp2; - if (EmptyString(aconf->host) || EmptyString(aconf->name)) { Debug((DEBUG_ERROR, "Host/server name error: (%s) (%s)", aconf->host, aconf->name)); return; } + if (aconf->origin_name + && !ircd_aton(&aconf->origin.addr, aconf->origin_name)) { + Debug((DEBUG_ERROR, "Origin name error: (%s) (%s)", + aconf->origin_name, aconf->name)); + } /* * Do name lookup now on hostnames given and store the * ip numbers in conf structure. */ - if ((tmp = strchr(aconf->host, '/'))) { - *(tmp++) = '\0'; - aconf->origin.s_addr = inet_addr(aconf->host); - tmp2 = aconf->host; - DupString(aconf->host, tmp); - free(tmp2); - } else - aconf->origin.s_addr = INADDR_NONE; - - if (IsDigit(*aconf->host)) { - /* - * rfc 1035 sez host names may not start with a digit - * XXX - this has changed code needs to be updated - */ - aconf->ipnum.s_addr = inet_addr(aconf->host); - if (INADDR_NONE == aconf->ipnum.s_addr) { + if (IsIP6Char(*aconf->host)) { + if (!ircd_aton(&aconf->address.addr, aconf->host)) { Debug((DEBUG_ERROR, "Host/server name error: (%s) (%s)", - aconf->host, aconf->name)); + aconf->host, aconf->name)); } } else conf_dns_lookup(aconf); } -/* - * conf_find_server - find a server by name or hostname - * returns a server conf item pointer if found, 0 otherwise - * - * NOTE: at some point when we don't have to scan the entire - * list it may be cheaper to look for server names and host - * names in separate loops (original code did it that way) +/** Find a server by name or hostname. + * @param name Server name to find. + * @return Pointer to the corresponding ConfItem, or NULL if none exists. */ struct ConfItem* conf_find_server(const char* name) { @@ -308,14 +319,10 @@ return 0; } -/* - * conf_eval_crule - evaluate connection rules - * returns the name of the rule triggered if found, 0 otherwise - * - * Evaluate connection rules... If no rules found, allow the - * connect. Otherwise stop with the first true rule (ie: rules - * are ored together. Oper connects are effected only by D - * lines (CRULE_ALL) not d lines (CRULE_AUTO). +/** Evaluate connection rules. + * @param name Name of server to check + * @param mask Filter for CRule types (only consider if type & \a mask != 0). + * @return Name of rule that forbids the connection; NULL if no prohibitions. */ const char* conf_eval_crule(const char* name, int mask) { @@ -331,9 +338,10 @@ return 0; } -/* - * Remove all conf entries from the client except those which match +/** Remove all conf entries from the client except those which match * the status field mask. + * @param cptr Client to operate on. + * @param mask ConfItem types to keep. */ void det_confs_butmask(struct Client* cptr, int mask) { @@ -348,96 +356,62 @@ } } -/* - * check_limit_and_attach - check client limits and attach I:line - * - * Made it accept 1 charactor, and 2 charactor limits (0->99 now), - * and dislallow more than 255 people here as well as in ipcheck. - * removed the old "ONE" scheme too. - * -- Isomer 2000-06-22 +/** Check client limits and attach Client block. + * If there are more connections from the IP than \a aconf->maximum + * allows, return ACR_TOO_MANY_FROM_IP. Otherwise, attach \a aconf to + * \a cptr. + * @param cptr Client getting \a aconf. + * @param aconf Configuration item to attach. + * @return Authorization check result. */ static enum AuthorizationCheckResult check_limit_and_attach(struct Client* cptr, struct ConfItem* aconf) { - int number = 255; - - if (aconf->passwd) { - if (IsDigit(*aconf->passwd) && !aconf->passwd[1]) - number = *aconf->passwd-'0'; - else if (IsDigit(*aconf->passwd) && IsDigit(aconf->passwd[1]) && - !aconf->passwd[2]) - number = (*aconf->passwd-'0')*10+(aconf->passwd[1]-'0'); - } - if (IPcheck_nr(cptr) > number) + if (IPcheck_nr(cptr) > aconf->maximum) return ACR_TOO_MANY_FROM_IP; return attach_conf(cptr, aconf); } -/* - * Find the first (best) I line to attach. +/** Find the first (best) Client block to attach. + * @param cptr Client for whom to check rules. + * @return Authorization check result. */ -enum AuthorizationCheckResult attach_iline(struct Client* cptr) +enum AuthorizationCheckResult attach_iline(struct Client* cptr) { struct ConfItem* aconf; - const char* hname; - int i; - static char uhost[HOSTLEN + USERLEN + 3]; - static char fullname[HOSTLEN + 1]; - struct hostent* hp = 0; + struct DNSReply* hp; assert(0 != cptr); - if (cli_dns_reply(cptr)) - hp = cli_dns_reply(cptr); - + hp = cli_dns_reply(cptr); for (aconf = GlobalConfList; aconf; aconf = aconf->next) { - if (aconf->status != CONF_CLIENT) - continue; - if (aconf->port && aconf->port != cli_listener(cptr)->port) + if (aconf->status != CONF_CLIENT || !aconf->host) continue; - if (!aconf->host || !aconf->name) + if (aconf->address.port && aconf->address.port != cli_listener(cptr)->addr.port) continue; - if (hp) { - for (i = 0, hname = hp->h_name; hname; hname = hp->h_aliases[i++]) { - ircd_strncpy(fullname, hname, HOSTLEN); - fullname[HOSTLEN] = '\0'; - - Debug((DEBUG_DNS, "a_il: %s->%s", cli_sockhost(cptr), fullname)); - - if (strchr(aconf->name, '@')) { - strcpy(uhost, cli_username(cptr)); - strcat(uhost, "@"); - } - else - *uhost = '\0'; - strncat(uhost, fullname, sizeof(uhost) - 1 - strlen(uhost)); - uhost[sizeof(uhost) - 1] = 0; - if (0 == match(aconf->name, uhost)) { - if (strchr(uhost, '@')) - SetFlag(cptr, FLAG_DOID); - return check_limit_and_attach(cptr, aconf); - } - } - } - if (strchr(aconf->host, '@')) { - ircd_strncpy(uhost, cli_username(cptr), sizeof(uhost) - 2); - uhost[sizeof(uhost) - 2] = 0; - strcat(uhost, "@"); - } - else - *uhost = '\0'; - strncat(uhost, cli_sock_ip(cptr), sizeof(uhost) - 1 - strlen(uhost)); - uhost[sizeof(uhost) - 1] = 0; - if (match(aconf->host, uhost)) - continue; - if (strchr(uhost, '@')) + if (aconf->username) { SetFlag(cptr, FLAG_DOID); - - return check_limit_and_attach(cptr, aconf); + if (match(aconf->username, cli_username(cptr))) + continue; + } + if (hp) { + Debug((DEBUG_DNS, "a_il: %s->%s", cli_sockhost(cptr), hp->h_name)); + if (!match(aconf->host, hp->h_name)) + return check_limit_and_attach(cptr, aconf); + } + if ((aconf->addrbits >= 0) + && ipmask_check(&cli_ip(cptr), &aconf->address.addr, aconf->addrbits)) + return check_limit_and_attach(cptr, aconf); } return ACR_NO_AUTHORIZATION; } +/** Check whether a particular ConfItem is already attached to a + * Client. + * @param aconf ConfItem to search for + * @param cptr Client to check + * @return Non-zero if \a aconf is attached to \a cptr, zero if not. + */ static int is_attached(struct ConfItem *aconf, struct Client *cptr) { struct SLink *lp; @@ -449,13 +423,12 @@ return 0; } -/* - * attach_conf - * - * Associate a specific configuration entry to a *local* - * client (this is the one which used in accepting the - * connection). Note, that this automaticly changes the - * attachment if there was an old one... +/** Associate a specific configuration entry to a *local* client (this + * is the one which used in accepting the connection). Note, that this + * automaticly changes the attachment if there was an old one... + * @param cptr Client to attach \a aconf to + * @param aconf ConfItem to attach + * @return Authorization check result. */ enum AuthorizationCheckResult attach_conf(struct Client *cptr, struct ConfItem *aconf) { @@ -478,17 +451,20 @@ return ACR_OK; } +/** Return our LocalConf configuration structure. + * @return A pointer to #localConf. + */ const struct LocalConf* conf_get_local(void) { return &localConf; } -/* - * attach_confs_byname - * - * Attach a CONF line to a client if the name passed matches that for - * the conf file (for non-C/N lines) or is an exact match (C/N lines - * only). The difference in behaviour is to stop C:*::* and N:*::*. +/** Attach ConfItems to a client if the name passed matches that for + * the ConfItems or is an exact match for them. + * @param cptr Client getting the ConfItem attachments. + * @param name Filter to match ConfItem::name. + * @param statmask Filter to limit ConfItem::status. + * @return First ConfItem attached to \a cptr. */ struct ConfItem* attach_confs_byname(struct Client* cptr, const char* name, int statmask) @@ -513,8 +489,12 @@ return first; } -/* - * Added for new access check meLazy +/** Attach ConfItems to a client if the host passed matches that for + * the ConfItems or is an exact match for them. + * @param cptr Client getting the ConfItem attachments. + * @param host Filter to match ConfItem::host. + * @param statmask Filter to limit ConfItem::status. + * @return First ConfItem attached to \a cptr. */ struct ConfItem* attach_confs_byhost(struct Client* cptr, const char* host, int statmask) @@ -538,43 +518,47 @@ return first; } -/* - * find a conf entry which matches the hostname and has the same name. +/** Find a ConfItem that has the same name and user+host fields as + * specified. Requires an exact match for \a name. + * @param name Name to match + * @param cptr Client to match against + * @param statmask Filter for ConfItem::status + * @return First found matching ConfItem. */ -struct ConfItem* find_conf_exact(const char* name, const char* user, - const char* host, int statmask) +struct ConfItem* find_conf_exact(const char* name, struct Client *cptr, int statmask) { struct ConfItem *tmp; - char userhost[USERLEN + HOSTLEN + 3]; - - if (user) - ircd_snprintf(0, userhost, sizeof(userhost), "%s@%s", user, host); - else - ircd_strncpy(userhost, host, sizeof(userhost) - 1); for (tmp = GlobalConfList; tmp; tmp = tmp->next) { if (!(tmp->status & statmask) || !tmp->name || !tmp->host || 0 != ircd_strcmp(tmp->name, name)) continue; - /* - * Accept if the *real* hostname (usually sockecthost) - * socket host) matches *either* host or name field - * of the configuration. - */ - if (match(tmp->host, userhost)) + if (tmp->username + && (EmptyString(cli_username(cptr)) + || match(tmp->username, cli_username(cptr)))) continue; - if (tmp->status & CONF_OPERATOR) { - if (tmp->clients < MaxLinks(tmp->conn_class)) - return tmp; - else + if (tmp->addrbits < 0) + { + if (match(tmp->host, cli_sockhost(cptr))) continue; } - else - return tmp; + else if (!ipmask_check(&cli_ip(cptr), &tmp->address.addr, tmp->addrbits)) + continue; + if ((tmp->status & CONF_OPERATOR) + && (tmp->clients >= MaxLinks(tmp->conn_class))) + continue; + return tmp; } return 0; } +/** Find a ConfItem from a list that has a name that matches \a name. + * @param lp List to search in. + * @param name Filter for ConfItem::name field; matches either exactly + * or as a glob. + * @param statmask Filter for ConfItem::status. + * @return First matching ConfItem from \a lp. + */ struct ConfItem* find_conf_byname(struct SLink* lp, const char* name, int statmask) { @@ -595,8 +579,11 @@ return 0; } -/* - * Added for new access check meLazy +/** Find a ConfItem from a list that has a host that matches \a host. + * @param lp List to search in. + * @param host Filter for ConfItem::host field; matches as a glob. + * @param statmask Filter for ConfItem::status. + * @return First matching ConfItem from \a lp. */ struct ConfItem* find_conf_byhost(struct SLink* lp, const char* host, int statmask) @@ -618,27 +605,27 @@ return 0; } -/* - * find_conf_ip - * - * Find a conf line using the IP# stored in it to search upon. - * Added 1/8/92 by Avalon. +/** Find a ConfItem from a list that has an address equal to \a ip. + * @param lp List to search in. + * @param ip Filter for ConfItem::address field; matches exactly. + * @param statmask Filter for ConfItem::status. + * @return First matching ConfItem from \a lp. */ -struct ConfItem* find_conf_byip(struct SLink* lp, const char* ip, +struct ConfItem* find_conf_byip(struct SLink* lp, const struct irc_in_addr* ip, int statmask) { struct ConfItem* tmp; for (; lp; lp = lp->next) { tmp = lp->value.aconf; - if (0 != (tmp->status & statmask)) { - if (0 == memcmp(&tmp->ipnum, ip, sizeof(struct in_addr))) - return tmp; - } + if (0 != (tmp->status & statmask) + && !irc_in_addr_cmp(&tmp->address.addr, ip)) + return tmp; } return 0; } +/** Free all CRules from #cruleConfList. */ void conf_erase_crule_list(void) { struct CRuleConf* next; @@ -654,11 +641,15 @@ cruleConfList = 0; } +/** Return #cruleConfList. + * @return #cruleConfList + */ const struct CRuleConf* conf_get_crule_list(void) { return cruleConfList; } +/** Fr... [truncated message content] |
From: Toni G. <zo...@us...> - 2004-11-24 16:03:03
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-11-24 16:02:39 UTC Modified files: ircd/m_account.c ircd/m_admin.c ircd/m_away.c ircd/m_burst.c ircd/m_clearmode.c ircd/m_connect.c ircd/m_create.c ircd/m_endburst.c ircd/m_gline.c ircd/m_info.c ircd/m_invite.c ircd/m_join.c ircd/m_jupe.c ircd/m_kick.c ircd/m_links.c ircd/m_list.c ircd/m_lusers.c ircd/m_map.c ircd/m_mode.c ircd/m_nick.c ircd/m_oper.c ircd/m_opmode.c ircd/m_pong.c ircd/m_quit.c ircd/m_server.c ircd/m_settime.c ircd/m_silence.c ircd/m_squit.c ircd/m_stats.c ircd/m_topic.c ircd/m_trace.c ircd/m_userip.c ircd/m_version.c ircd/m_wallchops.c ircd/m_wallvoices.c ircd/m_who.c ircd/m_whois.c Log message: Author: zoltan <zo...@ir...> Log message: 2004-11-24 Toni García <zo...@ir...> 1.0.alpha13 * Comentarios para Doxygen * Excepciones de Silences * Soporte total de IPv6 * Sincronizacion Undernet ---------------------- diff included ---------------------- Index: ircd-ircdev/ircd/m_account.c diff -u ircd-ircdev/ircd/m_account.c:1.4 ircd-ircdev/ircd/m_account.c:1.5 --- ircd-ircdev/ircd/m_account.c:1.4 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/m_account.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_account.c,v 1.4 2004/05/21 15:39:35 zolty Exp $ + * $Id: m_account.c,v 1.5 2004/11/24 16:02:28 zolty Exp $ * */ @@ -101,7 +101,6 @@ * parv[0] = sender prefix * parv[1] = numeric of client to act on * parv[2] = account name (12 characters or less) - * */ int ms_account(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) @@ -125,9 +124,11 @@ assert(0 == cli_user(acptr)->account[0]); - if (strlen(parv[2]) > ACCOUNTLEN) { - return protocol_violation(cptr, "Received account (%s) longer than %d for %s; ignoring.", parv[2], ACCOUNTLEN, cli_name(acptr)); - } + if (strlen(parv[2]) > ACCOUNTLEN) + return protocol_violation(cptr, + "Received account (%s) longer than %d for %s; " + "ignoring.", + parv[2], ACCOUNTLEN, cli_name(acptr)); if (parc > 3) { cli_user(acptr)->acc_create = atoi(parv[3]); Index: ircd-ircdev/ircd/m_admin.c diff -u ircd-ircdev/ircd/m_admin.c:1.2 ircd-ircdev/ircd/m_admin.c:1.3 --- ircd-ircdev/ircd/m_admin.c:1.2 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/m_admin.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_admin.c,v 1.2 2004/02/22 16:11:42 zolty Exp $ + * $Id: m_admin.c,v 1.3 2004/11/24 16:02:28 zolty Exp $ * */ @@ -111,7 +111,6 @@ * * parv[0] = sender prefix * parv[1] = servername - * */ int m_admin(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { @@ -120,7 +119,7 @@ assert(0 != cptr); assert(cptr == sptr); - if (parc > 1 && (!(acptr = find_match_server(parv[1])) || !IsMe(acptr))) + if (parc > 1 && (!(acptr = find_match_server(parv[1])) || !IsMe(acptr))) return send_reply(sptr, ERR_NOPRIVILEGES); return send_admin_info(sptr); @@ -131,7 +130,6 @@ * * parv[0] = sender prefix * parv[1] = servername - * */ int mo_admin(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { @@ -139,7 +137,7 @@ assert(cptr == sptr); if (hunt_server_cmd(sptr, CMD_ADMIN, cptr, feature_int(FEAT_HIS_REMOTE), - ":%C", 1, parc, parv) != HUNTED_ISME) + ":%C", 1, parc, parv) != HUNTED_ISME) return 0; return send_admin_info(sptr); } @@ -149,7 +147,6 @@ * * parv[0] = sender prefix * parv[1] = servername - * */ int ms_admin(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { Index: ircd-ircdev/ircd/m_away.c diff -u ircd-ircdev/ircd/m_away.c:1.3 ircd-ircdev/ircd/m_away.c:1.4 --- ircd-ircdev/ircd/m_away.c:1.3 Wed Nov 17 03:45:50 2004 +++ ircd-ircdev/ircd/m_away.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_away.c,v 1.3 2004/11/17 11:45:50 zolty Exp $ + * $Id: m_away.c,v 1.4 2004/11/24 16:02:28 zolty Exp $ * */ @@ -128,9 +128,8 @@ len = AWAYLEN; } if (away) - away = (char*) MyRealloc(away, len + 1); - else - away = (char*) MyMalloc(len + 1); + MyFree(away); + away = (char*) MyMalloc(len + 1); assert(0 != away); user->away = away; @@ -158,9 +157,10 @@ assert(0 != cptr); assert(cptr == sptr); - if (user_set_away(cli_user(sptr), away_message)) { - if (!was_away) - sendcmdto_serv_butone(sptr, CMD_AWAY, cptr, ":%s", away_message); + if (user_set_away(cli_user(sptr), away_message)) + { + if (!was_away) + sendcmdto_serv_butone(sptr, CMD_AWAY, cptr, ":%s", away_message); send_reply(sptr, RPL_NOWAWAY); } else { @@ -176,7 +176,6 @@ * * parv[0] = sender prefix * parv[1] = away message - * */ int ms_away(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { Index: ircd-ircdev/ircd/m_burst.c diff -u ircd-ircdev/ircd/m_burst.c:1.4 ircd-ircdev/ircd/m_burst.c:1.5 --- ircd-ircdev/ircd/m_burst.c:1.4 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/m_burst.c Wed Nov 24 08:02:28 2004 @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_burst.c,v 1.4 2004/05/21 15:39:35 zolty Exp $ + * $Id: m_burst.c,v 1.5 2004/11/24 16:02:28 zolty Exp $ * */ @@ -99,13 +99,39 @@ #include "s_misc.h" #include "send.h" #include "struct.h" -#include "support.h" #include <assert.h> #include <ctype.h> #include <stdlib.h> #include <string.h> +static int +netride_modes(int parc, char **parv, const char *curr_key) +{ + char *modes = parv[0]; + int result = 0; + + assert(modes && modes[0] == '+'); + while (*modes) { + switch (*modes++) { + case 'i': + result |= MODE_INVITEONLY; + break; + case 'k': + if (strcmp(curr_key, *++parv)) + result |= MODE_KEY; + break; + case 'l': + ++parv; + break; + case 'r': + result |= MODE_REGONLY; + break; + } + } + return result; +} + /* * ms_burst - server message handler * @@ -190,7 +216,7 @@ struct Channel *chptr; time_t timestamp; struct Membership *member, *nmember; - struct SLink *lp, **lp_p; + struct Ban *lp, **lp_p; unsigned int parse_flags = (MODE_PARSE_FORCE | MODE_PARSE_BURST); int param, nickpos = 0, banpos = 0; char modestr[BUFSIZE], nickstr[BUFSIZE], banstr[BUFSIZE]; @@ -215,17 +241,31 @@ */ for (param = 3; param < parc; param++) { + int check_modes; if (parv[param][0] != '+') continue; - if (strchr(parv[param], 'i') || strchr(parv[param], 'k')) + check_modes = netride_modes(parc - param, parv + param, chptr->mode.key); + if (check_modes) { /* Clear any outstanding rogue invites */ mode_invite_clear(chptr); for (member = chptr->members; member; member = nmember) { - nmember=member->next_member; + nmember = member->next_member; if (!MyUser(member->user) || IsZombie(member)) continue; + /* Kick as netrider if key mismatch *or* remote channel is + * +i (unless user is an oper) *or* remote channel is +r + * (unless user has an account). + */ + if (!(check_modes & MODE_KEY) + && (!(check_modes & MODE_INVITEONLY) || IsAnOper(member->user)) +#if defined(UNDERNET) + && (!(check_modes & MODE_REGONLY) || IsAccount(member->user))) +#else + ) +#endif + continue; sendcmdto_serv_butone(&me, CMD_KICK, NULL, "%H %C :Net Rider", chptr, member->user); sendcmdto_channel_butserv_butone(&me, CMD_KICK, chptr, NULL, 0, "%H %C :Net Rider", chptr, member->user); make_zombie(member, member->user, &me, &me, chptr); @@ -257,15 +297,13 @@ modebuf_init(mbuf = &modebuf, &me, cptr, chptr, MODEBUF_DEST_CHANNEL | MODEBUF_DEST_NOKEY); modebuf_mode(mbuf, MODE_DEL | chptr->mode.mode); /* wipeout modes */ - chptr->mode.mode &= ~(MODE_ADD | MODE_DEL | MODE_PRIVATE | MODE_SECRET | - MODE_MODERATED | MODE_TOPICLIMIT | MODE_INVITEONLY | - MODE_NOPRIVMSGS | MODE_DELJOINS); + chptr->mode.mode &= MODE_BURSTADDED | MODE_WASDELJOINS; parse_flags |= (MODE_PARSE_SET | MODE_PARSE_WIPEOUT); /* wipeout keys */ /* mark bans for wipeout */ for (lp = chptr->banlist; lp; lp = lp->next) - lp->flags |= CHFL_BURST_BAN_WIPEOUT; + lp->flags |= BAN_BURST_WIPEOUT; /* clear topic set by netrider (if set) */ if (*chptr->topic) { @@ -293,7 +331,7 @@ case '%': /* parameter contains bans */ if (parse_flags & MODE_PARSE_SET) { char *banlist = parv[param] + 1, *p = 0, *ban, *ptr; - struct SLink *newban; + struct Ban *newban; for (ban = ircd_strtok(&p, banlist, " "); ban; ban = ircd_strtok(&p, 0, " ")) { @@ -308,16 +346,16 @@ * shown below *sigh* */ for (lp = chptr->banlist; lp; lp = lp->next) { - if (!ircd_strcmp(lp->value.ban.banstr, ban)) { + if (!ircd_strcmp(lp->banstr, ban)) { ban = 0; /* don't add ban */ - lp->flags &= ~CHFL_BURST_BAN_WIPEOUT; /* not wiping out */ + lp->flags &= ~BAN_BURST_WIPEOUT; /* not wiping out */ break; /* new ban already existed; don't even repropagate */ - } else if (!(lp->flags & CHFL_BURST_BAN_WIPEOUT) && - !mmatch(lp->value.ban.banstr, ban)) { + } else if (!(lp->flags & BAN_BURST_WIPEOUT) && + !mmatch(lp->banstr, ban)) { ban = 0; /* don't add ban unless wiping out bans */ break; /* new ban is encompassed by an existing one; drop */ - } else if (!mmatch(ban, lp->value.ban.banstr)) - lp->flags |= CHFL_BAN_OVERLAPPED; /* remove overlapping ban */ + } else if (!mmatch(ban, lp->banstr)) + lp->flags |= BAN_OVERLAPPED; /* remove overlapping ban */ if (!lp->next) break; @@ -334,18 +372,15 @@ for (ptr = ban; *ptr; ptr++) /* add ban to buffer */ banstr[banpos++] = *ptr; - newban = make_link(); /* create new ban */ - - DupString(newban->value.ban.banstr, ban); + newban = make_ban(ban); /* create new ban */ - DupString(newban->value.ban.who, - cli_name(feature_bool(FEAT_HIS_BANWHO) ? &me : sptr)); + DupString(newban->who, + cli_name(feature_bool(FEAT_HIS_BANWHO) ? &me : sptr)); + newban->when = TStime(); - newban->value.ban.when = TStime(); - - newban->flags = CHFL_BAN | CHFL_BURST_BAN; /* set flags */ + newban->flags = BAN_BURSTED; /* set flags */ if ((ptr = strrchr(ban, '@')) && check_if_ipmask(ptr + 1)) - newban->flags |= CHFL_BAN_IPMASK; + newban->flags |= BAN_IPMASK; newban->next = 0; if (lp) @@ -547,19 +582,18 @@ lp = *lp_p; /* remove ban from channel */ - if (lp->flags & (CHFL_BAN_OVERLAPPED | CHFL_BURST_BAN_WIPEOUT)) { + if (lp->flags & (BAN_OVERLAPPED | BAN_BURST_WIPEOUT)) { modebuf_mode_string(mbuf, MODE_DEL | MODE_BAN, - lp->value.ban.banstr, 1); /* let it free banstr */ - + lp->banstr, 1); /* let it free banstr */ + lp->banstr = NULL; /* do not free this string */ *lp_p = lp->next; /* clip out of list */ - MyFree(lp->value.ban.who); /* free who */ - free_link(lp); /* free ban */ + free_ban(lp); continue; - } else if (lp->flags & CHFL_BURST_BAN) /* add ban to channel */ + } else if (lp->flags & BAN_BURSTED) /* add ban to channel */ modebuf_mode_string(mbuf, MODE_ADD | MODE_BAN, - lp->value.ban.banstr, 0); /* don't free banstr */ + lp->banstr, 0); /* don't free banstr */ - lp->flags &= (CHFL_BAN | CHFL_BAN_IPMASK); /* reset the flag */ + lp->flags &= BAN_IPMASK; /* reset the flag */ lp_p = &(*lp_p)->next; } } Index: ircd-ircdev/ircd/m_clearmode.c diff -u ircd-ircdev/ircd/m_clearmode.c:1.4 ircd-ircdev/ircd/m_clearmode.c:1.5 --- ircd-ircdev/ircd/m_clearmode.c:1.4 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/m_clearmode.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_clearmode.c,v 1.4 2004/05/21 15:39:35 zolty Exp $ + * $Id: m_clearmode.c,v 1.5 2004/11/24 16:02:28 zolty Exp $ * */ @@ -95,7 +95,6 @@ #include "numnicks.h" #include "s_conf.h" #include "send.h" -#include "support.h" #include <assert.h> @@ -130,7 +129,7 @@ char control_buf[20]; int control_buf_i = 0; struct ModeBuf mbuf; - struct SLink *link, *next; + struct Ban *link, *next; struct Membership *member; /* Ok, so what are we supposed to get rid of? */ @@ -179,10 +178,10 @@ next = link->next; modebuf_mode_string(&mbuf, MODE_DEL | MODE_BAN, /* delete ban */ - link->value.ban.banstr, 1); - - MyFree(link->value.ban.who); /* free up who string */ - free_link(link); /* and of course the link itself */ + link->banstr, 1); + link->banstr = NULL; /* modebuf_mode_string() gave ownership of + * banstr to mbuf */ + free_ban(link); } chptr->banlist = 0; @@ -288,9 +287,12 @@ control = parv[2]; chname = parv[1]; - if (*chname == '!') { + if (*chname == '!') + { chname++; - if (!HasPriv(sptr, IsLocalChannel(chname) ? PRIV_FORCE_LOCAL_OPMODE : PRIV_FORCE_OPMODE)) + if (!HasPriv(sptr, IsLocalChannel(chname) ? + PRIV_FORCE_LOCAL_OPMODE : + PRIV_FORCE_OPMODE)) return send_reply(sptr, ERR_NOPRIVILEGES); force = 1; } @@ -299,7 +301,7 @@ IsLocalChannel(chname) ? PRIV_LOCAL_OPMODE : PRIV_OPMODE)) return send_reply(sptr, ERR_NOPRIVILEGES); - if (!(chptr = FindChannel(chname))) + if (('#' != *chname && '&' != *chname) || !(chptr = FindChannel(chname))) return send_reply(sptr, ERR_NOSUCHCHANNEL, chname); if (!force && (qreason = find_quarantine(chptr->chname))) Index: ircd-ircdev/ircd/m_connect.c diff -u ircd-ircdev/ircd/m_connect.c:1.3 ircd-ircdev/ircd/m_connect.c:1.4 --- ircd-ircdev/ircd/m_connect.c:1.3 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_connect.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_connect.c,v 1.3 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_connect.c,v 1.4 2004/11/24 16:02:28 zolty Exp $ * */ @@ -184,18 +184,17 @@ /* * save the old port */ - tmpport = aconf->port; - if (port) { - aconf->port = port; - } - else { - port = aconf->port; - } + tmpport = aconf->address.port; + if (port) + aconf->address.port = port; + else + port = aconf->address.port; + /* * Notify all operators about remote connect requests */ sendwallto_group_butone(&me, WALL_WALLOPS, 0, - "Remote CONNECT %s %s from %s", parv[1], + "Remote CONNECT %s %s from %s", parv[1], parv[2] ? parv[2] : "", get_client_name(sptr, HIDE_IP)); log_write(LS_NETWORK, L_INFO, 0, "CONNECT From %C : %s %s", sptr, parv[1], @@ -209,7 +208,7 @@ sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :*** Connection to %s failed", sptr, aconf->name); } - aconf->port = tmpport; + aconf->address.port = tmpport; return 0; } @@ -313,7 +312,7 @@ * use the default from configuration structure. If missing * from there, then use the precompiled default. */ - port = aconf->port; + port = aconf->address.port; if (parc > 2) { assert(0 != parv[2]); if (0 == (port = atoi(parv[2]))) { @@ -328,8 +327,8 @@ return 0; } - tmpport = aconf->port; - aconf->port = port; + tmpport = aconf->address.port; + aconf->address.port = port; if (connect_server(aconf, sptr)) { sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :*** Connecting to %s.", sptr, @@ -339,6 +338,6 @@ sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :*** Connection to %s failed", sptr, aconf->name); } - aconf->port = tmpport; + aconf->address.port = tmpport; return 0; } Index: ircd-ircdev/ircd/m_create.c diff -u ircd-ircdev/ircd/m_create.c:1.2 ircd-ircdev/ircd/m_create.c:1.3 --- ircd-ircdev/ircd/m_create.c:1.2 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_create.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_create.c,v 1.2 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_create.c,v 1.3 2004/11/24 16:02:28 zolty Exp $ * */ @@ -129,18 +129,19 @@ cli_serv(cli_user(sptr)->server)->lag = TStime() - chanTS; /* If this server is >1 minute fast, warn */ - if (TStime() - chanTS<-60) { + if (TStime() - chanTS<-60) + { static time_t rate; sendto_opmask_butone_ratelimited(0, SNO_NETWORK, &rate, - "Timestamp drift from %C (%is); issuing " - "SETTIME to correct this", + "Timestamp drift from %C (%is); issuing " + "SETTIME to correct this", cli_user(sptr)->server, chanTS - TStime()); /* Now issue a SETTIME to resync. If we're in the wrong, our * (RELIABLE_CLOCK) hub will bounce a SETTIME back to us. */ sendcmdto_prio_one(&me, CMD_SETTIME, cli_user(sptr)->server, - "%Tu %C", TStime(), cli_user(sptr)->server); + "%Tu %C", TStime(), cli_user(sptr)->server); } joinbuf_init(&join, sptr, cptr, JOINBUF_TYPE_JOIN, 0, 0); @@ -154,7 +155,8 @@ if (IsLocalChannel(name)) continue; - if ((chptr = FindChannel(name))) { + if ((chptr = FindChannel(name))) + { name = chptr->chname; /* Check if we need to bounce a mode */ @@ -172,7 +174,7 @@ badop = 1; } - } else /* Channel doesn't exist: create it */ + } else /* Channel doesn't exist: create it */ chptr = get_channel(sptr, name, CGT_CREATE); if (!badop) /* Set/correct TS */ Index: ircd-ircdev/ircd/m_endburst.c diff -u ircd-ircdev/ircd/m_endburst.c:1.2 ircd-ircdev/ircd/m_endburst.c:1.3 --- ircd-ircdev/ircd/m_endburst.c:1.2 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_endburst.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_endburst.c,v 1.2 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_endburst.c,v 1.3 2004/11/24 16:02:28 zolty Exp $ * */ @@ -126,11 +126,12 @@ next_chan = chan->next; if (!chan->members) { /* empty channel */ - if (!(chan->mode.mode & MODE_BURSTADDED)) + if ((chan->mode.mode & MODE_BURSTADDED)) + sub1_from_channel(chan); /* New empty channel, schedule it for removal. */ + /* FIX-ZOLTAN Añadido */ + else sendto_opmask_butone(0, SNO_OLDSNO, "Empty channel %H not added by " "BURST!", chan); - - sub1_from_channel(chan); /* ok, nuke channel now */ } chan->mode.mode &= ~MODE_BURSTADDED; Index: ircd-ircdev/ircd/m_gline.c diff -u ircd-ircdev/ircd/m_gline.c:1.2 ircd-ircdev/ircd/m_gline.c:1.3 --- ircd-ircdev/ircd/m_gline.c:1.2 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_gline.c Wed Nov 24 08:02:28 2004 @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_gline.c,v 1.2 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_gline.c,v 1.3 2004/11/24 16:02:28 zolty Exp $ * */ @@ -96,7 +96,6 @@ #include "s_conf.h" #include "s_misc.h" #include "send.h" -#include "support.h" #include <assert.h> #include <stdlib.h> @@ -129,23 +128,27 @@ time_t expire_off, lastmod = 0; char *mask = parv[2], *target = parv[1], *reason = "No reason"; - if (*mask == '!') { + if (*mask == '!') + { mask++; - flags |= GLINE_OPERFORCE; /* assume oper had WIDE_GLINE */ } - if ((parc == 3 && *mask == '-') || parc == 5) { + if ((parc == 3 && *mask == '-') || parc == 5) + { if (!find_conf_byhost(cli_confs(cptr), cli_name(sptr), CONF_UWORLD)) return need_more_params(sptr, "GLINE"); if (parc > 4) reason = parv[4]; flags |= GLINE_FORCE; - } else if (parc > 5) { + } + else if (parc > 5) + { lastmod = atoi(parv[4]); reason = parv[5]; - } else + } + else return need_more_params(sptr, "GLINE"); if (IsServer(sptr)) @@ -267,12 +270,16 @@ } else return need_more_params(sptr, "GLINE"); - if (target) { - if (!(target[0] == '*' && target[1] == '\0')) { + if (target) + { + if (!(target[0] == '*' && target[1] == '\0')) + { if (!(acptr = find_match_server(target))) return send_reply(sptr, ERR_NOSUCHSERVER, target); - if (!IsMe(acptr)) { /* manually propagate, since we don't set it */ + /* manually propagate, since we don't set it */ + if (!IsMe(acptr)) + { if (!feature_bool(FEAT_CONFIG_OPERCMDS)) return send_reply(sptr, ERR_DISABLED, "GLINE"); @@ -285,7 +292,6 @@ TStime(), reason); return 0; } - flags |= GLINE_LOCAL; } } Index: ircd-ircdev/ircd/m_info.c diff -u ircd-ircdev/ircd/m_info.c:1.2 ircd-ircdev/ircd/m_info.c:1.3 --- ircd-ircdev/ircd/m_info.c:1.2 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_info.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_info.c,v 1.2 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_info.c,v 1.3 2004/11/24 16:02:28 zolty Exp $ * */ @@ -109,7 +109,7 @@ HUNTED_ISME) return 0; - while (text[2]) + while (text[212]) { send_reply(sptr, RPL_INFO, *text); text++; @@ -139,7 +139,7 @@ if (hunt_server_cmd(sptr, CMD_INFO, cptr, 1, ":%C", 1, parc, parv) != HUNTED_ISME) return 0; - while (text[2]) + while (text[212]) { if (!IsOper(sptr)) send_reply(sptr, RPL_INFO, *text); @@ -172,13 +172,13 @@ if (hunt_server_cmd(sptr, CMD_INFO, cptr, 1, ":%C", 1, parc, parv) == HUNTED_ISME) { - while (text[2]) + while (text[212]) { if (!IsOper(sptr)) send_reply(sptr, RPL_INFO, *text); text++; } - if (IsOper(sptr)) + if (IsOper(sptr) && (NULL != parv[1])) { while (*text) send_reply(sptr, RPL_INFO, *text++); Index: ircd-ircdev/ircd/m_invite.c diff -u ircd-ircdev/ircd/m_invite.c:1.4 ircd-ircdev/ircd/m_invite.c:1.5 --- ircd-ircdev/ircd/m_invite.c:1.4 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/m_invite.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_invite.c,v 1.4 2004/05/21 15:39:35 zolty Exp $ + * $Id: m_invite.c,v 1.5 2004/11/24 16:02:28 zolty Exp $ * */ @@ -180,17 +180,17 @@ if (!IsLocalChannel(chptr->chname) || MyConnect(acptr)) { if (feature_bool(FEAT_ANNOUNCE_INVITES)) { + /* Announce to channel operators. */ sendcmdto_channel_butserv_butone(&me, get_error_numeric(RPL_ISSUEDINVITE)->str, NULL, chptr, sptr, SKIP_NONOPS, - "%C %C :%C has been invited by %C", - acptr, sptr, acptr, sptr); - sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, sptr, 0, + "%H %C %C :%C has been invited by %C", + chptr, acptr, sptr, acptr, sptr); + /* Announce to servers with channel operators, but skip acptr, + * since they will be notified below. */ + sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, acptr, SKIP_NONOPS, "%s :%H", cli_name(acptr), chptr); - if (MyConnect(acptr)) - sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", cli_name(acptr), chptr); } - else - sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", cli_name(acptr), chptr); + sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", cli_name(acptr), chptr); } return 0; @@ -241,27 +241,6 @@ send_reply(sptr, ERR_NOSUCHNICK, parv[1]); return 0; } - if (feature_bool(FEAT_ANNOUNCE_INVITES)) { - sendcmdto_channel_butserv_butone(&me, get_error_numeric(RPL_ISSUEDINVITE)->str, - NULL, chptr, sptr, SKIP_NONOPS, - "%C %C :%C has been invited by %C", - acptr, sptr, acptr, sptr); - sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, sptr, 0, - "%s :%H", cli_name(acptr), chptr); - if (MyConnect(acptr)) - sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", cli_name(acptr), chptr); - return 0; - } - if (!MyUser(acptr)) { - /* - * just relay the message - */ - sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%s", cli_name(acptr), parv[2]); - return 0; - } - - if (is_silenced(sptr, acptr)) - return 0; if (!(chptr = FindChannel(parv[2]))) { /* @@ -274,16 +253,34 @@ /* Allow remote +k users who aren't on the channel to invite people - * needed for off-channel services to work properly */ - if (!IsChannelService(sptr) && !find_channel_member(sptr, chptr)) { - send_reply(sptr, ERR_NOTONCHANNEL, chptr->chname); - return 0; - } + if (!IsChannelService(sptr) && !find_channel_member(sptr, chptr)) { + send_reply(sptr, ERR_NOTONCHANNEL, chptr->chname); + return 0; + } if (find_channel_member(acptr, chptr)) { send_reply(sptr, ERR_USERONCHANNEL, cli_name(acptr), chptr->chname); return 0; } - add_invite(acptr, chptr); + + if (is_silenced(sptr, acptr)) + return 0; + + if (MyConnect(acptr)) + add_invite(acptr, chptr); + + if (feature_bool(FEAT_ANNOUNCE_INVITES)) { + /* Announce to channel operators. */ + sendcmdto_channel_butserv_butone(&me, get_error_numeric(RPL_ISSUEDINVITE)->str, + NULL, chptr, sptr, SKIP_NONOPS, + "%H %C %C :%C has been invited by %C", + chptr, acptr, sptr, acptr, sptr); + /* Announce to servers with channel operators, but skip acptr, + * since they will be notified below. */ + sendcmdto_channel_servers_butone(sptr, NULL, TOK_INVITE, chptr, acptr, SKIP_NONOPS, + "%s :%H", cli_name(acptr), chptr); + } + sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%H", cli_name(acptr), chptr); return 0; } Index: ircd-ircdev/ircd/m_join.c diff -u ircd-ircdev/ircd/m_join.c:1.6 ircd-ircdev/ircd/m_join.c:1.7 --- ircd-ircdev/ircd/m_join.c:1.6 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/m_join.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_join.c,v 1.6 2004/05/21 15:39:35 zolty Exp $ + * $Id: m_join.c,v 1.7 2004/11/24 16:02:28 zolty Exp $ * */ @@ -152,8 +152,8 @@ while ((member = cli_user(sptr)->channel)) joinbuf_join(&part, member->channel, IsZombie(member) ? CHFL_ZOMBIE : - IsDelayedJoin(member) ? CHFL_DELAYED : - 0); + IsDelayedJoin(member) ? CHFL_DELAYED : + 0); joinbuf_flush(&part); @@ -196,7 +196,9 @@ if (join0(&join, cptr, sptr, name)) /* did client do a JOIN 0? */ continue; - if (!IsChannelName(name)) { /* bad channel name */ + /* bad channel name */ + if (!IsChannelName(name)) + { send_reply(sptr, ERR_NOSUCHCHANNEL, name); continue; } @@ -206,9 +208,9 @@ */ for (k = 0, j = 0; name[j]; j++) if (IsCntrl(name[j])) - k++; - - if ( k > 0 ) { + k++; + if (k > 0) + { send_reply(sptr, ERR_NOSUCHCHANNEL, name); continue; } @@ -220,7 +222,8 @@ continue; } - if ((chptr = FindChannel(name))) { + if ((chptr = FindChannel(name))) + { if (find_member_link(chptr, sptr)) continue; /* already on channel */ @@ -317,7 +320,8 @@ #endif } else if (!(chptr = get_channel(sptr, name, CGT_CREATE))) continue; /* couldn't get channel */ - else if (check_target_limit(sptr, chptr, chptr->chname, 1)) { + else if (check_target_limit(sptr, chptr, chptr->chname, 1)) + { /* Note: check_target_limit will only ever return 0 here */ #if defined(UNDERNET) /* FIXME zoltan */ @@ -327,7 +331,8 @@ sub1_from_channel(chptr); /* created it... */ #endif continue; - } else + } + else joinbuf_join(&create, chptr, flags); del_invite(sptr, chptr); @@ -361,12 +366,14 @@ char *chanlist; char *name; - if (IsServer(sptr)) { + if (IsServer(sptr)) + { return protocol_violation(cptr, - "%s tried to JOIN %s, duh!", - cli_name(sptr), - (parc < 2 || *parv[1] == '\0') ? "a channel":parv[1] - ); + "%s tried to JOIN %s, duh!", + cli_name(sptr), + (parc < 2 || *parv[1] == '\0') ? "a channel" : + parv[1] + ); } if (parc < 2 || *parv[1] == '\0') @@ -386,14 +393,17 @@ if (join0(&join, cptr, sptr, name)) /* did client do a JOIN 0? */ continue; - if (IsLocalChannel(name) || !IsChannelName(name)) { - protocol_violation(cptr,"%s tried to join %s",cli_name(sptr),name); + if (IsLocalChannel(name) || !IsChannelName(name)) + { + protocol_violation(cptr, "%s tried to join %s", cli_name(sptr), name); continue; } - if (!(chptr = FindChannel(name))) { + if (!(chptr = FindChannel(name))) + { /* No channel exists, so create one */ - if (!(chptr = get_channel(sptr, name, CGT_CREATE))) { + if (!(chptr = get_channel(sptr, name, CGT_CREATE))) + { protocol_violation(sptr,"couldn't get channel %s for %s", name,cli_name(sptr)); continue; @@ -404,15 +414,18 @@ chptr->creationtime = creation ? creation : MAGIC_REMOTE_JOIN_TS; } else { /* We have a valid channel? */ - if ((member = find_member_link(chptr, sptr))) { + if ((member = find_member_link(chptr, sptr))) + { + /* It is impossible to get here --Run */ if (!IsZombie(member)) /* already on channel */ continue; flags = member->status & (CHFL_DEOPPED | CHFL_SERVOPOK); remove_user_from_channel(sptr, chptr); chptr = FindChannel(name); - } else - flags = CHFL_DEOPPED | (HasFlag(sptr, FLAG_TS8) ? CHFL_SERVOPOK : 0); + } + else + flags = CHFL_DEOPPED | (HasFlag(sptr, FLAG_TS8) ? CHFL_SERVOPOK : 0); /* Always copy the timestamp when it is older, that is the only way to ensure network-wide synchronization of creation times. */ if (creation && creation < chptr->creationtime) Index: ircd-ircdev/ircd/m_jupe.c diff -u ircd-ircdev/ircd/m_jupe.c:1.2 ircd-ircdev/ircd/m_jupe.c:1.3 --- ircd-ircdev/ircd/m_jupe.c:1.2 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_jupe.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_jupe.c,v 1.2 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_jupe.c,v 1.3 2004/11/24 16:02:28 zolty Exp $ * */ @@ -94,7 +94,6 @@ #include "s_conf.h" #include "s_misc.h" #include "send.h" -#include "support.h" #include <assert.h> #include <stdlib.h> Index: ircd-ircdev/ircd/m_kick.c diff -u ircd-ircdev/ircd/m_kick.c:1.4 ircd-ircdev/ircd/m_kick.c:1.5 --- ircd-ircdev/ircd/m_kick.c:1.4 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/m_kick.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_kick.c,v 1.4 2004/05/21 15:39:35 zolty Exp $ + * $Id: m_kick.c,v 1.5 2004/11/24 16:02:28 zolty Exp $ * */ @@ -144,8 +144,8 @@ /* Don't allow to kick member with a higher or equal op-level */ if ((OpLevel(member) <= OpLevel(member2)) && feature_bool(FEAT_OPLEVELS)) return send_reply(sptr, ERR_NOTLOWEROPLEVEL, cli_name(who), chptr->chname, - OpLevel(member2), OpLevel(member), "kick", - OpLevel(member) == OpLevel(member2) ? "the same" : "a higher"); + OpLevel(member2), OpLevel(member), "kick", + OpLevel(member) == OpLevel(member2) ? "the same" : "a higher"); #endif /* We rely on ircd_snprintf to truncate the comment */ @@ -206,9 +206,9 @@ /* Send HACK notice, but not for servers in BURST */ /* 2002-10-17: Don't send HACK if the users local server is kicking them */ - if (IsServer(sptr) - && !IsBurstOrBurstAck(sptr) - && sptr!=cli_from(who)) + if (IsServer(sptr) && + !IsBurstOrBurstAck(sptr) && + sptr!=cli_from(who)) sendto_opmask_butone(0, SNO_HACK4, "HACK: %C KICK %H %C %s", sptr, chptr, who, comment); Index: ircd-ircdev/ircd/m_links.c diff -u ircd-ircdev/ircd/m_links.c:1.3 ircd-ircdev/ircd/m_links.c:1.4 --- ircd-ircdev/ircd/m_links.c:1.3 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_links.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_links.c,v 1.3 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_links.c,v 1.4 2004/11/24 16:02:28 zolty Exp $ * */ @@ -113,17 +113,19 @@ char *mask; struct Client *acptr; - if (feature_bool(FEAT_HIS_LINKS) && !IsAnOper(sptr)) { + if (feature_bool(FEAT_HIS_LINKS) && !IsAnOper(sptr)) + { send_reply(sptr, RPL_ENDOFLINKS, parc < 2 ? "*" : parv[1]); sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s %s", sptr, - "/LINKS has been disabled; visit ", - feature_str(FEAT_HIS_URLSERVERS)); + "/LINKS has been disabled; visit ", + feature_str(FEAT_HIS_URLSERVERS)); return 0; } - if (parc > 2) { - if (hunt_server_cmd(sptr, CMD_LINKS, cptr, 1, "%C :%s", 1, parc, - parv) != HUNTED_ISME) + if (parc > 2) + { + if (hunt_server_cmd(sptr, CMD_LINKS, cptr, 1, "%C :%s", 1, parc, parv) != + HUNTED_ISME) return 0; mask = parv[2]; } @@ -142,6 +144,7 @@ } send_reply(sptr, RPL_ENDOFLINKS, BadPtr(mask) ? "*" : mask); + return 0; } @@ -157,32 +160,33 @@ * parv[1] = server to query * parv[2] = servername mask */ -int ms_links(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) -{ - char *mask; - struct Client *acptr; - - if (parc > 2) - { - if (hunt_server_cmd(sptr, CMD_LINKS, cptr, 1, "%C :%s", 1, parc, parv) != - HUNTED_ISME) - return 0; - mask = parv[2]; - } - else - mask = parc < 2 ? 0 : parv[1]; - - for (acptr = GlobalClientList, collapse(mask); acptr; acptr = cli_next(acptr)) - { - if (!IsServer(acptr) && !IsMe(acptr)) - continue; - if (!BadPtr(mask) && match(mask, cli_name(acptr))) - continue; - send_reply(sptr, RPL_LINKS, cli_name(acptr), cli_name(cli_serv(acptr)->up), - cli_hopcount(acptr), cli_serv(acptr)->prot, - ((cli_info(acptr))[0] ? cli_info(acptr) : "(Unknown Location)")); - } - - send_reply(sptr, RPL_ENDOFLINKS, BadPtr(mask) ? "*" : mask); - return 0; -} +int +ms_links(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) + { + char *mask; + struct Client *acptr; + + if (parc > 2) + { + if (hunt_server_cmd(sptr, CMD_LINKS, cptr, 1, "%C :%s", 1, parc, parv) != + HUNTED_ISME) + return 0; + mask = parv[2]; + } + else + mask = parc < 2 ? 0 : parv[1]; + + for (acptr = GlobalClientList, collapse(mask); acptr; acptr = cli_next(acptr)) + { + if (!IsServer(acptr) && !IsMe(acptr)) + continue; + if (!BadPtr(mask) && match(mask, cli_name(acptr))) + continue; + send_reply(sptr, RPL_LINKS, cli_name(acptr), cli_name(cli_serv(acptr)->up), + cli_hopcount(acptr), cli_serv(acptr)->prot, + ((cli_info(acptr))[0] ? cli_info(acptr) : "(Unknown Location)")); + } + + send_reply(sptr, RPL_ENDOFLINKS, BadPtr(mask) ? "*" : mask); + return 0; + } Index: ircd-ircdev/ircd/m_list.c diff -u ircd-ircdev/ircd/m_list.c:1.2 ircd-ircdev/ircd/m_list.c:1.3 --- ircd-ircdev/ircd/m_list.c:1.2 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_list.c Wed Nov 24 08:02:28 2004 @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * - * $Id: m_list.c,v 1.2 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_list.c,v 1.3 2004/11/24 16:02:28 zolty Exp $ * */ @@ -108,7 +108,7 @@ 0, /* min_time */ 4294967295U, /* max_users */ 0, /* min_users */ - 0, /* flags */ + 0, /* topic_limits */ 2147483647, /* max_topic_time */ 0, /* min_topic_time */ 0 /* chptr */ @@ -119,7 +119,7 @@ 0, /* min_time */ 4294967295U, /* max_users */ 0, /* min_users */ - 0, /* flags */ + 0, /* topic_limits */ 2147483647, /* max_topic_time */ 0, /* min_topic_time */ 0 /* chptr */ @@ -158,7 +158,7 @@ "set more than \037min_minutes\037 ago."); if (IsAnOper(sptr)) send_reply(sptr, RPL_LISTUSAGE, - " \002S\002 ; Show secret channels."); + " \002S\002 ; Show secret channels."); send_reply(sptr, RPL_LISTUSAGE, "Example: LIST <3,>1,C<10,T>0 ; 2 users, younger than 10 " "min., topic set."); @@ -243,7 +243,7 @@ param++; if (*param != ',' && *param != ' ' && *param != '\0') /* check syntax */ - return show_usage(sptr); + return show_usage(sptr); break; default: /* channel name? */ @@ -289,7 +289,6 @@ if (cli_listing(sptr)) /* Already listing ? */ { - cli_listing(sptr)->chptr->mode.mode &= ~MODE_LISTED; MyFree(cli_listing(sptr)); cli_listing(sptr) = 0; send_reply(sptr, RPL_LISTEND); @@ -329,14 +328,8 @@ cli_listing(sptr) = (struct ListingArgs*) MyMalloc(sizeof(struct ListingArgs)); assert(0 != cli_listing(sptr)); memcpy(cli_listing(sptr), &args, sizeof(struct ListingArgs)); - if ((cli_listing(sptr)->chptr = GlobalChannelList)) { - int m = GlobalChannelList->mode.mode & MODE_LISTED; - list_next_channels(sptr, 64); - GlobalChannelList->mode.mode |= m; - return 0; - } - MyFree(cli_listing(sptr)); - cli_listing(sptr) = 0; + list_next_channels(sptr); + return 0; } send_reply(sptr, RPL_LISTEND); return 0; Index: ircd-ircdev/ircd/m_lusers.c diff -u ircd-ircdev/ircd/m_lusers.c:1.3 ircd-ircdev/ircd/m_lusers.c:1.4 --- ircd-ircdev/ircd/m_lusers.c:1.3 Fri Apr 23 04:08:08 2004 +++ ircd-ircdev/ircd/m_lusers.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_lusers.c,v 1.3 2004/04/23 11:08:08 zolty Exp $ + * $Id: m_lusers.c,v 1.4 2004/11/24 16:02:28 zolty Exp $ */ /* @@ -108,7 +108,7 @@ int longoutput = MyUser(sptr) || IsOper(sptr); if (parc > 2) if (hunt_server_cmd(sptr, CMD_LUSERS, cptr, feature_int(FEAT_HIS_REMOTE), - "%s :%C", 2, parc, parv) != HUNTED_ISME) + "%s :%C", 2, parc, parv) != HUNTED_ISME) return 0; send_reply(sptr, RPL_LUSERCLIENT, UserStats.clients - UserStats.inv_clients, Index: ircd-ircdev/ircd/m_map.c diff -u ircd-ircdev/ircd/m_map.c:1.3 ircd-ircdev/ircd/m_map.c:1.4 --- ircd-ircdev/ircd/m_map.c:1.3 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_map.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_map.c,v 1.3 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_map.c,v 1.4 2004/11/24 16:02:28 zolty Exp $ * */ @@ -102,26 +102,33 @@ static void dump_map(struct Client *cptr, struct Client *server, char *mask, int prompt_length) { + const char *chr; static char prompt[64]; struct DLink *lp; - char *p = &prompt[prompt_length]; + char *p = prompt + prompt_length; int cnt = 0; - + *p = '\0'; if (prompt_length > 60) send_reply(cptr, RPL_MAPMORE, prompt, cli_name(server)); - else { + else + { char lag[512]; if (cli_serv(server)->lag>10000) - lag[0]=0; + lag[0]=0; else if (cli_serv(server)->lag<0) - strcpy(lag,"(0s)"); + strcpy(lag,"(0s)"); else - sprintf(lag,"(%is)",cli_serv(server)->lag); - send_reply(cptr, RPL_MAP, prompt, ( - (IsBurst(server)) ? "*" : (IsBurstAck(server) ? "!" : "")), - cli_name(server), lag, (server == &me) ? UserStats.local_clients : - cli_serv(server)->clients); + sprintf(lag,"(%is)",cli_serv(server)->lag); + if (IsBurst(server)) + chr = "*"; + else if (IsBurstAck(server)) + chr = "!"; + else + chr = ""; + send_reply(cptr, RPL_MAP, prompt, chr, cli_name(server), + lag, (server == &me) ? UserStats.local_clients : + cli_serv(server)->clients); } if (prompt_length > 0) { @@ -162,14 +169,25 @@ */ int m_map(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { - if (feature_bool(FEAT_HIS_MAP) && !IsAnOper(sptr)) { + if (feature_bool(FEAT_HIS_MAP) && !IsAnOper(sptr)) + { sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s %s", sptr, - "/MAP has been disabled; visit", - feature_str(FEAT_HIS_URLSERVERS)); + "/MAP has been disabled, from CFV-165. " + "Visit ", feature_str(FEAT_HIS_URLSERVERS)); return 0; } if (parc < 2) parv[1] = "*"; + dump_map(sptr, &me, parv[1], 0); + send_reply(sptr, RPL_MAPEND); + + return 0; +} + +int mo_map(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) +{ + if (parc < 2) + parv[1] = "*"; dump_map(sptr, &me, parv[1], 0); send_reply(sptr, RPL_MAPEND); Index: ircd-ircdev/ircd/m_mode.c diff -u ircd-ircdev/ircd/m_mode.c:1.3 ircd-ircdev/ircd/m_mode.c:1.4 --- ircd-ircdev/ircd/m_mode.c:1.3 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_mode.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_mode.c,v 1.3 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_mode.c,v 1.4 2004/11/24 16:02:28 zolty Exp $ * */ @@ -111,7 +111,7 @@ clean_channelname(parv[1]); - if (!(chptr = FindChannel(parv[1]))) + if (!IsChannelName(parv[1]) || !(chptr = FindChannel(parv[1]))) return set_user_mode(cptr, sptr, parc, parv); ClrFlag(sptr, FLAG_TS8); Index: ircd-ircdev/ircd/m_nick.c diff -u ircd-ircdev/ircd/m_nick.c:1.4 ircd-ircdev/ircd/m_nick.c:1.5 --- ircd-ircdev/ircd/m_nick.c:1.4 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/m_nick.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_nick.c,v 1.4 2004/05/21 15:39:35 zolty Exp $ + * $Id: m_nick.c,v 1.5 2004/11/24 16:02:28 zolty Exp $ * */ @@ -250,7 +250,7 @@ */ if (IsUnknown(acptr) && MyConnect(acptr)) { ++ServerStats->is_ref; - IPcheck_connect_fail(cli_ip(acptr)); + IPcheck_connect_fail(&cli_ip(acptr)); exit_client(cptr, acptr, &me, "Overridden by other sign on"); return set_nick_name(cptr, sptr, nick, parc, parv); } @@ -284,17 +284,18 @@ */ int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { - struct Client* acptr; - char nick[NICKLEN + 2]; - time_t lastnick = 0; - int differ = 1; - int samelastnick = 0; - + struct Client *acptr; + char nick[NICKLEN + 2]; + time_t lastnick = 0; + int differ = 1; + const char *type; + assert(0 != cptr); assert(0 != sptr); assert(IsServer(cptr)); - if ((IsServer(sptr) && parc < 8) || parc < 3) { + if ((IsServer(sptr) && parc < 8) || parc < 3) + { sendto_opmask_butone(0, SNO_OLDSNO, "bad NICK param count for %s from %C", parv[1], cptr); return need_more_params(sptr, "NICK"); @@ -303,12 +304,14 @@ ircd_strncpy(nick, parv[1], NICKLEN); nick[NICKLEN] = '\0'; - if (IsServer(sptr)) { + if (IsServer(sptr)) + { lastnick = atoi(parv[3]); if (lastnick > OLDEST_TS && !IsBurstOrBurstAck(sptr)) cli_serv(sptr)->lag = TStime() - lastnick; } - else { + else + { lastnick = atoi(parv[2]); if (lastnick > OLDEST_TS && !IsBurstOrBurstAck(sptr)) cli_serv(cli_user(sptr)->server)->lag = TStime() - lastnick; @@ -322,14 +325,15 @@ if (!do_nick_name(nick) || strcmp(nick, parv[1])) { send_reply(sptr, ERR_ERRONEUSNICKNAME, parv[1]); - + ++ServerStats->is_kill; sendto_opmask_butone(0, SNO_OLDSNO, "Bad Nick: %s From: %s %C", parv[1], parv[0], cptr); sendcmdto_one(&me, CMD_KILL, cptr, "%s :%s (%s <- %s[%s])", - IsServer(sptr) ? parv[parc - 2] : parv[0], - cli_name(&me), parv[1], nick, cli_name(cptr)); - if (!IsServer(sptr)) { + IsServer(sptr) ? parv[parc - 2] : parv[0], cli_name(&me), parv[1], + nick, cli_name(cptr)); + if (!IsServer(sptr)) + { /* * bad nick _change_ */ @@ -341,25 +345,10 @@ } return 0; } - /* - * Check against nick name collisions. - * - * Put this 'if' here so that the nesting goes nicely on the screen :) - * We check against server name list before determining if the nickname - * is present in the nicklist (due to the way the below for loop is - * constructed). -avalon - */ - - assert(NULL == strchr(nick,'.')); - - acptr = FindClient(nick); - if (!acptr) { - /* - * No collisions, all clear... - */ + /* Check against nick name collisions. */ + if ((acptr = FindClient(nick)) == NULL) + /* No collisions, all clear... */ return set_nick_name(cptr, sptr, nick, parc, parv); - } - assert(0 != acptr); /* * If acptr == sptr, then we have a client doing a nick @@ -367,23 +356,16 @@ * is concerned (user is changing the case of his/her * nickname or somesuch) */ - if (acptr == sptr) { - if (strcmp(cli_name(acptr), nick) == 0) - /* - * This is just ':old NICK old' type thing. - * Just forget the whole thing here. There is - * no point forwarding it to anywhere, - * especially since servers prior to this - * version would treat it as nick collision. - */ - return 0; /* NICK Message ignored */ - else - /* - * Allows change of case in his/her nick - */ + if (acptr == sptr) + { + if (strcmp(cli_name(acptr), nick) != 0) + /* Allows change of case in his/her nick */ return set_nick_name(cptr, sptr, nick, parc, parv); + else + /* Setting their nick to what it already is? Ignore it. */ + return 0; } - + /* now we know we have a real collision. */ /* * Note: From this point forward it can be assumed that * acptr != sptr (point to different client structures). @@ -395,9 +377,10 @@ * and proceed with the nick. This should take care of the * "dormant nick" way of generating collisions... */ - if (IsUnknown(acptr) && MyConnect(acptr)) { - ++ServerStats->is_ref; - IPcheck_connect_fail(cli_ip(acptr)); + if (IsUnknown(acptr) && MyConnect(acptr)) + { + ServerStats->is_ref++; + IPcheck_connect_fail(&cli_ip(acptr)); exit_client(cptr, acptr, &me, "Overridden by other sign on"); return set_nick_name(cptr, sptr, nick, parc, parv); } @@ -419,34 +402,37 @@ * --Run * */ - - - if (IsServer(sptr)) { + if (IsServer(sptr)) + { + struct irc_in_addr ip; /* * A new NICK being introduced by a neighbouring * server (e.g. message type ":server NICK new ..." received) * * compare IP address and username */ - differ = (cli_ip(acptr).s_addr != htonl(base64toint(parv[parc - 3]))) || + base64toip(parv[parc - 3], &ip); + differ = (0 != memcmp(&cli_ip(acptr), &ip, sizeof(cli_ip(acptr)))) || (0 != ircd_strcmp(cli_user(acptr)->username, parv[4])); sendto_opmask_butone(0, SNO_OLDSNO, "Nick collision on %C (%C %Tu <- " "%C %Tu (%s user@host))", acptr, cli_from(acptr), cli_lastnick(acptr), cptr, lastnick, differ ? "Different" : "Same"); } - else { + else + { /* * A NICK change has collided (e.g. message type ":old NICK new"). * * compare IP address and username */ - differ = (cli_ip(acptr).s_addr != cli_ip(sptr).s_addr) || - (0 != ircd_strcmp(cli_user(acptr)->username, cli_user(sptr)->username)); + differ = (0 != memcmp(&cli_ip(acptr), &cli_ip(sptr), sizeof(cli_ip(acptr)))) || + (0 != ircd_strcmp(cli_user(acptr)->username, cli_user(sptr)->username)); sendto_opmask_butone(0, SNO_OLDSNO, "Nick change collision from %C to " "%C (%C %Tu <- %C %Tu)", sptr, acptr, cli_from(acptr), cli_lastnick(acptr), cptr, lastnick); } + type = differ ? "older nick overruled" : "nick collision from same user@host"; /* * Now remove (kill) the nick on our side if it is the youngest. * If no timestamp was received, we ignore the incoming nick @@ -456,75 +442,66 @@ * * This exits the client sending the NICK message */ - if (cli_from(acptr) != cptr) { - if ((differ && lastnick >= cli_lastnick(acptr)) || - (!differ && lastnick <= cli_lastnick(acptr))) { - if (!IsServer(sptr)) { - ++ServerStats->is_kill; - sendcmdto_serv_butone(&me, CMD_KILL, NULL, "%C :%s (Nick collision)", - sptr, cli_name(&me)); - assert(!MyConnect(sptr)); - - SetFlag(sptr, FLAG_KILLED); - - exit_client_msg(cptr, sptr, &me, - "Killed (%s (Nick collision))", - feature_str(FEAT_HIS_SERVERNAME)); - - sptr = 0; /* Make sure we don't use the dead client */ - - } else { - /* We need to kill this incoming client, which hasn't been properly registered yet. - * Send a KILL message upstream to the server it came from */ - sendcmdto_one(&me, CMD_KILL, sptr, "%s :%s (Nick collision)", parv[parc-2], cli_name(&me)); - } - /* If the two have the same TS then we want to kill both sides, so - * don't leave yet! + if ((differ && lastnick >= cli_lastnick(acptr)) || + (!differ && lastnick <= cli_lastnick(acptr))) + { + /* We need to bounce this kill straight back... Although the nick message + * for acptr is probably waiting in their recvq from me, its also possible + * that sptr will change their nick on cptr before cptr receives the + * nick message for acptr, which would leave acptr and sptr both alive + * on cptr, but only acptr alive on me, i.e. desync. This extra kill + * message has been absent for a while in ircu although it was a major + * problem when it was tried on efnet, so I don't know how big an issue it + * is. Probably best that this be left here, anyway... + */ + ServerStats->is_kill++; + sendcmdto_one(&me, CMD_KILL, cptr, "%s :%s (%s)", + nick, cli_name(&me), type); + /* But if this was a nick change and not a nick introduction, + * we also need to ensure that we remove our local state + * record of the original client... Also, the rest of the + * net should be informed... + */ + if (!IsServer(sptr)) + { + assert(!MyConnect(sptr)); + /* Inform the rest of the net... */ + sendcmdto_serv_butone(&me, CMD_KILL, cptr, "%s :%s (%s)", + nick, cli_name(&me), type); + /* Don't go sending off a QUIT message... */ + SetFlag(sptr, FLAG_KILLED); + /* Remove them locally. */ + exit_client_msg(cptr, sptr, &me, + "Killed (%s (%s))", + feature_str(FEAT_HIS_SERVERNAME), type); + /* + * We have killed sptr off, zero out it's pointer so if it's used + * again we'll know about it --Bleep */ - if (lastnick != cli_lastnick(acptr)) - return 0; /* Ignore the NICK */ + sptr = NULL; } - send_reply(acptr, ERR_NICKCOLLISION, nick); + /* If the timestamps differ and we just killed sptr, we don't need to kill + * acptr as well. + */ + if (lastnick != cli_lastnick(acptr)) + return 0; } + /* Tell acptr why we are killing it. */ + send_reply(acptr, ERR_NICKCOLLISION, nick); - ++ServerStats->is_kill; + ServerStats->is_kill++; SetFlag(acptr, FLAG_KILLED); - - if (lastnick == cli_lastnick(acptr)) - samelastnick = 1; - /* * This exits the client we had before getting the NICK message */ - if (differ) { - sendcmdto_serv_butone(&me, CMD_KILL, NULL, "%C :%s (older nick " - "overruled)", acptr, cli_name(&me)); - if (MyConnect(acptr)) { - sendcmdto_one(acptr, CMD_QUIT, cptr, ":Killed (%s (older " - "nick overruled))", feature_str(FEAT_HIS_SERVERNAME)); - sendcmdto_one(&me, CMD_KILL, acptr, "%C :%s (older nick " - "overruled)", acptr, feature_str(FEAT_HIS_SERVERNAME)); - } - - exit_client_msg(cptr, acptr, &me, "Killed (%s (older nick " - "overruled))", feature_str(FEAT_HIS_SERVERNAME)); - } - else { - sendcmdto_serv_butone(&me, CMD_KILL, NULL, "%C :%s (nick collision from " - "same user@host)", acptr, cli_name(&me)); - if (MyConnect(acptr)) { - sendcmdto_one(acptr, CMD_QUIT, cptr, ":Killed (%s (nick " - "collision from same user@host))", - feature_str(FEAT_HIS_SERVERNAME)); - sendcmdto_one(&me, CMD_KILL, acptr, "%C :%s (older nick " - "overruled)", acptr, feature_str(FEAT_HIS_SERVERNAME)); - } - exit_client_msg(cptr, acptr, &me, "Killed (%s (nick collision from " - "same user@host))", feature_str(FEAT_HIS_SERVERNAME)); - } - if (samelastnick) + sendcmdto_serv_butone(&me, CMD_KILL, NULL, "%C :%s" + " (%s)", acptr, feature_str(FEAT_HIS_SERVERNAME), + type); + exit_client_msg(cptr, acptr, &me, "Killed (%s (%s))", + feature_str(FEAT_HIS_SERVERNAME), type); + if (lastnick == cli_lastnick(acptr)) + return 0; + if (sptr == NULL) return 0; - - assert(0 != sptr); return set_nick_name(cptr, sptr, nick, parc, parv); } Index: ircd-ircdev/ircd/m_oper.c diff -u ircd-ircdev/ircd/m_oper.c:1.4 ircd-ircdev/ircd/m_oper.c:1.5 --- ircd-ircdev/ircd/m_oper.c:1.4 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/m_oper.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_oper.c,v 1.4 2004/05/21 15:39:35 zolty Exp $ + * $Id: m_oper.c,v 1.5 2004/11/24 16:02:28 zolty Exp $ */ /* @@ -82,11 +82,12 @@ #include "client.h" #include "hash.h" #include "ircd.h" +#include "ircd_alloc.h" +#include "ircd_crypt.h" #include "ircd_features.h" #include "ircd_log.h" #include "ircd_reply.h" #include "ircd_string.h" -#include "ircd_xopen.h" #include "msg.h" #include "numeric.h" #include "numnicks.h" @@ -96,7 +97,6 @@ #include "s_user.h" #include "s_misc.h" #include "send.h" -#include "support.h" #include <assert.h> #include <stdlib.h> @@ -104,6 +104,8 @@ int oper_password_match(const char* to_match, const char* passwd) { + char *crypted; + int res; /* * use first two chars of the password they send in as salt * @@ -112,10 +114,16 @@ if (!to_match || !passwd) return 0; - if (feature_bool(FEAT_CRYPT_OPER_PASSWORD)) - to_match = ircd_crypt(to_match, passwd); - - return (0 == strcmp(to_match, passwd)); + /* we no longer do a CRYPT_OPER_PASSWORD check because a clear + text passwords just handled by a fallback mechanism called + crypt_clear if it's enabled -- hikari */ + crypted = ircd_crypt(to_match, passwd); + + if (to_match == NULL) + return 0; + res = strcmp(crypted, passwd); + MyFree(crypted); + return 0 == res; } /* @@ -136,12 +144,9 @@ if (EmptyString(name) || EmptyString(password)) return need_more_params(sptr, "OPER"); - aconf = find_conf_exact(name, cli_username(sptr), cli_sockhost(sptr), CONF_OPERATOR); - if (!aconf) - aconf = find_conf_exact(name, cli_username(sptr), - ircd_ntoa((const char*) &(cli_ip(cptr))), CONF_OPERATOR); - - if (!aconf || IsIllegal(aconf)) { + aconf = find_conf_exact(name, sptr, CONF_OPERATOR); + if (!aconf || IsIllegal(aconf)) + { send_reply(sptr, ERR_NOOPERHOST); sendto_opmask_butone(0, SNO_OLDREALOP, "Failed OPER attempt by %s (%s@%s)", parv[0], cli_user(sptr)->username, cli_sockhost(sptr)); @@ -149,7 +154,8 @@ } assert(0 != (aconf->status & CONF_OPERATOR)); - if (oper_password_match(password, aconf->passwd)) { + if (oper_password_match(password, aconf->passwd)) + { struct Flags old_mode = cli_flags(sptr); if (ACR_OK != attach_conf(sptr, aconf)) { @@ -184,7 +190,8 @@ log_write(LS_OPER, L_INFO, 0, "OPER (%s) by (%#C)", name, sptr); } - else { + else + { send_reply(sptr, ERR_PASSWDMISMATCH); sendto_opmask_butone(0, SNO_OLDREALOP, "Failed OPER attempt by %s (%s@%s)", parv[0], cli_user(sptr)->username, cli_sockhost(sptr)); @@ -202,7 +209,8 @@ /* * if message arrived from server, trust it, and set to oper */ - if (!IsServer(sptr) && !IsOper(sptr)) { + if (!IsServer(sptr) && !IsOper(sptr)) + { ++UserStats.opers; SetFlag(sptr, FLAG_OPER); sendcmdto_serv_butone(sptr, CMD_MODE, cptr, "%s :+o", parv[0]); Index: ircd-ircdev/ircd/m_opmode.c diff -u ircd-ircdev/ircd/m_opmode.c:1.3 ircd-ircdev/ircd/m_opmode.c:1.4 --- ircd-ircdev/ircd/m_opmode.c:1.3 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_opmode.c Wed Nov 24 08:02:28 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_opmode.c,v 1.3 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_opmode.c,v 1.4 2004/11/24 16:02:28 zolty Exp $ * */ @@ -109,7 +109,7 @@ if (IsLocalChannel(parv[1])) return 0; - if (!(chptr = FindChannel(parv[1]))) + if ('#' != *parv[1] || !(chptr = FindChannel(parv[1]))) return send_reply(sptr, ERR_NOSUCHCHANNEL, parv[1]); modebuf_init(&mbuf, sptr, cptr, chptr, @@ -148,9 +148,11 @@ return need_more_params(sptr, "OPMODE"); chname = parv[1]; - if (*chname == '!') { + if (*chname == '!') + { chname++; - if (!HasPriv(sptr, IsLocalChannel(chname) ? PRIV_FORCE_LOCAL_OPMODE : PRIV_FORCE_OPMODE)) + if (!HasPriv(sptr, IsLocalChannel(chname) ? PRIV_FORCE_LOCAL_OPMODE + : PRIV_FORCE_OPMODE)) return send_reply(sptr, ERR_NOPRIVILEGES); force = 1; } @@ -160,7 +162,7 @@ IsLoca... [truncated message content] |
From: Toni G. <zo...@us...> - 2004-11-24 16:01:53
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-11-24 16:00:55 UTC Modified files: include/IPcheck.h include/channel.h include/class.h include/client.h include/crule.h include/dbuf.h include/destruct_event.h include/fileio.h include/gline.h include/handlers.h include/hash.h include/ircd.h include/ircd_alloc.h include/ircd_chattr.h include/ircd_defs.h include/ircd_events.h include/ircd_features.h include/ircd_handler.h include/ircd_log.h include/ircd_osdep.h include/ircd_relay.h include/ircd_reply.h include/ircd_signal.h include/ircd_snprintf.h include/ircd_string.h include/ircd_tea.h include/jupe.h include/list.h include/listener.h include/match.h include/motd.h include/msg.h include/msgq.h include/numeric.h include/numnicks.h include/opercmds.h include/packet.h include/parse.h include/patchlevel.h include/querycmds.h include/random.h include/res.h include/s_auth.h include/s_bsd.h include/s_conf.h include/s_debug.h include/s_misc.h include/s_numeric.h include/s_serv.h include/s_stats.h include/s_user.h include/send.h include/struct.h include/supported.h include/uping.h include/userload.h include/whocmds.h include/whowas.h Added files: include/.cvsignore include/ircd_auth.h include/ircd_crypt.h include/ircd_crypt_native.h include/ircd_crypt_plain.h include/ircd_crypt_smd5.h include/ircd_reslib.h include/memdebug.h include/umkpasswd.h Removed files: include/fda.h include/iauth.h include/ircd_xopen.h include/support.h Log message: Author: zoltan <zo...@ir...> Log message: 2004-11-24 Toni García <zo...@ir...> 1.0.alpha13 * Comentarios para Doxygen * Excepciones de Silences * Soporte total de IPv6 * Sincronizacion Undernet ---------------------- diff included ---------------------- Index: ircd-ircdev/include/.cvsignore diff -u /dev/null ircd-ircdev/include/.cvsignore:1.1 --- /dev/null Wed Nov 24 08:00:55 2004 +++ ircd-ircdev/include/.cvsignore Wed Nov 24 08:00:42 2004 @@ -0,0 +1 @@ +patchlist.h Index: ircd-ircdev/include/IPcheck.h diff -u ircd-ircdev/include/IPcheck.h:1.2 ircd-ircdev/include/IPcheck.h:1.3 --- ircd-ircdev/include/IPcheck.h:1.2 Sun Feb 22 08:13:20 2004 +++ ircd-ircdev/include/IPcheck.h Wed Nov 24 08:00:43 2004 @@ -18,8 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: IPcheck.h,v 1.2 2004/02/22 16:13:20 zolty Exp $ - * + */ +/** @file + * @brief Interface to count users connected from particular IP addresses. + * @version $Id: IPcheck.h,v 1.3 2004/11/24 16:00:43 zolty Exp $ */ #ifndef INCLUDED_ipcheck_h #define INCLUDED_ipcheck_h @@ -28,19 +30,16 @@ #include <sys/types.h> /* time_t, size_t */ #define INCLUDED_sys_types_h #endif -#ifndef INCLUDED_netinet_in_h -#include <netinet/in.h> /* in_addr */ -#define INCLUDED_netinet_in_h -#endif struct Client; +struct irc_in_addr; /* * Prototypes */ extern void IPcheck_init(void); -extern int IPcheck_local_connect(struct in_addr ip, time_t* next_target_out); -extern void IPcheck_connect_fail(struct in_addr ip); +extern int IPcheck_local_connect(const struct irc_in_addr *ip, time_t *next_target_out); +extern void IPcheck_connect_fail(const struct irc_in_addr *ip); extern void IPcheck_connect_succeeded(struct Client *cptr); extern int IPcheck_remote_connect(struct Client *cptr, int is_burst); extern void IPcheck_disconnect(struct Client *cptr); Index: ircd-ircdev/include/channel.h diff -u ircd-ircdev/include/channel.h:1.5 ircd-ircdev/include/channel.h:1.6 --- ircd-ircdev/include/channel.h:1.5 Fri May 21 08:39:33 2004 +++ ircd-ircdev/include/channel.h Wed Nov 24 08:00:43 2004 @@ -19,8 +19,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: channel.h,v 1.5 2004/05/21 15:39:33 zolty Exp $ - * + */ +/** @file + * @brief Channel management and maintenance. + * @version $Id: channel.h,v 1.6 2004/11/24 16:00:43 zolty Exp $ */ #ifndef INCLUDED_channel_h #define INCLUDED_channel_h @@ -32,6 +34,9 @@ #include <sys/types.h> #define INCLUDED_sys_types_h #endif +#ifndef INCLUDED_res_h +#include "res.h" +#endif struct SLink; struct Client; @@ -40,17 +45,17 @@ * General defines */ -#define MAXMODEPARAMS 6 -#define MODEBUFLEN 200 +#define MAXMODEPARAMS 6 /**< Maximum number of mode parameters */ +#define MODEBUFLEN 200 /**< Maximum length of a mode */ -#define KEYLEN 23 +#define KEYLEN 23 /**< Maximum length of a key */ #if defined(UNDERNET) -#define PASSLEN 23 +#define PASSLEN 23 /**< Maximum length of a password */ #endif -#define CHANNELLEN 200 +#define CHANNELLEN 200 /**< Maximum length of a channel */ -#define MAXJOINARGS 15 /* number of slots for join buffer */ -#define STARTJOINLEN 10 /* fuzzy numbers */ +#define MAXJOINARGS 15 /**< number of slots for join buffer */ +#define STARTJOINLEN 10 /**< fuzzy numbers */ #define STARTCREATELEN 20 /* @@ -59,27 +64,32 @@ #define ChannelExists(n) (0 != FindChannel(n)) -#define CHFL_CHANOP 0x0001 /* Channel operator */ -#define CHFL_VOICE 0x0002 /* the power to speak */ -#define CHFL_DEOPPED 0x0004 /* Is de-opped by a server */ -#define CHFL_SERVOPOK 0x0008 /* Server op allowed */ -#define CHFL_ZOMBIE 0x0010 /* Kicked from channel */ -#define CHFL_BAN 0x0020 /* ban channel flag */ -#define CHFL_BAN_IPMASK 0x0040 /* ban mask is an IP-number mask */ -#define CHFL_BAN_OVERLAPPED 0x0080 /* ban overlapped, need bounce */ -#define CHFL_BURST_JOINED 0x0100 /* Just joined by net.junction */ -#define CHFL_BURST_BAN 0x0200 /* Ban part of last BURST */ -#define CHFL_BURST_BAN_WIPEOUT 0x0400 /* Ban will be wiped at end of BURST */ -#define CHFL_BANVALID 0x0800 /* CHFL_BANNED bit is valid */ -#define CHFL_BANNED 0x1000 /* Channel member is banned */ -#define CHFL_SILENCE_IPMASK 0x2000 /* silence mask is an IP-number mask */ +#define CHFL_CHANOP 0x0001 /**< Channel operator */ +#define CHFL_VOICE 0x0002 /**< the power to speak */ +#define CHFL_DEOPPED 0x0004 /**< Is de-opped by a server */ +#define CHFL_SERVOPOK 0x0008 /**< Server op allowed */ +#define CHFL_ZOMBIE 0x0010 /**< Kicked from channel */ +#define CHFL_BURST_JOINED 0x0100 /**< Just joined by net.junction */ +#define CHFL_BANVALID 0x0800 /**< CHFL_BANNED bit is valid */ +#define CHFL_BANNED 0x1000 /**< Channel member is banned */ +#define CHFL_SILENCE_IPMASK 0x2000 /**< silence mask is a CIDR */ #if defined(UNDERNET) -#define CHFL_BURST_ALREADY_OPPED 0x04000 /* In oob BURST, but was already joined and opped */ -#define CHFL_BURST_ALREADY_VOICED 0x08000 /* In oob BURST, but was already joined and voiced */ -#define CHFL_CHANNEL_MANAGER 0x10000 /* Set when creating channel or using Apass */ -#endif -#define CHFL_USER_PARTING 0x20000 /* User is already parting that channel */ -#define CHFL_DELAYED 0x40000 /* User's join message is delayed */ +#define CHFL_BURST_ALREADY_OPPED 0x04000 + /**< In oob BURST, but was already + * joined and opped + */ +#define CHFL_BURST_ALREADY_VOICED 0x08000 + /**, In oob BURST, but was already + * joined and voiced + */ +#define CHFL_CHANNEL_MANAGER 0x10000 /**< Set when creating channel or using + * Apass + */ +#endif +#define CHFL_USER_PARTING 0x20000 /**< User is already parting that + * channel + */ +#define CHFL_DELAYED 0x40000 /**< User's join message is delayed */ #define CHFL_OVERLAP (CHFL_CHANOP | CHFL_VOICE) #define CHFL_BANVALIDMASK (CHFL_BANVALID | CHFL_BANNED) @@ -87,54 +97,60 @@ /* Channel Visibility macros */ -#define MODE_CHANOP CHFL_CHANOP -#define MODE_VOICE CHFL_VOICE -#define MODE_PRIVATE 0x0004 -#define MODE_SECRET 0x0008 -#define MODE_MODERATED 0x0010 -#define MODE_TOPICLIMIT 0x0020 -#define MODE_INVITEONLY 0x0040 -#define MODE_NOPRIVMSGS 0x0080 -#define MODE_KEY 0x0100 -#define MODE_BAN 0x0200 -#define MODE_LIMIT 0x0400 -#define MODE_REGONLY 0x0800 /* Only +r users may join */ -#define MODE_DELJOINS 0x1000 /* New join messages are delayed */ -#define MODE_LISTED 0x10000 -#define MODE_SAVE 0x20000 /* save this mode-with-arg 'til later */ -#define MODE_FREE 0x40000 /* string needs to be passed to MyFree() */ -#define MODE_BURSTADDED 0x80000 /* channel was created by a BURST */ +#define MODE_CHANOP CHFL_CHANOP /**< +o Chanop */ +#define MODE_VOICE CHFL_VOICE /**< +v Voice */ +#define MODE_PRIVATE 0x0004 /**< +p Private */ +#define MODE_SECRET 0x0008 /**< +s Secret */ +#define MODE_MODERATED 0x0010 /**< +m Moderated */ +#define MODE_TOPICLIMIT 0x0020 /**< +t Topic Limited */ +#define MODE_INVITEONLY 0x0040 /**< +i Invite only */ +#define MODE_NOPRIVMSGS 0x0080 /**< +n No Private Messages */ +#define MODE_KEY 0x0100 /**< +k Keyed */ +#define MODE_BAN 0x0200 /**< +b Ban */ +#define MODE_LIMIT 0x0400 /**< +l Limit */ +#define MODE_REGONLY 0x0800 /**< Only +r users may join */ +#define MODE_DELJOINS 0x1000 /**< New join messages are delayed */ +#define MODE_SAVE 0x20000 /**< save this mode-with-arg 'til + * later */ +#define MODE_FREE 0x40000 /**< string needs to be passed to + * MyFree() */ +#define MODE_BURSTADDED 0x80000 /**< channel was created by a BURST */ #if defined(UNDERNET) #define MODE_UPASS 0x100000 #define MODE_APASS 0x200000 #endif -#define MODE_WASDELJOINS 0x400000 /* Not DELJOINS, but some joins pending */ -/* - * mode flags which take another parameter (With PARAmeterS) - */ +#define MODE_WASDELJOINS 0x400000 /**< Not DELJOINS, but some joins + * pending */ #if defined(UNDERNET) +/** mode flags which take another parameter (With PARAmeterS) + */ #define MODE_WPARAS (MODE_CHANOP|MODE_VOICE|MODE_BAN|MODE_KEY|MODE_LIMIT|MODE_APASS|MODE_UPASS) -#define infochanmodes feature_bool(FEAT_OPLEVELS) ? "AbiklmnopstuvrD" : "biklmnopstvrD" -#define infochanmodeswithparams feature_bool(FEAT_OPLEVELS) ? "Abklouv" : "bklov" +/** Available Channel modes */ +#define infochanmodes feature_bool(FEAT_OPLEVELS) ? "AbiklmnopstUvrD" : "biklmnopstvrD" +/** Available Channel modes that take parameters */ +#define infochanmodeswithparams feature_bool(FEAT_OPLEVELS) ? "AbkloUv" : "bklov" #else +/** mode flags which take another parameter (With PARAmeterS) + */ #define MODE_WPARAS (MODE_CHANOP|MODE_VOICE|MODE_BAN|MODE_KEY|MODE_LIMIT) +/** Available Channel modes */ #define infochanmodes "biklmnopstvrD" +/** Available Channel modes that take parameters */ #define infochanmodeswithparams "bklov" #endif #define HoldChannel(x) (!(x)) -/* name invisible */ +/** name invisible */ #define SecretChannel(x) ((x) && ((x)->mode.mode & MODE_SECRET)) -/* channel not shown but names are */ +/** channel not shown but names are */ #define HiddenChannel(x) ((x) && ((x)->mode.mode & MODE_PRIVATE)) -/* channel visible */ +/** channel visible */ #define ShowChannel(v,c) (PubChannel(c) || find_channel_member((v),(c)) || \ (IsAnOper(v) && HasPriv(v, PRIV_LIST_CHAN))) #define PubChannel(x) ((!x) || ((x)->mode.mode & \ (MODE_PRIVATE | MODE_SECRET)) == 0) -#define is_listed(x) ((x)->mode.mode & MODE_LISTED) #define IsGlobalChannel(name) (*(name) == '#') #define IsLocalChannel(name) (*(name) == '&') @@ -156,7 +172,7 @@ #define LISTARG_TOPICLIMITS 0x0001 #define LISTARG_SHOWSECRET 0x0002 -/* +/** * Maximum acceptable lag time in seconds: A channel younger than * this is not protected against hacking admins. * Mainly here to check if the TS clocks really sync (otherwise this @@ -169,14 +185,16 @@ */ #define TS_LAG_TIME 86400 -/* +/** * A Magic TS that is used for channels that are created by JOIN, * a channel with this TS accepts all TS without complaining that * it might receive later via MODE or CREATE. + * + * Part of the P9 compatibility, shouldn't occur on a P10 network. */ #define MAGIC_REMOTE_JOIN_TS 1270080000 -/* +/** * used in can_join to determine if an oper forced a join on a channel */ #define MAGIC_OPER_OVERRIDE 1000 @@ -192,16 +210,24 @@ * Structures */ +/** Information about a client on one channel + * + * This structure forms a sparse matrix with users down the side, and + * channels across the top. This matrix holds all the information about + * which users are on what channels, and what modes that user has on that + * channel (if they are op'd, voice'd and cached information if they are + * banned or not) + */ struct Membership { - struct Client* user; - struct Channel* channel; - struct Membership* next_member; - struct Membership* prev_member; - struct Membership* next_channel; - struct Membership* prev_channel; - unsigned int status; + struct Client* user; /**< The user */ + struct Channel* channel; /**< The channel */ + struct Membership* next_member; /**< The next user on this channel */ + struct Membership* prev_member; /**< The previous user on this channel*/ + struct Membership* next_channel; /**< Next channel this user is on */ + struct Membership* prev_channel; /**< Previous channel this user is on*/ + unsigned int status; /**< Flags for op'd, voice'd, etc */ #if defined(UNDERNET) - unsigned short oplevel; + unsigned short oplevel; /**< Op level */ #endif }; @@ -210,7 +236,7 @@ #define MAXOPLEVEL 999 #endif -#define IsZombie(x) ((x)->status & CHFL_ZOMBIE) +#define IsZombie(x) ((x)->status & CHFL_ZOMBIE) /**< see \ref zombie */ #define IsDeopped(x) ((x)->status & CHFL_DEOPPED) #define IsBanned(x) ((x)->status & CHFL_BANNED) #define IsBanValid(x) ((x)->status & CHFL_BANVALID) @@ -248,7 +274,7 @@ #define ClearBurstJoined(x) ((x)->status &= ~CHFL_BURST_JOINED) #define ClearDelayedJoin(x) ((x)->status &= ~CHFL_DELAYED) - +/** Mode information for a channel */ struct Mode { unsigned int mode; unsigned int limit; @@ -259,23 +285,49 @@ #endif }; +#define BAN_IPMASK 0x0001 /**< ban mask is an IP-number mask */ +#define BAN_OVERLAPPED 0x0002 /**< ban overlapped, need bounce */ +#define BAN_BURSTED 0x0004 /**< Ban part of last BURST */ +#define BAN_BURST_WIPEOUT 0x0008 /**< Ban will be wiped at EOB */ +#define BAN_EXCEPTION 0x0010 /**< Ban is an exception */ +#define BAN_DEL 0x4000 /**< Ban is being removed */ +#define BAN_ADD 0x8000 /**< Ban is being added */ + +/** A single ban for a channel. */ +struct Ban { + struct Ban* next; /**< next ban in the channel */ + struct irc_in_addr address; /**< addres for BAN_IPMASK bans */ + time_t when; /**< timestamp when ban was added */ + unsigned short flags; /**< modifier flags for the ban */ + unsigned char nu_len; /**< length of nick!user part of banstr */ + unsigned char addrbits; /**< netmask length for BAN_IPMASK bans */ + char *who; /**< name of client that set the ban */ + char *banstr; /**< hostmask that the ban matches */ +}; + +/** Information about a channel */ struct Channel { - struct Channel* next; - struct Channel* prev; - struct Channel* hnext; - struct DestructEvent* destruct_event; - time_t creationtime; - time_t topic_time; - unsigned int users; - struct Membership* members; - struct SLink* invites; - struct SLink* banlist; - struct Mode mode; - char topic[TOPICLEN + 1]; - char topic_nick[NICKLEN + 1]; - char chname[1]; + struct Channel* next; /**< next channel in the global channel list */ + struct Channel* prev; /**< previous channel */ + struct Channel* hnext; /**< Next channel in the hash table */ + struct DestructEvent* destruct_event; + time_t creationtime; /**< Creation time of this channel */ + time_t topic_time; /**< Modification time of the topic */ + unsigned int users; /**< Number of clients on this channel */ + struct Membership* members; /**< Pointer to the clients on this channel*/ + struct SLink* invites; /**< List of invites on this channel */ + struct Ban* banlist; /**< List of bans on this channel */ + struct Mode mode; /**< This channels mode */ + char topic[TOPICLEN + 1]; /**< Channels topic */ + char topic_nick[NICKLEN + 1]; /**< Nick of the person who set + * The topic + */ + char chname[1]; /**< Dynamically allocated string of the + * channel name + */ }; +/** Information about a /list in progress */ struct ListingArgs { time_t max_time; time_t min_time; @@ -284,63 +336,64 @@ unsigned int flags; time_t max_topic_time; time_t min_topic_time; - struct Channel *chptr; + unsigned int bucket; }; struct ModeBuf { - unsigned int mb_add; /* Modes to add */ - unsigned int mb_rem; /* Modes to remove */ - struct Client *mb_source; /* Source of MODE changes */ - struct Client *mb_connect; /* Connection of MODE changes */ - struct Channel *mb_channel; /* Channel they affect */ - unsigned int mb_dest; /* Destination of MODE changes */ - unsigned int mb_count; /* Number of modes w/args */ + unsigned int mb_add; /**< Modes to add */ + unsigned int mb_rem; /**< Modes to remove */ + struct Client *mb_source; /**< Source of MODE changes */ + struct Client *mb_connect; /**< Connection of MODE changes */ + struct Channel *mb_channel; /**< Channel they affect */ + unsigned int mb_dest; /**< Destination of MODE changes */ + unsigned int mb_count; /**< Number of modes w/args */ struct { - unsigned int mbm_type; /* Type of argument */ + unsigned int mbm_type; /**< Type of argument */ union { - unsigned int mbma_uint; /* A limit */ - char *mbma_string; /* A string */ - struct Client *mbma_client; /* A client */ - } mbm_arg; /* The mode argument */ + unsigned int mbma_uint; /**< A limit */ + char *mbma_string; /**< A string */ + struct Client *mbma_client; /**< A client */ + } mbm_arg; /**< The mode argument */ } mb_modeargs[MAXMODEPARAMS]; - /* A mode w/args */ + /**< A mode w/args */ }; -#define MODEBUF_DEST_CHANNEL 0x00001 /* Mode is flushed to channel */ -#define MODEBUF_DEST_SERVER 0x00002 /* Mode is flushed to server */ +#define MODEBUF_DEST_CHANNEL 0x00001 /**< Mode is flushed to channel */ +#define MODEBUF_DEST_SERVER 0x00002 /**< Mode is flushed to server */ -#define MODEBUF_DEST_OPMODE 0x00100 /* Send server mode as OPMODE */ -#define MODEBUF_DEST_DEOP 0x00200 /* Deop the offender */ -#define MODEBUF_DEST_BOUNCE 0x00400 /* Bounce the modes */ -#define MODEBUF_DEST_LOG 0x00800 /* Log the mode changes to OPATH */ - -#define MODEBUF_DEST_HACK2 0x02000 /* Send a HACK(2) notice, reverse */ -#define MODEBUF_DEST_HACK3 0x04000 /* Send a HACK(3) notice, TS == 0 */ -#define MODEBUF_DEST_HACK4 0x08000 /* Send a HACK(4) notice, TS == 0 */ +#define MODEBUF_DEST_OPMODE 0x00100 /**< Send server mode as OPMODE */ +#define MODEBUF_DEST_DEOP 0x00200 /**< Deop the offender */ +#define MODEBUF_DEST_BOUNCE 0x00400 /**< Bounce the modes */ +#define MODEBUF_DEST_LOG 0x00800 /**< Log the mode changes to OPATH */ + +#define MODEBUF_DEST_HACK2 0x02000 /**< Send a HACK(2) notice, reverse */ +#define MODEBUF_DEST_HACK3 0x04000 /**< Send a HACK(3) notice, TS == 0 */ +#define MODEBUF_DEST_HACK4 0x08000 /**< Send a HACK(4) notice, TS == 0 */ -#define MODEBUF_DEST_NOKEY 0x10000 /* Don't send the real key */ +#define MODEBUF_DEST_NOKEY 0x10000 /**< Don't send the real key */ #define MB_TYPE(mb, i) ((mb)->mb_modeargs[(i)].mbm_type) #define MB_UINT(mb, i) ((mb)->mb_modeargs[(i)].mbm_arg.mbma_uint) #define MB_STRING(mb, i) ((mb)->mb_modeargs[(i)].mbm_arg.mbma_string) #define MB_CLIENT(mb, i) ((mb)->mb_modeargs[(i)].mbm_arg.mbma_client) +/** A buffer represeting a list of joins to send */ struct JoinBuf { - struct Client *jb_source; /* Source of joins (ie, joiner) */ - struct Client *jb_connect; /* Connection of joiner */ - unsigned int jb_type; /* Type of join (JOIN or CREATE) */ - char *jb_comment; /* part comment */ - time_t jb_create; /* Creation timestamp */ - unsigned int jb_count; /* Number of channels */ - unsigned int jb_strlen; /* length so far */ + struct Client *jb_source; /**< Source of joins (ie, joiner) */ + struct Client *jb_connect; /**< Connection of joiner */ + unsigned int jb_type; /**< Type of join (JOIN or CREATE) */ + char *jb_comment; /**< part comment */ + time_t jb_create; /**< Creation timestamp */ + unsigned int jb_count; /**< Number of channels */ + unsigned int jb_strlen; /**< length so far */ struct Channel *jb_channels[MAXJOINARGS]; - /* channels joined or whatever */ + /**< channels joined or whatever */ }; -#define JOINBUF_TYPE_JOIN 0 /* send JOINs */ -#define JOINBUF_TYPE_CREATE 1 /* send CREATEs */ -#define JOINBUF_TYPE_PART 2 /* send PARTs */ -#define JOINBUF_TYPE_PARTALL 3 /* send local PARTs, but not remote */ +#define JOINBUF_TYPE_JOIN 0 /**< send JOINs */ +#define JOINBUF_TYPE_CREATE 1 /**< send CREATEs */ +#define JOINBUF_TYPE_PART 2 /**< send PARTs */ +#define JOINBUF_TYPE_PARTALL 3 /**< send local PARTs, but not remote */ extern struct Channel* GlobalChannelList; extern int LocalChanOperMode; @@ -350,7 +403,8 @@ */ extern void clean_channelname(char* name); extern void channel_modes(struct Client *cptr, char *mbuf, char *pbuf, - int buflen, struct Channel *chptr, struct Membership *member); + int buflen, struct Channel *chptr, + struct Membership *member); extern int set_mode(struct Client* cptr, struct Client* sptr, struct Channel* chptr, int parc, char* parv[], char* mbuf, char* pbuf, char* npbuf, int* badop); @@ -365,15 +419,6 @@ extern int can_join(struct Client *sptr, struct Channel *chptr, char *key); extern void add_user_to_channel(struct Channel* chptr, struct Client* who, unsigned int flags, int oplevel); -extern void cancel_mode(struct Client *sptr, struct Channel *chptr, char m, - const char *param, int *count); -extern void add_token_to_sendbuf(char *token, size_t *sblenp, int *firstp, - int *send_itp, char is_a_ban, int mode); -extern int add_banid(struct Client *cptr, struct Channel *chptr, char *banid, - int change, int firsttime); -extern struct SLink *next_removed_overlapped_ban(void); -extern void cancel_mode(struct Client *sptr, struct Channel *chptr, char m, - const char *param, int *count); extern void make_zombie(struct Membership* member, struct Client* who, struct Client* cptr, struct Client* sptr, struct Channel* chptr); @@ -382,7 +427,6 @@ int number_of_zombies(struct Channel *chptr); extern const char* find_no_nickchange_channel(struct Client* cptr); -extern struct Membership* IsMember(struct Client *cptr, struct Channel *chptr); extern struct Membership* find_channel_member(struct Client* cptr, struct Channel* chptr); extern int member_can_send_to_channel(struct Membership* member, int reveal); extern int client_can_send_to_channel(struct Client *cptr, struct Channel *chptr, int reveal); @@ -402,7 +446,6 @@ extern void send_channel_modes(struct Client *cptr, struct Channel *chptr); extern char *pretty_mask(char *mask); extern void del_invite(struct Client *cptr, struct Channel *chptr); -extern void list_next_channels(struct Client *cptr, int nr); extern void list_set_default(void); /* this belongs elsewhere! */ extern void RevealDelayedJoin(struct Membership *member); @@ -429,14 +472,14 @@ int parc, char *parv[], unsigned int flags, struct Membership* member); -#define MODE_PARSE_SET 0x01 /* actually set channel modes */ -#define MODE_PARSE_STRICT 0x02 /* +m +n +t style not supported */ -#define MODE_PARSE_FORCE 0x04 /* force the mode to be applied */ -#define MODE_PARSE_BOUNCE 0x08 /* we will be bouncing the modes */ -#define MODE_PARSE_NOTOPER 0x10 /* send "not chanop" to user */ -#define MODE_PARSE_NOTMEMBER 0x20 /* send "not member" to user */ -#define MODE_PARSE_WIPEOUT 0x40 /* wipe out +k and +l during burst */ -#define MODE_PARSE_BURST 0x80 /* be even more strict w/extra args */ +#define MODE_PARSE_SET 0x01 /**< actually set channel modes */ +#define MODE_PARSE_STRICT 0x02 /**< +m +n +t style not supported */ +#define MODE_PARSE_FORCE 0x04 /**< force the mode to be applied */ +#define MODE_PARSE_BOUNCE 0x08 /**< we will be bouncing the modes */ +#define MODE_PARSE_NOTOPER 0x10 /**< send "not chanop" to user */ +#define MODE_PARSE_NOTMEMBER 0x20 /**< send "not member" to user */ +#define MODE_PARSE_WIPEOUT 0x40 /**< wipe out +k and +l during burst */ +#define MODE_PARSE_BURST 0x80 /**< be even more strict w/extra args */ extern void joinbuf_init(struct JoinBuf *jbuf, struct Client *source, struct Client *connect, unsigned int type, @@ -444,5 +487,9 @@ extern void joinbuf_join(struct JoinBuf *jbuf, struct Channel *chan, unsigned int flags); extern int joinbuf_flush(struct JoinBuf *jbuf); +extern struct Ban *make_ban(const char *banstr); +extern struct Ban *find_ban(struct Client *cptr, struct Ban *banlist); +extern int apply_ban(struct Ban **banlist, struct Ban *newban); +extern void free_ban(struct Ban *ban); #endif /* INCLUDED_channel_h */ Index: ircd-ircdev/include/class.h diff -u ircd-ircdev/include/class.h:1.4 ircd-ircdev/include/class.h:1.5 --- ircd-ircdev/include/class.h:1.4 Fri May 21 08:39:34 2004 +++ ircd-ircdev/include/class.h Wed Nov 24 08:00:43 2004 @@ -19,8 +19,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: class.h,v 1.4 2004/05/21 15:39:34 zolty Exp $ - * + */ +/** @file + * @brief Declarations and interfaces for handling connection classes. + * @version $Id: class.h,v 1.5 2004/11/24 16:00:43 zolty Exp $ */ #ifndef INCLUDED_class_h #define INCLUDED_class_h @@ -37,37 +39,55 @@ /* * Structures */ +/** Represents a connection class. */ struct ConnectionClass { - struct ConnectionClass* next; - char *cc_name; - char *default_umode; - struct Privs privs; - struct Privs privs_dirty; - unsigned int max_sendq; - short ping_freq; - short conn_freq; - short max_links; - unsigned char valid; - int ref_count; + struct ConnectionClass* next; /**< Link to next connection class. */ + char *cc_name; /**< Name of connection class. */ + char *default_umode; /**< Default usermode for users + in this class. */ + struct Privs privs; /**< Privilege bits that are set on + or off. */ + struct Privs privs_dirty; /**< Indication of which bits in + ConnectionClass::privs are valid. */ + unsigned int max_sendq; /**< Maximum client SendQ in bytes. */ + unsigned int max_links; /**< Maximum connections allowed. */ + unsigned int ref_count; /**< Number of references to class. */ + unsigned short ping_freq; /**< Ping frequency for clients. */ + unsigned short conn_freq; /**< Auto-connect frequency. */ + unsigned char valid; /**< Valid flag (cleared after this + class is removed from the config).*/ }; /* * Macro's */ +/** Get class name for \a x. */ #define ConClass(x) ((x)->cc_name) +/** Get ping frequency for \a x. */ #define PingFreq(x) ((x)->ping_freq) +/** Get connection frequency for \a x. */ #define ConFreq(x) ((x)->conn_freq) +/** Get maximum links allowed for \a x. */ #define MaxLinks(x) ((x)->max_links) +/** Get maximum SendQ size for \a x. */ #define MaxSendq(x) ((x)->max_sendq) +/** Get number of references to \a x. */ #define Links(x) ((x)->ref_count) +/** Get class name for ConfItem \a x. */ #define ConfClass(x) ((x)->conn_class->cc_name) +/** Get ping frequency for ConfItem \a x. */ #define ConfPingFreq(x) ((x)->conn_class->ping_freq) +/** Get connection frequency for ConfItem \a x. */ #define ConfConFreq(x) ((x)->conn_class->conn_freq) +/** Get maximum links allowed for ConfItem \a x. */ #define ConfMaxLinks(x) ((x)->conn_class->max_links) +/** Get maximum SendQ size for ConfItem \a x. */ #define ConfSendq(x) ((x)->conn_class->max_sendq) +/** Get number of references to class in ConfItem \a x. */ #define ConfLinks(x) ((x)->conn_class->ref_count) +/** Get default usermode for ConfItem \a x. */ #define ConfUmode(x) ((x)->conn_class->default_umode) /* @@ -88,10 +108,10 @@ extern int get_conf_ping(const struct ConfItem *aconf); extern char *get_client_class(struct Client *acptr); extern void add_class(char *name, unsigned int ping, - unsigned int confreq, unsigned int maxli, unsigned int sendq); -extern void check_class(void); -extern void report_classes(struct Client *sptr, struct StatDesc *sd, int stat, - char *param); + unsigned int confreq, unsigned int maxli, + unsigned int sendq); +extern void report_classes(struct Client *sptr, const struct StatDesc *sd, + char *param); extern unsigned int get_sendq(struct Client* cptr); extern void class_send_meminfo(struct Client* cptr); Index: ircd-ircdev/include/client.h diff -u ircd-ircdev/include/client.h:1.6 ircd-ircdev/include/client.h:1.7 --- ircd-ircdev/include/client.h:1.6 Fri May 21 08:39:34 2004 +++ ircd-ircdev/include/client.h Wed Nov 24 08:00:43 2004 @@ -18,8 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: client.h,v 1.6 2004/05/21 15:39:34 zolty Exp $ - * + */ +/** @file + * @brief Structures and functions for handling local clients. + * @version $Id: client.h,v 1.7 2004/11/24 16:00:43 zolty Exp $ */ #ifndef INCLUDED_client_h #define INCLUDED_client_h @@ -39,14 +41,13 @@ #ifndef INCLUDED_ircd_handler_h #include "ircd_handler.h" #endif +#ifndef INCLUDED_res_h +#include "res.h" +#endif #ifndef INCLUDED_sys_types_h #include <sys/types.h> /* time_t, size_t */ #define INCLUDED_sys_types_h #endif -#ifndef INCLUDED_netinet_in_h -#include <netinet/in.h> /* in_addr */ -#define INCLUDED_netinet_in_h -#endif struct ConfItem; struct Listener; @@ -67,481 +68,662 @@ * source file, or in the source file itself (when only used in that file). */ +/** Single element in a flag bitset array. */ typedef unsigned long flagpage_t; +/** Number of bits in a flagpage_t. */ #define FLAGSET_NBITS (8 * sizeof(flagpage_t)) -#define FLAGSET_INDEX(flag) (flag / FLAGSET_NBITS) -#define FLAGSET_MASK(flag) (1<<(flag % FLAGSET_NBITS)) +/** Element number for flag \a flag. */ +#define FLAGSET_INDEX(flag) ((flag) / FLAGSET_NBITS) +/** Element bit for flag \a flag. */ +#define FLAGSET_MASK(flag) (1ul<<((flag) % FLAGSET_NBITS)) +/** Declare a flagset structure of a particular size. */ #define DECLARE_FLAGSET(name,max) \ struct name \ { \ unsigned long bits[((max + FLAGSET_NBITS - 1) / FLAGSET_NBITS)]; \ - }; + } -#define FLAGSET_ISSET(set,flag) ((set).bits[FLAGSET_INDEX(flag)] & FLAGSET_MASK(flag)) -#define FLAGSET_SET(set, flag) (set).bits[FLAGSET_INDEX(flag)] |= FLAGSET_MASK(flag) -#define FLAGSET_CLEAR(set, flag) (set).bits[FLAGSET_INDEX(flag)] &= ~FLAGSET_MASK(flag) +/** Test whether a flag is set in a flagset. */ +#define FlagHas(set,flag) ((set)->bits[FLAGSET_INDEX(flag)] & FLAGSET_MASK(flag)) +/** Set a flag in a flagset. */ +#define FlagSet(set,flag) ((set)->bits[FLAGSET_INDEX(flag)] |= FLAGSET_MASK(flag)) +/** Clear a flag in a flagset. */ +#define FlagClr(set,flag) ((set)->bits[FLAGSET_INDEX(flag)] &= ~FLAGSET_MASK(flag)) +/** String containig valid user modes, in no particular order. */ #define infousermodes "dioswkgx" -enum Priv { - PRIV_CHAN_LIMIT, /* no channel limit on oper */ - PRIV_MODE_LCHAN, /* oper can mode local chans */ - PRIV_WALK_LCHAN, /* oper can walk thru local modes */ - PRIV_DEOP_LCHAN, /* no deop oper on local chans */ - PRIV_SHOW_INVIS, /* show local invisible users */ - PRIV_SHOW_ALL_INVIS, /* show all invisible users */ - PRIV_UNLIMIT_QUERY, /* unlimit who queries */ - - PRIV_KILL, /* oper can KILL */ - PRIV_LOCAL_KILL, /* oper can local KILL */ - PRIV_REHASH, /* oper can REHASH */ - PRIV_RESTART, /* oper can RESTART */ - PRIV_DIE, /* oper can DIE */ - PRIV_GLINE, /* oper can GLINE */ - PRIV_LOCAL_GLINE, /* oper can local GLINE */ - PRIV_JUPE, /* oper can JUPE */ - PRIV_LOCAL_JUPE, /* oper can local JUPE */ - PRIV_OPMODE, /* oper can OP/CLEARMODE */ - PRIV_LOCAL_OPMODE, /* oper can local OP/CLEARMODE */ - PRIV_SET, /* oper can SET */ - PRIV_WHOX, /* oper can use /who x */ - PRIV_BADCHAN, /* oper can BADCHAN */ - PRIV_LOCAL_BADCHAN, /* oper can local BADCHAN */ - PRIV_SEE_CHAN, /* oper can see in secret chans */ - PRIV_PROPAGATE, /* propagate oper status */ - PRIV_DISPLAY, /* "Is an oper" displayed */ - PRIV_SEE_OPERS, /* display hidden opers */ - PRIV_WIDE_GLINE, /* oper can set wider G-lines */ - PRIV_LIST_CHAN, /* oper can list secret channels */ - PRIV_FORCE_OPMODE, /* can hack modes on quarantined channels */ - PRIV_FORCE_LOCAL_OPMODE, /* can hack modes on quarantined local channels */ - PRIV_LAST_PRIV /* must be the same as the last priv */ -}; +/** Operator privileges. */ +enum Priv + { + PRIV_CHAN_LIMIT, /**< no channel limit on oper */ + PRIV_MODE_LCHAN, /**< oper can mode local chans */ + PRIV_WALK_LCHAN, /**< oper can walk through local modes */ + PRIV_DEOP_LCHAN, /**< no deop oper on local chans */ + PRIV_SHOW_INVIS, /**< show local invisible users */ + PRIV_SHOW_ALL_INVIS, /**< show all invisible users */ + PRIV_UNLIMIT_QUERY, /**< unlimit who queries */ + PRIV_KILL, /**< oper can KILL */ + PRIV_LOCAL_KILL, /**< oper can local KILL */ + PRIV_REHASH, /**< oper can REHASH */ + PRIV_RESTART, /**< oper can RESTART */ + PRIV_DIE, /**< oper can DIE */ + PRIV_GLINE, /**< oper can GLINE */ + PRIV_LOCAL_GLINE, /**< oper can local GLINE */ + PRIV_JUPE, /**< oper can JUPE */ + PRIV_LOCAL_JUPE, /**< oper can local JUPE */ + PRIV_OPMODE, /**< oper can OP/CLEARMODE */ + PRIV_LOCAL_OPMODE, /**< oper can local OP/CLEARMODE */ + PRIV_SET, /**< oper can SET */ + PRIV_WHOX, /**< oper can use /who x */ + PRIV_BADCHAN, /**< oper can BADCHAN */ + PRIV_LOCAL_BADCHAN, /**< oper can local BADCHAN */ + PRIV_SEE_CHAN, /**< oper can see in secret chans */ + PRIV_PROPAGATE, /**< propagate oper status */ + PRIV_DISPLAY, /**< "Is an oper" displayed */ + PRIV_SEE_OPERS, /**< display hidden opers */ + PRIV_WIDE_GLINE, /**< oper can set wider G-lines */ + PRIV_LIST_CHAN, /**< oper can list secret channels */ + PRIV_FORCE_OPMODE, /**< can hack modes on quarantined channels */ + PRIV_FORCE_LOCAL_OPMODE, /**< can hack modes on quarantined local channels */ + PRIV_LAST_PRIV /**< number of privileges */ + }; -enum Flag { - FLAG_PINGSENT, /* Unreplied ping sent */ - FLAG_DEADSOCKET, /* Local socket is dead--Exiting soon */ - FLAG_KILLED, /* Prevents "QUIT" from being sent for this */ - FLAG_BLOCKED, /* socket is in a blocked condition */ - FLAG_CLOSING, /* set when closing to suppress errors */ - FLAG_UPING, /* has active UDP ping request */ - FLAG_CHKACCESS, /* ok to check clients access if set */ - FLAG_HUB, /* server is a hub */ - FLAG_SERVICE, /* server is a service */ - FLAG_LOCAL, /* set for local clients */ - FLAG_GOTID, /* successful ident lookup achieved */ - FLAG_DOID, /* I-lines say must use ident return */ - FLAG_NONL, /* No \n in buffer */ - FLAG_TS8, /* Why do you want to know? */ - FLAG_MAP, /* Show server on the map */ - FLAG_JUNCTION, /* Junction causing the net.burst */ - FLAG_BURST, /* Server is receiving a net.burst */ - FLAG_BURST_ACK, /* Server is waiting for eob ack */ - FLAG_IPCHECK, /* Added or updated IPregistry data */ - - FLAG_LOCOP, /* Local operator -- SRB */ - FLAG_SERVNOTICE, /* server notices such as kill */ - - FLAG_OPER, /* Operator */ - FLAG_INVISIBLE, /* makes user invisible */ - FLAG_WALLOP, /* send wallops to them */ - FLAG_DEAF, /* Makes user deaf */ - FLAG_CHSERV, /* Disallow KICK or MODE -o on the user; +/** Client flags and modes. + * Note that flags at least FLAG_LOCAL_UMODES but less than + * FLAG_GLOBAL_UMODES are treated as local modes, and flags at least + * FLAG_GLOBAL_UMODES (but less than FLAG_LAST_FLAG) are treated as + * global modes. + */ +enum Flag + { + FLAG_PINGSENT, /**< Unreplied ping sent */ + FLAG_DEADSOCKET, /**< Local socket is dead--Exiting soon */ + FLAG_KILLED, /**< Prevents "QUIT" from being sent for this */ + FLAG_BLOCKED, /**< socket is in a blocked condition */ + FLAG_CLOSING, /**< set when closing to suppress errors */ + FLAG_UPING, /**< has active UDP ping request */ + FLAG_HUB, /**< server is a hub */ + FLAG_SERVICE, /**< server is a service */ + FLAG_GOTID, /**< successful ident lookup achieved */ + FLAG_DOID, /**< I-lines say must use ident return */ + FLAG_NONL, /**< No \n in buffer */ + FLAG_TS8, /**< Why do you want to know? */ + FLAG_MAP, /**< Show server on the map */ + FLAG_JUNCTION, /**< Junction causing the net.burst. */ + FLAG_BURST, /**< Server is receiving a net.burst */ + FLAG_BURST_ACK, /**< Server is waiting for eob ack */ + FLAG_IPCHECK, /**< Added or updated IPregistry data */ + FLAG_IAUTHED, /**< Got IAUTH response for user */ + FLAG_LOCOP, /**< Local operator -- SRB */ + FLAG_SERVNOTICE, /**< server notices such as kill */ + FLAG_OPER, /**< Operator */ + FLAG_INVISIBLE, /**< makes user invisible */ + FLAG_WALLOP, /**< send wallops to them */ + FLAG_DEAF, /**< Makes user deaf */ + FLAG_CHSERV, /**< Disallow KICK or MODE -o on the user; don't display channels in /whois */ - FLAG_DEBUG, /* send global debug/anti-hack info */ + FLAG_DEBUG, /**< send global debug/anti-hack info */ #if defined(UNDERNET) - FLAG_ACCOUNT, /* account name has been set */ + FLAG_ACCOUNT, /**< account name has been set */ #endif - FLAG_HIDDENHOST, /* user's host is hidden */ - FLAG_LAST_FLAG, - FLAG_LOCAL_UMODES = FLAG_LOCOP, /* First local mode flag */ - FLAG_GLOBAL_UMODES = FLAG_OPER /* First global mode flag */ -}; - -DECLARE_FLAGSET(Privs, PRIV_LAST_PRIV) -DECLARE_FLAGSET(Flags, FLAG_LAST_FLAG) + FLAG_HIDDENHOST, /**< user's host is hidden */ + FLAG_LAST_FLAG, /**< number of flags */ + FLAG_LOCAL_UMODES = FLAG_LOCOP, /**< First local mode flag */ + FLAG_GLOBAL_UMODES = FLAG_OPER /**< First global mode flag */ + }; -struct Connection { - /* - * The following fields are allocated only for local clients - * (directly connected to *this* server with a socket. - * The first of them *MUST* be the "count"--it is the field - * to which the allocation is tied to! *Never* refer to - * these fields, if (from != self). - */ - unsigned long con_magic; /* magic number */ - struct Connection* con_next; /* Next connection with queued data */ - struct Connection** con_prev_p; /* What points to us */ - struct Client* con_client; /* Client associated with connection */ - unsigned int con_count; /* Amount of data in buffer */ - int con_fd; /* >= 0, for local clients */ - int con_freeflag; /* indicates if connection can be freed */ - int con_error; /* last socket level error for client */ - unsigned int con_snomask; /* mask for server messages */ - time_t con_nextnick; /* Next time a nick change is allowed */ - time_t con_nexttarget;/* Next time a target change is allowed */ - unsigned int con_cookie; /* Random number the user must PONG */ - struct MsgQ con_sendQ; /* Outgoing message queue--if socket full */ - struct DBuf con_recvQ; /* Hold for data incoming yet to be parsed */ - unsigned int con_sendM; /* Statistics: protocol messages send */ - unsigned int con_sendK; /* Statistics: total k-bytes send */ - unsigned int con_receiveM;/* Statistics: protocol messages received */ - unsigned int con_receiveK; /* Statistics: total k-bytes received */ - unsigned short con_sendB; /* counters to count upto 1-k lots of bytes */ - unsigned short con_receiveB; /* sent and received. */ - struct Listener* con_listener; /* listening client which we accepted - from */ - struct SLink* con_confs; /* Configuration record associated */ - HandlerType con_handler; /* message index into command table - for parsing */ - struct hostent* con_dns_reply; /* DNS reply used during client - registration */ - struct ListingArgs* con_listing; - unsigned int con_max_sendq; /* cached max send queue for client */ - unsigned int con_ping_freq; /* cached ping freq from client conf - class */ - unsigned short con_lastsq; /* # 2k blocks when sendqueued called last */ - unsigned short con_port; /* and the remote port# too :-) */ - unsigned char con_targets[MAXTARGETS]; /* Hash values of current - targets */ - char con_sock_ip[SOCKIPLEN + 1]; /* this is the ip address as a string */ - char con_sockhost[HOSTLEN + 1]; /* This is the host name from the socket and - after which the connection was accepted. */ - char con_passwd[PASSWDLEN + 1]; - char con_buffer[BUFSIZE]; /* Incoming message buffer; or the error that - caused this clients socket to be `dead' */ - struct Socket con_socket; /* socket descriptor for client */ - struct Timer con_proc; /* process latent messages from client */ - struct AuthRequest* con_auth; /* auth request for client */ +/** Declare flagset type for operator privileges. */ +DECLARE_FLAGSET(Privs, PRIV_LAST_PRIV); +/** Declare flagset type for user flags. */ +DECLARE_FLAGSET(Flags, FLAG_LAST_FLAG); + +/** Represents a local connection. + * This contains a lot of stuff irrelevant to server connections, but + * those are so rare as to not be worth special-casing. + */ +struct Connection +{ + unsigned long con_magic; /**< magic number */ + struct Connection* con_next; /**< Next connection with queued data */ + struct Connection** con_prev_p; /**< What points to us */ + struct Client* con_client; /**< Client associated with connection */ + unsigned int con_count; /**< Amount of data in buffer */ + int con_freeflag; /**< indicates if connection can be freed */ + int con_error; /**< last socket level error for client */ + int con_sentalong; /**< sentalong marker for connection */ + unsigned int con_snomask; /**< mask for server messages */ + time_t con_nextnick; /**< Next time a nick change is allowed */ + time_t con_nexttarget;/**< Next time a target change is allowed */ + time_t con_lasttime; /**< Last time data read from socket */ + time_t con_since; /**< Last time we accepted a command */ + unsigned int con_cookie; /**< Random number the user must PONG */ + struct MsgQ con_sendQ; /**< Outgoing message queue */ + struct DBuf con_recvQ; /**< Incoming data yet to be parsed */ + unsigned int con_sendM; /**< Stats: protocol messages sent */ + unsigned int con_receiveM; /**< Stats: protocol messages received */ + uint64_t con_sendB; /**< Bytes sent. */ + uint64_t con_receiveB; /**< Bytes received. */ + struct Listener* con_listener; /**< Listening socket which we accepted + from. */ + struct SLink* con_confs; /**< Associated configuration records. */ + HandlerType con_handler; /**< Message index into command table + for parsing. */ + struct DNSReply* con_dns_reply; /**< DNS reply received during client + registration. */ + struct ListingArgs* con_listing; /**< Current LIST status. */ + unsigned int con_max_sendq; /**< cached max send queue for client */ + unsigned int con_ping_freq; /**< cached ping freq */ + unsigned short con_lastsq; /**< # 2k blocks when sendqueued + called last. */ + unsigned char con_targets[MAXTARGETS]; /**< Hash values of + current targets. */ + char con_sock_ip[SOCKIPLEN + 1]; /**< Remote IP address as a string. */ + char con_sockhost[HOSTLEN + 1]; /**< This is the host name from + the socket and after which the + connection was accepted. */ + char con_passwd[PASSWDLEN + 1]; /**< Password given by user. */ + char con_buffer[BUFSIZE]; /**< Incoming message buffer; or + the error that caused this + clients socket to close. */ + struct Socket con_socket; /**< socket descriptor for + client */ + struct Timer con_proc; /**< process latent messages from + client */ + struct AuthRequest* con_auth; /**< auth request for client */ + struct IAuthRequest* con_iauth; /**< iauth request for client */ }; +/** Magic constant to identify valid Connection structures. */ #define CONNECTION_MAGIC 0x12f955f3 +/** Represents a client anywhere on the network. */ struct Client { - unsigned long cli_magic; /* magic number */ - struct Client* cli_next; /* link in GlobalClientList */ - struct Client* cli_prev; /* link in GlobalClientList */ - struct Client* cli_hnext; /* link in hash table bucket or this */ - struct Connection* cli_connect; /* Connection structure associated with us */ - struct User* cli_user; /* ...defined, if this is a User */ - struct Server* cli_serv; /* ...defined, if this is a server */ - struct Whowas* cli_whowas; /* Pointer to ww struct to be freed on quit */ - char cli_yxx[4]; /* Numeric Nick: YMM if this is a server, - XX0 if this is a user */ - /* - * XXX - move these to local part for next release - * (lasttime, since) - */ - time_t cli_lasttime; /* last time data read from socket */ - time_t cli_since; /* last time we parsed something, flood control */ - - time_t cli_firsttime; /* time client was created */ - time_t cli_lastnick; /* TimeStamp on nick */ - int cli_marker; /* /who processing marker */ - struct Flags cli_flags; /* client flags */ - unsigned int cli_hopcount; /* number of servers to this 0 = local */ - struct in_addr cli_ip; /* Real ip# NOT defined for remote servers! */ - short cli_status; /* Client type */ - unsigned char cli_local; /* local or remote client */ - struct Privs cli_privs; /* Oper privileges */ - char cli_name[HOSTLEN + 1]; /* Unique name of the client, nick or host */ - char cli_username[USERLEN + 1]; /* username here now for auth stuff */ - char cli_info[REALLEN + 1]; /* Free form additional client information */ + unsigned long cli_magic; /**< magic number */ + struct Client* cli_next; /**< link in GlobalClientList */ + struct Client* cli_prev; /**< link in GlobalClientList */ + struct Client* cli_hnext; /**< link in hash table bucket or this */ + struct Connection* cli_connect; /**< Connection structure associated with us */ + struct User* cli_user; /**< Defined if this client is a user */ + struct Server* cli_serv; /**< Defined if this client is a server */ + struct Whowas* cli_whowas; /**< Pointer to ww struct to be freed on quit */ + char cli_yxx[4]; /**< Numeric Nick: YY if this is a + server, XXX if this is a user */ + time_t cli_firsttime; /**< time client was created */ + time_t cli_lastnick; /**< TimeStamp on nick */ + int cli_marker; /**< /who processing marker */ + struct Flags cli_flags; /**< client flags */ + unsigned int cli_hopcount; /**< number of servers to this 0 = local */ + struct irc_in_addr cli_ip; /**< Real IP of client */ + short cli_status; /**< Client type */ + struct Privs cli_privs; /**< Oper privileges */ + char cli_name[HOSTLEN + 1]; /**< Unique name of the client, nick or host */ + char cli_username[USERLEN + 1]; /**< username here now for auth stuff */ + char cli_info[REALLEN + 1]; /**< Free form additional client information */ }; +/** Magic constant to identify valid Client structures. */ #define CLIENT_MAGIC 0x4ca08286 +/** Verify that a client is valid. */ #define cli_verify(cli) ((cli)->cli_magic == CLIENT_MAGIC) +/** Get client's magic number. */ #define cli_magic(cli) ((cli)->cli_magic) +/** Get global next client. */ #define cli_next(cli) ((cli)->cli_next) +/** Get global previous client. */ #define cli_prev(cli) ((cli)->cli_prev) +/** Get next client in hash bucket chain. */ #define cli_hnext(cli) ((cli)->cli_hnext) +/** Get connection associated with client. */ #define cli_connect(cli) ((cli)->cli_connect) -#define cli_from(cli) ((cli)->cli_connect->con_client) +/** Get local client that links us to \a cli. */ +#define cli_from(cli) con_client(cli_connect(cli)) +/** Get User structure for client, if client is a user. */ #define cli_user(cli) ((cli)->cli_user) +/** Get Server structure for client, if client is a server. */ #define cli_serv(cli) ((cli)->cli_serv) +/** Get Whowas link for client. */ #define cli_whowas(cli) ((cli)->cli_whowas) +/** Get client numnick. */ #define cli_yxx(cli) ((cli)->cli_yxx) -#define cli_lasttime(cli) ((cli)->cli_lasttime) -#define cli_since(cli) ((cli)->cli_since) +/** Get time we last read data from the client socket. */ +#define cli_lasttime(cli) con_lasttime(cli_connect(cli)) +/** Get time we last parsed something from the client. */ +#define cli_since(cli) con_since(cli_connect(cli)) +/** Get time client was created. */ #define cli_firsttime(cli) ((cli)->cli_firsttime) +/** Get time client last changed nickname. */ #define cli_lastnick(cli) ((cli)->cli_lastnick) +/** Get WHO marker for client. */ #define cli_marker(cli) ((cli)->cli_marker) +/** Get flags flagset for client. */ #define cli_flags(cli) ((cli)->cli_flags) +/** Get hop count to client. */ #define cli_hopcount(cli) ((cli)->cli_hopcount) +/** Get client IP address. */ #define cli_ip(cli) ((cli)->cli_ip) +/** Get status bitmask for client. */ #define cli_status(cli) ((cli)->cli_status) -#define cli_local(cli) ((cli)->cli_local) +/** Return non-zero if the client is local. */ +#define cli_local(cli) (cli_from(cli) == cli) +/** Get oper privileges for client. */ #define cli_privs(cli) ((cli)->cli_privs) +/** Get client name. */ #define cli_name(cli) ((cli)->cli_name) +/** Get client username (ident). */ #define cli_username(cli) ((cli)->cli_username) +/** Get client realname (information field). */ #define cli_info(cli) ((cli)->cli_info) -#define cli_count(cli) ((cli)->cli_connect->con_count) -#define cli_fd(cli) ((cli)->cli_connect->con_fd) -#define cli_freeflag(cli) ((cli)->cli_connect->con_freeflag) -#define cli_error(cli) ((cli)->cli_connect->con_error) -#define cli_snomask(cli) ((cli)->cli_connect->con_snomask) -#define cli_nextnick(cli) ((cli)->cli_connect->con_nextnick) -#define cli_nexttarget(cli) ((cli)->cli_connect->con_nexttarget) -#define cli_cookie(cli) ((cli)->cli_connect->con_cookie) -#define cli_sendQ(cli) ((cli)->cli_connect->con_sendQ) -#define cli_recvQ(cli) ((cli)->cli_connect->con_recvQ) -#define cli_sendM(cli) ((cli)->cli_connect->con_sendM) -#define cli_sendK(cli) ((cli)->cli_connect->con_sendK) -#define cli_receiveM(cli) ((cli)->cli_connect->con_receiveM) -#define cli_receiveK(cli) ((cli)->cli_connect->con_receiveK) -#define cli_sendB(cli) ((cli)->cli_connect->con_sendB) -#define cli_receiveB(cli) ((cli)->cli_connect->con_receiveB) -#define cli_listener(cli) ((cli)->cli_connect->con_listener) -#define cli_confs(cli) ((cli)->cli_connect->con_confs) -#define cli_handler(cli) ((cli)->cli_connect->con_handler) -#define cli_dns_reply(cli) ((cli)->cli_connect->con_dns_reply) -#define cli_listing(cli) ((cli)->cli_connect->con_listing) -#define cli_max_sendq(cli) ((cli)->cli_connect->con_max_sendq) -#define cli_ping_freq(cli) ((cli)->cli_connect->con_ping_freq) -#define cli_lastsq(cli) ((cli)->cli_connect->con_lastsq) -#define cli_port(cli) ((cli)->cli_connect->con_port) -#define cli_targets(cli) ((cli)->cli_connect->con_targets) -#define cli_sock_ip(cli) ((cli)->cli_connect->con_sock_ip) -#define cli_sockhost(cli) ((cli)->cli_connect->con_sockhost) -#define cli_passwd(cli) ((cli)->cli_connect->con_passwd) -#define cli_buffer(cli) ((cli)->cli_connect->con_buffer) -#define cli_socket(cli) ((cli)->cli_connect->con_socket) -#define cli_proc(cli) ((cli)->cli_connect->con_proc) -#define cli_auth(cli) ((cli)->cli_connect->con_auth) +/** Get number of incoming bytes queued for client. */ +#define cli_count(cli) con_count(cli_connect(cli)) +/** Get file descriptor for sending in client's direction. */ +#define cli_fd(cli) con_fd(cli_connect(cli)) +/** Get free flags for the client's connection. */ +#define cli_freeflag(cli) con_freeflag(cli_connect(cli)) +/** Get last error code for the client's connection. */ +#define cli_error(cli) con_error(cli_connect(cli)) +/** Get server notice mask for the client. */ +#define cli_snomask(cli) con_snomask(cli_connect(cli)) +/** Get next time a nick change is allowed for the client. */ +#define cli_nextnick(cli) con_nextnick(cli_connect(cli)) +/** Get next time a target change is allowed for the client. */ +#define cli_nexttarget(cli) con_nexttarget(cli_connect(cli)) +/** Get required PING/PONG cookie for client. */ +#define cli_cookie(cli) con_cookie(cli_connect(cli)) +/** Get SendQ for client. */ +#define cli_sendQ(cli) con_sendQ(cli_connect(cli)) +/** Get RecvQ for client. */ +#define cli_recvQ(cli) con_recvQ(cli_connect(cli)) +/** Get count of messages sent to client. */ +#define cli_sendM(cli) con_sendM(cli_connect(cli)) +/** Get number of messages received from client. */ +#define cli_receiveM(cli) con_receiveM(cli_connect(cli)) +/** Get number of bytes (modulo 1024) sent to client. */ +#define cli_sendB(cli) con_sendB(cli_connect(cli)) +/** Get number of bytes (modulo 1024) received from client. */ +#define cli_receiveB(cli) con_receiveB(cli_connect(cli)) +/** Get listener that accepted the client's connection. */ +#define cli_listener(cli) con_listener(cli_connect(cli)) +/** Get list of attached conf lines. */ +#define cli_confs(cli) con_confs(cli_connect(cli)) +/** Get handler type for client. */ +#define cli_handler(cli) con_handler(cli_connect(cli)) +/** Get DNS reply for client. */ +#define cli_dns_reply(cli) con_dns_reply(cli_connect(cli)) +/** Get LIST status for client. */ +#define cli_listing(cli) con_listing(cli_connect(cli)) +/** Get cached max SendQ for client. */ +#define cli_max_sendq(cli) con_max_sendq(cli_connect(cli)) +/** Get ping frequency for client. */ +#define cli_ping_freq(cli) con_ping_freq(cli_connect(cli)) +/** Get lastsq for client's connection. */ +#define cli_lastsq(cli) con_lastsq(cli_connect(cli)) +/** Get the array of current targets for the client. */ +#define cli_targets(cli) con_targets(cli_connect(cli)) +/** Get the string form of the client's IP address. */ +#define cli_sock_ip(cli) con_sock_ip(cli_connect(cli)) +/** Get the resolved hostname for the client. */ +#define cli_sockhost(cli) con_sockhost(cli_connect(cli)) +/** Get the client's password. */ +#define cli_passwd(cli) con_passwd(cli_connect(cli)) +/** Get the unprocessed input buffer for a client's connection. */ +#define cli_buffer(cli) con_buffer(cli_connect(cli)) +/** Get the Socket structure for sending to a client. */ +#define cli_socket(cli) con_socket(cli_connect(cli)) +/** Get Timer for processing waiting messages from the client. */ +#define cli_proc(cli) con_proc(cli_connect(cli)) +/** Get auth request for client. */ +#define cli_auth(cli) con_auth(cli_connect(cli)) +/** Get iauth request for client. */ +#define cli_iauth(cli) con_iauth(cli_connect(cli)) +/** Get sentalong marker for client. */ +#define cli_sentalong(cli) con_sentalong(cli_connect(cli)) +/** Verify that a connection is valid. */ #define con_verify(con) ((con)->con_magic == CONNECTION_MAGIC) +/** Get connection's magic number. */ #define con_magic(con) ((con)->con_magic) +/** Get global next connection. */ #define con_next(con) ((con)->con_next) +/** Get global previous connection. */ #define con_prev_p(con) ((con)->con_prev_p) +/** Get locally connected client for connection. */ #define con_client(con) ((con)->con_client) +/** Get number of unprocessed data bytes from connection. */ #define con_count(con) ((con)->con_count) -#define con_fd(con) ((con)->con_fd) +/** Get file descriptor for connection. */ +#define con_fd(con) s_fd(&(con)->con_socket) +/** Get freeable flags for connection. */ #define con_freeflag(con) ((con)->con_freeflag) +/** Get last error code on connection. */ #define con_error(con) ((con)->con_error) +/** Get sentalong marker for connection. */ +#define con_sentalong(con) ((con)->con_sentalong) +/** Get server notice mask for connection. */ #define con_snomask(con) ((con)->con_snomask) +/** Get next nick change time for connection. */ #define con_nextnick(con) ((con)->con_nextnick) +/** Get next new target time for connection. */ #define con_nexttarget(con) ((con)->con_nexttarget) +/** Get last time we read from the co... [truncated message content] |
From: Toni G. <zo...@us...> - 2004-11-17 12:25:21
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-11-17 12:25:12 UTC Removed files: libs/adns/.cvsignore Log message: Author: zoltan <zo...@ir...> Log message: Borrando libreria ADNS porque no se va a utilizar ---------------------- diff included ---------------------- Index: ircd-ircdev/libs/adns/.cvsignore diff -u ircd-ircdev/libs/adns/.cvsignore:1.1 ircd-ircdev/libs/adns/.cvsignore:removed --- ircd-ircdev/libs/adns/.cvsignore:1.1 Sat Nov 1 09:28:12 2003 +++ ircd-ircdev/libs/adns/.cvsignore Wed Nov 17 04:25:12 2004 @@ -1,3 +0,0 @@ -config.log -config.status -settings.make ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2004-11-17 12:23:24
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-11-17 12:23:14 UTC Removed files: libs/adns/src/.cvsignore Log message: Author: zoltan <zo...@ir...> Log message: Borrando libreria ADNS porque no se va a utilizar ---------------------- diff included ---------------------- Index: ircd-ircdev/libs/adns/src/.cvsignore diff -u ircd-ircdev/libs/adns/src/.cvsignore:1.1 ircd-ircdev/libs/adns/src/.cvsignore:removed --- ircd-ircdev/libs/adns/src/.cvsignore:1.1 Sat Nov 1 09:28:12 2003 +++ ircd-ircdev/libs/adns/src/.cvsignore Wed Nov 17 04:23:17 2004 @@ -1 +0,0 @@ -Makefile ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2004-11-17 12:20:39
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-11-17 12:20:28 UTC Removed files: libs/adns/COPYING libs/adns/Makefile libs/adns/Makefile.in libs/adns/README libs/adns/README.html libs/adns/README.ircu libs/adns/aclocal.m4 libs/adns/configure libs/adns/configure.in libs/adns/settings.make.in libs/adns/src/Makefile.in libs/adns/src/adns.h libs/adns/src/adns.make libs/adns/src/check.c libs/adns/src/config.h libs/adns/src/config.h.in libs/adns/src/dlist.h libs/adns/src/event.c libs/adns/src/general.c libs/adns/src/internal.h libs/adns/src/parse.c libs/adns/src/poll.c libs/adns/src/query.c libs/adns/src/reply.c libs/adns/src/setup.c libs/adns/src/transmit.c libs/adns/src/tvarith.h libs/adns/src/types.c Log message: Author: zoltan <zo...@ir...> Log message: Borrando libreria ADNS porque no se va a utilizar ---------------------- diff included ---------------------- Index: ircd-ircdev/libs/adns/COPYING diff -u ircd-ircdev/libs/adns/COPYING:1.1 ircd-ircdev/libs/adns/COPYING:removed --- ircd-ircdev/libs/adns/COPYING:1.1 Sat Nov 1 09:28:12 2003 +++ ircd-ircdev/libs/adns/COPYING Wed Nov 17 04:20:28 2004 @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) 19yy <name of author> - - 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 - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. Index: ircd-ircdev/libs/adns/Makefile diff -u ircd-ircdev/libs/adns/Makefile:1.1 ircd-ircdev/libs/adns/Makefile:removed --- ircd-ircdev/libs/adns/Makefile:1.1 Sat Nov 1 09:28:12 2003 +++ ircd-ircdev/libs/adns/Makefile Wed Nov 17 04:20:28 2004 @@ -1,69 +0,0 @@ -# Generated automatically from Makefile.in by configure. -# Makefile - top-level Makefile -# -# This file is -# Copyright (C) 1997-2000 Ian Jackson <ia...@da...> -# -# It is part of adns, which is -# Copyright (C) 1997-2000 Ian Jackson <ia...@da...> -# Copyright (C) 1999-2000 Tony Finch <do...@do...> -# -# 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, 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. - -# Remember to change ADNS_VERSION_STRING in client/client.h too, and -# possibly library soname (MAJOR and MINOR in settings.make.in). -DISTVERSION= 1.0 - -srcdir= . - -SUBDIRS= src - -build: all - -all install uninstall clean distclean mostlyclean maintainer-clean distprep: - set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done - $(MAKE) $@-here - -all-here install-here uninstall-here distprep-here: README - -clean-here mostlyclean-here: - rm -f *~ ./#*# core *.orig *.rej adns-*.tar.gz - rm -rf dist_tmp - -distclean-here maintainer-clean-here: clean-here - rm -f settings.make config.h config.cache config.log config.status - -install-strip: - $(MAKE) INSTALL_PROGRAM_FLAGS=-s - -dist_tmp=dist_tmp/adns-$(DISTVERSION) -dist: distprep - rm -rf dist_tmp* - mkdir dist_tmp $(dist_tmp) - find \( -name CVS -o -name dist_tmp* \) -prune -o -type d -print | \ - sed -e 's#.*#mkdir -p $(dist_tmp)/&#' | sh - find \( -name CVS -o -name dist_tmp* \) -prune -o -type f -print | \ - sed -e 's#.*#ln & $(dist_tmp)/&#' | sh - $(MAKE) -C dist_tmp/adns-$(DISTVERSION) distclean - cd dist_tmp && tar cf ../$(dist_tmp).tar `basename $(dist_tmp)` - gzip -9 $(dist_tmp).tar - mv $(dist_tmp).tar.gz . - -README: README.html - lynx -dump -number_links -cfg=/dev/null $(srcdir)/README.html >README.tmp - mv -f README.tmp README - -TAGS info dvi: - # do nothing Index: ircd-ircdev/libs/adns/Makefile.in diff -u ircd-ircdev/libs/adns/Makefile.in:1.1 ircd-ircdev/libs/adns/Makefile.in:removed --- ircd-ircdev/libs/adns/Makefile.in:1.1 Sat Nov 1 09:28:12 2003 +++ ircd-ircdev/libs/adns/Makefile.in Wed Nov 17 04:20:28 2004 @@ -1,69 +0,0 @@ -# Makefile - top-level Makefile -# -# This file is -# Copyright (C) 1997-2000 Ian Jackson <ia...@da...> -# -# It is part of adns, which is -# Copyright (C) 1997-2000 Ian Jackson <ia...@da...> -# Copyright (C) 1999-2000 Tony Finch <do...@do...> -# -# 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, 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. - -# Remember to change ADNS_VERSION_STRING in client/client.h too, and -# possibly library soname (MAJOR and MINOR in settings.make.in). -DISTVERSION= 1.0 - -srcdir= @srcdir@ -VPATH= @srcdir@ - -SUBDIRS= src - -build: all - -all install uninstall clean distclean mostlyclean maintainer-clean distprep: - set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done - $(MAKE) $@-here - -all-here install-here uninstall-here distprep-here: README - -clean-here mostlyclean-here: - rm -f *~ ./#*# core *.orig *.rej adns-*.tar.gz - rm -rf dist_tmp - -distclean-here maintainer-clean-here: clean-here - rm -f settings.make config.h config.cache config.log config.status - -install-strip: - $(MAKE) INSTALL_PROGRAM_FLAGS=-s - -dist_tmp=dist_tmp/adns-$(DISTVERSION) -dist: distprep - rm -rf dist_tmp* - mkdir dist_tmp $(dist_tmp) - find \( -name CVS -o -name dist_tmp* \) -prune -o -type d -print | \ - sed -e 's#.*#mkdir -p $(dist_tmp)/&#' | sh - find \( -name CVS -o -name dist_tmp* \) -prune -o -type f -print | \ - sed -e 's#.*#ln & $(dist_tmp)/&#' | sh - $(MAKE) -C dist_tmp/adns-$(DISTVERSION) distclean - cd dist_tmp && tar cf ../$(dist_tmp).tar `basename $(dist_tmp)` - gzip -9 $(dist_tmp).tar - mv $(dist_tmp).tar.gz . - -README: README.html - lynx -dump -number_links -cfg=/dev/null $(srcdir)/README.html >README.tmp - mv -f README.tmp README - -TAGS info dvi: - # do nothing Index: ircd-ircdev/libs/adns/README diff -u ircd-ircdev/libs/adns/README:1.2 ircd-ircdev/libs/adns/README:removed --- ircd-ircdev/libs/adns/README:1.2 Sat Nov 1 16:47:33 2003 +++ ircd-ircdev/libs/adns/README Wed Nov 17 04:20:29 2004 @@ -1,167 +0,0 @@ - - GNU adns - - Advanced, easy to use, asynchronous-capable DNS client library and - utilities. - - adns is a resolver library for C (and C++) programs, and a collection - of useful DNS resolver utilities. - -C library - - In contrast with the standard interfaces, gethostbyname et al and - libresolv, it has the following features: - * It is reasonably easy to use for simple programs which just want - to translate names to addresses, look up MX records, etc. - * It can be used in an asynchronous, non-blocking, manner. Many - queries can be handled simultaneously. - * Responses are decoded automatically into a natural representation - for a C program - there is no need to deal with DNS packet - formats. - * Sanity checking (eg, name syntax checking, reverse/forward - correspondence, CNAME pointing to CNAME) is performed - automatically. - * Time-to-live, CNAME and other similar information is returned in - an easy-to-use form, without getting in the way. - * There is no global state in the library; resolver state is an - opaque data structure which the client creates explicitly. A - program can have several instances of the resolver. - * Errors are reported to the application in a way that distinguishes - the various causes of failure properly. - * Understands conventional resolv.conf, but this can overridden by - environment variables. - * Flexibility. For example, the application can tell adns to: ignore - environment variables (for setuid programs), disable hostname - syntax sanity checks to return arbitrary data, override or ignore - resolv.conf in favour of supplied configuration, etc. - * Believed to be correct ! For example, will correctly back off to - TCP in case of long replies or queries, or to other nameservers if - several are available. It has sensible handling of bad responses - etc. - -DNS utility programs - - adns also comes with a number of utility programs for use from the - command line and in scripts: - * adnslogres is a much faster version of Apache's logresolv program. - * adnsresfilter is a filter which copies its input to its output, - replacing IP addresses by the corresponding names, without unduly - delaying the output. For example, you can usefully pipe the output - of netstat -n, tcpdump -ln, and the like, into it. - * adnshost is a general-purpose DNS lookup utility which can be used - easily in from the command line and from shell scripts to do - simple lookups. In a more advanced mode it can be used as a - general-purpose DNS helper program for scripting languages which - can invoke and communicate with subprocesses. See the [1]adnshost - usage message for a summary of its capabilities. - -Documentation - - I'm afraid there is no manual yet. However, competent C programmers - should be able to use the library based on the [2]commented adns.h - header file, and the usage messages for the programs should be - sufficient. - -Feedback - - I'd be pleased if you would let me know if you're using my library in - your project, and what you think of it. - - If you are subscribed to adns-discuss please send feedback, including - bug reports, there; otherwise send mail to - adn...@ch.... If you'd prefer that your - message wasn't forwarded to the adns-bugreports list, send it to - adn...@ch.... - -Mailinglists - - I have set up mailinglists adns-announce and adns-discuss. The - announcements list is moderated and will contain only announcements of - important bugs, new versions, etc. The bug reports address mentioned - above is also a mailing list; feel free to subscribe to it. - - There are [3]archives and subscription web pages, or you can subscribe - by sending mail containing the word `subscribe' to - adn...@ch... or - adn...@ch.... - -Download - - Available for download from [4]chiark.greenend.org.uk are: - * The [5]current release as a gzipped tarfile. - * [6]adns.h API header file with comments, and [7]usage message for - adnshost (currently there is no manual, sorry). - * All versions released so far are also available via [8]anonymous - FTP and [9]HTTP, - * A mirror of my CVS repository is available via rsync from - rsync.chiark.greenend.org.uk::ftp/users/ian/cvs-pub/adns (use FTP - first to find your way around), or via [10]cvsweb. - - adns is also available from the [11]GNU Project FTP servers and their - [12]mirrors. - -Technical note - - adns requires a real nameserver like [13]BIND or [14]Dents running on - the same system or a nearby one, which must be willing to provide - `recursive service'. I.e., adns is a `stub resolver'. All properly - configured UN*X and GNU systems will already have such nameserver(s); - they are usually listed in /etc/resolv.conf. - -Copyright and licensing - - adns is Copyright 1997-2000 Ian Jackson, Copyright 1999-2000 Tony - Finch, and Copyright (C) 1991 Massachusetts Institute of Technology. - - adns 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 and documentation 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 - [15]GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with adns, or one should be available above; if not, write to - the [16]Free Software Foundation, 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA, or email adn...@ch.... - _________________________________________________________________ - - [17]Ian Jackson / [18]adn...@ch...; more [19]free - software by me. - - [20]GNU home page; [21]chiark home page; [22]site or mirror home page - - This web page is Copyright (C)1996-2000 Ian Jackson. See the - [23]Copyright/acknowledgements. - - Use any browser - [24]Campaign for a non-browser-specific WWW - -References - - 1. http://www.chiark.greenend.org.uk/~ian/adns/adnshost.txt - 2. http://www.chiark.greenend.org.uk/~ian/adns/adns.h.txt - 3. http://www.chiark.greenend.org.uk/mailman/listinfo - 4. http://www.chiark.greenend.org.uk/~ian/adns/ - 5. http://www.chiark.greenend.org.uk/~ian/adns/adns.tar.gz - 6. http://www.chiark.greenend.org.uk/~ian/adns/adns.h.txt - 7. http://www.chiark.greenend.org.uk/~ian/adns/adnshost.txt - 8. ftp://ftp.chiark.greenend.org.uk/users/ian/adns/ - 9. http://www.chiark.greenend.org.uk/~ian/adns/ftp/ - 10. http://www.chiark.greenend.org.uk/ucgi/~ijackson/cvsweb/adns/ - 11. http://www.gnu.org/ - 12. http://www.gnu.org/order/ftp.html - 13. http://www.isc.org/view.cgi?/products/BIND/index.phtml - 14. http://www.dents.org/ - 15. http://www.chiark.greenend.org.uk/~ian/COPYING.txt - 16. http://www.fsf.org/ - 17. http://www.chiark.greenend.org.uk/ - 18. mailto:adn...@ch... - 19. http://www.chiark.greenend.org.uk/~ian/software/ - 20. http://www.gnu.org/ - 21. http://www.chiark.greenend.org.uk/ - 22. file://localhost/ - 23. http://www.chiark.greenend.org.uk/~ian/sw-www-copy.html - 24. http://www.anybrowser.org/campaign/ Index: ircd-ircdev/libs/adns/README.html diff -u ircd-ircdev/libs/adns/README.html:1.1 ircd-ircdev/libs/adns/README.html:removed --- ircd-ircdev/libs/adns/README.html:1.1 Sat Nov 1 09:28:12 2003 +++ ircd-ircdev/libs/adns/README.html Wed Nov 17 04:20:29 2004 @@ -1,222 +0,0 @@ -<html> -<head> -<title>adns - advanced, alternative, asynchronous resolver</title> -<link rev="made" href="mailto:adn...@ch..."> -</head> -<body> -<h1>GNU adns</h1> - -<strong>Advanced, easy to use, asynchronous-capable DNS client -library and utilities.</strong> - -<!-- Note: this file is maintained in Ian Jackson's private CVS. --> -<!-- --> -<!-- It is served on the GNU site and also from my own system, --> -<!-- under the URL http://www.chiark.greenend.org.uk/adns/ --> -<!-- Please ensure that all links continine to be correct --> -<!-- both for www.gnu.org and chiark. --> -<!-- --> -<!-- $Id: README.html,v 1.1 2003/11/01 17:28:12 zolty Exp $ --> - -<p> - -adns is a resolver library for C (and C++) programs, and a collection -of useful DNS resolver utilities. - - -<h2>C library</h2> - -In contrast with the standard interfaces, gethostbyname et al and -libresolv, it has the following features: - -<ul> - -<li>It is reasonably easy to use for simple programs which just want -to translate names to addresses, look up MX records, etc. - -<li>It can be used in an asynchronous, non-blocking, manner. Many -queries can be handled simultaneously. - -<li>Responses are decoded automatically into a natural representation -for a C program - there is no need to deal with DNS packet formats. - -<li>Sanity checking (eg, name syntax checking, reverse/forward -correspondence, CNAME pointing to CNAME) is performed automatically. - -<li>Time-to-live, CNAME and other similar information is returned in -an easy-to-use form, without getting in the way. - -<li>There is no global state in the library; resolver state is an -opaque data structure which the client creates explicitly. A program -can have several instances of the resolver. - -<li>Errors are reported to the application in a way that distinguishes -the various causes of failure properly. - -<li>Understands conventional resolv.conf, but this can overridden by -environment variables. - -<li>Flexibility. For example, the application can tell adns to: -ignore environment variables (for setuid programs), disable hostname -syntax sanity checks to return arbitrary data, override or ignore -resolv.conf in favour of supplied configuration, etc. - -<li>Believed to be correct ! For example, will correctly back off to -TCP in case of long replies or queries, or to other nameservers if -several are available. It has sensible handling of bad responses etc. - -</ul> - -<h2>DNS utility programs</h2> - -adns also comes with a number of utility programs for use from the -command line and in scripts: - -<ul> - -<li><code>adnslogres</code> is a much faster version of Apache's -logresolv program. - -<li><code>adnsresfilter</code> is a filter which copies its input to -its output, replacing IP addresses by the corresponding names, without -unduly delaying the output. For example, you can usefully pipe the -output of netstat -n, tcpdump -ln, and the like, into it. - -<li><code>adnshost</code> is a general-purpose DNS lookup utility -which can be used easily in from the command line and from shell -scripts to do simple lookups. In a more advanced mode it can be used -as a general-purpose DNS helper program for scripting languages which -can invoke and communicate with subprocesses. See the -<A href="http://www.chiark.greenend.org.uk/~ian/adns/adnshost.txt">adnshost -usage message</A> for a summary of its capabilities. - -</ul> - -<h2>Documentation</h2> - -I'm afraid there is no manual yet. However, competent C programmers -should be able to use the library based on the -<A href="http://www.chiark.greenend.org.uk/~ian/adns/adns.h.txt">commented -adns.h header file</A>, and the usage messages for the programs should -be sufficient. - -<h2>Feedback</h2> - -I'd be pleased if you would let me know if you're using my library in -your project, and what you think of it. - -<p> - -If you are subscribed to <code>adns-discuss</code> please send -feedback, including bug reports, there; otherwise send mail to -<code>adn...@ch...</code>. If you'd prefer -that your message wasn't forwarded to the <code>adns-bugreports</code> -list, send it to <code>adn...@ch...</code>. - -<h2>Mailinglists</h2> - -I have set up mailinglists <code>adns-announce</code> and -<code>adns-discuss</code>. The announcements list is moderated and -will contain only announcements of important bugs, new versions, etc. -The bug reports address mentioned above is also a mailing list; feel -free to subscribe to it. - -<p> - -There are -<A href="http://www.chiark.greenend.org.uk/mailman/listinfo">archives -and subscription web pages</A>, or you can subscribe by sending mail -containing the word `subscribe' to -<code>adn...@ch...</code> or -<code>adn...@ch...</code>. - -<h2>Download</h2> - -Available for download from -<A href="http://www.chiark.greenend.org.uk/~ian/adns/">chiark.greenend.org.uk</A> -are: -<ul> -<li>The <A href="http://www.chiark.greenend.org.uk/~ian/adns/adns.tar.gz">current - release</A> as a gzipped tarfile. -<li><A href="http://www.chiark.greenend.org.uk/~ian/adns/adns.h.txt">adns.h</A> - API header file with comments, and - <A href="http://www.chiark.greenend.org.uk/~ian/adns/adnshost.txt">usage - message for adnshost</A> (currently there is no manual, sorry). -<li>All versions released so far are also available via - <A href="ftp://ftp.chiark.greenend.org.uk/users/ian/adns/">anonymous - FTP</A> and <A href="http://www.chiark.greenend.org.uk/~ian/adns/ftp/">HTTP</A>, -<li>A mirror of my CVS repository is available via rsync from - <code>rsync.chiark.greenend.org.uk::ftp/users/ian/cvs-pub/adns</code> - (use FTP first to find your way around), or via - <A href="http://www.chiark.greenend.org.uk/ucgi/~ijackson/cvsweb/adns/">cvsweb</A>. -</ul> - -adns is also available from the -<A href="http://www.gnu.org/">GNU Project</A> FTP servers and their -<A href="http://www.gnu.org/order/ftp.html">mirrors</A>. - -<h2>Technical note</h2> - -adns requires a real nameserver like -<A href="http://www.isc.org/view.cgi?/products/BIND/index.phtml">BIND</A> -or -<A href="http://www.dents.org/">Dents</A> running on -the same system or a nearby one, which must be willing to provide -`recursive service'. I.e., adns is a `stub resolver'. All properly -configured UN*X and GNU systems will already have such nameserver(s); -they are usually listed in /etc/resolv.conf. - -<h2>Copyright and licensing</h2> - -<kbd>adns</kbd> is Copyright 1997-2000 Ian Jackson, Copyright -1999-2000 Tony Finch, and Copyright (C) 1991 Massachusetts Institute -of Technology. - -<p> - -<kbd>adns</kbd> 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. - -<p> - -This program and documentation is distributed in the hope that it will -be useful, but <em>without any warranty</em>; without even the implied -warranty of <em>merchantability</em> or <em>fitness for a particular -purpose</em>. See the -<A href="http://www.chiark.greenend.org.uk/~ian/COPYING.txt">GNU -General Public License</A> for more details. - -<p> - -You should have received a copy of the GNU General Public License -along with <kbd>adns</kbd>, or one should be available above; if not, -write to the -<A href="http://www.fsf.org/">Free Software Foundation</A>, -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, -or email <code>adn...@ch...</code>. - -<p> - -<hr> -<A href="http://www.chiark.greenend.org.uk/">Ian Jackson</A> / -<A href="mailto:adn...@ch..."><tt>adn...@ch...</tt></A>; -more <A href="http://www.chiark.greenend.org.uk/~ian/software/">free -software</A> by me. -<p> - -<A href="http://www.gnu.org/">GNU home page</A>; -<A href="http://www.chiark.greenend.org.uk/">chiark home page</A>; -<A href="/">site or mirror home page</A> -<p> - -This web page is Copyright (C)1996-2000 Ian Jackson. See the -<A href="http://www.chiark.greenend.org.uk/~ian/sw-www-copy.html">Copyright/acknowledgements</A>. -<p> - -Use any browser - -<A href="http://www.anybrowser.org/campaign/">Campaign for a non-browser-specific WWW</A> - -</body> -</html> Index: ircd-ircdev/libs/adns/README.ircu diff -u ircd-ircdev/libs/adns/README.ircu:1.1 ircd-ircdev/libs/adns/README.ircu:removed --- ircd-ircdev/libs/adns/README.ircu:1.1 Sat Nov 1 09:28:12 2003 +++ ircd-ircdev/libs/adns/README.ircu Wed Nov 17 04:20:29 2004 @@ -1,3 +0,0 @@ -The files in adns/ were borrowed from the ADNS library and slightly -modified to work with ircu's event loop. The original code's copyright -notices are in the README file. Index: ircd-ircdev/libs/adns/aclocal.m4 diff -u ircd-ircdev/libs/adns/aclocal.m4:1.1 ircd-ircdev/libs/adns/aclocal.m4:removed --- ircd-ircdev/libs/adns/aclocal.m4:1.1 Sat Nov 1 09:28:12 2003 +++ ircd-ircdev/libs/adns/aclocal.m4 Wed Nov 17 04:20:29 2004 @@ -1,70 +0,0 @@ -# aclocal.m4 - package-specific macros for autoconf -# -# This file is -# Copyright (C) 1997-1999 Ian Jackson <ia...@da...> -# -# It is part of adns, which is -# Copyright (C) 1997-1999 Ian Jackson <ia...@da...> -# Copyright (C) 1999-2000 Tony Finch <do...@do...> -# -# This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson -# -# 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, 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. - -dnl DPKG_CACHED_TRY_COMPILE(<description>,<cachevar>,<include>,<program>,<ifyes>,<ifno>) -define(DPKG_CACHED_TRY_COMPILE,[ - AC_MSG_CHECKING($1) - AC_CACHE_VAL($2,[ - AC_TRY_COMPILE([$3],[$4],[$2=yes],[$2=no]) - ]) - if test "x$$2" = xyes; then - true - $5 - else - true - $6 - fi -]) - -define(ADNS_C_GCCATTRIB,[ - DPKG_CACHED_TRY_COMPILE(__attribute__((,,)),adns_cv_c_attribute_supported,, - [extern int testfunction(int x) __attribute__((,,))], - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GNUC25_ATTRIB) - DPKG_CACHED_TRY_COMPILE(__attribute__((noreturn)),adns_cv_c_attribute_noreturn,, - [extern int testfunction(int x) __attribute__((noreturn))], - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GNUC25_NORETURN), - AC_MSG_RESULT(no)) - DPKG_CACHED_TRY_COMPILE(__attribute__((const)),adns_cv_c_attribute_const,, - [extern int testfunction(int x) __attribute__((const))], - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GNUC25_CONST), - AC_MSG_RESULT(no)) - DPKG_CACHED_TRY_COMPILE(__attribute__((format...)),adns_cv_attribute_format,, - [extern int testfunction(char *y, ...) __attribute__((format(printf,1,2)))], - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GNUC25_PRINTFFORMAT), - AC_MSG_RESULT(no)), - AC_MSG_RESULT(no)) -]) - -define(ADNS_C_GETFUNC,[ - AC_CHECK_FUNC([$1],,[ - AC_CHECK_LIB([$2],[$1],[$3],[ - AC_MSG_ERROR([cannot find library function $1]) - ]) - ]) -]) Index: ircd-ircdev/libs/adns/configure diff -u ircd-ircdev/libs/adns/configure:1.1 ircd-ircdev/libs/adns/configure:removed --- ircd-ircdev/libs/adns/configure:1.1 Sat Nov 1 09:28:12 2003 +++ ircd-ircdev/libs/adns/configure Wed Nov 17 04:20:29 2004 @@ -1,1994 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kub... [truncated message content] |
From: Toni G. <zo...@us...> - 2004-11-17 11:46:20
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-11-17 11:46:01 UTC Modified files: ChangeLog ChangeLog.es doc/ircd.sample-en.conf doc/ircd.sample-es.conf doc/history/Undernet/ChangeLog-u2.10.11 include/ircd_features.h include/patchlevel.h include/s_conf.h ircd/Makefile.in ircd/channel.c ircd/gline.c ircd/ircd_features.c ircd/ircd_relay.c ircd/listener.c ircd/m_away.c ircd/m_kill.c ircd/m_notice.c ircd/m_ping.c ircd/m_pong.c ircd/m_privmsg.c ircd/m_topic.c ircd/m_version.c ircd/m_wallchops.c ircd/m_wallvoices.c ircd/m_whois.c ircd/parse.c ircd/s_bsd.c ircd/s_conf.c ircd/s_err.c ircd/s_user.c ircd/test/ircd_chattr.0.dat tools/crypter Log message: Author: zoltan <zo...@ir...> Log message: 2004-11-17 Toni García <zo...@ir...> 1.0.alpha12 * Sincronizacion Undernet ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.12 ircd-ircdev/ChangeLog:1.13 --- ircd-ircdev/ChangeLog:1.12 Tue Nov 16 09:58:47 2004 +++ ircd-ircdev/ChangeLog Wed Nov 17 03:45:48 2004 @@ -1,13 +1,16 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.12 2004/11/16 17:58:47 zolty Exp $ +# $Id: ChangeLog,v 1.13 2004/11/17 11:45:48 zolty Exp $ # # Insert new changes at beginning of the change list. # +2004-11-17 Toni García <zo...@ir...> 1.0.alpha12 + * Undernet synchronization + 2004-11-16 Toni García <zo...@ir...> 1.0.alpha11 * IRCD IRC-Dev Reloaded!! - * Distribuited DataBase preliminary version + * Distribuited DataBase preliminary version 2004-05-21 Toni García <zo...@ir...> 1.0.alpha10 * Disallow nick change on a moderated channel Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.12 ircd-ircdev/ChangeLog.es:1.13 --- ircd-ircdev/ChangeLog.es:1.12 Tue Nov 16 09:58:47 2004 +++ ircd-ircdev/ChangeLog.es Wed Nov 17 03:45:48 2004 @@ -1,10 +1,13 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.12 2004/11/16 17:58:47 zolty Exp $ +# $Id: ChangeLog.es,v 1.13 2004/11/17 11:45:48 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2004-11-17 Toni García <zo...@ir...> 1.0.alpha12 + * Sincronizacion Undernet + 2004-11-16 Toni García <zo...@ir...> 1.0.alpha11 * IRCD IRC-Dev Ha Vuelto!! * Vesion preliminar de Base de Datos Distribuidas Index: ircd-ircdev/doc/history/Undernet/ChangeLog-u2.10.11 diff -u ircd-ircdev/doc/history/Undernet/ChangeLog-u2.10.11:1.1 ircd-ircdev/doc/history/Undernet/ChangeLog-u2.10.11:1.2 --- ircd-ircdev/doc/history/Undernet/ChangeLog-u2.10.11:1.1 Fri Apr 23 03:07:50 2004 +++ ircd-ircdev/doc/history/Undernet/ChangeLog-u2.10.11 Wed Nov 17 03:45:49 2004 @@ -1,3 +1,188 @@ +2004-09-17 Kevin L Mitchell <kl...@mi...> + + * include/patchlevel.h (PATCHLEVEL): Release the sucker. + +2004-09-13 Kevin L Mitchell <kl...@mi...> + + * doc/readme.features: update feature name--forgotten in a prior + commit + + * doc/ircd.conf.sample: update feature name--forgotten in a prior + commit + + * doc/example.conf: update feature name--forgotten in a prior + commit + + * include/patchlevel.h (PATCHLEVEL): bump patchlevel (again!), + just so we know who's runnin' what... + + * ircd/listener.c (add_listener): a listener needs to be listed as + a server port listener BEFORE we open the listening port! + +2004-09-11 Kevin L Mitchell <kl...@mi...> + + * ircd/m_topic.c (do_settopic): oh, bah, stupid bug... + +2004-06-17 Fredrik Soderblom <fr...@qu...> + + * ircd/s_conf.c (rehash): added restart_resolver() + +2003-07-04 Bas Steendijk <ste...@xs...> + + * include/client.h, ircd/m_userhost.c, ircd/m_userip.c, ircd/m_who.c, + ircd/m_whois.c, ircd/whocmds.c: the same code, for "can user A see user + B is an oper", appeared in a lot of places. made it a define SeeOper. + +2004-09-11 Kevin L Mitchell <kl...@mi...> + + * ircd/m_topic.c (do_settopic): Don't allow banned users to set a + topic in a channel (adapted from patch by Alexander Maassen + <out...@ke...>) + + * tools/Bounce/Bounce.h: drop file location + + * tools/Bounce/Bounce.cpp: drop file location + + * tools/crypter: drop file location; do some minor fixup; does + anyone actually use this script? + + * tools/Makefile.crypt: drop file location + + * ircd/test/ircd_chattr.0.dat (IsChannelPrefix): drop + from + channel prefix list + + * ircd/s_user.c (hide_hostmask): use the already calculated hidden + host + + * ircd/s_err.c: use the already calculated hidden host + + * ircd/m_version.c (mo_version): fix up a comment + + * ircd/m_topic.c (ms_topic): fix up a couple of comments + + * ircd/m_quit.c: drop the "template" moniker + + * ircd/m_privmsg.c: drop the "template" moniker + + * ircd/m_pong.c: drop the "template" moniker + + * ircd/m_ping.c: drop the "template" moniker + + * ircd/m_opmode.c: update file location + + * ircd/m_notice.c: drop the "template" moniker + + * ircd/m_kill.c: drop the "template" moniker + + * ircd/m_clearmode.c: update file location + + * ircd/m_away.c: drop the "template" moniker + + * ircd/ircd_relay.c (relay_directed_message): X does say it's a + service, now... + + * config.h.in: drop file location + + * acconfig.h: drop file location + + * ircd/m_whois.c (do_whois): rename FEAT_HIS_LOCAL_CHAN_WHOIS to + satisfy reed :P + + * ircd/ircd_features.c: rename FEAT_HIS_LOCAL_CHAN_WHOIS to + satisfy reed :P + + * include/ircd_features.h: rename FEAT_HIS_LOCAL_CHAN_WHOIS to + satisfy reed :P + + * include/patchlevel.h (PATCHLEVEL): bump patch level + + * ircd/channel.c (is_banned): apply patch #888640 + +2003-06-08 Matthias Crauwels <ult...@wo...> + * include/ircd_features.h: new feature FEAT_HIS_LOCAL_CHAN_WHOIS + + * ircd/ircd_features.c: new feature FEAT_HIS_LOCAL_CHAN_WHOIS + + * ircd/m_whois.c: hide local channels in local WHOIS, this breaks HIS + + * doc/readme.features: documented FEAT_HIS_LOCAL_CHAN_WHOIS + + * doc/ircd.conf.sample: default value for FEAT_HIS_LOCAL_CHAN_WHOIS + +2004-09-11 Kevin L Mitchell <kl...@mi...> + + * ircd/m_wallvoices.c (ms_wallvoices): Don't accept & channel + WALLVOICES from servers (Bug #721494) + + * ircd/m_wallchops.c (ms_wallchops): Don't accept & channel + WALLCHOPS from servers (Bug #721494) + + * ircd/ircd_relay.c: Don't accept & channel messages/notices from + servers (Bug #721494) + + * ircd/gline.c (gline_add): fix GLINE logging (Bug #750927) + + * ircd/channel.c: removing limits shouldn't gobble an argument; + this was a subtle interaction issue with modebuf...fixed by adding + MODE_LIMIT to modebuf_flush_int() and short-circuiting + modebuf_mode_uint() to add MODE_LIMIT to mbuf->mb_rem in the + removal case. Note that this is not proof against the sequence, + "modebuf_mode_uint(mbuf, MODE_ADD | MODE_LIMIT, 10); + modebuf_mode_uint(mbuf, MODE_DEL | MODE_LIMIT, 10);" + (Bug #916138) + +2004-08-31 Isomer <is...@un...> + * ircd/m_account.c: Back out untested login-on-connect extensions, + we'll relook at these for .12 + +2004-04-17 Isomer <is...@un...> + * ircd/parse.c: Don't rate limit /gline messages + +2004-08-26 Kevin L Mitchell <kl...@mi...> + + * ircd/s_conf.c (lookup_confhost): if field 1 of a C-line contains + a '/', interpret the text before the '/' as an IP address to bind + to locally, and use the text after the '/' as the host to connect + to + + * ircd/s_bsd.c (connect_inet): if origin field in struct ConfItem + is set, bind to the identified address + + * include/s_conf.h: add origin field to struct ConfItem + +2004-06-20 Alex Badea <dec...@us...> + + * ircd/m_account.c: login-on-connect extensions, part 1: + added message sub-types and implemented routing + +2004-06-18 Alex Badea <dec...@us...> + + * ircd/gline.c (gline_lookup): only return a gline if it's + active + + * ircd/s_conf.c (find_kill): don't check for active gline, + since gline_lookup does now + +2004-06-08 Kevin L Mitchell <kl...@mi...> + + * ircd/parse.c: don't let rank-and-file users escape HIS + limitations with /jupe... + +2004-05-14 Kevin L Mitchell <kl...@mi...> + + * ircd/ircd_features.c: per CFV-0243, NICKLEN default is increased + to 12 + + * ircd/s_user.c: process account creation timestamp if present in + user mode portion of a N protocol message; add account creation + timestamp to outgoing N protocol messages if that timestamp is + non-zero + + * ircd/m_account.c: process account creation timestamp if present + in AC protocol message + + * include/struct.h: add account creation timestamp + 2004-03-20 Isomer <is...@un...> * ircd/m_invite.c: Disallow invites to non existant channels Index: ircd-ircdev/doc/ircd.sample-en.conf diff -u ircd-ircdev/doc/ircd.sample-en.conf:1.7 ircd-ircdev/doc/ircd.sample-en.conf:1.8 --- ircd-ircdev/doc/ircd.sample-en.conf:1.7 Fri May 28 03:15:55 2004 +++ ircd-ircdev/doc/ircd.sample-en.conf Wed Nov 17 03:45:49 2004 @@ -1,6 +1,6 @@ # ircd.conf - configuration file for IRC-Dev's IRCD. # -# Last Updated: 28, May 2004. +# Last Updated: 17, Nov 2004. # # Written by Niels <ni...@un...>, based on the original example.conf, # server code and some real-life (ahem) experience. @@ -821,6 +821,7 @@ # "HIS_STATS_z" = "TRUE"; # "HIS_WHOIS_SERVERNAME" = "TRUE"; # "HIS_WHOIS_IDLETIME" = "TRUE"; +# "HIS_WHOIS_LOCALCHAN" = "TRUE"; # "HIS_WHO_SERVERNAME" = "TRUE"; # "HIS_WHO_HOPCOUNT" = TRUE"; # "HIS_BANWHO" = "TRUE"; Index: ircd-ircdev/doc/ircd.sample-es.conf diff -u ircd-ircdev/doc/ircd.sample-es.conf:1.2 ircd-ircdev/doc/ircd.sample-es.conf:1.3 --- ircd-ircdev/doc/ircd.sample-es.conf:1.2 Fri May 28 03:15:56 2004 +++ ircd-ircdev/doc/ircd.sample-es.conf Wed Nov 17 03:45:49 2004 @@ -1,6 +1,6 @@ # ircd.conf - archivo de configuración para el IRCD de IRC-Dev. # -# Ultima actualización: 28, May 2004. +# Ultima actualización: 17, Nov 2004. # # Escrito por Niels <ni...@un...>, basado en el archivo example.conf # original, en el código del servidor y la experiencia de la vida real. @@ -858,6 +858,7 @@ # "HIS_STATS_z" = "TRUE"; # "HIS_WHOIS_SERVERNAME" = "TRUE"; # "HIS_WHOIS_IDLETIME" = "TRUE"; +# "HIS_WHOIS_LOCALCHAN" = "TRUE"; # "HIS_WHO_SERVERNAME" = "TRUE"; # "HIS_WHO_HOPCOUNT" = TRUE"; # "HIS_BANWHO" = "TRUE"; Index: ircd-ircdev/include/ircd_features.h diff -u ircd-ircdev/include/ircd_features.h:1.6 ircd-ircdev/include/ircd_features.h:1.7 --- ircd-ircdev/include/ircd_features.h:1.6 Fri May 21 08:39:34 2004 +++ ircd-ircdev/include/ircd_features.h Wed Nov 17 03:45:49 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: ircd_features.h,v 1.6 2004/05/21 15:39:34 zolty Exp $ + * $Id: ircd_features.h,v 1.7 2004/11/17 11:45:49 zolty Exp $ * */ #ifndef INCLUDED_features_h @@ -137,6 +137,7 @@ FEAT_HIS_STATS_z, FEAT_HIS_WHOIS_SERVERNAME, FEAT_HIS_WHOIS_IDLETIME, + FEAT_HIS_WHOIS_LOCALCHAN, FEAT_HIS_WHO_SERVERNAME, FEAT_HIS_WHO_HOPCOUNT, FEAT_HIS_BANWHO, Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.12 ircd-ircdev/include/patchlevel.h:1.13 --- ircd-ircdev/include/patchlevel.h:1.12 Tue Nov 16 09:58:47 2004 +++ ircd-ircdev/include/patchlevel.h Wed Nov 17 03:45:49 2004 @@ -17,10 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: patchlevel.h,v 1.12 2004/11/16 17:58:47 zolty Exp $ + * $Id: patchlevel.h,v 1.13 2004/11/17 11:45:49 zolty Exp $ * */ -#define PATCHLEVEL ".alpha11" +#define PATCHLEVEL ".alpha12" #define RELEASE "1.0" Index: ircd-ircdev/include/s_conf.h diff -u ircd-ircdev/include/s_conf.h:1.5 ircd-ircdev/include/s_conf.h:1.6 --- ircd-ircdev/include/s_conf.h:1.5 Fri May 21 08:39:34 2004 +++ ircd-ircdev/include/s_conf.h Wed Nov 17 03:45:49 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: s_conf.h,v 1.5 2004/05/21 15:39:34 zolty Exp $ + * $Id: s_conf.h,v 1.6 2004/11/17 11:45:49 zolty Exp $ * */ #ifndef INCLUDED_s_conf_h @@ -74,6 +74,7 @@ unsigned int status; /* If CONF_ILLEGAL, delete when no clients */ unsigned int clients; /* Number of *LOCAL* clients using this */ struct ConnectionClass* conn_class; /* Class of connection */ + struct in_addr origin; /* ip number of connect origin */ struct in_addr ipnum; /* ip number of host field */ char* host; char* passwd; Index: ircd-ircdev/ircd/Makefile.in diff -u ircd-ircdev/ircd/Makefile.in:1.11 ircd-ircdev/ircd/Makefile.in:1.12 --- ircd-ircdev/ircd/Makefile.in:1.11 Tue Nov 16 09:58:47 2004 +++ ircd-ircdev/ircd/Makefile.in Wed Nov 17 03:45:49 2004 @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA -# $Id: Makefile.in,v 1.11 2004/11/16 17:58:47 zolty Exp $ +# $Id: Makefile.in,v 1.12 2004/11/17 11:45:49 zolty Exp $ #### Start of system configuration section. #### @@ -414,7 +414,7 @@ dbuf.o: dbuf.c ../config.h ../include/dbuf.h ../include/ircd_alloc.h \ ../include/ircd_chattr.h ../include/ircd_features.h ../include/send.h \ ../include/sys.h -ddb.o: ddb.c ../config.h ../include/ddb.h +ddb.o: ddb.c ../config.h destruct_event.o: destruct_event.c ../config.h ../include/channel.h \ ../include/ircd_defs.h ../include/s_debug.h ../include/ircd_alloc.h \ ../include/ircd.h ../include/struct.h ../include/ircd_events.h \ @@ -605,12 +605,8 @@ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/s_debug.h ../include/s_misc.h \ ../include/s_user.h ../include/send.h -m_db.o: m_db.c ../config.h ../include/ddb.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/msg.h -m_dbq.o: m_dbq.c ../config.h ../include/ddb.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/msg.h +m_db.o: m_db.c ../config.h +m_dbq.o: m_dbq.c ../config.h m_defaults.o: m_defaults.c ../config.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ Index: ircd-ircdev/ircd/channel.c diff -u ircd-ircdev/ircd/channel.c:1.7 ircd-ircdev/ircd/channel.c:1.8 --- ircd-ircdev/ircd/channel.c:1.7 Fri May 21 08:39:34 2004 +++ ircd-ircdev/ircd/channel.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: channel.c,v 1.7 2004/05/21 15:39:34 zolty Exp $ + * $Id: channel.c,v 1.8 2004/11/17 11:45:50 zolty Exp $ * */ #include "config.h" @@ -501,7 +501,7 @@ if (match(tmp->value.ban.banstr, ip_s) == 0) break; } - else if (match(tmp->value.ban.banstr, s) == 0) + if (match(tmp->value.ban.banstr, s) == 0) break; else if (sr && match(tmp->value.ban.banstr, sr) == 0) break; @@ -1611,7 +1611,7 @@ MODE_WASDELJOINS, 'd', /* MODE_KEY, 'k', */ /* MODE_BAN, 'b', */ -/* MODE_LIMIT, 'l', */ + MODE_LIMIT, 'l', #if defined(UNDERNET) /* MODE_APASS, 'A', */ /* MODE_UPASS, 'u', */ @@ -2033,6 +2033,11 @@ assert(0 != mbuf); assert(0 != (mode & (MODE_ADD | MODE_DEL))); + if (mode == (MODE_LIMIT | MODE_DEL)) { + mbuf->mb_rem |= mode; + return; + } + MB_TYPE(mbuf, mbuf->mb_count) = mode; MB_UINT(mbuf, mbuf->mb_count) = uint; Index: ircd-ircdev/ircd/gline.c diff -u ircd-ircdev/ircd/gline.c:1.6 ircd-ircdev/ircd/gline.c:1.7 --- ircd-ircdev/ircd/gline.c:1.6 Fri May 21 08:39:34 2004 +++ ircd-ircdev/ircd/gline.c Wed Nov 17 03:45:50 2004 @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: gline.c,v 1.6 2004/05/21 15:39:34 zolty Exp $ + * $Id: gline.c,v 1.7 2004/11/17 11:45:50 zolty Exp $ * */ #include "config.h" @@ -448,9 +448,11 @@ /* and log it */ log_write(LS_GLINE, L_INFO, LOG_NOSNOTICE, - "%#C adding %s %s for %s, expiring at %Tu: %s", sptr, + "%#C adding %s %s for %s%s%s, expiring at %Tu: %s", sptr, flags & GLINE_LOCAL ? "local" : "global", - flags & GLINE_BADCHAN ? "BADCHAN" : "GLINE", userhost, + flags & GLINE_BADCHAN ? "BADCHAN" : "GLINE", user, + flags & (GLINE_BADCHAN|GLINE_REALNAME) ? "" : "@", + flags & (GLINE_BADCHAN|GLINE_REALNAME) ? "" : host, expire + TSoffset, reason); /* make the gline */ @@ -666,7 +668,8 @@ Debug((DEBUG_DEBUG,"realname gline: '%s' '%s'",gline->gl_user,cli_info(cptr))); if (match(gline->gl_user+2, cli_info(cptr)) != 0) continue; - + if (!GlineIsActive(gline)) + continue; return gline; } else { @@ -683,7 +686,8 @@ continue; } } - return gline; + if (GlineIsActive(gline)) + return gline; } /* * No Glines matched Index: ircd-ircdev/ircd/ircd_features.c diff -u ircd-ircdev/ircd/ircd_features.c:1.6 ircd-ircdev/ircd/ircd_features.c:1.7 --- ircd-ircdev/ircd/ircd_features.c:1.6 Fri May 21 08:39:34 2004 +++ ircd-ircdev/ircd/ircd_features.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: ircd_features.c,v 1.6 2004/05/21 15:39:34 zolty Exp $ + * $Id: ircd_features.c,v 1.7 2004/11/17 11:45:50 zolty Exp $ * */ #include "config.h" @@ -344,6 +344,7 @@ F_B(HIS_STATS_z, 0, 1, 0), F_B(HIS_WHOIS_SERVERNAME, 0, 1, 0), F_B(HIS_WHOIS_IDLETIME, 0, 1, 0), + F_B(HIS_WHOIS_LOCALCHAN, 0, 1, 0), F_B(HIS_WHO_SERVERNAME, 0, 1, 0), F_B(HIS_WHO_HOPCOUNT, 0, 1, 0), F_B(HIS_BANWHO, 0, 1, 0), Index: ircd-ircdev/ircd/ircd_relay.c diff -u ircd-ircdev/ircd/ircd_relay.c:1.4 ircd-ircdev/ircd/ircd_relay.c:1.5 --- ircd-ircdev/ircd/ircd_relay.c:1.4 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/ircd_relay.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: ircd_relay.c,v 1.4 2004/05/21 15:39:35 zolty Exp $ + * $Id: ircd_relay.c,v 1.5 2004/11/17 11:45:50 zolty Exp $ * */ #include "config.h" @@ -109,7 +109,7 @@ assert(0 != name); assert(0 != text); - if (0 == (chptr = FindChannel(name))) { + if (*name == '&' || 0 == (chptr = FindChannel(name))) { /* * XXX - do we need to send this back from a remote server? */ @@ -135,7 +135,7 @@ assert(0 != name); assert(0 != text); - if (0 == (chptr = FindChannel(name))) + if (*name == '&' || 0 == (chptr = FindChannel(name))) return; /* * This first: Almost never a server/service Index: ircd-ircdev/ircd/listener.c diff -u ircd-ircdev/ircd/listener.c:1.3 ircd-ircdev/ircd/listener.c:1.4 --- ircd-ircdev/ircd/listener.c:1.3 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/listener.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: listener.c,v 1.3 2004/02/22 16:11:42 zolty Exp $ + * $Id: listener.c,v 1.4 2004/11/17 11:45:50 zolty Exp $ * */ #include "config.h" @@ -350,11 +350,12 @@ listener = make_listener(port, vaddr); + set_listener_mask(listener, mask); + listener->hidden = is_hidden; + listener->server = is_server; + if (inetport(listener)) { listener->active = 1; - set_listener_mask(listener, mask); - listener->hidden = is_hidden; - listener->server = is_server; listener->next = ListenerPollList; ListenerPollList = listener; } Index: ircd-ircdev/ircd/m_away.c diff -u ircd-ircdev/ircd/m_away.c:1.2 ircd-ircdev/ircd/m_away.c:1.3 --- ircd-ircdev/ircd/m_away.c:1.2 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/m_away.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_away.c,v 1.2 2004/02/22 16:11:42 zolty Exp $ + * $Id: m_away.c,v 1.3 2004/11/17 11:45:50 zolty Exp $ * */ @@ -141,7 +141,7 @@ /* - * m_away - generic message handler template + * m_away - generic message handler * - Added 14 Dec 1988 by jto. * * parv[0] = sender prefix @@ -171,7 +171,7 @@ } /* - * ms_away - server message handler template + * ms_away - server message handler * - Added 14 Dec 1988 by jto. * * parv[0] = sender prefix Index: ircd-ircdev/ircd/m_kill.c diff -u ircd-ircdev/ircd/m_kill.c:1.2 ircd-ircdev/ircd/m_kill.c:1.3 --- ircd-ircdev/ircd/m_kill.c:1.2 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_kill.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_kill.c,v 1.2 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_kill.c,v 1.3 2004/11/17 11:45:50 zolty Exp $ * */ @@ -161,7 +161,7 @@ } /* - * ms_kill - server message handler template + * ms_kill - server message handler * * NOTE: IsServer(cptr) == true; * @@ -226,7 +226,7 @@ } /* - * mo_kill - oper message handler template + * mo_kill - oper message handler * * NOTE: IsPrivileged(sptr), IsAnOper(sptr) == true * IsServer(cptr), IsServer(sptr) == false Index: ircd-ircdev/ircd/m_notice.c diff -u ircd-ircdev/ircd/m_notice.c:1.2 ircd-ircdev/ircd/m_notice.c:1.3 --- ircd-ircdev/ircd/m_notice.c:1.2 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_notice.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_notice.c,v 1.2 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_notice.c,v 1.3 2004/11/17 11:45:50 zolty Exp $ * */ @@ -147,7 +147,7 @@ } /* - * ms_notice - server message handler template + * ms_notice - server message handler */ int ms_notice(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { Index: ircd-ircdev/ircd/m_ping.c diff -u ircd-ircdev/ircd/m_ping.c:1.4 ircd-ircdev/ircd/m_ping.c:1.5 --- ircd-ircdev/ircd/m_ping.c:1.4 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/m_ping.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_ping.c,v 1.4 2004/05/21 15:39:35 zolty Exp $ + * $Id: m_ping.c,v 1.5 2004/11/17 11:45:50 zolty Exp $ * */ @@ -230,7 +230,7 @@ */ /* - * ms_ping - server message handler template + * ms_ping - server message handler */ int ms_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { Index: ircd-ircdev/ircd/m_pong.c diff -u ircd-ircdev/ircd/m_pong.c:1.2 ircd-ircdev/ircd/m_pong.c:1.3 --- ircd-ircdev/ircd/m_pong.c:1.2 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_pong.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_pong.c,v 1.2 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_pong.c,v 1.3 2004/11/17 11:45:50 zolty Exp $ * */ @@ -97,7 +97,7 @@ #include <stdlib.h> /* - * ms_pong - server message handler template + * ms_pong - server message handler * * parv[0] = sender prefix * parv[1] = origin Index: ircd-ircdev/ircd/m_privmsg.c diff -u ircd-ircdev/ircd/m_privmsg.c:1.2 ircd-ircdev/ircd/m_privmsg.c:1.3 --- ircd-ircdev/ircd/m_privmsg.c:1.2 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_privmsg.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_privmsg.c,v 1.2 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_privmsg.c,v 1.3 2004/11/17 11:45:50 zolty Exp $ */ /* @@ -143,7 +143,7 @@ } /* - * ms_privmsg - server message handler template + * ms_privmsg - server message handler */ int ms_privmsg(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { Index: ircd-ircdev/ircd/m_topic.c diff -u ircd-ircdev/ircd/m_topic.c:1.3 ircd-ircdev/ircd/m_topic.c:1.4 --- ircd-ircdev/ircd/m_topic.c:1.3 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/m_topic.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_topic.c,v 1.3 2004/05/21 15:39:35 zolty Exp $ + * $Id: m_topic.c,v 1.4 2004/11/17 11:45:50 zolty Exp $ * */ @@ -108,12 +108,16 @@ from = sptr; member = find_channel_member(sptr, chptr); - /* if +n and not @'d, return an error and ignore the topic */ + /* if +t and not @'d, return an error and ignore the topic */ if ((chptr->mode.mode & MODE_TOPICLIMIT) != 0 && (!member || !IsChanOp(member))) { send_reply(sptr, ERR_CHANOPRIVSNEEDED, chptr->chname); return; } + if (!client_can_send_to_channel(sptr, chptr, 1)) { + send_reply(sptr, ERR_CANNOTSENDTOCHAN, chptr->chname); + return; + } if (member && IsDelayedJoin(member)) RevealDelayedJoin(member); /* Note if this is just a refresh of an old topic, and don't @@ -125,7 +129,7 @@ ircd_strncpy(chptr->topic, topic, TOPICLEN); ircd_strncpy(chptr->topic_nick, cli_name(from), NICKLEN); chptr->topic_time = ts ? ts : TStime(); - /* Fixed in 2.10.11: Don't propergate local topics */ + /* Fixed in 2.10.11: Don't propagate local topics */ if (!IsLocalChannel(chptr->chname)) sendcmdto_serv_butone(sptr, CMD_TOPIC, cptr, "%H %Tu %Tu :%s", chptr, chptr->creationtime, chptr->topic_time, chptr->topic); @@ -192,7 +196,7 @@ } /* - * ms_topic - generic message handler + * ms_topic - server message handler * * parv[0] = sender prefix * parv[1] = channel Index: ircd-ircdev/ircd/m_version.c diff -u ircd-ircdev/ircd/m_version.c:1.2 ircd-ircdev/ircd/m_version.c:1.3 --- ircd-ircdev/ircd/m_version.c:1.2 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_version.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_version.c,v 1.2 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_version.c,v 1.3 2004/11/17 11:45:50 zolty Exp $ */ /* @@ -119,7 +119,7 @@ } /* - * mo_version - generic message handler + * mo_version - oper message handler * * parv[0] = sender prefix * parv[1] = servername Index: ircd-ircdev/ircd/m_wallchops.c diff -u ircd-ircdev/ircd/m_wallchops.c:1.3 ircd-ircdev/ircd/m_wallchops.c:1.4 --- ircd-ircdev/ircd/m_wallchops.c:1.3 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/m_wallchops.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_wallchops.c,v 1.3 2004/05/21 15:39:35 zolty Exp $ + * $Id: m_wallchops.c,v 1.4 2004/11/17 11:45:50 zolty Exp $ */ /* @@ -141,7 +141,7 @@ if (parc < 3 || !IsUser(sptr)) return 0; - if ((chptr = FindChannel(parv[1]))) { + if (*parv[1] != '&' && (chptr = FindChannel(parv[1]))) { if (client_can_send_to_channel(sptr, chptr, 0)) { sendcmdto_channel_butone(sptr, CMD_WALLCHOPS, chptr, cptr, SKIP_DEAF | SKIP_BURST | SKIP_NONOPS, Index: ircd-ircdev/ircd/m_wallvoices.c diff -u ircd-ircdev/ircd/m_wallvoices.c:1.3 ircd-ircdev/ircd/m_wallvoices.c:1.4 --- ircd-ircdev/ircd/m_wallvoices.c:1.3 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/m_wallvoices.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_wallvoices.c,v 1.3 2004/05/21 15:39:35 zolty Exp $ + * $Id: m_wallvoices.c,v 1.4 2004/11/17 11:45:50 zolty Exp $ */ /* @@ -141,7 +141,7 @@ if (parc < 3 || !IsUser(sptr)) return 0; - if ((chptr = FindChannel(parv[1]))) { + if (*parv[1] != '&' && (chptr = FindChannel(parv[1]))) { if (client_can_send_to_channel(sptr, chptr, 0)) { sendcmdto_channel_butone(sptr, CMD_WALLVOICES, chptr, cptr, SKIP_DEAF | SKIP_BURST | SKIP_NONVOICES, Index: ircd-ircdev/ircd/m_whois.c diff -u ircd-ircdev/ircd/m_whois.c:1.7 ircd-ircdev/ircd/m_whois.c:1.8 --- ircd-ircdev/ircd/m_whois.c:1.7 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/m_whois.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_whois.c,v 1.7 2004/05/21 15:39:35 zolty Exp $ + * $Id: m_whois.c,v 1.8 2004/11/17 11:45:50 zolty Exp $ */ /* @@ -156,6 +156,14 @@ if (acptr != sptr && IsZombie(chan)) continue; + + /* Don't show local channels when HIS is defined, unless it's a + * remote WHOIS --ULtimaTe_ + */ + if (IsLocalChannel(chptr->chname) && (parc == 2) && + feature_bool(FEAT_HIS_WHOIS_LOCALCHAN) && (acptr != sptr) && + !IsAnOper(sptr)) + continue; if (len+strlen(chptr->chname) + mlen > BUFSIZE - 5) { Index: ircd-ircdev/ircd/parse.c diff -u ircd-ircdev/ircd/parse.c:1.7 ircd-ircdev/ircd/parse.c:1.8 --- ircd-ircdev/ircd/parse.c:1.7 Tue Nov 16 09:58:47 2004 +++ ircd-ircdev/ircd/parse.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: parse.c,v 1.7 2004/11/16 17:58:47 zolty Exp $ + * $Id: parse.c,v 1.8 2004/11/17 11:45:50 zolty Exp $ * */ #include "config.h" @@ -495,7 +495,7 @@ { MSG_GLINE, TOK_GLINE, - 0, MAXPARA, MFLG_SLOW, 0, NULL, + 0, MAXPARA, 0, 0, NULL, /* UNREG, CLIENT, SERVER, OPER, SERVICE */ { m_unregistered, m_gline, ms_gline, mo_gline, m_ignore } }, Index: ircd-ircdev/ircd/s_bsd.c diff -u ircd-ircdev/ircd/s_bsd.c:1.4 ircd-ircdev/ircd/s_bsd.c:1.5 --- ircd-ircdev/ircd/s_bsd.c:1.4 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/s_bsd.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: s_bsd.c,v 1.4 2004/02/22 16:11:42 zolty Exp $ + * $Id: s_bsd.c,v 1.5 2004/11/17 11:45:50 zolty Exp $ * */ #include "config.h" @@ -234,7 +234,7 @@ */ static int connect_inet(struct ConfItem* aconf, struct Client* cptr) { - static struct sockaddr_in sin; + static struct sockaddr_in sin, *locaddr = 0; IOResult result; assert(0 != aconf); assert(0 != cptr); @@ -270,9 +270,17 @@ * explicitly bind it, it will default to IN_ADDR_ANY and we lose * due to the other server not allowing our base IP --smg */ - if (feature_bool(FEAT_VIRTUAL_HOST) && - bind(cli_fd(cptr), (struct sockaddr*) &VirtualHost, - sizeof(VirtualHost))) { + if (aconf->origin.s_addr != INADDR_NONE) { + memset(&sin, 0, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = aconf->origin.s_addr; + locaddr = &sin; + } else if (feature_bool(FEAT_VIRTUAL_HOST)) + locaddr = &VirtualHost; + + if (locaddr && + bind(cli_fd(cptr), (struct sockaddr*) locaddr, + sizeof(struct sockaddr_in))) { report_error(BIND_ERROR_MSG, cli_name(cptr), errno); close(cli_fd(cptr)); cli_fd(cptr) = -1; Index: ircd-ircdev/ircd/s_conf.c diff -u ircd-ircdev/ircd/s_conf.c:1.5 ircd-ircdev/ircd/s_conf.c:1.6 --- ircd-ircdev/ircd/s_conf.c:1.5 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/s_conf.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: s_conf.c,v 1.5 2004/05/21 15:39:35 zolty Exp $ + * $Id: s_conf.c,v 1.6 2004/11/17 11:45:50 zolty Exp $ * */ #include "config.h" @@ -246,6 +246,8 @@ */ void lookup_confhost(struct ConfItem *aconf) { + char *tmp, *tmp2; + if (EmptyString(aconf->host) || EmptyString(aconf->name)) { Debug((DEBUG_ERROR, "Host/server name error: (%s) (%s)", aconf->host, aconf->name)); @@ -255,6 +257,15 @@ * Do name lookup now on hostnames given and store the * ip numbers in conf structure. */ + if ((tmp = strchr(aconf->host, '/'))) { + *(tmp++) = '\0'; + aconf->origin.s_addr = inet_addr(aconf->host); + tmp2 = aconf->host; + DupString(aconf->host, tmp); + free(tmp2); + } else + aconf->origin.s_addr = INADDR_NONE; + if (IsDigit(*aconf->host)) { /* * rfc 1035 sez host names may not start with a digit @@ -949,15 +960,13 @@ send_reply(cptr, SND_EXPLICIT | ERR_YOUREBANNEDCREEP, ":%s.", deny->message); } } - else if ((agline = gline_lookup(cptr, 0)) && GlineIsActive(agline)) { + else if ((agline = gline_lookup(cptr, 0))) { /* * find active glines * added a check against the user's IP address to find_gline() -Kev */ send_reply(cptr, SND_EXPLICIT | ERR_YOUREBANNEDCREEP, ":%s.", GlineReason(agline)); } - else - agline = 0; /* if a gline was found, it was inactive */ if (deny) return -1; Index: ircd-ircdev/ircd/s_err.c diff -u ircd-ircdev/ircd/s_err.c:1.7 ircd-ircdev/ircd/s_err.c:1.8 --- ircd-ircdev/ircd/s_err.c:1.7 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/s_err.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: s_err.c,v 1.7 2004/05/21 15:39:35 zolty Exp $ + * $Id: s_err.c,v 1.8 2004/11/17 11:45:50 zolty Exp $ * */ #include "config.h" @@ -835,7 +835,7 @@ /* 395 */ { 0 }, /* 396 */ - { RPL_HOSTHIDDEN, "%s.%s :is now your hidden host", "396" }, + { RPL_HOSTHIDDEN, "%s :is now your hidden host", "396" }, /* 397 */ { 0 }, /* 398 */ Index: ircd-ircdev/ircd/s_user.c diff -u ircd-ircdev/ircd/s_user.c:1.6 ircd-ircdev/ircd/s_user.c:1.7 --- ircd-ircdev/ircd/s_user.c:1.6 Fri May 21 08:39:35 2004 +++ ircd-ircdev/ircd/s_user.c Wed Nov 17 03:45:50 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: s_user.c,v 1.6 2004/05/21 15:39:35 zolty Exp $ + * $Id: s_user.c,v 1.7 2004/11/17 11:45:50 zolty Exp $ * */ #include "config.h" @@ -1107,8 +1107,7 @@ /* ok, the client is now fully hidden, so let them know -- hikari */ if (MyConnect(cptr)) - send_reply(cptr, RPL_HOSTHIDDEN, cli_user(cptr)->account, - feature_str(FEAT_HIDDEN_HOST)); + send_reply(cptr, RPL_HOSTHIDDEN, cli_user(cptr)->host(< /* * Go through all channels the client was on, rejoin him Index: ircd-ircdev/ircd/test/ircd_chattr.0.dat diff -u ircd-ircdev/ircd/test/ircd_chattr.0.dat:1.1.1.1 ircd-ircdev/ircd/test/ircd_chattr.0.dat:1.2 --- ircd-ircdev/ircd/test/ircd_chattr.0.dat:1.1.1.1 Mon Sep 8 03:34:31 2003 +++ ircd-ircdev/ircd/test/ircd_chattr.0.dat Wed Nov 17 03:45:50 2004 @@ -7,7 +7,7 @@ IsCntrl: \0\1\2\3\4\5\6\a\b\t\n\v\f\r\e\f\10\11\12\13\14\15\16\17\18\19\1a\1b\1c\1d\1e\1f IsChannelChar: \0\1\2\3\4\5\6\b\t\n\v\f\r\e\f\10\11\12\13\14\15\16\17\18\19\1a\1b\1c\1d\1e\1f!"#$%&'()*+-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\7f\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f\a1\a2\a3\a4\a5\a6\a7\a8\a9\aa\ab\ac\ad\ae\af\b0\b1\b2\b3\b4\b5\b6\b7\b8\b9\ba\bb\bc\bd\be\bf\c0\c1\c2\c3\c4\c5\c6\c7\c8\c9\ca\cb\cc\cd\ce\cf\d0\d1\d2\d3\d4\d5\d6\d7\d8\d9\da\db\dc\dd\de\df\e0\e1\e2\e3\e4\e5\e6\e7\e8\e9\ea\eb\ec\ed\ee\ef\f0\f1\f2\f3\f4\f5\f6\f7\f8\f9\fa\fb\fc\fd\fe\ff IsChannelLower: \c0\c1\c2\c3\c4\c5\c6\c7\c8\c9\ca\cb\cc\cd\ce\cf\d0\d1\d2\d3\d4\d5\d6\d8\d9\da\db\dc\dd\de -IsChannelPrefix: #&+ +IsChannelPrefix: #& IsNickChar: -0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ IsUserChar: '-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\c0\c1\c2\c3\c4\c5\c6\c7\c8\c9\ca\cb\cc\cd\ce\cf\d0\d1\d2\d3\d4\d5\d6\d8\d9\da\db\dc\dd\de\e0\e1\e2\e3\e4\e5\e6\e7\e8\e9\ea\eb\ec\ed\ee\ef\f0\f1\f2\f3\f4\f5\f6\f8\f9\fa\fb\fc\fd\fe IsHostChar: -.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}~ Index: ircd-ircdev/tools/crypter diff -u ircd-ircdev/tools/crypter:1.2 ircd-ircdev/tools/crypter:1.3 --- ircd-ircdev/tools/crypter:1.2 Sun Feb 22 08:14:25 2004 +++ ircd-ircdev/tools/crypter Wed Nov 17 03:45:51 2004 @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl +#!/usr/bin/perl # # IRC-Dev IRCD - An advanced and innovative IRC Daemon, tools/crypter # @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id: crypter,v 1.2 2004/02/22 16:14:25 zolty Exp $ +# $Id: crypter,v 1.3 2004/11/17 11:45:51 zolty Exp $ # #From Sean Batt se...@co... @@ -37,7 +37,7 @@ @saltset = ('a' .. 'z', 'A' .. 'Z', '0' .. '9', '.', '/'); umask(0077); -open ($ircdout, ">/tmp/ircd.conf.tmp") || die "open $!"; +open ($ircdout, ">$tmpfile") || die "open $!"; while ($text = <>) { #if its not an "O" line we can ignore it @@ -52,5 +52,6 @@ close ($ircdin); print "/bin/cp ",$tmpfile," ",$ircdconf,"\n"; (fork()==0) ? exec("/bin/cp", $tmpfile, $ircdconf) : wait; +print "",$ircdconf," has been crypted successfully!\n"; #unlink($tmpfile); ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2004-11-16 17:59:05
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-11-16 17:58:58 UTC Modified files: ChangeLog ChangeLog.es include/handlers.h include/msg.h include/patchlevel.h ircd/Makefile.in ircd/ddb.c ircd/parse.c Added files: include/ddb.h ircd/m_db.c ircd/m_dbq.c Log message: Author: zoltan <zo...@ir...> Log message: 2004-11-16 Toni García <zo...@ir...> 1.0.alpha11 * IRCD IRC-Dev Ha Vuelto!! * Vesion preliminar de Base de Datos Distribuidas ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.11 ircd-ircdev/ChangeLog:1.12 --- ircd-ircdev/ChangeLog:1.11 Fri May 21 08:39:32 2004 +++ ircd-ircdev/ChangeLog Tue Nov 16 09:58:47 2004 @@ -1,10 +1,14 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.11 2004/05/21 15:39:32 zolty Exp $ +# $Id: ChangeLog,v 1.12 2004/11/16 17:58:47 zolty Exp $ # # Insert new changes at beginning of the change list. # +2004-11-16 Toni García <zo...@ir...> 1.0.alpha11 + * IRCD IRC-Dev Reloaded!! + * Distribuited DataBase preliminary version + 2004-05-21 Toni García <zo...@ir...> 1.0.alpha10 * Disallow nick change on a moderated channel * Mapping service commands Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.11 ircd-ircdev/ChangeLog.es:1.12 --- ircd-ircdev/ChangeLog.es:1.11 Fri May 21 08:39:33 2004 +++ ircd-ircdev/ChangeLog.es Tue Nov 16 09:58:47 2004 @@ -1,10 +1,14 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.11 2004/05/21 15:39:33 zolty Exp $ +# $Id: ChangeLog.es,v 1.12 2004/11/16 17:58:47 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2004-11-16 Toni García <zo...@ir...> 1.0.alpha11 + * IRCD IRC-Dev Ha Vuelto!! + * Vesion preliminar de Base de Datos Distribuidas + 2004-05-21 Toni García <zo...@ir...> 1.0.alpha10 * Deshabilitar el cambio de nick en canales moderados * Mapeo de comandos de services Index: ircd-ircdev/include/ddb.h diff -u /dev/null ircd-ircdev/include/ddb.h:1.1 --- /dev/null Tue Nov 16 09:58:58 2004 +++ ircd-ircdev/include/ddb.h Tue Nov 16 09:58:47 2004 @@ -0,0 +1,104 @@ +/* + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, include/ddb.h + * + * Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 2004 Toni Garcia (zoltan) <zo...@ir...> + * + * 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: ddb.h,v 1.1 2004/11/16 17:58:47 zolty Exp $ + * + */ +#ifndef INCLUDED_ddb_h +#define INCLUDED_ddb_h + +#include "config.h" +#include "client.h" + +#if defined(DDB) + +/* + * General defines + */ + +#define DDB_TABLE_MAX 256 + +/* + * Distributed DataBase Tables + */ +#define DDB_INIT 'a' /* First table */ + +#define DDB_CHANDB 'c' /* ChanDB table */ +#define DDB_NICKDB 'n' /* NickDB table */ + +#define DDB_END 'z' /* Last table */ + + +/* + * Structures + */ +struct Ddb { + char *key; + char *content; + struct Ddb *next; +}; + +struct ddb_memory_table { + char *position; + unsigned int len; + char *point_r; + char *point_w; +}; + + +/* + * Prototypes + */ +extern struct Ddb **ddb_data_table[DDB_TABLE_MAX]; +extern int ddb_resident_table[DDB_TABLE_MAX]; +extern unsigned long int ddb_count_table[DDB_TABLE_MAX]; +extern unsigned long int ddb_id_table[DDB_TABLE_MAX]; +extern unsigned long int ddb_hashtable_hi[DDB_TABLE_MAX]; +extern unsigned long int ddb_hashtable_lo[DDB_TABLE_MAX]; + +extern int ddb_table_is_resident(unsigned char table); +extern unsigned long int ddb_id_in_table(unsigned char table); +extern unsigned long int ddb_count_in_table(unsigned char table); + +extern void ddb_init(void); +extern int ddb_open(unsigned int registry, char *buf, unsigned char table, + struct ddb_memory_table *dump); +extern int ddb_read(struct ddb_memory_table *dump, char *buf); +extern void ddb_add(char *registry, unsigned char table, int save_disk); +extern void ddb_del(char *registry, unsigned char table); +extern void ddb_drop(unsigned char table); +extern void ddb_close(struct ddb_memory_table *dump); +extern void ddb_hash_write(unsigned char table); +extern struct Ddb *ddb_find_reg(unsigned char table, char *key); +extern int ddb_is_member(unsigned char table, char *key, char *subcadena); +extern char *ddb_get_botname(char *bot); + +extern struct Ddb *ddb_iterator_init(unsigned char table); +extern struct Ddb *ddb_iterator_next(void); + +extern void ddb_reload(void); +extern void ddb_die(char *msg, unsigned char table); +extern void ddb_burst(struct Client *cptr); +extern void report_ddb(struct Client *cptr); + +#endif /* defined(DDB) */ + +#endif /* INCLUDED_ddb_h */ + Index: ircd-ircdev/include/handlers.h diff -u ircd-ircdev/include/handlers.h:1.6 ircd-ircdev/include/handlers.h:1.7 --- ircd-ircdev/include/handlers.h:1.6 Fri May 21 08:39:34 2004 +++ ircd-ircdev/include/handlers.h Tue Nov 16 09:58:47 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: handlers.h,v 1.6 2004/05/21 15:39:34 zolty Exp $ + * $Id: handlers.h,v 1.7 2004/11/16 17:58:47 zolty Exp $ * */ #ifndef INCLUDED_handlers_h @@ -151,6 +151,9 @@ extern int mo_clearmode(struct Client*, struct Client*, int, char*[]); extern int mo_close(struct Client*, struct Client*, int, char*[]); extern int mo_connect(struct Client*, struct Client*, int, char*[]); +#if defined(DDB) +extern int mo_dbq(struct Client*, struct Client*, int, char*[]); +#endif extern int mo_die(struct Client*, struct Client*, int, char*[]); extern int mo_get(struct Client*, struct Client*, int, char*[]); extern int mo_gline(struct Client*, struct Client*, int, char*[]); @@ -198,6 +201,10 @@ extern int ms_clearmode(struct Client*, struct Client*, int, char*[]); extern int ms_connect(struct Client*, struct Client*, int, char*[]); extern int ms_create(struct Client*, struct Client*, int, char*[]); +#if defined(DDB) +extern int ms_db(struct Client*, struct Client*, int, char*[]); +extern int ms_dbq(struct Client*, struct Client*, int, char*[]); +#endif extern int ms_destruct(struct Client*, struct Client*, int, char*[]); extern int ms_desynch(struct Client*, struct Client*, int, char*[]); extern int ms_end_of_burst(struct Client*, struct Client*, int, char*[]); Index: ircd-ircdev/include/msg.h diff -u ircd-ircdev/include/msg.h:1.5 ircd-ircdev/include/msg.h:1.6 --- ircd-ircdev/include/msg.h:1.5 Fri May 21 08:39:34 2004 +++ ircd-ircdev/include/msg.h Tue Nov 16 09:58:47 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: msg.h,v 1.5 2004/05/21 15:39:34 zolty Exp $ + * $Id: msg.h,v 1.6 2004/11/16 17:58:47 zolty Exp $ * */ #ifndef INCLUDED_msg_h @@ -363,6 +363,16 @@ #define MSG_WATCH "WATCH" /* WATC */ #define TOK_WATCH "WATCH" + +#if defined(DDB) +#define MSG_DB "DB" /* DB */ +#define TOK_DB "DB" + +#define MSG_DBQ "DBQ" /* DBQ */ +#define TOK_DBQ "DBQ" +#endif /* defined(DDB) */ + + /* * Constants */ Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.11 ircd-ircdev/include/patchlevel.h:1.12 --- ircd-ircdev/include/patchlevel.h:1.11 Fri May 21 08:39:34 2004 +++ ircd-ircdev/include/patchlevel.h Tue Nov 16 09:58:47 2004 @@ -17,10 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: patchlevel.h,v 1.11 2004/05/21 15:39:34 zolty Exp $ + * $Id: patchlevel.h,v 1.12 2004/11/16 17:58:47 zolty Exp $ * */ -#define PATCHLEVEL ".alpha10" +#define PATCHLEVEL ".alpha11" #define RELEASE "1.0" Index: ircd-ircdev/ircd/Makefile.in diff -u ircd-ircdev/ircd/Makefile.in:1.10 ircd-ircdev/ircd/Makefile.in:1.11 --- ircd-ircdev/ircd/Makefile.in:1.10 Fri May 21 08:39:34 2004 +++ ircd-ircdev/ircd/Makefile.in Tue Nov 16 09:58:47 2004 @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA -# $Id: Makefile.in,v 1.10 2004/05/21 15:39:34 zolty Exp $ +# $Id: Makefile.in,v 1.11 2004/11/16 17:58:47 zolty Exp $ #### Start of system configuration section. #### @@ -95,6 +95,7 @@ client.c \ crule.c \ dbuf.c \ + ddb.c \ destruct_event.c \ fda.c \ fileio.c \ @@ -126,6 +127,8 @@ m_connect.c \ m_cprivmsg.c \ m_create.c \ + m_db.c \ + m_dbq.c \ m_defaults.c \ m_destruct.c \ m_desynch.c \ @@ -370,960 +373,971 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. -IPcheck.o: IPcheck.c ../config.h ../include/IPcheck.h \ - ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ - ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/ircd.h ../include/struct.h ../include/msg.h \ - ../include/numnicks.h ../include/ircd_alloc.h ../include/s_debug.h \ - ../include/s_user.h ../include/send.h +IPcheck.o: IPcheck.c ../config.h ../include/IPcheck.h ../include/client.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ + ../include/struct.h ../include/msg.h ../include/numnicks.h \ + ../include/ircd_alloc.h ../include/ircd_features.h ../include/s_debug.h \ + ../include/s_user.h ../include/send.h channel.o: channel.c ../config.h ../include/channel.h \ - ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ - ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_alloc.h ../include/ircd_chattr.h \ - ../include/ircd_features.h ../include/ircd_log.h \ - ../include/ircd_reply.h ../include/ircd_snprintf.h \ - ../include/ircd_string.h ../include/list.h ../include/match.h \ - ../include/msg.h ../include/numeric.h ../include/numnicks.h \ - ../include/querycmds.h ../include/s_bsd.h ../include/s_conf.h \ - ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \ - ../include/send.h ../include/support.h ../include/sys.h \ - ../include/whowas.h + ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ + ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/destruct_event.h ../include/hash.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_alloc.h ../include/ircd_chattr.h \ + ../include/ircd_features.h ../include/ircd_log.h \ + ../include/ircd_reply.h ../include/ircd_snprintf.h \ + ../include/ircd_string.h ../include/list.h ../include/match.h \ + ../include/msg.h ../include/numeric.h ../include/numnicks.h \ + ../include/querycmds.h ../include/s_bsd.h ../include/s_conf.h \ + ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \ + ../include/send.h ../include/support.h ../include/sys.h \ + ../include/whowas.h class.o: class.c ../config.h ../include/class.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_alloc.h \ - ../include/ircd_features.h ../include/ircd_reply.h ../include/list.h \ - ../include/numeric.h ../include/s_conf.h ../include/s_debug.h \ - ../include/send.h -client.o: client.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/class.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_features.h \ - ../include/ircd_reply.h ../include/list.h ../include/numeric.h \ - ../include/s_conf.h ../include/s_debug.h ../include/send.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_alloc.h ../include/ircd_features.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/list.h ../include/numeric.h \ + ../include/s_conf.h ../include/s_debug.h ../include/send.h +client.o: client.c ../config.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ + ../include/ircd_handler.h ../include/class.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_features.h ../include/ircd_reply.h \ + ../include/list.h ../include/numeric.h ../include/s_conf.h \ + ../include/s_debug.h ../include/send.h crule.o: crule.c ../config.h ../include/crule.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_alloc.h ../include/ircd_chattr.h \ - ../include/ircd_string.h ../include/match.h ../include/s_bsd.h \ - ../include/s_debug.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_alloc.h ../include/ircd_chattr.h \ + ../include/ircd_string.h ../include/match.h ../include/s_bsd.h \ + ../include/s_debug.h dbuf.o: dbuf.c ../config.h ../include/dbuf.h ../include/ircd_alloc.h \ - ../include/ircd_chattr.h ../include/ircd_features.h ../include/send.h \ - ../include/sys.h + ../include/ircd_chattr.h ../include/ircd_features.h ../include/send.h \ + ../include/sys.h +ddb.o: ddb.c ../config.h ../include/ddb.h +destruct_event.o: destruct_event.c ../config.h ../include/channel.h \ + ../include/ircd_defs.h ../include/s_debug.h ../include/ircd_alloc.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_events.h \ + ../include/send.h ../include/msg.h ../include/ircd_handler.h fda.o: fda.c ../config.h fileio.o: fileio.c ../config.h ../include/fileio.h \ - ../include/ircd_alloc.h + ../include/ircd_alloc.h gline.o: gline.c ../config.h ../include/gline.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_alloc.h \ - ../include/ircd_features.h ../include/ircd_log.h \ - ../include/ircd_reply.h ../include/ircd_snprintf.h \ - ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \ - ../include/numeric.h ../include/s_bsd.h ../include/s_debug.h \ - ../include/s_misc.h ../include/s_stats.h ../include/send.h \ - ../include/support.h ../include/msg.h ../include/numnicks.h \ - ../include/sys.h ../include/whocmds.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_alloc.h ../include/ircd_features.h \ + ../include/ircd_log.h ../include/ircd_reply.h \ + ../include/ircd_snprintf.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/match.h ../include/numeric.h \ + ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \ + ../include/s_stats.h ../include/send.h ../include/support.h \ + ../include/msg.h ../include/numnicks.h ../include/sys.h \ + ../include/whocmds.h hash.o: hash.c ../config.h ../include/hash.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/channel.h ../include/ircd_chattr.h \ - ../include/ircd_string.h ../include/ircd.h ../include/struct.h \ - ../include/msg.h ../include/send.h ../include/support.h \ - ../include/sys.h ../include/watch.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/channel.h \ + ../include/ircd_chattr.h ../include/ircd_string.h ../include/ircd.h \ + ../include/struct.h ../include/msg.h ../include/send.h \ + ../include/support.h ../include/sys.h ../include/watch.h ircd.o: ircd.c ../config.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_defs.h ../include/IPcheck.h ../include/class.h \ - ../include/client.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/crule.h \ - ../include/hash.h ../include/ircd_alloc.h ../include/ircd_features.h \ - ../include/ircd_log.h ../include/ircd_reply.h \ - ../include/ircd_signal.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/jupe.h ../include/list.h \ - ../include/match.h ../include/motd.h ../include/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/opercmds.h \ - ../include/parse.h ../include/res.h ../include/s_auth.h \ - ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \ - ../include/s_misc.h ../include/s_stats.h ../include/send.h \ - ../include/sys.h ../include/uping.h ../include/userload.h \ - ../include/version.h ../include/whowas.h + ../include/ircd_defs.h ../include/IPcheck.h ../include/class.h \ + ../include/client.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/crule.h \ + ../include/destruct_event.h ../include/channel.h ../include/hash.h \ + ../include/ircd_alloc.h ../include/ircd_features.h \ + ../include/ircd_log.h ../include/ircd_reply.h ../include/ircd_signal.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/jupe.h \ + ../include/list.h ../include/match.h ../include/motd.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/opercmds.h \ + ../include/parse.h ../include/res.h ../include/s_auth.h \ + ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \ + ../include/s_misc.h ../include/s_stats.h ../include/send.h \ + ../include/sys.h ../include/uping.h ../include/userload.h \ + ../include/version.h ../include/whowas.h ircd_alloc.o: ircd_alloc.c ../config.h ../include/ircd_alloc.h \ - ../include/ircd_string.h ../include/ircd_chattr.h \ - ../include/s_debug.h ../include/ircd_defs.h + ../include/ircd_string.h ../include/ircd_chattr.h ../include/s_debug.h \ + ../include/ircd_defs.h ircd_events.o: ircd_events.c ../config.h ../include/ircd_events.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_defs.h \ - ../include/ircd_alloc.h ../include/ircd_log.h \ - ../include/ircd_snprintf.h ../include/s_debug.h -ircd_features.o: ircd_features.c ../config.h \ - ../include/ircd_features.h ../include/channel.h \ - ../include/ircd_defs.h ../include/class.h ../include/client.h \ - ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ - ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_alloc.h ../include/ircd_log.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/match.h ../include/motd.h \ - ../include/msg.h ../include/numeric.h ../include/numnicks.h \ - ../include/random.h ../include/s_bsd.h ../include/s_debug.h \ - ../include/s_misc.h ../include/s_stats.h ../include/send.h \ - ../include/support.h ../include/sys.h ../include/whowas.h + ../include/ircd.h ../include/struct.h ../include/ircd_defs.h \ + ../include/ircd_alloc.h ../include/ircd_log.h \ + ../include/ircd_snprintf.h ../include/s_debug.h +ircd_features.o: ircd_features.c ../config.h ../include/ircd_features.h \ + ../include/channel.h ../include/ircd_defs.h ../include/class.h \ + ../include/client.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ + ../include/ircd_log.h ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/match.h ../include/motd.h \ + ../include/msg.h ../include/numeric.h ../include/numnicks.h \ + ../include/random.h ../include/s_bsd.h ../include/s_debug.h \ + ../include/s_misc.h ../include/s_stats.h ../include/send.h \ + ../include/support.h ../include/sys.h ../include/whowas.h ircd_log.o: ircd_log.c ../config.h ../include/ircd_log.h \ - ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ - ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/ircd_alloc.h ../include/ircd_reply.h \ - ../include/ircd_snprintf.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/ircd.h ../include/struct.h \ - ../include/numeric.h ../include/s_debug.h ../include/send.h + ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ + ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/ircd_alloc.h ../include/ircd_reply.h \ + ../include/ircd_snprintf.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/ircd.h ../include/struct.h \ + ../include/numeric.h ../include/s_debug.h ../include/send.h ircd_relay.o: ircd_relay.c ../config.h ../include/ircd_relay.h \ - ../include/channel.h ../include/ircd_defs.h ../include/client.h \ - ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ - ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_chattr.h \ - ../include/ircd_features.h ../include/ircd_reply.h \ - ../include/ircd_string.h ../include/match.h ../include/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/s_debug.h \ - ../include/s_misc.h ../include/s_user.h ../include/send.h + ../include/channel.h ../include/ircd_defs.h ../include/client.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ + ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_chattr.h ../include/ircd_features.h \ + ../include/ircd_reply.h ../include/ircd_string.h ../include/match.h \ + ../include/msg.h ../include/numeric.h ../include/numnicks.h \ + ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \ + ../include/send.h ircd_reply.o: ircd_reply.c ../config.h ../include/ircd_reply.h \ - ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ - ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_snprintf.h \ - ../include/msg.h ../include/numeric.h ../include/s_conf.h \ - ../include/s_debug.h ../include/send.h + ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ + ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_snprintf.h \ + ../include/msg.h ../include/numeric.h ../include/s_conf.h \ + ../include/s_debug.h ../include/send.h ircd_signal.o: ircd_signal.c ../config.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_defs.h ../include/ircd_events.h \ - ../include/ircd_signal.h ../include/s_conf.h + ../include/struct.h ../include/ircd_defs.h ../include/ircd_events.h \ + ../include/ircd_signal.h ../include/s_conf.h ../include/client.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h ircd_snprintf.o: ircd_snprintf.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/channel.h ../include/ircd_snprintf.h ../include/struct.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/channel.h \ + ../include/ircd_snprintf.h ../include/struct.h ircd_string.o: ircd_string.c ../config.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/ircd_defs.h ../include/ircd_log.h \ - chattr.tab.c + ../include/ircd_chattr.h ../include/ircd_defs.h ../include/ircd_log.h \ + chattr.tab.c +ircd_tea.o: ircd_tea.c ../config.h ircd_xopen.o: ircd_xopen.c ../config.h ../include/ircd_xopen.h jupe.o: jupe.c ../config.h ../include/jupe.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ - ../include/ircd_features.h ../include/ircd_log.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/match.h ../include/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/s_bsd.h \ - ../include/s_misc.h ../include/send.h ../include/support.h \ - ../include/sys.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ + ../include/ircd_features.h ../include/ircd_log.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/match.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/s_bsd.h \ + ../include/s_misc.h ../include/send.h ../include/support.h \ + ../include/sys.h +lex.yy.o: lex.yy.c ../include/ircd.h ../include/struct.h \ + ../include/ircd_defs.h y.tab.h list.o: list.c ../config.h ../include/list.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_alloc.h ../include/ircd_reply.h \ - ../include/ircd_string.h ../include/ircd_chattr.h \ - ../include/listener.h ../include/match.h ../include/numeric.h \ - ../include/res.h ../include/s_auth.h ../include/s_bsd.h \ - ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \ - ../include/s_user.h ../include/send.h ../include/support.h \ - ../include/whowas.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_alloc.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/listener.h \ + ../include/match.h ../include/numeric.h ../include/res.h \ + ../include/s_auth.h ../include/s_bsd.h ../include/s_conf.h \ + ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \ + ../include/send.h ../include/support.h ../include/whowas.h listener.o: listener.c ../config.h ../include/listener.h \ - ../include/ircd_defs.h ../include/ircd_events.h ../include/client.h \ - ../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ - ../include/ircd_features.h ../include/ircd_osdep.h \ - ../include/ircd_reply.h ../include/ircd_snprintf.h \ - ../include/ircd_string.h ../include/ircd_chattr.h \ - ../include/numeric.h ../include/s_bsd.h ../include/s_conf.h \ - ../include/s_misc.h ../include/s_stats.h ../include/send.h \ - ../include/sys.h -m_account.o: m_account.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/msg.h ../include/numnicks.h \ - ../include/s_user.h ../include/send.h + ../include/ircd_defs.h ../include/ircd_events.h ../include/client.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_handler.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ + ../include/ircd_features.h ../include/ircd_osdep.h \ + ../include/ircd_reply.h ../include/ircd_snprintf.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/numeric.h \ + ../include/s_bsd.h ../include/s_conf.h ../include/s_misc.h \ + ../include/s_stats.h ../include/send.h ../include/sys.h +m_account.o: m_account.c ../config.h m_admin.o: m_admin.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_features.h \ - ../include/ircd_reply.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/s_conf.h ../include/s_user.h -m_asll.o: m_asll.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \ - ../include/ircd_string.h ../include/ircd_chattr.h \ - ../include/numeric.h ../include/numnicks.h ../include/match.h \ - ../include/msg.h ../include/send.h ../include/s_bsd.h \ - ../include/s_user.h -m_away.o: m_away.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_alloc.h ../include/ircd_reply.h \ - ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/s_user.h \ - ../include/send.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_features.h \ + ../include/ircd_reply.h ../include/msg.h ../include/numeric.h \ + ../include/numnicks.h ../include/s_conf.h ../include/s_user.h +m_asll.o: m_asll.c ../config.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ + ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/numeric.h ../include/numnicks.h \ + ../include/match.h ../include/msg.h ../include/send.h \ + ../include/s_bsd.h ../include/s_user.h +m_away.o: m_away.c ../config.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ + ../include/ircd_handler.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_alloc.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/s_user.h \ + ../include/send.h m_burst.o: m_burst.c ../config.h ../include/channel.h \ - ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ - ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_alloc.h ../include/ircd_features.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/list.h ../include/match.h \ - ../include/msg.h ../include/numeric.h ../include/numnicks.h \ - ../include/s_conf.h ../include/s_misc.h ../include/send.h \ - ../include/support.h + ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ + ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/hash.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_alloc.h ../include/ircd_features.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/ircd_snprintf.h ../include/list.h \ + ../include/match.h ../include/msg.h ../include/numeric.h \ + ../include/numnicks.h ../include/s_conf.h ../include/s_misc.h \ + ../include/send.h ../include/support.h m_clearmode.o: m_clearmode.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/channel.h ../include/hash.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_alloc.h \ - ../include/ircd_features.h ../include/ircd_log.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/list.h ../include/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \ - ../include/send.h ../include/support.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/channel.h \ + ../include/hash.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_alloc.h ../include/ircd_features.h \ + ../include/ircd_log.h ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/list.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \ + ../include/send.h ../include/support.h m_close.o: m_close.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_reply.h ../include/numeric.h \ - ../include/s_bsd.h ../include/send.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_reply.h ../include/numeric.h \ + ../include/s_bsd.h ../include/send.h m_connect.o: m_connect.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/crule.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_features.h ../include/ircd_log.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/jupe.h ../include/match.h \ - ../include/msg.h ../include/numeric.h ../include/numnicks.h \ - ../include/s_bsd.h ../include/s_conf.h ../include/s_user.h \ - ../include/send.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/crule.h \ + ../include/hash.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_features.h ../include/ircd_log.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/jupe.h ../include/match.h \ + ../include/msg.h ../include/numeric.h ../include/numnicks.h \ + ../include/s_bsd.h ../include/s_conf.h ../include/s_user.h \ + ../include/send.h m_cprivmsg.o: m_cprivmsg.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/s_user.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/s_user.h m_create.o: m_create.c ../config.h ../include/channel.h \ - ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ - ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/s_debug.h ../include/s_misc.h \ - ../include/s_user.h ../include/send.h + ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ + ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/hash.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ + ../include/numnicks.h ../include/s_debug.h ../include/s_misc.h \ + ../include/s_user.h ../include/send.h +m_db.o: m_db.c ../config.h ../include/ddb.h ../include/client.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/msg.h +m_dbq.o: m_dbq.c ../config.h ../include/ddb.h ../include/client.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/msg.h m_defaults.o: m_defaults.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_reply.h ../include/numeric.h \ - ../include/numnicks.h ../include/send.h ../include/supported.h \ - ../include/channel.h ../include/version.h -m_destruct.o: m_destruct.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \ - ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/send.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_reply.h ../include/numeric.h \ + ../include/numnicks.h ../include/send.h ../include/supported.h \ + ../include/channel.h ../include/version.h +m_destruct.o: m_destruct.c ../config.h ../include/channel.h \ + ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ + ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/destruct_event.h ../include/hash.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ + ../include/numnicks.h ../include/send.h m_desynch.o: m_desynch.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \ - ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/s_bsd.h \ - ../include/send.h -m_die.o: m_die.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/s_bsd.h ../include/send.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/s_bsd.h \ + ../include/send.h +m_die.o: m_die.c ../config.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ + ../include/ircd_handler.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ + ../include/numnicks.h ../include/s_bsd.h ../include/send.h m_endburst.o: m_endburst.c ../config.h ../include/channel.h \ - ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ - ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/send.h + ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ + ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/hash.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ + ../include/numnicks.h ../include/send.h m_error.o: m_error.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/numeric.h ../include/numnicks.h \ - ../include/s_debug.h ../include/s_misc.h ../include/send.h -m_get.o: m_get.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_features.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/numeric.h ../include/numnicks.h \ - ../include/send.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/numeric.h ../include/numnicks.h \ + ../include/s_debug.h ../include/s_misc.h ../include/send.h +m_get.o: m_get.c ../config.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ + ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_features.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/numeric.h \ + ../include/numnicks.h ../include/send.h m_gline.o: m_gline.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/gline.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_features.h ../include/ircd_reply.h \ - ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \ - ../include/msg.h ../include/numeric.h ../include/numnicks.h \ - ../include/s_conf.h ../include/s_misc.h ../include/send.h \ - ../include/support.h -m_help.o: m_help.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \ - ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/send.h -m_info.o: m_info.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/s_misc.h ../include/s_user.h \ - ../include/s_conf.h ../include/send.h ../include/version.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/gline.h \ + ../include/hash.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_features.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \ + ../include/msg.h ../include/numeric.h ../include/numnicks.h \ + ../include/s_conf.h ../include/s_misc.h ../include/send.h \ + ../include/support.h +m_help.o: m_help.c ../config.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ + ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ + ../include/numnicks.h ../include/send.h +m_info.o: m_info.c ../config.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ + ../include/ircd_handler.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ + ../include/numnicks.h ../include/s_misc.h ../include/s_user.h \ + ../include/s_conf.h ../include/send.h ../include/version.h m_invite.o: m_invite.c ../config.h ../include/channel.h \ - ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ - ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/list.h ../include/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/s_user.h \ - ../include/send.h -m_ison.o: m_ison.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_reply.h \ - ../include/ircd_string.h ../include/ircd_chattr.h \ - ../include/numeric.h ../include/send.h + ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ + ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/hash.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_features.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/list.h \ + ../include/msg.h ../include/numeric.h ../include/numnicks.h \ + ../include/s_user.h ../include/send.h +m_ison.o: m_ison.c ../config.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ + ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/numeric.h ../include/send.h m_join.o: m_join.c ../config.h ../include/channel.h \ - ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ - ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/gline.h ../include/hash.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_chattr.h \ - ../include/ircd_features.h ../include/ircd_reply.h \ - ../include/ircd_string.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/s_debug.h ../include/s_user.h \ - ../include/send.h -m_jupe.o: m_jupe.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/jupe.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_features.h ../include/ircd_reply.h \ - ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \ - ../include/msg.h ../include/numeric.h ../include/numnicks.h \ - ../include/s_conf.h ../include/s_misc.h ../include/send.h \ - ../include/support.h + ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ + ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/gline.h ../include/hash.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_chattr.h ../include/ircd_features.h \ + ../include/ircd_reply.h ../include/ircd_string.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/s_debug.h \ + ../include/s_user.h ../include/send.h +m_jupe.o: m_jupe.c ../config.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ + ../include/ircd_handler.h ../include/jupe.h ../include/hash.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_features.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/match.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \ + ../include/s_misc.h ../include/send.h ../include/support.h m_kick.o: m_kick.c ../config.h ../include/channel.h \ - ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ - ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/send.h -m_kill.o: m_kill.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_features.h \ - ../include/ircd_log.h ../include/ircd_reply.h \ - ../include/ircd_snprintf.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/s_misc.h ../include/send.h \ - ../include/whowas.h + ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ + ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/hash.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_features.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/send.h +m_kill.o: m_kill.c ../config.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ + ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_features.h ../include/ircd_log.h \ + ../include/ircd_reply.h ../include/ircd_snprintf.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/s_misc.h \ + ../include/send.h ../include/whowas.h m_links.o: m_links.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_features.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/match.h ../include/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/s_user.h \ - ../include/send.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_features.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \ + ../include/msg.h ../include/numeric.h ../include/numnicks.h \ + ../include/s_user.h ../include/send.h m_list.o: m_list.c ../config.h ../include/channel.h \ - ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ - ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_alloc.h ../include/ircd_chattr.h \ - ../include/ircd_features.h ../include/ircd_log.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../include/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/s_bsd.h \ - ../include/send.h + ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ + ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/hash.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_alloc.h ../include/ircd_chattr.h \ + ../include/ircd_features.h ../include/ircd_log.h \ + ../include/ircd_reply.h ../include/ircd_string.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/s_bsd.h \ + ../include/send.h m_lusers.o: m_lusers.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_features.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/querycmds.h ../include/s_user.h \ - ../include/s_serv.h ../include/send.h -m_map.o: m_map.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_features.h \ - ../include/ircd_reply.h ../include/ircd_snprintf.h \ - ../include/ircd_string.h ../include/ircd_chattr.h ../include/list.h \ - ../include/match.h ../include/msg.h ../include/numeric.h \ - ../include/s_user.h ../include/s_serv.h ../include/send.h \ - ../include/querycmds.h -m_mode.o: m_mode.c ../config.h ../include/handlers.h \ - ../include/channel.h ../include/ircd_defs.h ../include/client.h \ - ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ - ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/s_conf.h ../include/s_debug.h \ - ../include/s_user.h ../include/send.h -m_motd.o: m_motd.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_features.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/match.h ../include/motd.h \ - ../include/msg.h ../include/numeric.h ../include/numnicks.h \ - ../include/s_conf.h ../include/class.h ../include/s_user.h \ - ../include/send.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/handlers.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_features.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/querycmds.h \ + ../include/s_misc.h ../include/s_serv.h ../include/s_user.h \ + ../include/send.h +m_map.o: m_map.c ../config.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ + ../include/ircd_handler.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_features.h ../include/ircd_reply.h \ + ../include/ircd_snprintf.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/list.h ../include/match.h \ + ../include/msg.h ../include/numeric.h ../include/s_user.h \ + ../include/s_serv.h ../include/send.h ../include/querycmds.h +m_mode.o: m_mode.c ../config.h ../include/handlers.h ../include/channel.h \ + ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ + ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/hash.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ + ../include/numnicks.h ../include/s_conf.h ../include/s_debug.h \ + ../include/s_user.h ../include/send.h +m_motd.o: m_motd.c ../config.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ + ../include/ircd_handler.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_features.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \ + ../include/motd.h ../include/msg.h ../include/numeric.h \ + ../include/numnicks.h ../include/s_conf.h ../include/class.h \ + ../include/s_user.h ../include/send.h m_names.o: m_names.c ../config.h ../include/channel.h \ - ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ - ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/s_user.h ../include/send.h -m_nick.o: m_nick.c ../config.h ../include/IPcheck.h \ - ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ - ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/hash.h ../include/ircd.h ../include/struct.h \ - ../include/ircd_chattr.h ../include/ircd_features.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../include/msg.h \ - ../include/numeric.h ../include/numnicks.h ../include/s_debug.h \ - ../include/s_misc.h ../include/s_user.h ../include/send.h + ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ + ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/hash.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ + ../include/numnicks.h ../include/s_user.h ../include/send.h +m_nick.o: m_nick.c ../config.h ../include/IPcheck.h ../include/client.h \ + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ + ../include/ircd.h ../include/struct.h ../include/ircd_chattr.h \ + ../include/ircd_features.h ../include/ircd_reply.h \ + ../include/ircd_string.h ../include/msg.h ../include/numeric.h \ + ../include/numnicks.h ../include/s_debug.h ../include/s_misc.h \ + ../include/s_user.h ../include/send.h ../include/sys.h m_notice.o: m_notice.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/ircd_chattr.h ../include/ircd_relay.h \ - ../include/ircd_reply.h ../include/ircd_string.h ../include/match.h \ - ../include/msg.h ../include/numeric.h ../include/send.h \ - ../include/handlers.h -m_oper.o: m_oper.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h ../include/hash.h \ - ../include/ircd.h ../include/struct.h ../include/ircd_features.h \ - ../include/ircd_log.h ../include/ircd_reply.h \ - ../include/ircd_string.h ../include/ircd_chattr.h \ - ../include/ircd_xopen.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/querycmds.h ../include/s_conf.h \ - ../include/s_debug.h ../include/s_user.h ../include/s_misc.h \ - ../include/send.h ../include/support.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h \ + ../include/ircd_chattr.h ../include/ircd_relay.h \ + ../include/ircd_reply.h ../include/ircd_string.h ../include/match.h \ + ../include/msg.h ../include/numeric.h ../include/send.h \ + ../include/handlers.h +m_oper.o: m_oper.c ../config.h ../include/client.h ../include/ircd_defs.h \ + ../include/dbuf.h ../include/msgq.h ../include/ircd_events.h \ + ../include/ircd_handler.h ../include/hash.h ../include/ircd.h \ + ../include/struct.h ../include/ircd_features.h ../include/ircd_log.h \ + ../include/ircd_reply.h ../include/ircd_string.h \ + ../include/ircd_chattr.h ../include/ircd_xopen.h ../include/msg.h \ + ../include/numeric.h ../include/numnicks.h ../include/querycmds.h \ + ../include/s_conf.h ../include/s_debug.h ../include/s_user.h \ + ../include/s_misc.h ../include/send.h ../include/support.h m_opmode.o: m_opmode.c ../config.h ../include/client.h \ - ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ - ../include/ircd_events.h ../include/ircd_handler.h \ - ../include/channel.h ../include/hash.h ../include/ircd.h \ - ../include/struct.h ../include/ircd_features.h \ - ../include/ircd_reply.h ../include/ircd_string.h \ - ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \ - ../include/numnicks.h ../include/send.h ../include/s_conf.h + ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ + ../include/ircd_events.h ../include/ircd_handler.h ../include/channel.h \ + ../include/hash.h ../include/ircd.h ../include/struct.h \ + ../include/ircd_features.h ../include/ircd_reply.h \ + .... [truncated message content] |
From: Toni G. <zo...@us...> - 2004-05-28 10:16:16
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-05-28 10:16:06 UTC Modified files: doc/ircd.sample-en.conf doc/ircd.sample-es.conf Log message: fixes de errores sintaticos en los ircd.conf ---------------------- diff included ---------------------- Index: ircd-ircdev/doc/ircd.sample-en.conf diff -u ircd-ircdev/doc/ircd.sample-en.conf:1.6 ircd-ircdev/doc/ircd.sample-en.conf:1.7 --- ircd-ircdev/doc/ircd.sample-en.conf:1.6 Fri May 28 03:01:20 2004 +++ ircd-ircdev/doc/ircd.sample-en.conf Fri May 28 03:15:55 2004 @@ -231,19 +231,17 @@ # Technical description (for examples, see below): # For every connecting client, the IP address is known. A reverse lookup # on this IP-number is done to get the (/all) hostname(s). -# Each hostname that belongs to this IP-number is matched to <hostmask>, -# and the "Client" block is used when any matches; the client will then -show -FIX FIX +# Each hostname that belongs to this IP-number is matched to "host" field, +# and the "Client" block is used when any matches; the client will then show # with this particular hostname. If none of the hostnames match, then -# the IP-number is matched against the <IP mask ...> field, if this matches -# then the Client{} is used nevertheless and the client will show with the +# the IP-number is matched against the "ip" field, if this matches then the +# "Client" block is used nevertheless and the client will show with the # first (main) hostname if any; if the IP-number did not resolve then the # client will show with the dot notation of the IP-number. # There is a special case for the UNIX domain sockets and localhost connections -# though; in this case the <IP mask ...> field is compared with the -# name of the server (thus not with any IP-number representation). The name -# of the server is the one returned in the numeric 002 reply, for example: +# though; in this case the "ip" field is compared with the name of the server +# (thus not with any IP-number representation). The name of the server is the +# one returned in the numeric 002 reply, for example: # 002 Your host is 2.irc-dev.net[jolan.ppro], running version ... # Then the "jolan.ppro" is the name used for matching. # Therefore, unix domain sockets, and connections to localhost would Index: ircd-ircdev/doc/ircd.sample-es.conf diff -u ircd-ircdev/doc/ircd.sample-es.conf:1.1 ircd-ircdev/doc/ircd.sample-es.conf:1.2 --- ircd-ircdev/doc/ircd.sample-es.conf:1.1 Fri May 28 03:03:11 2004 +++ ircd-ircdev/doc/ircd.sample-es.conf Fri May 28 03:15:56 2004 @@ -214,7 +214,7 @@ # badchan (puede poner Gchans a otros servidores) # force_opmode (puede utilizar OPMODE/CLEARMODE en canales quarantined globales) # - # PAra los opers globales (con "propagate = yes" o "local = no"), por + # Para los opers globales (con "propagate = yes" o "local = no"), por # defecto es conceder todos los privilegios antes mencionados. Para los # opers locales, por defecto es conceder SOLO los siguientes privilegios: # chan_limit, mode_lchan, show_invis, show_all_invis, local_kill, @@ -245,16 +245,16 @@ # Para cada cliente que conecta, su dirección IP es conocida. Se hace una # consulta de dns inverso a la IP númerica para obtener el/los(todos) # hostnames. -# Cada hostname que pertenece a esa IP numérica se compara con <hostmask>, -# y el bloque "Client" se usa cuando cualquiera de ellos encaja; el cliente -# entonces se mostrará con ese hostname en concreto. Si ninguno de los -# hostnames encanjan, entonces la IP numérica se compara contra el campo -# <IP mask>, y si esta concuerda entonces el bloque "Client" se usa a pesar +# Cada hostname que pertenece a esa IP numérica se compara con el campo +# "host", y el bloque "Client" se usa cuando cualquiera de ellos encaja; +# el cliente entonces se mostrará con ese hostname en concreto. Si ninguno +# de los hostnames encajan, entonces la IP numérica se compara contra el +# campo "ip", y si esta concuerda entonces el bloque "Client" se usa a pesar # de todo y el cliente mostrará el primer (principal) hostname si existe; # si la IP numérica no resuelve, el cliente mostrará la notación decimal de # la IP númerica. # Hay un caso especial para los sockets de los dominios UNIX y las -# conexiones del host local (localhost); en este caso el campo <IP mask> +# conexiones del host local (localhost); en este caso el campo "ip" # se compara con el nombre del servidor (de tal suerte que no se hace # con ninguna representación de una IP numérica). El nombre del servidor # es el devuelto en la respuesta del numérico 002, por ejemplo: ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2004-05-28 10:03:29
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-05-28 10:03:21 UTC Added files: doc/ircd.sample-es.conf Log message: ircd.conf de ejemplo en castellano ;) ---------------------- diff included ---------------------- Index: ircd-ircdev/doc/ircd.sample-es.conf diff -u /dev/null ircd-ircdev/doc/ircd.sample-es.conf:1.1 --- /dev/null Fri May 28 03:03:22 2004 +++ ircd-ircdev/doc/ircd.sample-es.conf Fri May 28 03:03:11 2004 @@ -0,0 +1,886 @@ +# ircd.conf - archivo de configuración para el IRCD de IRC-Dev. +# +# Ultima actualización: 28, May 2004. +# +# Escrito por Niels <ni...@un...>, basado en el archivo example.conf +# original, en el código del servidor y la experiencia de la vida real. +# +# Actualizado y modificado profundamente por by Braden <db...@ya...>. +# +# Reescrito por A1kmm(Andrew Miller)<a1...@mw...> para +# soportar el nuevo analizador de configuración flex/bison. +# +# Agradecimientos y creditos para: Run, Trillian, Cym, Morrissey, Chaos, +# Flynn, Xorath, WildThang, Mmmm, SeKs, +# Ghostwolf y todo el resto de +# Administradores y Operadores de +# Undernet, y los programadores del ircd +# de Undernet. +# +# Actualizado por Zoltan (Toni Garcia) <zo...@ir...> +# Traducido por Zoltan (Toni Garcia) <zo...@ir...> +# +# Este es un ejemplo del archivo de configuración usado por el IRCD de IRC-Dev. +# +# Este documento está basado en un (fiticio) servidor en Europa con una +# conexión a la red de IRC de IRC-Dev. Este es un servidor "leaf", pero +# si todos los otros "hubs" en Europa no están en servicio, puede conectar +# a uno en los E.E.U.U. por sí mismo. +# +# El formato de la configuración consiste en un número de bloques en este +# formato +# NombreBloque { ajuste = número; ajuste2 = "texto"; ajuste3 = yes; }; +# Notése que los comentarios empiezan con un #(almohadilla) va al extremo +# de la línea. Espacios en blanco (espacio, tabulación, retornos de carro) +# son ignorados y se puede utlizar para hacer más legible el archivo de +# la configuración. +# +# Por favor observe que cuando el ircd pone las líneas en práctica, las +# analiza exactamente al sentido contrario que las lees. Utiliza los +# bloques en el orden reverso. +# +# Esto significa que debes comenzar tus bloques "Client" con "fall through", +# "most vanilla one", y al final con el más detallado. +# +# Hay una diferencia entre el "hostname" y el "nombre del servidor" de la +# máquina que el servidor está corriendo. Por ejemplo, el host puede tener +# "83.Red-80-59-255.pooles.rima-tde.net" como FQDN y "gmsis.irc-dev.net" +# como nombre del servidor. +# Una "máscara de servidor" es algo como "*.EU.irc-dev.net", que es +# emparejado por "Vigo.ES.EU.irc-dev.net" pero no por +# "Miami.FL.US.irc-dev.net". +# +# Por favor NO renombrar el ircd.sample-es.conf a ircd.conf y no espere +# que esto funcione. + + +# [General] +# +# Primero una información sobre el servidor. +# General { +# name = "nombreservidor"; +# vhost = "virtualhost"; +# description = "descripcion"; +# numeric = númerodenúmerico; +# }; +# +# El campo "vhost" debe contener un * o una dirección IPv4 válida en la +# notación de 4 números (127.0.0.1). La dirección DEBE ser la dirección +# de una interfaz física en el host. Esta dirección se utiliza solamente +# para las conexiones salientes, veáse el bloque "Port" para la escucha +# con virtual hosting. +# En caso de duda, pon un * o la IP de tu interface primaria aquí. +# El servidor debe estar compilado con "virtual hosting" activado para +# conseguir que esto trabaje correctamente. +# +# Observe que el campo "numeric" tiene que ser único en la red si tu +# servidor esta funcionando, y debe estar entre 0 y 4095, y no se +# actualiza en un rehash. +General { + name = "gmsis.irc-dev.net"; + description = "Servidor de Desarrollo de IRC-Dev.Net."; + numeric = 1; +}; + +# [Admin] +# +# Esto fija la información que se puede ver con el comando "/ADMIN". +# Se debe poner por lo menos una dirección de Email de contacto del +# administrador. +Admin { + # En la mayoría se permiten dos líneas de localización ("Location")... + Location = "Servidor de Desarrollo de IRC-Dev.Net"; + Location = "Administrador IRC : zoltan"; + Contact = "Email Administrador <zo...@ir...>"; +}; + +# [Classes] +# +# Todas las conexiones al servidor están asociadas con una cierta "clase +# de conexión", sean entrantes o salientes (iniciadas por el servidor), +# ya sean clientes, servidores o Martians. (Observe que el ircd no tiene +# soporte directo) +# Clases de clientes recomendadas: +# Para Martians (todavía?); tendrán que colocarse como usuarios normales. ;-) +# Tome los siguientes bloques de clases solamente como guía. +# Class { +# name = "nombreclase"; +# pingfreq = tiempo; +# connectfreq = tiempo; +# maxlinks = número; +# sendq = tamaño; +# usermode = "+i"; +# }; +# +# El campo "connectfreq" se aplica solamente a los servidores, y especifica +# la frecuencia con la cual el servidor intentará hacer el "autoconnect". +# Ajustando a 0 causará que el servidor intentará repetidamente sin pausa +# hasta que la condición especificada en el campo "maxlinks" esté satisfecha. +# Esto es una mala idea (Bad Thing(tm)). +# Observe que los tiempos se pueden especificar como número, dando algo +# como este: 1 minutes 20 seconds, or 1*60+20. +# Client { +# host = "user@host"; +# ip = "ip@host"; +# password = "contraseña"; +# class = "nombreclase"; +# }; +# +# El campo "maxlinks" se debe fijar en 0 o 1. +# +# Clases de servidores recomendadas: +# Todos los uplinks del servidor si tu no eres un "hub". +Class { + name = "Servidor"; + pingfreq = 1 minutes 30 seconds; + connectfreq = 5 minutes; + maxlinks = 1; + sendq = 9000000; +}; +# Todos los servidores "leaf" si tu eres "hub". +Class { + name = "ServidorLeaf"; + pingfreq = 1 minutes 30 seconds; + connectfreq = 5 minutes; + maxlinks = 0; + sendq = 9000000; +}; + +# Clases de clientes recomendadas: +# Clases de clientes. 10 = locales; 2 = para todos los .net y .com que no +# estén en Europa; 1 = para todos los demás. +Class { + name = "Local"; + pingfreq = 1 minutes 30 seconds; + sendq = 160000; + maxlinks = 100; + usermode = "+iw"; +}; +Client +{ + class = "Otros"; + host = "*@*"; +}; +Class { + name = "Telefonica"; + pingfreq = 1 minutes 30 seconds; + sendq = 80000; + maxlinks = 5; +}; +Class { + name = "Otros"; + pingfreq = 1 minutes 30 seconds; + sendq = 160000; + maxlinks = 400; +}; +Class { + name = "Opers"; + pingfreq = 1 minutes 30 seconds; + sendq = 160000; + maxlinks = 10; + + # Para las clases de conexión previstas para el uso de operadores, puedes + # especificar los privilegios usados cuando el bloque "Operator" (véase + # abajo) utiliza esta clase. El privilegio local (aka globally_opered) + # DEBE estar definido por el bloque de "Class" o de "Operator". Existen + # los siguientes privilegios: + # + # local (o "propagate", con el efecto contrario) + # whox (puede utlizar el flag x con /WHO) + # display (estado de Oper visible en lusers) + # chan_limit (puede entrar en canales locales cuando esta en + # MAXCHANNELSPERUSER canales) + # mode_lchan (puede usar /MODE &channel sin tener op en el canal) + # deop_lchan (no puede ser deopeado o kickeado en canales locales) + # walk_lchan (puede forzar /JOIN &channel OVERRIDE) + # show_invis (ve usuarios invisibles (+i) en el /WHO x) + # show_all_invis (ve usuarios invisibles (+i) en el /WHO x) + # unlimit_query (muestra más resultados desde /WHO) + # local_kill (puede expulsar (kill) clientes de este servidor) + # rehash (puede usar /REHASH) + # die (puede usar /DIE) + # local_jupe_server (no se usa) + # set (puede usar /SET) + # local_gline (puede poner una G-line para solamente este servidor) + # local_badchan (puede poner una Gchan para solamente este servidor) + # see_chan (puede ver usuarios en canales secretos (+s) en el /WHO) + # wide_gline (puede usar ! para forzar una wide G-line) + # see_opers (puede ver opers sin el privilegio DISPLAY) + # force_local_opmode (puede utilizar OPMODE/CLEARMODE en canales quarantined locales) + # kill (puede expulsar (kill) clientes en otros servidores) + # gline (puede poner G-lines a otros servidores) + # jupe_server (no se usa) + # opmode (puede usar /OPMODE) + # badchan (puede poner Gchans a otros servidores) + # force_opmode (puede utilizar OPMODE/CLEARMODE en canales quarantined globales) + # + # PAra los opers globales (con "propagate = yes" o "local = no"), por + # defecto es conceder todos los privilegios antes mencionados. Para los + # opers locales, por defecto es conceder SOLO los siguientes privilegios: + # chan_limit, mode_lchan, show_invis, show_all_invis, local_kill, + # rehash, local_gline, local_jupe, local_opmode, whox, display, + # force_local_opmode + # Cualquier privilegio listado en un bloque "Class" prevalece a los por + # defecto. + + local = no; +}; +# [Client] +# +# Para permitir conectar a los clientes, necesitan la autorización. Esta +# se puede otorgar basandose en una máscara de hosts, una máscara de +# direcciones y/o con una contraseña. +# Con un uso inteligente de las clases y el campo de "maxconnections" en +# los bloques "Client", puedes permitir entrar a un dominio específico, +# pero rechazando el resto de dominios del mismo nivel, como si fuera +# creando una especie de "bloque Kill inverso". +# Client { +# host = "user@host"; +# ip = "ip@host"; +# password = "contraseña"; +# class = "nombreclase"; +# }; +# +# Descripción técnica (para los ejemplos, vea abajo): +# Para cada cliente que conecta, su dirección IP es conocida. Se hace una +# consulta de dns inverso a la IP númerica para obtener el/los(todos) +# hostnames. +# Cada hostname que pertenece a esa IP numérica se compara con <hostmask>, +# y el bloque "Client" se usa cuando cualquiera de ellos encaja; el cliente +# entonces se mostrará con ese hostname en concreto. Si ninguno de los +# hostnames encanjan, entonces la IP numérica se compara contra el campo +# <IP mask>, y si esta concuerda entonces el bloque "Client" se usa a pesar +# de todo y el cliente mostrará el primer (principal) hostname si existe; +# si la IP numérica no resuelve, el cliente mostrará la notación decimal de +# la IP númerica. +# Hay un caso especial para los sockets de los dominios UNIX y las +# conexiones del host local (localhost); en este caso el campo <IP mask> +# se compara con el nombre del servidor (de tal suerte que no se hace +# con ninguna representación de una IP numérica). El nombre del servidor +# es el devuelto en la respuesta del numérico 002, por ejemplo: +# 002 Your host is 2.irc-dev.net[jolan.ppro], running version .. +# Entonces el "jolan.ppro" es el nombre que usa para comparar. +# Por lo tanto, los sockets de dominio unix, y las conexiones al host +# local (localhost), tendrían que satisfacer este bloque: +# host = "*@jolan.ppro"; +# +# Esta es la entrada "fallback". Todo .uk, .nl, y todos los sin resolver +# están en estos dos bloques. +# Usando dos bloques diferentes, las conexiones múltiples desde una sola +# IP son permitidas solamente de los hostnames que tienen resoluciones DNS +# directas e inversas válidas. +Client +{ + class = "Otros"; + ip = "*@*"; +}; + + +Client +{ + class = "Otros"; + host = "*@*"; +}; +# Si no quieres que conecten usuarios sin DNS inverso resuelto a tu +# servidor, no poner ajustes de "ip = ". +# +# Aqui, sólo se dejaría entrar a todos los usuarios españoles de Telefonica. +Client +{ + host = "*@*.pooles.rima-tde.net"; + class = "Telefonica"; +}; + +Client +{ + host = "*@*.telefonica-data.net"; + class = "Telefonica"; +}; + +Client +{ + host = "*@*.ttd.es"; + class = "Telefonica"; +}; + +# Ahora se listan los dominios .com / .net que se desean permitir... +# Esto es menos trabajoso que hacerlo de la otra manera - poniendo "Klined" +# a cada ISP de los E.E.U.U. +# Deseo que la gente de Holanda con dominio .nl, y no intento ser fresco +# y usar .com... +Client { host = "*@*.wirehub.net"; class = "Otros";}; +Client { host = "*@*.planete.net"; class = "Otros";}; +Client { host = "*@*.ivg.com"; class = "Otros";}; +Client { host = "*@*.ib.com"; class = "Otros";}; +Client { host = "*@*.ibm.net"; class = "Otros";}; +Client { host = "*@*.hydro.com"; class = "Otros";}; +Client { host = "*@*.nl.net"; class = "Local";}; + +# Puedes solicitar un listado más completo, incluyendo la "lista estándar +# de bloques "Kill"" del comité de "Routing"; también le será enviada si +# solicita para un servidor y consigues el aprobado. +# +# Nosotros mismos - esto nos asegura poder entrar, independiente de lo lleno +# que esté el servidor. +Client +{ + host = "*@*.pooles.rima-tde.net"; + ip = "*@80.59.*"; + class = "Local"; +}; + +# Puedes poner un número (0..9) en el campo "password", que hará que el +# ircd sólo acepte un cliente cuando el numero total de conexiones a la +# red desde la misma IP numérica no exceda de ese número. +# El siguiente ejemplo aceptaría al menos una conexión por IP numérica +# desde "*.ono.com" y al menos dos conexiones desde cuentas de acceso a +# internet por modem que tengan "*.dial??.*" como máscara de host: +# Client { +# host = "*@*.ono.com"; +# password = "1"; +# class = "Otros"; +# }; +# Client { +# host = "*@dial??.*"; +# password = "2"; +# class = "Otros"; +# }; +# +# Si no te preocupa de quien se conecta, esta línea permitirá que se +# conecten todos. +Client { + host = "*@*"; + ip = "*@*"; + class = "Otros"; +}; + + +# [Motd] +# +# Es posible mostrar un MOTD (Message of the Day"), a un cliente que +# conecta dependiendo de su origen. +# Motd { +# # Nota: el campo "host" también puede ser un nombre de clase. +# host = "Otros"; +# file = "ruta/al/fichero/del/motd"; +# }; +# +# DPATH/net_com.motd contiene un MOTD especial donde se anima a los +# usuarios que registren sus dominios y conseguir su propios bloques +# "Client" si están en Europa, o moverse a US.irc-dev.net si están en +# los E.E.U.U.. +Motd { + host = "*.net"; + file = "net_com.motd"; +}; +Motd { + host = "*.com"; + file = "net_com.motd"; +}; +Motd { + host = "Telefonica"; + file = "telefonica.motd"; +}; + +# Un MOTD diferente para nosotros, donde precisamos que el "helpdesk" +# mejor no ser molestado con preguntas con respeto al IRC... +Motd { + host = "*.irc-dev.net"; + file := "irc-dev.motd"; +}; + +# [Server] +# +# Una de las características más atractivas de IRC-Dev, es "Uworld", un +# programa conectado a la red como servidor. Esto le permite realizar +# cualquier cambio de modo, para que esta manera los opers puedan +# permitir, por ejemplo, desbloquear un canal que ha sufrido un take-over. +# Sólo hay un pequeño problema: El protocolo del TimeStamp (TS) hace +# que no sea posible. Por esto, hay una opción de configuración para +# permitir esos cambios desde cierto servidor. +# Server { +# # El nombre del servidor o la máscara para el que esto se aplica. +# name = "relnombreservidor"; +# # La máscara de servidores se permite para introducir (para hub = yes;) +# # o no se permite (para leaf = yes;). +# mask = "máscaraservidor"; +# # No son asumidos estos valores a menos que lo fijes a "yes". +# uworld = no; +# leaf = no; +# hub = yes; +# }; +# +# Nota: (1) Estas líneas son puestas por cada administrador de un servidor +# en IRC-Dev; (2) Estas líneas debe ser exactamente iguales en cada +# servidor, o los resultados serán impredecibles; (3) Esta es una +# característica útil, no algo que es una responsabilidad y abusado +# regularmente (bien... :-) +# Si estás en IRC-Dev, DEBES tener estas líneas. No puedo tener estrés +# por esto. Si todos los servidores no tienen las mismas lineas, los +# servidores intentarán deshacer los "hack" de cambios de modos que hará +# Uworld. ASEGURATE que todos los servidores tengan EXACTAMENTE las mismas +# "Ulines". +# +# Si tu servidor arranca en una red más grande, es probable que se te +# asignen uno o dos servidores a los que tu servidor pueda conectar. +# Si estos servidores a su vez se conecta a otros servidores que el tuyo +# (lo que es probable), necesitas definir el servidor al que te conectas +# con permiso como "hub". +# Para hacer esto, ajusta "hub = yes;" +# Puedes tambien forzar un servidor (uno que que no conecte con usted) +# a ser un "leaf" con "leaf = yes;" + +Server { + name = "luz.irc-dev.net"; + mask = "*"; + uworld = yes; + hub = yes; +}; +Server { + name = "services.irc-dev.net"; + mask = "*"; + uworld = yes; + hub = yes; +}; +Server { + name = "gmsis2.irc-dev.net"; + mask = "*"; + hub = yes; +}; +# Un ejemplo para estar seguro que IRCnet no consiga en IRC-Dev.Net... +Server { + name = "*"; + mask = "eris.berkeley.edu"; + hub = yes; +}; + +# Esto es posible para prohibir (Jupe) nicks. +Jupe { + nick = "EuWorld,E,StatServ,NoteServ"; + nick = "UWorld2,ChanSvr,ChanSaver,ChanServ"; + nick = "Uworld,NickSvr,NickSaver,NickServ"; + nick = "LPT1,X,login,LPT2,W,Undernet,COM1,V,protocol,COM2"; + nick = "U,pass,COM3,Y,AUX,COM4,Z,newpass"; +}; + +# [Kill] +# +# Mientras funciona tu servidor, es muy probablemente que encontrarás a +# personas o grupos de personas a los que no quieres permitir acceso a tu +# servidor. +# +# Para este propósito, el ircd entiende de "kill blocks". Estos también se +# conocen como "K-lines", en virtud del formato anterior del archivo de +# configuracion. + +# Kill +# { +# host = "user@host"; +# reason = "La razón que verá el usuario"; +# }; +# Es posible prohibir en base del nombre real (Realname). +# También es posible utilizar un archivo como comentario de la prohibición, +# usando file = "archivo": +# Kill +# { +# realname = "realnameabanear"; +# file = "ruta/al/archivo/con/la/razon/para/mostrar"; +# }; +# +# +# La razón por defecto es: "You are banned from this server" +# Notese que las "K-lines" son locales al servidor; si se prohibe a una +# persona o un dominio entero de tu servidor, aun pueden entrar al IRC +# por otro servidor que no tengan "K-lined" (aun). +# +# Con un simple comentario, usando comillas: +Kill { host = "*.au"; reason = "Por favor, use un servidor más cercano"; }; +Kill { host = "*.edu"; reason = "Por favor, use un servidor más cercano"; }; + +# El archivo puede contener, por ejemplo, una razón, un enlace a las normas +# del servidor y una dirección de contacto. +Kill +{ + host = "*lu...@un..."; + file = "kline/youflooded.txt"; +}; + +# Las lineas "kill" basadas en IP se aplican a todos los hosts, incluso si +# una dirección IP tiene un nombre de host resuelto correctamente. +Kill +{ + host = "192.168.*"; + file = "klines/martians"; +}; + +# El campo "realname" permite prohibir por el nombre real (realname)... +Kill +{ + realname = "*sub7*"; + reason = "Estás infectado con un Troyano"; +}; + +# [Connect] +# +# Es probable que quieras que tu servidor se conecte con otros servidores +# de forma que tus usuarios tengan otros usuarios con quien chatear. +# Los servidores del IRC conectan con otros servidores formando una red +# con topología de estrella o árbol. No se permiten los bucles (Loops). +# +# En esta red, dos servidores pueden ser distinguidos: servidores "hub" +# y "leaf". Los servidores "leaf" se conectan con los "hubs"; los "hub" +# se conectan entre ellos. Por supuesto, muchos servidores no se pueden +# clasificar directamente en una de esas categorias. Existe un sistema +# predefindo de toma de decisión basado en las reglas para los enlaces +# de los servidores se proporciona para decidir a que enlaces permitr, +# cuales se dejan establecer a mano, y cuales de los enlaces denegar (a +# la fuerza). +# +# Los bloques "Connect" +# define con qué servidores conecta el servidores, y qué servidores se +# permiten conectar. +# Connect { +# name = "nombreservidor"; +# host = "hostnameOip"; +# password = "contraseña"; +# port = númeropuerto; +# class = "nombreclase"; +# }; +# +# El campo "port" define el puerto por defecto que el servidor intentará +# conectar si un operador utiliza el comando "/connect" sin especificar +# un puerto. Este también es el puerto usado para los intentos del servidor +# de autoconectar con el servidor remoto. (Véase los bloques "Class" para +# más informacion sobre "auto-connects"). +# +# Nuestro uplink primario. +Connect { + name = "devel.irc-dev.net"; + host = "1.2.3.4"; + password = "passwd"; + port = 4400; + class = "Servidor"; +}; + + +# [Crule] +# +# Para un sistema avanzado de toma de decisiones basado en las reglas de +# encaminamiento en tiempo real puedes utilizar los bloques "Crule". Para +# más información, vea doc/*/crules.txt +# Crule +# { +# server = "máscaraservidor"; +# rule = "reglaconexión"; +# # Ajustar "all" a "yes" hace que la regla se aplique siempre. Si no +# # solamente se aplica a los "autoconnects". +# all = yes; +# }; +Crule +{ + server = "*.US.irc-dev.net"; + rule = "connected(*.US.irc-dev.net)"; +}; +Crule +{ + server = "*.EU.irc-dev.net"; + rule = "connected(Vigo.ES.EU.*)"; +}; + +# El siguiente bloque se recomienda para servidores "leaf": +Crule +{ + server = "*"; + rule = "directcon(*)"; +}; + +# [Operator] +# +# Inevitablemente, has alcanzado la parte sobre los Operadores del IRC (IRC +# Operators). El estado de Oper condece algunos privilegios especiales a un +# usuario, como la capacidad de poder desconectar el servidor de otro +# o (intentar a) establecer una conexión con otro usuario y a expulsar +# (kill) a usuarios del IRC. +# Se podrian escribir muchas páginas sobre esto; Resumamos con que si +# deseas designar a alguien como operador del IRC (IRC Operator) en tu +# servidor, esta persona debe estar enterado de sus responsabilidades, y +# eso, siendo el admin, el responsable de sus actos. +# +# Hay dos clases de Operadores del IRC (IRC Operators): "local" y "global". +# Los Opers locales pueden hacer "squit", "connect" y "kill" - pero +# solamente localmente: su modo de usuario de +o no se propaga a los otros +# servidores. En IRC-Dev, esto previene ellos de usar Uworld también. +# +# Operator { +# host = "máscara host/IP"; +# name = "nombreoper"; +# password = "contraseñacifrada"; +# class = "nombreclase"; +# # Puedes fijar también cualquier privilegio del operador; vea +# # la documentación del bloque "Class" para más detalles. Un +# # privilegio definido para un solo Operador prevalecerá los +# # ajustes de privilegios para la Clase y para el ajuste por +# # defecto. +# }; +# +# La contraseña cifrada es opcional. Si deseas cifrar tu contraseña, hay +# una utilidad en el ircd. Lea por favor el archivo tools/README.es +# Todos los privilegios son mostrados con los valores por defecto; Si +# deseas eliminar los valores por defecto, debes fijar solamente esos +# privilegios para el operador. Enumerar los privilegios omitidos apenas +# hace las cosas más duras para encontrar. +Operator { + local = no; + host = "*@*.pooles.rima-tde.net"; + password = "KI88nphRm0UPw"; + name = "zoltan"; + class = "Local"; +}; +Operator { + host = "*@*.ttd.es"; + password = "passnocifrada"; + name = "zolty"; + class = "Opers"; +}; + +# Notese que el campo "class" es opcional, pero dejarla vacía pone los +# opers en la clase "default", que acepta generalmente una sola conexión +# a la vez. Si deseas que haya más de un usuario para Oper por bloque, +# entonces utiliza una clase de conexión que permita más de una conexión, +# por ejemplo (usando la clase "Local" como en el ejemplo de arriba): +# +# Una vez que te haces OPER tu clase de conexión cambia, no importa de +# dónde eres o tus clases de conexión anteriores. Si la clase de conexión +# definida es "Local" para el bloque "Operator", entonces tu nueva clase +# de conexión es "Local". + +# [Port] +# Cuando tu servidor consigue llenarse, notarás retrasos al intentar +# conectar al puerto de escucha primario de tu servidor. Es posible con las +# lineas "Port" para especificar puertos adicionales para que el ircd los +# escuche. De hecho los puertos son: 6667 - estándar; 6660-6669 - puertos +# adicionales de clientes; +# Usar 4000 para puerto de escucha de servidores. +# Esto es sólo por convenio, no hay políticas oficiales de la IANA ni del +# IETF. +# La IANA dice que debemos usar el puerto 194, pero éste requiere que +# el ircd funcione como root, así que no lo hacemos. +# +# Port { +# port = número; +# mask = "máscaraip"; +# # Utilice esto para controlar la interfaz para "bindear". +# vhost = "ipvirtualhost"; +# # Ajustando a "yes" hace que sea de sólo servidores. +# server = yes; +# # Ajustando a "yes" hace que el port no salga en los "stats". +# hidden = yes; +# }; +# +# El ajuste del campo "mask" permite que especifiques un rango de +# direcciones IP de las cuales permitirás conexiones. Esto debe contener +# solamente direcciones IP y '*' si está utilizada. Este campo utiliza +# solamente direcciones IP. Esto no utiliza resolución DNS de ninguna manera +# así que no puedes utilizarlo para permitir *.nl o *.uk. Los intentos de +# especificar cualquier cosa excepto números, puntos y estrella [0-9.*] +# dará lugar que en el puerto permitirá conexiones desde cualquier sitio. +# +# El ajuste de la interface permite a los servidores "multihosts" a +# especificar que interface será utilizada en el puerto, si una interfaz +# no está especificada, será utilizada la interfaz por defecto. La interfaz +# DEBE ser la dirección IP completa de la interfaz hardware real en la +# máquina donde corre el ircd. +# Si deseas utilizar "virtual hosting" *TU* *DEBES* *UTILIZAR* *ESTO*, de +# otra manera *SE USARA* todas las interfaces - que no es lo que espera la +# mayoría de la gente. +# +Port { + server = yes; + port = 4400; +}; + +# Este es un puerto de Servidor que está oculto +Port { + server = yes; + hidden = yes; + port = 4401; +}; + +# Lo siguiente son puertos normales de cliente +Port { port = 6667; }; +Port { port = 6668; }; +Port { + mask = "192.168.*"; + port = 6666; +}; + +# Esto es un puerto de cliente oculto, escuchando en la interfaz +# asociado a la dirección IP 168.8.21.107 +Port { + mask = "168.8.21.107"; + hidden = yes; + port = 7000; +}; + +# Esto es un alias implementado del servidor para enviar un mensaje a un +# service. La cadena después de Pseudo es el nombre del comando; el campo +# "name" es el nombre del service, usado para los mensajes de error. Más +# de una entrada del campo "nick" puede ser proporcionadas, la última +# listada es la que tiene la prioridad más alta. +Pseudo "CHANSERV" { + name = "X"; + nick = "X...@ch..."; +}; + +# Puedes poner un texto "prepend" antes del mensaje del usuario. +Pseudo "LOGIN" { + name = "X"; + prepend = "LOGIN "; + nick = "X...@ch..."; +}; + +# [Features] +# Los servidores de IRC tienen una gran cantidad de opciones y +# características. La mayoria de éstos se ajustan en tiempo de compilación +# con el uso de #define's --ver "make config" para más detalles -- pero +# estamos trabajando para mover muchos de éstos al archivo de configuracion. +# Las características (features) permiten ajustarlos en tiempo real. +# Sólo necesitas un bloque "feature" en el cual se usa del siguiente modo. +# "nombrecaracterstica" = "valor1" , "valor2", ..., "valorn-1", "valorn"; +# +# El propósito entero de las F:lines es que no tengas que recompilar el IRCD +# cada vez que quieres cambiar una característica (feature). Todas las +# características se enumeran abajo, y al final cómo ajustar el "logging". +# +# Gracias especiales a Kev por escribir la documentación de F:lines. Eso +# puede ser encontrado en doc/*/features.txt y la documentación de registro +# de eventos (logging) se puede encontrar en doc/*/log.txt. Los valores por +# defecto usados por la red de IRC-Dev están abajo. +# +Features +{ +# "LOG" = "SYSTEM:FILE:ircd.log"; +# "LOG" = "SYSTEM:LEVEL:CRIT"; +# "DOMAINNAME" = "<obtenido desde /etc/resolv.conf por el ./configure>"; +# "RELIABLE_CLOCK" = "FALSE"; +# "BUFFERPOOL" = "27000000"; +# "HAS_FERGUSON_FLUSHER" = "FALSE"; +# "CLIENT_FLOOD" = "2048"; +# "SERVER_PORT" = "4400"; +# "NODEFAULTMOTD" = "TRUE"; +# "MOTD_BANNER" = "string"; +# "PROVIDER" = "string"; +# "KILL_IPMISMATCH" = "FALSE"; +# "IDLE_FROM_MSG" = "TRUE"; +# "HUB" = "FALSE"; +# "WALLOPS_OPER_ONLY" = "FALSE"; +# "NODNS" = "FALSE"; +# "RANDOM_SEED" = "<debes fijar uno explícitamente>"; +# "DEFAULT_LIST_PARAM" = "TRUE"; +# "NICKNAMEHISTORYLENGTH" = "800"; +# "HOST_HIDING" = "TRUE"; +# "HIDDEN_HOST" = "users.irc-dev.net"; +# "HIDDEN_IP" = "127.0.0.1"; +# "CONNEXIT_NOTICES" = "FALSE"; +# "OPLEVELS" = "TRUE"; +# "LOCAL_CHANNELS" = "TRUE"; +# "TOPIC_BURST" = "FALSE"; +# "KILLCHASETIMELIMIT" = "30"; +# "MAXCHANNELSPERUSER" = "10"; +# "NICKLEN" = "12"; +# "AVBANLEN" = "40"; +# "MAXBANS" = "45"; +# "MAXSILES" = "15"; +# "MAXWATCHS" = "128"; +# "HANGONGOODLINK = "300"; +# "HANGONRETRYDELAY" = "10"; +# "CONNECTTIMEOUT" = "90"; +# "TIMESEC" = "60"; +# "MAXIMUM_LINKS" = "1"; +# "PINGFREQUENCY" = "120"; +# "CONNECTFREQUENCY" = "600"; +# "DEFAULTMAXSENDQLENGTH" = "40000"; +# "GLINEMAXUSERCOUNT" = "20"; +# "SOCKSENDBUF" = "61440"; +# "SOCKRECVBUF" = "61440"; +# "IPCHECK_CLONE_LIMIT = 24"; +# "IPCHECK_CLONE_PERIOD = "40"; +# "IPCHECK_CLONE_DELAY = "600"; +# "MPATH" = "ircd.motd"; +# "RPATH" = "remote.motd"; +# "PPATH" = "ircd.pid";# "LIST_CHAN" = "TRUE"; +# "VIRTUAL_HOST" = "FALSE"; +# "TOS_SERVER" = "0x08"; +# "TOS_CLIENT" = "0x08"; +# "POLLS_PER_LOOP" = "200"; +# "IRCD_RES_TIMEOUTS = "4"; +# "IRCD_RES_RETRIES = "2"; +# "AUTH_TIMEOUT = "9"; +# "ANNOUNCE_INVITES = "FALSE"; +# "CRYPT_OPER_PASSWORD" = "TRUE"; +# "CONFIG_OPERCMDS" = "FALSE"; +# "LIST_CHAN" = "TRUE"; +# "HIS_SNOTICES" = "TRUE"; +# "HIS_SNOTICES_OPER_ONLY" = "TRUE"; +# "HIS_DESYNCS" = "TRUE"; +# "HIS_DEBUG_OPER_ONLY" = "TRUE"; +# "HIS_WALLOPS" = "TRUE"; +# "HIS_MAP" = "TRUE"; +# "HIS_LINKS" = "TRUE"; +# "HIS_TRACE" = "TRUE"; +# "HIS_STATS_a" = "TRUE"; +# "HIS_STATS_b" = "TRUE"; +# "HIS_STATS_c" = "TRUE"; +# "HIS_STATS_d" = "TRUE"; +# "HIS_STATS_e" = "TRUE"; +# "HIS_STATS_f" = "TRUE"; +# "HIS_STATS_g" = "TRUE"; +# "HIS_STATS_h" = "TRUE"; +# "HIS_STATS_i" = "TRUE"; +# "HIS_STATS_j" = "TRUE"; +# "HIS_STATS_k" = "TRUE"; +# "HIS_STATS_l" = "TRUE"; +# "HIS_STATS_m" = "TRUE"; +# "HIS_STATS_M" = "TRUE"; +# "HIS_STATS_o" = "TRUE"; +# "HIS_STATS_p" = "TRUE"; +# "HIS_STATS_q" = "TRUE"; +# "HIS_STATS_r" = "TRUE"; +# "HIS_STATS_R" = "TRUE"; +# "HIS_STATS_t" = "TRUE"; +# "HIS_STATS_T" = "TRUE"; +# "HIS_STATS_u" = "FALSE"; +# "HIS_STATS_U" = "TRUE"; +# "HIS_STATS_v" = "TRUE"; +# "HIS_STATS_w" = "FALSE"; +# "HIS_STATS_x" = "TRUE"; +# "HIS_STATS_y" = "TRUE"; +# "HIS_STATS_z" = "TRUE"; +# "HIS_WHOIS_SERVERNAME" = "TRUE"; +# "HIS_WHOIS_IDLETIME" = "TRUE"; +# "HIS_WHO_SERVERNAME" = "TRUE"; +# "HIS_WHO_HOPCOUNT" = TRUE"; +# "HIS_BANWHO" = "TRUE"; +# "HIS_KILLWHO" = "TRUE"; +# "HIS_REWRITE" = "TRUE"; +# "HIS_REMOTE" = 1; +# "HIS_NETSPLIT" = TRUE"; +# "HIS_SERVERNAME" = "*.irc-dev.net"; +# "HIS_SERVERINFO" = "IRC-Dev.Net, Desarrollo de IRC / IRC Development"; +# "HIS_URLSERVERS" = "http://www.irc-dev.net/servers.php"; +# "NETWORK" = "IRC-Dev"; +# "URL_CLIENTS" = "ftp://ftp.irc.org/pub/irc/clients"; + +}; + +# Bien, has llegado al final de este ejemplo del archivo de configuración. +# Si tienes alguna pregunta, visita http://www.irc-dev.net, o entra en el +# canal #irc-dev de Undernet y nos las planteas :-) +# +# Las actualizaciones de este ircd se puede encontrar via CVS o por +# descarga directa en http://www.irc-dev.net +# +# Buena suerte con el resto! + +# +# IRC-Dev Devel Team. ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2004-05-28 10:01:37
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-05-28 10:01:30 UTC Modified files: doc/ircd.sample-en.conf Log message: Actualizacion ircd.conf en ingles ---------------------- diff included ---------------------- Index: ircd-ircdev/doc/ircd.sample-en.conf diff -u ircd-ircdev/doc/ircd.sample-en.conf:1.5 ircd-ircdev/doc/ircd.sample-en.conf:1.6 --- ircd-ircdev/doc/ircd.sample-en.conf:1.5 Fri May 28 02:52:55 2004 +++ ircd-ircdev/doc/ircd.sample-en.conf Fri May 28 03:01:20 2004 @@ -747,8 +747,9 @@ # "HIDDEN_HOST" = "users.irc-dev.net"; # "HIDDEN_IP" = "127.0.0.1"; # "CONNEXIT_NOTICES" = "FALSE"; +# "OPLEVELS" = "TRUE"; # "LOCAL_CHANNELS" = "TRUE"; -# "FEAT_TOPIC_BURST" = "FALSE"; +# "TOPIC_BURST" = "FALSE"; # "KILLCHASETIMELIMIT" = "30"; # "MAXCHANNELSPERUSER" = "10"; # "NICKLEN" = "12"; @@ -767,6 +768,9 @@ # "GLINEMAXUSERCOUNT" = "20"; # "SOCKSENDBUF" = "61440"; # "SOCKRECVBUF" = "61440"; +# "IPCHECK_CLONE_LIMIT = 24"; +# "IPCHECK_CLONE_PERIOD = "40"; +# "IPCHECK_CLONE_DELAY = "600"; # "MPATH" = "ircd.motd"; # "RPATH" = "remote.motd"; # "PPATH" = "ircd.pid"; @@ -777,14 +781,10 @@ # "IRCD_RES_TIMEOUTS = "4"; # "IRCD_RES_RETRIES = "2"; # "AUTH_TIMEOUT = "9"; -# "FEAT_ANNOUNCE_INVITES = "FALSE"; -# "IPCHECK_CLONE_LIMIT = 24"; -# "IPCHECK_CLONE_PERIOD = "40"; -# "IPCHECK_CLONE_DELAY = "600"; +# "ANNOUNCE_INVITES = "FALSE"; # "CRYPT_OPER_PASSWORD" = "TRUE"; # "CONFIG_OPERCMDS" = "FALSE"; -# "OPLEVELS" = "TRUE"; -# "LOCAL_CHANNELS" = "TRUE"; +# "LIST_CHAN" = "TRUE"; # "HIS_SNOTICES" = "TRUE"; # "HIS_SNOTICES_OPER_ONLY" = "TRUE"; # "HIS_DESYNCS" = "TRUE"; ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2004-05-28 09:53:13
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-05-28 09:53:06 UTC Modified files: doc/ircd.sample-en.conf Log message: Actualizacion ircd.conf en ingles ---------------------- diff included ---------------------- Index: ircd-ircdev/doc/ircd.sample-en.conf diff -u ircd-ircdev/doc/ircd.sample-en.conf:1.4 ircd-ircdev/doc/ircd.sample-en.conf:1.5 --- ircd-ircdev/doc/ircd.sample-en.conf:1.4 Fri May 21 09:21:23 2004 +++ ircd-ircdev/doc/ircd.sample-en.conf Fri May 28 02:52:55 2004 @@ -1,6 +1,6 @@ # ircd.conf - configuration file for IRC-Dev's IRCD. # -# Last Updated: 21, May 2004. +# Last Updated: 28, May 2004. # # Written by Niels <ni...@un...>, based on the original example.conf, # server code and some real-life (ahem) experience. @@ -40,9 +40,9 @@ # There is a difference between the "hostname" and the "server name" # of the machine that the server is run on. For example, the host can # have "83.Red-80-59-255.pooles.rima-tde.net" as FQDN, and -# "zoltan.irc-dev.net" as server name. +# "gmsis.irc-dev.net" as server name. # A "server mask" is something like "*.EU.irc-dev.net", which is -# matched by "Vigo.ES.EU.irc-dev.net" but not by "Porto.PT.US.irc-dev.net". +# matched by "Vigo.ES.EU.irc-dev.net" but not by "Miami.FL.US.irc-dev.net". # # Please do NOT just rename the ircd.sample-en.conf to ircd.conf and expect # it to work. @@ -58,15 +58,15 @@ # numeric = numericnumber; # }; # -# <virtual host> must contain either a * or a valid IPv4 address in +# The "vhost" field must contain either a * or a valid IPv4 address in # dotted quad notation. (127.0.0.1) The address MUST be the address # of a physical interface on the host. This address is used for outgoing -# connections only, see Port{} for listener virtual hosting. +# connections only, see "Port" block for listener virtual hosting. # If in doubt put a * or the IP of your primary interface here. # The server must be compiled with virtual hosting turned on to get this # to work correctly. # -# Note that <server numeric> has to be unique on the network your server +# Note that "numeric" field has to be unique on the network your server # is running on, must be between 0 and 4095, and is not updated on a rehash. General { name = "gmsis.irc-dev.net"; @@ -102,10 +102,10 @@ # usermode = "+i"; # }; # -# <connect freq> applies only to servers, and specifies the frequency -# that the server tries to autoconnect. setting this to 0 will cause -# the server to attempt to connect repeatedly with no delay until the -# <maximum links> condition is satisfied. This is a Bad Thing(tm). +# The "connectfreq" field applies only to servers, and specifies the +# frequency that the server tries to autoconnect. setting this to 0 will +# cause the server to attempt to connect repeatedly with no delay until the +# "maxlinks" condition is satisfied. This is a Bad Thing(tm). # Note that times can be specified as a number, or by giving something # like: 1 minutes 20 seconds, or 1*60+20. # Client { @@ -115,7 +115,7 @@ # class = "classname"; # }; # -# <maximum links> should be set at either 0 or 1. +# The "maxlinks" field should be set at either 0 or 1. # # Recommended server classes: # All your server uplinks you are not a hub for. @@ -218,8 +218,8 @@ # To allow clients to connect, they need authorization. This can be # done based on hostmask, address mask, and/or with a password. # With intelligent use of classes and the maxconnections field in the -# Client blocks, you can let in a specific domain, but get rid of all other -# domains in the same toplevel, thus setting up some sort of "reverse +# "Client" blocks, you can let in a specific domain, but get rid of all +# other domains in the same toplevel, thus setting up some sort of "reverse # Kill block". # Client { # host = "user@host"; @@ -232,7 +232,9 @@ # For every connecting client, the IP address is known. A reverse lookup # on this IP-number is done to get the (/all) hostname(s). # Each hostname that belongs to this IP-number is matched to <hostmask>, -# and the Client {} is used when any matches; the client will then show +# and the "Client" block is used when any matches; the client will then +show +FIX FIX # with this particular hostname. If none of the hostnames match, then # the IP-number is matched against the <IP mask ...> field, if this matches # then the Client{} is used nevertheless and the client will show with the @@ -339,7 +341,7 @@ }; -# [motd] +# [Motd] # # It is possible to show a different Message of the Day to a connecting # client depending on its origin. @@ -350,26 +352,26 @@ # }; # # DPATH/net_com.motd contains a special MOTD where users are encouraged -# to register their domains and get their own client{} lines if they're in +# to register their domains and get their own "Client" blocks if they're in # Europe, or move to US.irc-dev.net if they're in the USA. -motd { +Motd { host = "*.net"; file = "net_com.motd"; }; -motd { +Motd { host = "*.com"; file = "net_com.motd"; }; -motd { +Motd { host = "Telefonica"; file = "telefonica.motd"; }; # A different MOTD for ourselves, where we point out that the helpdesk # better not be bothered with questions regarding irc... -motd { - host = "*.london.ac.uk"; - file = "london.motd"; +Motd { + host = "*.irc-dev.net"; + file = "irc-dev.motd"; }; # [Server] @@ -493,7 +495,7 @@ # The realname field lets you ban by realname... Kill { - host = "*sub7*"; + realname = "*sub7*"; reason = "You are infected with a Trojan"; }; @@ -510,7 +512,7 @@ # server links is provided for ircd to decide what links to allow, what # to let humans do themselves, and what links to (forcefully) disallow. # -# The Connect blocks +# The "Connect" blocks # define what servers the server connect to, and which servers are # allowed to connect. # Connect { @@ -524,11 +526,11 @@ # The "port" field defines the default port the server tries to connect # to if an operator uses /connect without specifying a port. This is also # the port used when the server attempts to auto-connect to the remote -# server. (See Class blocks for more informationa about auto-connects). +# server. (See "Class" blocks for more informationa about auto-connects). # # Our primary uplink. Connect { - name = "gmsis.irc-dev.net"; + name = "devel.irc-dev.net"; host = "1.2.3.4"; password = "passwd"; port = 4400; @@ -536,11 +538,11 @@ }; -# [crule] +# [Crule] # # For an advanced, real-time rule-based routing decision making system -# you can use crule blocks. For more information, see doc/readme.crules. -# CRULE +# you can use "Crule" blocks. For more information, see doc/*/crules.txt. +# Crule # { # server = "servermask"; # rule = "connectrule"; @@ -548,19 +550,19 @@ # # applies to autoconnects. # all = yes; # }; -CRULE +Crule { server = "*.US.irc-dev.net"; rule = "connected(*.US.irc-dev.net)"; }; -CRULE +Crule { server = "*.EU.irc-dev.net"; rule = "connected(Vigo.ES.EU.*)"; }; # The following block is recommended for leaf servers: -CRULE +Crule { server = "*"; rule = "directcon(*)"; @@ -587,7 +589,7 @@ # name = "opername"; # password = "encryptedpass"; # class = "classname"; -# # You can also set any operator privilege; see the Class block +# # You can also set any operator privilege; see the "Class" block # # documentation for details. A privilege defined for a single # # Operator will override the privilege settings for the Class # # and the default setting. @@ -614,15 +616,15 @@ class = "Opers"; }; -# Note that the <connection class> is optional, but leaving it away -# puts the opers in class "default", which usually only accepts one -# connection at a time. If you want users to Oper up more then once per -# block, then use a connection class that allows more then one connection, -# for example (using class Local as in the example above): +# Note that the "class" field is optional, but leaving it away puts the +# opers in class "default", which usually only accepts one connection at +# a time. If you want users to Oper up more then once per block, then use +# a connection class that allows more then one connection, for example +# (using class Local as in the example above): # # Once you OPER your connection class changes no matter where you are or # your previous connection classes. If the defined connection class is -# Local for the operator block, then your new connection class is Local. +# Local for the "Operator" block, then your new connection class is Local. # [Port] # When your server gets more full, you will notice delays when trying to @@ -704,12 +706,12 @@ nick = "X...@ch..."; }; -# [features] +# [Features] # IRC servers have a large number of options and features. Most of these # are set at compile time through the use of #define's--see "make config" # for more details--but we are working to move many of these into the # configuration file. Features let you configure these at runtime. -# You only need one feature block in which you use +# You only need one "features" block in which you use # "featurename" = "value1" , "value2", ..., "valuen-1", "valuen"; # # The entire purpose of F:lines are so that you do not have to recompile @@ -720,7 +722,7 @@ # be found at doc/*/features.txt and the logging documentation can be found # at doc/*/log.txt. The defaults used by the IRC-Dev.Net network are below. # -features +Features { # "LOG" = "SYSTEM:FILE:ircd.log"; # "LOG" = "SYSTEM:LEVEL:CRIT"; @@ -838,7 +840,7 @@ # Well, you have now reached the end of this sample configuration # file. If you have any questions, visit http://www.irc-dev.net, -# or join the channel #irc-dev at IRC-Hispano or Undernet, and feel :-) +# or join the channel #irc-dev at Undernet, and feel :-) # # Upgrades of the ircd can be found via CVS or download on # http://www.irc-dev.net ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2004-05-24 15:51:28
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-05-24 15:51:21 UTC Modified files: TODO.es Log message: Actualizacion TODO ---------------------- diff included ---------------------- Index: ircd-ircdev/TODO.es diff -u ircd-ircdev/TODO.es:1.8 ircd-ircdev/TODO.es:1.9 --- ircd-ircdev/TODO.es:1.8 Fri May 21 08:39:33 2004 +++ ircd-ircdev/TODO.es Mon May 24 08:51:11 2004 @@ -1,7 +1,7 @@ # # TODO para ircd-ircdev # -# $Id: TODO.es,v 1.8 2004/05/21 15:39:33 zolty Exp $ +# $Id: TODO.es,v 1.9 2004/05/24 15:51:11 zolty Exp $ # # Insertar las nuevas entradas al principio de la lista TODO. # @@ -72,7 +72,6 @@ 23/Abr/2004 - [G] Sistema de logs no funciona por el paso del .conf al bison 1/Nov/2003 - - [G] Bug al conectar sale umode -Oo. - [G] Bug en las U-lines (uworld y jupes). ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2004-05-21 16:21:59
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-05-21 16:21:45 UTC Modified files: doc/ircd.sample-en.conf Log message: Actualizacion ircd.conf ---------------------- diff included ---------------------- Index: ircd-ircdev/doc/ircd.sample-en.conf diff -u ircd-ircdev/doc/ircd.sample-en.conf:1.3 ircd-ircdev/doc/ircd.sample-en.conf:1.4 --- ircd-ircdev/doc/ircd.sample-en.conf:1.3 Fri May 21 08:39:33 2004 +++ ircd-ircdev/doc/ircd.sample-en.conf Fri May 21 09:21:23 2004 @@ -746,6 +746,7 @@ # "HIDDEN_IP" = "127.0.0.1"; # "CONNEXIT_NOTICES" = "FALSE"; # "LOCAL_CHANNELS" = "TRUE"; +# "FEAT_TOPIC_BURST" = "FALSE"; # "KILLCHASETIMELIMIT" = "30"; # "MAXCHANNELSPERUSER" = "10"; # "NICKLEN" = "12"; @@ -774,6 +775,7 @@ # "IRCD_RES_TIMEOUTS = "4"; # "IRCD_RES_RETRIES = "2"; # "AUTH_TIMEOUT = "9"; +# "FEAT_ANNOUNCE_INVITES = "FALSE"; # "IPCHECK_CLONE_LIMIT = 24"; # "IPCHECK_CLONE_PERIOD = "40"; # "IPCHECK_CLONE_DELAY = "600"; @@ -807,6 +809,7 @@ # "HIS_STATS_p" = "TRUE"; # "HIS_STATS_q" = "TRUE"; # "HIS_STATS_r" = "TRUE"; +# "HIS_STATS_R" = "TRUE"; # "HIS_STATS_t" = "TRUE"; # "HIS_STATS_T" = "TRUE"; # "HIS_STATS_u" = "FALSE"; ----------------------- End of diff ----------------------- |
From: Toni G. <zo...@us...> - 2004-05-21 15:42:07
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-05-21 15:41:59 UTC Added files: ircd/m_pseudo.c Log message: Author: zoltan <zo...@ir...> Log message: 2004-05-21 Toni García <zo...@ir...> 1.0.alpha10 * Deshabilitar el cambio de nick en canales moderados * Mapeo de comandos de services * Modo de canal +D (Delayed-join / Modo de conferencias) * Opcion de usermode por defecto por clase de conection * Anuncio de invitaciones a los otros operadores * Sincronizacion Undernet ---------------------- diff included ---------------------- Index: ircd-ircdev/ircd/m_pseudo.c diff -u /dev/null ircd-ircdev/ircd/m_pseudo.c:1.1 --- /dev/null Fri May 21 08:42:00 2004 +++ ircd-ircdev/ircd/m_pseudo.c Fri May 21 08:41:49 2004 @@ -0,0 +1,150 @@ +/* + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, ircd/m_pseudo.c + * + * Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 2002-2003 Zoot <zo...@ga...> + * + * 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: m_pseudo.c,v 1.1 2004/05/21 15:41:49 zolty Exp $ + * + */ + +/* + * m_functions execute protocol messages on this server: + * + * cptr is always NON-NULL, pointing to a *LOCAL* client + * structure (with an open socket connected!). This + * identifies the physical socket where the message + * originated (or which caused the m_function to be + * executed--some m_functions may call others...). + * + * sptr is the source of the message, defined by the + * prefix part of the message if present. If not + * or prefix not found, then sptr==cptr. + * + * (!IsServer(cptr)) => (cptr == sptr), because + * prefixes are taken *only* from servers... + * + * (IsServer(cptr)) + * (sptr == cptr) => the message didn't + * have the prefix. + * + * (sptr != cptr && IsServer(sptr) means + * the prefix specified servername. (?) + * + * (sptr != cptr && !IsServer(sptr) means + * that message originated from a remote + * user (not local). + * + * combining + * + * (!IsServer(sptr)) means that, sptr can safely + * taken as defining the target structure of the + * message in this server. + * + * *Always* true (if 'parse' and others are working correct): + * + * 1) sptr->from == cptr (note: cptr->from == cptr) + * + * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr + * *cannot* be a local connection, unless it's + * actually cptr!). [MyConnect(x) should probably + * be defined as (x == x->from) --msa ] + * + * parc number of variable parameter strings (if zero, + * parv is allowed to be NULL) + * + * parv a NULL terminated list of parameter pointers, + * + * parv[0], sender (prefix string), if not present + * this points to an empty string. + * parv[1], pointer to "extra" data (service mapping) + * parv[2]...parv[parc-1] + * pointers to additional parameters + * parv[parc] == NULL, *always* + * + * note: it is guaranteed that parv[0]..parv[parc-1] are all + * non-NULL pointers. + */ +#include "config.h" + +#include "client.h" +#include "hash.h" +#include "ircd.h" +#include "ircd_features.h" +#include "ircd_relay.h" +#include "ircd_reply.h" +#include "ircd_string.h" +#include "ircd_snprintf.h" +#include "msg.h" +#include "numeric.h" +#include "numnicks.h" +#include "s_conf.h" +#include "s_user.h" + +#include <assert.h> + +/* + * m_pseudo - generic service message handler + * + * parv[0] = sender prefix + * parv[1] = service mapping (s_map * disguised as char *) + * parv[2] = message + */ +int m_pseudo(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) +{ + char *text, buffer[BUFSIZE]; + struct s_map *map; + struct nick_host *nh; + + assert(0 != cptr); + assert(cptr == sptr); + assert(0 != cli_user(sptr)); + + /* By default, relay the message straight through. */ + text = parv[parc - 1]; + + if (parc < 3 || EmptyString(text)) + return send_reply(sptr, ERR_NOTEXTTOSEND); + + /* HACK! HACK! HACK! HACK! Yes. It's icky, but + * it's the only way. */ + map = (struct s_map *)parv[1]; + assert(0 != map); + + if (map->prepend) { + ircd_snprintf(0, buffer, sizeof(buffer) - 1, "%s%s", map->prepend, text); + buffer[sizeof(buffer) - 1] = 0; + text = buffer; + } + + for (nh = map->services; nh; nh = nh->next) { + struct Client *target, *server; + + if (NULL == (server = FindServer(nh->nick + nh->nicklen + 1))) + continue; + nh->nick[nh->nicklen] = '\0'; + if ((NULL == (target = FindUser(nh->nick))) + || (server != cli_user(target)->server)) + continue; + nh->nick[nh->nicklen] = '@'; + relay_directed_message(sptr, nh->nick, nh->nick + nh->nicklen, text); + return 0; + } + + return send_reply(sptr, ERR_SERVICESDOWN, map->name); +} + ----------------------- End of diff ----------------------- |