[IRC-Dev CVS] Module ircdh: Change commited ircdh/include ircd_defs.h,NONE,1.1 IPcheck.h,1.1.1.1,1.2
Brought to you by:
zolty
Update of /cvsroot/irc-dev/ircdh/include In directory usw-pr-cvs1:/tmp/cvs-serv7124/ircdh/include Modified Files: IPcheck.h channel.h class.h hash.h ircd.h list.h map.h match.h msg.h numnicks.h opercmds.h packet.h parse.h patchlevel.h querycmds.h random.h res.h s_auth.h s_bsd.h s_conf.h s_debug.h s_misc.h s_numeric.h s_serv.h s_user.h send.h struct.h support.h sys.h userload.h version.h whocmds.h whowas.h Added Files: ircd_defs.h Log Message: 2002-08-15 Toni Garcia <zo...@ir...> Comienzo de la ordenacion del codigo. * Muevo todos los defines del whocmds.c al .h ya que nos hara falta cuando pongamos cada comando, un *.c. * Se hacen cambios en muchos variables globales con el fin de facilitar la lectura e interpretacion. Son los siguientes: time_t now; => time_t CurrentTime; struct Client client; => struct Client *GlobalClientList; struct lusers_st nrof; => struct UserStatistics UserStats; struct stats *ircstp; => struct ServerStatistics *ServerStats; struct ConfItem *conf; => struct ConfItem *GlobalConfList; struct DSlink; => struct DLink; * Empiezo a eliminar los alias de structs, ejempo "aClient" pasa a ser "struct Client". Y en algunas funciones agrego "const" cuando han de mantener la variable de forma constante. * Se desactivan temporalmente WATCH y ESNET_ZLIB mientras se va ordenando el codigo, en breves dias estaran activados. * En los archivos .h de la carpeta include meto las cabeceras con el $Id: de control de RCS asi como los nuevos defines al estilo Undernet. * Se mueven los defines *LEN y similiares al nuevo fichero ircd_defs.h. --- NEW FILE: ircd_defs.h --- /* * IRC - Internet Relay Chat, include/ircd_defs.h * Copyright (C) 1990 Jarkko Oikarinen and * University of Oulu, Computing Center * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * * Commentary by Bleep (Thomas Helvey) * * $Id: */ #ifndef INCLUDED_ircd_defs_h #define INCLUDED_ircd_defs_h /* * Definitions used everywhere in the server * NOTE: Changing any of these definitions is equivalent to a protocol * revision. Every server on a given network must also use the same sizes. */ /* * NICKLEN is the maximum length allowed for a nickname * * Because certain networks are very helpful in finding bugs, the below * is a default that can easily be overridden in CFLAGS. Just add * -DNICKLEN=15 to CFLAGS and save your config in .., and you can forget about * it. Thanks for helping debug guys. */ #ifndef NICKLEN #define NICKLEN 9 #endif /* * USERLEN is the maximum length allowed of a user name including an optional * leading '~' if the user name has not been authenticated by an auth (RFC 931) * server query. */ #define USERLEN 10 /* * HOSTLEN is exactly long enough to hold one (1) segment of FQDN or hostname. * This is due to an historical misinterpretation of RFC 1034. * 3.1. Name space specifications and terminology * * The domain name space is a tree structure. Each node and leaf on the * tree corresponds to a resource set (which may be empty). The domain * system makes no distinctions between the uses of the interior nodes and * leaves, and this memo uses the term "node" to refer to both. * * Each node has a label, which is zero to 63 octets in length. Brother * nodes may not have the same label, although the same label can be used * for nodes which are not brothers. One label is reserved, and that is * the null (i.e., zero length) label used for the root. * * This has proven not to be a problem in the past as connections with FQDN's * of greater than 63 characters are rejected by the server, and most FQDN's * are shorter. It is possible to have a valid FQDN longer than 63 characters. */ #define HOSTLEN 63 /* * REALLEN is the maximum length for user supplied information about a client * connection (gcos). This information is set at client/server registration * time. */ #define REALLEN 50 /* * PASSWDLEN is the maximum length for a password used for connecting servers * and clients. */ #define PASSWDLEN 20 /* * SOCKIPLEN is the length of a dotted quad ip address "XXX.XXX.XXX.XXX" */ #define SOCKIPLEN 15 /* * TOPICLEN is the maximum length for channel topics */ #define TOPICLEN 160 /* * KICKLEN is the maximum length for kick comments */ #define KICKLEN 160 /* * AWAYLEN is the maximum length for away messages */ #define AWAYLEN 160 /* * QUITLEN is the maximum length for quit messages and kill comments */ #define QUITLEN 250 /* * BUFSIZE is exactly long enough to hold one protocol message (RFC 1459) * including the line termination (\r\n). */ #define BUFSIZE 512 /* WARNING: *DONT* CHANGE THIS!!!! */ #define MAXTARGETS 20 #define STARTTARGETS 10 #define RESERVEDTARGETS 12 #endif /* INCLUDED_ircd_defs_h */ Index: IPcheck.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/IPcheck.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- IPcheck.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ IPcheck.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,10 +1,25 @@ -#ifndef IPCHECK_H -#define IPCHECK_H - -/*============================================================================= - * Proto types +/* + * IPcheck.h + * + * $Id: */ +#ifndef INCLUDED_ipcheck_h +#define INCLUDED_ipcheck_h + +#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 + + +/* + * Prototypes + */ extern int IPcheck_local_connect(aClient *cptr); extern void IPcheck_connect_fail(aClient *cptr); extern void IPcheck_connect_succeeded(aClient *cptr); Index: channel.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/channel.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- channel.h 6 Aug 2002 18:45:19 -0000 1.2 +++ channel.h 15 Aug 2002 20:55:23 -0000 1.3 @@ -16,14 +16,23 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: */ +#ifndef INCLUDED_channel_h +#define INCLUDED_channel_h +#ifndef INCLUDED_ircd_defs_h +#include "ircd_defs.h" /* NICKLEN */ +#endif +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> +#define INCLUDED_sys_types_h +#endif -#include "list.h" - -#ifndef CHANNEL_H -#define CHANNEL_H +struct SLink; +struct Client; -/*============================================================================= +/* * General defines */ @@ -31,17 +40,16 @@ #define MODEBUFLEN 200 #define KEYLEN 23 -#define KICKLEN 160 /* Hispano extension */ -#define TOPICLEN 160 #define CHANNELLEN 64 #define MAXBANS 30 #define MAXBANLENGTH 1024 -/*============================================================================= +/* * Macro's */ #define ChannelExists(n) (FindChannel(n) != NullChn) +/* Borrar */ #define NullChn ((aChannel *)0) #define CREATE 1 /* whether a channel should be * created or just tested for existance */ @@ -54,7 +62,6 @@ #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_OVERLAP (CHFL_CHANOP|CHFL_VOICE) #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 */ @@ -62,6 +69,10 @@ #define CHFL_BANNED 0x1000 /* Channel member is banned */ #define CHFL_SILENCE_IPMASK 0x2000 /* silence mask is an IP-number mask */ +#define CHFL_OVERLAP (CHFL_CHANOP|CHFL_VOICE) +#define CHFL_BANVALIDMASK (CHFL_BANVALID | CHFL_BANNED) +#define CHFL_VOICED_OR_OPPED (CHFL_CHANOP | CHFL_VOICE) + /* Channel Visibility macros */ #define MODE_CHANOP CHFL_CHANOP @@ -200,4 +211,4 @@ extern aChannel *channel; -#endif /* CHANNEL_H */ +#endif /* INCLUDED_channel_h */ Index: class.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/class.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- class.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ class.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -16,15 +16,22 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: */ +#ifndef INCLUDED_class_h +#define INCLUDED_class_h +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> +#define INCLUDED_sys_types_h +#endif -#ifndef CLASS_H -#define CLASS_H +struct Client; +struct ConfItem; -/*========================================================================= +/* * Structures */ - struct ConfClass { unsigned int conClass; unsigned int conFreq; @@ -35,7 +42,7 @@ struct ConfClass *next; }; -/*============================================================================= +/* * Macro's */ @@ -59,7 +66,7 @@ #define MarkDelete(x) do { MaxLinks(x) = (unsigned int)-1; } while(0) #define IsMarkedDelete(x) (MaxLinks(x) == (unsigned int)-1) -/*============================================================================= +/* * Proto types */ @@ -79,4 +86,4 @@ extern aConfClass *classes; -#endif /* CLASS_H */ +#endif /* INCLUDED_class_h */ Index: hash.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/hash.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- hash.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ hash.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -15,29 +15,33 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: */ -#ifndef HASH_H -#define HASH_H +#ifndef INCLUDED_hash_h +#define INCLUDED_hash_h -#include "s_serv.h" /* For STAT_* values and StatusMask() macro */ +struct Client; +struct Channel; +struct Watch; -/*============================================================================= +/* * general defines */ /* Now client and channel hash table must be of the same size */ -#define HASHSIZE 32000 +#define HASHSIZE 32000 -/*============================================================================= +/* * Structures */ -/*============================================================================= +/* * Macros for internal use */ -/*============================================================================= +/* * Externally visible pseudofunctions (macro interface to internal functions) */ @@ -47,6 +51,7 @@ #define SeekUser(name) hSeekClient((name), StatusMask(STAT_USER)) #define SeekServer(name) hSeekClient((name), StatusMask(STAT_ME) | \ StatusMask(STAT_SERVER) ) +#define SeekWatch(name) hSeekWatch((name)) /* Safer macros with sanity check on name, WARNING: these are _macros_, no side effects allowed on <name> ! */ @@ -54,19 +59,23 @@ #define FindClient(name) (BadPtr((name))?NULL:SeekClient(name)) #define FindUser(name) (BadPtr((name))?NULL:SeekUser(name)) #define FindServer(name) (BadPtr((name))?NULL:SeekServer(name)) +#define FindWatch(name) (BadPtr((name))?NULL:SeekWatch(name)) -/*============================================================================= +/* * Proto types */ extern void hash_init(void); /* Call me on startup */ -extern int hAddClient(aClient *cptr); -extern int hAddChannel(aChannel *chptr); -extern int hRemClient(aClient *cptr); -extern int hChangeClient(aClient *cptr, char *newname); -extern int hRemChannel(aChannel *chptr); -extern aClient *hSeekClient(char *name, int TMask); -extern aChannel *hSeekChannel(char *name); +extern int hAddClient(struct Client *cptr); +extern int hAddChannel(struct Channel *chptr); +extern int hAddWatch(struct Watch *wptr); +extern int hRemClient(struct Client *cptr); +extern int hChangeClient(struct Client *cptr, const char *newname); +extern int hRemChannel(struct Channel *chptr); +extern int hRemWatch(struct Watch *wptr); +extern struct Client *hSeekClient(const char *name, int TMask); +extern struct Channel *hSeekChannel(const char *name); +extern struct Watch *hSeekWatch(const char *name); extern int m_hash(aClient *cptr, aClient *sptr, int parc, char *parv[]); @@ -78,13 +87,4 @@ extern int dbh_hash_registro(char *clave, int hash_size); #endif /* BDD */ -#ifdef WATCH -extern int hAddWatch(aWatch * wptr); -extern int hRemWatch(aWatch * wptr); -extern aWatch *hSeekWatch(char *nick); - -#define SeekWatch(nick) hSeekWatch((nick)) -#define FindWatch(nick) (BadPtr((nick))?NULL:SeekWatch(nick)) -#endif /* WATCH */ - -#endif /* HASH_H */ +#endif /* INCLUDED_hash_h */ Index: ircd.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/ircd.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- ircd.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ ircd.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,11 +1,27 @@ -#ifndef IRCD_H -#define IRCD_H +/* + * ircd.h + * + * $Id: + */ +#ifndef INCLUDED_ircd_h +#define INCLUDED_ircd_h +#ifndef INCLUDED_config_h +//#include "config.h" +#endif +#ifndef INCLUDED_struct_h +#include "struct.h" /* struct Client */ +#endif +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> /* size_t, time_t */ +#endif -/*============================================================================= - * Macro's + +/* + * Macros */ -#define TStime() (now + TSoffset) +#define TStime() (CurrentTime + TSoffset) +#define OLDEST_TS 780000000 /* Any TS older than this is bogus */ #define BadPtr(x) (!(x) || (*(x) == '\0')) /* Miscellaneous defines */ @@ -16,7 +32,7 @@ #define BASE_VERSION "u2.10" /* Flags for bootup options (command line flags) */ - +/* NO SE USA CONSOLE, INETD y AUTODIE */ #define BOOT_CONSOLE 1 #define BOOT_QUICK 2 #define BOOT_DEBUG 4 @@ -24,7 +40,7 @@ #define BOOT_TTY 16 #define BOOT_AUTODIE 32 -/*============================================================================= +/* * Proto types */ @@ -37,18 +53,21 @@ extern void restart(char *mesg); extern void server_reboot(void); -extern aClient me; -extern time_t now; -extern aClient *client; +extern struct Client me; +extern time_t CurrentTime; +extern struct Client *GlobalClientList; extern time_t TSoffset; extern unsigned int bootopt; extern time_t nextdnscheck; extern time_t nextconnect; -extern int dorehash; +extern int GlobalRehashFlag; +extern int GlobalRestartFlag; extern time_t nextping; -extern unsigned short int portnum; extern char *configfile; -extern int debuglevel; +extern int debuglevel; extern char *debugmode; -#endif /* IRCD_H */ +/* Borrar cuando sea necesario */ +extern unsigned short int portnum; + +#endif /* INCLUDED_ircd_h */ Index: list.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/list.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- list.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ list.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,27 +1,31 @@ -#ifndef LIST_H -#define LIST_H - -/*============================================================================= - * General defines - */ +/* + * list.h + * + * $Id: +*/ +#ifndef INCLUDED_list_h +#define INCLUDED_list_h +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> /* time_t, size_t */ +#define INCLUDED_sys_types_h +#endif -/*============================================================================= - * Macro's - */ +struct Client; +struct Channel; +struct ConfItem; +struct Watch; -/* ============================================================================ +/* * Structures */ struct SLink { struct SLink *next; union { - aClient *cptr; + struct Client *cptr; struct Channel *chptr; struct ConfItem *aconf; -#ifdef WATCH - aWatch *wptr; -#endif + struct Watch *wptr; char *cp; struct { char *banstr; @@ -32,18 +36,20 @@ unsigned int flags; }; -struct DSlink { - struct DSlink *next; - struct DSlink *prev; +struct DLink { + struct DLink *next; + struct DLink *prev; union { - aClient *cptr; + struct Client *cptr; struct Channel *chptr; - struct ConfItem *aconf; - char *cp; +/* borrar */ +// struct ConfItem *aconf; +// char *cp; +/* fin borrar */ + char *ch; } value; }; -#ifdef WATCH struct Watch { struct Watch *next; struct SLink *watch; /* Cadena de punteros a lista aUser */ @@ -51,40 +57,42 @@ time_t lasttime; /* TS de ultimo cambio de estado del nick */ }; -#endif /* WATCH */ -/*============================================================================= +/* * Proto types */ -extern void free_link(Link *lp); -extern Link *make_link(void); -extern Link *find_user_link(Link *lp, aClient *ptr); +extern void free_link(struct SLink *lp); +extern struct SLink *make_link(void); +extern struct SLink *find_user_link(struct SLink *lp, struct Client *ptr); +extern void init_list(void); +extern struct Client *make_client(struct Client *from, int status); +extern void free_client(struct Client *cptr); +extern struct Server *make_server(struct Client *cptr); +extern void remove_client_from_list(struct Client *cptr); +extern void add_client_to_list(struct Client *cptr); +extern struct DLink *add_dlink(struct DLink **lpp, struct Client *cp); +extern void remove_dlink(struct DLink **lpp, struct DLink *lp); +extern struct ConfItem *make_conf(void); +extern void delist_conf(struct ConfItem *aconf); +extern void free_conf(struct ConfItem *aconf); +extern void send_listinfo(struct Client *cptr, char *name); + +/* provisional */ extern void initlists(void); extern void outofmemory(void); -extern aClient *make_client(aClient *from, int status); -extern void free_client(aClient *cptr); extern struct User *make_user(aClient *cptr); -extern struct Server *make_server(aClient *cptr); extern void free_user(struct User *user, aClient *cptr); -extern void remove_client_from_list(aClient *cptr); -extern void add_client_to_list(aClient *cptr); -extern Dlink *add_dlink(Dlink **lpp, aClient *cp); -extern void remove_dlink(Dlink **lpp, Dlink *lp); -extern struct ConfItem *make_conf(void); -extern void delist_conf(struct ConfItem *aconf); -extern void free_conf(struct ConfItem *aconf); extern aGline *make_gline(int is_ipmask, char *host, char *reason, char *name, time_t expire); extern aGline *find_gline(aClient *cptr, aGline **pgline); extern void free_gline(aGline *agline, aGline *pgline); -extern void send_listinfo(aClient *cptr, char *name); #ifdef BADCHAN extern int bad_channel(char *name); #endif -#ifdef WATCH -extern aWatch *make_watch(char *nick); -extern void free_watch(aWatch * wptr); -#endif /* WATCH */ -#endif /* LIST_H */ +extern struct Watch *make_watch(const char *nick); +extern void free_watch(struct Watch *wptr); + +#endif /* INCLUDED_list_h */ + Index: map.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/map.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- map.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ map.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,10 +1,20 @@ -#ifndef MAP_H -#define MAP_H +/* + * map.h + * + * $Id: + */ +#ifndef INCLUDED_map_h +#define INCLUDED_map_h -/*============================================================================= - * Proto types +struct Client; + +/* + * Prototypes */ +/* borrar */ extern int m_map(aClient *cptr, aClient *sptr, int parc, char *parv[]); -#endif /* MAP_H */ +void dump_map(struct Client *cptr, struct Client *server, char *mask, int prompt_length); + +#endif /* INCLUDED_map_h */ Index: match.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/match.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- match.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ match.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,6 +1,20 @@ -#ifndef MATCH_H -#define MATCH_H +/* + * match.h + * + * $Id: +*/ +#ifndef INCLUDED_match_h +#define INCLUDED_match_h +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> /* XXX - broken BSD system headers */ +#define INCLUDED_sys_types_h +#endif +#ifndef INCLUDED_netinet_in_h +#include <netinet/in.h> /* struct in_addr */ +#define INCLUDED_netinet_in_h +#endif +/* BORRAR */ /*============================================================================= * System headers used by this header file */ @@ -8,20 +22,23 @@ #include <netinet/in.h> #include <arpa/inet.h> -/*============================================================================= +/* * Structures */ - struct in_mask { struct in_addr bits; struct in_addr mask; int fall; }; -/*============================================================================= - * Proto types +/* + * Prototypes */ +/* + * XXX - match returns 0 if a match is found. Smelly interface + * needs to be fixed. --Bleep + */ extern int mmatch(const char *old_mask, const char *new_mask); extern int match(const char *ma, const char *na); extern char *collapse(char *pattern); @@ -32,4 +49,5 @@ extern int mmexec(const char *wcm, int wminlen, const char *rcm, int rminlen); extern int matchcompIP(struct in_mask *imask, const char *mask); -#endif /* MATCH_H */ +#endif /* INCLUDED_match_h */ + Index: msg.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/msg.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- msg.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ msg.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -16,19 +16,25 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: */ +#ifndef INCLUDED_msg_h +#define INCLUDED_msg_h +#ifndef INCLUDED_ircd_handler_h +//#include "ircd_handler.h" +#endif -#ifndef MSG_H -#define MSG_H +struct Client; -/*============================================================================= +/* * General defines */ #define MAXPARA 15 -/*----------------------------------------------------------------------------- - * Macro's +/* + * Macros */ /* Index: numnicks.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/numnicks.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- numnicks.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ numnicks.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,5 +1,5 @@ /* - * IRC - Internet Relay Chat, include/h.h + * IRC - Internet Relay Chat, include/numnicks.h * Copyright (C) 1996 - 1997 Carlo Wood * * This program is free software; you can redistribute it and/or modify Index: opercmds.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/opercmds.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- opercmds.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ opercmds.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,7 +1,18 @@ -#ifndef OPERCMDS_H -#define OPERCMDS_H +/* + * opercmds.h + * + * $Id: + */ +#ifndef INCLUDED_opercmds_h +#define INCLUDED_opercmds_h +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> +#define INCLUDED_sys_types_h +#endif -/*============================================================================= +struct Client; + +/* * General defines */ Index: packet.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/packet.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- packet.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ packet.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,11 +1,25 @@ -#ifndef PACKET_H -#define PACKET_H - -/*============================================================================= - * Proto types +/* + * packet.h + * + * $Id: */ +#ifndef INCLUDED_packet_h +#define INCLUDED_packet_h +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> +#define INCLUDED_sys_types_h +#endif + +struct Client; +/* + * Prototypes + */ +/*eliminar */ extern int dopacket(aClient *cptr, char *buffer, int length); -extern int client_dopacket(aClient *cptr, size_t length); -#endif /* PACKET_H */ +extern int server_dopacket(struct Client *cptr, const char *buffer, int length); +extern int client_dopacket(struct Client *cptr, size_t length); + +#endif /* INCLUDED_packet_h */ + Index: parse.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/parse.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- parse.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ parse.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,12 +1,19 @@ -#ifndef PARSE_H -#define PARSE_H +/* + * parse.h + * + * $Id: + */ +#ifndef INCLUDED_parse_h +#define INCLUDED_parse_h -/*============================================================================= - * Proto types +struct Client; + +/* + * Prototypes */ -extern int parse_client(aClient *cptr, char *buffer, char *bufend); -extern int parse_server(aClient *cptr, char *buffer, char *bufend); +extern int parse_client(struct Client *cptr, char *buffer, char *bufend); +extern int parse_server(struct Client *cptr, char *buffer, char *bufend); extern void initmsgtree(void); -#endif /* PARSE_H */ +#endif /* INCLUDED_parse_h */ Index: patchlevel.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/patchlevel.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- patchlevel.h 26 Jul 2002 23:58:43 -0000 1.2 +++ patchlevel.h 15 Aug 2002 20:55:23 -0000 1.3 @@ -14,6 +14,9 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: + * */ /* Index: querycmds.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/querycmds.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- querycmds.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ querycmds.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,84 +1,97 @@ -#ifndef QUERYCMDS_H -#define QUERYCMDS_H +/* + * querycmds.h + * + * $Id: + */ +#ifndef INCLUDED_querycmds_h +#define INCLUDED_querycmds_h -/*============================================================================= +struct Client; + +/* * Structs */ -struct lusers_st { +struct UserStatistics { /* Local connections: */ unsigned int unknowns; /* IsUnknown() || IsConnecting() || IsHandshake() */ unsigned int local_servers; /* IsServer() && MyConnect() */ unsigned int local_clients; /* IsUser() && MyConnect() */ + /* Global counts: */ unsigned int servers; /* IsServer() || IsMe() */ unsigned int clients; /* IsUser() */ + /* Global user mode changes: */ unsigned int inv_clients; /* IsUser() && IsInvisible() */ unsigned int opers; /* IsUser() && IsOper() */ + /* Misc: */ unsigned int channels; }; -/*============================================================================= +extern struct UserStatistics UserStats; + +/* * Macros */ /* Macros for remote connections: */ -#define Count_newremoteclient(nrof,cptr) \ +#define Count_newremoteclient(UserStats, cptr) \ do { \ - ++nrof.clients; \ + ++UserStats.clients; \ ++cptr->user->server->serv->clients; \ - if (nrof.clients >= max_global_count) \ + if (UserStats.clients >= max_global_count) \ { \ - max_global_count = nrof.clients; \ + max_global_count = UserStats.clients; \ max_global_count_TS = TStime(); \ } \ } while(0) -#define Count_newremoteserver(nrof) (++nrof.servers) -#define Count_remoteclientquits(nrof,cptr) \ +#define Count_newremoteserver(UserStats) (++UserStats.servers) +#define Count_remoteclientquits(UserStats, cptr) \ do { \ - --nrof.clients; \ + --UserStats.clients; \ if (!IsServer(cptr)) \ --cptr->user->server->serv->clients; \ } while(0) -#define Count_remoteserverquits(nrof) (--nrof.servers) +#define Count_remoteserverquits(UserStats) (--UserStats.servers) /* Macros for local connections: */ -#define Count_newunknown(nrof) (++nrof.unknowns) -#define Count_unknownbecomesclient(cptr, nrof) \ +#define Count_newunknown(UserStats) (++UserStats.unknowns) +#define Count_unknownbecomesclient(cptr, UserStats) \ do { \ - --nrof.unknowns; ++nrof.local_clients; ++nrof.clients; \ + --UserStats.unknowns; ++UserStats.local_clients; ++UserStats.clients; \ if (match("*" DOMAINNAME, cptr->sockhost) == 0) \ ++current_load.local_count; \ - if (nrof.local_clients > max_client_count) { \ - max_client_count = nrof.local_clients; \ + if (UserStats.local_clients > max_client_count) \ + { \ + max_client_count = UserStats.local_clients; \ max_client_count_TS = TStime(); \ } \ - if (nrof.clients >= max_global_count) \ + if (UserStats.clients >= max_global_count) \ { \ - max_global_count = nrof.clients; \ + max_global_count = UserStats.clients; \ max_global_count_TS = TStime(); \ } \ - if (nrof.local_clients + nrof.local_servers > max_connection_count) \ + if (UserStats.local_clients + UserStats.local_servers > max_connection_count) \ { \ - max_connection_count = nrof.local_clients + nrof.local_servers; \ + max_connection_count = UserStats.local_clients + UserStats.local_servers; \ } \ } while(0) -#define Count_unknownbecomesserver(nrof) do { --nrof.unknowns; ++nrof.local_servers; ++nrof.servers; } while(0) -#define Count_clientdisconnects(cptr, nrof) \ +#define Count_unknownbecomesserver(UserStats) do { --UserStats.unknowns; ++UserStats.local_servers; ++UserStats.servers; } while(0) +#define Count_clientdisconnects(cptr, UserStats) \ do \ { \ - --nrof.local_clients; --nrof.clients; \ + --UserStats.local_clients; --UserStats.clients; \ if (match("*" DOMAINNAME, cptr->sockhost) == 0) \ --current_load.local_count; \ } while(0) -#define Count_serverdisconnects(nrof) do { --nrof.local_servers; --nrof.servers; } while(0) +#define Count_serverdisconnects(UserStats) do { --UserStats.local_servers; --UserStats.servers; } while(0) #define Count_unknowndisconnects(nrof) (--nrof.unknowns) -/*============================================================================= - * Proto types +/* + * Prototypes */ extern int m_version(aClient *cptr, aClient *sptr, int parc, char *parv[]); @@ -90,6 +103,4 @@ extern int m_admin(aClient *cptr, aClient *sptr, int parc, char *parv[]); extern int m_motd(aClient *cptr, aClient *sptr, int parc, char *parv[]); -extern struct lusers_st nrof; - -#endif /* QUERYCMDS_H */ +#endif /* INCLUDED_querycmds_h */ Index: random.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/random.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- random.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ random.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,10 +1,15 @@ -#ifndef RANDOM_H -#define RANDOM_H +/* + * random.h + * + * $Id: + */ +#ifndef INCLUDED_random_h +#define INCLUDED_random_h -/*============================================================================= +/* * Proto types */ extern unsigned int ircrandom(void); -#endif /* RANDOM_H */ +#endif /* INCLUDED_random_h */ Index: res.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/res.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- res.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ res.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,5 +1,16 @@ -#ifndef RES_H -#define RES_H +/* + * irc2.7.2/ircd/res.h (C)opyright 1992 Darren Reed. + * + * $Id: + */ +#ifndef INCLUDED_res_h +#define INCLUDED_res_h + +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> /* time_t */ +#define INCLUDED_sys_types_h +#endif + #include <netinet/in.h> #include <netdb.h> Index: s_auth.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/s_auth.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- s_auth.h 26 Jul 2002 21:58:23 -0000 1.1.1.1 +++ s_auth.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,5 +1,34 @@ -#ifndef S_AUTH_H -#define S_AUTH_H +/* + * IRC - Internet Relay Chat, include/s_auth.h + * + * 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: + */ +#ifndef INCLUDED_s_auth_h +#define INCLUDED_s_auth_h +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> +#define INCLUDED_sys_types_h +#endif +#ifndef INCLUDED_config_h +//#include "config.h" +#endif + +struct Client; + /*============================================================================= * Proto types Index: s_bsd.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/s_bsd.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- s_bsd.h 26 Jul 2002 21:58:24 -0000 1.1.1.1 +++ s_bsd.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,8 +1,27 @@ -#ifndef S_BSD_H -#define S_BSD_H +/* + * s_bsd.h + * + * $Id: + */ +#ifndef INCLUDED_s_bsd_h +#define INCLUDED_s_bsd_h +#ifndef INCLUDED_config_h +//#include "config.h" +#endif +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> /* size_t, time_t */ +#define INCLUDED_sys_types_h +#endif +struct Client; +struct ConfItem; +struct Listener; +struct DNSReply; + +/* prov */ #include <netdb.h> #include "s_conf.h" + /*============================================================================= * Macro's Index: s_conf.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/s_conf.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- s_conf.h 27 Jul 2002 15:02:47 -0000 1.2 +++ s_conf.h 15 Aug 2002 20:55:23 -0000 1.3 @@ -1,21 +1,44 @@ -#ifndef S_CONF_H -#define S_CONF_H +/* + * s_conf.h + * + * $Id: + */ +#ifndef INCLUDED_s_conf_h +#define INCLUDED_s_conf_h +#ifndef INCLUDED_time_h +#include <time.h> /* struct tm */ +#define INCLUDED_time_h +#endif +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> +#define INCLUDED_sys_types_h +#endif +#ifndef INCLUDED_netinet_in_h +#include <netinet/in.h> /* struct in_addr */ +#define INCLUDED_netinet_in_h +#endif +struct Client; +struct SLink; +struct TRecord; +struct hostent; + +/* Provisional */ #include "list.h" -#include <netinet/in.h> #include <netdb.h> -/*============================================================================= +/* * General defines */ -/*----------------------------------------------------------------------------- - * Macro's +/* + * Macros */ #define CONF_ILLEGAL 0x80000000 #define CONF_MATCH 0x40000000 #define CONF_CLIENT 0x0002 +/* #define CONF_SERVER 0x0004 */ #define CONF_CONNECT_SERVER 0x0004 #define CONF_NOCONNECT_SERVER 0x0008 #define CONF_LOCOP 0x0010 @@ -50,7 +73,7 @@ #define IsIllegal(x) ((x)->status & CONF_ILLEGAL) -/*============================================================================= +/* * Structures */ @@ -62,11 +85,9 @@ char *passwd; char *name; unsigned short int port; - time_t hold; /* Hold action until this time - (calendar time) */ -#ifndef VMSP + time_t hold; /* Hold action until this time (calendar time) */ + int dns_pending; /* a dns request is pending */ struct ConfClass *confClass; /* Class of connection */ -#endif struct ConfItem *next; }; @@ -75,11 +96,11 @@ struct MotdItem *next; }; -struct trecord { +struct TRecord { char *hostmask; struct MotdItem *tmotd; struct tm tmotd_tm; - struct trecord *next; + struct TRecord *next; }; enum AuthorizationCheckResult { @@ -91,43 +112,69 @@ ACR_BAD_SOCKET }; -/*============================================================================= +/* + * GLOBALS + */ +extern struct ConfItem *GlobalConfList; +extern int GlobalConfCount; +extern struct tm motd_tm; +extern struct MotdItem *motd; +extern struct MotdItem *rmotd; +extern struct TRecord *tdata; + +/* * Proto types */ +extern struct ConfItem *attach_confs_byhost(struct Client *cptr, + const char *host, int statmask); +extern struct ConfItem *find_conf_byhost(struct SLink* lp, const char *host, + int statmask); +extern struct ConfItem *find_conf_byname(struct SLink* lp, const char *name, + int statmask); +extern struct ConfItem *conf_find_server(const char *name); +const char *conf_eval_crule(struct ConfItem *conf); -extern aConfItem *find_conf_host(Link *lp, char *host, int statmask); +extern void det_confs_butmask(struct Client *cptr, int mask); +extern int attach_iline(struct Client *cptr); +extern int detach_conf(struct Client *cptr, struct ConfItem *aconf); +//extern int attach_conf(struct Client *cptr, struct ConfItem *aconf); +extern struct ConfItem *find_admin(void); +extern struct ConfItem *find_me(void); +extern struct ConfItem *find_conf_exact(const char *name, + const char *user, + const char *host, int statmask); +extern enum AuthorizationCheckResult conf_check_client(struct Client *cptr); +extern int conf_check_server(struct Client *cptr); +extern struct ConfItem *find_conf_name(const char *name, int statmask); + +/* viejos */ +extern struct ConfItem *find_conf_host(Link *lp, char *host, int statmask); extern void det_confs_butmask(aClient *cptr, int mask); extern enum AuthorizationCheckResult attach_Iline(aClient *cptr, struct hostent *hp, char *sockhost); extern aConfItem *count_cnlines(Link *lp); -extern int detach_conf(aClient *cptr, aConfItem *aconf); extern enum AuthorizationCheckResult attach_conf(aClient *cptr, aConfItem *aconf); -extern aConfItem *find_admin(void); -extern aConfItem *find_me(void); extern aConfItem *attach_confs(aClient *cptr, const char *name, int statmask); extern aConfItem *attach_confs_host(aClient *cptr, char *host, int statmask); -extern aConfItem *find_conf_exact(char *name, char *user, char *host, - int statmask); extern aConfItem *find_conf(Link *lp, const char *name, int statmask); extern aConfItem *find_conf_ip(Link *lp, char *ip, char *user, int statmask); -extern int rehash(aClient *cptr, int sig); +extern struct ConfItem* find_conf_name(const char* name, int statmask); +/* Viejos */ + +extern int rehash(struct Client *cptr, int sig); extern int initconf(int opt); extern void read_tlines(void); -extern int find_kill(aClient *cptr); -extern int find_restrict(aClient *cptr); -extern int m_killcomment(aClient *sptr, char *parv, char *filename); -extern aMotdItem *read_motd(char *motdfile); +extern int find_kill(struct Client *cptr); +extern int find_restrict(struct Client *cptr); +extern int m_killcomment(struct Client *sptr, char *parv, char *filename); +extern struct MotdItem *read_motd(const char* motdfile); -extern aConfItem *conf; +/* MIRAR */ #ifdef ESNET_NEG extern aConfItem *conf_negociacion; #endif extern aGline *gline; extern aGline *badchan; -extern struct tm motd_tm; -extern aMotdItem *motd; -extern aMotdItem *rmotd; -extern atrecord *tdata; -#endif /* S_CONF_H */ +#endif /* INCLUDED_s_conf_h */ Index: s_debug.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/s_debug.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- s_debug.h 26 Jul 2002 21:58:24 -0000 1.1.1.1 +++ s_debug.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,15 +1,30 @@ -#ifndef S_DEBUG_H -#define S_DEBUG_H - +/* + * s_debug.h + * + * $Id: + */ +#ifndef INCLUDED_s_debug_h +#define INCLUDED_s_debug_h +#ifndef INCLUDED_config_h +//#include "config.h" +#endif +#ifndef INCLUDED_ircd_defs_h +#include "ircd_defs.h" /* Needed for HOSTLEN */ +#endif +#ifndef INCLUDED_stdarg_h #include <stdarg.h> -#ifdef MSGLOG_ENABLED -#include "struct.h" /* Needed for HOSTLEN */ +#define INCLUDED_stdarg_h #endif +struct Client; + +#include "struct.h" /* Needed for HOSTLEN */ +//#endif + #ifdef DEBUGMODE -/*============================================================================= - * Macro's +/* + * Macros */ #define Debug(x) debug x @@ -19,26 +34,24 @@ * defined debugging levels */ #define DEBUG_FATAL 0 -#define DEBUG_ERROR 1 /* report_error() and other - errors that are found */ +#define DEBUG_ERROR 1 /* report_error() and other errors that are found */ #define DEBUG_NOTICE 3 #define DEBUG_DNS 4 /* used by all DNS related routines - a *lot* */ #define DEBUG_INFO 5 /* general usful info */ #define DEBUG_NUM 6 /* numerics */ #define DEBUG_SEND 7 /* everything that is sent out */ -#define DEBUG_DEBUG 8 /* anything to do with debugging, - ie unimportant :) */ +#define DEBUG_DEBUG 8 /* everything that is received */ #define DEBUG_MALLOC 9 /* malloc/free calls */ #define DEBUG_LIST 10 /* debug list use */ -/*============================================================================= +/* * proto types */ extern void vdebug(int level, const char *form, va_list vl); extern void debug(int level, const char *form, ...) __attribute__ ((format(printf, 2, 3))); -extern void send_usage(aClient *cptr, char *nick); +extern void send_usage(struct Client *cptr, char *nick); #else /* !DEBUGMODE */ @@ -47,7 +60,8 @@ #endif /* !DEBUGMODE */ -extern void count_memory(aClient *cptr, char *nick); +extern void open_debugfile(void); +extern void count_memory(struct Client *cptr, char *nick); extern char serveropts[]; /*============================================================================= Index: s_misc.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/s_misc.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- s_misc.h 26 Jul 2002 21:58:24 -0000 1.1.1.1 +++ s_misc.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,12 +1,25 @@ -#ifndef S_MISC_H -#define S_MISC_H - -/*============================================================================= - * General defines +/* + * s_misc.h + * + * $Id: */ +#ifndef INCLUDED_s_misc_h +#define INCLUDED_s_misc_h +#ifndef INCLUDED_stdarg_h +#include <stdarg.h> /* va_list */ +#define INCLUDED_stdarg_h +#endif +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> /* time_t */ +#define INCLUDED_sys_types_h +#endif -/*----------------------------------------------------------------------------- - * Macro's + +struct Client; +struct ConfItem; + +/* + * Macros */ #define CPTR_KILLED -2 @@ -15,7 +28,7 @@ * Structures */ -struct stats { +struct ServerStatistics { unsigned int is_cl; /* number of client connections */ unsigned int is_sv; /* number of server connections */ unsigned int is_ni; /* connection but no idea who it was */ @@ -40,35 +53,45 @@ unsigned int is_fake; /* MODE 'fakes' */ unsigned int is_asuc; /* successful auth requests */ unsigned int is_abad; /* bad auth requests */ - unsigned int is_udp; /* packets recv'd on udp port */ unsigned int is_loc; /* local connections made */ + unsigned int uping_recv; /* UDP Pings received */ +unsigned int is_udp; /* PROVISIONAL */ }; -/*============================================================================= - * Proto types +/* + * Prototypes */ -extern int check_registered(aClient *sptr); -extern int check_registered_user(aClient *sptr); -extern int exit_client(aClient *cptr, aClient *bcptr, - aClient *sptr, char *comment); +extern int check_registered(struct Client *sptr); +extern int check_registered_user(struct Client *sptr); +extern int exit_client(struct Client *cptr, struct Client *bcptr, + struct Client *sptr, const char *comment); extern char *myctime(time_t value); + +/* OBSOLETO */ extern char *get_client_name(aClient *sptr, int showip); #if defined(BDD) && defined(BDD_VIP) extern char *get_visible_name(aClient *acptr, aClient *sptr); #endif extern int exit_client_msg(aClient *cptr, aClient *bcptr, - aClient *sptr, char *pattern, ...) __attribute__ ((format(printf, 4, 5))); + aClient *sptr, const char *pattern, ...) __attribute__ ((format(printf, 4, 5))); +/* de momento no +extern int exit_client_msg(struct Client *cptr, struct Client *bcptr, + struct Client *sptr, const char *pattern, ...); +**/ + extern void initstats(void); extern char *date(time_t clock); -extern char *get_client_host(aClient *cptr); -extern void get_sockhost(aClient *cptr, char *host); +extern char *get_client_host(struct Client *cptr); +extern void get_sockhost(struct Client *cptr, char *host); +/* Borrar */ extern char *my_name_for_link(char *name, aConfItem *aconf); -extern int vexit_client_msg(aClient *cptr, aClient *bcptr, - aClient *sptr, char *pattern, va_list vl); +extern int vexit_client_msg(struct Client *cptr, struct Client *bcptr, + struct Client *sptr, const char *pattern, va_list vl); +/* borrar */ extern void checklist(void); extern void tstats(aClient *cptr, char *name); -extern struct stats *ircstp; +extern struct ServerStatistics *ServerStats; -#endif /* S_MISC_H */ +#endif /* INCLUDED_s_misc_h */ Index: s_numeric.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/s_numeric.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- s_numeric.h 26 Jul 2002 21:58:24 -0000 1.1.1.1 +++ s_numeric.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,11 +1,18 @@ -#ifndef S_NUMERIC_H -#define S_NUMERIC_H +/* + * s_numeric.h + * + * $Id: + */ +#ifndef INCLUDED_s_numeric_h +#define INCLUDED_s_numeric_h -/*============================================================================= - * Proto types +struct Client; + +/* + * Prototypes */ -extern int do_numeric(int numeric, int nnn, aClient *cptr, aClient *sptr, +extern int do_numeric(int numeric, int nnn, struct Client *cptr, struct Client *sptr, int parc, char *parv[]); -#endif /* S_NUMERIC_H */ +#endif /* INCLUDED_s_numeric_h */ Index: s_serv.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/s_serv.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- s_serv.h 26 Jul 2002 21:58:24 -0000 1.1.1.1 +++ s_serv.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,15 +1,38 @@ -#ifndef S_SERV_H -#define S_SERV_H +/* + * s_serv.h + * + * $Id: + */ +#ifndef INCLUDED_s_serv_h +#define INCLUDED_s_serv_h +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> +#define INCLUDED_sys_types_h +#endif +struct ConfItem; +struct Client; + +/* Borrar cuando sea necesario */ #include "struct.h" -/*============================================================================= - * General defines +/* + * Prototypes */ +/* +extern int exit_new_server(struct Client *cptr, struct Client *sptr, + char *host, time_t timestamp, char *fmt, ...); +*/ +extern int exit_new_server(struct Client *cptr, struct Client *sptr, + char *host, time_t timestamp, char *fmt, ...) + __attribute__ ((format(printf, 5, 6))); + +extern int a_kills_b_too(struct Client *a, struct Client *b); +extern int server_estab(struct Client *cptr, struct ConfItem *aconf); + + +// #endif /* INCLUDED_s_serv_h */ -/*----------------------------------------------------------------------------- - * Macro's - */ #ifdef CHECK_TS_LINKS #define CHECK_TS_MAX_LINKS 30 /* 30 segundos de desfase maximo Index: s_user.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/s_user.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- s_user.h 26 Jul 2002 21:58:24 -0000 1.1.1.1 +++ s_user.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,8 +1,20 @@ -#ifndef S_USER_H -#define S_USER_H +/* + * s_user.h + * + * $Id: + */ +#ifndef INCLUDED_s_user_h +#define INCLUDED_s_user_h +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> +#define INCLUDED_sys_types_h +#endif -/*============================================================================= - * Macro's +struct Client; +struct User; + +/* + * Macros */ /* @@ -31,8 +43,14 @@ #define MATCH_SERVER 1 #define MATCH_HOST 2 -/*============================================================================= - * Proto types +#define COOKIE_VERIFIED 0xffffffff + +extern struct SLink *opsarray[]; + +typedef char* (*InfoFormatter)(struct Client* who, char* buf); + +/* + * Prototypes */ extern int m_umode(aClient *cptr, aClient *sptr, int parc, char *parv[]); Index: send.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/send.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- send.h 26 Jul 2002 21:58:24 -0000 1.1.1.1 +++ send.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,15 +1,27 @@ -#ifndef SEND_H -#define SEND_H +/* + * send.h + * + * $Id: + */ +#ifndef INCLUDED_send_h +#define INCLUDED_send_h +#ifndef INCLUDED_stdarg_h +#include <stdarg.h> /* va_list */ +#define INCLUDED_stdarg_h +#endif -/*============================================================================= - * Macros +struct Channel; +struct Client; +struct DBuf; + + +/* + * Prototypes */ +/* Borrar en cuando sea necesario */ #define LastDeadComment(cptr) ((cptr)->info) -/*============================================================================= - * Proto types - */ extern void sendto_one(aClient *to, char *pattern, ...) __attribute__ ((format(printf, 2, 3))); Index: struct.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/struct.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- struct.h 6 Aug 2002 18:45:19 -0000 1.2 +++ struct.h 15 Aug 2002 20:55:23 -0000 1.3 @@ -34,17 +34,6 @@ * General defines */ -#define NICKLEN 9 -#define USERLEN 10 -#define HOSTLEN 63 -#define REALLEN 50 -#define PASSWDLEN 20 -#define AWAYLEN 160 /* Hispano extension */ -#define QUITLEN 250 /* Hispano extension */ -#define BUFSIZE 512 /* WARNING: *DONT* CHANGE THIS!!!! */ -#define MAXTARGETS 20 -#define STARTTARGETS 10 -#define RESERVEDTARGETS 12 #define MAXLEN 490 /*----------------------------------------------------------------------------- @@ -155,8 +144,8 @@ struct Server { struct Server *nexts; struct Client *up; /* Server one closer to me */ - struct DSlink *down; /* List with downlink servers */ - struct DSlink *updown; /* own Dlink in up->serv->down struct */ + struct DLink *down; /* List with downlink servers */ + struct DLink *updown; /* own Dlink in up->serv->down struct */ aClient **client_list; /* List with client pointers on this server */ struct User *user; /* who activated this connection */ struct ConfItem *nline; /* N-line pointer for this server */ @@ -187,10 +176,8 @@ struct SLink *channel; /* chain of channel pointer blocks */ struct SLink *invited; /* chain of invite pointer blocks */ struct SLink *silence; /* chain of silence pointer blocks */ -#ifdef WATCH struct SLink *watch; /* Cadena de punteros a lista aWatch */ int cwatch; /* Contador de entradas de lista WATCH */ -#endif /* WATCH */ char *away; /* pointer to away message */ time_t last; unsigned int refcnt; /* Number of times this block is referenced */ Index: support.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/support.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- support.h 26 Jul 2002 21:58:24 -0000 1.1.1.1 +++ support.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,5 +1,24 @@ -#ifndef SUPPORT_H -#define SUPPORT_H +/* + * support.h + * + * $Id: + */ +#ifndef INCLUDED_support_h +#define INCLUDED_support_h +#ifndef INCLUDED_config_h +//#include "config.h" +#define INCLUDED_config_h +#endif +#if 0 +#ifndef INCLUDED_sys_types_h +#include <sys/types.h> /* broken BSD system headers */ +#define INCLUDED_sys_types_h +#endif +#endif /* 0 */ + +/* + * Prototypes + */ #include <netinet/in.h> Index: sys.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/sys.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- sys.h 26 Jul 2002 21:58:24 -0000 1.1.1.1 +++ sys.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -15,13 +15,19 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: */ +#ifndef INCLUDED_sys_h +#define INCLUDED_sys_h +#ifndef INCLUDED_config_h +//#include "config.h" +#endif -#ifndef __sys_include__ -#define __sys_include__ - +/* BORRAR CUANDO SEA NECESARIO */ #include "../config/config.h" #include "../config/setup.h" +#include "ircd_defs.h" #ifdef __osf__ #define _OSF_SOURCE @@ -34,6 +40,7 @@ #define SUNOS4 #endif #endif +/* AQUI ACABA */ #if WORDS_BIGENDIAN # define BIT_ZERO_ON_LEFT @@ -317,4 +324,4 @@ #endif #endif /* !HAVE_SYS_CDEFS_H */ -#endif /* __sys_include__ */ +#endif /* INCLUDED_sys_h */ Index: userload.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/userload.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- userload.h 26 Jul 2002 21:58:24 -0000 1.1.1.1 +++ userload.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -19,12 +19,15 @@ * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id: */ +#ifndef INCLUDED_userload_h +#define INCLUDED_userload_h -#ifndef USERLOAD_H -#define USERLOAD_H +struct Client; -/*============================================================================= +/* * Structures */ @@ -34,14 +37,15 @@ unsigned int conn_count; }; -/*============================================================================= +/* * Proto types */ extern void update_load(void); -extern void calc_load(aClient *sptr); +extern void calc_load(struct Client *sptr); extern void initload(void); extern struct current_load_st current_load; -#endif /* USERLOAD_H */ +#endif /* INCLUDED_userload_h */ + Index: version.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/version.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- version.h 26 Jul 2002 21:58:24 -0000 1.1.1.1 +++ version.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,9 +1,14 @@ -#ifndef VERSION_H -#define VERSION_H +/* + * version.h + * + * $Id: + */ +#ifndef INCLUDED_version_h +#define INCLUDED_version_h extern const char *version; extern const char *creation; extern const char *infotext[]; extern const char *generation; -#endif /* VERSION_H */ +#endif /* INCLUDED_version_h */ Index: whocmds.h =================================================================== RCS file: /cvsroot/irc-dev/ircdh/include/whocmds.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- whocmds.h 26 Jul 2002 21:58:24 -0000 1.1.1.1 +++ whocmds.h 15 Aug 2002 20:55:23 -0000 1.2 @@ -1,15 +1,99 @@ -#ifndef WHOCMDS_H -#define WHOCMDS_H +/* + * whocmds.h + * + * $Id: + */ +#ifndef INCLUDED_whocmds_h +#define INCLUDED_whocmds_h +#ifndef INCLUDED_config_h +//#include "config.h" +#endif -/*============================================================================= - * Macro's +struct Client; +struct Channel; + +/* + * m_who() + * m_who with support routines rewritten by Nemesi, August 1997 + * - Alghoritm have been flattened (no more recursive) + * - Several bug fixes + * - Strong performance improvement + * - Added possibility to have specific fields in the output + * See readme.who for further details. */ -/*============================================================================= - * Proto types +/* Macros used only in here by m_who and its support functions */ + +#define WHOSELECT_OPER 1 +#define WHOSELECT_EXTRA 2 + +#define WHO_FIELD_QTY 1 +#define WHO_FIELD_CHA 2 +#define WHO_FIELD_UID 4 +#define WHO_FIELD_NIP 8 +#define WHO_FIELD_HOS 16 +#define WHO_FIELD_SER 32 +#define WHO_FIELD_NIC 64 +#define WHO_FIELD_FLA 128 +#define WHO_FIELD_DIS 256 +#define WHO_FIELD_REN 512 + +#define WHO_FIELD_DEF ( WHO_FIELD_NIC | WHO_FIELD_UID | WHO_FIELD_HOS | WHO_FIELD_SER ) + +#define IS_VISIBLE_USER(s,ac) ((s==ac) || (!IsInvisible(ac))) + +#if defined(SHOW_INVISIBLE_LUSERS) || defined(SHOW_ALL_INVISIBLE_USERS) +#if defined(BDD) && defined(WHOX_HELPERS) +#define SEE_LUSER(s, ac, b) (IS_VISIBLE_USER(s, ac) || ((b & WHOSELECT_EXTRA) && MyConnect(ac) && (IsAnOper(s)||IsHelpOp(s)))) +#else +#define SEE_LUSER(s, ac, b) (IS_VISIBLE_USER(s, ac) || ((b & WHOSELECT_EXTRA) && MyConnect(ac) && IsAnOper(s))) +#endif /* WHOX_HELPERS */ +#else +#define SEE_LUSER(s, ac, b) (IS_VISIBLE_USER(s, ac)) +#endif + +#ifdef SHOW_ALL_INVISIBLE_USERS +#if defined(BDD) && defined(WHOX_HELPERS) +#define SEE_USER(s, ac, b) (SEE_LUSER(s, ac, b) || ((b & WHOSELECT_EXTRA) && (IsOper(s)||IsHelpOp(s)))) +#else +#define SEE_USER(s, ac, b) (SEE_LUSER(s, ac, b) || ((b & WHOSELECT_EXTRA) && IsOper(s))) +#endif /* WHOX_HELPERS */ +#else +#define SEE_USER(s, ac, b) (SEE_LUSER(s, ac, b)) +#endif + +#ifdef UNLIMIT_OPER_QUERY +#if defined(BDD) +#define SHOW_MORE(sptr, counter) (IsAnOper(sptr) || IsHelpOp(sptr) || (!(counter-- < 0)) ) +#else +#define SHOW_MORE(sptr, counter) (IsAnOper(sptr) || (!(counter-- < 0)) ) +#endif /* Helper */ +#else +#define SHOW_MORE(sptr, counter) (!(counter-- < 0)) +#endif + +#ifdef OPERS_SEE_IN_S... [truncated message content] |