diff -uNrd ircd-ratbox-1.2-3+ipmask/include/client.h ircd-ratbox-1.2-3/include/client.h
--- ircd-ratbox-1.2-3+ipmask/include/client.h	Thu Nov 27 09:18:27 2003
+++ ircd-ratbox-1.2-3/include/client.h	Tue Aug  5 15:07:08 2003
@@ -150,7 +150,6 @@
 	 * considered a read-only field after the client has registered.
 	 */
 	char host[HOSTLEN + 1];	/* client's hostname */
-	char rhost[HOSTLEN + 1];
 	/*
 	 * client->info for unix clients will normally contain the info from the 
 	 * gcos field in /etc/passwd but anything can go here.
@@ -383,8 +382,6 @@
 #define UMODE_OPER         0x20000	/* Operator */
 #define UMODE_ADMIN        0x40000	/* Admin on server */
 
-#define UMODE_IPMASK	   0x80000
-
 #define UMODE_ALL	   UMODE_SERVNOTICE
 
 
@@ -421,7 +418,7 @@
 #define FLAGS2_EXEMPTSPAMBOT	0x1000000
 
 #define SEND_UMODES  (UMODE_INVISIBLE | UMODE_OPER | UMODE_WALLOP | \
-                      UMODE_ADMIN | UMODE_IPMASK)
+                      UMODE_ADMIN)
 #define ALL_UMODES   (SEND_UMODES | UMODE_SERVNOTICE | UMODE_CCONN | \
                       UMODE_REJ | UMODE_SKILL | UMODE_FULL | UMODE_SPY | \
                       UMODE_NCHANGE | UMODE_OPERWALL | UMODE_DEBUG | \
@@ -500,8 +497,6 @@
 
 #define SetGotId(x)             ((x)->flags |= FLAGS_GOTID)
 #define IsGotId(x)              (((x)->flags & FLAGS_GOTID) != 0)
-
-#define IsMasked(x)				((x)->umodes & UMODE_IPMASK)
 
 /*
  * flags2 macros.
diff -uNrd ircd-ratbox-1.2-3+ipmask/include/client.h.orig ircd-ratbox-1.2-3/include/client.h.orig
--- ircd-ratbox-1.2-3+ipmask/include/client.h.orig	Tue Aug  5 15:07:08 2003
+++ ircd-ratbox-1.2-3/include/client.h.orig	Wed Dec 31 17:00:00 1969
@@ -1,592 +0,0 @@
-/*
- *  ircd-ratbox: A slightly useful ircd.
- *  client.h: The ircd client header.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002 ircd-ratbox development team
- *
- *  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: client.h,v 7.206.2.3 2003/08/05 22:07:08 androsyn Exp $
- */
-
-#ifndef INCLUDED_client_h
-#define INCLUDED_client_h
-
-#include "config.h"
-
-#if !defined(CONFIG_RATBOX_LEVEL_1)
-#error Incorrect config.h for this revision of ircd.
-#endif
-
-#include "ircd_defs.h"
-#include "ircd_handler.h"
-#include "linebuf.h"
-#include "channel.h"
-#include "res.h"
-#ifdef IPV6
-#define HOSTIPLEN	53	/* sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255.ipv6") */
-#else
-#define HOSTIPLEN       16	/* Length of dotted quad form of IP        */
-#endif
-#define PASSWDLEN       20
-#define CIPHERKEYLEN    64	/* 512bit */
-
-#define IDLEN           12	/* this is the maximum length, not the actual
-				   generated length; DO NOT CHANGE! */
-#define COOKIELEN       IDLEN
-
-#define CLIENT_BUFSIZE 512	/* must be at least 512 bytes */
-
-/*
- * pre declare structs
- */
-struct ConfItem;
-struct Whowas;
-struct DNSReply;
-struct Listener;
-struct Client;
-struct LocalUser;
-struct AuthRequest;
-/*
- * Client structures
- */
-struct User
-{
-	dlink_list channel;	/* chain of channel pointer blocks */
-	dlink_list invited;	/* chain of invite pointer blocks */
-	char *away;		/* pointer to away message */
-	time_t last_away;	/* Away since... */
-	time_t last;
-	int refcnt;		/* Number of times this block is referenced */
-	const char *server;	/* pointer to scached server name */
-	char *response;		/* expected response from client */
-	char *auth_oper;	/* Operator to become if they supply the response. */
-	char id[IDLEN + 1];	/* client ID, unique ID per client */
-};
-
-struct Server
-{
-	struct User *user;	/* who activated this connection */
-	const char *up;		/* Pointer to scache name */
-	char by[NICKLEN];
-	struct ConfItem *sconf;	/* connect{} pointer for this server */
-	dlink_list servers;
-	dlink_list users;
-};
-
-struct SlinkRpl
-{
-	int command;
-	int datalen;
-	int gotdatalen;
-	int readdata;
-	unsigned char *data;
-};
-
-struct ZipStats
-{
-	unsigned long in;
-	unsigned long in_wire;
-	unsigned long out;
-	unsigned long out_wire;
-	double in_ratio;
-	double out_ratio;
-};
-
-struct Client
-{
-	dlink_node node;
-	dlink_node lnode;
-
-	struct User *user;	/* ...defined, if this is a User */
-	struct Server *serv;	/* ...defined, if this is a server */
-	struct Client *servptr;	/* Points to server this Client is on */
-	struct Client *from;	/* == self, if Local Client, *NEVER* NULL! */
-
-	struct Whowas *whowas;	/* Pointers to whowas structs */
-	time_t lasttime;	/* ...should be only LOCAL clients? --msa */
-	time_t firsttime;	/* time client was created */
-	time_t since;		/* last time we parsed something */
-	time_t tsinfo;		/* TS on the nick, SVINFO on server */
-	unsigned int umodes;	/* opers, normal users subset */
-	unsigned int flags;	/* client flags */
-	unsigned int flags2;	/* ugh. overflow */
-
-	int hopcount;		/* number of servers to this 0 = local */
-	unsigned short status;	/* Client type */
-	unsigned char handler;	/* Handler index */
-	unsigned long serial;	/* used to enforce 1 send per nick */
-
-	/* client->name is the unique name for a client nick or host */
-	char name[HOSTLEN + 1];
-
-	/* 
-	 * client->username is the username from ident or the USER message, 
-	 * If the client is idented the USER message is ignored, otherwise 
-	 * the username part of the USER message is put here prefixed with a 
-	 * tilde depending on the I:line, Once a client has registered, this
-	 * field should be considered read-only.
-	 */
-	char username[USERLEN + 1];	/* client's username */
-	/*
-	 * client->host contains the resolved name or ip address
-	 * as a string for the user, it may be fiddled with for oper spoofing etc.
-	 * once it's changed the *real* address goes away. This should be
-	 * considered a read-only field after the client has registered.
-	 */
-	char host[HOSTLEN + 1];	/* client's hostname */
-	/*
-	 * client->info for unix clients will normally contain the info from the 
-	 * gcos field in /etc/passwd but anything can go here.
-	 */
-	char info[REALLEN + 1];	/* Free form additional client info */
-
-	/* caller ID allow list */
-	/* This has to be here, since a client on an on_allow_list could
-	 * be a remote client. simpler to keep both here.
-	 */
-	dlink_list allow_list;	/* clients I'll allow to talk to me */
-	dlink_list on_allow_list;	/* clients that have =me= on their allow list */
-
-	struct LocalUser *localClient;
-};
-
-struct LocalUser
-{
-	dlink_node tnode;
-	/*
-	 * The following fields are allocated only for local clients
-	 * (directly connected to *this* server with a socket.
-	 */
-	/* Anti flooding part, all because of lamers... */
-	time_t last_join_time;	/* when this client last 
-				   joined a channel */
-	time_t last_leave_time;	/* when this client last 
-				 * left a channel */
-	int join_leave_count;	/* count of JOIN/LEAVE in less than 
-				   MIN_JOIN_LEAVE_TIME seconds */
-	int oper_warn_count_down;	/* warn opers of this possible 
-					   spambot every time this gets to 0 */
-	time_t last_caller_id_time;
-	time_t first_received_message_time;
-	int received_number_of_privmsgs;
-	int flood_noticed;
-
-	/* Send and receive linebuf queues .. */
-	buf_head_t buf_sendq;
-	buf_head_t buf_recvq;
-	/*
-	 * we want to use unsigned int here so the sizes have a better chance of
-	 * staying the same on 64 bit machines. The current trend is to use
-	 * I32LP64, (32 bit ints, 64 bit longs and pointers) and since ircd
-	 * will NEVER run on an operating system where ints are less than 32 bits, 
-	 * it's a relatively safe bet to use ints. Since right shift operations are
-	 * performed on these, it's not safe to allow them to become negative, 
-	 * which is possible for long running server connections. Unsigned values 
-	 * generally overflow gracefully. --Bleep
-	 */
-	unsigned int sendM;	/* Statistics: protocol messages send */
-	unsigned int sendK;	/* Statistics: total k-bytes send */
-	unsigned int receiveM;	/* Statistics: protocol messages received */
-	unsigned int receiveK;	/* Statistics: total k-bytes received */
-	unsigned short sendB;	/* counters to count upto 1-k lots of bytes */
-	unsigned short receiveB;	/* sent and received. */
-	unsigned int lastrecvM;	/* to check for activity --Mika */
-	int priority;
-	struct Listener *listener;	/* listener accepted from */
-	dlink_list confs;	/* Configuration record associated */
-
-	struct irc_inaddr ip;
-	unsigned short port;	/* and the remote port# too :-) */
-	int aftype;		/* Makes life easier for DNS res in IPV6 */
-	unsigned long serverMask;	/* Only used for Lazy Links */
-	time_t last_nick_change;
-	int number_of_nick_changes;
-	/*
-	 * client->sockhost contains the ip address gotten from the socket as a
-	 * string, this field should be considered read-only once the connection
-	 * has been made. (set in s_bsd.c only)
-	 */
-	char sockhost[HOSTIPLEN + 1];	/* This is the host name from the 
-					   socket ip address as string */
-	/*
-	 * XXX - there is no reason to save this, it should be checked when it's
-	 * received and not stored, this is not used after registration
-	 */
-	char passwd[PASSWDLEN + 1];
-	int caps;		/* capabilities bit-field */
-	int enc_caps;		/* cipher capabilities bit-field */
-
-#ifdef HAVE_LIBCRYPTO
-	struct EncCapability *in_cipher;
-	struct EncCapability *out_cipher;
-
-	char in_key[CIPHERKEYLEN];
-	char out_key[CIPHERKEYLEN];
-#endif
-
-	int fd;			/* >= 0, for local clients */
-#ifndef HAVE_SOCKETPAIR
-	int fd_r;		/* fd for reading */
-#endif
-
-	int ctrlfd;		/* For servers:
-				   control fd used for sending commands
-				   to servlink */
-#ifndef HAVE_SOCKETPAIR
-	int ctrlfd_r;		/* control fd for reading */
-#endif
-
-	struct SlinkRpl slinkrpl;	/* slink reply being parsed */
-	unsigned char *slinkq;	/* sendq for control data */
-	int slinkq_ofs;		/* ofset into slinkq */
-	int slinkq_len;		/* length remaining after slinkq_ofs */
-
-	struct ZipStats zipstats;
-
-	/*
-	 * Anti-flood stuff. We track how many messages were parsed and how
-	 * many we were allowed in the current second, and apply a simple decay
-	 * to avoid flooding.
-	 *   -- adrian
-	 */
-	int allow_read;		/* how many we're allowed to read in this second */
-	int actually_read;	/* how many we've actually read in this second */
-	int sent_parsed;	/* how many messages we've parsed in this second */
-	time_t last_knock;	/* time of last knock */
-	unsigned long random_ping;
-	struct AuthRequest *auth_request;
-};
-
-/*
- * status macros.
- */
-#define STAT_CONNECTING         0x01
-#define STAT_HANDSHAKE          0x02
-#define STAT_ME                 0x04
-#define STAT_UNKNOWN            0x08
-#define STAT_SERVER             0x10
-#define STAT_CLIENT             0x20
-
-#define HasID(x) (!IsServer(x) && (x)->user && (x)->user->id[0] != '\0')
-#define ID(source_p) (HasID(source_p) ? source_p->user->id : source_p->name)
-
-#define ID_or_name(x,client_p) (IsCapable(client_p,CAP_UID)?(x)->user->id:(x)->name)
-
-#define IsRegisteredUser(x)     ((x)->status == STAT_CLIENT)
-#define IsRegistered(x)         ((x)->status  > STAT_UNKNOWN)
-#define IsConnecting(x)         ((x)->status == STAT_CONNECTING)
-#define IsHandshake(x)          ((x)->status == STAT_HANDSHAKE)
-#define IsMe(x)                 ((x)->status == STAT_ME)
-#define IsUnknown(x)            ((x)->status == STAT_UNKNOWN)
-#define IsServer(x)             ((x)->status == STAT_SERVER)
-#define IsClient(x)             ((x)->status == STAT_CLIENT)
-#define IsAnyServer(x)          (IsServer(x) || IsHandshake(x) || IsConnecting(x))
-
-#define IsOper(x)		((x)->umodes & UMODE_OPER)
-#define IsAdmin(x)		((x)->umodes & UMODE_ADMIN)
-
-#define SetConnecting(x)        {(x)->status = STAT_CONNECTING; \
-				 (x)->handler = UNREGISTERED_HANDLER; }
-
-#define SetHandshake(x)         {(x)->status = STAT_HANDSHAKE; \
-				 (x)->handler = UNREGISTERED_HANDLER; }
-
-#define SetMe(x)                {(x)->status = STAT_ME; \
-				 (x)->handler = UNREGISTERED_HANDLER; }
-
-#define SetUnknown(x)           {(x)->status = STAT_UNKNOWN; \
-				 (x)->handler = UNREGISTERED_HANDLER; }
-
-#define SetServer(x)            {(x)->status = STAT_SERVER; \
-				 (x)->handler = SERVER_HANDLER; }
-
-#define SetClient(x)            {(x)->status = STAT_CLIENT; \
-				 (x)->handler = IsOper((x)) ? \
-					OPER_HANDLER : CLIENT_HANDLER; }
-
-#define STAT_CLIENT_PARSE (STAT_UNKNOWN | STAT_CLIENT)
-#define STAT_SERVER_PARSE (STAT_CONNECTING | STAT_HANDSHAKE | STAT_SERVER)
-
-#define PARSE_AS_CLIENT(x)      ((x)->status & STAT_CLIENT_PARSE)
-#define PARSE_AS_SERVER(x)      ((x)->status & STAT_SERVER_PARSE)
-
-
-/*
- * ts stuff
- */
-#define TS_CURRENT      5	/* current TS protocol version */
-#ifdef TS5_ONLY
-#define TS_MIN          5
-#else
-#define TS_MIN          3	/* minimum supported TS protocol version */
-#endif
-#define TS_DOESTS       0x20000000
-#define DoesTS(x)       ((x)->tsinfo == TS_DOESTS)
-
-
-/* housekeeping flags */
-
-#define FLAGS_PINGSENT     0x0001	/* Unreplied ping sent */
-#define FLAGS_DEADSOCKET   0x0002	/* Local socket is dead--Exiting soon */
-#define FLAGS_KILLED       0x0004	/* Prevents "QUIT" from being sent for this */
-#define FLAGS_CLOSING      0x0020	/* set when closing to suppress errors */
-#define FLAGS_CHKACCESS    0x0040	/* ok to check clients access if set */
-#define FLAGS_GOTID        0x0080	/* successful ident lookup achieved */
-#define FLAGS_NEEDID       0x0100	/* I-lines say must use ident return */
-#define FLAGS_NORMALEX     0x0400	/* Client exited normally */
-#define FLAGS_SENDQEX      0x0800	/* Sendq exceeded */
-#define FLAGS_CRYPTIN      0x2000	/* incoming data must be decrypted */
-#define FLAGS_CRYPTOUT     0x4000	/* outgoing data must be encrypted */
-#define FLAGS_WAITAUTH     0x8000	/* waiting for CRYPTLINK AUTH command */
-#define FLAGS_SERVLINK     0x10000	/* servlink has servlink process */
-#define FLAGS_MARK	   0x20000	/* marked client */
-#define FLAGS_HIDDEN       0x40000	/* hidden server */
-#define FLAGS_EOB          0x80000	/* EOB */
-/* umodes, settable flags */
-
-#define UMODE_SERVNOTICE   0x0001	/* server notices such as kill */
-#define UMODE_CCONN        0x0002	/* Client Connections */
-#define UMODE_REJ          0x0004	/* Bot Rejections */
-#define UMODE_SKILL        0x0008	/* Server Killed */
-#define UMODE_FULL         0x0010	/* Full messages */
-#define UMODE_SPY          0x0020	/* see STATS / LINKS */
-#define UMODE_DEBUG        0x0040	/* 'debugging' info */
-#define UMODE_NCHANGE      0x0080	/* Nick change notice */
-#define UMODE_WALLOP       0x0100	/* send wallops to them */
-#define UMODE_OPERWALL     0x0200	/* Operwalls */
-#define UMODE_INVISIBLE    0x0400	/* makes user invisible */
-#define UMODE_BOTS         0x0800	/* shows bots */
-#define UMODE_EXTERNAL     0x1000	/* show servers introduced and splitting */
-#define UMODE_CALLERID     0x2000	/* block unless caller id's */
-#define UMODE_UNAUTH       0x4000	/* show unauth connects here */
-#define UMODE_LOCOPS       0x8000	/* show locops */
-#define UMODE_OPERSPY      0x10000	/* show operspy notices */
-
-/* user information flags, only settable by remote mode or local oper */
-#define UMODE_OPER         0x20000	/* Operator */
-#define UMODE_ADMIN        0x40000	/* Admin on server */
-
-#define UMODE_ALL	   UMODE_SERVNOTICE
-
-
-/* overflow flags */
-#define OPER_GLOBAL_KILL        0x000001
-#define OPER_REMOTE             0x000002
-#define OPER_UNKLINE            0x000004
-#define OPER_GLINE              0x000008
-#define OPER_N                  0x000010
-#define OPER_K                  0x000020
-#define OPER_DIE                0x000040
-#define OPER_REHASH             0x000080
-#define OPER_ADMIN              0x000100
-#define OPER_XLINE              0x000200
-#define OPER_SPY                0x000400
-/*				0x000800 */
-#define OPER_RESV		0x001000 /* XXX - only here for shared {}; */
-#define OPER_OPERWALL		0x002000
-#define OPER_HIDDENADMIN        0x004000
-#define OPER_FLAGS      (OPER_GLOBAL_KILL | OPER_REMOTE | OPER_UNKLINE |\
-                         OPER_GLINE | OPER_N | OPER_K | OPER_DIE |\
-                         OPER_REHASH | OPER_ADMIN | OPER_XLINE | OPER_OPERWALL|\
-                         OPER_SPY | OPER_HIDDENADMIN)
-
-#define FLAGS2_EXEMPTGLINE      0x008000
-#define FLAGS2_EXEMPTKLINE      0x010000
-#define FLAGS2_EXEMPTFLOOD      0x020000
-#define FLAGS2_NOLIMIT          0x040000
-#define FLAGS2_IDLE_LINED       0x080000
-#define FLAGS2_RESTRICTED       0x100000
-#define FLAGS2_PING_COOKIE      0x200000
-#define FLAGS2_IP_SPOOFING      0x400000
-#define FLAGS2_FLOODDONE        0x800000
-#define FLAGS2_EXEMPTSPAMBOT	0x1000000
-
-#define SEND_UMODES  (UMODE_INVISIBLE | UMODE_OPER | UMODE_WALLOP | \
-                      UMODE_ADMIN)
-#define ALL_UMODES   (SEND_UMODES | UMODE_SERVNOTICE | UMODE_CCONN | \
-                      UMODE_REJ | UMODE_SKILL | UMODE_FULL | UMODE_SPY | \
-                      UMODE_NCHANGE | UMODE_OPERWALL | UMODE_DEBUG | \
-                      UMODE_BOTS | UMODE_EXTERNAL | UMODE_LOCOPS | \
- 		      UMODE_ADMIN | UMODE_UNAUTH | UMODE_CALLERID | UMODE_OPERSPY)
-
-#define FLAGS_ID     (FLAGS_NEEDID | FLAGS_GOTID)
-
-/*
- * flags macros.
- */
-#define IsPerson(x)             (IsClient(x) && (x)->user)
-#define DoAccess(x)             ((x)->flags & FLAGS_CHKACCESS)
-#define IsDead(x)               ((x)->flags & FLAGS_DEADSOCKET)
-#define SetDead(x)              ((x)->flags |= FLAGS_DEADSOCKET)
-#define SetAccess(x)            ((x)->flags |= FLAGS_CHKACCESS)
-#define IsClosing(x)		((x)->flags & FLAGS_CLOSING)
-#define SetClosing(x)		((x)->flags |= FLAGS_CLOSING)
-#define ClearAccess(x)          ((x)->flags &= ~FLAGS_CHKACCESS)
-#define IsCryptIn(x)            ((x)->flags &  FLAGS_CRYPTIN)
-#define SetCryptIn(x)           ((x)->flags |= FLAGS_CRYPTIN)
-#define IsCryptOut(x)           ((x)->flags &  FLAGS_CRYPTOUT)
-#define SetCryptOut(x)          ((x)->flags |= FLAGS_CRYPTOUT)
-#define IsWaitAuth(x)           ((x)->flags &  FLAGS_WAITAUTH)
-#define SetWaitAuth(x)          ((x)->flags |= FLAGS_WAITAUTH)
-#define ClearWaitAuth(x)        ((x)->flags &= ~FLAGS_WAITAUTH)
-#define HasServlink(x)          ((x)->flags &  FLAGS_SERVLINK)
-#define SetServlink(x)          ((x)->flags |= FLAGS_SERVLINK)
-#define MyConnect(x)            ((x)->localClient != NULL)
-#define MyClient(x)             (MyConnect(x) && IsClient(x))
-#define SetMark(x)		((x)->flags |= FLAGS_MARK)
-#define ClearMark(x)		((x)->flags &= ~FLAGS_MARK)
-#define IsMarked(x)		((x)->flags & FLAGS_MARK)
-#define SetHidden(x)		((x)->flags |= FLAGS_HIDDEN)
-#define ClearHidden(x)		((x)->flags &= ~FLAGS_HIDDEN)
-#define IsHidden(x)		((x)->flags & FLAGS_HIDDEN)
-#define ClearEob(x)		((x)->flags &= ~FLAGS_EOB)
-#define SetEob(x)		((x)->flags |= FLAGS_EOB)
-#define HasSentEob(x)		((x)->flags & FLAGS_EOB)
-
-
-/* oper flags */
-#define MyOper(x)               (MyConnect(x) && IsOper(x))
-
-#define SetOper(x)              {(x)->umodes |= UMODE_OPER; \
-				 if (!IsServer((x))) (x)->handler = OPER_HANDLER;}
-
-#define ClearOper(x)            {(x)->umodes &= ~(UMODE_OPER|UMODE_ADMIN); \
-				 if (!IsOper((x)) && !IsServer((x))) \
-				  (x)->handler = CLIENT_HANDLER; }
-
-#define IsPrivileged(x)         (IsOper(x) || IsServer(x))
-
-/* umode flags */
-#define IsInvisible(x)          ((x)->umodes & UMODE_INVISIBLE)
-#define SetInvisible(x)         ((x)->umodes |= UMODE_INVISIBLE)
-#define ClearInvisible(x)       ((x)->umodes &= ~UMODE_INVISIBLE)
-#define SendWallops(x)          ((x)->umodes & UMODE_WALLOP)
-#define ClearWallops(x)         ((x)->umodes &= ~UMODE_WALLOP)
-#define SendLocops(x)           ((x)->umodes & UMODE_LOCOPS)
-#define SendServNotice(x)       ((x)->umodes & UMODE_SERVNOTICE)
-#define SendOperwall(x)         ((x)->umodes & UMODE_OPERWALL)
-#define SendCConnNotice(x)      ((x)->umodes & UMODE_CCONN)
-#define SendRejNotice(x)        ((x)->umodes & UMODE_REJ)
-#define SendSkillNotice(x)      ((x)->umodes & UMODE_SKILL)
-#define SendFullNotice(x)       ((x)->umodes & UMODE_FULL)
-#define SendSpyNotice(x)        ((x)->umodes & UMODE_SPY)
-#define SendDebugNotice(x)      ((x)->umodes & UMODE_DEBUG)
-#define SendNickChange(x)       ((x)->umodes & UMODE_NCHANGE)
-#define SetWallops(x)           ((x)->umodes |= UMODE_WALLOP)
-#define SetCallerId(x)		((x)->umodes |= UMODE_CALLERID)
-#define IsSetCallerId(x)	((x)->umodes & UMODE_CALLERID)
-
-#define SetNeedId(x)            ((x)->flags |= FLAGS_NEEDID)
-#define IsNeedId(x)             (((x)->flags & FLAGS_NEEDID) != 0)
-
-#define SetGotId(x)             ((x)->flags |= FLAGS_GOTID)
-#define IsGotId(x)              (((x)->flags & FLAGS_GOTID) != 0)
-
-/*
- * flags2 macros.
- */
-#define IsExemptKline(x)        ((x)->flags2 & FLAGS2_EXEMPTKLINE)
-#define SetExemptKline(x)       ((x)->flags2 |= FLAGS2_EXEMPTKLINE)
-#define IsExemptLimits(x)       ((x)->flags2 & FLAGS2_NOLIMIT)
-#define SetExemptLimits(x)      ((x)->flags2 |= FLAGS2_NOLIMIT)
-#define IsExemptGline(x)        ((x)->flags2 & FLAGS2_EXEMPTGLINE)
-#define SetExemptGline(x)       ((x)->flags2 |= FLAGS2_EXEMPTGLINE)
-#define IsExemptFlood(x)        ((x)->flags2 & FLAGS2_EXEMPTFLOOD)
-#define SetExemptFlood(x)       ((x)->flags2 |= FLAGS2_EXEMPTFLOOD)
-#define IsExemptSpambot(x)	((x)->flags2 & FLAGS2_EXEMPTSPAMBOT)
-#define SetExemptSpambot(x)	((x)->flags2 |= FLAGS2_EXEMPTSPAMBOT)
-#define SetIPSpoof(x)           ((x)->flags2 |= FLAGS2_IP_SPOOFING)
-#define IsIPSpoof(x)            ((x)->flags2 & FLAGS2_IP_SPOOFING)
-
-#define SetIdlelined(x)         ((x)->flags2 |= FLAGS2_IDLE_LINED)
-#define IsIdlelined(x)          ((x)->flags2 & FLAGS2_IDLE_LINED)
-
-#define IsRestricted(x)         ((x)->flags2 &  FLAGS2_RESTRICTED)
-#define SetRestricted(x)        ((x)->flags2 |= FLAGS2_RESTRICTED)
-
-#define IsOperGlobalKill(x)     ((x)->flags2 & OPER_GLOBAL_KILL)
-#define IsOperRemote(x)         ((x)->flags2 & OPER_REMOTE)
-#define IsOperUnkline(x)        ((x)->flags2 & OPER_UNKLINE)
-#define IsOperGline(x)          ((x)->flags2 & OPER_GLINE)
-#define IsOperN(x)              ((x)->flags2 & OPER_N)
-#define IsOperK(x)              ((x)->flags2 & OPER_K)
-#define IsOperXline(x)          ((x)->flags2 & OPER_XLINE)
-#define IsOperDie(x)            ((x)->flags2 & OPER_DIE)
-#define IsOperRehash(x)         ((x)->flags2 & OPER_REHASH)
-#define IsOperHiddenAdmin(x)    ((x)->flags2 & OPER_HIDDENADMIN)
-#define IsOperAdmin(x)          (((x)->flags2 & OPER_ADMIN) || \
-                                 ((x)->flags2 & OPER_HIDDENADMIN))
-#define IsOperOperwall(x)	((x)->flags2 & OPER_OPERWALL)
-#define IsOperSpy(x)		((x)->flags2 & OPER_SPY)
-
-#define IsFloodDone(x)          ((x)->flags2 & FLAGS2_FLOODDONE)
-#define SetFloodDone(x)         ((x)->flags2 |= FLAGS2_FLOODDONE)
-
-/*
- * definitions for get_client_name
- */
-#define HIDE_IP 0
-#define SHOW_IP 1
-#define MASK_IP 2
-
-extern void check_banned_lines(void);
-extern void check_klines_event(void *unused);
-extern void check_klines(void);
-extern void check_glines(void);
-extern void check_dlines(void);
-extern void check_xlines(void);
-
-extern const char *get_client_name(struct Client *client, int show_ip);
-extern const char *log_client_name(struct Client *, int);
-extern void init_client(void);
-extern struct Client *make_client(struct Client *from);
-extern void free_client(struct Client *client);
-/*
- * extern void           add_client_to_list(struct Client* client);
- * This used to be a function..but now it is a macro
- */
-#define add_client_to_list(client) dlinkAddTail(client, &client->node, &global_client_list)
-
-extern void remove_client_from_list(struct Client *);
-extern int exit_client(struct Client *, struct Client *, struct Client *, const char *);
-
-
-extern void count_local_client_memory(int *count, size_t *memory);
-extern void count_remote_client_memory(int *count, size_t *memory);
-
-extern struct Client *find_chasing(struct Client *, char *, int *);
-extern struct Client *find_person(char *);
-extern struct Client *next_client(struct Client *, const char *);
-extern int accept_message(struct Client *source, struct Client *target);
-extern void del_from_accept(struct Client *source, struct Client *target);
-extern void del_all_accepts(struct Client *client_p);
-
-extern int set_initial_nick(struct Client *client_p, struct Client *source_p, char *nick);
-extern int change_local_nick(struct Client *client_p, struct Client *source_p, char *nick);
-extern void dead_link(struct Client *client_p);
-extern int show_ip(struct Client *source_p, struct Client *target_p);
-
-extern void initUser(void);
-extern void free_user(struct User *, struct Client *);
-
-extern struct User *make_user(struct Client *);
-extern struct Server *make_server(struct Client *);
-
-
-#endif /* INCLUDED_client_h */
diff -uNrd ircd-ratbox-1.2-3+ipmask/include/numeric.h ircd-ratbox-1.2-3/include/numeric.h
--- ircd-ratbox-1.2-3+ipmask/include/numeric.h	Thu Nov 27 09:18:27 2003
+++ ircd-ratbox-1.2-3/include/numeric.h	Thu Jun 26 07:01:41 2003
@@ -183,15 +183,12 @@
 #define RPL_ENDOFBANLIST     368
 /* rpl_endofwhowas above (369) */
 
-#define RPL_WHOWASREALHOST   370
 #define RPL_INFO             371
 #define RPL_MOTD             372
 #define RPL_INFOSTART        373
 #define RPL_ENDOFINFO        374
 #define RPL_MOTDSTART        375
 #define RPL_ENDOFMOTD        376
-
-#define RPL_WHOISHOST        378 /* -Jeremy */
 
 #define RPL_YOUREOPER        381
 #define RPL_REHASHING        382
diff -uNrd ircd-ratbox-1.2-3+ipmask/include/numeric.h.orig ircd-ratbox-1.2-3/include/numeric.h.orig
--- ircd-ratbox-1.2-3+ipmask/include/numeric.h.orig	Thu Jun 26 07:01:41 2003
+++ ircd-ratbox-1.2-3/include/numeric.h.orig	Wed Dec 31 17:00:00 1969
@@ -1,314 +0,0 @@
-/*
- *  ircd-ratbox: A slightly useful ircd.
- *  numeric.h: A header for the numeric functions.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002 ircd-ratbox development team
- *
- *  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: numeric.h,v 7.39.2.1 2003/06/26 14:01:41 androsyn Exp $
- */
-
-#ifndef INCLUDED_numeric_h
-#define INCLUDED_numeric_h
-
-#include "config.h"
-
-/*
- * form_str - return a format string for a message number
- * messages are defined below
- */
-extern const char *form_str(int);
-
-/*
- * Reserve numerics 000-099 for server-client connections where the client
- * is local to the server. If any server is passed a numeric in this range
- * from another server then it is remapped to 100-199. -avalon
- */
-#define RPL_WELCOME          001
-#define RPL_YOURHOST         002
-#define RPL_CREATED          003
-#define RPL_MYINFO           004
-#define RPL_ISUPPORT         005
-
-#define RPL_REDIR            10
-#define RPL_MAP		     15	/* Undernet extension */
-#define RPL_MAPMORE	     16	/* Undernet extension */
-#define RPL_MAPEND	     17	/* Undernet extension */
-#define RPL_YOURID           20
-
-/*
- * Numeric replies from server commands.
- * These are currently in the range 200-399.
- */
-#define RPL_TRACELINK        200
-#define RPL_TRACECONNECTING  201
-#define RPL_TRACEHANDSHAKE   202
-#define RPL_TRACEUNKNOWN     203
-#define RPL_TRACEOPERATOR    204
-#define RPL_TRACEUSER        205
-#define RPL_TRACESERVER      206
-#define RPL_TRACENEWTYPE     208
-#define RPL_TRACECLASS       209
-
-#define RPL_STATSLINKINFO    211
-#define RPL_STATSCOMMANDS    212
-#define RPL_STATSCLINE       213
-#define RPL_STATSNLINE       214
-#define RPL_STATSILINE       215
-#define RPL_STATSKLINE       216
-#define RPL_STATSQLINE       217
-#define RPL_STATSYLINE       218
-#define RPL_ENDOFSTATS       219
-/* note ircu uses 217 for STATSPLINE frip. conflict
- * as RPL_STATSQLINE was used in old 2.8 for Q line 
- * I'm going to steal 220 for now *sigh*
- * -Dianora
- */
-#define RPL_STATSPLINE       220
-#define RPL_UMODEIS          221
-
-#define RPL_STATSFLINE       224
-#define RPL_STATSDLINE       225
-#define RPL_STATSALINE	     226
-
-#define RPL_SERVLIST         234
-#define RPL_SERVLISTEND      235
-
-#define RPL_STATSLLINE       241
-#define RPL_STATSUPTIME      242
-#define RPL_STATSOLINE       243
-#define RPL_STATSHLINE       244
-/* 245 No longer used in ircd-ratbox */
-#define RPL_STATSSLINE       245
-#define RPL_STATSXLINE       247
-#define RPL_STATSULINE       248
-#define RPL_STATSDEBUG       249
-#define RPL_STATSCONN        250
-#define RPL_LUSERCLIENT      251
-#define RPL_LUSEROP          252
-#define RPL_LUSERUNKNOWN     253
-#define RPL_LUSERCHANNELS    254
-#define RPL_LUSERME          255
-#define RPL_ADMINME          256
-#define RPL_ADMINLOC1        257
-#define RPL_ADMINLOC2        258
-#define RPL_ADMINEMAIL       259
-
-#define RPL_TRACELOG         261
-#define RPL_ENDOFTRACE       262
-#define RPL_LOAD2HI          263
-
-#define RPL_LOCALUSERS       265
-#define RPL_GLOBALUSERS      266
-
-#define RPL_ACCEPTLIST	     281
-#define RPL_ENDOFACCEPT      282
-
-/* numeric_replies */
-
-#define RPL_NONE             300
-#define RPL_AWAY             301
-#define RPL_USERHOST         302
-#define RPL_ISON             303
-#define RPL_TEXT             304
-#define RPL_UNAWAY           305
-#define RPL_NOWAWAY          306
-
-#define RPL_WHOISADMIN       308
-
-#define RPL_WHOISUSER        311
-#define RPL_WHOISSERVER      312
-#define RPL_WHOISOPERATOR    313
-
-#define RPL_WHOWASUSER       314
-/* rpl_endofwho below (315) */
-#define RPL_ENDOFWHOWAS      369
-
-#define RPL_WHOISCHANOP      316	/* redundant and not needed but reserved */
-#define RPL_WHOISIDLE        317
-
-#define RPL_ENDOFWHOIS       318
-#define RPL_WHOISCHANNELS    319
-
-#define RPL_LISTSTART        321
-#define RPL_LIST             322
-#define RPL_LISTEND          323
-#define RPL_CHANNELMODEIS    324
-
-#define RPL_CREATIONTIME     329
-
-#define RPL_NOTOPIC          331
-#define RPL_TOPIC            332
-#define RPL_TOPICWHOTIME     333
-#define RPL_WHOISACTUALLY    338
-
-#define RPL_INVITING         341
-#define RPL_SUMMONING        342
-
-#define RPL_INVITELIST       346
-#define RPL_ENDOFINVITELIST  347
-#define RPL_EXCEPTLIST       348
-#define RPL_ENDOFEXCEPTLIST  349
-
-#define RPL_VERSION          351
-
-#define RPL_WHOREPLY         352
-#define RPL_ENDOFWHO         315
-#define RPL_NAMREPLY         353
-#define RPL_ENDOFNAMES       366
-
-#define RPL_KILLDONE         361
-#define RPL_CLOSING          362
-#define RPL_CLOSEEND         363
-#define RPL_LINKS            364
-#define RPL_ENDOFLINKS       365
-/* rpl_endofnames above (366) */
-#define RPL_BANLIST          367
-#define RPL_ENDOFBANLIST     368
-/* rpl_endofwhowas above (369) */
-
-#define RPL_INFO             371
-#define RPL_MOTD             372
-#define RPL_INFOSTART        373
-#define RPL_ENDOFINFO        374
-#define RPL_MOTDSTART        375
-#define RPL_ENDOFMOTD        376
-
-#define RPL_YOUREOPER        381
-#define RPL_REHASHING        382
-#define RPL_MYPORTIS         384
-#define RPL_NOTOPERANYMORE   385
-#define RPL_RSACHALLENGE     386
-
-#define RPL_TIME             391
-#define RPL_USERSSTART       392
-#define RPL_USERS            393
-#define RPL_ENDOFUSERS       394
-#define RPL_NOUSERS          395
-
-/*
- * Errors are in the range from 400-599 currently and are grouped by what
- * commands they come from.
- */
-#define ERR_NOSUCHNICK       401
-#define ERR_NOSUCHSERVER     402
-#define ERR_NOSUCHCHANNEL    403
-#define ERR_CANNOTSENDTOCHAN 404
-#define ERR_TOOMANYCHANNELS  405
-#define ERR_WASNOSUCHNICK    406
-#define ERR_TOOMANYTARGETS   407
-#define ERR_NOORIGIN         409
-
-#define ERR_NORECIPIENT      411
-#define ERR_NOTEXTTOSEND     412
-#define ERR_NOTOPLEVEL       413
-#define ERR_WILDTOPLEVEL     414
-
-#define ERR_TOOMANYMATCHES   416
-
-#define ERR_UNKNOWNCOMMAND   421
-#define ERR_NOMOTD           422
-#define ERR_NOADMININFO      423
-#define ERR_FILEERROR        424
-
-#define ERR_NONICKNAMEGIVEN  431
-#define ERR_ERRONEUSNICKNAME 432
-#define ERR_NICKNAMEINUSE    433
-#define ERR_NICKCOLLISION    436
-#define ERR_UNAVAILRESOURCE  437
-#define ERR_NICKTOOFAST	     438	/* We did it first Undernet! ;) db */
-
-#define ERR_USERNOTINCHANNEL 441
-#define ERR_NOTONCHANNEL     442
-#define ERR_USERONCHANNEL    443
-#define ERR_NOLOGIN          444
-#define ERR_SUMMONDISABLED   445
-#define ERR_USERSDISABLED    446
-
-#define ERR_NOTREGISTERED    451
-
-#define ERR_ACCEPTFULL       456
-#define ERR_ACCEPTEXIST      457
-#define ERR_ACCEPTNOT        458
-
-#define ERR_NEEDMOREPARAMS   461
-#define ERR_ALREADYREGISTRED 462
-#define ERR_NOPERMFORHOST    463
-#define ERR_PASSWDMISMATCH   464
-#define ERR_YOUREBANNEDCREEP 465
-#define ERR_YOUWILLBEBANNED  466
-#define ERR_KEYSET           467
-
-#define ERR_CHANNELISFULL    471
-#define ERR_UNKNOWNMODE      472
-#define ERR_INVITEONLYCHAN   473
-#define ERR_BANNEDFROMCHAN   474
-#define ERR_BADCHANNELKEY    475
-#define ERR_BADCHANMASK      476
-#define ERR_MODELESS         477	/* ircu numeric -db */
-#define ERR_BANLISTFULL      478	/* I stole the numeric from ircu -db */
-#define ERR_BADCHANNAME      479
-
-#define ERR_NOPRIVILEGES     481
-#define ERR_CHANOPRIVSNEEDED 482
-#define ERR_CANTKILLSERVER   483
-#define ERR_RESTRICTED       484
-#define ERR_BANNEDNICK       485
-
-#define ERR_NOOPERHOST       491
-
-#define ERR_UMODEUNKNOWNFLAG 501
-#define ERR_USERSDONTMATCH   502
-
-#define ERR_GHOSTEDCLIENT    503
-
-#define ERR_USERNOTONSERV    504
-
-/* #define ERR_LAST_ERR_MSG 505 
- * moved to 999
- */
-
-#define ERR_WRONGPONG	     513
-
-#define ERR_HELPNOTFOUND     524
-
-#define RPL_MODLIST          702
-#define RPL_ENDOFMODLIST     703
-
-#define RPL_HELPSTART        704
-#define RPL_HELPTXT          705
-#define RPL_ENDOFHELP        706
-
-#define RPL_ETRACE           709
-
-#define RPL_KNOCK	     710
-#define RPL_KNOCKDLVR	     711
-
-#define ERR_TOOMANYKNOCK     712
-#define ERR_CHANOPEN         713
-#define ERR_KNOCKONCHAN      714
-#define ERR_KNOCKDISABLED    715
-
-#define ERR_TARGUMODEG       716
-#define RPL_TARGNOTIFY       717
-#define RPL_UMODEGMSG        718
-
-#define ERR_LAST_ERR_MSG     999
-
-#endif /* INCLUDED_numeric_h */
diff -uNrd ircd-ratbox-1.2-3+ipmask/include/patchlevel.h ircd-ratbox-1.2-3/include/patchlevel.h
--- ircd-ratbox-1.2-3+ipmask/include/patchlevel.h	Thu Nov 27 09:18:45 2003
+++ ircd-ratbox-1.2-3/include/patchlevel.h	Wed Sep 24 06:38:17 2003
@@ -25,5 +25,5 @@
  */
 
 #ifndef PATCHLEVEL
-#define PATCHLEVEL   "ircd-ratbox-1.2-3+ipmask-1.2-2 (brown paper bag release)"
+#define PATCHLEVEL   "ircd-ratbox-1.2-3 (brown paper bag release)"
 #endif
diff -uNrd ircd-ratbox-1.2-3+ipmask/include/patchlevel.h.orig ircd-ratbox-1.2-3/include/patchlevel.h.orig
--- ircd-ratbox-1.2-3+ipmask/include/patchlevel.h.orig	Wed Sep 24 06:38:17 2003
+++ ircd-ratbox-1.2-3/include/patchlevel.h.orig	Wed Dec 31 17:00:00 1969
@@ -1,29 +0,0 @@
-/*
- *  ircd-ratbox: A slightly useful ircd.
- *  patchlevel.h: A header defining the patchlevel.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002 ircd-ratbox development team
- *
- *  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: patchlevel.h,v 7.50.2.8 2003/09/24 13:38:17 androsyn Exp $
- */
-
-#ifndef PATCHLEVEL
-#define PATCHLEVEL   "ircd-ratbox-1.2-3 (brown paper bag release)"
-#endif
diff -uNrd ircd-ratbox-1.2-3+ipmask/include/s_conf.h ircd-ratbox-1.2-3/include/s_conf.h
--- ircd-ratbox-1.2-3+ipmask/include/s_conf.h	Thu Nov 27 09:18:27 2003
+++ ircd-ratbox-1.2-3/include/s_conf.h	Fri Sep  5 17:03:00 2003
@@ -140,9 +140,6 @@
 #define CONF_FLAGS_CRYPTLINK            0x00400000
 #define CONF_FLAGS_VHOSTED		0x00800000
 #define CONF_FLAGS_TB			0x01000000
-
-#define CONF_FLAGS_IPMASK		0x02000000
-#define CONF_FLAGS_NO_MASK_NOTICE	0x04000000
 /* Macros for struct ConfItem */
 
 #define IsLimitIp(x)            ((x)->flags & CONF_FLAGS_LIMIT_IP)
@@ -165,8 +162,6 @@
 #define IsConfCryptLink(x)      ((x)->flags & CONF_FLAGS_CRYPTLINK)
 #define IsConfVhosted(x)	((x)->flags & CONF_FLAGS_VHOSTED)
 #define IsConfTburst(x)		((x)->flags & CONF_FLAGS_TB)
-#define IsConfDoMaskIp(x)		((x)->flags & CONF_FLAGS_IPMASK)
-#define IsConfNoMaskNotice(x)	((x)->flags & CONF_FLAGS_NO_MASK_NOTICE)
 
 /* flag definitions for opers now in client.h */
 
diff -uNrd ircd-ratbox-1.2-3+ipmask/include/s_conf.h.orig ircd-ratbox-1.2-3/include/s_conf.h.orig
--- ircd-ratbox-1.2-3+ipmask/include/s_conf.h.orig	Fri Sep  5 17:03:00 2003
+++ ircd-ratbox-1.2-3/include/s_conf.h.orig	Wed Dec 31 17:00:00 1969
@@ -1,455 +0,0 @@
-/*
- *  ircd-ratbox: A slightly useful ircd.
- *  s_conf.h: A header for the configuration functions.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002 ircd-ratbox development team
- *
- *  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: s_conf.h,v 7.241.2.5 2003/09/06 00:03:00 leeh Exp $
- */
-
-#ifndef INCLUDED_s_conf_h
-#define INCLUDED_s_conf_h
-#include "setup.h"
-
-
-
-#ifdef HAVE_LIBCRYPTO
-#include <openssl/rsa.h>
-#endif
-
-#include "config.h"		/* defines */
-#include "fileio.h"		/* FBFILE */
-#include "ircd_defs.h"
-#include "motd.h"		/* MessageFile */
-#include "class.h"
-#include "client.h"
-#include "common.h"
-
-struct Client;
-struct DNSReply;
-struct hostent;
-
-/* used by new parser */
-/* yacc/lex love globals!!! */
-
-struct ip_value
-{
-	struct irc_inaddr ip;
-	int ip_mask;
-	int type;
-};
-
-extern FBFILE *conf_fbfile_in;
-extern char conf_line_in[256];
-extern struct ConfItem *yy_aconf;
-
-struct ConfItem
-{
-	struct ConfItem *next;	/* list node pointer */
-	unsigned int status;	/* If CONF_ILLEGAL, delete when no clients */
-	unsigned int flags;
-	int clients;		/* Number of *LOCAL* clients using this */
-	struct irc_inaddr my_ipnum;	/* ip to bind to for outgoing connect */
-	struct irc_inaddr ipnum;	/* ip to connect to */
-	char *name;		/* IRC name, nick, server name, or original u@h */
-	char *host;		/* host part of user@host */
-	char *passwd;		/* doubles as kline reason *ugh* */
-	char *spasswd;		/* Password to send. */
-	char *user;		/* user part of user@host */
-	int port;
-	char *fakename;		/* Mask name */
-	time_t hold;		/* Hold action until this time (calendar time) */
-	char *className;	/* Name of class */
-	struct Class *c_class;	/* Class of connection */
-	struct DNSQuery *dns_query;
-	int aftype;
-#ifdef HAVE_LIBCRYPTO
-	char *rsa_public_key_file;
-	RSA *rsa_public_key;
-	struct EncCapability *cipher_preference;
-#endif
-};
-
-#define CONF_ILLEGAL            0x80000000
-#define CONF_QUARANTINED_NICK   0x0001
-#define CONF_CLIENT             0x0002
-#define CONF_SERVER             0x0004
-#define CONF_OPERATOR           0x0010
-#define CONF_KILL               0x0040
-
-#define CONF_CLASS              0x0400
-#define CONF_LEAF               0x0800
-#define CONF_LISTEN_PORT        0x1000
-#define CONF_HUB                0x2000
-#define CONF_EXEMPTKLINE        0x4000
-#define CONF_NOLIMIT            0x8000
-#define CONF_GLINE             0x10000
-#define CONF_DLINE             0x20000
-#define CONF_XLINE             0x40000
-#define CONF_ULINE             0x80000
-#define CONF_EXEMPTDLINE      0x100000
-
-#define CONF_SERVER_MASK       CONF_SERVER
-#define CONF_CLIENT_MASK       (CONF_CLIENT | CONF_OPERATOR | CONF_SERVER_MASK)
-
-#define IsIllegal(x)    ((x)->status & CONF_ILLEGAL)
-
-/* aConfItem->flags */
-
-/* Generic flags... */
-/* access flags... */
-#define CONF_FLAGS_DO_IDENTD            0x00000001
-#define CONF_FLAGS_LIMIT_IP             0x00000002
-#define CONF_FLAGS_NO_TILDE             0x00000004
-#define CONF_FLAGS_NEED_IDENTD          0x00000008
-#define CONF_FLAGS_PASS_IDENTD          0x00000010
-#define CONF_FLAGS_NOMATCH_IP           0x00000020
-#define CONF_FLAGS_EXEMPTKLINE          0x00000040
-#define CONF_FLAGS_NOLIMIT              0x00000080
-#define CONF_FLAGS_IDLE_LINED           0x00000100
-#define CONF_FLAGS_SPOOF_IP             0x00000200
-#define CONF_FLAGS_SPOOF_NOTICE         0x00000400
-#define CONF_FLAGS_REDIR                0x00000800
-#define CONF_FLAGS_EXEMPTGLINE          0x00001000
-#define CONF_FLAGS_RESTRICTED           0x00002000
-#define CONF_FLAGS_EXEMPTFLOOD          0x00004000
-#define CONF_FLAGS_EXEMPTSPAMBOT	0x00008000
-/* server flags */
-#define CONF_FLAGS_ALLOW_AUTO_CONN      0x00020000
-#define CONF_FLAGS_LAZY_LINK            0x00040000
-#define CONF_FLAGS_ENCRYPTED            0x00080000
-#define CONF_FLAGS_COMPRESSED           0x00100000
-#define CONF_FLAGS_TEMPORARY            0x00200000
-#define CONF_FLAGS_CRYPTLINK            0x00400000
-#define CONF_FLAGS_VHOSTED		0x00800000
-#define CONF_FLAGS_TB			0x01000000
-/* Macros for struct ConfItem */
-
-#define IsLimitIp(x)            ((x)->flags & CONF_FLAGS_LIMIT_IP)
-#define IsNoTilde(x)            ((x)->flags & CONF_FLAGS_NO_TILDE)
-#define IsNeedIdentd(x)         ((x)->flags & CONF_FLAGS_NEED_IDENTD)
-#define IsPassIdentd(x)         ((x)->flags & CONF_FLAGS_PASS_IDENTD)
-#define IsNoMatchIp(x)          ((x)->flags & CONF_FLAGS_NOMATCH_IP)
-#define IsConfExemptKline(x)    ((x)->flags & CONF_FLAGS_EXEMPTKLINE)
-#define IsConfExemptLimits(x)   ((x)->flags & CONF_FLAGS_NOLIMIT)
-#define IsConfExemptGline(x)    ((x)->flags & CONF_FLAGS_EXEMPTGLINE)
-#define IsConfExemptFlood(x)    ((x)->flags & CONF_FLAGS_EXEMPTFLOOD)
-#define IsConfExemptSpambot(x)	((x)->flags & CONF_FLAGS_EXEMPTSPAMBOT)
-#define IsConfIdlelined(x)      ((x)->flags & CONF_FLAGS_IDLE_LINED)
-#define IsConfDoIdentd(x)       ((x)->flags & CONF_FLAGS_DO_IDENTD)
-#define IsConfDoSpoofIp(x)      ((x)->flags & CONF_FLAGS_SPOOF_IP)
-#define IsConfSpoofNotice(x)    ((x)->flags & CONF_FLAGS_SPOOF_NOTICE)
-#define IsConfRestricted(x)     ((x)->flags & CONF_FLAGS_RESTRICTED)
-#define IsConfEncrypted(x)      ((x)->flags & CONF_FLAGS_ENCRYPTED)
-#define IsConfCompressed(x)     ((x)->flags & CONF_FLAGS_COMPRESSED)
-#define IsConfCryptLink(x)      ((x)->flags & CONF_FLAGS_CRYPTLINK)
-#define IsConfVhosted(x)	((x)->flags & CONF_FLAGS_VHOSTED)
-#define IsConfTburst(x)		((x)->flags & CONF_FLAGS_TB)
-
-/* flag definitions for opers now in client.h */
-
-struct config_file_entry
-{
-	const char *dpath;		/* DPATH if set from command line */
-	const char *configfile;
-	const char *klinefile;
-	const char *dlinefile;
-	const char *xlinefile;
-	const char *resvfile;
-
-	const char *glinefile;
-
-	char *logpath;
-	char *operlog;
-	char *glinelog;
-
-	char *servlink_path;
-	char *egdpool_path;
-
-	char *network_name;
-	char *network_desc;
-
-	char fname_operlog[MAXPATHLEN];
-	char fname_userlog[MAXPATHLEN];
-	char fname_foperlog[MAXPATHLEN];
-	char fname_operspylog[MAXPATHLEN];
-	char fname_operspyremotelog[MAXPATHLEN];
-
-	MessageFile motd;
-	MessageFile opermotd;
-	MessageFile linksfile;
-
-	int hub;
-	unsigned char compression_level;
-	int dot_in_ip6_addr;
-	int dots_in_ident;
-	int failed_oper_notice;
-	int anti_nick_flood;
-	int anti_spam_exit_message_time;
-	int max_accept;
-	int max_nick_time;
-	int max_nick_changes;
-	int ts_max_delta;
-	int ts_warn_delta;
-	int kline_with_reason;
-	int kline_with_connection_closed;
-	int kline_delay;
-	int warn_no_nline;
-	int non_redundant_klines;
-	int stats_o_oper_only;
-	int stats_k_oper_only;
-	int stats_i_oper_only;
-	int stats_P_oper_only;
-	int stats_c_oper_only;
-	int stats_y_oper_only;
-	int stats_h_oper_only;
-	int map_oper_only;
-	int operspy_admin_only;
-	int pace_wait;
-	int pace_wait_simple;
-	int short_motd;
-	int no_oper_flood;
-	int glines;
-	int gline_time;
-	int idletime;
-	int hide_server;
-	int client_exit;
-	int oper_only_umodes;
-	int oper_umodes;
-	int max_targets;
-	int caller_id_wait;
-	int min_nonwildcard;
-	int min_nonwildcard_simple;
-	int default_floodcount;
-	int client_flood;
-	int use_egd;
-	int ping_cookie;
-	int tkline_expire_notices;
-	int use_help;
-	int use_whois_actually;
-	int disable_auth;
-	int connect_timeout;
-	int reject_ban_time;
-	int reject_after_count;
-	int reject_duration;
-	char default_operstring[REALLEN];
-	char default_adminstring[REALLEN];
-
-#ifdef IPV6
-	int fallback_to_ip6_int;
-#endif
-#ifdef HAVE_LIBCRYPTO
-	struct EncCapability *default_cipher_preference;
-#endif
-};
-
-struct config_channel_entry
-{
-	int use_except;
-	int use_invex;
-	int use_knock;
-	int knock_delay;
-	int knock_delay_channel;
-	int max_bans;
-	int max_chans_per_user;
-	int no_create_on_split;
-	int no_join_on_split;
-	int persist_time;
-	int quiet_on_ban;
-	int default_split_server_count;
-	int default_split_user_count;
-	int default_split_delay;
-	int no_oper_resvs;
-	int burst_topicwho;
-};
-
-struct config_server_hide
-{
-	int flatten_links;
-	int hide_servers;
-	int disable_remote;
-	int disable_local_channels;
-	int links_delay;
-	int links_disabled;
-	int hidden;
-	int disable_hidden;
-};
-
-struct server_info
-{
-	char *name;
-	char *description;
-	char *network_name;
-	char *network_desc;
-#ifdef HAVE_LIBCRYPTO
-	char *rsa_private_key_file;
-	RSA *rsa_private_key;
-#endif
-	int hub;
-	struct irc_inaddr ip;
-	struct irc_inaddr ip6;
-	int no_hack_ops;
-	int specific_ipv4_vhost;
-	int specific_ipv6_vhost;
-	struct sockaddr_in dns_host;
-};
-
-struct admin_info
-{
-	char *name;
-	char *description;
-	char *email;
-};
-
-/* bleh. have to become global. */
-extern int scount;
-
-/* struct ConfItems */
-/* conf uline link list root */
-extern struct ConfItem *u_conf;
-/* conf xline link list root */
-extern struct ConfItem *x_conf;
-
-/* All variables are GLOBAL */
-extern struct ConfItem *ConfigItemList;	/* conf list head */
-extern int specific_ipv4_vhost;	/* used in s_bsd.c */
-extern int specific_ipv6_vhost;
-extern struct config_file_entry ConfigFileEntry;	/* defined in ircd.c */
-extern struct config_channel_entry ConfigChannel;	/* defined in channel.c */
-extern struct config_server_hide ConfigServerHide;	/* defined in s_conf.c */
-extern struct server_info ServerInfo;	/* defined in ircd.c */
-extern struct admin_info AdminInfo;	/* defined in ircd.c */
-/* End GLOBAL section */
-
-#define TEMP_MIN	1
-#define TEMP_HOUR	2
-#define TEMP_DAY	3
-#define TEMP_WEEK	4
-
-extern dlink_list tkline_min;
-extern dlink_list tkline_hour;
-extern dlink_list tkline_day;
-extern dlink_list tkline_week;
-
-extern dlink_list tdline_min;
-extern dlink_list tdline_hour;
-extern dlink_list tdline_day;
-extern dlink_list tdline_week;
-
-extern struct ConfItem *make_conf(void);
-extern void free_conf(struct ConfItem *);
-
-extern void read_conf_files(int cold);
-
-extern int attach_conf(struct Client *, struct ConfItem *);
-extern int attach_confs(struct Client *client, const char *name, int statmask);
-extern int attach_connect_block(struct Client *client, const char *name, const char *host);
-extern int check_client(struct Client *client_p, struct Client *source_p, char *);
-extern void det_confs_butmask(struct Client *, int);
-extern int detach_conf(struct Client *, struct ConfItem *);
-extern struct ConfItem *det_confs_butone(struct Client *, struct ConfItem *);
-extern struct ConfItem *find_conf_exact(const char *name, const char *user, const char *host,
-					int statmask);
-extern struct ConfItem *find_conf_name(dlink_list * list, const char *name, int statmask);
-extern struct ConfItem *find_conf_host(dlink_list * list, const char *host, int statmask);
-extern struct ConfItem *find_conf_ip(dlink_list * list, char *ip, char *name, int);
-extern struct ConfItem *find_conf_by_name(const char *name, int status);
-extern struct ConfItem *find_conf_by_host(const char *host, int status);
-extern struct ConfItem *find_kill(struct Client *);
-extern int conf_connect_allowed(struct irc_inaddr *addr, int aftype);
-extern char *oper_flags_as_string(int);
-extern char *oper_privs_as_string(struct Client *, int);
-
-extern int find_u_conf(char *, char *, char *, int);
-extern struct ConfItem *find_x_conf(char *);
-
-extern struct ConfItem *find_tkline(const char *, const char *, struct irc_inaddr *);
-extern char *show_iline_prefix(struct Client *, struct ConfItem *, char *);
-extern void get_printable_conf(struct ConfItem *,
-			       char **, char **, char **, char **, int *, char **);
-extern void report_configured_links(struct Client *client_p, int mask);
-
-extern void yyerror(const char *);
-extern int conf_yy_fatal_error(const char *);
-extern int conf_fbgets(char *, int, FBFILE *);
-
-typedef enum
-{
-	CONF_TYPE,
-	KLINE_TYPE,
-	DLINE_TYPE,
-	XLINE_TYPE,
-	RESV_TYPE
-}
-KlineType;
-
-extern void write_confitem(KlineType, struct Client *, char *, char *,
-			   const char *, const char *, const char *, int);
-extern void add_temp_kline(struct ConfItem *);
-extern void add_temp_dline(struct ConfItem *);
-extern void report_temp_klines(struct Client *);
-extern void show_temp_klines(struct Client *, dlink_list *);
-
-extern void cleanup_temps_min(void *);
-extern void cleanup_temps_hour(void *);
-extern void cleanup_temps_day(void *);
-extern void cleanup_temps_week(void *);
-
-
-extern const char *get_conf_name(KlineType);
-extern int rehash(int);
-
-extern int conf_add_server(struct ConfItem *, int);
-extern void conf_add_class_to_conf(struct ConfItem *);
-extern void conf_add_me(struct ConfItem *);
-extern void conf_add_class(struct ConfItem *, int);
-extern void conf_add_d_conf(struct ConfItem *);
-extern void conf_add_x_conf(struct ConfItem *);
-extern void conf_add_u_conf(struct ConfItem *);
-extern void conf_add_fields(struct ConfItem *, const char *, const char *, 
-                            const char *, const char *, const char *);
-extern void conf_add_conf(struct ConfItem *);
-
-/* XXX consider moving these into kdparse.h */
-extern void parse_k_file(FBFILE * fb);
-extern void parse_d_file(FBFILE * fb);
-extern void parse_x_file(FBFILE * fb);
-extern void parse_resv_file(FBFILE *);
-extern char *getfield(char *newline);
-
-extern char *get_oper_name(struct Client *client_p);
-
-extern int yylex(void);
-
-extern unsigned long cidr_to_bitmask[];
-
-extern char conffilebuf[IRCD_BUFSIZE + 1];
-extern int lineno;
-
-#define NOT_AUTHORISED  (-1)
-#define SOCKET_ERROR    (-2)
-#define I_LINE_FULL     (-3)
-#define BANNED_CLIENT   (-4)
-#define TOO_FAST        (-5)
-#define TOO_MANY_LOCAL	(-6)
-#define TOO_MANY_GLOBAL (-7)
-#define TOO_MANY_IDENT	(-8)
-
-#endif /* INCLUDED_s_conf_h */
diff -uNrd ircd-ratbox-1.2-3+ipmask/include/s_serv.h ircd-ratbox-1.2-3/include/s_serv.h
--- ircd-ratbox-1.2-3+ipmask/include/s_serv.h	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/include/s_serv.h	Fri Sep  5 17:03:00 2003
@@ -74,13 +74,12 @@
 #define CAP_UNKLN       0x00100000	/* supports remote unkline */
 #define CAP_CLUSTER	0x00200000	/* supports clustering */
 #define CAP_ENCAP	0x00400000
-#define CAP_IPMASK	0x00800000
 
 #define CAP_MASK        (CAP_QS  | CAP_EX   | CAP_CHW  | \
                          CAP_IE  | CAP_EOB  | CAP_KLN  | \
                          CAP_GLN | CAP_CLUSTER | CAP_ENCAP | \
                          CAP_UID | CAP_ZIP  | CAP_ENC | \
-                         CAP_KNOCK  | CAP_UNKLN | CAP_IPMASK)
+                         CAP_KNOCK  | CAP_UNKLN)
 
 #ifdef HAVE_LIBZ
 #define CAP_ZIP_SUPPORTED       CAP_ZIP
diff -uNrd ircd-ratbox-1.2-3+ipmask/include/s_serv.h.orig ircd-ratbox-1.2-3/include/s_serv.h.orig
--- ircd-ratbox-1.2-3+ipmask/include/s_serv.h.orig	Fri Sep  5 17:03:00 2003
+++ ircd-ratbox-1.2-3/include/s_serv.h.orig	Wed Dec 31 17:00:00 1969
@@ -1,293 +0,0 @@
-/*
- *  ircd-ratbox: A slightly useful ircd.
- *  s_serv.h: A header for the server functions.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002 ircd-ratbox development team
- *
- *  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: s_serv.h,v 7.80.2.2 2003/09/06 00:03:00 leeh Exp $
- */
-
-#ifndef INCLUDED_serv_h
-#define INCLUDED_serv_h
-
-#include "config.h"
-
-/*
- * The number of seconds between calls to try_connections(). Fiddle with
- * this ONLY if you KNOW what you're doing!
- */
-#define TRY_CONNECTIONS_TIME	60
-
-/* collect ziplinks compression ratios/etc every minute */
-#define ZIPSTATS_TIME           60
-
-/*
- * number of seconds to wait after server starts up, before
- * starting try_connections()
- * TOO SOON and you can nick collide like crazy. 
- */
-#define STARTUP_CONNECTIONS_TIME 60
-
-struct Client;
-struct ConfItem;
-struct Channel;
-
-/* Capabilities */
-struct Capability
-{
-	const char *name;	/* name of capability */
-	unsigned int cap;	/* mask value */
-};
-
-#define CAP_CAP         0x00000001	/* received a CAP to begin with */
-#define CAP_QS          0x00000002	/* Can handle quit storm removal */
-#define CAP_EX          0x00000008	/* Can do channel +e exemptions */
-#define CAP_CHW         0x00000010	/* Can do channel wall @# */
-#define CAP_IE          0x00000040	/* Can do invite exceptions */
-#define CAP_EOB	        0x00000100	/* Can do EOB message */
-#define CAP_KLN	        0x00000200	/* Can do KLINE message */
-#define CAP_GLN	        0x00000400	/* Can do GLINE message */
-#define CAP_UID         0x00004000	/* Can do UIDs */
-#define CAP_ZIP         0x00008000	/* Can do ZIPlinks */
-#define CAP_ENC         0x00010000	/* Can do ENCrypted links */
-
-#define CAP_KNOCK	0x00020000	/* supports KNOCK */
-
-#define CAP_TB		0x00040000	/* supports TBURST */
-#define CAP_UNKLN       0x00100000	/* supports remote unkline */
-#define CAP_CLUSTER	0x00200000	/* supports clustering */
-#define CAP_ENCAP	0x00400000
-
-#define CAP_MASK        (CAP_QS  | CAP_EX   | CAP_CHW  | \
-                         CAP_IE  | CAP_EOB  | CAP_KLN  | \
-                         CAP_GLN | CAP_CLUSTER | CAP_ENCAP | \
-                         CAP_UID | CAP_ZIP  | CAP_ENC | \
-                         CAP_KNOCK  | CAP_UNKLN)
-
-#ifdef HAVE_LIBZ
-#define CAP_ZIP_SUPPORTED       CAP_ZIP
-#else
-#define CAP_ZIP_SUPPORTED       0
-#endif
-
-#ifdef HAVE_LIBCRYPTO
-struct EncCapability
-{
-	const char *name;	/* name of capability (cipher name) */
-	unsigned int cap;	/* mask value */
-	int keylen;		/* keylength (bytes) */
-	int cipherid;		/* ID number of cipher type (BF, IDEA, etc.) */
-};
-
-/*
- * Cipher ID numbers
- *   - DO NOT CHANGE THESE!  Otherwise you break backwards compatibility
- *     If you wish to add a new cipher, append it to the list.  Do not
- *     have it's value replace another.
- */
-#define CIPHER_BF       1
-#define CIPHER_CAST     2
-#define CIPHER_DES      3
-#define CIPHER_3DES     4
-#define CIPHER_IDEA     5
-#define CIPHER_RC5_8    6
-#define CIPHER_RC5_12   7
-#define CIPHER_RC5_16   8
-
-/* Cipher Capabilities */
-#define CAP_ENC_BF_128          0x00000001
-#define CAP_ENC_BF_256          0x00000002
-#define CAP_ENC_CAST_128        0x00000004
-#define CAP_ENC_DES_56          0x00000008
-#define CAP_ENC_3DES_168        0x00000010
-#define CAP_ENC_IDEA_128        0x00000020
-#define CAP_ENC_RC5_8_128       0x00000040
-#define CAP_ENC_RC5_12_128      0x00000080
-#define CAP_ENC_RC5_16_128      0x00000100
-
-#define CAP_ENC_ALL             0xFFFFFFFF
-
-
-/* */
-#ifdef HAVE_EVP_BF_CFB
-#define USE_CIPHER_BF       1
-/* Check for bug handling variable length blowfish keys */
-#if OPENSSL_VERSION_NUMBER >= 0x00000000L
-#define USE_CIPHER_BF_V     1
-#else
-#define USE_CIPHER_BF_V     0
-#endif
-#else
-#define USE_CIPHER_BF_V     0
-#define USE_CIPHER_BF       0
-#endif
-/* Cast */
-#ifdef HAVE_EVP_CAST5_CFB
-#define USE_CIPHER_CAST     1
-#else
-#define USE_CIPHER_CAST     0
-#endif
-/* DES */
-#ifdef HAVE_EVP_DES_CFB
-#define USE_CIPHER_DES      1
-#else
-#define USE_CIPHER_DES      0
-#endif
-/* 3DES */
-#ifdef HAVE_EVP_DES_EDE3_CFB
-#define USE_CIPHER_3DES     1
-#else
-#define USE_CIPHER_3DES     0
-#endif
-/* IDEA */
-#ifdef HAVE_EVP_IDEA_CFB
-#define USE_CIPHER_IDEA     1
-#else
-#define USE_CIPHER_IDEA     0
-#endif
-/* RC5 */
-#ifdef HAVE_EVP_RC5_32_12_16_CFB
-#define USE_CIPHER_RC5      1
-#else
-#define USE_CIPHER_RC5      0
-#endif
-
-
-/* Only enable ciphers supported by available version of OpenSSL */
-#define CAP_ENC_MASK    \
-             (((USE_CIPHER_BF   * CAP_ENC_ALL) & CAP_ENC_BF_128)         | \
-              ((USE_CIPHER_BF_V * CAP_ENC_ALL) & CAP_ENC_BF_256)         | \
-              ((USE_CIPHER_CAST * CAP_ENC_ALL) & CAP_ENC_CAST_128)       | \
-              ((USE_CIPHER_DES  * CAP_ENC_ALL) & CAP_ENC_DES_56)         | \
-              ((USE_CIPHER_3DES * CAP_ENC_ALL) & CAP_ENC_3DES_168)       | \
-              ((USE_CIPHER_IDEA * CAP_ENC_ALL) & CAP_ENC_IDEA_128)       | \
-              ((USE_CIPHER_RC5  * CAP_ENC_ALL) & CAP_ENC_RC5_8_128)      | \
-              ((USE_CIPHER_RC5  * CAP_ENC_ALL) & CAP_ENC_RC5_12_128)     | \
-              ((USE_CIPHER_RC5  * CAP_ENC_ALL) & CAP_ENC_RC5_16_128))
-
-#define IsCapableEnc(x, cap)    ((x)->localClient->enc_caps &   (cap))
-#define SetCapableEnc(x, cap)   ((x)->localClient->enc_caps |=  (cap))
-#define ClearCapEnc(x, cap)     ((x)->localClient->enc_caps &= ~(cap))
-
-#endif /* HAVE_LIBCRYPTO */
-
-#define DoesCAP(x)      ((x)->caps)
-
-#define CHECK_SERVER_CRYPTLINK    1
-#define CHECK_SERVER_NOCRYPTLINK  0
-
-/*
- * Capability macros.
- */
-#define IsCapable(x, cap)       ((x)->localClient->caps &   (cap))
-#define SetCapable(x, cap)      ((x)->localClient->caps |=  (cap))
-#define ClearCap(x, cap)        ((x)->localClient->caps &= ~(cap))
-
-#define SLINKCMD_SET_ZIP_OUT_LEVEL           1	/* data */
-#define SLINKCMD_START_ZIP_OUT               2
-#define SLINKCMD_START_ZIP_IN                3
-#define SLINKCMD_SET_CRYPT_IN_CIPHER         4	/* data */
-#define SLINKCMD_SET_CRYPT_IN_KEY            5	/* data */
-#define SLINKCMD_START_CRYPT_IN              6
-#define SLINKCMD_SET_CRYPT_OUT_CIPHER        7	/* data */
-#define SLINKCMD_SET_CRYPT_OUT_KEY           8	/* data */
-#define SLINKCMD_START_CRYPT_OUT             9
-#define SLINKCMD_INJECT_RECVQ                10	/* data */
-#define SLINKCMD_INJECT_SENDQ                11	/* data */
-#define SLINKCMD_INIT                        12
-#define SLINKCMD_ZIPSTATS                    13
-
-#ifndef HAVE_SOCKETPAIR
-#define LAST_SLINK_FD   7
-#else
-#define LAST_SLINK_FD   5
-#endif
-
-#define SLINKRPL_FLAG_DATA      0x0001	/* reply has data following */
-#define SLINKRPL_ERROR          1
-#define SLINKRPL_ZIPSTATS       2
-
-#define MAX_SLINKRPL            2
-
-typedef void SlinkRplHnd(unsigned int replyid, unsigned int datalen,
-			 unsigned char *data, struct Client *client_p);
-struct SlinkRplDef
-{
-	unsigned int replyid;
-	SlinkRplHnd *handler;
-	unsigned int flags;
-};
-
-extern struct SlinkRplDef slinkrpltab[];
-
-/*
- * Globals
- *
- *
- * list of recognized server capabilities.  "TS" is not on the list
- * because all servers that we talk to already do TS, and the kludged
- * extra argument to "PASS" takes care of checking that.  -orabidoo
- */
-extern struct Capability captab[];
-#ifdef HAVE_LIBCRYPTO
-extern struct EncCapability CipherTable[];
-#endif
-
-extern int MaxClientCount;	/* GLOBAL - highest number of clients */
-extern int MaxConnectionCount;	/* GLOBAL - highest number of connections */
-
-extern int refresh_user_links;
-
-/*
- * return values for hunt_server() 
- */
-#define HUNTED_NOSUCH   (-1)	/* if the hunted server is not found */
-#define HUNTED_ISME     0	/* if this server should execute the command */
-#define HUNTED_PASS     1	/* if message passed onwards successfully */
-
-
-extern int check_server(const char *name, struct Client *server, int cryptlink);
-extern int hunt_server(struct Client *client_pt,
-		       struct Client *source_pt, const char *command, int server, int parc, char **parv);
-extern const char *my_name_for_link(const char *name, struct ConfItem *conf);
-extern void send_capabilities(struct Client *, struct ConfItem *conf, int, int);
-extern void write_links_file(void *);
-extern int server_estab(struct Client *client_p);
-extern void set_autoconn(struct Client *, char *, char *, int);
-extern const char *show_capabilities(struct Client *client);
-extern void try_connections(void *unused);
-extern void start_collect_zipstats(void);
-extern void collect_zipstats(void *unused);
-
-extern void add_server_to_list(struct Client *);
-extern void remove_server_from_list(struct Client *);
-
-extern void initServerMask(void);
-extern void sendnick_TS(struct Client *, struct Client *);
-extern int serv_connect(struct ConfItem *, struct Client *);
-extern unsigned long nextFreeMask(void);
-extern void cryptlink_init(struct Client *client_p, struct ConfItem *aconf, int fd);
-extern void cryptlink_regen_key(void *);
-extern void cryptlink_error(struct Client *client_p, const char *type,
-                            const char *reason, const char *client_reason);
-
-struct EncCapability *check_cipher(struct Client *client_p, struct ConfItem *aconf);
-
-#endif /* INCLUDED_s_serv_h */
diff -uNrd ircd-ratbox-1.2-3+ipmask/include/s_user.h ircd-ratbox-1.2-3/include/s_user.h
--- ircd-ratbox-1.2-3+ipmask/include/s_user.h	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/include/s_user.h	Tue Jul  8 08:21:53 2003
@@ -44,7 +44,7 @@
 extern int do_local_user(char *, struct Client *, struct Client *, char *, char *, char *, char *);
 
 extern int do_remote_user(char *, struct Client *, struct Client *,
-			  char *, char *, char *, char *, char *, char *);
+			  char *, char *, char *, char *, char *);
 
 extern int user_modes_from_c_to_bitmask[];
 extern void show_isupport(struct Client *);
diff -uNrd ircd-ratbox-1.2-3+ipmask/include/s_user.h.orig ircd-ratbox-1.2-3/include/s_user.h.orig
--- ircd-ratbox-1.2-3+ipmask/include/s_user.h.orig	Tue Jul  8 08:21:53 2003
+++ ircd-ratbox-1.2-3/include/s_user.h.orig	Wed Dec 31 17:00:00 1969
@@ -1,53 +0,0 @@
-/*
- *  ircd-ratbox: A slightly useful ircd.
- *  s_user.h: A header for the user functions.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002 ircd-ratbox development team
- *
- *  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: s_user.h,v 7.24.2.3 2003/07/08 15:21:53 leeh Exp $
- */
-
-#ifndef INCLUDED_s_user_h
-#define INCLUDED_s_user_h
-
-#include "config.h"
-
-struct Client;
-extern time_t LastUsedWallops;
-
-extern int valid_hostname(const char *hostname);
-extern int valid_username(const char *username);
-
-extern int user_mode(struct Client *, struct Client *, int, char **);
-extern void send_umode(struct Client *, struct Client *, int, int, char *);
-extern void send_umode_out(struct Client *, struct Client *, int);
-extern int show_lusers(struct Client *source_p);
-extern int register_local_user(struct Client *, struct Client *, char *, char *);
-extern int register_remote_user(struct Client *, struct Client *, char *, char *);
-extern int do_local_user(char *, struct Client *, struct Client *, char *, char *, char *, char *);
-
-extern int do_remote_user(char *, struct Client *, struct Client *,
-			  char *, char *, char *, char *, char *);
-
-extern int user_modes_from_c_to_bitmask[];
-extern void show_isupport(struct Client *);
-
-
-#endif
diff -uNrd ircd-ratbox-1.2-3+ipmask/include/whowas.h ircd-ratbox-1.2-3/include/whowas.h
--- ircd-ratbox-1.2-3+ipmask/include/whowas.h	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/include/whowas.h	Thu Jun 26 07:01:42 2003
@@ -51,7 +51,6 @@
 	char name[NICKLEN];
 	char username[USERLEN + 1];
 	char hostname[HOSTLEN + 1];
-	char rhostname[HOSTLEN + 1];
 	const char *servername;
 	char realname[REALLEN + 1];
 	time_t logoff;
diff -uNrd ircd-ratbox-1.2-3+ipmask/include/whowas.h.orig ircd-ratbox-1.2-3/include/whowas.h.orig
--- ircd-ratbox-1.2-3+ipmask/include/whowas.h.orig	Thu Jun 26 07:01:42 2003
+++ ircd-ratbox-1.2-3/include/whowas.h.orig	Wed Dec 31 17:00:00 1969
@@ -1,107 +0,0 @@
-/*
- *  ircd-ratbox: A slightly useful ircd.
- *  whowas.h: Header for the whowas functions.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002 ircd-ratbox development team
- *
- *  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: whowas.h,v 7.15.2.1 2003/06/26 14:01:42 androsyn Exp $
- */
-#ifndef INCLUDED_whowas_h
-#define INCLUDED_whowas_h
-
-#include "ircd_defs.h"
-#include "client.h"
-
-#include "setup.h"
-
-/*
- * Whowas hash table size
- *
- */
-#define WW_MAX 65536
-
-struct User;
-struct Client;
-
-/*
-  lets speed this up...
-  also removed away information. *tough*
-  - Dianora
- */
-struct Whowas
-{
-	int hashv;
-	char name[NICKLEN];
-	char username[USERLEN + 1];
-	char hostname[HOSTLEN + 1];
-	const char *servername;
-	char realname[REALLEN + 1];
-	time_t logoff;
-	struct Client *online;	/* Pointer to new nickname for chasing or NULL */
-	struct Whowas *next;	/* for hash table... */
-	struct Whowas *prev;	/* for hash table... */
-	struct Whowas *cnext;	/* for client struct linked list */
-	struct Whowas *cprev;	/* for client struct linked list */
-};
-
-/*
-** initwhowas
-*/
-extern void initwhowas(void);
-
-/*
-** add_history
-**      Add the currently defined name of the client to history.
-**      usually called before changing to a new name (nick).
-**      Client must be a fully registered user (specifically,
-**      the user structure must have been allocated).
-*/
-void add_history(struct Client *, int);
-
-/*
-** off_history
-**      This must be called when the client structure is about to
-**      be released. History mechanism keeps pointers to client
-**      structures and it must know when they cease to exist. This
-**      also implicitly calls AddHistory.
-*/
-void off_history(struct Client *);
-
-/*
-** get_history
-**      Return the current client that was using the given
-**      nickname within the timelimit. Returns NULL, if no
-**      one found...
-*/
-struct Client *get_history(char *, time_t);
-					/* Nick name */
-					/* Time limit in seconds */
-
-/*
-** for debugging...counts related structures stored in whowas array.
-*/
-void count_whowas_memory(int *, u_long *);
-
-/* XXX m_whowas.c in modules needs these */
-extern struct Whowas WHOWAS[];
-extern struct Whowas *WHOWASHASH[];
-extern unsigned int hash_whowas_name(const char *name);
-
-#endif /* INCLUDED_whowas_h */
diff -uNrd ircd-ratbox-1.2-3+ipmask/modules/Makefile.in ircd-ratbox-1.2-3/modules/Makefile.in
--- ircd-ratbox-1.2-3+ipmask/modules/Makefile.in	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/modules/Makefile.in	Fri Sep  5 17:03:03 2003
@@ -87,7 +87,6 @@
   m_set.c \
   m_stats.c \
   m_svinfo.c \
-  m_svs.c \
   m_tb.c \
   m_testline.c \
   m_time.c \
diff -uNrd ircd-ratbox-1.2-3+ipmask/modules/Makefile.in.orig ircd-ratbox-1.2-3/modules/Makefile.in.orig
--- ircd-ratbox-1.2-3+ipmask/modules/Makefile.in.orig	Fri Sep  5 17:03:03 2003
+++ ircd-ratbox-1.2-3/modules/Makefile.in.orig	Wed Dec 31 17:00:00 1969
@@ -1,215 +0,0 @@
-#
-# Makefile.in for ircd/modules
-#
-# $Id: Makefile.in,v 1.81.2.5 2003/09/06 00:03:03 leeh Exp $
-#
-CC		= @CC@
-AR		= @AR@
-RANLIB		= @RANLIB@
-RM		= @RM@
-SED             = @SED@
-LEX		= @LEX@
-LEXLIB		= @LEXLIB@
-CFLAGS		= @IRC_CFLAGS@ -DIRCD_PREFIX=\"@prefix@\"
-PICFLAGS	= @PICFLAGS@
-MKDEP		= @MKDEP@ -DIRCD_PREFIX=\"@prefix@\"
-INSTALL		= @INSTALL@
-INSTALL_PROGRAM	= @INSTALL_PROGRAM@
-INSTALL_DATA	= @INSTALL_DATA@
-INSTALL_SUID    = @INSTALL_PROGRAM@ -o root -m 4755
-SEDOBJ		= @SEDOBJ@
-SHELL		= /bin/sh
-MV		= @MV@
-LD		= @LD@
-
-SSL_LIBS	= @SSL_LIBS@
-SSL_INCLUDES	= @SSL_INCLUDES@
-
-IRCDLIBS        = @LIBS@ $(SSL_LIBS)
-
-prefix          = @prefix@
-# Change this later! -- adrian
-moduledir       = @prefix@/modules
-automoduledir   = @prefix@/modules/autoload
-
-INCLUDES	= -I../include -I../adns $(SSL_INCLUDES)
-CPPFLAGS	= ${INCLUDES} @CPPFLAGS@
-
-CORE_SRCS = \
-  core/m_die.c \
-  core/m_kick.c \
-  core/m_kill.c \
-  core/m_message.c \
-  core/m_mode.c \
-  core/m_nick.c \
-  core/m_part.c \
-  core/m_quit.c \
-  core/m_server.c \
-  core/m_sjoin.c \
-  core/m_squit.c
-
-SRCS =                          \
-  m_accept.c \
-  m_admin.c \
-  m_away.c \
-  m_capab.c \
-  m_challenge.c \
-  m_close.c \
-  m_connect.c \
-  m_cryptlink.c \
-  m_encap.c \
-  m_eob.c \
-  m_etrace.c \
-  m_gline.c \
-  m_help.c \
-  m_info.c \
-  m_invite.c \
-  m_ison.c \
-  m_join.c \
-  m_kline.c \
-  m_knock.c \
-  m_links.c \
-  m_list.c \
-  m_locops.c \
-  m_lusers.c \
-  m_map.c \
-  m_motd.c \
-  m_names.c \
-  m_oper.c \
-  m_operwall.c \
-  m_pass.c \
-  m_ping.c \
-  m_pong.c \
-  m_post.c \
-  m_rehash.c \
-  m_restart.c \
-  m_resv.c \
-  m_set.c \
-  m_stats.c \
-  m_svinfo.c \
-  m_tb.c \
-  m_testline.c \
-  m_time.c \
-  m_topic.c \
-  m_trace.c \
-  m_unkline.c \
-  m_user.c \
-  m_userhost.c \
-  m_users.c \
-  m_version.c \
-  m_wallops.c \
-  m_who.c \
-  m_whois.c \
-  m_whowas.c \
-  m_xline.c
-
-ALL_SRCS = $(CORE_SRCS) \
-           $(SRCS)
-
-SH_OBJS = ${SRCS:.c=.so}
-SH_CORE_OBJS = ${CORE_SRCS:.c=.so}
-
-HPUX_OBJS = ${SH_OBJS:.so=.sl}
-HPUX_CORE_OBJS = ${SH_CORE_OBJS:.so=.sl}
-
-S_OBJS = ${ALL_SRCS:.c=.o}
-
-DOLLAR = $$
-
-default:	build
-build: all
-all: @MOD_TARGET@
-
-shared_modules: $(SH_CORE_OBJS) $(SH_OBJS)
-
-hpux_modules: $(HPUX_CORE_OBJS) $(HPUX_OBJS)
-
-hpux_shared: $(SH_CORE_OBJS) $(SH_OBJS)
-	${MAKE} hpux_modules
-
-libmodules.a: $(S_OBJS)
-	$(RM) -f $@
-	$(AR) cqv $@ $(S_OBJS) 
-	$(RANLIB) $@
-
-
-install-mkdirs:
-	-@if test ! -d $(prefix); then \
-                echo "mkdir $(prefix)"; \
-                mkdir $(prefix); \
-        fi
-	
-	-@if test -d $(moduledir)-old; then \
-		echo "rm -rf $(moduledir)-old"; \
-		rm -rf $(moduledir)-old; \
-	fi
-	-@if test -d $(moduledir); then \
-		echo "mv $(moduledir) $(moduledir)-old"; \
-		mv $(moduledir) $(moduledir)-old; \
-	fi
-
-	-@if test ! -d $(moduledir); then \
-                echo "mkdir $(moduledir)"; \
-                mkdir $(moduledir); \
-        fi
-	-@if test ! -d $(automoduledir); then \
-                echo "mkdir $(automoduledir)"; \
-                mkdir $(automoduledir); \
-        fi
-
-install: install_@MOD_TARGET@
-
-install_libmodules.a: libmodules.a
-# Ye olde noop here.	
-
-install_shared_modules: install-mkdirs
-	@echo "Installing core modules into $(moduledir) .."
-	@for file in $(SH_CORE_OBJS); do \
-		$(INSTALL_DATA) $$file $(moduledir); \
-	done
-	@echo "Installing modules into $(automoduledir) .."
-	@for file in $(SH_OBJS); do \
-		$(INSTALL_DATA) $$file $(automoduledir); \
-	done
-
-install_hpux_shared: install-mkdirs
-	@echo "Installing core modules into $(moduledir) .."
-	@for file in $(HPUX_CORE_OBJS); do \
-		$(INSTALL_DATA) $$file $(moduledir); \
-	done
-	@echo "Installing modules into $(automoduledir) .."
-	@for file in $(HPUX_OBJS); do \
-		$(INSTALL_DATA) $$file $(automoduledir); \
-	done
-
-.SUFFIXES: .sl .so .o
-
-.c.o:
-	${CC} ${CPPFLAGS} ${CFLAGS} -c $< -o $@
-
-.c.so:
-	${CC} ${PICFLAGS} ${CPPFLAGS} ${CFLAGS} $< -o $@
-
-.so.sl:
-	$(LD) -b $< -o $@
-
-.PHONY: depend clean distclean
-depend:
-	@$(RM) -f .depend
-	${MKDEP} ${CPPFLAGS} ${ALL_SRCS} > .depend
-	@$(SED) -e '${SEDOBJ}' < .depend > .depend.tmp-1
-	@$(SED) -e 's/^m_\(die\|kick\|kill\|message\|mode\|nick\|part\|quit\|server\|sjoin\|squit\)/core\/m_\1/' .depend.tmp-1 > .depend.tmp
-	@$(MV) -f .depend.tmp .depend
-	@$(RM) -f .depend.tmp-1
-
-clean:
-	${RM} -f *.so *.sl *~ *.o *.a
-	${RM} -f core/*.so core/*.sl core/*~ core/*.o
-
-lint:
-	lint -aacgprxhH ${CPPFLAGS} -DIRCD_PREFIX=\"@prefix@\" $(ALL_SRCS) >../lint.out
-
-distclean: clean
-	${RM} -f Makefile
-
-include .depend
diff -uNrd ircd-ratbox-1.2-3+ipmask/modules/core/m_nick.c ircd-ratbox-1.2-3/modules/core/m_nick.c
--- ircd-ratbox-1.2-3+ipmask/modules/core/m_nick.c	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/modules/core/m_nick.c	Thu Jun 26 07:02:37 2003
@@ -286,7 +286,7 @@
 	}
 
 	/* parc == 3 on nickchange, parc == 9 on new nick */
-	if((IsClient(source_p) && (parc != 3)) || (IsServer(source_p) && ((parc != 9) && (parc != 10))))
+	if((IsClient(source_p) && (parc != 3)) || (IsServer(source_p) && (parc != 9)))
 	{
 		char tbuf[BUFSIZE] = { 0 };
 		int j;
@@ -315,19 +315,19 @@
 			    (parc == 9 ? parv[7] : (char *)source_p->user->server)))
 		return;
 
-	if(parc == 9 || parc == 10)
+	if(parc == 9)
 	{
 		if(check_clean_user(client_p, nick, parv[5], parv[7]) ||
 		   check_clean_host(client_p, nick, parv[6], parv[7]))
 			return;
 
 		/* check the length of the clients gecos */
-		if(strlen(parv[(parc > 9)? 9 : 8]) > REALLEN)
+		if(strlen(parv[8]) > REALLEN)
 		{
 			sendto_realops_flags(UMODE_ALL, L_ALL,
 					     "Long realname from server %s for %s", parv[7],
 					     parv[1]);
-			parv[(parc > 9)? 9 : 8][REALLEN] = '\0';
+			parv[8][REALLEN] = '\0';
 		}
 
 		if(IsServer(source_p))
@@ -385,7 +385,7 @@
 	char *name;
 
 	id = parv[8];
-	name = parv[(parc > 10)? 10 : 9];
+	name = parv[9];
 
 	/* parse the nickname */
 	strlcpy(nick, parv[1], sizeof(nick));
@@ -670,7 +670,7 @@
 			}
 
 			return do_remote_user(nick, client_p, source_p, parv[5], parv[6],
-					      parv[7], (parc > 9)? parv[8] : NULL, parv[(parc > 9)? 9 : 8], NULL);
+					      parv[7], parv[8], NULL);
 		}
 	}
 	else if(source_p->name[0])
@@ -747,7 +747,7 @@
 
 	}
 
-	return do_remote_user(nick, client_p, source_p, parv[5], parv[6], parv[7], (parc > 10)? parv[9] : NULL, name, id);
+	return do_remote_user(nick, client_p, source_p, parv[5], parv[6], parv[7], name, id);
 }
 
 static int
diff -uNrd ircd-ratbox-1.2-3+ipmask/modules/core/m_nick.c.orig ircd-ratbox-1.2-3/modules/core/m_nick.c.orig
--- ircd-ratbox-1.2-3+ipmask/modules/core/m_nick.c.orig	Thu Jun 26 07:02:37 2003
+++ ircd-ratbox-1.2-3/modules/core/m_nick.c.orig	Wed Dec 31 17:00:00 1969
@@ -1,926 +0,0 @@
-/*
- *  ircd-ratbox: an advanced Internet Relay Chat Daemon(ircd).
- *  m_nick.c: Sets a users nick.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002 ircd-ratbox development team
- *
- *  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_nick.c,v 1.122.2.1 2003/06/26 14:02:37 androsyn Exp $
- */
-
-#include "stdinc.h"
-#include "handlers.h"
-#include "client.h"
-#include "hash.h"
-#include "fdlist.h"
-#include "irc_string.h"
-#include "ircd.h"
-#include "numeric.h"
-#include "s_conf.h"
-#include "s_stats.h"
-#include "s_user.h"
-#include "hash.h"
-#include "whowas.h"
-#include "s_serv.h"
-#include "send.h"
-#include "channel.h"
-#include "s_log.h"
-#include "resv.h"
-#include "msg.h"
-#include "parse.h"
-#include "modules.h"
-#include "common.h"
-#include "packet.h"
-
-
-static void mr_nick(struct Client *, struct Client *, int, char **);
-static void m_nick(struct Client *, struct Client *, int, char **);
-static void ms_nick(struct Client *, struct Client *, int, char **);
-
-static void ms_client(struct Client *, struct Client *, int, char **);
-
-static int nick_from_server(struct Client *, struct Client *, int, char **, time_t, char *);
-static int client_from_server(struct Client *, struct Client *, int, char **, time_t, char *);
-
-static int check_clean_nick(struct Client *, struct Client *, char *, char *, char *);
-static int check_clean_user(struct Client *, char *, char *, char *);
-static int check_clean_host(struct Client *, char *, char *, char *);
-
-static int clean_nick_name(char *);
-static int clean_user_name(char *);
-static int clean_host_name(char *);
-
-static int perform_nick_collides(struct Client *, struct Client *,
-				 struct Client *, int, char **, time_t, char *);
-
-
-struct Message nick_msgtab = {
-	"NICK", 0, 0, 1, 0, MFLG_SLOW, 0,
-	{mr_nick, m_nick, ms_nick, m_nick}
-};
-
-struct Message client_msgtab = {
-	"CLIENT", 0, 0, 10, 0, MFLG_SLOW, 0,
-	{m_ignore, m_ignore, ms_client, m_ignore}
-};
-
-#ifndef STATIC_MODULES
-void
-_modinit(void)
-{
-	mod_add_cmd(&nick_msgtab);
-	mod_add_cmd(&client_msgtab);
-}
-
-void
-_moddeinit(void)
-{
-	mod_del_cmd(&nick_msgtab);
-	mod_del_cmd(&client_msgtab);
-}
-
-const char *_version = "$Revision: 1.122.2.1 $";
-#endif
-
-/*
- * mr_nick()
- *
- *       parv[0] = sender prefix
- *       parv[1] = nickname
- */
-static void
-mr_nick(struct Client *client_p, struct Client *source_p, int parc, char *parv[])
-{
-	struct Client *target_p;
-	char nick[NICKLEN];
-	char *s;
-
-	if(parc < 2 || BadPtr(parv[1]))
-	{
-		sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN),
-			   me.name, BadPtr(parv[0]) ? "*" : parv[0]);
-		return;
-	}
-
-	/* Terminate the nick at the first ~ */
-	if((s = strchr(parv[1], '~')))
-		*s = '\0';
-
-	/* and if the first ~ was the first letter.. */
-	if(BadPtr(parv[1]))
-	{
-		sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME),
-			   me.name, BadPtr(parv[0]) ? "*" : parv[0], parv[1]);
-		return;
-	}
-
-	/* copy the nick and terminate it */
-	strlcpy(nick, parv[1], sizeof(nick));
-
-	/* check the nickname is ok */
-	if(!clean_nick_name(nick))
-	{
-		sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME),
-			   me.name, BadPtr(parv[0]) ? "*" : parv[0], parv[1]);
-		return;
-	}
-
-	/* check if the nick is resv'd */
-	if(find_nick_resv(nick))
-	{
-		sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
-			   me.name, BadPtr(parv[0]) ? "*" : parv[0], nick);
-		return;
-	}
-
-	if((target_p = find_client(nick)) == NULL)
-	{
-		set_initial_nick(client_p, source_p, nick);
-		return;
-	}
-	else if(source_p == target_p)
-	{
-		strcpy(source_p->name, nick);
-		return;
-	}
-	else
-	{
-		sendto_one(source_p, form_str(ERR_NICKNAMEINUSE), me.name, "*", nick);
-	}
-}
-
-/*
- * m_nick()
- *
- *     parv[0] = sender prefix
- *     parv[1] = nickname
- */
-static void
-m_nick(struct Client *client_p, struct Client *source_p, int parc, char *parv[])
-{
-	char nick[NICKLEN];
-	struct Client *target_p;
-
-	if(parc < 2 || BadPtr(parv[1]))
-	{
-		sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, parv[0]);
-		return;
-	}
-
-	/* mark end of grace period, to prevent nickflooding */
-	if(!IsFloodDone(source_p))
-		flood_endgrace(source_p);
-
-	/* terminate nick to NICKLEN */
-	strlcpy(nick, parv[1], sizeof(nick));
-
-	/* check the nickname is ok */
-	if(!clean_nick_name(nick))
-	{
-		sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME), me.name, parv[0], nick);
-		return;
-	}
-
-	if(find_nick_resv(nick))
-	{
-		sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE), me.name, parv[0], nick);
-		return;
-	}
-
-	if((target_p = find_client(nick)))
-	{
-		/* If(target_p == source_p) the client is changing nicks between
-		 * equivalent nicknames ie: [nick] -> {nick}
-		 */
-
-		if(target_p == source_p)
-		{
-			/* check the nick isnt exactly the same */
-			if(strcmp(target_p->name, nick))
-			{
-				change_local_nick(client_p, source_p, nick);
-				return;
-			}
-			else
-			{
-				/* client is doing :old NICK old
-				 * ignore it..
-				 */
-				return;
-			}
-		}
-
-		/* if the client that has the nick isnt registered yet (nick but no
-		 * user) then drop the unregged client
-		 */
-		if(IsUnknown(target_p))
-		{
-			/* the old code had an if(MyConnect(target_p)) here.. but I cant see
-			 * how that can happen, m_nick() is local only --fl_
-			 */
-
-			exit_client(NULL, target_p, &me, "Overridden");
-			change_local_nick(client_p, source_p, nick);
-			return;
-		}
-		else
-		{
-			sendto_one(source_p, form_str(ERR_NICKNAMEINUSE), me.name, parv[0], nick);
-			return;
-		}
-
-	}
-	else
-	{
-		change_local_nick(client_p, source_p, nick);
-		return;
-	}
-}
-
-/*
- * ms_nick()
- *      
- * server -> server nick change
- *    parv[0] = sender prefix
- *    parv[1] = nickname
- *    parv[2] = TS when nick change
- *
- * server introducing new nick
- *    parv[0] = sender prefix
- *    parv[1] = nickname
- *    parv[2] = hop count
- *    parv[3] = TS
- *    parv[4] = umode
- *    parv[5] = username
- *    parv[6] = hostname
- *    parv[7] = server
- *    parv[8] = ircname
- */
-static void
-ms_nick(struct Client *client_p, struct Client *source_p, int parc, char *parv[])
-{
-	struct Client *target_p;
-	char nick[NICKLEN];
-	time_t newts = 0;
-
-	if(parc < 2 || BadPtr(parv[1]))
-	{
-		sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, parv[0]);
-		return;
-	}
-
-	/* parc == 3 on nickchange, parc == 9 on new nick */
-	if((IsClient(source_p) && (parc != 3)) || (IsServer(source_p) && (parc != 9)))
-	{
-		char tbuf[BUFSIZE] = { 0 };
-		int j;
-
-		for (j = 0; j < parc; j++)
-		{
-			strcat(tbuf, parv[j]);
-			strcat(tbuf, " ");
-		}
-
-		sendto_realops_flags(UMODE_ALL, L_ALL,
-				     "Dropping server %s due to (invalid) command 'NICK' "
-				     "with only %d arguments.  (Buf: '%s')",
-				     client_p->name, parc, tbuf);
-		ilog(L_CRIT, "Insufficient parameters (%d) for command 'NICK' from %s.  Buf: %s",
-		     parc, client_p->name, tbuf);
-		exit_client(client_p, client_p, client_p,
-			    "Not enough arguments to server command.");
-		return;
-	}
-
-	/* fix the length of the nick */
-	strlcpy(nick, parv[1], sizeof(nick));
-
-	if(check_clean_nick(client_p, source_p, nick, parv[1], 
-			    (parc == 9 ? parv[7] : (char *)source_p->user->server)))
-		return;
-
-	if(parc == 9)
-	{
-		if(check_clean_user(client_p, nick, parv[5], parv[7]) ||
-		   check_clean_host(client_p, nick, parv[6], parv[7]))
-			return;
-
-		/* check the length of the clients gecos */
-		if(strlen(parv[8]) > REALLEN)
-		{
-			sendto_realops_flags(UMODE_ALL, L_ALL,
-					     "Long realname from server %s for %s", parv[7],
-					     parv[1]);
-			parv[8][REALLEN] = '\0';
-		}
-
-		if(IsServer(source_p))
-			newts = atol(parv[3]);
-	}
-	else
-	{
-		if(!IsServer(source_p))
-			newts = atol(parv[2]);
-	}
-
-	/* if the nick doesnt exist, allow it and process like normal */
-	if(!(target_p = find_client(nick)))
-	{
-		nick_from_server(client_p, source_p, parc, parv, newts, nick);
-		return;
-	}
-
-	/* we're not living in the past anymore, an unknown client is local only. */
-	if(IsUnknown(target_p))
-	{
-		exit_client(NULL, target_p, &me, "Overridden");
-		nick_from_server(client_p, source_p, parc, parv, newts, nick);
-		return;
-	}
-
-	if(target_p == source_p)
-	{
-		if(strcmp(target_p->name, nick))
-		{
-			/* client changing case of nick */
-			nick_from_server(client_p, source_p, parc, parv, newts, nick);
-			return;
-		}
-		else
-			/* client not changing nicks at all */
-			return;
-	}
-
-	perform_nick_collides(source_p, client_p, target_p, parc, parv, newts, nick);
-
-
-}
-
-/*
- * ms_client()
- */
-static void
-ms_client(struct Client *client_p, struct Client *source_p, int parc, char *parv[])
-{
-	struct Client *target_p;
-	char nick[NICKLEN];
-	time_t newts = 0;
-	char *id;
-	char *name;
-
-	id = parv[8];
-	name = parv[9];
-
-	/* parse the nickname */
-	strlcpy(nick, parv[1], sizeof(nick));
-
-	/* check the nicknames, usernames and hostnames are ok */
-	if(check_clean_nick(client_p, source_p, nick, parv[1], parv[7]) ||
-	   check_clean_user(client_p, nick, parv[5], parv[7]) ||
-	   check_clean_host(client_p, nick, parv[6], parv[7]))
-		return;
-
-	/* check length of clients gecos */
-	if(strlen(name) > REALLEN)
-	{
-		sendto_realops_flags(UMODE_ALL, L_ALL, "Long realname from server %s for %s",
-				     parv[0], parv[1]);
-		name[REALLEN] = '\0';
-	}
-
-	newts = atol(parv[3]);
-
-	/* if there is an ID collision, kill our client, and kill theirs.
-	 * this may generate 401's, but it ensures that both clients always
-	 * go, even if the other server refuses to do the right thing.
-	 */
-	if((target_p = find_id(id)))
-	{
-		sendto_realops_flags(UMODE_ALL, L_ALL,
-				     "ID collision on %s(%s <- %s)(both killed)",
-				     target_p->name, target_p->from->name, client_p->name);
-
-		kill_client_serv_butone(NULL, target_p, "%s (ID collision)", me.name);
-
-		ServerStats->is_kill++;
-
-		target_p->flags |= FLAGS_KILLED;
-		exit_client(client_p, target_p, &me, "ID Collision");
-		return;
-	}
-
-	if(!(target_p = find_client(nick)))
-	{
-		client_from_server(client_p, source_p, parc, parv, newts, nick);
-		return;
-	}
-
-
-	if(IsUnknown(target_p))
-	{
-		exit_client(NULL, target_p, &me, "Overridden");
-		client_from_server(client_p, source_p, parc, parv, newts, nick);
-		return;
-	}
-
-	perform_nick_collides(source_p, client_p, target_p, parc, parv, newts, nick);
-}
-
-
-/* 
- * check_clean_nick()
- * 
- * input	- pointer to source
- *		- nickname
- *		- truncated nickname
- *		- origin of client
- * output	- none
- * side effects - if nickname is erroneous, or a different length to
- *                truncated nickname, return 1
- */
-static int
-check_clean_nick(struct Client *client_p, struct Client *source_p,
-		 char *nick, char *newnick, char *server)
-{
-	/* the old code did some wacky stuff here, if the nick is invalid, kill it
-	 * and dont bother messing at all
-	 */
-
-	/*
-	 * Zero length nicks are bad too..this shouldn't happen but..
-	 */
-
-	if(!clean_nick_name(nick) || strcmp(nick, newnick) || nick[0] == '\0')
-	{
-		ServerStats->is_kill++;
-		sendto_realops_flags(UMODE_DEBUG, L_ALL,
-				     "Bad Nick: %s From: %s(via %s)", nick, server, client_p->name);
-
-		sendto_one(client_p, ":%s KILL %s :%s (Bad Nickname)", me.name, newnick, me.name);
-
-		/* bad nick change */
-		if(source_p != client_p)
-		{
-			kill_client_serv_butone(client_p, source_p, "%s (Bad Nickname)", me.name);
-			source_p->flags |= FLAGS_KILLED;
-			exit_client(client_p, source_p, &me, "Bad Nickname");
-		}
-
-		return 1;
-	}
-
-	return 0;
-}
-
-/* check_clean_user()
- * 
- * input	- pointer to client sending data
- *              - nickname
- *              - username to check
- *		- origin of NICK
- * output	- none
- * side effects - if username is erroneous, return 1
- */
-static int
-check_clean_user(struct Client *client_p, char *nick, char *user, char *server)
-{
-	if(strlen(user) > USERLEN)
-	{
-		ServerStats->is_kill++;
-		sendto_realops_flags(UMODE_DEBUG, L_ALL,
-				     "Long Username: %s Nickname: %s From: %s(via %s)",
-				     user, nick, server, client_p->name);
-
-		sendto_one(client_p, ":%s KILL %s :%s (Bad Username)", me.name, nick, me.name);
-
-		return 1;
-	}
-
-	if(!clean_user_name(user))
-		sendto_realops_flags(UMODE_DEBUG, L_ALL,
-				     "Bad Username: %s Nickname: %s From: %s(via %s)",
-				     user, nick, server, client_p->name);
-
-	return 0;
-}
-
-/* check_clean_host()
- * 
- * input	- pointer to client sending us data
- *              - nickname
- *              - hostname to check
- *		- source name
- * output	- none
- * side effects - if hostname is erroneous, return 1
- */
-static int
-check_clean_host(struct Client *client_p, char *nick, char *host, char *server)
-{
-	if(strlen(host) > HOSTLEN)
-	{
-		ServerStats->is_kill++;
-		sendto_realops_flags(UMODE_DEBUG, L_ALL,
-				     "Long Hostname: %s Nickname: %s From: %s(via %s)",
-				     host, nick, server, client_p->name);
-
-		sendto_one(client_p, ":%s KILL %s :%s (Bad Hostname)", me.name, nick, me.name);
-
-		return 1;
-	}
-
-	if(!clean_host_name(host))
-		sendto_realops_flags(UMODE_DEBUG, L_ALL,
-				     "Bad Hostname: %s Nickname: %s From: %s(via %s)",
-				     host, nick, server, client_p->name);
-
-	return 0;
-}
-
-/* clean_nick_name()
- *
- * input	- nickname
- * output	- none
- * side effects - walks through the nickname, returning 0 if erroneous
- */
-static int
-clean_nick_name(char *nick)
-{
-	s_assert(nick);
-	if(nick == NULL)
-		return 0;
-
-	/* nicks cant start with a digit or -, and must have a length */
-	if(*nick == '-' || IsDigit(*nick) || !*nick)
-		return 0;
-
-	for (; *nick; nick++)
-	{
-		if(!IsNickChar(*nick))
-			return 0;
-	}
-
-	return 1;
-}
-
-/* clean_user_name()
- *
- * input	- username
- * output	- none
- * side effects - walks through the username, returning 0 if erroneous
- */
-static int
-clean_user_name(char *user)
-{
-	s_assert(user);
-	if(user == NULL)
-		return 0;
-
-	for (; *user; user++)
-	{
-		if(!IsUserChar(*user))
-			return 0;
-
-	}
-
-	return 1;
-}
-
-/* clean_host_name()
- * input	- hostname
- * output	- none
- * side effects - walks through the hostname, returning 0 if erroneous
- */
-static int
-clean_host_name(char *host)
-{
-	s_assert(host);
-	if(host == NULL)
-		return 0;
-	for (; *host; host++)
-	{
-		if(!IsHostChar(*host))
-			return 0;
-	}
-
-	return 1;
-}
-
-
-/*
- * nick_from_server()
- */
-static int
-nick_from_server(struct Client *client_p, struct Client *source_p, int parc,
-		 char *parv[], time_t newts, char *nick)
-{
-	if(IsServer(source_p))
-	{
-		/* A server introducing a new client, change source */
-		source_p = make_client(client_p);
-		add_client_to_list(source_p);
-
-		if(parc > 2)
-			source_p->hopcount = atoi(parv[2]);
-		if(newts)
-			source_p->tsinfo = newts;
-		else
-		{
-			newts = source_p->tsinfo = CurrentTime;
-			ts_warn("Remote nick %s (%s) introduced without a TS", nick, parv[0]);
-		}
-
-		/* copy the nick in place */
-		(void) strcpy(source_p->name, nick);
-		(void) add_to_client_hash_table(nick, source_p);
-
-		if(parc > 8)
-		{
-			int flag;
-			char *m;
-
-			/* parse usermodes */
-			m = &parv[4][1];
-			while (*m)
-			{
-				flag = user_modes_from_c_to_bitmask[(unsigned char) *m];
-				if(!(source_p->umodes & UMODE_INVISIBLE)
-				   && (flag & UMODE_INVISIBLE))
-					Count.invisi++;
-				if(!(source_p->umodes & UMODE_OPER) && (flag & UMODE_OPER))
-					Count.oper++;
-
-				source_p->umodes |= flag & SEND_UMODES;
-				m++;
-			}
-
-			return do_remote_user(nick, client_p, source_p, parv[5], parv[6],
-					      parv[7], parv[8], NULL);
-		}
-	}
-	else if(source_p->name[0])
-	{
-		/* client changing their nick */
-		if(irccmp(parv[0], nick))
-			source_p->tsinfo = newts ? newts : CurrentTime;
-
-		sendto_common_channels_local(source_p, ":%s!%s@%s NICK :%s",
-					     source_p->name, source_p->username, source_p->host,
-					     nick);
-
-		if(source_p->user)
-		{
-			add_history(source_p, 1);
-			sendto_server(client_p, NULL, NOCAPS, NOCAPS,
-				      ":%s NICK %s :%lu",
-				      parv[0], nick, (unsigned long) source_p->tsinfo);
-		}
-	}
-
-	/* set the new nick name */
-	if(source_p->name[0])
-		del_from_client_hash_table(source_p->name, source_p);
-
-	strcpy(source_p->name, nick);
-	add_to_client_hash_table(nick, source_p);
-
-	/* remove all accepts pointing to the client */
-	del_all_accepts(source_p);
-
-	return 0;
-}
-
-
-/*
- * client_from_server()
- */
-static int
-client_from_server(struct Client *client_p, struct Client *source_p, int parc,
-		   char *parv[], time_t newts, char *nick)
-{
-	char *name;
-	char *id;
-	int flag;
-	char *m;
-
-	id = parv[8];
-	name = parv[9];
-
-	source_p = make_client(client_p);
-	add_client_to_list(source_p);
-
-	source_p->hopcount = atoi(parv[2]);
-	source_p->tsinfo = newts;
-
-	/* copy the nick in place */
-	(void) strcpy(source_p->name, nick);
-	(void) add_to_client_hash_table(nick, source_p);
-	add_to_id_hash_table(id, source_p);
-
-	/* parse usermodes */
-	m = &parv[4][1];
-	while (*m)
-	{
-		flag = user_modes_from_c_to_bitmask[(unsigned char) *m];
-		if(flag & UMODE_INVISIBLE)
-			Count.invisi++;
-		if(flag & UMODE_OPER)
-			Count.oper++;
-
-		source_p->umodes |= flag & SEND_UMODES;
-		m++;
-
-	}
-
-	return do_remote_user(nick, client_p, source_p, parv[5], parv[6], parv[7], name, id);
-}
-
-static int
-perform_nick_collides(struct Client *source_p, struct Client *client_p,
-		      struct Client *target_p, int parc, char *parv[], time_t newts, char *nick)
-{
-	int sameuser;
-
-	/* server introducing new nick */
-	if(IsServer(source_p))
-	{
-		/* if we dont have a ts, or their TS's are the same, kill both */
-		if(!newts || !target_p->tsinfo || (newts == target_p->tsinfo))
-		{
-			sendto_realops_flags(UMODE_ALL, L_ALL,
-					     "Nick collision on %s(%s <- %s)(both killed)",
-					     target_p->name, target_p->from->name, client_p->name);
-
-			kill_client_serv_butone(NULL, target_p,
-						"%s (Nick collision (new))", me.name);
-			ServerStats->is_kill++;
-			sendto_one(target_p, form_str(ERR_NICKCOLLISION),
-				   me.name, target_p->name, target_p->name);
-
-			target_p->flags |= FLAGS_KILLED;
-			exit_client(client_p, target_p, &me, "Nick collision (new)");
-			return 0;
-		}
-		/* the timestamps are different */
-		else
-		{
-			sameuser = (target_p->user) && !irccmp(target_p->username, parv[5])
-				&& !irccmp(target_p->host, parv[6]);
-
-			/* if the users are the same (loaded a client on a different server)
-			 * and the new users ts is older, or the users are different and the
-			 * new users ts is newer, ignore the new client and let it do the kill
-			 */
-			if((sameuser && newts < target_p->tsinfo) ||
-			   (!sameuser && newts > target_p->tsinfo))
-			{
-				return 0;
-			}
-			else
-			{
-				if(sameuser)
-					sendto_realops_flags(UMODE_ALL, L_ALL,
-							     "Nick collision on %s(%s <- %s)(older killed)",
-							     target_p->name, target_p->from->name,
-							     client_p->name);
-				else
-					sendto_realops_flags(UMODE_ALL, L_ALL,
-							     "Nick collision on %s(%s <- %s)(newer killed)",
-							     target_p->name, target_p->from->name,
-							     client_p->name);
-
-				ServerStats->is_kill++;
-				sendto_one(target_p, form_str(ERR_NICKCOLLISION),
-					   me.name, target_p->name, target_p->name);
-
-				/* if it came from a LL server, itd have been source_p,
-				 * so we dont need to mark target_p as known
-				 */
-				kill_client_serv_butone(source_p, target_p,
-							"%s (Nick collision (new))", me.name);
-
-				target_p->flags |= FLAGS_KILLED;
-				(void) exit_client(client_p, target_p, &me, "Nick collision");
-
-				if(parc == 9)
-					nick_from_server(client_p, source_p, parc, parv, newts,
-							 nick);
-				else if(parc == 10)
-					client_from_server(client_p, source_p, parc, parv, newts,
-							   nick);
-
-				return 0;
-			}
-		}
-	}
-
-	/* its a client changing nick and causing a collide */
-	if(!newts || !target_p->tsinfo || (newts == target_p->tsinfo) || !source_p->user)
-	{
-		sendto_realops_flags(UMODE_ALL, L_ALL,
-				     "Nick change collision from %s to %s(%s <- %s)(both killed)",
-				     source_p->name, target_p->name, target_p->from->name,
-				     client_p->name);
-
-		ServerStats->is_kill++;
-		sendto_one(target_p, form_str(ERR_NICKCOLLISION),
-			   me.name, target_p->name, target_p->name);
-
-		/* if we got the message from a LL, it knows about source_p */
-		kill_client_serv_butone(NULL, source_p, "%s (Nick change collision)", me.name);
-
-		ServerStats->is_kill++;
-
-		kill_client_serv_butone(NULL, target_p, "%s (Nick change collision)", me.name);
-
-		target_p->flags |= FLAGS_KILLED;
-		exit_client(NULL, target_p, &me, "Nick collision(new)");
-		source_p->flags |= FLAGS_KILLED;
-		exit_client(client_p, source_p, &me, "Nick collision(old)");
-		return 0;
-	}
-	else
-	{
-		sameuser = !irccmp(target_p->username, source_p->username) &&
-			!irccmp(target_p->host, source_p->host);
-
-		if((sameuser && newts < target_p->tsinfo) ||
-		   (!sameuser && newts > target_p->tsinfo))
-		{
-			if(sameuser)
-				sendto_realops_flags(UMODE_ALL, L_ALL,
-						     "Nick change collision from %s to %s(%s <- %s)(older killed)",
-						     source_p->name, target_p->name,
-						     target_p->from->name, client_p->name);
-			else
-				sendto_realops_flags(UMODE_ALL, L_ALL,
-						     "Nick change collision from %s to %s(%s <- %s)(newer killed)",
-						     source_p->name, target_p->name,
-						     target_p->from->name, client_p->name);
-
-			ServerStats->is_kill++;
-
-			/* this won't go back to the incoming link, so LL doesnt matter */
-			kill_client_serv_butone(client_p, source_p,
-						"%s (Nick change collision)", me.name);
-
-			source_p->flags |= FLAGS_KILLED;
-
-			if(sameuser)
-				exit_client(client_p, source_p, &me, "Nick collision(old)");
-			else
-				exit_client(client_p, source_p, &me, "Nick collision(new)");
-			return 0;
-		}
-		else
-		{
-			if(sameuser)
-				sendto_realops_flags(UMODE_ALL, L_ALL,
-						     "Nick collision on %s(%s <- %s)(older killed)",
-						     target_p->name, target_p->from->name,
-						     client_p->name);
-			else
-				sendto_realops_flags(UMODE_ALL, L_ALL,
-						     "Nick collision on %s(%s <- %s)(newer killed)",
-						     target_p->name, target_p->from->name,
-						     client_p->name);
-
-			kill_client_serv_butone(source_p, target_p, "%s (Nick collision)", me.name);
-
-			ServerStats->is_kill++;
-			sendto_one(target_p, form_str(ERR_NICKCOLLISION),
-				   me.name, target_p->name, target_p->name);
-
-			target_p->flags |= FLAGS_KILLED;
-			(void) exit_client(client_p, target_p, &me, "Nick collision");
-		}
-	}
-
-	/*
-	   if(HasID(source_p))
-	   client_from_server(client_p,source_p,parc,parv,newts,nick);
-	   else
-	 */
-
-	/* we should only ever call nick_from_server() here, as
-	 * this is a client changing nick, not a new client
-	 */
-	nick_from_server(client_p, source_p, parc, parv, newts, nick);
-
-	return 0;
-}
diff -uNrd ircd-ratbox-1.2-3+ipmask/modules/m_svs.c ircd-ratbox-1.2-3/modules/m_svs.c
--- ircd-ratbox-1.2-3+ipmask/modules/m_svs.c	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/modules/m_svs.c	Wed Dec 31 17:00:00 1969
@@ -1,243 +0,0 @@
-/************************************************************************
- *   IRC - Internet Relay Chat, doc/example_module.c
- *   Copyright (C) 2001 Hybrid Development Team
- *
- *   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: m_svs.c,v 1.6 2003/11/05 18:29:47 jeremy Exp $
- */
-
-/* List of ircd includes from ../include/ */
-#include "stdinc.h"
-#include "handlers.h"
-#include "client.h"
-#include "common.h"     /* FALSE bleah */
-#include "ircd.h"
-#include "irc_string.h"
-#include "numeric.h"
-#include "fdlist.h"
-#include "s_bsd.h"
-#include "s_conf.h"
-#include "s_log.h"
-#include "s_serv.h"
-#include "send.h"
-#include "msg.h"
-#include "parse.h"
-#include "modules.h"
-
-#include "s_user.h"  /* send_umode_out() */
-#include "channel_mode.h" /* MODE_ADD & MOD_DEL */
-#include "hash.h"
-
-static void ms_svshost(struct Client *client_p, struct Client *source_p,
-                    int parc, char *parv[]);
-static void mo_svshost(struct Client *client_p, struct Client *source_p,
-                    int parc, char *parv[]);
-
-static void remove_host(struct Client *, char *);
-static void change_host(struct Client *, char *, char *);
-
-/* CHGHOST/SVSHOST/SETHOST */
-struct Message svshost_msgtab = {
-  "SVSHOST", 0, 0, 0, 0, MFLG_SLOW, 0,
-  {m_ignore, m_ignore, ms_svshost, m_ignore}
-};
-struct Message chghost_msgtab = {
-  "CHGHOST", 0, 0, 2, 3, MFLG_SLOW, 0,
-  {m_ignore, m_not_oper, m_ignore, mo_svshost}
-};
-struct Message sethost_msgtab = {
-  "SETHOST", 0, 0, 2, 3, MFLG_SLOW, 0,
-  {m_ignore, m_not_oper, m_ignore, mo_svshost}
-};
-
-#ifndef STATIC_MODULES
-/* Here we tell it what to do when the module is loaded */
-void
-_modinit(void)
-{
-  /* This will add the commands in test_msgtab (which is above) */
-  /* SVSHOST/CHGHOST/SETHOST */
-  mod_add_cmd(&svshost_msgtab);
-  mod_add_cmd(&chghost_msgtab);
-  mod_add_cmd(&sethost_msgtab);
-}
-
-/* here we tell it what to do when the module is unloaded */
-void
-_moddeinit(void)
-{
-  /* This will remove the commands in test_msgtab (which is above) */
-  /* SVSHOST/CHGHOST/SETHOST */
-  mod_del_cmd(&svshost_msgtab);
-  mod_del_cmd(&chghost_msgtab);
-  mod_del_cmd(&sethost_msgtab);
-}
-
-/* When we last modified the file (shown in /modlist), this is usually:
- */
-const char *_version = "$Revision: 1.6 $";
-#endif
-
-/*
- * mo_svshost
- *      parv[0] = sender prefix
- *      parv[1] = target nickname
- *      parv[2] = new hostname
- */
-static void mo_svshost(struct Client *client_p, struct Client *source_p,
-                   int parc, char *parv[])
-{
-  struct Client *target_p;
-  char *nick, hostname[HOSTLEN+1];
-  int remove = 0;
-
-  nick = parv[1];
-
-  if(parc > 2)
-    strlcpy(hostname, parv[2], HOSTLEN);
-
-  if(!isalpha(nick[0]))
-    if(nick[0] == '-')
-      remove = 1;
-
-  if(remove > 0)
-    {
-      nick++;
-      remove_host(source_p, nick);
-    }
-  else
-    {
-      if (parc != 3)
-        {
-          sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "CHGHOST");
-          return;
-        }
-      change_host(source_p, nick, (hostname)? hostname : NULL);
-    }
-
-  return;
-}
-
-static void remove_host(struct Client *source_p, char *nick)
-{
-  struct Client *target_p;
-
-  if ((target_p = find_client(nick)) == NULL)
-    {
-      sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, target_p->name);
-      return;
-    }
-
-  strcpy(target_p->host, target_p->rhost);
-
-  sendto_one(source_p, "Reset %s's Host", target_p->name);
-  return;
-}
-
-static void change_host(struct Client *source_p, char *nick, char *host)
-{
-  struct Client *target_p;
-  char oldhost[HOSTLEN+1];
-  int setflags;
-
-  if ((target_p = find_client(nick)) == NULL)
-    {
-      sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, nick);
-      return;
-    }
-
-  /* check at this point for a valid hostname, and if its null
-     which it shouldn't be at this point */
-  if (!valid_hostname(host) || (host == NULL) || (strlen(host) > HOSTLEN))
-    {
-      sendto_one(source_p, "%s :Invalid Hostname", host);
-      return;
-    }
-
-  if(!strchr(host, '.') && !strchr(host, ':'))
-    {
-      sendto_one(source_p, "Hostname's must contain one . or :");
-      return;
-    }
-
-  /* Preserve the old hostname until we are finished */
-  strcpy(oldhost, target_p->host);
-
-  /* Prevent any unnecessary bursts */
-  if(!strcmp(oldhost, host))
-    {
-      sendto_one(source_p, "%s :Hostname Identical", host);
-      return;
-    }
-
-  if(MyClient(target_p) && IsMasked(target_p))
-    {
-      setflags = target_p->umodes;
-      target_p->umodes &= ~UMODE_IPMASK;
-      send_umode_out(target_p, target_p, setflags);
-    }
-
-  strcpy(target_p->host, host);
-  sendto_realops_flags(UMODE_ALL, L_ALL, "CHGHOST was used on %s (%s -> %s)", nick, oldhost, host);
-  ilog(L_NOTICE, "%s changed %s's hostname (%s -> %s)", source_p->name, nick, oldhost, host);
-  sendto_server(NULL, NULL, CAP_IPMASK, NOCAPS, ":%s SVSHOST %s %s %s", source_p->name, target_p->name, oldhost, host);
-
-  sendto_one(source_p, "Changed %s's Host (%s -> %s)", nick, oldhost, host);
-  return;
-}
-
-/*
- * ms_svshost
- *      parv[0] = sender prefix
- *      parv[1] = target nickname
- *      parv[2] = new hostname
- */
-static void ms_svshost(struct Client *client_p, struct Client *source_p,
-                   int parc, char *parv[])
-{
-  struct Client *target_p;
-  char *nick;
-  int setflags;
-  nick = parv[1];
-
-  if (parc != 4)
-    return;
-
-  sendto_server(client_p, NULL, CAP_IPMASK, NOCAPS, ":%s SVSHOST %s %s %s", parv[0], parv[1], parv[2], parv[3]);
-
-  target_p = find_client(nick);  
-  strcpy(target_p->host, parv[3]);
-
-  if(!IsServer(client_p))
-    {
-      sendto_realops_flags(UMODE_ALL, L_ALL, "CHGHOST was used on %s (%s -> %s)", nick, parv[2], parv[3]);
-      ilog(L_NOTICE, "%s changed %s's hostname (%s -> %s)", parv[0], nick, parv[2], parv[3]);
-    }
-  else
-    {
-      /* Changing the host on a masked user?
-         if so pull +X */
-      if(MyClient(target_p) && IsMasked(target_p))
-        {
-          setflags = target_p->umodes;
-          target_p->umodes &= ~UMODE_IPMASK;
-          send_umode_out(target_p, target_p, setflags);
-        }
-      ilog(L_NOTICE, "Caught SVSHOST from server [%s], Possibly a change of UMODE_ISMASK", parv[0]);
-    }
-
-  return;
-}
diff -uNrd ircd-ratbox-1.2-3+ipmask/modules/m_whois.c ircd-ratbox-1.2-3/modules/m_whois.c
--- ircd-ratbox-1.2-3+ipmask/modules/m_whois.c	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/modules/m_whois.c	Sat Aug  2 04:39:27 2003
@@ -281,9 +281,6 @@
 		   target_p->username, target_p->host, target_p->info);
 	server_name = (char *) target_p->user->server;
 
-  if((IsOper(source_p)) || (source_p == target_p))
-    sendto_one(source_p, form_str(RPL_WHOISHOST), me.name, source_p->name, target_p->name, target_p->rhost);
-
 	cur_len = mlen = ircsprintf(buf, form_str(RPL_WHOISCHANNELS), me.name, source_p->name, target_p->name);
 	t = buf + mlen;
 
diff -uNrd ircd-ratbox-1.2-3+ipmask/modules/m_whois.c.orig ircd-ratbox-1.2-3/modules/m_whois.c.orig
--- ircd-ratbox-1.2-3+ipmask/modules/m_whois.c.orig	Sat Aug  2 04:39:27 2003
+++ ircd-ratbox-1.2-3/modules/m_whois.c.orig	Wed Dec 31 17:00:00 1969
@@ -1,367 +0,0 @@
-/*
- *  ircd-ratbox: an advanced Internet Relay Chat Daemon(ircd).
- *  m_whois.c: Shows who a user is.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002 ircd-ratbox development team
- *
- *  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_whois.c,v 1.120.2.2 2003/08/02 11:39:27 leeh Exp $
- */
-
-#include "stdinc.h"
-#include "tools.h"
-#include "common.h"
-#include "handlers.h"
-#include "client.h"
-#include "hash.h"
-#include "channel.h"
-#include "channel_mode.h"
-#include "hash.h"
-#include "ircd.h"
-#include "numeric.h"
-#include "s_conf.h"
-#include "s_serv.h"
-#include "send.h"
-#include "irc_string.h"
-#include "sprintf_irc.h"
-#include "s_conf.h"
-#include "msg.h"
-#include "parse.h"
-#include "modules.h"
-#include "hook.h"
-
-static void do_whois(struct Client *client_p, struct Client *source_p, int parc, char *parv[]);
-static void single_whois(struct Client *source_p, struct Client *target_p, int);
-
-static void m_whois(struct Client *, struct Client *, int, char **);
-static void ms_whois(struct Client *, struct Client *, int, char **);
-static void mo_whois(struct Client *, struct Client *, int, char **);
-
-struct Message whois_msgtab = {
-	"WHOIS", 0, 0, 0, 0, MFLG_SLOW, 0L,
-	{m_unregistered, m_whois, ms_whois, mo_whois}
-};
-
-#ifndef STATIC_MODULES
-void
-_modinit(void)
-{
-	mod_add_cmd(&whois_msgtab);
-}
-
-void
-_moddeinit(void)
-{
-	mod_del_cmd(&whois_msgtab);
-}
-
-const char *_version = "$Revision: 1.120.2.2 $";
-#endif
-/*
-** m_whois
-**      parv[0] = sender prefix
-**      parv[1] = nickname masklist
-*/
-static void
-m_whois(struct Client *client_p, struct Client *source_p, int parc, char *parv[])
-{
-	static time_t last_used = 0;
-
-	if(parc < 2 || BadPtr(parv[1]))
-	{
-		sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, parv[0]);
-		return;
-	}
-
-	if(parc > 2)
-	{
-		/* seeing as this is going across servers, we should limit it */
-		if((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime)
-		{
-			sendto_one(source_p, form_str(RPL_LOAD2HI),
-				   me.name, source_p->name, "WHOIS");
-			return;
-		}
-		else
-			last_used = CurrentTime;
-
-		/* if we have serverhide enabled, they can either ask the clients
-		 * server, or our server.. I dont see why they would need to ask
-		 * anything else for info about the client.. --fl_
-		 */
-		if(ConfigServerHide.disable_remote)
-			parv[1] = parv[2];
-
-		if(hunt_server(client_p, source_p, ":%s WHOIS %s :%s", 1, parc, parv) !=
-		   HUNTED_ISME)
-		{
-			return;
-		}
-		parv[1] = parv[2];
-
-	}
-	do_whois(client_p, source_p, parc, parv);
-}
-
-/*
-** mo_whois
-**      parv[0] = sender prefix
-**      parv[1] = nickname masklist
-*/
-static void
-mo_whois(struct Client *client_p, struct Client *source_p, int parc, char *parv[])
-{
-	if(parc < 2 || BadPtr(parv[1]))
-	{
-		sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, parv[0]);
-		return;
-	}
-
-	if(parc > 2)
-	{
-		if(hunt_server(client_p, source_p, ":%s WHOIS %s :%s", 1, parc, parv) !=
-		   HUNTED_ISME)
-		{
-			return;
-		}
-		parv[1] = parv[2];
-	}
-
-	do_whois(client_p, source_p, parc, parv);
-}
-
-/*
-** ms_whois
-**      parv[0] = sender prefix
-**      parv[1] = nickname masklist
-*/
-static void
-ms_whois(struct Client *client_p, struct Client *source_p, int parc, char *parv[])
-{
-	struct Client *target_p;
-
-	/* its a misconfigured server */
-	if(parc < 3 || BadPtr(parv[2]))
-	{
-		sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, parv[0]);
-		return;
-	}
-
-	if(!IsClient(source_p))
-		return;
-
-	/* check if parv[1] exists */
-	if((target_p = find_client(parv[1])) == NULL)
-	{
-		sendto_one(source_p, form_str(ERR_NOSUCHSERVER), me.name, parv[0], parv[1]);
-		return;
-	}
-
-	/* if parv[1] isnt my client, or me, someone else is supposed
-	 * to be handling the request.. so send it to them 
-	 */
-	if(!MyClient(target_p) && !IsMe(target_p))
-	{
-		sendto_one(target_p->from, ":%s WHOIS %s :%s", parv[0], parv[1], parv[2]);
-		return;
-	}
-
-	/* ok, the target is either us, or a client on our server, so perform the whois
-	 * but first, parv[1] == server to perform the whois on, parv[2] == person
-	 * to whois, so make parv[1] = parv[2] so do_whois is ok -- fl_
-	 */
-	parv[1] = parv[2];
-	do_whois(client_p, source_p, parc, parv);
-	return;
-}
-
-/* do_whois
- *
- * inputs	- pointer to 
- * output	- 
- * side effects -
- */
-static void
-do_whois(struct Client *client_p, struct Client *source_p, int parc, char *parv[])
-{
-	struct Client *target_p;
-	char *nick;
-	char *p = NULL;
-	int glob = 0;
-
-	/* This lets us make all "whois nick" queries look the same, and all
-	 * "whois nick nick" queries look the same.  We have to pass it all
-	 * the way down to whois_person() though -- fl
-	 */
-	if(parc > 2)
-		glob = 1;
-
-	nick = parv[1];
-	if((p = strchr(parv[1], ',')))
-		*p = '\0';
-
-	(void) collapse(nick);
-	if(((target_p = find_client(nick)) != NULL) && IsPerson(target_p))
-	{
-		/* cant give detailed whois on a remote client */
-		if(!MyClient(target_p))
-			glob = 0;
-
-		single_whois(source_p, target_p, glob);
-	}
-	else
-		sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, parv[0], nick);
-
-	sendto_one(source_p, form_str(RPL_ENDOFWHOIS), me.name, parv[0], parv[1]);
-
-	return;
-}
-
-
-/*
- * single_whois()
- *
- * Inputs	- source_p client to report to
- *		- target_p client to report on
- * Output	- if found return 1
- * Side Effects	- do a single whois on given client
- * 		  writing results to source_p
- */
-static void
-single_whois(struct Client *source_p, struct Client *target_p, int glob)
-{
-	char buf[BUFSIZE];
-	const char *name;
-	char *server_name;
-	dlink_node *lp;
-	struct Client *a2client_p;
-	struct Channel *chptr;
-	struct membership *msptr;
-	int cur_len = 0;
-	int mlen;
-	char *t;
-	int tlen;
-	struct hook_mfunc_data hd;
-
-	if(target_p->name[0] == '\0')
-		name = "?";
-	else
-		name = target_p->name;
-
-	if(target_p->user == NULL)
-	{
-		sendto_one(source_p, form_str(RPL_WHOISUSER), me.name,
-			   source_p->name, name,
-			   target_p->username, target_p->host, target_p->info);
-		sendto_one(source_p, form_str(RPL_WHOISSERVER),
-			   me.name, source_p->name, name, "<Unknown>", "*Not On This Net*");
-		return;
-	}
-
-	a2client_p = find_server(target_p->user->server);
-
-	sendto_one(source_p, form_str(RPL_WHOISUSER), me.name,
-		   source_p->name, target_p->name,
-		   target_p->username, target_p->host, target_p->info);
-	server_name = (char *) target_p->user->server;
-
-	cur_len = mlen = ircsprintf(buf, form_str(RPL_WHOISCHANNELS), me.name, source_p->name, target_p->name);
-	t = buf + mlen;
-
-	DLINK_FOREACH(lp, target_p->user->channel.head)
-	{
-		msptr = lp->data;
-		chptr = msptr->chptr;
-
-		if(ShowChannel(source_p, chptr))
-		{
-			if((cur_len + strlen(chptr->chname) + 3) > (BUFSIZE - 4))
-			{
-				sendto_one(source_p, "%s", buf);
-				cur_len = mlen;
-				t = buf + mlen;
-			}
-
-			ircsprintf(t, "%s%s ", 
-				   find_channel_status(msptr, 1), 
-				   chptr->chname);
-
-			tlen = strlen(t);
-			t += tlen;
-			cur_len += tlen;
-		}
-	}
-
-	if(cur_len > mlen)
-		sendto_one(source_p, "%s", buf);
-
-	if((IsOper(source_p) || !ConfigServerHide.hide_servers) || target_p == source_p)
-		sendto_one(source_p, form_str(RPL_WHOISSERVER),
-			   me.name, source_p->name, target_p->name, server_name,
-			   a2client_p ? a2client_p->info : "*Not On This Net*");
-	else
-		sendto_one(source_p, form_str(RPL_WHOISSERVER),
-			   me.name, source_p->name, target_p->name,
-			   ServerInfo.network_name, ServerInfo.network_desc);
-
-	if(target_p->user->away)
-		sendto_one(source_p, form_str(RPL_AWAY), me.name,
-			   source_p->name, target_p->name, target_p->user->away);
-
-	if(IsOper(target_p))
-	{
-			sendto_one(source_p, form_str(RPL_WHOISOPERATOR),
-				   me.name, source_p->name, target_p->name,
-				   IsAdmin(target_p) ? GlobalSetOptions.adminstring :
-				   GlobalSetOptions.operstring);
-	}
-
-	if(MyClient(target_p))
-	{
-	  /* send idle if its global, source == target, or source and target
-	   * are both local and theres no serverhiding or source is opered
-	   */
-	  if((glob == 1) || (MyClient(source_p) && 
-	     (IsOper(source_p) || !ConfigServerHide.hide_servers)) || 
-	     (source_p == target_p))
-	  {
-		if(ConfigFileEntry.use_whois_actually && show_ip(source_p, target_p))
-			sendto_one(source_p, form_str(RPL_WHOISACTUALLY),
-				   me.name, source_p->name, target_p->name,
-				   target_p->localClient->sockhost);
-
-		sendto_one(source_p, form_str(RPL_WHOISIDLE),
-			   me.name, source_p->name, target_p->name,
-			   CurrentTime - target_p->user->last, target_p->firsttime);
-	  }
-	}
-
-	hd.client_p = target_p;
-	hd.source_p = source_p;
-
-	/* although we should fill in parc and parv, we don't ..
-	 be careful of this when writing whois hooks */
-	if(MyClient(source_p))
-		hook_call_event("doing_whois_local", &hd);
-	else
-		hook_call_event("doing_whois_global", &hd);
-
-	return;
-}
-
diff -uNrd ircd-ratbox-1.2-3+ipmask/modules/m_whowas.c ircd-ratbox-1.2-3/modules/m_whowas.c
--- ircd-ratbox-1.2-3+ipmask/modules/m_whowas.c	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/modules/m_whowas.c	Thu Jun 26 07:02:15 2003
@@ -153,10 +153,6 @@
 				sendto_one(source_p, form_str(RPL_WHOISSERVER),
 					   me.name, parv[0], temp->name,
 					   temp->servername, myctime(temp->logoff));
-
-          if(IsOper(source_p))
-            sendto_one(source_p, form_str(RPL_WHOWASREALHOST), me.name, parv[0], temp->name, temp->hostname, temp->rhostname);
-
 			cur++;
 			found++;
 		}
diff -uNrd ircd-ratbox-1.2-3+ipmask/modules/m_whowas.c.orig ircd-ratbox-1.2-3/modules/m_whowas.c.orig
--- ircd-ratbox-1.2-3+ipmask/modules/m_whowas.c.orig	Thu Jun 26 07:02:15 2003
+++ ircd-ratbox-1.2-3/modules/m_whowas.c.orig	Wed Dec 31 17:00:00 1969
@@ -1,167 +0,0 @@
-/*
- *  ircd-ratbox: an advanced Internet Relay Chat Daemon(ircd).
- *  m_whois.c: Shows who a user was.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002 ircd-ratbox development team
- *
- *  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_whowas.c,v 1.41.2.1 2003/06/26 14:02:15 androsyn Exp $
- */
-
-#include "stdinc.h"
-#include "whowas.h"
-#include "handlers.h"
-#include "client.h"
-#include "common.h"
-#include "hash.h"
-#include "irc_string.h"
-#include "ircd.h"
-#include "ircd_defs.h"
-#include "numeric.h"
-#include "s_serv.h"
-#include "s_user.h"
-#include "send.h"
-#include "s_conf.h"
-#include "msg.h"
-#include "parse.h"
-#include "modules.h"
-
-
-static void m_whowas(struct Client *, struct Client *, int, char **);
-static void mo_whowas(struct Client *, struct Client *, int, char **);
-
-struct Message whowas_msgtab = {
-	"WHOWAS", 0, 0, 0, 0, MFLG_SLOW, 0L,
-	{m_unregistered, m_whowas, m_error, mo_whowas}
-};
-
-#ifndef STATIC_MODULES
-void
-_modinit(void)
-{
-	mod_add_cmd(&whowas_msgtab);
-}
-
-void
-_moddeinit(void)
-{
-	mod_del_cmd(&whowas_msgtab);
-}
-const char *_version = "$Revision: 1.41.2.1 $";
-#endif
-static int whowas_do(struct Client *client_p, struct Client *source_p, int parc, char *parv[]);
-
-
-/*
-** m_whowas
-**      parv[0] = sender prefix
-**      parv[1] = nickname queried
-*/
-static void
-m_whowas(struct Client *client_p, struct Client *source_p, int parc, char *parv[])
-{
-	static time_t last_used = 0L;
-
-	if(parc < 2 || BadPtr(parv[1]))
-	{
-		sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, parv[0]);
-		return;
-	}
-
-	if((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime)
-	{
-		sendto_one(source_p, form_str(RPL_LOAD2HI),
-			   me.name, source_p->name, "WHOWAS");
-		return;
-	}
-	else
-	{
-		last_used = CurrentTime;
-	}
-
-	whowas_do(client_p, source_p, parc, parv);
-}
-
-static void
-mo_whowas(struct Client *client_p, struct Client *source_p, int parc, char *parv[])
-{
-	if(parc < 2)
-	{
-		sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, parv[0]);
-		return;
-	}
-
-	whowas_do(client_p, source_p, parc, parv);
-}
-
-static int
-whowas_do(struct Client *client_p, struct Client *source_p, int parc, char *parv[])
-{
-	struct Whowas *temp;
-	int cur = 0;
-	int max = -1, found = 0;
-	char *p, *nick;
-
-	if(parc < 2 || BadPtr(parv[1]))
-	{
-		sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, parv[0]);
-		return 0;
-	}
-	if(parc > 2)
-		max = atoi(parv[2]);
-	if(parc > 3)
-		if(hunt_server(client_p, source_p, ":%s WHOWAS %s %s :%s", 3, parc, parv))
-			return 0;
-
-
-	if((p = strchr(parv[1], ',')))
-		*p = '\0';
-
-	nick = parv[1];
-
-	temp = WHOWASHASH[hash_whowas_name(nick)];
-	found = 0;
-	for (; temp; temp = temp->next)
-	{
-		if(!irccmp(nick, temp->name))
-		{
-			sendto_one(source_p, form_str(RPL_WHOWASUSER),
-				   me.name, parv[0], temp->name,
-				   temp->username, temp->hostname, temp->realname);
-
-			if(ConfigServerHide.hide_servers && !IsOper(source_p))
-				sendto_one(source_p, form_str(RPL_WHOISSERVER),
-					   me.name, parv[0], temp->name,
-					   ServerInfo.network_name, myctime(temp->logoff));
-			else
-				sendto_one(source_p, form_str(RPL_WHOISSERVER),
-					   me.name, parv[0], temp->name,
-					   temp->servername, myctime(temp->logoff));
-			cur++;
-			found++;
-		}
-		if(max > 0 && cur >= max)
-			break;
-	}
-	if(!found)
-		sendto_one(source_p, form_str(ERR_WASNOSUCHNICK), me.name, parv[0], nick);
-
-	sendto_one(source_p, form_str(RPL_ENDOFWHOWAS), me.name, parv[0], parv[1]);
-	return 0;
-}
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/Makefile.in ircd-ratbox-1.2-3/src/Makefile.in
--- ircd-ratbox-1.2-3+ipmask/src/Makefile.in	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/src/Makefile.in	Tue Aug  5 15:19:42 2003
@@ -69,7 +69,6 @@
   hash.c                        \
   hook.c                        \
   hostmask.c                    \
-  ipmask.c						\
   irc_string.c                  \
   ircd.c                        \
   ircd_signal.c                 \
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/Makefile.in.orig ircd-ratbox-1.2-3/src/Makefile.in.orig
--- ircd-ratbox-1.2-3+ipmask/src/Makefile.in.orig	Tue Aug  5 15:19:42 2003
+++ ircd-ratbox-1.2-3/src/Makefile.in.orig	Wed Dec 31 17:00:00 1969
@@ -1,181 +0,0 @@
-#
-# Makefile.in for ircd/src
-#
-# $Id: Makefile.in,v 7.130.2.3 2003/08/05 22:19:42 leeh Exp $
-#
-CC		= @CC@
-INSTALL		= @INSTALL@
-INSTALL_BIN	= @INSTALL_PROGRAM@
-INSTALL_DATA	= @INSTALL_DATA@
-INSTALL_SUID	= @INSTALL_PROGRAM@ -o root -m 4755
-RM		= @RM@
-LEX		= @LEX@
-LEXLIB		= @LEXLIB@
-CFLAGS		= @IRC_CFLAGS@ -DIRCD_PREFIX=\"@prefix@\"
-LDFLAGS   	= @LDFLAGS@
-MKDEP		= @MKDEP@ -DIRCD_PREFIX=\"@prefix@\"
-MV		= @MV@
-RM		= @RM@
-YACC		= @YACC@
-prefix		= @prefix@
-exec_prefix	= @exec_prefix@
-bindir		= @bindir@
-libexecdir	= @libexecdir@
-sysconfdir	= @sysconfdir@
-localstatedir	= @localstatedir@
-
-DOLLAR = $$
-
-IRCD_EXE	= ircd
-
-PROGS		= $(IRCD_EXE)
-
-SSL_LIBS	= @SSL_LIBS@
-SSL_INCLUDES	= @SSL_INCLUDES@
-
-IRCDLIBS	= @MODULES_LIBS@ -L../adns -ladns @LIBS@ $(SSL_LIBS)
-
-INCLUDES	= -I../include -I../adns $(SSL_INCLUDES)
-CPPFLAGS	= ${INCLUDES} @CPPFLAGS@
- 
-default:	all
-
-y.tab.o:	y.tab.c ircd_parser.y
-	${CC} ${CPPFLAGS} ${CFLAGS} -I. -c y.tab.c
-
-# Note GNU bison uses <file>.tab.c not y.tab.c
-y.tab.c:	ircd_parser.y
-	${YACC} -d ircd_parser.y
-
-lex.yy.o:	lex.yy.c ircd_lexer.l
-	${CC} ${CPPFLAGS} ${CFLAGS} -I. -c lex.yy.c
-
-lex.yy.c:	ircd_lexer.l
-	${LEX} ircd_lexer.l
-
-BASE_SRCS =                     \
-  adns.c                        \
-  balloc.c			\
-  channel.c                     \
-  channel_mode.c		\
-  class.c                       \
-  client.c                      \
-  cluster.c			\
-  dynlink.c			\
-  event.c                       \
-  fdlist.c                      \
-  fileio.c                      \
-  getopt.c                      \
-  hash.c                        \
-  hook.c                        \
-  hostmask.c                    \
-  irc_string.c                  \
-  ircd.c                        \
-  ircd_signal.c                 \
-  kdparse.c			\
-  linebuf.c                     \
-  listener.c                    \
-  m_error.c                     \
-  match.c                       \
-  md5.c                         \
-  memory.c                      \
-  modules.c                     \
-  motd.c                        \
-  newconf.c			\
-  numeric.c                     \
-  packet.c                      \
-  parse.c                       \
-  patricia.c			\
-  rsa.c                         \
-  reject.c			\
-  restart.c                     \
-  resv.c			\
-  s_auth.c                      \
-  s_bsd.c                       \
-  s_bsd_kqueue.c                \
-  s_bsd_poll.c                  \
-  s_bsd_select.c                \
-  s_bsd_devpoll.c               \
-  s_bsd_sigio.c			\
-  s_bsd_epoll.c			\
-  s_conf.c                      \
-  s_debug.c                     \
-  s_gline.c                     \
-  s_log.c                       \
-  s_misc.c                      \
-  s_serv.c                      \
-  s_stats.c                     \
-  s_user.c                      \
-  scache.c                      \
-  send.c                        \
-  @SNPRINTF_C@			\
-  sprintf_irc.c			\
-  tools.c                       \
-  whowas.c
-
-SRCS = ${BASE_SRCS}
-
-OBJS = ${SRCS:.c=.o}
-
-all: ircd
-
-build: all
-
-ircd: $(OBJS) y.tab.o lex.yy.o version.o
-	${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${OBJS} lex.yy.o y.tab.o version.o ${IRCDLIBS} ${LEXLIB}
-	mv version.c version.c.last
-
-install-mkdirs:
-	-@if test ! -d $(prefix); then \
-		echo "mkdir $(prefix)"; \
-		mkdir $(prefix); \
-	fi
-	-@if test ! -d $(exec_prefix); then \
-		echo "mkdir $(exec_prefix)"; \
-		mkdir $(exec_prefix); \
-	fi
-	-@if test ! -d $(bindir); then \
-		echo "mkdir $(bindir)"; \
-		mkdir $(bindir); \
-	fi
-	-@if test ! -d $(sysconfdir); then \
-		echo "mkdir $(sysconfdir)"; \
-		mkdir $(sysconfdir); \
-	fi
-	-@if test ! -d $(localstatedir)/logs; then \
-		echo "mkdir $(localstatedir)/logs"; \
-		mkdir $(localstatedir)/logs; \
-	fi
-
-install: install-mkdirs build
-	@for i in $(PROGS); do \
-		if test -f $(bindir)/$$i; then \
-			echo $(MV) $(bindir)/$$i $(bindir)/$$i.old; \
-			$(MV) $(bindir)/$$i $(bindir)/$$i.old; \
-		fi; \
-		echo $(INSTALL_BIN) $$i $(bindir); \
-		$(INSTALL_BIN) $$i $(bindir); \
-	done
-
-version.c: version.c.SH
-	/bin/sh ./version.c.SH
-
-
-# this is really the default rule for c files
-.c.o:
-	${CC} ${CPPFLAGS} ${CFLAGS} -c $<
-
-.PHONY: depend clean distclean
-depend:
-	${MKDEP} ${CPPFLAGS} ${BASE_SRCS} ${EXTRA_SRCS} > .depend
-
-clean:
-	${RM} -f *.o *.exe *~ y.tab.* lex.yy.c ircd.core core ircd 
-
-lint:
-	lint -aacgprxhH $(CPPFLAGS) -DIRCD_PREFIX=\"@prefix@\" $(SRCS) >>../lint.out
-
-distclean: clean
-	${RM} -f Makefile version.c.last
-
-include .depend
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/client.c ircd-ratbox-1.2-3/src/client.c
--- ircd-ratbox-1.2-3+ipmask/src/client.c	Thu Nov 27 09:18:57 2003
+++ ircd-ratbox-1.2-3/src/client.c	Tue Aug  5 15:28:12 2003
@@ -1539,7 +1539,7 @@
 		if(IsPerson(source_p))
 			sendto_realops_flags(UMODE_CCONN, L_ALL,
 					     "Client exiting: %s (%s@%s) [%s] [%s]",
-					     source_p->name, source_p->username, source_p->rhost,
+					     source_p->name, source_p->username, source_p->host,
 					     comment,
 #ifdef HIDE_SPOOF_IPS
 					     IsIPSpoof(source_p) ? "255.255.255.255" :
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/hostmask.c ircd-ratbox-1.2-3/src/hostmask.c
--- ircd-ratbox-1.2-3+ipmask/src/hostmask.c	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/src/hostmask.c	Thu Jun 26 07:03:11 2003
@@ -454,9 +454,6 @@
 	aconf = find_conf_by_address(client_p->host, &client_p->localClient->ip,
 				     CONF_KILL, client_p->localClient->aftype, client_p->username);
 
-	if (!aconf)
-		aconf = find_conf_by_address(client_p->rhost, &client_p->localClient->ip, CONF_KILL, client_p->localClient->aftype, client_p->username);
-
 	return aconf;
 }
 
@@ -473,9 +470,6 @@
 
 	aconf = find_conf_by_address(client_p->host, &client_p->localClient->ip,
 				     CONF_GLINE, client_p->localClient->aftype, client_p->username);
-
-	if (!aconf)
-		aconf = find_conf_by_address(client_p->rhost, &client_p->localClient->ip, CONF_GLINE, client_p->localClient->aftype, client_p->username);
 
 	return aconf;
 }
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/hostmask.c.orig ircd-ratbox-1.2-3/src/hostmask.c.orig
--- ircd-ratbox-1.2-3+ipmask/src/hostmask.c.orig	Thu Jun 26 07:03:11 2003
+++ ircd-ratbox-1.2-3/src/hostmask.c.orig	Wed Dec 31 17:00:00 1969
@@ -1,776 +0,0 @@
-/*
- *  ircd-ratbox: A slightly useful ircd.
- *  hostmask.c: Code to efficiently find IP & hostmask based configs.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002 ircd-ratbox development team
- *
- *  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: hostmask.c,v 7.88.2.1 2003/06/26 14:03:11 androsyn Exp $
- */
-
-#include "stdinc.h"
-#include "memory.h"
-#include "ircd_defs.h"
-#include "s_conf.h"
-#include "hostmask.h"
-#include "numeric.h"
-#include "send.h"
-#include "irc_string.h"
-
-#ifdef IPV6
-static int try_parse_v6_netmask(const char *, struct irc_inaddr *, int *);
-static unsigned long hash_ipv6(struct irc_inaddr *, int);
-#endif
-static int try_parse_v4_netmask(const char *, struct irc_inaddr *, int *);
-static unsigned long hash_ipv4(struct irc_inaddr *, int);
-
-#define DigitParse(ch) do { \
-                       if (ch >= '0' && ch <= '9') \
-                         ch = ch - '0'; \
-                       else if (ch >= 'A' && ch <= 'F') \
-                         ch = ch - 'A' + 10; \
-                       else if (ch >= 'a' && ch <= 'f') \
-                         ch = ch - 'a' + 10; \
-                       } while(0);
-
-/* The mask parser/type determination code... */
-
-/* int try_parse_v6_netmask(const char *, struct irc_inaddr *, int *);
- * Input: A possible IPV6 address as a string.
- * Output: An integer describing whether it is an IPV6 or hostmask,
- *         an address(if it is IPV6), a bitlength(if it is IPV6).
- * Side effects: None
- * Comments: Called from parse_netmask
- */
-/* Fixed so ::/0 (any IPv6 address) is valid 
-   Also a bug in DigitParse above.
-   -Gozem 2002-07-19 gozem@linux.nu
-*/
-#ifdef IPV6
-static int
-try_parse_v6_netmask(const char *text, struct irc_inaddr *addr, int *b)
-{
-	const char *p;
-	char c;
-	int d[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }, dp = 0, nyble = 4, finsert =
-		-1, bits = 128, deficit = 0;
-	short dc[8];
-
-	for (p = text; (c = *p); p++)
-		if(IsXDigit(c))
-		{
-			if(nyble == 0)
-				return HM_HOST;
-			DigitParse(c);
-			d[dp] |= c << (4 * --nyble);
-		}
-		else if(c == ':')
-		{
-			if(p > text && *(p - 1) == ':')
-			{
-				if(finsert >= 0)
-					return HM_HOST;
-				finsert = dp;
-			}
-			else
-			{
-				/* If there were less than 4 hex digits, e.g. :ABC: shift right
-				 * so we don't interpret it as ABC0 -A1kmm */
-				d[dp] = d[dp] >> 4 * nyble;
-				nyble = 4;
-				if(++dp >= 8)
-					return HM_HOST;
-			}
-		}
-		else if(c == '*')
-		{
-			/* * must be last, and * is ambiguous if there is a ::... -A1kmm */
-			if(finsert >= 0 || *(p + 1) || dp == 0 || *(p - 1) != ':')
-				return HM_HOST;
-			bits = dp * 16;
-		}
-		else if(c == '/')
-		{
-			char *after;
-
-			d[dp] = d[dp] >> 4 * nyble;
-			dp++;
-			bits = strtoul(p + 1, &after, 10);
-			if(bits < 0 || *after)
-				return HM_HOST;
-			if(bits > dp * 4 && !(finsert >= 0 && bits <= 128))
-				return HM_HOST;
-			break;
-		}
-		else
-			return HM_HOST;
-
-	d[dp] = d[dp] >> 4 * nyble;
-	if(c == 0)
-		dp++;
-	if(finsert < 0 && bits == 0)
-		bits = dp * 16;
-	/* How many words are missing? -A1kmm */
-	deficit = bits / 16 + ((bits % 16) ? 1 : 0) - dp;
-	/* Now fill in the gaps(from ::) in the copied table... -A1kmm */
-	for (dp = 0, nyble = 0; dp < 8; dp++)
-	{
-		if(nyble == finsert && deficit)
-		{
-			dc[dp] = 0;
-			deficit--;
-		}
-		else
-			dc[dp] = d[nyble++];
-	}
-	/* Set unused bits to 0... -A1kmm */
-	if(bits < 128 && (bits % 16 != 0))
-		dc[bits / 16] &= ~((1 << (15 - bits % 16)) - 1);
-	for (dp = bits / 16 + (bits % 16 ? 1 : 0); dp < 8; dp++)
-		dc[dp] = 0;
-	/* And assign... -A1kmm */
-	if(addr)
-		for (dp = 0; dp < 8; dp++)
-			/* The cast is a kludge to make netbsd work. */
-			((unsigned short *) &addr->sins.sin6)[dp] = htons(dc[dp]);
-	if(b != NULL)
-		*b = bits;
-	return HM_IPV6;
-}
-#endif
-
-/* int try_parse_v4_netmask(const char *, struct irc_inaddr *, int *);
- * Input: A possible IPV4 address as a string.
- * Output: An integer describing whether it is an IPV4 or hostmask,
- *         an address(if it is IPV4), a bitlength(if it is IPV4).
- * Side effects: None
- * Comments: Called from parse_netmask
- */
-static int
-try_parse_v4_netmask(const char *text, struct irc_inaddr *addr, int *b)
-{
-	const char *p;
-	const char *digits[4];
-	unsigned char addb[4];
-	int n = 0, bits = 0;
-	char c;
-
-	digits[n++] = text;
-
-	for (p = text; (c = *p); p++)
-		if(c >= '0' && c <= '9')	/* empty */
-			;
-		else if(c == '.')
-		{
-			if(n >= 4)
-				return HM_HOST;
-			digits[n++] = p + 1;
-		}
-		else if(c == '*')
-		{
-			if(*(p + 1) || n == 0 || *(p - 1) != '.')
-				return HM_HOST;
-			bits = (n - 1) * 8;
-			break;
-		}
-		else if(c == '/')
-		{
-			char *after;
-			bits = strtoul(p + 1, &after, 10);
-			if(!bits || *after)
-				return HM_HOST;
-			if(bits > n * 8)
-				return HM_HOST;
-			break;
-		}
-		else
-			return HM_HOST;
-
-	if(n < 4 && bits == 0)
-		bits = n * 8;
-	if(bits)
-		while (n < 4)
-			digits[n++] = "0";
-	for (n = 0; n < 4; n++)
-		addb[n] = strtoul(digits[n], NULL, 10);
-	if(bits == 0)
-		bits = 32;
-	/* Set unused bits to 0... -A1kmm */
-	if(bits < 32 && bits % 8)
-		addb[bits / 8] &= ~((1 << (8 - bits % 8)) - 1);
-	for (n = bits / 8 + (bits % 8 ? 1 : 0); n < 4; n++)
-		addb[n] = 0;
-	if(addr)
-		addr->sins.sin.s_addr =
-			htonl(addb[0] << 24 | addb[1] << 16 | addb[2] << 8 | addb[3]);
-	if(b != NULL)
-		*b = bits;
-	return HM_IPV4;
-}
-
-/* int parse_netmask(const char *, struct irc_inaddr *, int *);
- * Input: A hostmask, or an IPV4/6 address.
- * Output: An integer describing whether it is an IPV4, IPV6 address or a
- *         hostmask, an address(if it is an IP mask),
- *         a bitlength(if it is IP mask).
- * Side effects: None
- */
-int
-parse_netmask(const char *text, struct irc_inaddr *addr, int *b)
-{
-#ifdef IPV6
-	if(strchr(text, ':'))
-		return try_parse_v6_netmask(text, addr, b);
-#endif
-	if(strchr(text, '.'))
-		return try_parse_v4_netmask(text, addr, b);
-	return HM_HOST;
-}
-
-/* Hashtable stuff...now external as its used in m_stats.c */
-struct AddressRec *atable[ATABLE_SIZE];
-
-void
-init_host_hash(void)
-{
-	memset(&atable, 0, sizeof(atable));
-}
-
-/* unsigned long hash_ipv4(struct irc_inaddr*)
- * Input: An IP address.
- * Output: A hash value of the IP address.
- * Side effects: None
- */
-static unsigned long
-hash_ipv4(struct irc_inaddr *addr, int bits)
-{
-	if(bits != 0)
-	{
-		unsigned long av = ntohl(addr->sins.sin.s_addr) & ~((1 << (32 - bits)) - 1);
-		return (av ^ (av >> 12) ^ (av >> 24)) & (ATABLE_SIZE - 1);
-	}
-
-	return 0;
-}
-
-/* unsigned long hash_ipv6(struct irc_inaddr*)
- * Input: An IP address.
- * Output: A hash value of the IP address.
- * Side effects: None
- */
-#ifdef IPV6
-static unsigned long
-hash_ipv6(struct irc_inaddr *addr, int bits)
-{
-	unsigned long v = 0, n;
-	for (n = 0; n < 16; n++)
-	{
-		if(bits >= 8)
-		{
-			v ^= addr->sins.sin6.s6_addr[n];
-			bits -= 8;
-		}
-		else if(bits)
-		{
-			v ^= addr->sins.sin6.s6_addr[n] & ~((1 << (8 - bits)) - 1);
-			return v & (ATABLE_SIZE - 1);
-		}
-		else
-			return v & (ATABLE_SIZE - 1);
-	}
-	return v & (ATABLE_SIZE - 1);
-}
-#endif
-
-/* int hash_text(const char *start)
- * Input: The start of the text to hash.
- * Output: The hash of the string between 1 and (TH_MAX-1)
- * Side-effects: None.
- */
-static int
-hash_text(const char *start)
-{
-	const char *p = start;
-	unsigned long h = 0;
-
-	while (*p)
-	{
-		h = (h << 4) - (h + (unsigned char) ToLower(*p++));
-	}
-	return (h & (ATABLE_SIZE - 1));
-}
-
-/* unsigned long get_hash_mask(const char *)
- * Input: The text to hash.
- * Output: The hash of the string right of the first '.' past the last
- *         wildcard in the string.
- * Side-effects: None.
- */
-static unsigned long
-get_mask_hash(const char *text)
-{
-	const char *hp = "", *p;
-
-	for (p = text + strlen(text) - 1; p >= text; p--)
-		if(*p == '*' || *p == '?')
-			return hash_text(hp);
-		else if(*p == '.')
-			hp = p + 1;
-	return hash_text(text);
-}
-
-/* struct ConfItem* find_conf_by_address(const char*, struct irc_inaddr*,
- *         int type, int fam, const char *username)
- * Input: The hostname, the address, the type of mask to find, the address
- *        family, the username.
- * Output: The matching value with the highest precedence.
- * Side-effects: None
- * Note: Setting bit 0 of the type means that the username is ignored.
- */
-struct ConfItem *
-find_conf_by_address(const char *name, struct irc_inaddr *addr, int type,
-		     int fam, const char *username)
-{
-	unsigned long hprecv = 0;
-	struct ConfItem *hprec = NULL;
-	struct AddressRec *arec;
-	int b;
-
-	if(username == NULL)
-		username = "";
-
-	if(addr)
-	{
-		/* Check for IPV6 matches... */
-#ifdef IPV6
-		if(fam == AF_INET6)
-		{
-			for (b = 128; b >= 0; b -= 16)
-			{
-				for (arec = atable[hash_ipv6(addr, b)]; arec; arec = arec->next)
-					if(arec->type == (type & ~0x1) &&
-					   arec->masktype == HM_IPV6 &&
-					   comp_with_mask(&PIN_ADDR(addr),
-							  &IN_ADDR(arec->Mask.ipa.addr),
-							  arec->Mask.ipa.bits) && (type & 0x1
-										   || match(arec->
-											    username,
-											    username))
-					   && arec->precedence > hprecv)
-					{
-						hprecv = arec->precedence;
-						hprec = arec->aconf;
-					}
-			}
-		}
-		else
-#endif
-		if(fam == AF_INET)
-		{
-			for (b = 32; b >= 0; b -= 8)
-			{
-				for (arec = atable[hash_ipv4(addr, b)]; arec; arec = arec->next)
-					if(arec->type == (type & ~0x1) &&
-					   arec->masktype == HM_IPV4 &&
-					   comp_with_mask(&PIN_ADDR(addr),
-							  &IN_ADDR(arec->Mask.ipa.addr),
-							  arec->Mask.ipa.bits) && (type & 0x1
-										   || match(arec->
-											    username,
-											    username))
-					   && arec->precedence > hprecv)
-					{
-						hprecv = arec->precedence;
-						hprec = arec->aconf;
-					}
-			}
-		}
-	}
-
-	if(name != NULL)
-	{
-		const char *p;
-		/* And yes - we have to check p after strchr and p after increment for
-		 * NULL -kre */
-		for (p = name; p != NULL;)
-		{
-			for (arec = atable[hash_text(p)]; arec; arec = arec->next)
-				if((arec->type == (type & ~0x1)) &&
-				   (arec->masktype == HM_HOST) &&
-				   match(arec->Mask.hostname, name) &&
-				   (type & 0x1 || match(arec->username, username)) &&
-				   (arec->precedence > hprecv))
-				{
-					hprecv = arec->precedence;
-					hprec = arec->aconf;
-				}
-			p = strchr(p, '.');
-			if(p != NULL)
-				p++;
-			else
-				break;
-		}
-		for (arec = atable[0]; arec; arec = arec->next)
-			if(arec->type == (type & ~0x1) &&
-			   arec->masktype == HM_HOST &&
-			   match(arec->Mask.hostname, name) &&
-			   (type & 0x1 || match(arec->username, username)) &&
-			   arec->precedence > hprecv)
-			{
-				hprecv = arec->precedence;
-				hprec = arec->aconf;
-			}
-	}
-	return hprec;
-}
-
-/* find_kline()
- *
- * input        - pointer to client
- * output       -
- * side effects - matching kline is returned, if found
- */
-struct ConfItem *
-find_kline(struct Client *client_p)
-{
-	struct ConfItem *aconf;
-
-	aconf = find_conf_by_address(client_p->host, &client_p->localClient->ip,
-				     CONF_KILL, client_p->localClient->aftype, client_p->username);
-
-	return aconf;
-}
-
-/* find_gline()
- *
- * input        - pointer to client
- * output       -
- * side effects - matching dline is returned, if found
- */
-struct ConfItem *
-find_gline(struct Client *client_p)
-{
-	struct ConfItem *aconf;
-
-	aconf = find_conf_by_address(client_p->host, &client_p->localClient->ip,
-				     CONF_GLINE, client_p->localClient->aftype, client_p->username);
-
-	return aconf;
-}
-
-/* struct ConfItem* find_address_conf(const char*, const char*,
- * 	                               struct irc_inaddr*, int);
- * Input: The hostname, username, address, address family.
- * Output: The applicable ConfItem.
- * Side-effects: None
- */
-struct ConfItem *
-find_address_conf(const char *host, const char *user, struct irc_inaddr *ip, int aftype)
-{
-	struct ConfItem *iconf, *kconf;
-
-	/* Find the best I-line... If none, return NULL -A1kmm */
-	if(!(iconf = find_conf_by_address(host, ip, CONF_CLIENT, aftype, user)))
-		return NULL;
-
-	/* If they are exempt from K-lines, return the best I-line. -A1kmm */
-	if(IsConfExemptKline(iconf))
-		return iconf;
-
-	/* Find the best K-line... -A1kmm */
-	kconf = find_conf_by_address(host, ip, CONF_KILL, aftype, user);
-
-	/* If they are K-lined, return the K-line */
-	if(kconf)
-		return kconf;
-
-	/* hunt for a gline */
-	if(ConfigFileEntry.glines)
-	{
-		kconf = find_conf_by_address(host, ip, CONF_GLINE, aftype, user);
-
-		if((kconf != NULL) && !IsConfExemptGline(iconf))
-			return kconf;
-	}
-
-	return iconf;
-}
-
-/* struct ConfItem* find_dline(struct irc_inaddr*, int)
- * Input: An address, an address family.
- * Output: The best matching D-line or exempt line.
- * Side effects: None.
- */
-struct ConfItem *
-find_dline(struct irc_inaddr *addr, int aftype)
-{
-	struct ConfItem *eline;
-	eline = find_conf_by_address(NULL, addr, CONF_EXEMPTDLINE | 1, aftype, NULL);
-	if(eline)
-		return eline;
-	return find_conf_by_address(NULL, addr, CONF_DLINE | 1, aftype, NULL);
-}
-
-/* void add_conf_by_address(const char*, int, const char *,
- *         struct ConfItem *aconf)
- * Input: 
- * Output: None
- * Side-effects: Adds this entry to the hash table.
- */
-void
-add_conf_by_address(const char *address, int type, const char *username, struct ConfItem *aconf)
-{
-	static unsigned long prec_value = 0xFFFFFFFF;
-	int masktype, bits;
-	unsigned long hv;
-	struct AddressRec *arec;
-
-	if(address == NULL)
-		address = "/NOMATCH!/";
-	arec = MyMalloc(sizeof(struct AddressRec));
-	masktype = parse_netmask(address, &arec->Mask.ipa.addr, &bits);
-	arec->Mask.ipa.bits = bits;
-	arec->masktype = masktype;
-#ifdef IPV6
-	if(masktype == HM_IPV6)
-	{
-		/* We have to do this, since we do not re-hash for every bit -A1kmm. */
-		bits -= bits % 16;
-		arec->next = atable[(hv = hash_ipv6(&arec->Mask.ipa.addr, bits))];
-		atable[hv] = arec;
-	}
-	else
-#endif
-	if(masktype == HM_IPV4)
-	{
-		/* We have to do this, since we do not re-hash for every bit -A1kmm. */
-		bits -= bits % 8;
-		arec->next = atable[(hv = hash_ipv4(&arec->Mask.ipa.addr, bits))];
-		atable[hv] = arec;
-	}
-	else
-	{
-		arec->Mask.hostname = address;
-		arec->next = atable[(hv = get_mask_hash(address))];
-		atable[hv] = arec;
-	}
-	arec->username = username;
-	arec->aconf = aconf;
-	arec->precedence = prec_value--;
-	arec->type = type;
-}
-
-/* void delete_one_address(const char*, struct ConfItem*)
- * Input: An address string, the associated ConfItem.
- * Output: None
- * Side effects: Deletes an address record. Frees the ConfItem if there
- *               is nothing referencing it, sets it as illegal otherwise.
- */
-void
-delete_one_address_conf(const char *address, struct ConfItem *aconf)
-{
-	int masktype, bits;
-	unsigned long hv;
-	struct AddressRec *arec, *arecl = NULL;
-	struct irc_inaddr addr;
-	masktype = parse_netmask(address, &addr, &bits);
-#ifdef IPV6
-	if(masktype == HM_IPV6)
-	{
-		/* We have to do this, since we do not re-hash for every bit -A1kmm. */
-		bits -= bits % 16;
-		hv = hash_ipv6(&addr, bits);
-	}
-	else
-#endif
-	if(masktype == HM_IPV4)
-	{
-		/* We have to do this, since we do not re-hash for every bit -A1kmm. */
-		bits -= bits % 8;
-		hv = hash_ipv4(&addr, bits);
-	}
-	else
-		hv = get_mask_hash(address);
-	for (arec = atable[hv]; arec; arec = arec->next)
-	{
-		if(arec->aconf == aconf)
-		{
-			if(arecl)
-				arecl->next = arec->next;
-			else
-				atable[hv] = arec->next;
-			aconf->status |= CONF_ILLEGAL;
-			if(!aconf->clients)
-				free_conf(aconf);
-			MyFree(arec);
-			return;
-		}
-		arecl = arec;
-	}
-}
-
-/* void clear_out_address_conf(void)
- * Input: None
- * Output: None
- * Side effects: Clears out all address records in the hash table,
- *               frees them, and frees the ConfItems if nothing references
- *               them, otherwise sets them as illegal.
- */
-void
-clear_out_address_conf(void)
-{
-	int i;
-	struct AddressRec **store_next;
-	struct AddressRec *arec, *arecn;
-
-	for (i = 0; i < ATABLE_SIZE; i++)
-	{
-		store_next = &atable[i];
-		for (arec = atable[i]; arec; arec = arecn)
-		{
-			arecn = arec->next;
-			/* We keep the temporary K-lines and destroy the
-			 * permanent ones, just to be confusing :) -A1kmm */
-			if(arec->aconf->flags & CONF_FLAGS_TEMPORARY)
-			{
-				*store_next = arec;
-				store_next = &arec->next;
-			}
-			else
-			{
-				arec->aconf->status |= CONF_ILLEGAL;
-				if(!arec->aconf->clients)
-					free_conf(arec->aconf);
-				MyFree(arec);
-			}
-		}
-		*store_next = NULL;
-	}
-}
-
-
-/*
- * show_iline_prefix()
- *
- * inputs       - pointer to struct Client requesting output
- *              - pointer to struct ConfItem 
- *              - name to which iline prefix will be prefixed to
- * output       - pointer to static string with prefixes listed in ascii form
- * side effects - NONE
- */
-char *
-show_iline_prefix(struct Client *sptr, struct ConfItem *aconf, char *name)
-{
-	static char prefix_of_host[USERLEN + 15];
-	char *prefix_ptr;
-
-	prefix_ptr = prefix_of_host;
-	if(IsNoTilde(aconf))
-		*prefix_ptr++ = '-';
-	if(IsLimitIp(aconf))
-		*prefix_ptr++ = '!';
-	if(IsNeedIdentd(aconf))
-		*prefix_ptr++ = '+';
-	if(IsPassIdentd(aconf))
-		*prefix_ptr++ = '$';
-	if(IsNoMatchIp(aconf))
-		*prefix_ptr++ = '%';
-	if(IsConfDoSpoofIp(aconf))
-		*prefix_ptr++ = '=';
-	if(MyOper(sptr) && IsConfExemptKline(aconf))
-		*prefix_ptr++ = '^';
-	if(MyOper(sptr) && IsConfExemptLimits(aconf))
-		*prefix_ptr++ = '>';
-	if(MyOper(sptr) && IsConfIdlelined(aconf))
-		*prefix_ptr++ = '<';
-	*prefix_ptr = '\0';
-	strncpy(prefix_ptr, name, USERLEN);
-	return (prefix_of_host);
-}
-
-/* report_auth()
- *
- * Inputs: pointer to client to report to
- * Output: None
- * Side effects: Reports configured auth{} blocks to client_p
- */
-void
-report_auth(struct Client *client_p)
-{
-	char *name, *host, *pass, *user, *classname;
-	struct AddressRec *arec;
-	struct ConfItem *aconf;
-	int i, port;
-
-	for (i = 0; i < ATABLE_SIZE; i++)
-		for (arec = atable[i]; arec; arec = arec->next)
-			if(arec->type == CONF_CLIENT)
-			{
-				aconf = arec->aconf;
-
-				if(!MyOper(client_p) && IsConfDoSpoofIp(aconf))
-					continue;
-
-				get_printable_conf(aconf, &name, &host, &pass, &user, &port,
-						   &classname);
-
-				sendto_one(client_p, form_str(RPL_STATSILINE), me.name,
-					   client_p->name, (IsConfRestricted(aconf)) ? 'i' : 'I',
-					   name, show_iline_prefix(client_p, aconf, user),
-#ifdef HIDE_SPOOF_IPS
-					   IsConfDoSpoofIp(aconf) ? "255.255.255.255" :
-#endif
-					   host, port, classname);
-			}
-}
-
-/* report_Klines()
- * 
- * inputs       - Client to report to, mask 
- * outputs      -
- * side effects - Reports configured K-lines to client_p.
- */
-void
-report_Klines(struct Client *client_p)
-{
-	char *name, *host, *pass, *user, *classname;
-	struct AddressRec *arec;
-	struct ConfItem *aconf = NULL;
-	int i, port;
-
-	for (i = 0; i < ATABLE_SIZE; i++)
-	{
-		for (arec = atable[i]; arec; arec = arec->next)
-		{
-			if(arec->type == CONF_KILL)
-			{
-				aconf = arec->aconf;
-
-				/* its a tempkline, theyre reported elsewhere */
-				if(aconf->flags & CONF_FLAGS_TEMPORARY)
-					continue;
-
-				get_printable_conf(aconf, &name, &host, &pass, &user, &port,
-						   &classname);
-				sendto_one(client_p, form_str(RPL_STATSKLINE), me.name,
-					   client_p->name, 'K', host, user, pass);
-			}
-		}
-	}
-}
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/ipmask.c ircd-ratbox-1.2-3/src/ipmask.c
--- ircd-ratbox-1.2-3+ipmask/src/ipmask.c	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/src/ipmask.c	Wed Dec 31 17:00:00 1969
@@ -1,240 +0,0 @@
-/*
- *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
- *  FreeWorld-ircd:
- *  ipmask.c: IP Masking routines.
- *
- *  Copyright (C) 2002 by the past and present ircd coders, and others.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
- *  USA
- *
- *  $Id: ipmask.c,v 1.2 2003/10/20 06:30:42 ircd Exp $
- */
-
-#include "stdinc.h"
-#include "tools.h"
-#include "s_user.h"
-#include "channel.h"
-#include "channel_mode.h"
-#include "class.h"
-#include "client.h"
-#include "common.h"
-#include "fdlist.h"
-#include "hash.h"
-#include "irc_string.h"
-#include "sprintf_irc.h"
-#include "ircd.h"
-#include "listener.h"
-#include "motd.h"
-#include "ircd_handler.h"
-#include "msg.h"
-#include "numeric.h"
-#include "s_bsd.h"
-#include "s_conf.h"
-#include "s_log.h"
-#include "s_serv.h"
-#include "s_stats.h"
-#include "scache.h"
-#include "send.h"
-#include "supported.h"
-#include "whowas.h"
-#include "md5.h"
-#include "memory.h"
-#include "packet.h"
-
-void maskip (struct Client *);
-int calculate_ip (struct Client *);
-
-void maskip (struct Client *client_p)
-{
-	char buf[HOSTLEN];
-	int i = 0,j = 0,k = 0;
-	char *tmp = NULL;
-	char *tmp2 = NULL;
-	char *tmp3 = NULL;
-	char *tmp4 = NULL;
-	char mask[HOSTLEN];
-
-	strlcpy(buf, client_p->rhost, HOSTLEN);
-	j = strlen(buf);
-
-	if(strchr(buf, '.'))
-	{
-		k = calculate_ip (client_p);
-		if(!isdigit(buf[j - 1]))
-		{
-			tmp = strchr(buf, '.');
-			*tmp = '\0';
-			tmp++;
-			tmp2 = strchr(tmp, '.');
-
-			if(tmp2 != NULL)
-				ircsprintf(mask, "%s-%d.%s", ServerInfo.network_name, k, tmp);
-
-		}
-		else
-		{
-			tmp = strrchr(buf, '.');
-			*tmp = '\0';
-			tmp--;
-
-			ircsprintf(mask, "%s.%d", buf, k);
-		}
-
-		if (mask[0] != '\0') {
-			sendto_realops_flags(UMODE_DEBUG, L_ALL, "Applying mask (%s) to %s", mask, client_p->name);
-			strlcpy(client_p->host, mask, HOSTLEN);
-		}
-	}
-
-
-#ifdef IPV6
-	if(strchr(buf, ':'))
-	{
-		tmp = strrchr(buf, ':');
-		*tmp = '\0';
-		tmp--;
-		tmp2 = strrchr(tmp, ':');
-
-		if(tmp2 != NULL)
-		{
-			tmp3 = strrchr(tmp2, ':');
-
-			if(tmp3 != NULL)
-			{
-				tmp4 = strrchr(tmp3, ':');
-				*tmp4 = '\0';
-				tmp4--;
-			}
-			ircsprintf(mask, "%s::IPV6", buf);
-		}
-
-		if (mask[0] != '\0') {
-			sendto_realops_flags(UMODE_DEBUG, L_ALL, "Applying mask (%s) to %s", mask, client_p->name);
-			strlcpy(client_p->host, mask, HOSTLEN);
-		}
-	}
-#endif
-
-}
-
-int calculate_ip (struct Client *client_p)
-{
-  char buffer[BUFSIZE];
-  char *tmp, *tmp2, *tmp3;
-  int a,b,c,d,e;
-
-/*  if (!MyClient(client_p))
-    return;*/
-
-  strcpy(buffer, client_p->localClient->sockhost);
-
-  if ((tmp = strchr(buffer, '.')) != NULL)
-  {
-    *tmp = '\0';
-    tmp++;
-
-    if ((tmp2 = strchr(tmp, '.')) != NULL)
-    {
-      *tmp2 = '\0';
-      tmp2++;
-
-      if ((tmp3 = strchr(tmp2, '.')) != NULL)
-      {
-        *tmp3 = '\0';
-        tmp3++;
-      }
-    }
-  }
-
-  a = atoi(buffer);
-  b = atoi(tmp);
-  c = atoi(tmp2);
-  d = atoi(tmp3);
-
-  e = a + b + c + d;
-  e = e * e * 1024 % 100000;
-
-  return e;
-}
-
-char *ret_maskip(struct Client *client_p)
-{
-        char buf[HOSTLEN];
-        int i = 0,j = 0,k = 0;
-        char *tmp = NULL;
-        char *tmp2 = NULL;
-        char *tmp3 = NULL;
-        char *tmp4 = NULL;
-        static char mask[HOSTLEN];
-
-        strlcpy(buf, client_p->rhost, HOSTLEN);
-        j = strlen(buf);
-  
-        if(strchr(buf, '.'))
-        {
-                k = calculate_ip (client_p);
-                if(!isdigit(buf[j - 1]))
-                {
-                        tmp = strchr(buf, '.');
-                        *tmp = '\0';
-                        tmp++;
-                        tmp2 = strchr(tmp, '.');
-  
-                        if(tmp2 != NULL)
-                                ircsprintf(mask, "%s-%d.%s", ServerInfo.network_name, k, tmp);
- 
-                }
-                else
-                {
-                        tmp = strrchr(buf, '.');
-                        *tmp = '\0';
-                        tmp--;
-  
-                        ircsprintf(mask, "%s.%d", buf, k);
-                }  
-
-        }
-
-
-#ifdef IPV6
-        if(strchr(buf, ':'))
-        {
-                tmp = strrchr(buf, ':');
-                *tmp = '\0';
-                tmp--;
-                tmp2 = strrchr(tmp, ':');
-
-                if(tmp2 != NULL)
-                {
-                        tmp3 = strrchr(tmp2, ':');
-
-                        if(tmp3 != NULL)
-                        {
-                                tmp4 = strrchr(tmp3, ':');
-                                *tmp4 = '\0';
-                                tmp4--;
-                        }
-                        ircsprintf(mask, "%s::IPV6", buf);
-                }  
-
-        }
-#endif
-
-	if (mask)
-		return mask;
-	else
-		return client_p->host;
-}
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/messages.tab ircd-ratbox-1.2-3/src/messages.tab
--- ircd-ratbox-1.2-3+ipmask/src/messages.tab	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/src/messages.tab	Sat Sep  6 13:18:13 2003
@@ -394,7 +394,7 @@
 /* 367 RPL_BANLIST, */          ":%s 367 %s %s %s %s %lu",
 /* 368 RPL_ENDOFBANLIST, */     ":%s 368 %s %s :End of Channel Ban List",
 /* 369 RPL_ENDOFWHOWAS, */      ":%s 369 %s %s :End of WHOWAS",
-/* 370 RPL_WHOWASREALHOST, */   ":%s 370 %s :%s was connected from *@%s [%s]", 
+/* 370 */       NULL,
 /* 371 RPL_INFO, */             ":%s 371 %s :%s",
 /* 372 RPL_MOTD, */             ":%s 372 %s :- %s",
 /* 373 RPL_INFOSTART, */        ":%s 373 %s :Server INFO",
@@ -402,7 +402,7 @@
 /* 375 RPL_MOTDSTART, */        ":%s 375 %s :- %s Message of the Day - ",
 /* 376 RPL_ENDOFMOTD, */        ":%s 376 %s :End of /MOTD command.",
 /* 377 */       NULL,
-/* 378 RPL_WHOISHOST */         ":%s 378 %s :%s is connected from *@%s",
+/* 378 */       NULL,
 /* 379 */       NULL,
 /* 380 */       NULL,
 /* 381 RPL_YOUREOPER, */        ":%s 381 %s :You have entered... the Vanity Zone!.",
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/messages.tab.orig ircd-ratbox-1.2-3/src/messages.tab.orig
--- ircd-ratbox-1.2-3+ipmask/src/messages.tab.orig	Sat Sep  6 13:18:13 2003
+++ ircd-ratbox-1.2-3/src/messages.tab.orig	Wed Dec 31 17:00:00 1969
@@ -1,1030 +0,0 @@
-/************************************************************************
- *   IRC - Internet Relay Chat, src/messages.tab
- *   Copyright (C) 1992 Darren Reed
- *
- *   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: messages.tab,v 7.90.2.2 2003/09/06 20:18:13 leeh Exp $
- */
-
-static  const char *  replies[] = {
-/* 000 */       NULL,
-/* 001  RPL_WELCOME, */ ":%s 001 %s :Welcome to the %s Internet Relay Chat Network %s",
-/* 002  RPL_YOURHOST,*/ ":%s 002 %s :Your host is %s, running version %s",
-/* 003  RPL_CREATED, */ ":%s 003 %s :This server was created %s",
-/* 004  RPL_MYINFO, */ ":%s 004 %s %s %s oiwszcerkfydnxbaugl biklmnopstveIa bkloveI",
-/* 005  RPL_ISUPPORT, */ ":%s 005 %s %s :are supported by this server",
-/* 006 */       NULL,
-/* 007 */       NULL,
-/* 008 */       NULL,
-/* 009 */       NULL,
-/* 010  RPL_REDIR, */ ":%s 010 %s %s %d :Please use this Server/Port instead",
-/* 011 */       NULL,
-/* 012 */       NULL,
-/* 013 */       NULL,
-/* 014 */       NULL,
-/* 015 RPL_MAP */    ":%s 015 %s :%s",
-/* 016 */       NULL,
-/* 017 RPL_MAPEND */ ":%s 017 %s :End of /MAP",
-/* 018 */       NULL,
-/* 019 */       NULL,
-/* 020 RPL_YOURID */  ":%s 020 %s %s %s :Your ID and key is",
-/* 021 */       NULL,
-/* 022 */       NULL,
-/* 023 */       NULL,
-/* 024 */       NULL,
-/* 025 */       NULL,
-/* 026 */       NULL,
-/* 027 */       NULL,
-/* 028 */       NULL,
-/* 029 */       NULL,
-/* 030 */       NULL,
-/* 031 */       NULL,
-/* 032 */       NULL,
-/* 033 */       NULL,
-/* 034 */       NULL,
-/* 035 */       NULL,
-/* 036 */       NULL,
-/* 037 */       NULL,
-/* 038 */       NULL,
-/* 039 */       NULL,
-/* 040 */       NULL,
-/* 041 */       NULL,
-/* 042 */       NULL,
-/* 043 */       NULL,
-/* 044 */       NULL,
-/* 045 */       NULL,
-/* 046 */       NULL,
-/* 047 */       NULL,
-/* 048 */       NULL,
-/* 049 */       NULL,
-/* 050 */       NULL,
-/* 051 */       NULL,
-/* 052 */       NULL,
-/* 053 */       NULL,
-/* 054 */       NULL,
-/* 055 */       NULL,
-/* 056 */       NULL,
-/* 057 */       NULL,
-/* 058 */       NULL,
-/* 059 */       NULL,
-/* 060 */       NULL,
-/* 061 */       NULL,
-/* 062 */       NULL,
-/* 063 */       NULL,
-/* 064 */       NULL,
-/* 065 */       NULL,
-/* 066 */       NULL,
-/* 067 */       NULL,
-/* 068 */       NULL,
-/* 069 */       NULL,
-/* 070 */       NULL,
-/* 071 */       NULL,
-/* 072 */       NULL,
-/* 073 */       NULL,
-/* 074 */       NULL,
-/* 075 */       NULL,
-/* 076 */       NULL,
-/* 077 */       NULL,
-/* 078 */       NULL,
-/* 079 */       NULL,
-/* 080 */       NULL,
-/* 081 */       NULL,
-/* 082 */       NULL,
-/* 083 */       NULL,
-/* 084 */       NULL,
-/* 085 */       NULL,
-/* 086 */       NULL,
-/* 087 */       NULL,
-/* 088 */       NULL,
-/* 089 */       NULL,
-/* 090 */       NULL,
-/* 091 */       NULL,
-/* 092 */       NULL,
-/* 093 */       NULL,
-/* 094 */       NULL,
-/* 095 */       NULL,
-/* 096 */       NULL,
-/* 097 */       NULL,
-/* 098 */       NULL,
-/* 099 */       NULL,
-/* 100 */       NULL,
-/* 101 */       NULL,
-/* 102 */       NULL,
-/* 103 */       NULL,
-/* 104 */       NULL,
-/* 105 */       NULL,
-/* 106 */       NULL,
-/* 107 */       NULL,
-/* 108 */       NULL,
-/* 109 */       NULL,
-/* 110 */       NULL,
-/* 111 */       NULL,
-/* 112 */       NULL,
-/* 113 */       NULL,
-/* 114 */       NULL,
-/* 115 */       NULL,
-/* 116 */       NULL,
-/* 117 */       NULL,
-/* 118 */       NULL,
-/* 119 */       NULL,
-/* 120 */       NULL,
-/* 121 */       NULL,
-/* 122 */       NULL,
-/* 123 */       NULL,
-/* 124 */       NULL,
-/* 125 */       NULL,
-/* 126 */       NULL,
-/* 127 */       NULL,
-/* 128 */       NULL,
-/* 129 */       NULL,
-/* 130 */       NULL,
-/* 131 */       NULL,
-/* 132 */       NULL,
-/* 133 */       NULL,
-/* 134 */       NULL,
-/* 135 */       NULL,
-/* 136 */       NULL,
-/* 137 */       NULL,
-/* 138 */       NULL,
-/* 139 */       NULL,
-/* 140 */       NULL,
-/* 141 */       NULL,
-/* 142 */       NULL,
-/* 143 */       NULL,
-/* 144 */       NULL,
-/* 145 */       NULL,
-/* 146 */       NULL,
-/* 147 */       NULL,
-/* 148 */       NULL,
-/* 149 */       NULL,
-/* 150 */       NULL,
-/* 151 */       NULL,
-/* 152 */       NULL,
-/* 153 */       NULL,
-/* 154 */       NULL,
-/* 155 */       NULL,
-/* 156 */       NULL,
-/* 157 */       NULL,
-/* 158 */       NULL,
-/* 159 */       NULL,
-/* 160 */       NULL,
-/* 161 */       NULL,
-/* 162 */       NULL,
-/* 163 */       NULL,
-/* 164 */       NULL,
-/* 165 */       NULL,
-/* 166 */       NULL,
-/* 167 */       NULL,
-/* 168 */       NULL,
-/* 169 */       NULL,
-/* 170 */       NULL,
-/* 171 */       NULL,
-/* 172 */       NULL,
-/* 173 */       NULL,
-/* 174 */       NULL,
-/* 175 */       NULL,
-/* 176 */       NULL,
-/* 177 */       NULL,
-/* 178 */       NULL,
-/* 179 */       NULL,
-/* 180 */       NULL,
-/* 181 */       NULL,
-/* 182 */       NULL,
-/* 183 */       NULL,
-/* 184 */       NULL,
-/* 185 */       NULL,
-/* 186 */       NULL,
-/* 187 */       NULL,
-/* 188 */       NULL,
-/* 189 */       NULL,
-/* 190 */       NULL,
-/* 191 */       NULL,
-/* 192 */       NULL,
-/* 193 */       NULL,
-/* 194 */       NULL,
-/* 195 */       NULL,
-/* 196 */       NULL,
-/* 197 */       NULL,
-/* 198 */       NULL,
-/* 199 */       NULL,
-/* 200 RPL_TRACELINK, */        ":%s 200 %s Link %s%s %s %s",
-/* 201 RPL_TRACECONNECTING, */  ":%s 201 %s Try. %s %s",
-/* 202 RPL_TRACEHANDSHAKE, */   ":%s 202 %s H.S. %s %s",
-/* 203 RPL_TRACEUNKNOWN, */     ":%s 203 %s ???? %s %s (%s) %d",
-/* 204 RPL_TRACEOPERATOR, */    ":%s 204 %s Oper %s %s (%s) %lu %lu",
-/* 205 RPL_TRACEUSER, */        ":%s 205 %s User %s %s (%s) %lu %lu",
-/* 206 RPL_TRACESERVER, */      ":%s 206 %s Serv %s %dS %dC %s %s!%s@%s %lu",
-/* 207 */       NULL,
-/* 208 RPL_TRACENEWTYPE, */     ":%s 208 %s <newtype> 0 %s",
-/* 209 RPL_TRACECLASS, */       ":%s 209 %s Class %s %d",
-/* 210 */       NULL,
-/* 211 RPL_STATSLINKINFO, */    NULL,
-/* 212 RPL_STATSCOMMANDS, */    ":%s 212 %s %s %u %u :%u",
-/* 213 RPL_STATSCLINE, */       ":%s 213 %s %c %s %s %s %d %s",
-/* 214 RPL_STATSNLINE, */       ":%s 214 %s %c %s * %s %d %s",
-/* 215 RPL_STATSILINE, */       ":%s 215 %s %c %s * %s@%s %d %s",
-/* 216 RPL_STATSKLINE, */       ":%s 216 %s %c %s * %s :%s",
-/* 217 RPL_STATSQLINE, */       ":%s 217 %s %c %s :%s",
-/* 218 RPL_STATSYLINE, */       ":%s 218 %s %c %s %d %d %d %lu/%lu %d.%d %d.%d",
-/* 219 RPL_ENDOFSTATS, */       ":%s 219 %s %c :End of /STATS report",
-/* 220 RPL_STATSPLINE, */       ":%s 220 %s %c %d %s %d :%s",
-/* 221 RPL_UMODEIS, */          ":%s 221 %s %s",
-/* 222 */	NULL,
-/* 223 */       NULL,
-/* 224 */       NULL,
-/* 225 RPL_STATSDLINE*/         ":%s 225 %s %c %s :%s",
-/* 226 RPL_STATSALINE*/         ":%s 226 %s %s",
-/* 227 */       NULL,
-/* 228 */       NULL,
-/* 229 */       NULL,
-/* 230 */       NULL,
-/* 231 */       NULL,
-/* 232 */       NULL,
-/* 233 */       NULL,
-/* 234 RPL_SERVLIST, */ NULL,
-/* 235 RPL_SERVLISTEND, */ NULL,
-/* 236 */       NULL,
-/* 237 */       NULL,
-/* 238 */       NULL,
-/* 239 */       NULL,
-/* 240 */       NULL,
-/* 241 RPL_STATSLLINE, */       ":%s 241 %s %c %s * %s %d %s",
-/* 242 RPL_STATSUPTIME,*/       ":%s 242 %s :Server Up %d days, %d:%02d:%02d",
-/* 243 RPL_STATSOLINE, */       ":%s 243 %s %c %s@%s * %s %s %s %s",
-/* 244 RPL_STATSHLINE, */       ":%s 244 %s %c %s * %s %d %s", 
-/* 245 RPL_STATSSLINE, */       NULL,
-/* 246 */       NULL,
-/* 247 RPL_STATSXLINE, */       ":%s 247 %s X %d %s :%s",
-
-/* 248 RPL_STATSULINE, */       ":%s 248 %s U %s %s@%s %s",
-/* 249 RPL_STATSDEBUG */       NULL,
-/* 250 RPL_STATSCONN, */
-                ":%s 250 %s :Highest connection count: %d (%d clients) (%d connections received)",
-/* 251 RPL_LUSERCLIENT, */
-                ":%s 251 %s :There are %d users and %d invisible on %d servers",
-/* 252 RPL_LUSEROP, */          ":%s 252 %s %d :IRC Operators online",
-/* 253 RPL_LUSERUNKNOWN, */     ":%s 253 %s %d :unknown connection(s)",
-/* 254 RPL_LUSERCHANNELS, */    ":%s 254 %s %d :channels formed",
-/* 255 RPL_LUSERME, */          ":%s 255 %s :I have %d clients and %d servers",
-/* 256 RPL_ADMINME, */          ":%s 256 %s :Administrative info about %s",
-/* 257 RPL_ADMINLOC1, */        ":%s 257 %s :%s",
-/* 258 RPL_ADMINLOC2, */        ":%s 258 %s :%s",
-/* 259 RPL_ADMINEMAIL, */       ":%s 259 %s :%s",
-/* 260 */       NULL,
-/* 261 RPL_TRACELOG, */         ":%s 261 %s File %s %d",
-/* 262 RPL_ENDOFTRACE, */       ":%s 262 %s %s :End of TRACE",
-/* 263 RPL_LOAD2HI, */          
-":%s 263 %s %s :Server load is temporarily too heavy. Please wait a while and try again.",
-/* 264 */       NULL,
-/* 265 RPL_LOCALUSERS, */       ":%s 265 %s :Current local  users: %d  Max: %d",
-/* 266 RPL_GLOBALUSERS, */      ":%s 266 %s :Current global users: %d  Max: %d",
-/* 267 */       NULL,
-/* 268 */       NULL,
-/* 269 */       NULL,
-/* 270 */       NULL,
-/* 271 */       NULL,
-/* 272 */       NULL,
-/* 273 */       NULL,
-/* 274 */       NULL,
-/* 275 */       NULL,
-/* 276 */       NULL,
-/* 277 */       NULL,
-/* 278 */       NULL,
-/* 279 */       NULL,
-/* 280 */       NULL,
-/* 281 RPL_ACCEPTLIST, */       ":%s 281 %s %s :",
-/* 282 RPL_ENDOFACCEPT */       ":%s 282 %s :End of /ACCEPT list.",
-/* 283 */       NULL,
-/* 284 */       NULL,
-/* 285 */       NULL,
-/* 286 */       NULL,
-/* 287 */       NULL,
-/* 288 */       NULL,
-/* 289 */       NULL,
-/* 290 */       NULL,
-/* 291 */       NULL,
-/* 292 */       NULL,
-/* 293 */       NULL,
-/* 294 */       NULL,
-/* 295 */       NULL,
-/* 296 */       NULL,
-/* 297 */       NULL,
-/* 298 */       NULL,
-/* 299 */       NULL,
-/* 300 RPL_NONE, */      NULL,
-/* 301 RPL_AWAY, */      ":%s 301 %s %s :%s",
-/* 302 RPL_USERHOST, */  ":%s 302 %s :%s",
-/* 303 RPL_ISON, */     ":%s 303 %s :",
-/* 304 RPL_TEXT, */      NULL,
-/* 305 RPL_UNAWAY, */   ":%s 305 %s :You are no longer marked as being away",
-/* 306 RPL_NOWAWAY, */  ":%s 306 %s :You have been marked as being away",
-/* 307 */       NULL,
-/* 308 */	NULL,
-/* 309 */       NULL,
-/* 310 */       NULL,
-/* 311 RPL_WHOISUSER, */        ":%s 311 %s %s %s %s * :%s",
-/* 312 RPL_WHOISSERVER, */      ":%s 312 %s %s %s :%s",
-/* 313 RPL_WHOISOPERATOR, */    ":%s 313 %s %s :%s",
-/* 314 RPL_WHOWASUSER, */       ":%s 314 %s %s %s %s * :%s",
-/* 315 RPL_ENDOFWHO, */         ":%s 315 %s %s :End of /WHO list.",
-/* 316 RPL_WHOISCHANOP, */      NULL,
-/* 317 RPL_WHOISIDLE, */        ":%s 317 %s %s %d %d :seconds idle, signon time",
-/* 318 RPL_ENDOFWHOIS, */       ":%s 318 %s %s :End of /WHOIS list.",
-/* 319 RPL_WHOISCHANNELS, */    ":%s 319 %s %s :",
-/* 320 */      NULL,
-/* 321 RPL_LISTSTART, */        ":%s 321 %s Channel :Users  Name",
-/* 322 RPL_LIST, */             ":%s 322 %s %s %d :%s",
-/* 323 RPL_LISTEND, */          ":%s 323 %s :End of /LIST",
-/* 324 RPL_CHANNELMODEIS, */    ":%s 324 %s %s %s %s",
-/* 325 */       NULL,
-/* 326 */       NULL,
-/* 327 */       NULL,
-/* 328 */       NULL,
-/* 329 RPL_CREATIONTIME, */      ":%s 329 %s %s %lu", 
-/* 330 */       NULL,
-/* 331 RPL_NOTOPIC, */          ":%s 331 %s %s :No topic is set.",
-/* 332 RPL_TOPIC, */            ":%s 332 %s %s :%s",
-/* 333 RPL_TOPICWHOTIME, */     ":%s 333 %s %s %s %lu",
-/* 334 */       NULL,
-/* 335 */       NULL,
-/* 336 */       NULL,
-/* 337 */       NULL,
-/* 338 RPL_WHOISACTUALLY, */	":%s 338 %s %s %s :actually using host",
-/* 339 */       NULL,
-/* 340 */       NULL,
-/* 341 RPL_INVITING, */         ":%s 341 %s %s %s",
-/* 342 RPL_SUMMONING, */ NULL,
-/* 343 */       NULL,
-/* 344 */       NULL,
-/* 345 */       NULL,
-/* 346 RPL_INVEXLIST */         ":%s 346 %s %s %s %s %lu",       
-/* 347 RPL_ENDOFINVEXLIST */    ":%s 347 %s %s :End of Channel Invite List",
-/* 348 RPL_EXCEPTLIST */        ":%s 348 %s %s %s %s %lu",
-/* 349 RPL_ENDOFEXCEPTLIST */   ":%s 349 %s %s :End of Channel Exception List",
-/* 350 */       NULL,
-/* 351 RPL_VERSION, */          ":%s 351 %s %s(%s).%s %s :%s%s",
-/* 352 RPL_WHOREPLY, */         ":%s 352 %s %s %s %s %s %s %s :%d %s",
-/* 353 RPL_NAMREPLY, */         ":%s 353 %s %s %s :",
-/* 354 */       NULL,
-/* 355 */       NULL,
-/* 356 */       NULL,
-/* 357 */       NULL,
-/* 358 */       NULL,
-/* 359 */       NULL,
-/* 360 */       NULL,
-/* 361 RPL_KILLDONE, */ NULL,
-/* 362 RPL_CLOSING, */          ":%s 362 %s %s :Closed. Status = %d",
-/* 363 RPL_CLOSEEND, */         ":%s 363 %s %d :Connections Closed",
-/* 364 RPL_LINKS, */            ":%s 364 %s %s %s :%d %s",
-/* 365 RPL_ENDOFLINKS, */       ":%s 365 %s %s :End of /LINKS list.",
-/* 366 RPL_ENDOFNAMES, */       ":%s 366 %s %s :End of /NAMES list.",
-/* 367 RPL_BANLIST, */          ":%s 367 %s %s %s %s %lu",
-/* 368 RPL_ENDOFBANLIST, */     ":%s 368 %s %s :End of Channel Ban List",
-/* 369 RPL_ENDOFWHOWAS, */      ":%s 369 %s %s :End of WHOWAS",
-/* 370 */       NULL,
-/* 371 RPL_INFO, */             ":%s 371 %s :%s",
-/* 372 RPL_MOTD, */             ":%s 372 %s :- %s",
-/* 373 RPL_INFOSTART, */        ":%s 373 %s :Server INFO",
-/* 374 RPL_ENDOFINFO, */        ":%s 374 %s :End of /INFO list.",
-/* 375 RPL_MOTDSTART, */        ":%s 375 %s :- %s Message of the Day - ",
-/* 376 RPL_ENDOFMOTD, */        ":%s 376 %s :End of /MOTD command.",
-/* 377 */       NULL,
-/* 378 */       NULL,
-/* 379 */       NULL,
-/* 380 */       NULL,
-/* 381 RPL_YOUREOPER, */        ":%s 381 %s :You have entered... the Vanity Zone!.",
-/* 382 RPL_REHASHING, */        ":%s 382 %s %s :Rehashing",
-/* 383 */       NULL,
-/* 384 RPL_MYPORTIS, */         ":%s 384 %s %d :Port to local server is",
-/* 385 RPL_NOTOPERANYMORE, */   NULL,
-/* 386 */                       ":%s 386 %s :%s",
-/* 387 */       NULL,
-/* 388 */       NULL,
-/* 389 */       NULL,
-/* 390 */       NULL,
-/* 391 RPL_TIME, */             ":%s 391 %s %s :%s",
-/* 392 */       NULL,
-/* 393 */       NULL,
-/* 394 */       NULL,
-/* 395 */       NULL,
-/* 396 */       NULL,
-/* 397 */       NULL,
-/* 398 */       NULL,
-/* 399 */       NULL,
-/* 400 */       NULL,
-/* 401 ERR_NOSUCHNICK, */       ":%s 401 %s %s :No such nick/channel",
-/* 402 ERR_NOSUCHSERVER, */     ":%s 402 %s %s :No such server",
-/* 403 ERR_NOSUCHCHANNEL, */    ":%s 403 %s %s :No such channel",
-/* 404 ERR_CANNOTSENDTOCHAN, */ ":%s 404 %s %s :Cannot send to channel",
-/* 405 ERR_TOOMANYCHANNELS, */  ":%s 405 %s %s :You have joined too many channels",
-/* 406 ERR_WASNOSUCHNICK, */    ":%s 406 %s %s :There was no such nickname",
-/* 407 ERR_TOOMANYTARGETS, */   ":%s 407 %s %s :Too many recipients.",
-/* 408 */       NULL,
-/* 409 ERR_NOORIGIN, */         ":%s 409 %s :No origin specified",
-/* 410 */       NULL,
-/* 411 ERR_NORECIPIENT, */      ":%s 411 %s :No recipient given (%s)",
-/* 412 ERR_NOTEXTTOSEND, */     ":%s 412 %s :No text to send",
-/* 413 ERR_NOTOPLEVEL, */       ":%s 413 %s %s :No toplevel domain specified",
-/* 414 ERR_WILDTOPLEVEL, */     ":%s 414 %s %s :Wildcard in toplevel Domain",
-/* 415 */       NULL,
-/* 416 ERR_TOOMANYMATCHES */    ":%s 416 %s %s :output too large, truncated",
-/* 417 */       NULL,
-/* 418 */       NULL,
-/* 419 */       NULL,
-/* 420 */       NULL,
-/* 421 ERR_UNKNOWNCOMMAND, */   ":%s 421 %s %s :Unknown command",
-/* 422 ERR_NOMOTD, */           ":%s 422 %s :MOTD File is missing",
-/* 423 ERR_NOADMININFO, */
-                ":%s 423 %s %s :No administrative info available",
-/* 424 ERR_FILEERROR, */        ":%s 424 %s :File error doing %s on %s",
-/* 425 */       NULL,
-/* 426 */       NULL,
-/* 427 */       NULL,
-/* 428 */       NULL,
-/* 429 */       NULL,
-/* 430 */       NULL,
-/* 431 ERR_NONICKNAMEGIVEN, */  ":%s 431 %s :No nickname given",
-/* 432 ERR_ERRONEUSNICKNAME, */ ":%s 432 %s %s :Erroneous Nickname",
-/* 433 ERR_NICKNAMEINUSE, */    ":%s 433 %s %s :Nickname is already in use.",
-/* 434 */       NULL,
-/* 435 */       NULL,
-/* 436 ERR_NICKCOLLISION, */    ":%s 436 %s %s :Nickname collision KILL",
-/* 437 ERR_ERR_UNAVAILRESOURCE, */ ":%s 437 %s %s :Nick/channel is temporarily unavailable",
-/* 438 ERR_NICKTOOFAST */       ":%s 438 %s %s %s :Nick change too fast. Please wait %d seconds.",
-/* 439 */       NULL,
-/* 440 */       NULL,
-/* 441 ERR_USERNOTINCHANNEL, */ ":%s 441 %s %s %s :They aren't on that channel",
-/* 442 ERR_NOTONCHANNEL, */     ":%s 442 %s %s :You're not on that channel",
-/* 443 ERR_USERONCHANNEL, */    ":%s 443 %s %s %s :is already on channel",
-/* 444 ERR_NOLOGIN, */          ":%s 444 %s %s :User not logged in",
-/* 445 ERR_SUMMONDISABLED, */   ":%s 445 %s :SUMMON has been removed",
-/* 446 ERR_USERSDISABLED, */    ":%s 446 %s :USERS has been removed",
-/* 447 */       NULL,
-/* 448 */       NULL,
-/* 449 */       NULL,
-/* 450 */       NULL,
-/* 451 ERR_NOTREGISTERED, */    ":%s 451 %s :You have not registered",
-/* 452 */       NULL,
-/* 453 */       NULL,
-/* 454 */       NULL,
-/* 455 */       NULL,
-/* 456 ERR_ACCEPTFULL */        ":%s 456 %s :Accept list is full",
-/* 457 ERR_ACCEPTEXIST */       ":%s 457 %s %s :is already on your accept list",
-/* 458 ERR_ACCEPTNOT */         ":%s 458 %s %s :is not on your accept list",
-/* 459 */       NULL,
-/* 460 */       NULL,
-/* 461 ERR_NEEDMOREPARAMS, */   ":%s 461 %s %s :Not enough parameters",
-/* 462 ERR_ALREADYREGISTRED, */ ":%s 462 %s :You may not reregister",
-/* 463 ERR_NOPERMFORHOST, */    ":%s 463 %s :Your host isn't among the privileged",
-/* 464 ERR_PASSWDMISMATCH, */   ":%s 464 %s :Password Incorrect",
-/* 465 ERR_YOUREBANNEDCREEP, */ ":%s 465 %s :You are banned from this server- %s",
-/* 466 ERR_YOUWILLBEBANNED, */  NULL,
-/* 467 ERR_KEYSET, */           ":%s 467 %s %s :Channel key already set",
-/* 468 */       NULL,
-/* 469 */       NULL,
-/* 470 */       NULL,
-/* 471 ERR_CHANNELISFULL, */    ":%s 471 %s %s :Cannot join channel (+l)",
-/* 472 ERR_UNKNOWNMODE  , */    ":%s 472 %s %c :is unknown mode char to me",
-/* 473 ERR_INVITEONLYCHAN, */   ":%s 473 %s %s :Cannot join channel (+i)",
-/* 474 ERR_BANNEDFROMCHAN, */   ":%s 474 %s %s :Cannot join channel (+b)",
-/* 475 ERR_BADCHANNELKEY, */    ":%s 475 %s %s :Cannot join channel (+k)",
-/* 476 ERR_BADCHANMASK, */      ":%s 476 %s %s :Bad Channel Mask",
-/* 477 ERR_MODELESS, */         ":%s 477 %s %s :Channel does not support modes",
-/* 478 ERR_BANLISTFULL, */      ":%s 478 %s %s %s :Channel ban list is full",
-/* 479 ERR_BADCHANNAME */       ":%s 479 %s %s :Illegal channel name",
-/* 480 */       NULL,
-/* 481 ERR_NOPRIVILEGES, */
-                ":%s 481 %s :Permission Denied - You're not an IRC operator",
-/* 482 ERR_CHANOPRIVSNEEDED, */ ":%s 482 %s %s :You're not channel operator",
-/* 483 ERR_CANTKILLSERVER, */   ":%s 483 %s :You can't kill a server!",
-/* 484 ERR_RESTRICTED, */       ":%s 484 %s :You are restricted",
-/* 485 ERR_BANNEDNICK, */
-       ":%s 485 %s :Can't change nick when banned or on a moderated channel (%s)",
-/* 486 */       NULL,
-/* 487 */       NULL,
-/* 488 */       NULL,
-/* 489 */       NULL,
-/* 490 */       NULL,
-/* 491 ERR_NOOPERHOST, */       ":%s 491 %s :Only few of mere mortals may try to enter the twilight zone",
-/* 492 */       NULL,
-/* 493 */       NULL,
-/* 494 */       NULL,
-/* 495 */       NULL,
-/* 496 */       NULL,
-/* 497 */       NULL,
-/* 498 */       NULL,
-/* 499 */       NULL,
-/* 500 */       NULL,
-/* 501 ERR_UMODEUNKNOWNFLAG, */ ":%s 501 %s :Unknown MODE flag",
-/* 502 ERR_USERSDONTMATCH, */   ":%s 502 %s :Can't change mode for other users",
-/* 503 ERR_GHOSTEDCLIENT, */    ":%s 503 %s :Message could not be delivered to %s",
-/* 504 ERR_USERNOTONSERV, */    ":%s 504 %s %s :User is not on this server",
-/* 505 */	NULL,
-/* 506 */       NULL,
-/* 507 */       NULL,
-/* 508 */	NULL,
-/* 509 */	NULL,
-/* 510 */	NULL,
-/* 511 */	NULL,
-/* 512 */	NULL,
-/* 513 ERR_WRONGPONG */		":%s 513 %s :To connect type /QUOTE PONG %lu",
-/* 514 */	NULL,
-/* 515 */	NULL,
-/* 516 */	NULL,
-/* 517 */	NULL,
-/* 518 */	NULL,
-/* 519 */	NULL,
-/* 520 */	NULL,
-/* 521 */	NULL,
-/* 522 */	NULL,
-/* 523 */	NULL,
-/* 524 ERR_HELPNOTFOUND, */	":%s 524 %s %s :Help not found",
-/* 525 */	NULL,
-/* 526 */	NULL,
-/* 527 */	NULL,
-/* 528 */	NULL,
-/* 529 */	NULL,
-/* 530 */	NULL,
-/* 531 */	NULL,
-/* 532 */	NULL,
-/* 533 */	NULL,
-/* 534 */	NULL,
-/* 535 */	NULL,
-/* 536 */	NULL,
-/* 537 */	NULL,
-/* 538 */	NULL,
-/* 539 */	NULL,
-/* 540 */	NULL,
-/* 541 */	NULL,
-/* 542 */	NULL,
-/* 543 */	NULL,
-/* 544 */	NULL,
-/* 545 */	NULL,
-/* 546 */	NULL,
-/* 547 */	NULL,
-/* 548 */	NULL,
-/* 549 */	NULL,
-/* 550 */	NULL,
-/* 551 */	NULL,
-/* 552 */	NULL,
-/* 553 */	NULL,
-/* 554 */	NULL,
-/* 555 */	NULL,
-/* 556 */	NULL,
-/* 557 */	NULL,
-/* 558 */	NULL,
-/* 559 */	NULL,
-/* 560 */	NULL,
-/* 561 */	NULL,
-/* 562 */	NULL,
-/* 563 */	NULL,
-/* 564 */	NULL,
-/* 565 */	NULL,
-/* 566 */	NULL,
-/* 567 */	NULL,
-/* 568 */	NULL,
-/* 569 */	NULL,
-/* 570 */	NULL,
-/* 571 */	NULL,
-/* 572 */	NULL,
-/* 573 */	NULL,
-/* 574 */	NULL,
-/* 575 */	NULL,
-/* 576 */	NULL,
-/* 577 */	NULL,
-/* 578 */	NULL,
-/* 579 */	NULL,
-/* 580 */	NULL,
-/* 581 */	NULL,
-/* 582 */	NULL,
-/* 583 */	NULL,
-/* 584 */	NULL,
-/* 585 */	NULL,
-/* 586 */	NULL,
-/* 587 */	NULL,
-/* 588 */	NULL,
-/* 589 */	NULL,
-/* 590 */	NULL,
-/* 591 */	NULL,
-/* 592 */	NULL,
-/* 593 */	NULL,
-/* 594 */	NULL,
-/* 595 */	NULL,
-/* 596 */	NULL,
-/* 597 */	NULL,
-/* 598 */	NULL,
-/* 599 */	NULL,
-/* 600 */	NULL,
-/* 601 */	NULL,
-/* 602 */	NULL,
-/* 603 */	NULL,
-/* 604 */	NULL,
-/* 605 */	NULL,
-/* 606 */	NULL,
-/* 607 */	NULL,
-/* 608 */	NULL,
-/* 609 */	NULL,
-/* 610 */	NULL,
-/* 611 */	NULL,
-/* 612 */	NULL,
-/* 613 */	NULL,
-/* 614 */	NULL,
-/* 615 */	NULL,
-/* 616 */	NULL,
-/* 617 */	NULL,
-/* 618 */	NULL,
-/* 619 */	NULL,
-/* 620 */	NULL,
-/* 621 */	NULL,
-/* 622 */	NULL,
-/* 623 */	NULL,
-/* 624 */	NULL,
-/* 625 */	NULL,
-/* 626 */	NULL,
-/* 627 */	NULL,
-/* 628 */	NULL,
-/* 629 */	NULL,
-/* 630 */	NULL,
-/* 631 */	NULL,
-/* 632 */	NULL,
-/* 633 */	NULL,
-/* 634 */	NULL,
-/* 635 */	NULL,
-/* 636 */	NULL,
-/* 637 */	NULL,
-/* 638 */	NULL,
-/* 639 */	NULL,
-/* 640 */	NULL,
-/* 641 */	NULL,
-/* 642 */	NULL,
-/* 643 */	NULL,
-/* 644 */	NULL,
-/* 645 */	NULL,
-/* 646 */	NULL,
-/* 647 */	NULL,
-/* 648 */	NULL,
-/* 649 */	NULL,
-/* 650 */	NULL,
-/* 651 */	NULL,
-/* 652 */	NULL,
-/* 653 */	NULL,
-/* 654 */	NULL,
-/* 655 */	NULL,
-/* 656 */	NULL,
-/* 657 */	NULL,
-/* 658 */	NULL,
-/* 659 */	NULL,
-/* 660 */	NULL,
-/* 661 */	NULL,
-/* 662 */	NULL,
-/* 663 */	NULL,
-/* 664 */	NULL,
-/* 665 */	NULL,
-/* 666 */	NULL,
-/* 667 */	NULL,
-/* 668 */	NULL,
-/* 669 */	NULL,
-/* 670 */	NULL,
-/* 671 */	NULL,
-/* 672 */	NULL,
-/* 673 */	NULL,
-/* 674 */	NULL,
-/* 675 */	NULL,
-/* 676 */	NULL,
-/* 677 */	NULL,
-/* 678 */	NULL,
-/* 679 */	NULL,
-/* 680 */	NULL,
-/* 681 */	NULL,
-/* 682 */	NULL,
-/* 683 */	NULL,
-/* 684 */	NULL,
-/* 685 */	NULL,
-/* 686 */	NULL,
-/* 687 */	NULL,
-/* 688 */	NULL,
-/* 689 */	NULL,
-/* 690 */	NULL,
-/* 691 */	NULL,
-/* 692 */	NULL,
-/* 693 */	NULL,
-/* 694 */	NULL,
-/* 695 */	NULL,
-/* 696 */	NULL,
-/* 697 */	NULL,
-/* 698 */	NULL,
-/* 699 */	NULL,
-/* 700 */	NULL,
-/* 701 */	NULL,
-/* 702 RPL_MODLIST, */		":%s 702 %s %s 0x%x %s %s",
-/* 703 RPL_ENDOFMODLIST, */	":%s 703 %s :End of /MODLIST.",
-/* 704 RPL_HELPSTART, */	":%s 704 %s %s :%s",
-/* 705 RPL_HELPTXT, */		":%s 705 %s %s :%s",
-/* 706 RPL_ENDOFHELP, */	":%s 706 %s %s :End of /HELP.",
-/* 707 */	NULL,
-/* 708 */	NULL,
-/* 709 RPL_ETRACE */		":%s 709 %s %s %s %s %s %s %s :%s",
-/* 710 RPL_KNOCK */		":%s 710 %s %s %s!%s@%s :has asked for an invite.",
-/* 711 RPL_KNOCKDLVR */		":%s 711 %s %s :Your KNOCK has been delivered.",
-/* 712 ERR_TOOMANYKNOCK */	":%s 712 %s %s :Too many KNOCKs (%s).",
-/* 713 ERR_CHANOPEN */		":%s 713 %s %s :Channel is open.",
-/* 714 ERR_KNOCKONCHAN */	":%s 714 %s %s :You are already on that channel.",
-/* 715 ERR_KNOCKDISABLED */	":%s 715 %s :KNOCKs are disabled.",
-/* 716 RPL_TARGUMODEG */	":%s 716 %s %s :is in +g mode (server-side ignore.)",
-/* 717 RPL_TARGNOTIFY */	":%s 717 %s %s :has been informed that you messaged them.",
-/* 718 RPL_UMODEGMSG */		":%s 718 %s %s %s@%s :is messaging you, and you have umode +g.",
-/* 719 */	NULL,
-/* 720 */	NULL,
-/* 721 */	NULL,
-/* 722 */	NULL,
-/* 723 */	NULL,
-/* 724 */	NULL,
-/* 725 */	NULL,
-/* 726 */	NULL,
-/* 727 */	NULL,
-/* 728 */	NULL,
-/* 729 */	NULL,
-/* 730 */	NULL,
-/* 731 */	NULL,
-/* 732 */	NULL,
-/* 733 */	NULL,
-/* 734 */	NULL,
-/* 735 */	NULL,
-/* 736 */	NULL,
-/* 737 */	NULL,
-/* 738 */	NULL,
-/* 739 */	NULL,
-/* 740 */	NULL,
-/* 741 */	NULL,
-/* 742 */	NULL,
-/* 743 */	NULL,
-/* 744 */	NULL,
-/* 745 */	NULL,
-/* 746 */	NULL,
-/* 747 */	NULL,
-/* 748 */	NULL,
-/* 749 */	NULL,
-/* 750 */	NULL,
-/* 751 */	NULL,
-/* 752 */	NULL,
-/* 753 */	NULL,
-/* 754 */	NULL,
-/* 755 */	NULL,
-/* 756 */	NULL,
-/* 757 */	NULL,
-/* 758 */	NULL,
-/* 759 */	NULL,
-/* 760 */	NULL,
-/* 761 */	NULL,
-/* 762 */	NULL,
-/* 763 */	NULL,
-/* 764 */	NULL,
-/* 765 */	NULL,
-/* 766 */	NULL,
-/* 767 */	NULL,
-/* 768 */	NULL,
-/* 769 */	NULL,
-/* 770 */	NULL,
-/* 771 */	NULL,
-/* 772 */	NULL,
-/* 773 */	NULL,
-/* 774 */	NULL,
-/* 775 */	NULL,
-/* 776 */	NULL,
-/* 777 */	NULL,
-/* 778 */	NULL,
-/* 779 */	NULL,
-/* 780 */	NULL,
-/* 781 */	NULL,
-/* 782 */	NULL,
-/* 783 */	NULL,
-/* 784 */	NULL,
-/* 785 */	NULL,
-/* 786 */	NULL,
-/* 787 */	NULL,
-/* 788 */	NULL,
-/* 789 */	NULL,
-/* 790 */	NULL,
-/* 791 */	NULL,
-/* 792 */	NULL,
-/* 793 */	NULL,
-/* 794 */	NULL,
-/* 795 */	NULL,
-/* 796 */	NULL,
-/* 797 */	NULL,
-/* 798 */	NULL,
-/* 799 */	NULL,
-/* 800 */	NULL,
-/* 801 */	NULL,
-/* 802 */	NULL,
-/* 803 */	NULL,
-/* 804 */	NULL,
-/* 805 */	NULL,
-/* 806 */	NULL,
-/* 807 */	NULL,
-/* 808 */	NULL,
-/* 809 */	NULL,
-/* 810 */	NULL,
-/* 811 */	NULL,
-/* 812 */	NULL,
-/* 813 */	NULL,
-/* 814 */	NULL,
-/* 815 */	NULL,
-/* 816 */	NULL,
-/* 817 */	NULL,
-/* 818 */	NULL,
-/* 819 */	NULL,
-/* 820 */	NULL,
-/* 821 */	NULL,
-/* 822 */	NULL,
-/* 823 */	NULL,
-/* 824 */	NULL,
-/* 825 */	NULL,
-/* 826 */	NULL,
-/* 827 */	NULL,
-/* 828 */	NULL,
-/* 829 */	NULL,
-/* 830 */	NULL,
-/* 831 */	NULL,
-/* 832 */	NULL,
-/* 833 */	NULL,
-/* 834 */	NULL,
-/* 835 */	NULL,
-/* 836 */	NULL,
-/* 837 */	NULL,
-/* 838 */	NULL,
-/* 839 */	NULL,
-/* 840 */	NULL,
-/* 841 */	NULL,
-/* 842 */	NULL,
-/* 843 */	NULL,
-/* 844 */	NULL,
-/* 845 */	NULL,
-/* 846 */	NULL,
-/* 847 */	NULL,
-/* 848 */	NULL,
-/* 849 */	NULL,
-/* 850 */	NULL,
-/* 851 */	NULL,
-/* 852 */	NULL,
-/* 853 */	NULL,
-/* 854 */	NULL,
-/* 855 */	NULL,
-/* 856 */	NULL,
-/* 857 */	NULL,
-/* 858 */	NULL,
-/* 859 */	NULL,
-/* 860 */	NULL,
-/* 861 */	NULL,
-/* 862 */	NULL,
-/* 863 */	NULL,
-/* 864 */	NULL,
-/* 865 */	NULL,
-/* 866 */	NULL,
-/* 867 */	NULL,
-/* 868 */	NULL,
-/* 869 */	NULL,
-/* 870 */	NULL,
-/* 871 */	NULL,
-/* 872 */	NULL,
-/* 873 */	NULL,
-/* 874 */	NULL,
-/* 875 */	NULL,
-/* 876 */	NULL,
-/* 877 */	NULL,
-/* 878 */	NULL,
-/* 879 */	NULL,
-/* 880 */	NULL,
-/* 881 */	NULL,
-/* 882 */	NULL,
-/* 883 */	NULL,
-/* 884 */	NULL,
-/* 885 */	NULL,
-/* 886 */	NULL,
-/* 887 */	NULL,
-/* 888 */	NULL,
-/* 889 */	NULL,
-/* 890 */	NULL,
-/* 891 */	NULL,
-/* 892 */	NULL,
-/* 893 */	NULL,
-/* 894 */	NULL,
-/* 895 */	NULL,
-/* 896 */	NULL,
-/* 897 */	NULL,
-/* 898 */	NULL,
-/* 899 */	NULL,
-/* 900 */	NULL,
-/* 901 */	NULL,
-/* 902 */	NULL,
-/* 903 */	NULL,
-/* 904 */	NULL,
-/* 905 */	NULL,
-/* 906 */	NULL,
-/* 907 */	NULL,
-/* 908 */	NULL,
-/* 909 */	NULL,
-/* 910 */	NULL,
-/* 911 */	NULL,
-/* 912 */	NULL,
-/* 913 */	NULL,
-/* 914 */	NULL,
-/* 915 */	NULL,
-/* 916 */	NULL,
-/* 917 */	NULL,
-/* 918 */	NULL,
-/* 919 */	NULL,
-/* 920 */	NULL,
-/* 921 */	NULL,
-/* 922 */	NULL,
-/* 923 */	NULL,
-/* 924 */	NULL,
-/* 925 */	NULL,
-/* 926 */	NULL,
-/* 927 */	NULL,
-/* 928 */	NULL,
-/* 929 */	NULL,
-/* 930 */	NULL,
-/* 931 */	NULL,
-/* 932 */	NULL,
-/* 933 */	NULL,
-/* 934 */	NULL,
-/* 935 */	NULL,
-/* 936 */	NULL,
-/* 937 */	NULL,
-/* 938 */	NULL,
-/* 939 */	NULL,
-/* 940 */	NULL,
-/* 941 */	NULL,
-/* 942 */	NULL,
-/* 943 */	NULL,
-/* 944 */	NULL,
-/* 945 */	NULL,
-/* 946 */	NULL,
-/* 947 */	NULL,
-/* 948 */	NULL,
-/* 949 */	NULL,
-/* 950 */	NULL,
-/* 951 */	NULL,
-/* 952 */	NULL,
-/* 953 */	NULL,
-/* 954 */	NULL,
-/* 955 */	NULL,
-/* 956 */	NULL,
-/* 957 */	NULL,
-/* 958 */	NULL,
-/* 959 */	NULL,
-/* 960 */	NULL,
-/* 961 */	NULL,
-/* 962 */	NULL,
-/* 963 */	NULL,
-/* 964 */	NULL,
-/* 965 */	NULL,
-/* 966 */	NULL,
-/* 967 */	NULL,
-/* 968 */	NULL,
-/* 969 */	NULL,
-/* 970 */	NULL,
-/* 971 */	NULL,
-/* 972 */	NULL,
-/* 973 */	NULL,
-/* 974 */	NULL,
-/* 975 */	NULL,
-/* 976 */	NULL,
-/* 977 */	NULL,
-/* 978 */	NULL,
-/* 979 */	NULL,
-/* 980 */	NULL,
-/* 981 */	NULL,
-/* 982 */	NULL,
-/* 983 */	NULL,
-/* 984 */	NULL,
-/* 985 */	NULL,
-/* 986 */	NULL,
-/* 987 */	NULL,
-/* 988 */	NULL,
-/* 989 */	NULL,
-/* 990 */	NULL,
-/* 991 */	NULL,
-/* 992 */	NULL,
-/* 993 */	NULL,
-/* 994 */	NULL,
-/* 995 */	NULL,
-/* 996 */	NULL,
-/* 997 */	NULL,
-/* 998 */	NULL,
-/* 999 LAST ERR_LAST_ERR_MSG,*/	":%s 999 %s :Last Error Message"
-};
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/newconf.c ircd-ratbox-1.2-3/src/newconf.c
--- ircd-ratbox-1.2-3+ipmask/src/newconf.c	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/src/newconf.c	Sat Sep  6 13:18:13 2003
@@ -108,8 +108,6 @@
 	{"restricted", CONF_FLAGS_RESTRICTED},
 	{"need_ident", CONF_FLAGS_NEED_IDENTD},
 	{"have_ident", CONF_FLAGS_NEED_IDENTD},
-	{"mask", CONF_FLAGS_IPMASK},
-	{"no_mask_notice", CONF_FLAGS_NO_MASK_NOTICE},
 	{NULL}
 };
 
@@ -1359,28 +1357,6 @@
 	DupString(yy_achead->className, data);
 }
 
-static void
-conf_set_auth_mask(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if (yesno)
-		yy_achead->flags |= CONF_FLAGS_IPMASK;
-	else
-		yy_achead->flags &= ~CONF_FLAGS_IPMASK;
-}
-
-static void
-conf_set_auth_no_mask_notice (void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if (yesno)
-		yy_achead->flags |= CONF_FLAGS_NO_MASK_NOTICE;
-	else
-		yy_achead->flags &= ~CONF_FLAGS_NO_MASK_NOTICE;
-}
-
 static int
 conf_begin_resv(struct TopConf *tc)
 {
@@ -2991,8 +2967,6 @@
 	add_conf_item("auth", "flood_exempt", CF_YESNO, conf_set_auth_flood_exempt);
 	add_conf_item("auth", "redirserv", CF_QSTRING, conf_set_auth_redir_serv);
 	add_conf_item("auth", "redirport", CF_INT, conf_set_auth_redir_port);
-	add_conf_item("auth", "mask", CF_YESNO, conf_set_auth_mask);
-	add_conf_item("auth", "no_mask_notice", CF_YESNO, conf_set_auth_no_mask_notice);
 	add_conf_item("auth", "flags", CF_STRING | CF_FLIST, conf_set_auth_flags);
 
 	add_top_conf("resv", conf_begin_resv, conf_end_resv);
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/newconf.c.orig ircd-ratbox-1.2-3/src/newconf.c.orig
--- ircd-ratbox-1.2-3+ipmask/src/newconf.c.orig	Sat Sep  6 13:18:13 2003
+++ ircd-ratbox-1.2-3/src/newconf.c.orig	Wed Dec 31 17:00:00 1969
@@ -1,3134 +0,0 @@
-/* This code is in the public domain.
- * $Id: newconf.c,v 7.93.2.9 2003/09/06 20:18:13 leeh Exp $
- */
-
-#include "stdinc.h"
-
-#ifdef HAVE_LIBCRYPTO
-#include <openssl/pem.h>
-#include <openssl/rsa.h>
-#endif
-
-#include "memory.h"
-#include "newconf.h"
-#include "tools.h"
-#include "ircd_defs.h"
-#include "sprintf_irc.h"
-#include "common.h"
-#include "s_log.h"
-#include "s_conf.h"
-#include "s_user.h"
-#include "send.h"
-#include "setup.h"
-#include "modules.h"
-#include "listener.h"
-#include "hostmask.h"
-#include "resv.h"
-#include "s_serv.h"
-#include "event.h"
-#include "hash.h"
-#include "cluster.h"
-
-#define CF_TYPE(x) ((x) & CF_MTYPE)
-
-struct TopConf *conf_cur_block;
-static char *conf_cur_block_name;
-
-static dlink_list conf_items;
-
-/* XXX This _really_ needs to go away */
-static struct ConfItem *yy_achead = NULL;
-static struct ConfItem *yy_aconf = NULL;
-static struct ConfItem *yy_aprev = NULL;
-static int yy_acount = 0;
-static struct ConfItem *yy_hconf;
-static struct ConfItem *yy_lconf;
-
-static struct ConfItem *hub_confs;
-static struct ConfItem *leaf_confs;
-static struct ConfItem *yy_aconf_next;
-
-static struct cluster *yy_cconf = NULL;
-
-static struct Class *yy_class = NULL;
-static char *resv_reason;
-
-struct mode_table
-{
-	const char *name;
-	int mode;
-};
-
-static struct mode_table umode_table[] = {
-	{"bots", UMODE_BOTS},
-	{"cconn", UMODE_CCONN},
-	{"debug", UMODE_DEBUG},
-	{"full", UMODE_FULL},
-	{"callerid", UMODE_CALLERID},
-	{"invisible", UMODE_INVISIBLE},
-	{"skill", UMODE_SKILL},
-	{"locops", UMODE_LOCOPS},
-	{"nchange", UMODE_NCHANGE},
-	{"rej", UMODE_REJ},
-	{"servnotice", UMODE_SERVNOTICE},
-	{"unauth", UMODE_UNAUTH},
-	{"wallop", UMODE_WALLOP},
-	{"external", UMODE_EXTERNAL},
-	{"spy", UMODE_SPY},
-	{"operwall", UMODE_OPERWALL},
-	{"operspy", UMODE_OPERSPY},
-	{NULL}
-};
-
-static struct mode_table flag_table[] = {
-	{"global_kill", OPER_GLOBAL_KILL},
-	{"remote", OPER_REMOTE},
-	{"kline", OPER_K},
-	{"unkline", OPER_UNKLINE},
-	{"gline", OPER_GLINE},
-	{"nick_changes", OPER_N},
-	{"rehash", OPER_REHASH},
-	{"die", OPER_DIE},
-	{"admin", OPER_ADMIN},
-	{"hidden_admin", OPER_HIDDENADMIN},
-	{"xline", OPER_XLINE},
-	{"operwall", OPER_OPERWALL},
-	{"oper_spy", OPER_SPY},
-	{NULL}
-};
-
-static struct mode_table auth_table[] = {
-	{"spoof_notice", CONF_FLAGS_SPOOF_NOTICE},
-	{"exceed_limit", CONF_FLAGS_NOLIMIT},
-	{"kline_exempt", CONF_FLAGS_EXEMPTKLINE},
-	{"gline_exempt", CONF_FLAGS_EXEMPTGLINE},
-	{"spambot_exempt", CONF_FLAGS_EXEMPTSPAMBOT},
-	{"flood_exempt", CONF_FLAGS_EXEMPTFLOOD},
-	{"no_tilde", CONF_FLAGS_NO_TILDE},
-	{"restricted", CONF_FLAGS_RESTRICTED},
-	{"need_ident", CONF_FLAGS_NEED_IDENTD},
-	{"have_ident", CONF_FLAGS_NEED_IDENTD},
-	{NULL}
-};
-
-static struct mode_table cluster_table[] = {
-	{ "kline",	CLUSTER_KLINE	},
-	{ "unkline",	CLUSTER_UNKLINE	},
-	{ "locops",	CLUSTER_LOCOPS	},
-	{ "xline",	CLUSTER_XLINE	},
-	{ "unxline",	CLUSTER_UNXLINE },
-	{ "resv",	CLUSTER_RESV	},
-	{ "unresv",	CLUSTER_UNRESV	},
-	{ "all",	CLUSTER_ALL	},
-	{NULL}
-};
-
-static struct mode_table shared_table[] =
-{
-	{ "kline",	OPER_K		},
-	{ "unkline",	OPER_UNKLINE	},
-	{ "xline",	OPER_XLINE	},
-	{ "resv",	OPER_RESV	},
-	{ "all",	OPER_K|OPER_UNKLINE|OPER_XLINE|OPER_RESV },
-	{NULL}
-};
-
-
-static const char *
-conf_strtype(int type)
-{
-	switch (type & CF_MTYPE)
-	{
-	case CF_INT:
-		return "integer value";
-	case CF_STRING:
-		return "unquoted string";
-	case CF_YESNO:
-		return "yes/no value";
-	case CF_QSTRING:
-		return "quoted string";
-	case CF_TIME:
-		return "time/size value";
-	default:
-		return "unknown type";
-	}
-}
-
-static int
-add_top_conf(const char *name, int (*sfunc) (struct TopConf *), int (*efunc) (struct TopConf *))
-{
-	struct TopConf *tc;
-
-	tc = MyMalloc(sizeof(struct TopConf));
-
-	DupString(tc->tc_name, name);
-	tc->tc_sfunc = sfunc;
-	tc->tc_efunc = efunc;
-
-	dlinkAddAlloc(tc, &conf_items);
-	return 0;
-}
-
-static struct TopConf *
-find_top_conf(const char *name)
-{
-	dlink_node *d;
-	struct TopConf *tc;
-
-	DLINK_FOREACH(d, conf_items.head)
-	{
-		tc = d->data;
-		if(strcasecmp(tc->tc_name, name) == 0)
-			return tc;
-	}
-
-	return NULL;
-}
-
-#if 0
-static int
-remove_top_conf(char *name)
-{
-	struct TopConf *tc;
-	dlink_node *ptr;
-
-	if((tc = find_top_conf(name)) == NULL)
-		return -1;
-
-	if((ptr = dlinkFind(&conf_items, tc)) == NULL)
-		return -1;
-
-	dlinkDestroy(ptr, &conf_items);
-	MyFree(tc->tc_name);
-	MyFree(tc);
-
-	return 0;
-}
-#endif
-
-
-static struct ConfEntry *
-find_conf_item(const struct TopConf *top, const char *name)
-{
-	dlink_node *d;
-	struct ConfEntry *cf;
-
-	DLINK_FOREACH(d, top->tc_items.head)
-	{
-		cf = d->data;
-		if(strcasecmp(cf->cf_name, name) == 0)
-			return cf;
-	}
-
-	return NULL;
-}
-
-
-
-static void
-conf_set_general_reject_ban_time(void *data)
-{ 	
-	ConfigFileEntry.reject_ban_time = *(unsigned int *) data;
-} 
-
-static void
-conf_set_general_reject_after_count(void *data)
-{ 	
-	ConfigFileEntry.reject_after_count = *(unsigned int *) data;
-} 
-
-static void
-conf_set_general_reject_duration(void *data)
-{
-	ConfigFileEntry.reject_duration = *(unsigned int *) data;
-}
-
-static void
-conf_set_class_cidr_bitlen(void *data)
-{
-#ifdef IPV6
-	unsigned int maxsize = 128;
-#else
-	unsigned int maxsize = 32;
-#endif
-	if(*(unsigned int *) data > maxsize)
-		conf_report_error
-			("class::cidr_bitlen argument exceeds maxsize (%d > %d) - ignoring.",
-			 *(unsigned int *) data, maxsize);
-	else
-		yy_class->cidr_bitlen = *(unsigned int *) data;
-
-}
-
-static void
-conf_set_class_number_per_cidr(void *data)
-{
-	yy_class->cidr_amount = *(unsigned int *) data;
-}
-
-
-
-static void
-conf_set_serverinfo_rsa_private_key_file(void *data)
-{
-#ifdef HAVE_LIBCRYPTO
-	BIO *file;
-
-	if(ServerInfo.rsa_private_key)
-	{
-		RSA_free(ServerInfo.rsa_private_key);
-		ServerInfo.rsa_private_key = NULL;
-	}
-
-	if(ServerInfo.rsa_private_key_file)
-	{
-		MyFree(ServerInfo.rsa_private_key_file);
-		ServerInfo.rsa_private_key_file = NULL;
-	}
-
-	DupString(ServerInfo.rsa_private_key_file, (char *) data);
-
-	file = BIO_new_file((char *) data, "r");
-
-	if(file == NULL)
-	{
-		conf_report_error("Ignoring config file entry rsa_private_key -- file open failed"
-				  " (%s)", (char *) data);
-		return;
-	}
-
-	ServerInfo.rsa_private_key = (RSA *) PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL);
-	if(ServerInfo.rsa_private_key == NULL)
-	{
-		conf_report_error
-			("Ignoring config file entry rsa_private_key -- couldn't extract key");
-		return;
-	}
-
-	if(!RSA_check_key(ServerInfo.rsa_private_key))
-	{
-		conf_report_error("Ignoring config file entry rsa_private_key -- invalid key");
-		return;
-	}
-
-	/* require 2048 bit (256 byte) key */
-	if(RSA_size(ServerInfo.rsa_private_key) != 256)
-	{
-		conf_report_error("Ignoring config file entry rsa_private_key -- not 2048 bit");
-		return;
-	}
-
-	BIO_set_close(file, BIO_CLOSE);
-	BIO_free(file);
-#else
-	conf_report_error("Ignoring serverinfo::rsa_private_key -- SSL support not available.");
-#endif
-}
-
-static void
-conf_set_serverinfo_name(void *data)
-{
-	if(ServerInfo.name == NULL)
-	{
-		/* the ircd will exit() in main() if we dont set one */
-		if(strlen((char *) data) <= HOSTLEN)
-			DupString(ServerInfo.name, (char *) data);
-	}
-}
-
-static void
-conf_set_serverinfo_description(void *data)
-{
-	MyFree(ServerInfo.description);
-	DupString(ServerInfo.description, (char *) data);
-}
-
-static void
-conf_set_serverinfo_network_name(void *data)
-{
-	char *p;
-
-	if((p = strchr((char *) data, ' ')))
-		*p = '\0';
-
-	MyFree(ServerInfo.network_name);
-	DupString(ServerInfo.network_name, (char *) data);
-}
-
-static void
-conf_set_serverinfo_network_desc(void *data)
-{
-	MyFree(ServerInfo.network_desc);
-	DupString(ServerInfo.network_desc, (char *) data);
-}
-
-static void
-conf_set_serverinfo_vhost(void *data)
-{
-	if(inetpton(DEF_FAM, (char *) data, &IN_ADDR(ServerInfo.ip)) <= 0)
-	{
-		conf_report_error("Invalid netmask for server IPv4 vhost (%s)", (char *) data);
-		return;
-	}
-
-	ServerInfo.specific_ipv4_vhost = 1;
-}
-
-static void
-conf_set_serverinfo_vhost6(void *data)
-{
-#ifdef IPV6
-	if(inetpton(DEF_FAM, (char *) data, &IN_ADDR(ServerInfo.ip6)) <= 0)
-	{
-		conf_report_error("Invalid netmask for server IPv6 vhost (%s)", (char *) data);
-		return;
-	}
-
-	ServerInfo.specific_ipv6_vhost = 1;
-#else
-	conf_report_error("Warning -- ignoring serverinfo::vhost6 -- IPv6 support not available.");
-#endif
-}
-
-static void
-conf_set_serverinfo_hub(void *data)
-{
-	int hub = *(int *) data;
-
-	ServerInfo.hub = hub;
-}
-
-static void
-conf_set_modules_module(void *data)
-{
-#ifndef STATIC_MODULES
-	char *m_bn;
-
-	m_bn = irc_basename((char *) data);
-
-	if(findmodule_byname(m_bn) != -1)
-		return;
-
-	load_one_module((char *) data, 0);
-
-	MyFree(m_bn);
-#else
-	conf_report_error("Ignoring modules::module -- loadable module support not present.");
-#endif
-}
-
-static void
-conf_set_modules_path(void *data)
-{
-#ifndef STATIC_MODULES
-	mod_add_path((char *) data);
-#else
-	conf_report_error("Ignoring modules::path -- loadable module support net present.");
-#endif
-}
-
-static void
-conf_set_admin_name(void *data)
-{
-	MyFree(AdminInfo.name);
-	DupString(AdminInfo.name, (char *) data);
-}
-
-static void
-conf_set_admin_email(void *data)
-{
-	MyFree(AdminInfo.email);
-	DupString(AdminInfo.email, (char *) data);
-}
-
-static void
-conf_set_admin_description(void *data)
-{
-	MyFree(AdminInfo.description);
-	DupString(AdminInfo.description, (char *) data);
-}
-
-static void
-conf_set_logging_path(void *data)
-{
-	conf_report_error("Warning -- logging::path is not yet implemented.");
-}
-
-static void
-conf_set_logging_oper_log(void *data)
-{
-	conf_report_error("Warning -- logging::oper_log is not yet implemented.");
-}
-
-static void
-conf_set_logging_gline_log(void *data)
-{
-	conf_report_error("Warning -- logging::gline_log is not yet implemented.");
-}
-
-static void
-conf_set_logging_fname_userlog(void *data)
-{
-	strlcpy(ConfigFileEntry.fname_userlog, data, sizeof(ConfigFileEntry.fname_userlog));
-}
-
-static void
-conf_set_logging_fname_foperlog(void *data)
-{
-	strlcpy(ConfigFileEntry.fname_foperlog, data, sizeof(ConfigFileEntry.fname_foperlog));
-}
-
-static void
-conf_set_logging_fname_operlog(void *data)
-{
-	strlcpy(ConfigFileEntry.fname_operlog, data, sizeof(ConfigFileEntry.fname_operlog));
-}
-
-static void
-conf_set_logging_fname_operspylog(void *data)
-{
-	strlcpy(ConfigFileEntry.fname_operspylog, data,
-		sizeof(ConfigFileEntry.fname_operspylog));
-}
-
-static void
-conf_set_logging_fname_operspyremotelog(void *data)
-{
-	strlcpy(ConfigFileEntry.fname_operspyremotelog, data,
-		sizeof(ConfigFileEntry.fname_operspyremotelog));
-}
-
-static struct
-{
-	const char *name;
-	int level;
-}
-log_levels[] =
-{
-	{ "l_crit",	L_CRIT} ,
-	{ "l_error",	L_ERROR} ,
-	{ "l_warn",	L_WARN} ,
-	{ "l_notice",	L_NOTICE} ,
-	{ "l_trace",	L_TRACE} ,
-	{ "l_info",	L_INFO} ,
-	{ "l_debug",	L_DEBUG} ,
-	{ NULL, 0}
-};
-
-static void
-conf_set_logging_log_level(void *data)
-{
-	int i;
-
-	for (i = 0; log_levels[i].name; i++)
-	{
-		if(strcasecmp((char *) data, log_levels[i].name) == 0)
-		{
-			set_log_level(log_levels[i].level);
-			return;
-		}
-	}
-
-	conf_report_error("Warning -- log level '%s' is not defined, "
-			  "using default of L_NOTICE", (char *) data);
-	set_log_level(L_NOTICE);
-}
-
-
-static int
-find_umode(struct mode_table *tab, char *name)
-{
-	int i;
-
-	for (i = 0; tab[i].name; i++)
-	{
-		if(strcmp(tab[i].name, name) == 0)
-			return tab[i].mode;
-	}
-
-	return 0;
-}
-
-static void
-set_modes_from_table(int *modes, const char *whatis, struct mode_table *tab, conf_parm_t * args)
-{
-	for (; args; args = args->next)
-	{
-		int mode;
-
-		if((args->type & CF_MTYPE) != CF_STRING)
-		{
-			conf_report_error("Warning -- %s is not a string; ignoring.", whatis);
-			continue;
-		}
-
-		mode = find_umode(tab, args->v.string);
-
-		if(!mode)
-		{
-			conf_report_error("Warning -- unknown %s %s.", whatis, args->v.string);
-			continue;
-		}
-
-		*modes |= mode;
-	}
-}
-
-static int
-conf_begin_oper(struct TopConf *tc)
-{
-	struct ConfItem *yy_tmp;
-
-	yy_tmp = yy_achead;
-	while (yy_tmp)
-	{
-		yy_aconf = yy_tmp;
-		yy_tmp = yy_tmp->next;
-		yy_aconf->next = NULL;
-		free_conf(yy_aconf);
-	}
-	yy_acount = 0;
-	yy_achead = yy_aconf = make_conf();
-	yy_aconf->status = CONF_OPERATOR;
-	yy_aconf->flags |= CONF_FLAGS_ENCRYPTED;
-	yy_achead->port |= OPER_OPERWALL;
-	return 0;
-}
-
-static int
-conf_end_oper(struct TopConf *tc)
-{
-	struct ConfItem *yy_tmp;
-	struct ConfItem *yy_next;
-
-	if(conf_cur_block_name != NULL)
-	{
-		MyFree(yy_achead->name);
-		DupString(yy_achead->name, conf_cur_block_name);
-	}
-	/* copy over settings from first struct */
-	for (yy_tmp = yy_achead->next; yy_tmp; yy_tmp = yy_tmp->next)
-	{
-		if(yy_achead->className)
-			DupString(yy_tmp->className, yy_achead->className);
-		if(yy_achead->name)
-			DupString(yy_tmp->name, yy_achead->name);
-		if(yy_achead->passwd)
-			DupString(yy_tmp->passwd, yy_achead->passwd);
-		yy_tmp->port = yy_achead->port;
-		yy_tmp->flags = yy_achead->flags;
-
-#ifdef HAVE_LIBCRYPTO
-		if(yy_achead->rsa_public_key_file)
-			DupString(yy_tmp->rsa_public_key_file, yy_achead->rsa_public_key_file);
-
-		if(yy_achead->rsa_public_key)
-		{
-			BIO *file;
-
-			file = BIO_new_file(yy_achead->rsa_public_key_file, "r");
-			yy_tmp->rsa_public_key = (RSA *) PEM_read_bio_RSA_PUBKEY(file,
-										 NULL, 0, NULL);
-			BIO_set_close(file, BIO_CLOSE);
-			BIO_free(file);
-		}
-#endif
-	}
-
-	for (yy_tmp = yy_achead; yy_tmp; yy_tmp = yy_next)
-	{
-		yy_next = yy_tmp->next;
-
-#ifdef HAVE_LIBCRYPTO
-		if(yy_tmp->name && (yy_tmp->passwd || yy_aconf->rsa_public_key) && yy_tmp->host)
-#else
-		if(yy_tmp->name && yy_tmp->passwd && yy_tmp->host)
-#endif
-		{
-			conf_add_class_to_conf(yy_tmp);
-			conf_add_conf(yy_tmp);
-		}
-		else
-		{
-			free_conf(yy_tmp);
-		}
-	}
-
-	yy_achead = NULL;
-	yy_aconf = NULL;
-	yy_aprev = NULL;
-	yy_acount = 0;
-
-	return 0;
-}
-
-static void
-conf_set_oper_flags(void *data)
-{
-	conf_parm_t *args = data;
-
-	set_modes_from_table(&yy_achead->port, "flag", flag_table, args);
-}
-
-static void
-conf_set_oper_name(void *data)
-{
-	int oname_len;
-
-	MyFree(yy_achead->name);
-
-	if((oname_len = strlen((char *) data)) > OPERNICKLEN)
-		((char *) data)[OPERNICKLEN] = 0;
-
-	DupString(yy_achead->name, (char *) data);
-}
-
-static void
-conf_set_oper_user(void *data)
-{
-	char *p;
-	char *new_user;
-	char *new_host;
-	char *host = (char *) data;
-
-	/* The first user= line doesn't allocate a new conf */
-	if(yy_acount++)
-	{
-		yy_aconf = (yy_aconf->next = make_conf());
-		yy_aconf->status = CONF_OPERATOR;
-	}
-
-	if((p = strchr(host, '@')))
-	{
-		*p = '\0';
-		DupString(new_user, host);
-		MyFree(yy_aconf->user);
-		yy_aconf->user = new_user;
-		p++;
-		DupString(new_host, p);
-		MyFree(yy_aconf->host);
-		yy_aconf->host = new_host;
-	}
-	else
-	{
-		MyFree(yy_aconf->host);
-		DupString(yy_aconf->host, host);
-		DupString(yy_aconf->user, "*");
-	}
-}
-
-static void
-conf_set_oper_password(void *data)
-{
-	if(yy_achead->passwd)
-		memset(yy_achead->passwd, 0, strlen(yy_achead->passwd));
-
-	MyFree(yy_achead->passwd);
-	DupString(yy_achead->passwd, (char *) data);
-}
-
-static void
-conf_set_oper_rsa_public_key_file(void *data)
-{
-#ifdef HAVE_LIBCRYPTO
-	BIO *file;
-
-	if(yy_achead->rsa_public_key)
-	{
-		RSA_free(yy_achead->rsa_public_key);
-		yy_achead->rsa_public_key = NULL;
-	}
-
-	if(yy_achead->rsa_public_key_file)
-	{
-		MyFree(yy_achead->rsa_public_key_file);
-		yy_achead->rsa_public_key_file = NULL;
-	}
-
-	DupString(yy_achead->rsa_public_key_file, (char *) data);
-
-	file = BIO_new_file((char *) data, "r");
-
-	if(file == NULL)
-	{
-		conf_report_error("Ignoring rsa_public_key_file -- does %s exist?", (char *) data);
-		return;
-	}
-
-	yy_achead->rsa_public_key = (RSA *) PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL);
-
-	if(yy_achead->rsa_public_key == NULL)
-	{
-		conf_report_error("Ignoring rsa_public_key_file -- Key invalid; check key syntax.");
-		return;
-	}
-
-	BIO_set_close(file, BIO_CLOSE);
-	BIO_free(file);
-#else
-	conf_report_error("Warning -- ignoring rsa_public_key_file (OpenSSL support not available");
-#endif
-}
-
-static void
-conf_set_oper_encrypted(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_achead->flags |= CONF_FLAGS_ENCRYPTED;
-	else
-		yy_achead->flags &= ~CONF_FLAGS_ENCRYPTED;
-}
-
-static void
-conf_set_oper_class(void *data)
-{
-	MyFree(yy_achead->className);
-	DupString(yy_achead->className, (char *) data);
-}
-
-static void
-conf_set_oper_global_kill(void *data)
-{
-	int yesno = *(int *) data;
-
-	if(yesno)
-		yy_achead->port |= OPER_GLOBAL_KILL;
-	else
-		yy_achead->port &= ~OPER_GLOBAL_KILL;
-}
-
-static void
-conf_set_oper_remote(void *data)
-{
-	int yesno = *(int *) data;
-
-	if(yesno)
-		yy_achead->port |= OPER_REMOTE;
-	else
-		yy_achead->port &= ~OPER_REMOTE;
-}
-
-static void
-conf_set_oper_kline(void *data)
-{
-	int yesno = *(int *) data;
-
-	if(yesno)
-		yy_achead->port |= OPER_K;
-	else
-		yy_achead->port &= ~OPER_K;
-}
-
-static void
-conf_set_oper_unkline(void *data)
-{
-	int yesno = *(int *) data;
-
-	if(yesno)
-		yy_achead->port |= OPER_UNKLINE;
-	else
-		yy_achead->port &= ~OPER_UNKLINE;
-}
-
-static void
-conf_set_oper_xline(void *data)
-{
-	int yesno = *(int *) data;
-
-	if(yesno)
-		yy_achead->port |= OPER_XLINE;
-	else
-		yy_achead->port &= ~OPER_XLINE;
-}
-
-static void
-conf_set_oper_gline(void *data)
-{
-	int yesno = *(int *) data;
-
-	if(yesno)
-		yy_achead->port |= OPER_GLINE;
-	else
-		yy_achead->port &= ~OPER_GLINE;
-}
-
-static void
-conf_set_oper_operwall(void *data)
-{
-	int yesno = *(int *) data;
-
-	if(yesno)
-		yy_achead->port |= OPER_OPERWALL;
-	else
-		yy_achead->port &= ~OPER_OPERWALL;
-}
-
-static void
-conf_set_oper_nick_changes(void *data)
-{
-	int yesno = *(int *) data;
-
-	if(yesno)
-		yy_achead->port |= OPER_N;
-	else
-		yy_achead->port &= ~OPER_N;
-}
-
-static void
-conf_set_oper_die(void *data)
-{
-	int yesno = *(int *) data;
-
-	if(yesno)
-		yy_achead->port |= OPER_DIE;
-	else
-		yy_achead->port &= ~OPER_DIE;
-}
-
-static void
-conf_set_oper_rehash(void *data)
-{
-	int yesno = *(int *) data;
-
-	if(yesno)
-		yy_achead->port |= OPER_REHASH;
-	else
-		yy_achead->port &= ~OPER_REHASH;
-}
-
-static void
-conf_set_oper_admin(void *data)
-{
-	int yesno = *(int *) data;
-
-	if(yesno)
-		yy_achead->port |= OPER_ADMIN;
-	else
-		yy_achead->port &= ~OPER_ADMIN;
-}
-
-static void
-conf_set_oper_hidden_admin(void *data)
-{
-	int yesno = *(int *) data;
-
-	if(yesno)
-		yy_achead->port |= OPER_HIDDENADMIN;
-	else
-		yy_achead->port &= ~OPER_HIDDENADMIN;
-}
-
-static void
-conf_set_oper_spy(void *data)
-{
-	int yesno = *(int *) data;
-
-	if(yesno)
-		yy_achead->port |= OPER_SPY;
-	else
-		yy_achead->port &= ~OPER_SPY;
-}
-
-static int
-conf_begin_class(struct TopConf *tc)
-{
-	yy_class = make_class();
-	return 0;
-}
-
-static int
-conf_end_class(struct TopConf *tc)
-{
-	if(conf_cur_block_name != NULL)
-	{
-		MyFree(yy_class->class_name);
-		DupString(yy_class->class_name, conf_cur_block_name);
-	}
-
-	if(yy_class->class_name)
-		add_class(yy_class);
-	else
-		free_class(yy_class);
-	return 0;
-}
-
-static void
-conf_set_class_name(void *data)
-{
-	DupString(yy_class->class_name, (char *) data);
-}
-
-static void
-conf_set_class_ping_time(void *data)
-{
-	yy_class->ping_freq = *(unsigned int *) data;
-}
-
-static void
-conf_set_class_number_per_ip(void *data)
-{
-	yy_class->max_local = *(unsigned int *) data;
-}
-
-static void
-conf_set_class_number_per_ip_global(void *data)
-{
-	yy_class->max_global = *(unsigned int *) data;
-}
-
-static void
-conf_set_class_number_per_ident(void *data)
-{
-	yy_class->max_ident = *(unsigned int *) data;
-}
-
-static void
-conf_set_class_connectfreq(void *data)
-{
-	yy_class->con_freq = *(unsigned int *) data;
-}
-
-static void
-conf_set_class_max_number(void *data)
-{
-	yy_class->max_total = *(unsigned int *) data;
-}
-
-static void
-conf_set_class_sendq(void *data)
-{
-	yy_class->max_sendq = *(unsigned int *) data;
-}
-
-static void
-conf_set_class_sendq_eob(void *data)
-{
-	yy_class->max_sendq_eob = *(unsigned int *) data;
-}
-
-static char *listener_address;
-
-static int
-conf_begin_listen(struct TopConf *tc)
-{
-	listener_address = NULL;
-	return 0;
-}
-
-static int
-conf_end_listen(struct TopConf *tc)
-{
-	MyFree(listener_address);
-	listener_address = NULL;
-	return 0;
-}
-
-static void
-conf_set_listen_port(void *data)
-{
-	conf_parm_t *args = data;
-
-	for (; args; args = args->next)
-	{
-		if((args->type & CF_MTYPE) != CF_INT)
-		{
-			conf_report_error("listener::port argument is not an integer "
-					  "-- ignoring.");
-			continue;
-		}
-
-		add_listener(args->v.number, listener_address);
-	}
-}
-
-static void
-conf_set_listen_address(void *data)
-{
-	MyFree(listener_address);
-	DupString(listener_address, data);
-}
-
-static int
-conf_begin_auth(struct TopConf *tc)
-{
-	struct ConfItem *yy_tmp;
-
-	yy_tmp = yy_achead;
-	while (yy_tmp)
-	{
-		yy_aconf = yy_tmp;
-		yy_tmp = yy_tmp->next;
-		yy_aconf->next = NULL;
-		free_conf(yy_aconf);
-	}
-	yy_achead = NULL;
-	yy_aconf = NULL;
-	yy_aprev = NULL;
-	yy_achead = yy_aprev = yy_aconf = make_conf();
-	yy_aconf->status = CONF_CLIENT;
-
-	return 0;
-}
-
-static int
-conf_end_auth(struct TopConf *tc)
-{
-	struct ConfItem *yy_tmp;
-	struct ConfItem *yy_next;
-
-	/* copy over settings from first struct */
-	for (yy_tmp = yy_achead->next; yy_tmp; yy_tmp = yy_tmp->next)
-	{
-		if(yy_achead->passwd)
-			DupString(yy_tmp->passwd, yy_achead->passwd);
-		if(yy_achead->name)
-			DupString(yy_tmp->name, yy_achead->name);
-		if(yy_achead->className)
-			DupString(yy_tmp->className, yy_achead->className);
-
-		yy_tmp->flags = yy_achead->flags;
-		yy_tmp->port = yy_achead->port;
-	}
-
-	for (yy_tmp = yy_achead; yy_tmp; yy_tmp = yy_next)
-	{
-		yy_next = yy_tmp->next;	/* yy_tmp->next is used by conf_add_conf */
-		yy_tmp->next = NULL;
-
-		if(yy_tmp->name == NULL)
-			DupString(yy_tmp->name, "NOMATCH");
-
-		conf_add_class_to_conf(yy_tmp);
-
-		if(yy_tmp->user == NULL)
-			DupString(yy_tmp->user, "*");
-		else
-			collapse(yy_tmp->user);
-
-		if(yy_tmp->host == NULL)
-			continue;
-		else
-			collapse(yy_tmp->host);
-
-		add_conf_by_address(yy_tmp->host, CONF_CLIENT, yy_tmp->user, yy_tmp);
-	}
-
-	yy_achead = NULL;
-	yy_aconf = NULL;
-	yy_aprev = NULL;
-	yy_acount = 0;
-	return 0;
-}
-
-static void
-conf_set_auth_user(void *data)
-{
-	char *p;
-	char *new_user;
-	char *new_host;
-
-	/* The first user= line doesn't allocate a new conf */
-	if(yy_acount++)
-	{
-		yy_aprev = yy_aconf;
-		yy_aconf = (yy_aconf->next = make_conf());
-		yy_aconf->status = CONF_CLIENT;
-	}
-
-	if((p = strchr(data, '@')))
-	{
-		*p = '\0';
-		DupString(new_user, data);
-		MyFree(yy_aconf->user);
-		yy_aconf->user = new_user;
-		p++;
-		MyFree(yy_aconf->host);
-		DupString(new_host, p);
-		yy_aconf->host = new_host;
-	}
-	else
-	{
-		MyFree(yy_aconf->host);
-		DupString(yy_aconf->host, data);
-		DupString(yy_aconf->user, "*");
-	}
-}
-
-static void
-conf_set_auth_passwd(void *data)
-{
-	if(yy_achead->passwd)
-		memset(yy_achead->passwd, 0, strlen(yy_achead->passwd));
-	MyFree(yy_achead->passwd);
-	DupString(yy_achead->passwd, data);
-}
-
-static void
-conf_set_auth_encrypted(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_achead->flags |= CONF_FLAGS_ENCRYPTED;
-	else
-		yy_achead->flags &= ~CONF_FLAGS_ENCRYPTED;
-}
-
-static void
-conf_set_auth_spoof_notice(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_achead->flags |= CONF_FLAGS_SPOOF_NOTICE;
-	else
-		yy_achead->flags &= ~CONF_FLAGS_SPOOF_NOTICE;
-}
-
-static void
-conf_set_auth_spoof(void *data)
-{
-	char *p;
-	char *user = NULL;
-	char *host = NULL;
-
-	host = data;
-
-	/* user@host spoof */
-	if((p = strchr(host, '@')) != NULL)
-	{
-		*p = '\0';
-		user = data;
-		host = p+1;
-
-		if(EmptyString(user))
-		{
-			conf_report_error("Warning -- spoof ident empty.");
-			return;
-		}
-
-		if(strlen(user) > USERLEN)
-		{
-			conf_report_error("Warning -- spoof ident length invalid.");
-			return;
-		}
-
-		if(!valid_username(user))
-		{
-			conf_report_error("Warning -- invalid spoof (ident).");
-			return;
-		}
-
-		/* this must be restored! */
-		*p = '@';
-	}
-
-	if(EmptyString(host))
-	{
-		conf_report_error("Warning -- spoof host empty.");
-		return;
-	}
-
-	if(strlen(host) > HOSTLEN)
-	{
-		conf_report_error("Warning -- spoof host length invalid.");
-		return;
-	}
-
-	if(!valid_hostname(host) || (strchr(host, '.') == NULL))
-	{
-		conf_report_error("Warning -- invalid spoof (host).");
-		return;
-	}
-
-	MyFree(yy_achead->name);
-	DupString(yy_achead->name, data);
-	yy_achead->flags |= CONF_FLAGS_SPOOF_IP;
-}
-
-static void
-conf_set_auth_flags(void *data)
-{
-	conf_parm_t *args = data;
-
-	set_modes_from_table((int *) &yy_achead->flags, "flag", auth_table, args);
-}
-
-static void
-conf_set_auth_exceed_limit(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_achead->flags |= CONF_FLAGS_NOLIMIT;
-	else
-		yy_achead->flags &= ~CONF_FLAGS_NOLIMIT;
-}
-
-static void
-conf_set_auth_is_restricted(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_achead->flags |= CONF_FLAGS_RESTRICTED;
-	else
-		yy_achead->flags &= ~CONF_FLAGS_RESTRICTED;
-}
-
-static void
-conf_set_auth_kline_exempt(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_achead->flags |= CONF_FLAGS_EXEMPTKLINE;
-	else
-		yy_achead->flags &= ~CONF_FLAGS_EXEMPTKLINE;
-}
-
-static void
-conf_set_auth_need_ident(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_achead->flags |= CONF_FLAGS_NEED_IDENTD;
-	else
-		yy_achead->flags &= ~CONF_FLAGS_NEED_IDENTD;
-}
-
-static void
-conf_set_auth_no_tilde(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_achead->flags |= CONF_FLAGS_NO_TILDE;
-	else
-		yy_achead->flags &= ~CONF_FLAGS_NO_TILDE;
-}
-
-static void
-conf_set_auth_gline_exempt(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_achead->flags |= CONF_FLAGS_EXEMPTGLINE;
-	else
-		yy_achead->flags &= ~CONF_FLAGS_EXEMPTGLINE;
-}
-
-static void
-conf_set_auth_flood_exempt(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_achead->flags |= CONF_FLAGS_EXEMPTFLOOD;
-	else
-		yy_achead->flags &= ~CONF_FLAGS_EXEMPTFLOOD;
-}
-
-static void
-conf_set_auth_redir_serv(void *data)
-{
-	yy_achead->flags |= CONF_FLAGS_REDIR;
-	MyFree(yy_achead->name);
-	DupString(yy_achead->name, data);
-}
-
-static void
-conf_set_auth_redir_port(void *data)
-{
-	int port = *(unsigned int *) data;
-
-	yy_achead->flags |= CONF_FLAGS_REDIR;
-	yy_achead->port = port;
-}
-
-static void
-conf_set_auth_class(void *data)
-{
-	MyFree(yy_achead->className);
-	DupString(yy_achead->className, data);
-}
-
-static int
-conf_begin_resv(struct TopConf *tc)
-{
-	resv_reason = NULL;
-	return 0;
-}
-
-static int
-conf_end_resv(struct TopConf *tc)
-{
-	MyFree(resv_reason);
-	resv_reason = NULL;
-	return 0;
-}
-
-static void
-conf_set_resv_channel(void *data)
-{
-	static char noreason[] = "No Reason";
-
-	if(IsChannelName((char *) data))
-	{
-		if(resv_reason)
-			create_resv(data, resv_reason, RESV_CHANNEL);
-		else
-			create_resv(data, noreason, RESV_CHANNEL);
-	}
-	else
-	{
-		conf_report_error("Warning -- channel '%s' in resv is not a valid channel name.",
-				  (char *) data);
-	}
-}
-
-static void
-conf_set_resv_reason(void *data)
-{
-	MyFree(resv_reason);
-	DupString(resv_reason, data);
-}
-
-static void
-conf_set_resv_nick(void *data)
-{
-	char noreason[] = "No Reason";
-	if(clean_resv_nick(data))
-	{
-		if(resv_reason)
-			create_resv(data, resv_reason, RESV_NICK);
-		else
-			create_resv(data, noreason, RESV_NICK);
-	}
-	else
-	{
-		conf_report_error("Warning -- nickname '%s' in resv is not a valid nickname.",
-				  (char *) data);
-	}
-}
-
-static int
-conf_begin_shared(struct TopConf *tc)
-{
-	if(yy_aconf != NULL)
-	{
-		free_conf(yy_aconf);
-		yy_aconf = NULL;
-	}
-	yy_aconf = make_conf();
-	yy_aconf->status = CONF_ULINE;
-	yy_aconf->port = OPER_K;
-	return 0;
-}
-
-static int
-conf_end_shared(struct TopConf *tc)
-{
-	conf_add_u_conf(yy_aconf);
-	yy_aconf = (struct ConfItem *) NULL;
-	return 0;
-}
-
-static void
-conf_set_shared_name(void *data)
-{
-	MyFree(yy_aconf->name);
-	DupString(yy_aconf->name, data);
-}
-
-static void
-conf_set_shared_user(void *data)
-{
-	char *p;
-	char *new_user;
-	char *new_host;
-
-	if((p = strchr(data, '@')))
-	{
-		*p = '\0';
-		DupString(new_user, data);
-		MyFree(yy_aconf->user);
-		yy_aconf->user = new_user;
-
-		p++;
-		DupString(new_host, p);
-		MyFree(yy_aconf->host);
-		yy_aconf->host = new_host;
-	}
-}
-
-static void
-conf_set_shared_kline(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_aconf->port |= OPER_K;
-	else
-		yy_aconf->port &= ~OPER_K;
-}
-
-static void
-conf_set_shared_unkline(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_aconf->port |= OPER_UNKLINE;
-	else
-		yy_aconf->port &= ~OPER_UNKLINE;
-}
-
-static void
-conf_set_shared_type(void *data)
-{
-	conf_parm_t *args = data;
-
-	/* if theyre setting a type, remove the 'kline' default */
-	yy_aconf->port = 0;
-	set_modes_from_table(&yy_aconf->port, "flag", shared_table, args);
-}
-
-static int
-conf_begin_connect(struct TopConf *tc)
-{
-	hub_confs = NULL;
-
-	if(yy_aconf)
-	{
-		free_conf(yy_aconf);
-		yy_aconf = NULL;
-	}
-
-	if(yy_hconf)
-	{
-		free_conf(yy_hconf);
-		yy_hconf = NULL;
-	}
-
-	if(yy_lconf)
-	{
-		free_conf(yy_lconf);
-		yy_lconf = NULL;
-	}
-
-	yy_aconf = make_conf();
-	yy_aconf->passwd = NULL;
-	yy_aconf->status = CONF_SERVER;
-	yy_aconf->port = PORTNUM;
-	return 0;
-}
-
-static int
-conf_end_connect(struct TopConf *tc)
-{
-	if(conf_cur_block_name != NULL)
-	{
-		MyFree(yy_aconf->name);
-		DupString(yy_aconf->name, conf_cur_block_name);
-	}
-#ifdef HAVE_LIBCRYPTO
-	if(yy_aconf->host &&
-	   ((yy_aconf->passwd && yy_aconf->spasswd) ||
-	    (yy_aconf->rsa_public_key && IsConfCryptLink(yy_aconf))))
-#else /* !HAVE_LIBCRYPTO */
-	if(yy_aconf->host && !IsConfCryptLink(yy_aconf) && yy_aconf->passwd && yy_aconf->spasswd)
-#endif /* !HAVE_LIBCRYPTO */
-	{
-		if(conf_add_server(yy_aconf, scount) >= 0)
-		{
-			conf_add_conf(yy_aconf);
-			++scount;
-		}
-		else
-		{
-			free_conf(yy_aconf);
-			yy_aconf = NULL;
-		}
-	}
-	else
-	{
-		if(yy_aconf->name)
-		{
-#ifndef HAVE_LIBCRYPTO
-			if(IsConfCryptLink(yy_aconf))
-				conf_report_error
-					("Ignoring connect block for %s -- OpenSSL support is not available.",
-					 yy_aconf->name);
-#else
-			if(IsConfCryptLink(yy_aconf) && !yy_aconf->rsa_public_key)
-				conf_report_error("Ignoring connect block for %s -- missing key.",
-						  yy_aconf->name);
-#endif
-			if(!yy_aconf->host)
-				conf_report_error("Ignoring connect block for %s -- missing host.",
-						  yy_aconf->name);
-			else if(!IsConfCryptLink(yy_aconf) &&
-				(!yy_aconf->passwd || !yy_aconf->spasswd))
-				conf_report_error
-					("Ignoring connect block for %s -- missing password.",
-					 yy_aconf->name);
-		}
-
-		free_conf(yy_aconf);
-		yy_aconf = NULL;
-	}
-
-	/*
-	 * yy_aconf is still pointing at the server that is having
-	 * a connect block built for it. This means, y_aconf->name 
-	 * points to the actual irc name this server will be known as.
-	 * Now this new server has a set or even just one hub_mask (or leaf_mask)
-	 * given in the link list at yy_hconf. Fill in the HUB confs
-	 * from this link list now.
-	 */
-
-	for (yy_hconf = hub_confs; yy_hconf; yy_hconf = yy_aconf_next)
-	{
-		yy_aconf_next = yy_hconf->next;
-		MyFree(yy_hconf->name);
-		yy_hconf->name = NULL;
-
-		/* yy_aconf == NULL is a fatal error for this connect block! */
-		if(yy_aconf != NULL)
-		{
-			DupString(yy_hconf->name, yy_aconf->name);
-			conf_add_conf(yy_hconf);
-		}
-		else
-			free_conf(yy_hconf);
-	}
-
-	for (yy_lconf = leaf_confs; yy_lconf; yy_lconf = yy_aconf_next)
-	{
-		yy_aconf_next = yy_lconf->next;
-		if(yy_aconf != NULL)
-		{
-			DupString(yy_lconf->name, yy_aconf->name);
-			conf_add_conf(yy_lconf);
-		}
-		else
-			free_conf(yy_lconf);
-	}
-
-	hub_confs = NULL;
-	leaf_confs = NULL;
-	yy_aconf = NULL;
-	yy_hconf = NULL;
-	yy_lconf = NULL;
-	return 0;
-}
-
-static void
-conf_set_connect_name(void *data)
-{
-	if(yy_aconf->name != NULL)
-	{
-		conf_report_error("Warning -- connect::name specified multiple times.");
-	}
-
-	MyFree(yy_aconf->name);
-	DupString(yy_aconf->name, data);
-}
-
-static void
-conf_set_connect_host(void *data)
-{
-	MyFree(yy_aconf->host);
-	DupString(yy_aconf->host, data);
-}
-
-static void
-conf_set_connect_send_password(void *data)
-{
-	if(yy_aconf->spasswd)
-		memset(yy_aconf->spasswd, 0, strlen(yy_aconf->spasswd));
-	MyFree(yy_aconf->spasswd);
-	DupString(yy_aconf->spasswd, data);
-}
-
-static void
-conf_set_connect_accept_password(void *data)
-{
-	if(yy_aconf->passwd)
-		memset(yy_aconf->passwd, 0, strlen(yy_aconf->passwd));
-	MyFree(yy_aconf->passwd);
-	DupString(yy_aconf->passwd, data);
-}
-
-static void
-conf_set_connect_vhost(void *data)
-{
-	if(inetpton(DEF_FAM, (char *) data, &IN_ADDR(yy_aconf->my_ipnum)) <= 0)
-	{
-		conf_report_error("Invalid netmask for server vhost (%s)", (char *) data);
-		return;
-	}
-
-	yy_aconf->flags |= CONF_FLAGS_VHOSTED;
-}
-
-static void
-conf_set_connect_port(void *data)
-{
-	yy_aconf->port = *(unsigned int *) data;
-}
-
-static void
-conf_set_connect_aftype(void *data)
-{
-	char *aft = data;
-
-	if(strcasecmp(aft, "ipv4") == 0)
-		yy_aconf->aftype = AF_INET;
-#ifdef IPV6
-	else if(strcasecmp(aft, "ipv6") == 0)
-		yy_aconf->aftype = AF_INET6;
-#endif
-	else
-		conf_report_error("connect::aftype '%s' is unknown.", aft);
-}
-
-static void
-conf_set_connect_fakename(void *data)
-{
-	MyFree(yy_aconf->fakename);
-	DupString(yy_aconf->fakename, data);
-}
-
-static void
-conf_set_connect_encrypted(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_aconf->flags |= CONF_FLAGS_ENCRYPTED;
-	else
-		yy_aconf->flags &= ~CONF_FLAGS_ENCRYPTED;
-}
-
-static void
-conf_set_connect_rsa_public_key_file(void *data)
-{
-#ifdef HAVE_LIBCRYPTO
-	BIO *file;
-
-	if(yy_aconf->rsa_public_key)
-	{
-		RSA_free(yy_aconf->rsa_public_key);
-		yy_aconf->rsa_public_key = NULL;
-	}
-
-	if(yy_aconf->rsa_public_key_file)
-	{
-		MyFree(yy_aconf->rsa_public_key_file);
-		yy_aconf->rsa_public_key_file = NULL;
-	}
-
-	DupString(yy_aconf->rsa_public_key_file, data);
-
-	file = BIO_new_file(data, "r");
-
-	if(file == NULL)
-	{
-		conf_report_error("Ignoring connect::rsa_public_key_file %s -- couldn't open file.",
-				  data);
-		return;
-	}
-
-	yy_aconf->rsa_public_key = (RSA *) PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL);
-
-	if(yy_aconf->rsa_public_key == NULL)
-	{
-		conf_report_error
-			("Ignoring connect::rsa_public_key_file -- Key invalid; check syntax.");
-		return;
-	}
-
-	BIO_set_close(file, BIO_CLOSE);
-	BIO_free(file);
-#else
-	conf_report_error
-		("Ignoring connect::rsa_public_key_file -- OpenSSL support not available.");
-#endif
-}
-
-static void
-conf_set_connect_cryptlink(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_aconf->flags |= CONF_FLAGS_CRYPTLINK;
-	else
-		yy_aconf->flags &= ~CONF_FLAGS_CRYPTLINK;
-}
-
-static void
-conf_set_connect_compressed(void *data)
-{
-#ifdef HAVE_LIBZ
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_aconf->flags |= CONF_FLAGS_COMPRESSED;
-	else
-		yy_aconf->flags &= ~CONF_FLAGS_COMPRESSED;
-#else
-	conf_report_error("Ignoring connect::compressed -- zlib not available.");
-#endif
-}
-
-static void
-conf_set_connect_auto(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_aconf->flags |= CONF_FLAGS_ALLOW_AUTO_CONN;
-	else
-		yy_aconf->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN;
-}
-
-static void
-conf_set_connect_topicburst(void *data)
-{
-	int yesno = *(unsigned int *) data;
-
-	if(yesno)
-		yy_aconf->flags |= CONF_FLAGS_TB;
-	else
-		yy_aconf->flags &= ~CONF_FLAGS_TB;
-}
-
-static void
-conf_set_connect_hub_mask(void *data)
-{
-	if(hub_confs == NULL)
-	{
-		hub_confs = make_conf();
-		hub_confs->status = CONF_HUB;
-		DupString(hub_confs->host, data);
-		DupString(hub_confs->user, "*");
-	}
-	else
-	{
-		yy_hconf = make_conf();
-		yy_hconf->status = CONF_HUB;
-		DupString(yy_hconf->host, data);
-		DupString(yy_hconf->user, "*");
-		yy_hconf->next = hub_confs;
-		hub_confs = yy_hconf;
-	}
-}
-
-static void
-conf_set_connect_leaf_mask(void *data)
-{
-	if(leaf_confs == NULL)
-	{
-		leaf_confs = make_conf();
-		leaf_confs->status = CONF_LEAF;
-		DupString(leaf_confs->host, data);
-		DupString(leaf_confs->user, "*");
-	}
-	else
-	{
-		yy_lconf = make_conf();
-		yy_lconf->status = CONF_LEAF;
-		DupString(yy_lconf->host, data);
-		DupString(yy_lconf->user, "*");
-		yy_lconf->next = leaf_confs;
-		leaf_confs = yy_lconf;
-	}
-}
-
-static void
-conf_set_connect_class(void *data)
-{
-	MyFree(yy_aconf->className);
-	DupString(yy_aconf->className, data);
-}
-
-static void
-conf_set_connect_cipher_preference(void *data)
-{
-#ifdef HAVE_LIBCRYPTO
-	struct EncCapability *ecap;
-	char *cipher_name;
-	int found = 0;
-
-	yy_aconf->cipher_preference = NULL;
-
-	cipher_name = data;
-
-	for (ecap = CipherTable; ecap->name; ecap++)
-	{
-		if((!irccmp(ecap->name, cipher_name)) && (ecap->cap & CAP_ENC_MASK))
-		{
-			yy_aconf->cipher_preference = ecap;
-			found = 1;
-		}
-	}
-
-	if(!found)
-	{
-		conf_report_error("Invalid cipher '%s'.", cipher_name);
-	}
-#else
-	conf_report_error("Ignoring connect::cipher_preference -- OpenSSL support not available.");
-#endif
-}
-
-static int
-conf_begin_kill(struct TopConf *tc)
-{
-	if(yy_aconf)
-	{
-		free_conf(yy_aconf);
-		yy_aconf = NULL;
-	}
-
-	yy_aconf = make_conf();
-	yy_aconf->status = CONF_KILL;
-	return 0;
-}
-
-static int
-conf_end_kill(struct TopConf *tc)
-{
-	if(yy_aconf->user && yy_aconf->passwd && yy_aconf->host)
-	{
-		if(yy_aconf->host != NULL)
-			add_conf_by_address(yy_aconf->host, CONF_KILL, yy_aconf->user, yy_aconf);
-	}
-	else
-	{
-		free_conf(yy_aconf);
-	}
-	yy_aconf = NULL;
-	return 0;
-}
-
-static void
-conf_set_kill_user(void *data)
-{
-	char *p;
-	char *new_user;
-	char *new_host;
-
-	if((p = strchr(data, '@')))
-	{
-		*p = '\0';
-		DupString(new_user, data);
-		yy_aconf->user = new_user;
-		p++;
-		DupString(new_host, p);
-		MyFree(yy_aconf->host);
-		yy_aconf->host = new_host;
-	}
-	else
-	{
-		MyFree(yy_aconf->host);
-		DupString(yy_aconf->host, data);
-		MyFree(yy_aconf->user);
-		DupString(yy_aconf->user, "*");
-	}
-}
-
-static void
-conf_set_kill_reason(void *data)
-{
-	MyFree(yy_aconf->passwd);
-	DupString(yy_aconf->passwd, data);
-}
-
-static int
-conf_begin_deny(struct TopConf *tc)
-{
-	if(yy_aconf)
-	{
-		free_conf(yy_aconf);
-		yy_aconf = NULL;
-	}
-
-	yy_aconf = make_conf();
-	yy_aconf->status = CONF_DLINE;
-	/* default reason */
-	DupString(yy_aconf->passwd, "No Reason");
-
-	return 0;
-}
-
-static int
-conf_end_deny(struct TopConf *tc)
-{
-	if(yy_aconf->host && parse_netmask(yy_aconf->host, NULL, NULL) != HM_HOST)
-	{
-		add_conf_by_address(yy_aconf->host, CONF_DLINE, NULL, yy_aconf);
-	}
-	else
-	{
-		free_conf(yy_aconf);
-		conf_report_error("Ignoring deny -- invalid hostname.");
-	}
-	yy_aconf = NULL;
-	return 0;
-}
-
-static void
-conf_set_deny_ip(void *data)
-{
-	MyFree(yy_aconf->host);
-	DupString(yy_aconf->host, data);
-}
-
-static void
-conf_set_deny_reason(void *data)
-{
-	MyFree(yy_aconf->passwd);
-	DupString(yy_aconf->passwd, data);
-}
-
-static int
-conf_begin_exempt(struct TopConf *tc)
-{
-	if(yy_aconf)
-	{
-		free_conf(yy_aconf);
-		yy_aconf = NULL;
-	}
-
-	yy_aconf = make_conf();
-	DupString(yy_aconf->passwd, "*");
-	yy_aconf->status = CONF_EXEMPTDLINE;
-
-	return 0;
-}
-
-static int
-conf_end_exempt(struct TopConf *tc)
-{
-	if(yy_aconf->host && parse_netmask(yy_aconf->host, NULL, NULL) != HM_HOST)
-	{
-		add_conf_by_address(yy_aconf->host, CONF_EXEMPTDLINE, NULL, yy_aconf);
-	}
-	else
-	{
-		conf_report_error("Ignoring exempt -- invalid exempt::ip.");
-		free_conf(yy_aconf);
-	}
-
-	yy_aconf = NULL;
-	return 0;
-}
-
-static void
-conf_set_exempt_ip(void *data)
-{
-	MyFree(yy_aconf->host);
-	DupString(yy_aconf->host, data);
-}
-
-static int
-conf_begin_gecos(struct TopConf *tc)
-{
-	if(yy_aconf)
-	{
-		free_conf(yy_aconf);
-		yy_aconf = NULL;
-	}
-
-	yy_aconf = make_conf();
-	yy_aconf->status = CONF_XLINE;
-	DupString(yy_aconf->passwd, "No Reason");
-	return 0;
-}
-
-static int
-conf_end_gecos(struct TopConf *tc)
-{
-	if(yy_aconf->host)
-		conf_add_x_conf(yy_aconf);
-	else
-	{
-		conf_report_error("Ignoring gecos -- invalid gecos::name.");
-		free_conf(yy_aconf);
-	}
-
-	yy_aconf = NULL;
-
-	return 0;
-}
-
-static void
-conf_set_gecos_name(void *data)
-{
-	MyFree(yy_aconf->host);
-	DupString(yy_aconf->host, data);
-	collapse(yy_aconf->host);
-}
-
-static void
-conf_set_gecos_reason(void *data)
-{
-	MyFree(yy_aconf->passwd);
-	DupString(yy_aconf->passwd, data);
-}
-
-static void
-conf_set_gecos_action(void *data)
-{
-	char *act = data;
-
-	if(strcasecmp(act, "warn") == 0)
-		yy_aconf->port = 0;
-	else if(strcasecmp(act, "reject") == 0)
-		yy_aconf->port = 1;
-	else if(strcasecmp(act, "silent") == 0)
-		yy_aconf->port = 2;
-	else
-		conf_report_error("Warning -- invalid gecos::action.");
-}
-
-static int
-conf_begin_cluster(struct TopConf *tc)
-{
-	yy_cconf = make_cluster();
-	return 0;
-}
-
-static int
-conf_end_cluster(struct TopConf *tc)
-{
-	if(!EmptyString(yy_cconf->name))
-	{
-		dlinkAddAlloc(yy_cconf, &cluster_list);
-	}
-	else
-	{
-		conf_report_error("Ignoring cluster -- invalid cluster::server");
-		free_cluster(yy_cconf);
-	}
-
-	yy_cconf = NULL;
-	return 0;
-}
-
-static void
-conf_set_cluster_name(void *data)
-{
-	MyFree(yy_cconf->name);
-	DupString(yy_cconf->name, data);
-}
-
-static void
-conf_set_cluster_type(void *data)
-{
-	conf_parm_t *args = data;
-
-	set_modes_from_table(&yy_cconf->type, "flag", cluster_table, args);
-}
-
-static void
-conf_set_general_failed_oper_notice(void *data)
-{
-	ConfigFileEntry.failed_oper_notice = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_anti_nick_flood(void *data)
-{
-	ConfigFileEntry.anti_nick_flood = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_max_nick_time(void *data)
-{
-	ConfigFileEntry.max_nick_time = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_max_nick_changes(void *data)
-{
-	ConfigFileEntry.max_nick_changes = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_max_accept(void *data)
-{
-	ConfigFileEntry.max_accept = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_anti_spam_exit_message_time(void *data)
-{
-	ConfigFileEntry.anti_spam_exit_message_time = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_ts_warn_delta(void *data)
-{
-	ConfigFileEntry.ts_warn_delta = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_ts_max_delta(void *data)
-{
-	ConfigFileEntry.ts_max_delta = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_havent_read_conf(void *data)
-{
-	if(*(unsigned int *) data)
-	{
-		conf_report_error("You haven't read your config file properly.");
-		conf_report_error
-			("There is a line in the example conf that will kill your server if not removed.");
-		conf_report_error
-			("Consider actually reading/editing the conf file, and removing this line.");
-		exit(0);
-	}
-}
-
-static void
-conf_set_general_kline_with_reason(void *data)
-{
-	ConfigFileEntry.kline_with_reason = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_client_exit(void *data)
-{
-	ConfigFileEntry.client_exit = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_kline_with_connection_closed(void *data)
-{
-	ConfigFileEntry.kline_with_connection_closed = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_kline_delay(void *data)
-{
-	ConfigFileEntry.kline_delay = *(unsigned int *) data;
-
-	/* note, this must be here to prevent us getting stuck in a
-	 * a loop where we can never check klines --fl
-	 */
-	kline_queued = 0;
-}
-
-static void
-conf_set_general_warn_no_nline(void *data)
-{
-	ConfigFileEntry.warn_no_nline = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_non_redundant_klines(void *data)
-{
-	ConfigFileEntry.non_redundant_klines = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_stats_o_oper_only(void *data)
-{
-	ConfigFileEntry.stats_o_oper_only = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_stats_P_oper_only(void *data)
-{
-	ConfigFileEntry.stats_P_oper_only = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_stats_c_oper_only(void *data)
-{
-	ConfigFileEntry.stats_c_oper_only = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_stats_y_oper_only(void *data)
-{
-	ConfigFileEntry.stats_y_oper_only = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_stats_h_oper_only(void *data)
-{
-	ConfigFileEntry.stats_h_oper_only = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_stats_k_oper_only(void *data)
-{
-	char *val = data;
-
-	if(strcasecmp(val, "yes") == 0)
-		ConfigFileEntry.stats_k_oper_only = 2;
-	else if(strcasecmp(val, "masked") == 0)
-		ConfigFileEntry.stats_k_oper_only = 1;
-	else if(strcasecmp(val, "no") == 0)
-		ConfigFileEntry.stats_k_oper_only = 0;
-	else
-		conf_report_error("Invalid setting '%s' for general::stats_k_oper_only.", val);
-}
-
-static void
-conf_set_general_stats_i_oper_only(void *data)
-{
-	char *val = data;
-
-	if(strcasecmp(val, "yes") == 0)
-		ConfigFileEntry.stats_i_oper_only = 2;
-	else if(strcasecmp(val, "masked") == 0)
-		ConfigFileEntry.stats_i_oper_only = 1;
-	else if(strcasecmp(val, "no") == 0)
-		ConfigFileEntry.stats_i_oper_only = 0;
-	else
-		conf_report_error("Invalid setting '%s' for general::stats_i_oper_only.", val);
-}
-
-static void
-conf_set_general_map_oper_only(void *data)
-{
-	ConfigFileEntry.map_oper_only = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_pace_wait(void *data)
-{
-	ConfigFileEntry.pace_wait = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_caller_id_wait(void *data)
-{
-	ConfigFileEntry.caller_id_wait = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_pace_wait_simple(void *data)
-{
-	ConfigFileEntry.pace_wait_simple = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_short_motd(void *data)
-{
-	ConfigFileEntry.short_motd = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_no_oper_flood(void *data)
-{
-	ConfigFileEntry.no_oper_flood = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_glines(void *data)
-{
-	ConfigFileEntry.glines = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_message_locale(void *data)
-{
-	char langenv[BUFSIZE];
-
-	if(strlen((char *) data) > BUFSIZE - 10)
-		((char *) data)[BUFSIZE - 9] = 0;
-
-	ircsprintf(langenv, "LANGUAGE=%s", (char *) data);
-	putenv(langenv);
-}
-
-static void
-conf_set_general_gline_time(void *data)
-{
-	ConfigFileEntry.gline_time = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_idletime(void *data)
-{
-	ConfigFileEntry.idletime = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_dots_in_ident(void *data)
-{
-	ConfigFileEntry.dots_in_ident = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_max_targets(void *data)
-{
-	ConfigFileEntry.max_targets = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_servlink_path(void *data)
-{
-	MyFree(ConfigFileEntry.servlink_path);
-	DupString(ConfigFileEntry.servlink_path, data);
-}
-
-static void
-conf_set_general_default_cipher_preference(void *data)
-{
-#ifdef HAVE_LIBCRYPTO
-	struct EncCapability *ecap;
-	char *cipher_name;
-
-	ConfigFileEntry.default_cipher_preference = NULL;
-
-	cipher_name = data;
-
-	for (ecap = CipherTable; ecap->name; ecap++)
-	{
-		if((!irccmp(ecap->name, cipher_name)) && (ecap->cap & CAP_ENC_MASK))
-		{
-			ConfigFileEntry.default_cipher_preference = ecap;
-			return;
-		}
-	}
-
-	conf_report_error("Invalid general::default_cipher_preference '%s'.", cipher_name);
-#else
-	conf_report_error
-		("Ignoring general::default_cipher_preference -- OpenSSL support not available.");
-#endif
-}
-
-static void
-conf_set_general_compression_level(void *data)
-{
-#ifdef HAVE_LIBZ
-	ConfigFileEntry.compression_level = *(unsigned int *) data;
-
-	if((ConfigFileEntry.compression_level < 1) || (ConfigFileEntry.compression_level > 9))
-	{
-		conf_report_error("Invalid general::compression_level %d -- using default.",
-				  ConfigFileEntry.compression_level);
-		ConfigFileEntry.compression_level = 0;
-	}
-#else
-	conf_report_error("Ignoring general::compression_level -- zlib not available.");
-#endif
-}
-
-static void
-conf_set_general_use_egd(void *data)
-{
-	ConfigFileEntry.use_egd = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_egdpool_path(void *data)
-{
-	MyFree(ConfigFileEntry.egdpool_path);
-	DupString(ConfigFileEntry.egdpool_path, data);
-}
-
-static void
-conf_set_general_ping_cookie(void *data)
-{
-	ConfigFileEntry.ping_cookie = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_disable_auth(void *data)
-{
-	ConfigFileEntry.disable_auth = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_use_help(void *data)
-{
-	ConfigFileEntry.use_help = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_use_whois_actually(void *data)
-{
-	ConfigFileEntry.use_whois_actually = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_tkline_expire_notices(void *data)
-{
-	ConfigFileEntry.tkline_expire_notices = *(unsigned int *) data;
-}
-
-
-static void
-conf_set_general_connect_timeout(void *data)
-{
-	ConfigFileEntry.connect_timeout = *(unsigned int *) data;
-}
-
-#ifdef IPV6
-static void
-conf_set_general_fallback_to_ip6_int(void *data)
-{
-	ConfigFileEntry.fallback_to_ip6_int = *(unsigned int *) data;
-}
-#endif
-
-static void
-conf_set_general_oper_umodes(void *data)
-{
-	set_modes_from_table(&ConfigFileEntry.oper_umodes, "umode", umode_table, data);
-}
-
-static void
-conf_set_general_oper_only_umodes(void *data)
-{
-	set_modes_from_table(&ConfigFileEntry.oper_only_umodes, "umode", umode_table, data);
-}
-
-static void
-conf_set_general_min_nonwildcard(void *data)
-{
-	ConfigFileEntry.min_nonwildcard = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_min_nonwildcard_simple(void *data)
-{
-	ConfigFileEntry.min_nonwildcard_simple = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_operspy_admin_only(void *data)
-{
-	ConfigFileEntry.operspy_admin_only = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_default_floodcount(void *data)
-{
-	ConfigFileEntry.default_floodcount = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_client_flood(void *data)
-{
-	ConfigFileEntry.client_flood = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_dot_in_ip6_addr(void *data)
-{
-	ConfigFileEntry.dot_in_ip6_addr = *(unsigned int *) data;
-}
-
-static void
-conf_set_general_default_operstring(void *data)
-{
-
-	strlcpy(ConfigFileEntry.default_operstring, data, sizeof(ConfigFileEntry.default_operstring));
-}
-
-static void
-conf_set_general_default_adminstring(void *data)
-{
-
-	strlcpy(ConfigFileEntry.default_adminstring, data, sizeof(ConfigFileEntry.default_adminstring));
-}
-
-
-static void
-conf_set_channel_use_except(void *data)
-{
-	ConfigChannel.use_except = *(unsigned int *) data;
-}
-
-static void
-conf_set_channel_use_invex(void *data)
-{
-	ConfigChannel.use_invex = *(unsigned int *) data;
-}
-
-static void
-conf_set_channel_use_knock(void *data)
-{
-	ConfigChannel.use_knock = *(unsigned int *) data;
-}
-
-static void
-conf_set_channel_knock_delay(void *data)
-{
-	ConfigChannel.knock_delay = *(unsigned int *) data;
-}
-
-static void
-conf_set_channel_knock_delay_channel(void *data)
-{
-	ConfigChannel.knock_delay_channel = *(unsigned int *) data;
-}
-
-static void
-conf_set_channel_max_chans_per_user(void *data)
-{
-	ConfigChannel.max_chans_per_user = *(unsigned int *) data;
-}
-
-static void
-conf_set_channel_quiet_on_ban(void *data)
-{
-	ConfigChannel.quiet_on_ban = *(unsigned int *) data;
-}
-
-static void
-conf_set_channel_max_bans(void *data)
-{
-	ConfigChannel.max_bans = *(unsigned int *) data;
-}
-
-static void
-conf_set_channel_persist_time(void *data)
-{
-	ConfigChannel.persist_time = *(unsigned int *) data;
-}
-
-static void
-conf_set_channel_default_split_user_count(void *data)
-{
-	ConfigChannel.default_split_user_count = *(unsigned int *) data;
-}
-
-static void
-conf_set_channel_default_split_server_count(void *data)
-{
-	ConfigChannel.default_split_server_count = *(unsigned int *) data;
-}
-
-static void
-conf_set_channel_default_split_delay(void *data)
-{
-	ConfigChannel.default_split_delay = *(unsigned int *) data;
-}
-
-static void
-conf_set_channel_no_create_on_split(void *data)
-{
-	ConfigChannel.no_create_on_split = *(unsigned int *) data;
-}
-
-static void
-conf_set_channel_no_join_on_split(void *data)
-{
-	ConfigChannel.no_join_on_split = *(unsigned int *) data;
-}
-
-static void
-conf_set_channel_no_oper_resvs(void *data)
-{
-	ConfigChannel.no_oper_resvs = *(unsigned int *) data;
-}
-
-static void
-conf_set_channel_burst_topicwho(void *data)
-{
-	ConfigChannel.burst_topicwho = *(unsigned int *) data;
-}
-
-static void
-conf_set_serverhide_flatten_links(void *data)
-{
-	ConfigServerHide.flatten_links = *(unsigned int *) data;
-}
-
-static void
-conf_set_serverhide_hide_servers(void *data)
-{
-	ConfigServerHide.hide_servers = *(unsigned int *) data;
-}
-
-static void
-conf_set_serverhide_disable_remote_commands(void *data)
-{
-	ConfigServerHide.disable_remote = *(unsigned int *) data;
-}
-
-static void
-conf_set_serverhide_disable_local_channels(void *data)
-{
-	ConfigServerHide.disable_local_channels = *(unsigned int *) data;
-}
-
-static void
-conf_set_serverhide_links_delay(void *data)
-{
-	int val = *(unsigned int *) data;
-
-	if((val > 0) && ConfigServerHide.links_disabled == 1)
-	{
-		eventAddIsh("write_links_file", write_links_file, NULL, val);
-		ConfigServerHide.links_disabled = 0;
-	}
-
-	ConfigServerHide.links_delay = val;
-}
-
-static void
-conf_set_serverhide_hidden(void *data)
-{
-	ConfigServerHide.hidden = *(unsigned int *) data;
-}
-
-static void
-conf_set_serverhide_disable_hidden(void *data)
-{
-	ConfigServerHide.disable_hidden = *(unsigned int *) data;
-}
-
-
-void
-conf_report_error(const char *fmt, ...)
-{
-	va_list ap;
-	char msg[IRCD_BUFSIZE + 1] = { 0 };
-
-	va_start(ap, fmt);
-	vsnprintf(msg, IRCD_BUFSIZE, fmt, ap);
-	va_end(ap);
-
-	ilog(L_ERROR, "\"%s\", line %d: %s", conffilebuf, lineno + 1, msg);
-
-	sendto_realops_flags(UMODE_ALL, L_ALL, "\"%s\", line %d: %s", conffilebuf, lineno + 1, msg);
-}
-
-int
-conf_start_block(const char *block, const char *name)
-{
-	if((conf_cur_block = find_top_conf(block)) == NULL)
-	{
-		conf_report_error("Configuration block '%s' is not defined.", block);
-		return -1;
-	}
-
-	if(name)
-		DupString(conf_cur_block_name, name);
-	else
-		conf_cur_block_name = NULL;
-
-	if(conf_cur_block->tc_sfunc)
-		if(conf_cur_block->tc_sfunc(conf_cur_block) < 0)
-			return -1;
-
-	return 0;
-}
-
-int
-conf_end_block(struct TopConf *tc)
-{
-	if(tc->tc_efunc)
-		return tc->tc_efunc(tc);
-
-	MyFree(conf_cur_block_name);
-	return 0;
-}
-
-int
-conf_call_set(struct TopConf *tc, const char *item, conf_parm_t * value, int type)
-{
-	struct ConfEntry *cf;
-	conf_parm_t *cp;
-
-	if(!tc)
-		return -1;
-
-	if((cf = find_conf_item(tc, item)) == NULL)
-	{
-		conf_report_error("Non-existant configuration setting %s::%s.",
-				  tc->tc_name, (char *) item);
-		return -1;
-	}
-
-	/* if it takes one thing, make sure they only passed one thing,
-	   and handle as needed. */
-	if(value->type & CF_FLIST && !cf->cf_type & CF_FLIST)
-	{
-		conf_report_error("Option %s::%s does not take a list of values.",
-				  tc->tc_name, item);
-		return -1;
-	}
-
-	cp = value->v.list;
-
-
-	if(CF_TYPE(value->v.list->type) != CF_TYPE(cf->cf_type))
-	{
-		/* if it expects a string value, but we got a yesno, 
-		 * convert it back
-		 */
-		if((CF_TYPE(value->v.list->type) == CF_YESNO) &&
-		   (CF_TYPE(cf->cf_type) == CF_STRING))
-		{
-			value->v.list->type = CF_STRING;
-
-			if(cp->v.number == 1)
-				DupString(cp->v.string, "yes");
-			else
-				DupString(cp->v.string, "no");
-		}
-
-		/* maybe it's a CF_TIME and they passed CF_INT --
-		   should still be valid */
-		else if(!((CF_TYPE(value->v.list->type) == CF_INT) &&
-			  (CF_TYPE(cf->cf_type) == CF_TIME)))
-		{
-			conf_report_error("Wrong type for %s::%s (expected %s, got %s)",
-					  tc->tc_name, (char *) item, conf_strtype(cf->cf_type),
-					  conf_strtype(value->v.list->type));
-			return -1;
-		}
-	}
-
-	if(cf->cf_type & CF_FLIST)
-	{
-		/* just pass it the extended argument list */
-		cf->cf_func(value->v.list);
-	}
-	else
-	{
-		/* it's old-style, needs only one arg */
-		switch (cf->cf_type)
-		{
-		case CF_INT:
-		case CF_TIME:
-		case CF_YESNO:
-			cf->cf_func(&cp->v.number);
-			break;
-		case CF_STRING:
-		case CF_QSTRING:
-			cf->cf_func(cp->v.string);
-			break;
-		}
-	}
-
-
-	return 0;
-}
-
-int
-add_conf_item(const char *topconf, const char *name, int type, void (*func) (void *))
-{
-	struct TopConf *tc;
-	struct ConfEntry *cf;
-
-	if((tc = find_top_conf(topconf)) == NULL)
-		return -1;
-
-	if((cf = find_conf_item(tc, name)) != NULL)
-		return -1;
-
-	cf = MyMalloc(sizeof(struct ConfEntry));
-
-	DupString(cf->cf_name, name);
-	cf->cf_type = type;
-	cf->cf_func = func;
-
-	dlinkAddAlloc(cf, &tc->tc_items);
-
-	return 0;
-}
-
-int
-remove_conf_item(const char *topconf, const char *name)
-{
-	struct TopConf *tc;
-	struct ConfEntry *cf;
-	dlink_node *ptr;
-
-	if((tc = find_top_conf(topconf)) == NULL)
-		return -1;
-
-	if((cf = find_conf_item(tc, name)) == NULL)
-		return -1;
-
-	if((ptr = dlinkFind(&tc->tc_items, cf)) == NULL)
-		return -1;
-
-	dlinkDestroy(ptr, &tc->tc_items);
-	MyFree(cf->cf_name);
-	MyFree(cf);
-
-	return 0;
-}
-
-void
-newconf_init()
-{
-	add_top_conf("modules", NULL, NULL);
-	add_conf_item("modules", "path", CF_QSTRING, conf_set_modules_path);
-	add_conf_item("modules", "module", CF_QSTRING, conf_set_modules_module);
-
-	add_top_conf("serverinfo", NULL, NULL);
-	add_conf_item("serverinfo", "rsa_private_key_file", CF_QSTRING,
-		      conf_set_serverinfo_rsa_private_key_file);
-	add_conf_item("serverinfo", "name", CF_QSTRING, conf_set_serverinfo_name);
-	add_conf_item("serverinfo", "description", CF_QSTRING, conf_set_serverinfo_description);
-	add_conf_item("serverinfo", "network_name", CF_QSTRING, conf_set_serverinfo_network_name);
-	add_conf_item("serverinfo", "network_desc", CF_QSTRING, conf_set_serverinfo_network_desc);
-	add_conf_item("serverinfo", "vhost", CF_QSTRING, conf_set_serverinfo_vhost);
-	add_conf_item("serverinfo", "vhost6", CF_QSTRING, conf_set_serverinfo_vhost6);
-	add_conf_item("serverinfo", "hub", CF_YESNO, conf_set_serverinfo_hub);
-
-	add_top_conf("admin", NULL, NULL);
-	add_conf_item("admin", "name", CF_QSTRING, conf_set_admin_name);
-	add_conf_item("admin", "description", CF_QSTRING, conf_set_admin_description);
-	add_conf_item("admin", "email", CF_QSTRING, conf_set_admin_email);
-
-	add_top_conf("logging", NULL, NULL);
-	add_conf_item("logging", "path", CF_QSTRING, conf_set_logging_path);
-	add_conf_item("logging", "oper_log", CF_QSTRING, conf_set_logging_oper_log);
-	add_conf_item("logging", "gline_log", CF_QSTRING, conf_set_logging_gline_log);
-	add_conf_item("logging", "log_level", CF_STRING, conf_set_logging_log_level);
-	add_conf_item("logging", "fname_userlog", CF_QSTRING, conf_set_logging_fname_userlog);
-	add_conf_item("logging", "fname_operlog", CF_QSTRING, conf_set_logging_fname_operlog);
-	add_conf_item("logging", "fname_foperlog", CF_QSTRING, conf_set_logging_fname_foperlog);
-	add_conf_item("logging", "fname_operspylog", CF_QSTRING,
-		      conf_set_logging_fname_operspylog);
-	add_conf_item("logging", "fname_operspyremotelog", CF_QSTRING,
-		      conf_set_logging_fname_operspyremotelog);
-
-	add_top_conf("operator", conf_begin_oper, conf_end_oper);
-	add_conf_item("operator", "name", CF_QSTRING, conf_set_oper_name);
-	add_conf_item("operator", "user", CF_QSTRING, conf_set_oper_user);
-	add_conf_item("operator", "password", CF_QSTRING, conf_set_oper_password);
-	add_conf_item("operator", "class", CF_QSTRING, conf_set_oper_class);
-	add_conf_item("operator", "global_kill", CF_YESNO, conf_set_oper_global_kill);
-	add_conf_item("operator", "remote", CF_YESNO, conf_set_oper_remote);
-	add_conf_item("operator", "kline", CF_YESNO, conf_set_oper_kline);
-	add_conf_item("operator", "xline", CF_YESNO, conf_set_oper_xline);
-	add_conf_item("operator", "unkline", CF_YESNO, conf_set_oper_unkline);
-	add_conf_item("operator", "gline", CF_YESNO, conf_set_oper_gline);
-	add_conf_item("operator", "operwall", CF_YESNO, conf_set_oper_operwall);
-	add_conf_item("operator", "nick_changes", CF_YESNO, conf_set_oper_nick_changes);
-	add_conf_item("operator", "die", CF_YESNO, conf_set_oper_die);
-	add_conf_item("operator", "rehash", CF_YESNO, conf_set_oper_rehash);
-	add_conf_item("operator", "admin", CF_YESNO, conf_set_oper_admin);
-	add_conf_item("operator", "hidden_admin", CF_YESNO, conf_set_oper_hidden_admin);
-	add_conf_item("operator", "oper_spy", CF_YESNO, conf_set_oper_spy);
-	add_conf_item("operator", "encrypted", CF_YESNO, conf_set_oper_encrypted);
-	add_conf_item("operator", "rsa_public_key_file", CF_QSTRING,
-		      conf_set_oper_rsa_public_key_file);
-	add_conf_item("operator", "flags", CF_STRING | CF_FLIST, conf_set_oper_flags);
-
-	add_top_conf("class", conf_begin_class, conf_end_class);
-	add_conf_item("class", "name", CF_QSTRING, conf_set_class_name);
-	add_conf_item("class", "ping_time", CF_TIME, conf_set_class_ping_time);
-	add_conf_item("class", "number_per_ip", CF_INT, conf_set_class_number_per_ip);
-	add_conf_item("class", "number_per_ip_global", CF_INT, conf_set_class_number_per_ip_global);
-	add_conf_item("class", "number_per_ident", CF_INT, conf_set_class_number_per_ident);
-	add_conf_item("class", "connectfreq", CF_TIME, conf_set_class_connectfreq);
-	add_conf_item("class", "max_number", CF_INT, conf_set_class_max_number);
-	add_conf_item("class", "sendq", CF_TIME, conf_set_class_sendq);
-	add_conf_item("class", "sendq_eob", CF_TIME, conf_set_class_sendq_eob);
-	add_conf_item("class", "cidr_bitlen", CF_INT, conf_set_class_cidr_bitlen);
-	add_conf_item("class", "number_per_cidr", CF_INT, conf_set_class_number_per_cidr);
-        
-	add_top_conf("listen", conf_begin_listen, conf_end_listen);
-	add_conf_item("listen", "port", CF_INT | CF_FLIST, conf_set_listen_port);
-	add_conf_item("listen", "ip", CF_QSTRING, conf_set_listen_address);
-	add_conf_item("listen", "host", CF_QSTRING, conf_set_listen_address);
-
-	add_top_conf("auth", conf_begin_auth, conf_end_auth);
-	add_conf_item("auth", "user", CF_QSTRING, conf_set_auth_user);
-	add_conf_item("auth", "password", CF_QSTRING, conf_set_auth_passwd);
-	add_conf_item("auth", "encrypted", CF_YESNO, conf_set_auth_encrypted);
-	add_conf_item("auth", "class", CF_QSTRING, conf_set_auth_class);
-	add_conf_item("auth", "kline_exempt", CF_YESNO, conf_set_auth_kline_exempt);
-	add_conf_item("auth", "need_ident", CF_YESNO, conf_set_auth_need_ident);
-	add_conf_item("auth", "have_ident", CF_YESNO, conf_set_auth_need_ident);
-	add_conf_item("auth", "restricted", CF_YESNO, conf_set_auth_is_restricted);
-	add_conf_item("auth", "exceed_limit", CF_YESNO, conf_set_auth_exceed_limit);
-	add_conf_item("auth", "no_tilde", CF_YESNO, conf_set_auth_no_tilde);
-	add_conf_item("auth", "gline_exempt", CF_YESNO, conf_set_auth_gline_exempt);
-	add_conf_item("auth", "spoof", CF_QSTRING, conf_set_auth_spoof);
-	add_conf_item("auth", "spoof_notice", CF_YESNO, conf_set_auth_spoof_notice);
-	add_conf_item("auth", "flood_exempt", CF_YESNO, conf_set_auth_flood_exempt);
-	add_conf_item("auth", "redirserv", CF_QSTRING, conf_set_auth_redir_serv);
-	add_conf_item("auth", "redirport", CF_INT, conf_set_auth_redir_port);
-	add_conf_item("auth", "flags", CF_STRING | CF_FLIST, conf_set_auth_flags);
-
-	add_top_conf("resv", conf_begin_resv, conf_end_resv);
-	add_conf_item("resv", "reason", CF_QSTRING, conf_set_resv_reason);
-	add_conf_item("resv", "channel", CF_QSTRING, conf_set_resv_channel);
-	add_conf_item("resv", "nick", CF_QSTRING, conf_set_resv_nick);
-
-	add_top_conf("shared", conf_begin_shared, conf_end_shared);
-	add_conf_item("shared", "name", CF_QSTRING, conf_set_shared_name);
-	add_conf_item("shared", "user", CF_QSTRING, conf_set_shared_user);
-	add_conf_item("shared", "kline", CF_YESNO, conf_set_shared_kline);
-	add_conf_item("shared", "unkline", CF_YESNO, conf_set_shared_unkline);
-	add_conf_item("shared", "type", CF_STRING | CF_FLIST, conf_set_shared_type);
-
-	add_top_conf("connect", conf_begin_connect, conf_end_connect);
-	add_conf_item("connect", "name", CF_QSTRING, conf_set_connect_name);
-	add_conf_item("connect", "host", CF_QSTRING, conf_set_connect_host);
-	add_conf_item("connect", "send_password", CF_QSTRING, conf_set_connect_send_password);
-	add_conf_item("connect", "accept_password", CF_QSTRING, conf_set_connect_accept_password);
-	add_conf_item("connect", "port", CF_INT, conf_set_connect_port);
-	add_conf_item("connect", "vhost", CF_QSTRING, conf_set_connect_vhost);
-	add_conf_item("connect", "aftype", CF_STRING, conf_set_connect_aftype);
-	add_conf_item("connect", "fakename", CF_QSTRING, conf_set_connect_fakename);
-	add_conf_item("connect", "hub_mask", CF_QSTRING, conf_set_connect_hub_mask);
-	add_conf_item("connect", "leaf_mask", CF_QSTRING, conf_set_connect_leaf_mask);
-	add_conf_item("connect", "class", CF_QSTRING, conf_set_connect_class);
-	add_conf_item("connect", "autoconn", CF_YESNO, conf_set_connect_auto);
-	add_conf_item("connect", "encrypted", CF_YESNO, conf_set_connect_encrypted);
-	add_conf_item("connect", "compressed", CF_YESNO, conf_set_connect_compressed);
-	add_conf_item("connect", "topicburst", CF_YESNO, conf_set_connect_topicburst);
-	add_conf_item("connect", "cryptlink", CF_YESNO, conf_set_connect_cryptlink);
-	add_conf_item("connect", "rsa_public_key_file", CF_QSTRING,
-		      conf_set_connect_rsa_public_key_file);
-	add_conf_item("connect", "cipher_preference", CF_QSTRING,
-		      conf_set_connect_cipher_preference);
-
-	add_top_conf("kill", conf_begin_kill, conf_end_kill);
-	add_conf_item("kill", "user", CF_QSTRING, conf_set_kill_user);
-	add_conf_item("kill", "reason", CF_QSTRING, conf_set_kill_reason);
-
-	add_top_conf("deny", conf_begin_deny, conf_end_deny);
-	add_conf_item("deny", "ip", CF_QSTRING, conf_set_deny_ip);
-	add_conf_item("deny", "reason", CF_QSTRING, conf_set_deny_reason);
-
-	add_top_conf("exempt", conf_begin_exempt, conf_end_exempt);
-	add_conf_item("exempt", "ip", CF_QSTRING, conf_set_exempt_ip);
-
-	add_top_conf("gecos", conf_begin_gecos, conf_end_gecos);
-	add_conf_item("gecos", "name", CF_QSTRING, conf_set_gecos_name);
-	add_conf_item("gecos", "reason", CF_QSTRING, conf_set_gecos_reason);
-	add_conf_item("gecos", "action", CF_STRING, conf_set_gecos_action);
-
-	add_top_conf("cluster", conf_begin_cluster, conf_end_cluster);
-	add_conf_item("cluster", "name", CF_QSTRING, conf_set_cluster_name);
-	add_conf_item("cluster", "type", CF_STRING | CF_FLIST, conf_set_cluster_type);
-
-	add_top_conf("general", NULL, NULL);
-	add_conf_item("general", "operspy_admin_only", CF_YESNO,
-		      conf_set_general_operspy_admin_only);
-	add_conf_item("general", "failed_oper_notice", CF_YESNO,
-		      conf_set_general_failed_oper_notice);
-	add_conf_item("general", "anti_nick_flood", CF_YESNO, conf_set_general_anti_nick_flood);
-	add_conf_item("general", "max_nick_time", CF_TIME, conf_set_general_max_nick_time);
-	add_conf_item("general", "max_nick_changes", CF_INT, conf_set_general_max_nick_changes);
-	add_conf_item("general", "max_accept", CF_INT, conf_set_general_max_accept);
-	add_conf_item("general", "anti_spam_exit_message_time", CF_TIME,
-		      conf_set_general_anti_spam_exit_message_time);
-	add_conf_item("general", "ts_warn_delta", CF_TIME, conf_set_general_ts_warn_delta);
-	add_conf_item("general", "ts_max_delta", CF_TIME, conf_set_general_ts_max_delta);
-	add_conf_item("general", "kline_with_reason", CF_YESNO, conf_set_general_kline_with_reason);
-	add_conf_item("general", "kline_with_connection_closed", CF_YESNO,
-		      conf_set_general_kline_with_connection_closed);
-	add_conf_item("general", "kline_delay", CF_TIME, conf_set_general_kline_delay);
-	add_conf_item("general", "warn_no_nline", CF_YESNO, conf_set_general_warn_no_nline);
-	add_conf_item("general", "non_redundant_klines", CF_YESNO,
-		      conf_set_general_non_redundant_klines);
-	add_conf_item("general", "dots_in_ident", CF_INT, conf_set_general_dots_in_ident);
-	add_conf_item("general", "stats_o_oper_only", CF_YESNO, conf_set_general_stats_o_oper_only);
-	add_conf_item("general", "stats_k_oper_only", CF_STRING,
-		      conf_set_general_stats_k_oper_only);
-	add_conf_item("general", "stats_i_oper_only", CF_STRING,
-		      conf_set_general_stats_i_oper_only);
-	add_conf_item("general", "stats_P_oper_only", CF_YESNO, conf_set_general_stats_P_oper_only);
-	add_conf_item("general", "stats_c_oper_only", CF_YESNO, conf_set_general_stats_c_oper_only);
-	add_conf_item("general", "stats_y_oper_only", CF_YESNO, conf_set_general_stats_y_oper_only);
-	add_conf_item("general", "stats_h_oper_only", CF_YESNO, conf_set_general_stats_h_oper_only);
-	add_conf_item("general", "map_oper_only", CF_YESNO, conf_set_general_map_oper_only);
-	add_conf_item("general", "pace_wait", CF_TIME, conf_set_general_pace_wait);
-	add_conf_item("general", "pace_wait_simple", CF_TIME, conf_set_general_pace_wait_simple);
-	add_conf_item("general", "short_motd", CF_YESNO, conf_set_general_short_motd);
-	add_conf_item("general", "no_oper_flood", CF_YESNO, conf_set_general_no_oper_flood);
-	add_conf_item("general", "glines", CF_YESNO, conf_set_general_glines);
-	add_conf_item("general", "gline_time", CF_TIME, conf_set_general_gline_time);
-	add_conf_item("general", "idletime", CF_TIME, conf_set_general_idletime);
-	add_conf_item("general", "message_locale", CF_QSTRING, conf_set_general_message_locale);
-	add_conf_item("general", "client_exit", CF_YESNO, conf_set_general_client_exit);
-	add_conf_item("general", "oper_only_umodes", CF_STRING | CF_FLIST,
-		      conf_set_general_oper_only_umodes);
-	add_conf_item("general", "max_targets", CF_INT, conf_set_general_max_targets);
-	add_conf_item("general", "use_egd", CF_YESNO, conf_set_general_use_egd);
-	add_conf_item("general", "egdpool_path", CF_QSTRING, conf_set_general_egdpool_path);
-	add_conf_item("general", "oper_umodes", CF_STRING | CF_FLIST, conf_set_general_oper_umodes);
-	add_conf_item("general", "caller_id_wait", CF_TIME, conf_set_general_caller_id_wait);
-	add_conf_item("general", "default_floodcount", CF_INT, conf_set_general_default_floodcount);
-	add_conf_item("general", "min_nonwildcard", CF_INT, conf_set_general_min_nonwildcard);
-	add_conf_item("general", "min_nonwildcard_simple", CF_INT,
-		      conf_set_general_min_nonwildcard_simple);
-	add_conf_item("general", "servlink_path", CF_QSTRING, conf_set_general_servlink_path);
-	add_conf_item("general", "tkline_expire_notices", CF_YESNO,
-		      conf_set_general_tkline_expire_notices);
-	add_conf_item("general", "use_help", CF_YESNO, conf_set_general_use_help);
-	add_conf_item("general", "use_whois_actually", CF_YESNO,
-		      conf_set_general_use_whois_actually);
-	add_conf_item("general", "default_cipher_preference", CF_QSTRING,
-		      conf_set_general_default_cipher_preference);
-	add_conf_item("general", "compression_level", CF_INT, conf_set_general_compression_level);
-	add_conf_item("general", "client_flood", CF_INT, conf_set_general_client_flood);
-	add_conf_item("general", "havent_read_conf", CF_YESNO, conf_set_general_havent_read_conf);
-	add_conf_item("general", "dot_in_ip6_addr", CF_YESNO, conf_set_general_dot_in_ip6_addr);
-	add_conf_item("general", "ping_cookie", CF_YESNO, conf_set_general_ping_cookie);
-	add_conf_item("general", "disable_auth", CF_YESNO, conf_set_general_disable_auth);
-	add_conf_item("general", "connect_timeout", CF_TIME, conf_set_general_connect_timeout);
-	add_conf_item("general", "default_operstring", CF_QSTRING, conf_set_general_default_operstring);
-	add_conf_item("general", "default_adminstring", CF_QSTRING, conf_set_general_default_adminstring);
-	add_conf_item("general", "reject_ban_time", CF_TIME, conf_set_general_reject_ban_time);
-	add_conf_item("general", "reject_after_count", CF_INT, conf_set_general_reject_after_count);
-	add_conf_item("general", "reject_duration", CF_TIME, conf_set_general_reject_duration);
-#ifdef IPV6
-	add_conf_item("general", "fallback_to_ip6_int", CF_YESNO,
-		      conf_set_general_fallback_to_ip6_int);
-#endif
-	add_top_conf("channel", NULL, NULL);
-	add_conf_item("channel", "use_except", CF_YESNO, conf_set_channel_use_except);
-	add_conf_item("channel", "use_invex", CF_YESNO, conf_set_channel_use_invex);
-	add_conf_item("channel", "use_knock", CF_YESNO, conf_set_channel_use_knock);
-	add_conf_item("channel", "max_bans", CF_INT, conf_set_channel_max_bans);
-	add_conf_item("channel", "knock_delay", CF_TIME, conf_set_channel_knock_delay);
-	add_conf_item("channel", "knock_delay_channel", CF_TIME,
-		      conf_set_channel_knock_delay_channel);
-	add_conf_item("channel", "max_chans_per_user", CF_INT, conf_set_channel_max_chans_per_user);
-	add_conf_item("channel", "quiet_on_ban", CF_YESNO, conf_set_channel_quiet_on_ban);
-	add_conf_item("channel", "persist_time", CF_TIME, conf_set_channel_persist_time);
-	add_conf_item("channel", "default_split_user_count", CF_INT,
-		      conf_set_channel_default_split_user_count);
-	add_conf_item("channel", "default_split_server_count", CF_INT,
-		      conf_set_channel_default_split_server_count);
-	add_conf_item("channel", "default_split_delay", CF_TIME,
-		      conf_set_channel_default_split_delay);
-	add_conf_item("channel", "no_create_on_split", CF_YESNO,
-		      conf_set_channel_no_create_on_split);
-	add_conf_item("channel", "no_join_on_split", CF_YESNO, conf_set_channel_no_join_on_split);
-	add_conf_item("channel", "no_oper_resvs", CF_YESNO, conf_set_channel_no_oper_resvs);
-	add_conf_item("channel", "burst_topicwho", CF_YESNO, conf_set_channel_burst_topicwho);
-
-	add_top_conf("serverhide", NULL, NULL);
-	add_conf_item("serverhide", "flatten_links", CF_YESNO, conf_set_serverhide_flatten_links);
-	add_conf_item("serverhide", "hide_servers", CF_YESNO, conf_set_serverhide_hide_servers);
-	add_conf_item("serverhide", "disable_remote_commands", CF_YESNO,
-		      conf_set_serverhide_disable_remote_commands);
-	add_conf_item("serverhide", "links_delay", CF_TIME, conf_set_serverhide_links_delay);
-	add_conf_item("serverhide", "disable_hidden", CF_YESNO, conf_set_serverhide_disable_hidden);
-	add_conf_item("serverhide", "hidden", CF_YESNO, conf_set_serverhide_hidden);
-	add_conf_item("serverhide", "disable_local_channels", CF_YESNO,
-		      conf_set_serverhide_disable_local_channels);
-}
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/s_conf.c ircd-ratbox-1.2-3/src/s_conf.c
--- ircd-ratbox-1.2-3+ipmask/src/s_conf.c	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/src/s_conf.c	Sat Sep  6 13:18:13 2003
@@ -56,7 +56,6 @@
 #include "patricia.h"
 #include "reject.h"
 
-char *ret_maskip(struct Client *);
 
 struct config_server_hide ConfigServerHide;
 
@@ -532,18 +531,6 @@
 			SetNeedId(client_p);
 		if(IsConfRestricted(aconf))
 			SetRestricted(client_p);
-
-
-		strlcpy (client_p->rhost, client_p->host, sizeof(client_p->rhost));
-		if(IsConfDoMaskIp(aconf))
-		{
-			strcpy (client_p->host, ret_maskip(client_p));
-			client_p->umodes |= UMODE_IPMASK;
-			if(!IsConfNoMaskNotice(aconf))
-			{
-				sendto_realops_flags (UMODE_ALL, L_ALL, ":%s mssking: %s as %s", client_p->name, client_p->rhost, client_p->host);
-			}
-		}
 
 		/* Thanks for spoof idea amm */
 		if(IsConfDoSpoofIp(aconf))
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/s_conf.c.orig ircd-ratbox-1.2-3/src/s_conf.c.orig
--- ircd-ratbox-1.2-3+ipmask/src/s_conf.c.orig	Sat Sep  6 13:18:13 2003
+++ ircd-ratbox-1.2-3/src/s_conf.c.orig	Wed Dec 31 17:00:00 1969
@@ -1,2490 +0,0 @@
-/*
- *  ircd-ratbox: A slightly useful ircd.
- *  s_conf.c: Configuration file functions.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002-2003 ircd-ratbox development team
- *
- *  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: s_conf.c,v 7.416.2.9 2003/09/06 20:18:13 leeh Exp $
- */
-
-#include "stdinc.h"
-#include "ircd_defs.h"
-#include "tools.h"
-#include "s_conf.h"
-#include "s_serv.h"
-#include "resv.h"
-#include "s_stats.h"
-#include "channel.h"
-#include "class.h"
-#include "client.h"
-#include "common.h"
-#include "event.h"
-#include "hash.h"
-#include "irc_string.h"
-#include "sprintf_irc.h"
-#include "ircd.h"
-#include "listener.h"
-#include "hostmask.h"
-#include "modules.h"
-#include "numeric.h"
-#include "fdlist.h"
-#include "s_bsd.h"
-#include "s_log.h"
-#include "send.h"
-#include "s_gline.h"
-#include "s_debug.h"
-#include "fileio.h"
-#include "memory.h"
-#include "cluster.h"
-#include "patricia.h"
-#include "reject.h"
-
-
-struct config_server_hide ConfigServerHide;
-
-extern int yyparse();		/* defined in y.tab.c */
-extern int lineno;
-extern char linebuf[];
-extern char conffilebuf[IRCD_BUFSIZE + 1];
-int scount = 0;			/* used by yyparse(), etc */
-
-#ifndef INADDR_NONE
-#define INADDR_NONE ((unsigned int) 0xffffffff)
-#endif
-
-
-/* internally defined functions */
-
-static void lookup_confhost(struct ConfItem *aconf);
-static int SplitUserHost(struct ConfItem *aconf);
-
-static void set_default_conf(void);
-static void validate_conf(void);
-static void read_conf(FBFILE *);
-static void clear_out_old_conf(void);
-static void flush_deleted_I_P(void);
-static int is_attached(struct Client *client_p, struct ConfItem *aconf);
-
-static void expire_tkline(dlink_list *, int);
-static void expire_tdline(dlink_list *, int);
-
-dlink_list tkline_min;
-dlink_list tkline_hour;
-dlink_list tkline_day;
-dlink_list tkline_week;
-
-dlink_list tdline_min;
-dlink_list tdline_hour;
-dlink_list tdline_day;
-dlink_list tdline_week;
-
-
-FBFILE *conf_fbfile_in;
-extern char yytext[];
-
-/* address of class 0 conf */
-static struct Class *class0;
-
-static int verify_access(struct Client *client_p, const char *username);
-static int attach_iline(struct Client *, struct ConfItem *);
-
-static void clear_special_conf(struct ConfItem **);
-
-/* general conf items link list root */
-struct ConfItem *ConfigItemList = NULL;
-
-/* conf xline link list root */
-struct ConfItem *x_conf = ((struct ConfItem *) NULL);
-
-/* conf uline link list root */
-struct ConfItem *u_conf = ((struct ConfItem *) NULL);
-
-/*
- * conf_dns_callback
- * inputs	- pointer to struct ConfItem
- *		- pointer to adns reply
- * output	- none
- * side effects	- 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
- */
-static void
-conf_dns_callback(void *vptr, adns_answer * reply)
-{
-	struct ConfItem *aconf = (struct ConfItem *) vptr;
-
-	if(reply && reply->status == adns_s_ok)
-	{
-#ifdef IPV6
-		copy_s_addr(IN_ADDR(aconf->ipnum), reply->rrs.addr->addr.inet6.sin6_addr.s6_addr);
-#else
-		copy_s_addr(IN_ADDR(aconf->ipnum), reply->rrs.addr->addr.inet.sin_addr.s_addr);
-#endif
-		MyFree(reply);
-	}
-
-	MyFree(aconf->dns_query);
-	aconf->dns_query = NULL;
-}
-
-/*
- * conf_dns_lookup - do a nameserver lookup of the conf host
- * if the conf entry is currently doing a ns lookup do nothing, otherwise
- * allocate a dns_query and start ns lookup.
- */
-static void
-conf_dns_lookup(struct ConfItem *aconf)
-{
-	if(aconf->dns_query == NULL)
-	{
-		aconf->dns_query = MyMalloc(sizeof(struct DNSQuery));
-		aconf->dns_query->ptr = aconf;
-		aconf->dns_query->callback = conf_dns_callback;
-		adns_gethost(aconf->host, aconf->aftype, aconf->dns_query);
-	}
-}
-
-/*
- * make_conf
- *
- * inputs	- none
- * output	- pointer to new conf entry
- * side effects	- none
- */
-struct ConfItem *
-make_conf()
-{
-	struct ConfItem *aconf;
-
-	aconf = (struct ConfItem *) MyMalloc(sizeof(struct ConfItem));
-	aconf->status = CONF_ILLEGAL;
-	aconf->aftype = AF_INET;
-	return (aconf);
-}
-
-/*
- * free_conf
- *
- * inputs	- pointer to conf to free
- * output	- none
- * side effects	- crucial password fields are zeroed, conf is freed
- */
-void
-free_conf(struct ConfItem *aconf)
-{
-	s_assert(aconf != NULL);
-	if(aconf == NULL)
-		return;
-
-	s_assert(!(aconf->status & CONF_CLIENT) ||
-	       (aconf->host && strcmp(aconf->host, "NOMATCH")) || (aconf->clients == -1));
-
-	delete_adns_queries(aconf->dns_query);
-
-	/* security.. */
-	if(aconf->passwd)
-		memset(aconf->passwd, 0, strlen(aconf->passwd));
-	if(aconf->spasswd)
-		memset(aconf->spasswd, 0, strlen(aconf->spasswd));
-
-	MyFree(aconf->passwd);
-	MyFree(aconf->spasswd);
-	MyFree(aconf->name);
-	MyFree(aconf->className);
-	MyFree(aconf->user);
-	MyFree(aconf->host);
-	MyFree(aconf->fakename);
-
-#ifdef HAVE_LIBCRYPTO
-	if(aconf->rsa_public_key)
-		RSA_free(aconf->rsa_public_key);
-
-	MyFree(aconf->rsa_public_key_file);
-#endif
-	MyFree((char *) aconf);
-}
-
-/*
- * remove all conf entries from the client except those which match
- * the status field mask.
- */
-void
-det_confs_butmask(struct Client *client_p, int mask)
-{
-	dlink_node *dlink;
-	dlink_node *link_next;
-	struct ConfItem *aconf;
-
-	DLINK_FOREACH_SAFE(dlink, link_next, client_p->localClient->confs.head)
-	{
-		aconf = dlink->data;
-
-		if((aconf->status & mask) == 0)
-		{
-			detach_conf(client_p, aconf);
-		}
-	}
-}
-
-static struct LinkReport
-{
-	int conf_type;
-	int rpl_stats;
-	int conf_char;
-}
-report_array[] =
-{
-	{
-	CONF_SERVER, RPL_STATSCLINE, 'C'}
-	,
-	{
-	CONF_LEAF, RPL_STATSLLINE, 'L'}
-	,
-	{
-	CONF_OPERATOR, RPL_STATSOLINE, 'O'}
-	,
-	{
-	CONF_HUB, RPL_STATSHLINE, 'H'}
-	,
-	{
-	0, 0, '\0'}
-};
-
-/*
- * report_configured_links
- *
- * inputs	- pointer to client to report to
- *		- type of line to report
- * output	- NONE
- * side effects	-
- */
-void
-report_configured_links(struct Client *source_p, int mask)
-{
-	struct ConfItem *tmp;
-	struct LinkReport *p;
-	char *host;
-	char *pass;
-	char *user;
-	char *name;
-	char *classname;
-	int port;
-
-	for (tmp = ConfigItemList; tmp; tmp = tmp->next)
-	{
-		if(tmp->status & mask)
-		{
-			for (p = &report_array[0]; p->conf_type; p++)
-				if(p->conf_type == (int)tmp->status)
-					break;
-
-			if(p->conf_type == 0)
-				return;
-
-			get_printable_conf(tmp, &name, &host, &pass, &user, &port, &classname);
-
-			if(mask & CONF_SERVER)
-			{
-				char c;
-				char buf[20];
-				char *s = buf;
-
-				buf[0] = '\0';
-				c = p->conf_char;
-
-				if(IsOper(source_p))
-				{
-					if(tmp->flags & CONF_FLAGS_ALLOW_AUTO_CONN)
-						*s++ = 'A';
-					if(tmp->flags & CONF_FLAGS_CRYPTLINK)
-						*s++ = 'C';
-					if(tmp->flags & CONF_FLAGS_COMPRESSED)
-						*s++ = 'Z';
-					if(tmp->fakename)
-						*s++ = 'M';
-				}
-
-				if(!buf[0])
-					*s++ = '*';
-
-				*s = '\0';
-
-				/* Allow admins to see actual ips */
-				/* except if HIDE_SERVERS_IPS is defined */
-#ifndef HIDE_SERVERS_IPS
-				if(IsOperAdmin(source_p))
-					sendto_one(source_p, form_str(p->rpl_stats), me.name,
-						   source_p->name, c,
-						   host,
-						   buf,
-						   name,
-						   port,
-						   classname,
-						   oper_flags_as_string((int) tmp->hold));
-				else
-#endif
-					sendto_one(source_p, form_str(p->rpl_stats), me.name,
-						   source_p->name, c,
-						   "*@127.0.0.1", buf, name, port, classname);
-
-			}
-			else if(mask & (CONF_OPERATOR))
-			{
-				/* Don't allow non opers to see oper privs */
-				if(IsOper(source_p))
-					sendto_one(source_p, form_str(p->rpl_stats), me.name,
-						   source_p->name,
-						   p->conf_char,
-						   user, host, name,
-						   oper_privs_as_string((struct Client *) NULL,
-									port), classname,
-						   oper_flags_as_string((int) tmp->hold));
-				else
-					sendto_one(source_p, form_str(p->rpl_stats), me.name,
-						   source_p->name, p->conf_char,
-						   user, host, name, "0", classname, "");
-			}
-			else
-				sendto_one(source_p, form_str(p->rpl_stats), me.name,
-					   source_p->name, p->conf_char,
-					   host, name, port, classname);
-		}
-	}
-}
-
-/*
- * check_client
- *
- * inputs	- pointer to client
- * output	- 0 = Success
- * 		  NOT_AUTHORISED (-1) = Access denied (no I line match)
- * 		  SOCKET_ERROR   (-2) = Bad socket.
- * 		  I_LINE_FULL    (-3) = I-line is full
- *		  TOO_MANY       (-4) = Too many connections from hostname
- * 		  BANNED_CLIENT  (-5) = K-lined
- * side effects - Ordinary client access check.
- *		  Look for conf lines which have the same
- * 		  status as the flags passed.
- */
-int
-check_client(struct Client *client_p, struct Client *source_p, char *username)
-{
-	int i;
-
-	ClearAccess(source_p);
-
-	if((i = verify_access(source_p, username)))
-	{
-		ilog(L_INFO, "Access denied: %s[%s]", source_p->name,
-		    source_p->localClient->sockhost);
-	}
-
-	switch (i)
-	{
-	case SOCKET_ERROR:
-		(void) exit_client(client_p, source_p, &me, "Socket Error");
-		break;
-
-	case TOO_MANY_LOCAL:
-		sendto_realops_flags(UMODE_FULL, L_ALL,
-				     "Too many local connections for %s",
-				     get_client_name(source_p, SHOW_IP));
-
-		ilog(L_INFO, "Too many local connections from %s",
-		     log_client_name(source_p, SHOW_IP));
-
-		ServerStats->is_ref++;
-		exit_client(client_p, source_p, &me, "Too many host connections (local)");
-		break;
-
-	case TOO_MANY_GLOBAL:
-		sendto_realops_flags(UMODE_FULL, L_ALL,
-				     "Too many global connections for %s",
-				     get_client_name(source_p, SHOW_IP));
-		ilog(L_INFO, "Too many global connections from %s",
-		     log_client_name(source_p, SHOW_IP));
-
-		ServerStats->is_ref++;
-		exit_client(client_p, source_p, &me, "Too many host connections (global)");
-		break;
-
-	case TOO_MANY_IDENT:
-		sendto_realops_flags(UMODE_FULL, L_ALL,
-				     "Too many user connections for %s",
-				     get_client_name(source_p, SHOW_IP));
-		ilog(L_INFO, "Too many user connections from %s",
-		     log_client_name(source_p, SHOW_IP));
-
-		ServerStats->is_ref++;
-		exit_client(client_p, source_p, &me, "Too many user connections (global)");
-		break;
-
-	case I_LINE_FULL:
-		sendto_realops_flags(UMODE_FULL, L_ALL,
-				     "I-line is full for %s (%s).",
-				     get_client_name(source_p, SHOW_IP),
-				     source_p->localClient->sockhost);
-
-		ilog(L_INFO, "Too many connections from %s.", log_client_name(source_p, SHOW_IP));
-
-		ServerStats->is_ref++;
-		(void) exit_client(client_p, source_p, &me,
-				   "No more connections allowed in your connection class");
-		break;
-
-	case NOT_AUTHORISED:
-		{
-			static char ipaddr[HOSTIPLEN];
-			ServerStats->is_ref++;
-			/* jdc - lists server name & port connections are on */
-			/*       a purely cosmetical change */
-			inetntop(source_p->localClient->aftype, &IN_ADDR(source_p->localClient->ip),
-				 ipaddr, HOSTIPLEN);
-			sendto_realops_flags(UMODE_UNAUTH, L_ALL,
-					     "Unauthorised client connection from %s [%s] on [%s/%u].",
-					     get_client_name(source_p, SHOW_IP), ipaddr,
-					     source_p->localClient->listener->name,
-					     source_p->localClient->listener->port);
-
-			ilog(L_INFO, "Unauthorised client connection from %s on [%s/%u].",
-			     log_client_name(source_p, SHOW_IP),
-			     source_p->localClient->listener->name,
-			     source_p->localClient->listener->port);
-			add_reject(client_p);
-			(void) exit_client(client_p, source_p, &me,
-					   "You are not authorised to use this server");
-			break;
-		}
-	case BANNED_CLIENT:
-		add_reject(client_p);
-		(void) exit_client(client_p, client_p, &me, "*** Banned ");
-		ServerStats->is_ref++;
-		break;
-
-	case 0:
-	default:
-		break;
-	}
-	return (i);
-}
-
-/*
- * verify_access
- *
- * inputs	- pointer to client to verify
- *		- pointer to proposed username
- * output	- 0 if success -'ve if not
- * side effect	- find the first (best) I line to attach.
- */
-static int
-verify_access(struct Client *client_p, const char *username)
-{
-	struct ConfItem *aconf;
-	char non_ident[USERLEN + 1];
-
-	if(IsGotId(client_p))
-	{
-		aconf = find_address_conf(client_p->host, client_p->username,
-					  &client_p->localClient->ip,
-					  client_p->localClient->aftype);
-	}
-	else
-	{
-		strlcpy(non_ident, "~", sizeof(non_ident));
-		strlcat(non_ident, username, sizeof(non_ident));
-		aconf = find_address_conf(client_p->host, non_ident,
-					  &client_p->localClient->ip,
-					  client_p->localClient->aftype);
-	}
-
-	if(aconf == NULL)
-		return NOT_AUTHORISED;
-
-	if(aconf->status & CONF_CLIENT)
-	{
-		if(aconf->flags & CONF_FLAGS_REDIR)
-		{
-			sendto_one(client_p, form_str(RPL_REDIR), me.name, client_p->name,
-					aconf->name ? aconf->name : "", aconf->port);
-			return (NOT_AUTHORISED);
-		}
-
-		if(IsConfDoIdentd(aconf))
-			SetNeedId(client_p);
-		if(IsConfRestricted(aconf))
-			SetRestricted(client_p);
-
-		/* Thanks for spoof idea amm */
-		if(IsConfDoSpoofIp(aconf))
-		{
-			char *p;
-
-			if(IsConfSpoofNotice(aconf))
-			{
-				sendto_realops_flags(UMODE_ALL, L_ALL,
-						"%s spoofing: %s as %s",
-						client_p->name,
-#ifdef HIDE_SPOOF_IPS
-						aconf->name,
-#else
-						client_p->host,
-#endif
-						aconf->name);
-			}
-
-			/* user@host spoof */
-			if((p = strchr(aconf->name, '@')) != NULL)
-			{
-				char *host = p+1;
-				*p = '\0';
-
-				strlcpy(client_p->username, aconf->name,
-					sizeof(client_p->username));
-				strlcpy(client_p->host, host,
-					sizeof(client_p->host));
-				*p = '@';
-			}
-			else
-				strlcpy(client_p->host, aconf->name,
-					sizeof(client_p->host));
-
-			SetIPSpoof(client_p);
-		}
-		return (attach_iline(client_p, aconf));
-	}
-	else if(aconf->status & CONF_KILL)
-	{
-		if(ConfigFileEntry.kline_with_reason)
-		{
-			sendto_one(client_p, ":%s NOTICE %s :*** Banned %s",
-					me.name, client_p->name, aconf->passwd);
-		}
-		return (BANNED_CLIENT);
-	}
-	else if(aconf->status & CONF_GLINE)
-	{
-		sendto_one(client_p, ":%s NOTICE %s :*** G-lined", me.name, client_p->name);
-
-		if(ConfigFileEntry.kline_with_reason)
-			sendto_one(client_p, ":%s NOTICE %s :*** Banned %s",
-					me.name, client_p->name, aconf->passwd);
-
-		return (BANNED_CLIENT);
-	}
-
-	return (NOT_AUTHORISED);
-}
-
-/*
- * add_ip_limit
- * 
- * Returns 1 if successful 0 if not
- *
- * This checks if the user has exceed the limits for their class
- * unless of course they are exempt..
- */
-
-static int
-add_ip_limit(struct Client *client_p, struct ConfItem *aconf)
-{
-	patricia_node_t *pnode;
-
-	/* If the limits are 0 don't do anything.. */
-	if(ConfCidrAmount(aconf) == 0 || ConfCidrBitlen(aconf) == 0)
-		return -1;
-
-	pnode = match_ip(ConfIpLimits(aconf), &client_p->localClient->ip);
-
-	if(pnode == NULL)
-		pnode = make_and_lookup_ip(ConfIpLimits(aconf), &client_p->localClient->ip, ConfCidrBitlen(aconf));
-
-	assert(pnode != NULL);
-
-	if(pnode != NULL)
-	{
-		if(((long) pnode->data) >= ConfCidrAmount(aconf)
-		   && !IsConfExemptLimits(aconf))
-		{
-			/* This should only happen if the limits are set to 0 */
-			if((unsigned long) pnode->data == 0)
-			{
-				patricia_remove(ConfIpLimits(aconf), pnode);
-			}
-			return (0);
-		}
-		((unsigned long) pnode->data)++;
-	}
-	return 1;
-}
-
-static void
-remove_ip_limit(struct Client *client_p, struct ConfItem *aconf)
-{
-	patricia_node_t *pnode;
-
-	/* If the limits are 0 don't do anything.. */
-	if(ConfCidrAmount(aconf) == 0 || ConfCidrBitlen(aconf) == 0)
-		return;
-
-	pnode = match_ip(ConfIpLimits(aconf), &client_p->localClient->ip);
-	if(pnode == NULL)
-		return;
-
-	((unsigned long) pnode->data)--;
-	if(((unsigned long) pnode->data) == 0)
-	{
-		patricia_remove(ConfIpLimits(aconf), pnode);
-	}
-
-}
-
-
-/*
- * attach_iline
- *
- * inputs	- client pointer
- *		- conf pointer
- * output	-
- * side effects	- do actual attach
- */
-static int
-attach_iline(struct Client *client_p, struct ConfItem *aconf)
-{
-	struct Client *target_p;
-	dlink_node *ptr;
-	int local_count = 0;
-	int global_count = 0;
-	int ident_count = 0;
-	int unidented = 0;
-
-	if(IsConfExemptLimits(aconf))
-		return (attach_conf(client_p, aconf));
-
-	if(*client_p->username == '~')
-		unidented = 1;
-
-	/* find_hostname() returns the head of the list to search */
-	DLINK_FOREACH(ptr, find_hostname(client_p->host))
-	{
-		target_p = ptr->data;
-
-		if(irccmp(client_p->host, target_p->host) != 0)
-			continue;
-
-		if(MyConnect(target_p))
-			local_count++;
-
-		global_count++;
-
-		if(unidented)
-		{
-			if(*target_p->username == '~')
-				ident_count++;
-		}
-		else if(irccmp(target_p->username, client_p->username) == 0)
-			ident_count++;
-
-		if(ConfMaxLocal(aconf) && local_count >= ConfMaxLocal(aconf))
-			return (TOO_MANY_LOCAL);
-		else if(ConfMaxGlobal(aconf) && global_count >= ConfMaxGlobal(aconf))
-			return (TOO_MANY_GLOBAL);
-		else if(ConfMaxIdent(aconf) && ident_count >= ConfMaxIdent(aconf))
-			return (TOO_MANY_IDENT);
-	}
-
-	return (attach_conf(client_p, aconf));
-}
-
-/*
- * detach_conf
- *
- * inputs	- pointer to client to detach
- * 		- pointer to conf item to detach
- * output	- 0 for success, -1 for failure
- * side effects	- Disassociate configuration from the client.
- *		  Also removes a class from the list if marked for deleting.
- */
-int
-detach_conf(struct Client *client_p, struct ConfItem *aconf)
-{
-	dlink_node *ptr;
-
-	if(aconf == NULL)
-		return (-1);
-
-	DLINK_FOREACH(ptr, client_p->localClient->confs.head)
-	{
-		if(ptr->data == aconf)
-		{
-			if((aconf) && (ClassPtr(aconf)))
-			{
-				remove_ip_limit(client_p, aconf);
-
-				if(aconf->status & CONF_CLIENT_MASK)
-				{
-					if(ConfCurrUsers(aconf) > 0)
-						--ConfCurrUsers(aconf);
-				}
-				if(ConfMaxUsers(aconf) == -1 && ConfCurrUsers(aconf) == 0)
-				{
-					free_class(ClassPtr(aconf));
-					ClassPtr(aconf) = NULL;
-				}
-			}
-			if(aconf && !--aconf->clients && IsIllegal(aconf))
-			{
-				free_conf(aconf);
-			}
-			dlinkDestroy(ptr, &client_p->localClient->confs);
-			return (0);
-		}
-	}
-	return (-1);
-}
-
-/*
- * is_attached
- *
- * inputs	- pointer to client to check
- * 		- pointer to conf item to check
- * output	- 1 if attached, 0 if not
- * side effects	- 
- */
-static int
-is_attached(struct Client *client_p, struct ConfItem *aconf)
-{
-	dlink_node *ptr;
-
-	DLINK_FOREACH(ptr, client_p->localClient->confs.head) if(ptr->data == aconf)
-		break;
-
-	return ((ptr != NULL) ? 1 : 0);
-}
-
-/*
- * attach_conf
- * 
- * inputs	- client pointer
- * 		- conf pointer
- * output	-
- * side effects - Associate a specific configuration entry to a *local*
- *                client (this is the one which used in accepting the
- *                connection). Note, that this automatically changes the
- *                attachment if there was an old one...
- */
-int
-attach_conf(struct Client *client_p, struct ConfItem *aconf)
-{
-
-	if(is_attached(client_p, aconf))
-	{
-		return (1);
-	}
-	if(IsIllegal(aconf))
-	{
-		return (NOT_AUTHORISED);
-	}
-
-	if((aconf->status & CONF_OPERATOR) == 0)
-	{
-                if(ClassPtr(aconf))
-                {
-                        if(!add_ip_limit(client_p, aconf))
-                        {
-                                return (TOO_MANY_LOCAL);
-                        }
-                }
-	
-		if((aconf->status & CONF_CLIENT) &&
-		   ConfCurrUsers(aconf) >= ConfMaxUsers(aconf) && ConfMaxUsers(aconf) > 0)
-		{
-			if(!IsConfExemptLimits(aconf))
-			{
-				return (I_LINE_FULL);
-			}
-			else
-			{
-				send(client_p->localClient->fd,
-				     "NOTICE FLINE :I: line is full, but you have an >I: line!\n",
-				     57, 0);
-				SetExemptLimits(client_p);
-			}
-
-		}
-	}
-
-	if(aconf->status & FLAGS2_RESTRICTED)
-		SetRestricted(client_p);
-
-
-	dlinkAddAlloc(aconf, &client_p->localClient->confs);
-
-	aconf->clients++;
-	if(aconf->status & CONF_CLIENT_MASK)
-		ConfCurrUsers(aconf)++;
-	return (0);
-}
-
-/*
- * attach_confs - Attach all possible CONF lines 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:*::*.
- * returns count of conf entries attached if successful, 0 if none are found
- *
- * NOTE: this will allow C:::* and N:::* because the match mask is the
- * conf line and not the name
- */
-int
-attach_confs(struct Client *client_p, const char *name, int statmask)
-{
-	struct ConfItem *tmp;
-	int conf_counter = 0;
-
-	for (tmp = ConfigItemList; tmp; tmp = tmp->next)
-	{
-		if((tmp->status & statmask) && !IsIllegal(tmp) &&
-		   tmp->name && match(tmp->name, name))
-		{
-			if(-1 < attach_conf(client_p, tmp))
-				++conf_counter;
-		}
-		else if((tmp->status & statmask) && !IsIllegal(tmp) &&
-			tmp->name && !irccmp(tmp->name, name))
-		{
-			if(-1 < attach_conf(client_p, tmp))
-				++conf_counter;
-		}
-	}
-	return (conf_counter);
-}
-
-/*
- * attach_connect_block
- *
- * inputs	- pointer to server to attach
- * 		- name of server
- *		- hostname of server
- * output	- true (1) if both are found, otherwise return false (0)
- * side effects - find connect block and attach them to connecting client
- */
-int
-attach_connect_block(struct Client *client_p, const char *name, const char *host)
-{
-	struct ConfItem *ptr;
-
-	s_assert(client_p != NULL);
-	s_assert(host != NULL);
-	if(client_p == NULL || host == NULL)
-		return (0);
-
-	for (ptr = ConfigItemList; ptr; ptr = ptr->next)
-	{
-		if(IsIllegal(ptr))
-			continue;
-		if(ptr->status != CONF_SERVER)
-			continue;
-		if((match(name, ptr->name) == 0) || (match(ptr->host, host) == 0))
-			continue;
-		attach_conf(client_p, ptr);
-		return (-1);
-	}
-	return (0);
-}
-
-/*
- * find_conf_exact
- *
- * inputs	- pointer to name to find
- *		- pointer to username to find
- *		- pointer to host to find
- *		- int mask of type of conf to find
- * output	- NULL or pointer to conf found
- * side effects	- find a conf entry which matches the hostname
- *		  and has the same name.
- */
-struct ConfItem *
-find_conf_exact(const char *name, const char *user, const char *host, int statmask)
-{
-	struct ConfItem *tmp;
-
-	for (tmp = ConfigItemList; tmp; tmp = tmp->next)
-	{
-		if(!(tmp->status & statmask) || !tmp->name || !tmp->host || irccmp(tmp->name, name))
-			continue;
-		/*
-		 ** Accept if the *real* hostname (usually sockethost)
-		 ** socket host) matches *either* host or name field
-		 ** of the configuration.
-		 */
-		if(!match(tmp->host, host) || !match(tmp->user, user) || irccmp(tmp->name, name))
-			continue;
-		if(tmp->status & CONF_OPERATOR)
-		{
-			if(tmp->clients < ConfMaxUsers(tmp))
-				return (tmp);
-			else
-				continue;
-		}
-		else
-			return (tmp);
-	}
-	return (NULL);
-}
-
-/*
- * find_conf_name
- *
- * inputs	- pointer to conf link list to search
- *		- pointer to name to find
- *		- int mask of type of conf to find
- * output	- NULL or pointer to conf found
- * side effects	- find a conf entry which matches the name
- *		  and has the given mask.
- */
-struct ConfItem *
-find_conf_name(dlink_list * list, const char *name, int statmask)
-{
-	dlink_node *ptr;
-	struct ConfItem *aconf;
-
-	DLINK_FOREACH(ptr, list->head)
-	{
-		aconf = ptr->data;
-		if((aconf->status & statmask) && aconf->name &&
-		   (!irccmp(aconf->name, name) || match(aconf->name, name)))
-			return (aconf);
-	}
-	return (NULL);
-}
-
-
-/*
- * find_conf_by_name
- *
- * inputs	- pointer to name to match on
- *		- int mask of type of conf to find
- * output	- NULL or pointer to conf found
- * side effects	- find a conf entry which matches the name
- *		  and has the given mask.
- *
- */
-struct ConfItem *
-find_conf_by_name(const char *name, int status)
-{
-	struct ConfItem *conf;
-	s_assert(name != NULL);
-	if(name == NULL)
-		return (NULL);
-
-	for (conf = ConfigItemList; conf; conf = conf->next)
-	{
-		if((int)conf->status == status && conf->name && match(name, conf->name))
-			return (conf);
-	}
-	return (NULL);
-}
-
-/*
- * find_conf_by_host
- *
- * inputs	- pointer to hostname to match on
- *		- int mask of type of conf to find
- * output	- NULL or pointer to conf found
- * side effects	- find a conf entry which matches the host
- *		  and has the given mask.
- *
- */
-struct ConfItem *
-find_conf_by_host(const char *host, int status)
-{
-	struct ConfItem *conf;
-	s_assert(host != NULL);
-	if(host == NULL)
-		return (NULL);
-	for (conf = ConfigItemList; conf; conf = conf->next)
-	{
-		if((int)conf->status == status && conf->host && match(host, conf->host))
-			return (conf);
-	}
-	return (NULL);
-}
-
-/*
- * find_x_conf
- *
- * inputs       - pointer to char string to find
- * output       - NULL or pointer to found struct ConfItem
- * side effects - looks for a match on name field
- */
-struct ConfItem *
-find_x_conf(char *to_find)
-{
-	struct ConfItem *aconf;
-
-	for (aconf = x_conf; aconf; aconf = aconf->next)
-	{
-		if(BadPtr(aconf->name))
-			continue;
-
-		if(match_esc(aconf->name, to_find))
-			return (aconf);
-
-	}
-	return (NULL);
-}
-
-/*
- * find_u_conf
- *
- * inputs       - pointer to servername
- *		- pointer to user of oper
- *		- pointer to host of oper
- * output       - NULL or pointer to found struct ConfItem
- * side effects - looks for a matches on all fields
- */
-int
-find_u_conf(char *server, char *user, char *host, int flag)
-{
-	struct ConfItem *aconf;
-
-	for (aconf = u_conf; aconf; aconf = aconf->next)
-	{
-		if(BadPtr(aconf->name))
-			continue;
-
-		if(match(aconf->name, server))
-		{
-			if(BadPtr(aconf->user) || BadPtr(aconf->host))
-			{
-				if(aconf->port & flag)
-					return (YES);
-				else
-					return (NO);
-			}
-
-			if(match(aconf->user, user) && match(aconf->host, host) &&
-			   aconf->port & flag)
-				return (YES);
-
-		}
-	}
-	return (NO);
-}
-
-
-/*
- * clear_special_conf
- * 
- * inputs       - pointer to pointer of root of special conf link list
- * output       - none
- * side effects - clears given special conf lines
- */
-static void
-clear_special_conf(struct ConfItem **this_conf)
-{
-	struct ConfItem *aconf;
-	struct ConfItem *next_aconf;
-
-	for (aconf = *this_conf; aconf; aconf = next_aconf)
-	{
-		next_aconf = aconf->next;
-		free_conf(aconf);
-	}
-	*this_conf = (struct ConfItem *) NULL;
-	return;
-}
-
-/*
- * rehash
- *
- * Actual REHASH service routine. Called with sig == 0 if it has been called
- * as a result of an operator issuing this command, else assume it has been
- * called as a result of the server receiving a HUP signal.
- */
-int
-rehash(int sig)
-{
-	if(sig != 0)
-	{
-		sendto_realops_flags(UMODE_ALL, L_ALL,
-				     "Got signal SIGHUP, reloading ircd conf. file");
-	}
-
-	restart_resolver();
-	/* don't close listeners until we know we can go ahead with the rehash */
-	read_conf_files(NO);
-
-	if(ServerInfo.description != NULL)
-	{
-		strlcpy(me.info, ServerInfo.description, sizeof(me.info));
-	}
-
-	flush_deleted_I_P();
-	check_banned_lines();
-	reopen_log(logFileName);
-	return (0);
-}
-
-/*
- * set_default_conf()
- *
- * inputs	- NONE
- * output	- NONE
- * side effects	- Set default values here.
- *		  This is called **PRIOR** to parsing the
- *		  configuration file.  If you want to do some validation
- *		  of values later, put them in validate_conf().
- */
-
-#define YES     1
-#define NO      0
-#define UNSET  -1
-
-static void
-set_default_conf(void)
-{
-	class0 = find_class("default");	/* which one is the default class ? */
-
-#ifdef HAVE_LIBCRYPTO
-	ServerInfo.rsa_private_key = NULL;
-	ServerInfo.rsa_private_key_file = NULL;
-#endif
-
-	/* ServerInfo.name is not rehashable */
-	/* ServerInfo.name = ServerInfo.name; */
-	ServerInfo.description = NULL;
-	DupString(ServerInfo.network_name, NETWORK_NAME_DEFAULT);
-	DupString(ServerInfo.network_desc, NETWORK_DESC_DEFAULT);
-
-	memset(&ServerInfo.ip, 0, sizeof(ServerInfo.ip));
-	ServerInfo.specific_ipv4_vhost = 0;
-	memset(&ServerInfo.ip6, 0, sizeof(ServerInfo.ip6));
-	ServerInfo.specific_ipv6_vhost = 0;
-
-	/* Don't reset hub, as that will break lazylinks */
-	/* ServerInfo.hub = NO; */
-	ServerInfo.dns_host.sin_addr.s_addr = 0;
-	ServerInfo.dns_host.sin_port = 0;
-	AdminInfo.name = NULL;
-	AdminInfo.email = NULL;
-	AdminInfo.description = NULL;
-
-	set_log_level(L_NOTICE);
-
-	ConfigFileEntry.failed_oper_notice = YES;
-	ConfigFileEntry.anti_nick_flood = NO;
-	ConfigFileEntry.max_nick_time = 20;
-	ConfigFileEntry.max_nick_changes = 5;
-	ConfigFileEntry.max_accept = 20;
-	ConfigFileEntry.anti_spam_exit_message_time = 0;
-	ConfigFileEntry.ts_warn_delta = TS_WARN_DELTA_DEFAULT;
-	ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT;
-	ConfigFileEntry.kline_with_reason = YES;
-	ConfigFileEntry.kline_with_connection_closed = NO;
-	ConfigFileEntry.kline_delay = 0;
-	ConfigFileEntry.client_exit = YES;
-	ConfigFileEntry.warn_no_nline = YES;
-	ConfigFileEntry.non_redundant_klines = YES;
-	ConfigFileEntry.stats_o_oper_only = NO;
-	ConfigFileEntry.stats_k_oper_only = 1;	/* masked */
-	ConfigFileEntry.stats_i_oper_only = 1;	/* masked */
-	ConfigFileEntry.stats_P_oper_only = NO;
-	ConfigFileEntry.stats_c_oper_only = NO;
-	ConfigFileEntry.stats_y_oper_only = NO;
-	ConfigFileEntry.stats_h_oper_only = NO;
-	ConfigFileEntry.map_oper_only = YES;
-	ConfigFileEntry.pace_wait = 10;
-	ConfigFileEntry.caller_id_wait = 60;
-	ConfigFileEntry.pace_wait_simple = 1;
-	ConfigFileEntry.short_motd = NO;
-	ConfigFileEntry.no_oper_flood = NO;
-	ConfigFileEntry.fname_userlog[0] = '\0';
-	ConfigFileEntry.fname_foperlog[0] = '\0';
-	ConfigFileEntry.fname_operlog[0] = '\0';
-	ConfigFileEntry.fname_operspylog[0] = '\0';
-	ConfigFileEntry.fname_operspyremotelog[0] = '\0';
-	ConfigFileEntry.glines = NO;
-	ConfigFileEntry.use_egd = NO;
-	/* don't reset msglocale setting -- we'd overwrite then env string */
-	ConfigFileEntry.gline_time = 12 * 3600;
-	ConfigFileEntry.idletime = 0;
-	ConfigFileEntry.dots_in_ident = 0;
-	ConfigFileEntry.max_targets = MAX_TARGETS_DEFAULT;
-	DupString(ConfigFileEntry.servlink_path, SLPATH);
-	ConfigFileEntry.egdpool_path = NULL;
-	ConfigFileEntry.use_whois_actually = YES;
-	strlcpy(ConfigFileEntry.default_operstring, "is an IRC Operator",sizeof(ConfigFileEntry.default_operstring));
-	strlcpy(ConfigFileEntry.default_adminstring, "is a Server Administrator", sizeof(ConfigFileEntry.default_adminstring));
-
-	ConfigFileEntry.reject_after_count = 5;
-	ConfigFileEntry.reject_ban_time = 300;
-	ConfigFileEntry.reject_duration = 120;
-
-#ifdef HAVE_LIBCRYPTO
-	/* jdc -- This is our default value for a cipher.  According to the
-	 *        CRYPTLINK document (doc/cryptlink.txt), BF/128 must be supported
-	 *        under all circumstances if cryptlinks are enabled.  So,
-	 *        this will be our default.
-	 *
-	 *        NOTE: I apologise for the hard-coded value of "1" (BF/128).
-	 *              This should be moved into a find_cipher() routine.
-	 */
-	ConfigFileEntry.default_cipher_preference = &CipherTable[1];
-#endif
-#ifdef HAVE_LIBZ
-	ConfigFileEntry.compression_level = 0;
-#endif
-
-	ConfigFileEntry.oper_umodes = UMODE_LOCOPS | UMODE_SERVNOTICE |
-		UMODE_OPERWALL | UMODE_WALLOP;
-	ConfigFileEntry.oper_only_umodes = UMODE_DEBUG | UMODE_OPERSPY;
-
-	ConfigChannel.use_except = YES;
-	ConfigChannel.use_invex = YES;
-	ConfigChannel.use_knock = YES;
-	ConfigChannel.knock_delay = 300;
-	ConfigChannel.knock_delay_channel = 60;
-	ConfigChannel.max_chans_per_user = 15;
-	ConfigChannel.max_bans = 100;
-	ConfigChannel.no_oper_resvs = NO;
-	ConfigChannel.burst_topicwho = NO;
-
-	ConfigChannel.persist_time = 0;
-
-	ConfigChannel.default_split_user_count = 0;
-	ConfigChannel.default_split_server_count = 0;
-	ConfigChannel.default_split_delay = 15;
-	ConfigChannel.no_join_on_split = NO;
-	ConfigChannel.no_create_on_split = YES;
-
-	ConfigServerHide.flatten_links = 0;
-	ConfigServerHide.hide_servers = 0;
-	ConfigServerHide.disable_remote = 0;
-	ConfigServerHide.links_delay = 300;
-	ConfigServerHide.hidden = 0;
-	ConfigServerHide.disable_hidden = 0;
-
-	ConfigFileEntry.min_nonwildcard = 4;
-	ConfigFileEntry.min_nonwildcard_simple = 3;
-	ConfigFileEntry.default_floodcount = 8;
-	ConfigFileEntry.client_flood = CLIENT_FLOOD_DEFAULT;
-	ConfigFileEntry.use_help = 0;
-	ConfigFileEntry.tkline_expire_notices = 0;
-
-#ifdef IPV6
-	ConfigFileEntry.fallback_to_ip6_int = YES;
-#endif
-}
-
-#undef YES
-#undef NO
-
-/*
- * read_conf() 
- *
- *
- * inputs       - file descriptor pointing to config file to use
- * output       - None
- * side effects	- Read configuration file.
- */
-static void
-read_conf(FBFILE * file)
-{
-	scount = lineno = 0;
-
-	set_default_conf();	/* Set default values prior to conf parsing */
-	yyparse();		/* Load the values from the conf */
-	validate_conf();	/* Check to make sure some values are still okay. */
-	/* Some global values are also loaded here. */
-	check_class();		/* Make sure classes are valid */
-}
-
-static void
-validate_conf(void)
-{
-	if(ConfigFileEntry.ts_warn_delta < TS_WARN_DELTA_MIN)
-		ConfigFileEntry.ts_warn_delta = TS_WARN_DELTA_DEFAULT;
-
-	if(ConfigFileEntry.ts_max_delta < TS_MAX_DELTA_MIN)
-		ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT;
-
-	if(ConfigFileEntry.servlink_path == NULL)
-		DupString(ConfigFileEntry.servlink_path, SLPATH);
-
-	if(ServerInfo.network_name == NULL)
-		DupString(ServerInfo.network_name, NETWORK_NAME_DEFAULT);
-
-	if(ServerInfo.network_desc == NULL)
-		DupString(ServerInfo.network_desc, NETWORK_DESC_DEFAULT);
-
-	if((ConfigFileEntry.client_flood < CLIENT_FLOOD_MIN) ||
-	   (ConfigFileEntry.client_flood > CLIENT_FLOOD_MAX))
-		ConfigFileEntry.client_flood = CLIENT_FLOOD_MAX;
-
-	GlobalSetOptions.idletime = (ConfigFileEntry.idletime * 60);
-}
-
-/*
- * conf_add_conf
- * Inputs	- ConfItem
- * Output	- none
- * Side effects	- add given conf to link list
- */
-void
-conf_add_conf(struct ConfItem *aconf)
-{
-	(void) collapse(aconf->host);
-	(void) collapse(aconf->user);
-
-	aconf->next = ConfigItemList;
-	ConfigItemList = aconf;
-}
-
-/*
- * SplitUserHost
- *
- * inputs	- struct ConfItem pointer
- * output	- return 1/0 true false or -1 for error
- * side effects - splits user@host found in a name field of conf given
- *		  stuff the user into ->user and the host into ->host
- */
-static int
-SplitUserHost(struct ConfItem *aconf)
-{
-	char *p;
-	char *new_user;
-	char *new_host;
-
-	if((p = strchr(aconf->host, '@')))
-	{
-		*p = '\0';
-		DupString(new_user, aconf->host);
-		MyFree(aconf->user);
-		aconf->user = new_user;
-		p++;
-		DupString(new_host, p);
-		MyFree(aconf->host);
-		aconf->host = new_host;
-	}
-	else
-	{
-		DupString(aconf->user, "*");
-	}
-	return (1);
-}
-
-/*
- * lookup_confhost - 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.
- *
- */
-static void
-lookup_confhost(struct ConfItem *aconf)
-{
-	if(BadPtr(aconf->host) || BadPtr(aconf->name))
-	{
-		ilog(L_ERROR, "Host/server name error: (%s) (%s)", aconf->host, aconf->name);
-		return;
-	}
-
-	if(strchr(aconf->host, '*') || strchr(aconf->host, '?'))
-		return;
-	/*
-	 ** Do name lookup now on hostnames given and store the
-	 ** ip numbers in conf structure.
-	 */
-	if(inetpton(DEF_FAM, aconf->host, &IN_ADDR(aconf->ipnum)) <= 0)
-	{
-		conf_dns_lookup(aconf);
-	}
-}
-
-/*
- * conf_connect_allowed
- *
- * inputs	- pointer to inaddr
- *		- int type ipv4 or ipv6
- * output	- BANNED or accepted
- * side effects	- none
- */
-int
-conf_connect_allowed(struct irc_inaddr *addr, int aftype)
-{
-	struct ConfItem *aconf = find_dline(addr, aftype);
-
-	/* DLINE exempt also gets you out of static limits/pacing... */
-	if(aconf && (aconf->status & CONF_EXEMPTDLINE))
-		return (0);
-
-	if(aconf != NULL)
-		return (BANNED_CLIENT);
-
-	return (0);
-}
-
-/*
- * find_kill
- *
- * inputs	- pointer to client structure
- * output	- pointer to struct ConfItem if found
- * side effects	- See if this user is klined already,
- *		  and if so, return struct ConfItem pointer
- */
-struct ConfItem *
-find_kill(struct Client *client_p)
-{
-	struct ConfItem *aconf;
-	s_assert(client_p != NULL);
-	if(client_p == NULL)
-		return (NULL);
-
-	aconf = find_address_conf(client_p->host, client_p->username,
-				  &client_p->localClient->ip, client_p->localClient->aftype);
-	if(aconf == NULL)
-		return (aconf);
-	if((aconf->status & CONF_KILL) || (aconf->status & CONF_GLINE))
-		return (aconf);
-
-	return (NULL);
-}
-
-/* add_temp_kline()
- *
- * inputs        - pointer to struct ConfItem
- * output        - none
- * Side effects  - links in given struct ConfItem into 
- *                 temporary kline link list
- */
-void
-add_temp_kline(struct ConfItem *aconf)
-{
-	if(aconf->hold >= CurrentTime + (10080 * 60))
-		dlinkAddAlloc(aconf, &tkline_week);
-	else if(aconf->hold >= CurrentTime + (1440 * 60))
-		dlinkAddAlloc(aconf, &tkline_day);
-	else if(aconf->hold >= CurrentTime + (60 * 60))
-		dlinkAddAlloc(aconf, &tkline_hour);
-	else
-		dlinkAddAlloc(aconf, &tkline_min);
-
-	aconf->flags |= CONF_FLAGS_TEMPORARY;
-	add_conf_by_address(aconf->host, CONF_KILL, aconf->user, aconf);
-}
-
-/* add_temp_dline()
- *
- * input	- pointer to struct ConfItem
- * output	- none
- * side effects - added to tdline link list and address hash
- */
-void
-add_temp_dline(struct ConfItem *aconf)
-{
-	if(aconf->hold >= CurrentTime + (10080 * 60))
-		dlinkAddAlloc(aconf, &tdline_week);
-	else if(aconf->hold >= CurrentTime + (1440 * 60))
-		dlinkAddAlloc(aconf, &tdline_day);
-	else if(aconf->hold >= CurrentTime + (60 * 60))
-		dlinkAddAlloc(aconf, &tdline_hour);
-	else
-		dlinkAddAlloc(aconf, &tdline_min);
-
-	aconf->flags |= CONF_FLAGS_TEMPORARY;
-	add_conf_by_address(aconf->host, CONF_DLINE, aconf->user, aconf);
-}
-
-void
-cleanup_temps_min(void *notused)
-{
-	expire_tkline(&tkline_min, TEMP_MIN);
-	expire_tdline(&tdline_min, TEMP_MIN);
-}
-
-void
-cleanup_temps_hour(void *notused)
-{
-	expire_tkline(&tkline_hour, TEMP_HOUR);
-	expire_tdline(&tdline_hour, TEMP_HOUR);
-}
-
-void
-cleanup_temps_day(void *notused)
-{
-	expire_tkline(&tkline_day, TEMP_DAY);
-	expire_tdline(&tdline_day, TEMP_DAY);
-}
-
-void
-cleanup_temps_week(void *notused)
-{
-	expire_tkline(&tkline_week, TEMP_WEEK);
-	expire_tdline(&tdline_week, TEMP_WEEK);
-}
-
-/* expire_tkline()
- *
- * inputs       - list pointer
- * 		- type
- * output       - NONE
- * side effects - expire tklines and moves them between lists
- */
-static void
-expire_tkline(dlink_list * tklist, int type)
-{
-	dlink_node *ptr;
-	dlink_node *next_ptr;
-	struct ConfItem *aconf;
-
-	DLINK_FOREACH_SAFE(ptr, next_ptr, tklist->head)
-	{
-		aconf = ptr->data;
-
-		if(aconf->hold <= CurrentTime)
-		{
-			/* Alert opers that a TKline expired - Hwy */
-			if(ConfigFileEntry.tkline_expire_notices)
-				sendto_realops_flags(UMODE_ALL, L_ALL,
-						     "Temporary K-line for [%s@%s] expired",
-						     (aconf->user) ? aconf->user : "*",
-						     (aconf->host) ? aconf->host : "*");
-
-			delete_one_address_conf(aconf->host, aconf);
-			dlinkDestroy(ptr, tklist);
-		}
-		else if((type == TEMP_WEEK && aconf->hold < (CurrentTime + (10080 * 60))) ||
-			(type == TEMP_DAY && aconf->hold < (CurrentTime + (1440 * 60))) ||
-			(type == TEMP_HOUR && aconf->hold < (CurrentTime + (60 * 60))))
-		{
-			/* expires within a hour, check every minute.. */
-			if(aconf->hold < CurrentTime + (60 * 60))
-				dlinkMoveNode(ptr, tklist, &tkline_min);
-
-			/* .. a day, check hourly */
-			else if(aconf->hold < CurrentTime + (1440 * 60))
-				dlinkMoveNode(ptr, tklist, &tkline_hour);
-
-			/* .. a week, check daily */
-			else if(aconf->hold < CurrentTime + (10080 * 60))
-				dlinkMoveNode(ptr, tklist, &tkline_day);
-		}
-	}
-}
-
-/* expire_tdline()
- *
- * inputs       - list pointer
- * 		- type
- * output       - NONE
- * side effects - expire tdlines and moves them between lists
- */
-static void
-expire_tdline(dlink_list * tdlist, int type)
-{
-	dlink_node *ptr;
-	dlink_node *next_ptr;
-	struct ConfItem *aconf;
-
-	DLINK_FOREACH_SAFE(ptr, next_ptr, tdlist->head)
-	{
-		aconf = ptr->data;
-
-		if(aconf->hold <= CurrentTime)
-		{
-			if(ConfigFileEntry.tkline_expire_notices)
-				sendto_realops_flags(UMODE_ALL, L_ALL,
-						     "Temporary D-line for [%s] expired",
-						     aconf->host);
-
-			delete_one_address_conf(aconf->host, aconf);
-			dlinkDestroy(ptr, tdlist);
-		}
-		else if((type == TEMP_WEEK && aconf->hold < (CurrentTime + (10080 * 60))) ||
-			(type == TEMP_DAY && aconf->hold < (CurrentTime + (1440 * 60))) ||
-			(type == TEMP_HOUR && aconf->hold < (CurrentTime + (60 * 60))))
-		{
-			/* expires within an hour, check every minute.. */
-			if(aconf->hold < CurrentTime + (60 * 60))
-				dlinkMoveNode(ptr, tdlist, &tdline_min);
-
-			/* .. a day, check hourly */
-			else if(aconf->hold < CurrentTime + (1440 * 60))
-				dlinkMoveNode(ptr, tdlist, &tdline_hour);
-
-			/* .. a week, check daily */
-			else if(aconf->hold < CurrentTime + (10080 * 60))
-				dlinkMoveNode(ptr, tdlist, &tdline_day);
-		}
-	}
-}
-
-/*
- * oper_privs_as_string
- *
- * inputs        - pointer to client_p or NULL
- * output        - pointer to static string showing oper privs
- * side effects  -
- * return as string, the oper privs as derived from port
- * also, set the oper privs if given client_p non NULL
- */
-
-char *
-oper_privs_as_string(struct Client *client_p, int port)
-{
-	static char privs_out[16];
-	char *privs_ptr;
-
-	privs_ptr = privs_out;
-	*privs_ptr = '\0';
-
-	if(client_p != NULL)
-		client_p->flags2 |= port;
-
-	if(port & OPER_GLINE)
-		*privs_ptr++ = 'G';
-	else
-		*privs_ptr++ = 'g';
-
-	if(port & OPER_K)
-		*privs_ptr++ = 'K';
-	else
-		*privs_ptr++ = 'k';
-
-	if(port & OPER_XLINE)
-		*privs_ptr++ = 'X';
-	else
-		*privs_ptr++ = 'x';
-
-	if(port & OPER_GLOBAL_KILL)
-		*privs_ptr++ = 'O';
-	else
-		*privs_ptr++ = 'o';
-
-	if(port & OPER_REMOTE)
-		*privs_ptr++ = 'R';
-	else
-		*privs_ptr++ = 'r';
-
-	if(port & OPER_UNKLINE)
-		*privs_ptr++ = 'U';
-	else
-		*privs_ptr++ = 'u';
-
-	if(port & OPER_REHASH)
-		*privs_ptr++ = 'H';
-	else
-		*privs_ptr++ = 'h';
-
-	if(port & OPER_DIE)
-		*privs_ptr++ = 'D';
-	else
-		*privs_ptr++ = 'd';
-
-	if(port & OPER_ADMIN)
-		*privs_ptr++ = 'A';
-	else
-		*privs_ptr++ = 'a';
-
-	if(port & OPER_N)
-		*privs_ptr++ = 'N';
-	else
-		*privs_ptr++ = 'n';
-
-	if(port & OPER_OPERWALL)
-		*privs_ptr++ = 'L';
-	else
-		*privs_ptr++ = 'l';
-
-	*privs_ptr = '\0';
-
-	return (privs_out);
-}
-
-
-/* oper_flags_as_string
- *
- * inputs        - oper flags as bit mask
- * output        - oper flags as as string
- * side effects -
- *
- */
-char *
-oper_flags_as_string(int flags)
-{
-	/* This MUST be extended if we add any more modes... -Hwy */
-	static char flags_out[20];
-	char *flags_ptr;
-
-	flags_ptr = flags_out;
-	*flags_ptr = '\0';
-
-	if(flags & UMODE_INVISIBLE)
-		*flags_ptr++ = 'i';
-	if(flags & UMODE_WALLOP)
-		*flags_ptr++ = 'w';
-	if(flags & UMODE_SERVNOTICE)
-		*flags_ptr++ = 's';
-	if(flags & UMODE_CCONN)
-		*flags_ptr++ = 'c';
-	if(flags & UMODE_REJ)
-		*flags_ptr++ = 'r';
-	if(flags & UMODE_SKILL)
-		*flags_ptr++ = 'k';
-	if(flags & UMODE_FULL)
-		*flags_ptr++ = 'f';
-	if(flags & UMODE_SPY)
-		*flags_ptr++ = 'y';
-	if(flags & UMODE_DEBUG)
-		*flags_ptr++ = 'd';
-	if(flags & UMODE_NCHANGE)
-		*flags_ptr++ = 'n';
-	if(flags & UMODE_ADMIN)
-		*flags_ptr++ = 'a';
-	if(flags & UMODE_EXTERNAL)
-		*flags_ptr++ = 'x';
-	if(flags & UMODE_UNAUTH)
-		*flags_ptr++ = 'u';
-	if(flags & UMODE_BOTS)
-		*flags_ptr++ = 'b';
-	if(flags & UMODE_LOCOPS)
-		*flags_ptr++ = 'l';
-	if(flags & UMODE_CALLERID)
-		*flags_ptr++ = 'g';
-	if(flags & UMODE_OPERSPY)
-		*flags_ptr++ = 'Z';
-
-	*flags_ptr = '\0';
-
-	return (flags_out);
-}
-
-
-/* const char* get_oper_name(struct Client *client_p)
- * Input: A client to find the active oper{} name for.
- * Output: The nick!user@host{oper} of the oper.
- *         "oper" is server name for remote opers
- * Side effects: None.
- */
-char *
-get_oper_name(struct Client *client_p)
-{
-	dlink_node *cnode;
-
-	/* +5 for !,@,{,} and null */
-	static char buffer[NICKLEN + USERLEN + HOSTLEN + HOSTLEN + 5];
-
-	if(MyConnect(client_p))
-	{
-		DLINK_FOREACH(cnode, client_p->localClient->confs.head)
-			if(((struct ConfItem *) cnode->data)->status & CONF_OPERATOR)
-		{
-			ircsprintf(buffer, "%s!%s@%s{%s}", client_p->name,
-				   client_p->username, client_p->host,
-				   ((struct ConfItem *) cnode->data)->name);
-			return (buffer);
-		}
-		/* Probably should s_assert here for now. If there is an oper out there 
-		 * with no oper{} conf attached, it would be good for us to know...
-		 */
-		s_assert(0);	/* Oper without oper conf! */
-	}
-	ircsprintf(buffer, "%s!%s@%s{%s}", client_p->name,
-		   client_p->username, client_p->host, client_p->servptr->name);
-	return (buffer);
-}
-
-/*
- * get_printable_conf
- *
- * inputs        - struct ConfItem
- *
- * output         - name 
- *                - host
- *                - pass
- *                - user
- *                - port
- *
- * side effects        -
- * Examine the struct struct ConfItem, setting the values
- * of name, host, pass, user to values either
- * in aconf, or "<NULL>" port is set to aconf->port in all cases.
- */
-
-void
-get_printable_conf(struct ConfItem *aconf, char **name, char **host,
-		   char **pass, char **user, int *port, char **classname)
-{
-	static char null[] = "<NULL>";
-	static char zero[] = "default";
-
-	*name = BadPtr(aconf->name) ? null : aconf->name;
-	*host = BadPtr(aconf->host) ? null : aconf->host;
-	*pass = BadPtr(aconf->passwd) ? null : aconf->passwd;
-	*user = BadPtr(aconf->user) ? null : aconf->user;
-	*classname = BadPtr(aconf->className) ? zero : aconf->className;
-	*port = (int) aconf->port;
-}
-
-/*
- * read_conf_files
- *
- * inputs       - cold start YES or NO
- * output       - none
- * side effects - read all conf files needed, ircd.conf kline.conf etc.
- */
-void
-read_conf_files(int cold)
-{
-	FBFILE *file;
-	const char *filename, *kfilename, *dfilename;	/* kline or conf filename */
-	const char *xfilename;
-	const char *resvfilename;
-
-	conf_fbfile_in = NULL;
-
-	filename = get_conf_name(CONF_TYPE);
-
-	/* We need to know the initial filename for the yyerror() to report
-	   FIXME: The full path is in conffilenamebuf first time since we
-	   dont know anything else
-
-	   - Gozem 2002-07-21 
-	 */
-	strlcpy(conffilebuf, filename, sizeof(conffilebuf));
-
-	if((conf_fbfile_in = fbopen(filename, "r")) == NULL)
-	{
-		if(cold)
-		{
-			ilog(L_CRIT, "Failed in reading configuration file %s", filename);
-			exit(-1);
-		}
-		else
-		{
-			sendto_realops_flags(UMODE_ALL, L_ALL,
-					     "Can't open file '%s' - aborting rehash!", filename);
-			return;
-		}
-	}
-
-	if(!cold)
-		clear_out_old_conf();
-
-	read_conf(conf_fbfile_in);
-	fbclose(conf_fbfile_in);
-
-	kfilename = get_conf_name(KLINE_TYPE);
-	if(irccmp(filename, kfilename))
-	{
-		if((file = fbopen(kfilename, "r")) == NULL)
-		{
-			if(cold)
-				ilog(L_ERROR, "Failed reading kline file %s", filename);
-			else
-				sendto_realops_flags(UMODE_ALL, L_ALL,
-						     "Can't open %s file klines could be missing!",
-						     kfilename);
-		}
-		else
-		{
-			parse_k_file(file);
-			fbclose(file);
-		}
-	}
-
-	dfilename = get_conf_name(DLINE_TYPE);
-	if(irccmp(filename, dfilename) && irccmp(kfilename, dfilename))
-	{
-		if((file = fbopen(dfilename, "r")) == NULL)
-		{
-			if(cold)
-				ilog(L_ERROR, "Failed reading dline file %s", dfilename);
-			else
-				sendto_realops_flags(UMODE_ALL, L_ALL,
-						     "Can't open %s file dlines could be missing!",
-						     dfilename);
-		}
-		else
-		{
-			parse_d_file(file);
-			fbclose(file);
-		}
-	}
-
-	xfilename = get_conf_name(XLINE_TYPE);
-	if(irccmp(filename, xfilename) && irccmp(kfilename, xfilename) &&
-	   irccmp(dfilename, xfilename))
-	{
-		if((file = fbopen(xfilename, "r")) == NULL)
-		{
-			if(cold)
-				ilog(L_ERROR, "Failed reading xline file %s", xfilename);
-			else
-				sendto_realops_flags(UMODE_ALL, L_ALL,
-						     "Can't open %s file xlines could be missing!",
-						     xfilename);
-		}
-		else
-		{
-			parse_x_file(file);
-			fbclose(file);
-		}
-	}
-
-	resvfilename = get_conf_name(RESV_TYPE);
-	if(irccmp(filename, resvfilename))
-	{
-		if((file = fbopen(resvfilename, "r")) == NULL)
-		{
-			if(cold)
-				ilog(L_ERROR, "Failed reading xline file %s", resvfilename);
-			else
-				sendto_realops_flags(UMODE_ALL, L_ALL,
-						     "Can't open %s file resvs could be missing!",
-						     resvfilename);
-		}
-		else
-		{
-			parse_resv_file(file);
-			fbclose(file);
-		}
-	}
-}
-
-/*
- * clear_out_old_conf
- *
- * inputs       - none
- * output       - none
- * side effects - Clear out the old configuration
- */
-static void
-clear_out_old_conf(void)
-{
-	struct ConfItem **tmp = &ConfigItemList;
-	struct ConfItem *tmp2;
-	struct Class *cltmp;
-
-	/*
-	 * We only need to free anything allocated by yyparse() here.
-	 * Reseting structs, etc, is taken care of by set_default_conf().
-	 */
-	while ((tmp2 = *tmp))
-	{
-		if(tmp2->clients)
-		{
-			/*
-			 ** Configuration entry is still in use by some
-			 ** local clients, cannot delete it--mark it so
-			 ** that it will be deleted when the last client
-			 ** exits...
-			 */
-			if(!(tmp2->status & CONF_CLIENT))
-			{
-				*tmp = tmp2->next;
-				tmp2->next = NULL;
-			}
-			else
-				tmp = &tmp2->next;
-			tmp2->status |= CONF_ILLEGAL;
-		}
-		else
-		{
-			*tmp = tmp2->next;
-			free_conf(tmp2);
-		}
-	}
-
-	/*
-	 * don't delete the class table, rather mark all entries
-	 * for deletion. The table is cleaned up by check_class. - avalon
-	 */
-	s_assert(ClassList != NULL);
-
-	for (cltmp = ClassList->next; cltmp; cltmp = cltmp->next)
-		MaxUsers(cltmp) = -1;
-
-	clear_out_address_conf();
-	clear_special_conf(&x_conf);
-	clear_special_conf(&u_conf);
-	clear_clusters();
-
-	/* clean out module paths */
-#ifndef STATIC_MODULES
-	mod_clear_paths();
-#endif
-
-	/* clean out ServerInfo */
-	MyFree(ServerInfo.description);
-	ServerInfo.description = NULL;
-	MyFree(ServerInfo.network_name);
-	ServerInfo.network_name = NULL;
-	MyFree(ServerInfo.network_desc);
-	ServerInfo.network_desc = NULL;
-#ifdef HAVE_LIBCRYPTO
-	if(ServerInfo.rsa_private_key != NULL)
-	{
-		RSA_free(ServerInfo.rsa_private_key);
-		ServerInfo.rsa_private_key = NULL;
-	}
-	if(ServerInfo.rsa_private_key_file != NULL)
-	{
-		MyFree(ServerInfo.rsa_private_key_file);
-		ServerInfo.rsa_private_key_file = NULL;
-	}
-#endif
-
-	/* clean out old resvs from the conf */
-	clear_resv();
-
-	/* clean out AdminInfo */
-	MyFree(AdminInfo.name);
-	AdminInfo.name = NULL;
-	MyFree(AdminInfo.email);
-	AdminInfo.email = NULL;
-	MyFree(AdminInfo.description);
-	AdminInfo.description = NULL;
-
-	/* operator{} and class{} blocks are freed above */
-	/* clean out listeners */
-	close_listeners();
-
-	/* auth{}, quarantine{}, shared{}, connect{}, kill{}, deny{}, exempt{}
-	 * and gecos{} blocks are freed above too
-	 */
-
-	/* clean out general */
-	MyFree(ConfigFileEntry.servlink_path);
-	ConfigFileEntry.servlink_path = NULL;
-#ifdef HAVE_LIBCRYPTO
-	ConfigFileEntry.default_cipher_preference = NULL;
-#endif /* HAVE_LIBCRYPTO */
-
-	/* OK, that should be everything... */
-}
-
-/*
- * flush_deleted_I_P
- *
- * inputs       - none
- * output       - none
- * side effects - This function removes I/P conf items
- */
-
-static void
-flush_deleted_I_P(void)
-{
-	struct ConfItem **tmp = &ConfigItemList;
-	struct ConfItem *tmp2;
-
-	/*
-	 * flush out deleted I and P lines although still in use.
-	 */
-	for (tmp = &ConfigItemList; (tmp2 = *tmp);)
-	{
-		if(!(tmp2->status & CONF_ILLEGAL))
-			tmp = &tmp2->next;
-		else
-		{
-			*tmp = tmp2->next;
-			tmp2->next = NULL;
-			if(!tmp2->clients)
-				free_conf(tmp2);
-		}
-	}
-}
-
-/* write_confitem()
- *
- * inputs       - kline, dline or xline type flag
- *              - client pointer to report to
- *              - user name of target
- *              - host name of target
- *              - reason for target
- *              - time string
- *              - type of xline
- * output       - NONE
- * side effects - This function takes care of finding the right conf
- *                file and adding the line to it, as well as notifying
- *                opers and the user.
- */
-void
-write_confitem(KlineType type, struct Client *source_p, char *user, char *host,
-	       const char *reason, const char *oper_reason, const char *current_date, int xtype)
-{
-	char buffer[1024];
-	FBFILE *out;
-	const char *filename;	/* filename to use for kline */
-
-	filename = get_conf_name(type);
-
-
-	if((out = fbopen(filename, "a")) == NULL)
-	{
-		sendto_realops_flags(UMODE_ALL, L_ALL, "*** Problem opening %s ", filename);
-		return;
-	}
-
-	if(oper_reason == NULL)
-		oper_reason = "";
-
-	if(type == KLINE_TYPE)
-	{
-		ircsprintf(buffer, "\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%ld\n",
-			   user, host, reason, oper_reason, current_date,
-			   get_oper_name(source_p), CurrentTime);
-	}
-	else if(type == DLINE_TYPE)
-	{
-		ircsprintf(buffer, "\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%ld\n",
-			   host, reason, oper_reason, current_date,
-			   get_oper_name(source_p), CurrentTime);
-	}
-	else if(type == XLINE_TYPE)
-	{
-		ircsprintf(buffer, "\"%s\",\"%d\",\"%s\",\"%s\",%lu\n",
-			   host, xtype, reason, get_oper_name(source_p), CurrentTime);
-	}
-	else if(type == RESV_TYPE)
-	{
-		ircsprintf(buffer, "\"%s\",\"%s\",\"%s\",%lu\n",
-			   host, reason, get_oper_name(source_p), CurrentTime);
-	}
-
-	if(fbputs(buffer, out) == -1)
-	{
-		sendto_realops_flags(UMODE_ALL, L_ALL, "*** Problem writing to %s", filename);
-		fbclose(out);
-		return;
-	}
-
-	fbclose(out);
-
-	if(type == KLINE_TYPE)
-	{
-		if(BadPtr(oper_reason))
-		{
-			sendto_realops_flags(UMODE_ALL, L_ALL,
-					     "%s added K-Line for [%s@%s] [%s]",
-					     get_oper_name(source_p), user, host, reason);
-			ilog(L_TRACE, "%s added K-Line for [%s@%s] [%s]",
-			     source_p->name, user, host, reason);
-		}
-		else
-		{
-			sendto_realops_flags(UMODE_ALL, L_ALL,
-					     "%s added K-Line for [%s@%s] [%s|%s]",
-					     get_oper_name(source_p), user, host,
-					     reason, oper_reason);
-			ilog(L_TRACE, "%s added K-Line for [%s@%s] [%s|%s]",
-			     source_p->name, user, host, reason, oper_reason);
-		}
-
-		sendto_one(source_p, ":%s NOTICE %s :Added K-Line [%s@%s]",
-			   me.name, source_p->name, user, host);
-	}
-	else if(type == DLINE_TYPE)
-	{
-		if(BadPtr(oper_reason))
-		{
-			sendto_realops_flags(UMODE_ALL, L_ALL,
-					     "%s added D-Line for [%s] [%s]",
-					     get_oper_name(source_p), host, reason);
-			ilog(L_TRACE, "%s added D-Line for [%s] [%s]",
-			     get_oper_name(source_p), host, reason);
-		}
-		else
-		{
-			sendto_realops_flags(UMODE_ALL, L_ALL,
-					     "%s added D-Line for [%s] [%s|%s]",
-					     get_oper_name(source_p), host, reason, oper_reason);
-			ilog(L_TRACE, "%s added D-Line for [%s] [%s|%s]",
-			     get_oper_name(source_p), host, reason, oper_reason);
-		}
-
-		sendto_one(source_p, ":%s NOTICE %s :Added D-Line [%s] to %s",
-			   me.name, source_p->name, host, filename);
-
-	}
-	else if(type == XLINE_TYPE)
-	{
-		sendto_realops_flags(UMODE_ALL, L_ALL, "%s added X-Line for [%s] [%s]",
-				     get_oper_name(source_p), host, reason);
-		ilog(L_TRACE, "%s added X-line for [%s] [%s]", source_p->name, host, reason);
-
-		sendto_one(source_p, ":%s NOTICE %s :Added X-Line for [%s] [%s]",
-			   me.name, source_p->name, host, reason);
-	}
-	else if(type == RESV_TYPE)
-	{
-		sendto_realops_flags(UMODE_ALL, L_ALL, "%s added RESV for [%s] [%s]",
-				     get_oper_name(source_p), host, reason);
-		ilog(L_TRACE, "%s added RESV for [%s] [%s]", source_p->name, host, reason);
-
-		sendto_one(source_p, ":%s NOTICE %s :Added RESV for [%s] [%s]",
-			   me.name, source_p->name, host, reason);
-	}
-}
-
-/* get_conf_name
- *
- * inputs       - type of conf file to return name of file for
- * output       - pointer to filename for type of conf
- * side effects - none
- */
-const char *
-get_conf_name(KlineType type)
-{
-	if(type == CONF_TYPE)
-	{
-		return (ConfigFileEntry.configfile);
-	}
-	else if(type == DLINE_TYPE)
-	{
-		return (ConfigFileEntry.dlinefile);
-	}
-	else if(type == XLINE_TYPE)
-	{
-		return (ConfigFileEntry.xlinefile);
-	}
-	else if(type == RESV_TYPE)
-	{
-		return (ConfigFileEntry.resvfile);
-	}
-
-	return ConfigFileEntry.klinefile;
-}
-
-/*
- * conf_add_class_to_conf
- * inputs       - pointer to config item
- * output       - NONE
- * side effects - Add a class pointer to a conf 
- */
-
-void
-conf_add_class_to_conf(struct ConfItem *aconf)
-{
-	if(aconf->className == NULL)
-	{
-		DupString(aconf->className, "default");
-		ClassPtr(aconf) = class0;
-		return;
-	}
-
-	ClassPtr(aconf) = find_class(aconf->className);
-
-	if(ClassPtr(aconf) == class0)
-	{
-		if(aconf->status == CONF_CLIENT)
-		{
-			sendto_realops_flags(UMODE_ALL, L_ALL,
-					     "Warning -- Using default class for missing class \"%s\" in auth{} for %s@%s",
-					     aconf->className, aconf->user, aconf->host);
-		}
-		else if(aconf->status == CONF_SERVER || aconf->status == CONF_OPERATOR)
-		{
-			sendto_realops_flags(UMODE_ALL, L_ALL,
-					     "Warning -- Using default class for missing class \"%s\" in %s{} for %s",
-					     aconf->className,
-					     aconf->status == CONF_SERVER ? "connect" : "operator",
-					     aconf->name);
-		}
-
-		MyFree(aconf->className);
-		DupString(aconf->className, "default");
-		return;
-	}
-
-	if(ConfMaxUsers(aconf) < 0)
-	{
-		ClassPtr(aconf) = find_class(0);
-		MyFree(aconf->className);
-		DupString(aconf->className, "default");
-		return;
-	}
-}
-
-#define MAXCONFLINKS 150
-
-/*
- * conf_add_server
- *
- * inputs       - pointer to config item
- *		- pointer to link count already on this conf
- * output       - NONE
- * side effects - Add a connect block
- */
-int
-conf_add_server(struct ConfItem *aconf, int lcount)
-{
-	conf_add_class_to_conf(aconf);
-
-	if(lcount > MAXCONFLINKS || !aconf->host || !aconf->name)
-	{
-		sendto_realops_flags(UMODE_ALL, L_ALL, "Bad connect block");
-		ilog(L_WARN, "Bad connect block");
-		return (-1);
-	}
-
-	if(BadPtr(aconf->passwd) && !(aconf->flags & CONF_FLAGS_CRYPTLINK))
-	{
-		sendto_realops_flags(UMODE_ALL, L_ALL, "Bad connect block, name %s", aconf->name);
-		ilog(L_WARN, "Bad connect block, host %s", aconf->name);
-		return (-1);
-	}
-
-	if(SplitUserHost(aconf) < 0)
-	{
-		sendto_realops_flags(UMODE_ALL, L_ALL, "Bad connect block, name %s", aconf->name);
-		ilog(L_WARN, "Bad connect block, name %s", aconf->name);
-		return (-1);
-	}
-	lookup_confhost(aconf);
-	return (0);
-}
-
-/*
- * conf_add_d_conf
- * inputs       - pointer to config item
- * output       - NONE
- * side effects - Add a d/D line
- */
-void
-conf_add_d_conf(struct ConfItem *aconf)
-{
-	if(aconf->host == NULL)
-		return;
-
-	aconf->user = NULL;
-
-	/* XXX - Should 'd' ever be in the old conf? For new conf we don't
-	 *       need this anyway, so I will disable it for now... -A1kmm
-	 */
-
-	if(parse_netmask(aconf->host, NULL, NULL) == HM_HOST)
-	{
-		ilog(L_WARN, "Invalid Dline %s ignored", aconf->host);
-		free_conf(aconf);
-	}
-	else
-	{
-		add_conf_by_address(aconf->host, CONF_DLINE, NULL, aconf);
-	}
-}
-
-/*
- * conf_add_x_conf
- * inputs       - pointer to config item
- * output       - NONE
- * side effects - Add a X line
- */
-void
-conf_add_x_conf(struct ConfItem *aconf)
-{
-	MyFree(aconf->user);
-	aconf->user = NULL;
-	aconf->name = aconf->host;
-	aconf->host = NULL;
-	aconf->next = x_conf;
-	x_conf = aconf;
-}
-
-/* conf_add_u_conf()
- * 
- * inputs       - pointer to config item
- * output       - NONE
- * side effects - Add an U line
- */
-void
-conf_add_u_conf(struct ConfItem *aconf)
-{
-	aconf->next = u_conf;
-	u_conf = aconf;
-}
-
-
-/*
- * conf_add_fields
- * inputs       - pointer to config item
- *              - pointer to host_field
- *		- pointer to pass_field
- *              - pointer to user_field
- *              - pointer to port_field
- *		- pointer to class_field
- * output       - NONE
- * side effects - update host/pass/user/port fields of given aconf
- */
-
-void
-conf_add_fields(struct ConfItem *aconf,
-		const char *host_field,
-		const char *pass_field, const char *user_field, const char *port_field, const char *class_field)
-{
-	if(host_field != NULL)
-		DupString(aconf->host, host_field);
-	if(pass_field != NULL)
-		DupString(aconf->passwd, pass_field);
-	if(user_field != NULL)
-		DupString(aconf->user, user_field);
-	if(port_field != NULL)
-		aconf->port = atoi(port_field);
-	if(class_field != NULL)
-		DupString(aconf->className, class_field);
-}
-
-/*
- * yyerror
- *
- * inputs	- message from parser
- * output	- none
- * side effects	- message to opers and log file entry is made
- */
-void
-yyerror(const char *msg)
-{
-	char newlinebuf[BUFSIZE];
-
-	strip_tabs(newlinebuf, (const unsigned char *) linebuf, strlen(linebuf));
-
-	sendto_realops_flags(UMODE_ALL, L_ALL, "\"%s\", line %d: %s at '%s'",
-			     conffilebuf, lineno + 1, msg, newlinebuf);
-
-	ilog(L_WARN, "\"%s\", line %d: %s at '%s'", conffilebuf, lineno + 1, msg, newlinebuf);
-}
-
-int
-conf_fbgets(char *lbuf, int max_size, FBFILE * fb)
-{
-	char *buff;
-
-	if((buff = fbgets(lbuf, max_size, fb)) == NULL)
-		return (0);
-
-	return (strlen(lbuf));
-}
-
-int
-conf_yy_fatal_error(const char *msg)
-{
-	return (0);
-}
-
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/s_serv.c ircd-ratbox-1.2-3/src/s_serv.c
--- ircd-ratbox-1.2-3+ipmask/src/s_serv.c	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/src/s_serv.c	Sat Sep  6 08:57:51 2003
@@ -98,7 +98,6 @@
 	{ "UNKLN",	CAP_UNKLN },
 	{ "CLUSTER",	CAP_CLUSTER },
 	{ "ENCAP",	CAP_ENCAP },
-	{ "IPMASK", CAP_IPMASK },
 	{ 0, 		0 }
 };
 
@@ -801,23 +800,21 @@
 	}
 
 	if(HasID(target_p) && IsCapable(client_p, CAP_UID))
-		sendto_one(client_p, "CLIENT %s %d %lu %s %s %s %s %s %s :%s",
+		sendto_one(client_p, "CLIENT %s %d %lu %s %s %s %s %s :%s",
 			   target_p->name,
 			   target_p->hopcount + 1,
 			   (unsigned long) target_p->tsinfo,
 			   ubuf,
 			   target_p->username, target_p->host,
-			   target_p->user->server, target_p->user->id,
-               IsCapable (client_p, CAP_IPMASK)? target_p->rhost : "", target_p->info);
+			   target_p->user->server, target_p->user->id, target_p->info);
 	else
-		sendto_one(client_p, "NICK %s %d %lu %s %s %s %s %s :%s",
+		sendto_one(client_p, "NICK %s %d %lu %s %s %s %s :%s",
 			   target_p->name,
 			   target_p->hopcount + 1,
 			   (unsigned long) target_p->tsinfo,
 			   ubuf,
 			   target_p->username, target_p->host,
-			   target_p->user->server,
-               IsCapable (client_p, CAP_IPMASK)? target_p->rhost : "", target_p->info);
+			   target_p->user->server, target_p->info);
 }
 
 /*
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/s_serv.c.orig ircd-ratbox-1.2-3/src/s_serv.c.orig
--- ircd-ratbox-1.2-3+ipmask/src/s_serv.c.orig	Sat Sep  6 08:57:51 2003
+++ ircd-ratbox-1.2-3/src/s_serv.c.orig	Wed Dec 31 17:00:00 1969
@@ -1,2017 +0,0 @@
-/*
- *  ircd-ratbox: A slightly useful ircd.
- *  s_serv.c: Server related functions.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002 ircd-ratbox development team
- *
- *  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: s_serv.c,v 7.333.2.3 2003/09/06 15:57:51 leeh Exp $
- */
-
-#include "stdinc.h"
-
-#ifdef HAVE_LIBCRYPTO
-#include <openssl/rsa.h>
-#include "rsa.h"
-#endif
-
-#include "tools.h"
-#include "s_serv.h"
-#include "channel_mode.h"
-#include "class.h"
-#include "client.h"
-#include "common.h"
-#include "event.h"
-#include "fdlist.h"
-#include "hash.h"
-#include "md5.h"
-#include "irc_string.h"
-#include "sprintf_irc.h"
-#include "ircd.h"
-#include "ircd_defs.h"
-#include "numeric.h"
-#include "packet.h"
-#include "res.h"
-#include "s_bsd.h"
-#include "s_conf.h"
-#include "s_log.h"
-#include "s_stats.h"
-#include "s_user.h"
-#include "scache.h"
-#include "send.h"
-#include "client.h"
-#include "s_debug.h"
-#include "memory.h"
-#include "channel.h"		/* chcap_usage_counts stuff... */
-#include "hook.h"
-
-extern char *crypt();
-
-#define MIN_CONN_FREQ 300
-
-#ifndef INADDR_NONE
-#define INADDR_NONE ((unsigned int) 0xffffffff)
-#endif
-
-int MaxConnectionCount = 1;
-int MaxClientCount = 1;
-int refresh_user_links = 0;
-
-static void start_io(struct Client *server);
-
-static SlinkRplHnd slink_error;
-static SlinkRplHnd slink_zipstats;
-/*
- * list of recognized server capabilities.  "TS" is not on the list
- * because all servers that we talk to already do TS, and the kludged
- * extra argument to "PASS" takes care of checking that.  -orabidoo
- */
-struct Capability captab[] = {
-	/* name		cap     */
-	{ "QS",		CAP_QS },
-	{ "EX",		CAP_EX },
-	{ "IE",		CAP_IE },
-	{ "CHW",	CAP_CHW },
-	{ "EOB",	CAP_EOB },
-	{ "KLN",	CAP_KLN },
-	{ "GLN",	CAP_GLN },
-	{ "KNOCK",	CAP_KNOCK },
-	{ "UID",	CAP_UID },
-	{ "ZIP",	CAP_ZIP },
-	{ "TB",		CAP_TB },
-	{ "UNKLN",	CAP_UNKLN },
-	{ "CLUSTER",	CAP_CLUSTER },
-	{ "ENCAP",	CAP_ENCAP },
-	{ 0, 		0 }
-};
-
-#ifdef HAVE_LIBCRYPTO
-struct EncCapability CipherTable[] = {
-#ifdef HAVE_EVP_BF_CFB
-	{"BF/256", CAP_ENC_BF_256, 32, CIPHER_BF},
-	{"BF/128", CAP_ENC_BF_128, 16, CIPHER_BF},
-#endif
-#ifdef HAVE_EVP_CAST5_CFB
-	{"CAST/128", CAP_ENC_CAST_128, 16, CIPHER_CAST},
-#endif
-#ifdef HAVE_EVP_IDEA_CFB
-	{"IDEA/128", CAP_ENC_IDEA_128, 16, CIPHER_IDEA},
-#endif
-#ifdef HAVE_EVP_RC5_32_12_16_CFB
-	{"RC5.16/128", CAP_ENC_RC5_16_128, 16, CIPHER_RC5_16},
-	{"RC5.12/128", CAP_ENC_RC5_12_128, 16, CIPHER_RC5_12},
-	{"RC5.8/128", CAP_ENC_RC5_8_128, 16, CIPHER_RC5_8},
-#endif
-#ifdef HAVE_EVP_DES_EDE3_CFB
-	{"3DES/168", CAP_ENC_3DES_168, 24, CIPHER_3DES},
-#endif
-#ifdef HAVE_EVP_DES_CFB
-	{"DES/56", CAP_ENC_DES_56, 8, CIPHER_DES},
-#endif
-
-	{0, 0, 0, 0}
-};
-#endif
-
-struct SlinkRplDef slinkrpltab[] = {
-	{SLINKRPL_ERROR, slink_error, SLINKRPL_FLAG_DATA},
-	{SLINKRPL_ZIPSTATS, slink_zipstats, SLINKRPL_FLAG_DATA},
-	{0, 0, 0},
-};
-
-unsigned long nextFreeMask();
-static unsigned long freeMask;
-static void server_burst(struct Client *client_p);
-#ifndef VMS
-static int fork_server(struct Client *client_p);
-#endif
-
-static CNCB serv_connect_callback;
-
-
-void
-slink_error(unsigned int rpl, unsigned int len, unsigned char *data, struct Client *server_p)
-{
-	s_assert(rpl == SLINKRPL_ERROR);
-
-	s_assert(len < 256);
-	data[len - 1] = '\0';
-
-	sendto_realops_flags(UMODE_ALL, L_ALL, "SlinkError for %s: %s", server_p->name, data);
-	exit_client(server_p, server_p, &me, "servlink error -- terminating link");
-}
-
-void
-slink_zipstats(unsigned int rpl, unsigned int len, unsigned char *data, struct Client *server_p)
-{
-	struct ZipStats zipstats;
-	unsigned long in = 0, in_wire = 0, out = 0, out_wire = 0;
-	int i = 0;
-
-	s_assert(rpl == SLINKRPL_ZIPSTATS);
-	s_assert(len == 16);
-	s_assert(IsCapable(server_p, CAP_ZIP));
-
-	/* Yes, it needs to be done this way, no we cannot let the compiler
-	 * work with the pointer to the structure.  This works around a GCC
-	 * bug on SPARC that affects all versions at the time of this writing.
-	 * I will feed you to the creatures living in RMS's beard if you do
-	 * not leave this as is, without being sure that you are not causing
-	 * regression for most of our installed SPARC base.
-	 * -jmallett, 04/27/2002
-	 */
-	memcpy(&zipstats, &server_p->localClient->zipstats, sizeof(struct ZipStats));
-
-	in |= (data[i++] << 24);
-	in |= (data[i++] << 16);
-	in |= (data[i++] << 8);
-	in |= (data[i++]);
-
-	in_wire |= (data[i++] << 24);
-	in_wire |= (data[i++] << 16);
-	in_wire |= (data[i++] << 8);
-	in_wire |= (data[i++]);
-
-	out |= (data[i++] << 24);
-	out |= (data[i++] << 16);
-	out |= (data[i++] << 8);
-	out |= (data[i++]);
-
-	out_wire |= (data[i++] << 24);
-	out_wire |= (data[i++] << 16);
-	out_wire |= (data[i++] << 8);
-	out_wire |= (data[i++]);
-
-	/* This macro adds b to a if a plus b is not an overflow, and sets the
-	 * value of a to b if it is.
-	 * Add and Set if No Overflow.
-	 */
-#define	ASNO(a,b)	\
-	a = (a + b >= a? a + b: b)
-
-	ASNO(zipstats.in, in);
-	ASNO(zipstats.out, out);
-	ASNO(zipstats.in_wire, in_wire);
-	ASNO(zipstats.out_wire, out_wire);
-
-	if(zipstats.in > 0)
-		zipstats.in_ratio = (((double) (zipstats.in - zipstats.in_wire) /
-				      (double) zipstats.in) * 100.00);
-	else
-		zipstats.in_ratio = 0;
-
-	if(zipstats.out > 0)
-		zipstats.out_ratio = (((double) (zipstats.out - zipstats.out_wire) /
-				       (double) zipstats.out) * 100.00);
-	else
-		zipstats.out_ratio = 0;
-
-	memcpy(&server_p->localClient->zipstats, &zipstats, sizeof(struct ZipStats));
-}
-
-void
-collect_zipstats(void *unused)
-{
-	dlink_node *ptr;
-	struct Client *target_p;
-
-	DLINK_FOREACH(ptr, serv_list.head)
-	{
-		target_p = ptr->data;
-		if(IsCapable(target_p, CAP_ZIP))
-		{
-			/* only bother if we haven't already got something queued... */
-			if(!target_p->localClient->slinkq)
-			{
-				target_p->localClient->slinkq = MyMalloc(1);	/* sigh.. */
-				target_p->localClient->slinkq[0] = SLINKCMD_ZIPSTATS;
-				target_p->localClient->slinkq_ofs = 0;
-				target_p->localClient->slinkq_len = 1;
-				send_queued_slink_write(target_p->localClient->ctrlfd, target_p);
-			}
-		}
-	}
-}
-
-
-#ifdef HAVE_LIBCRYPTO
-struct EncCapability *
-check_cipher(struct Client *client_p, struct ConfItem *aconf)
-{
-	struct EncCapability *epref;
-
-	/* Use connect{} specific info if available */
-	if(aconf->cipher_preference)
-		epref = aconf->cipher_preference;
-	else
-		epref = ConfigFileEntry.default_cipher_preference;
-
-	/*
-	 * If the server supports the capability in hand, return the matching
-	 * conf struct.  Otherwise, return NULL (an error).
-	 */
-	if(IsCapableEnc(client_p, epref->cap))
-		return (epref);
-
-	return (NULL);
-}
-#endif /* HAVE_LIBCRYPTO */
-
-/*
- * my_name_for_link - return wildcard name of my server name 
- * according to given config entry --Jto
- * XXX - this is only called with me.name as name
- */
-const char *
-my_name_for_link(const char *name, struct ConfItem *aconf)
-{
-	if(aconf->fakename)
-		return (aconf->fakename);
-	else
-		return (name);
-}
-
-/*
- * add_server_to_list()
- * input	- pointer to client
- * output	- none
- * side effects - server is added to global_serv_list
- */
-void
-add_server_to_list(struct Client *client_p)
-{
-	dlinkAddAlloc(client_p, &global_serv_list);
-}
-
-/*
- * remove_server_from_list()
- *
- * input	- pointer to client
- * output	- none
- * side effects	- server is removed from GlocalServerList
- */
-void
-remove_server_from_list(struct Client *client_p)
-{
-	dlinkFindDestroy(&global_serv_list, client_p);
-}
-
-/*
- * write_links_file
- */
-void
-write_links_file(void *notused)
-{
-	MessageFileLine *next_mptr = 0;
-	MessageFileLine *mptr = 0;
-	MessageFileLine *currentMessageLine = 0;
-	MessageFileLine *newMessageLine = 0;
-	MessageFile *MessageFileptr;
-	struct Client *target_p;
-	const char *p;
-	FBFILE *file;
-	char buff[512];
-	dlink_node *ptr;
-
-	refresh_user_links = 0;
-
-	MessageFileptr = &ConfigFileEntry.linksfile;
-
-	if((file = fbopen(MessageFileptr->fileName, "w")) == 0)
-		return;
-
-	for (mptr = MessageFileptr->contentsOfFile; mptr; mptr = next_mptr)
-	{
-		next_mptr = mptr->next;
-		MyFree(mptr);
-	}
-	MessageFileptr->contentsOfFile = NULL;
-	currentMessageLine = NULL;
-
-	DLINK_FOREACH(ptr, global_serv_list.head)
-	{
-		target_p = ptr->data;
-
-		/* skip ourselves, we send ourselves in /links */
-		if(IsMe(target_p))
-			continue;
-
-		/* skip hidden servers */
-		if(IsHidden(target_p) && !ConfigServerHide.disable_hidden)
-			continue;
-
-		if(target_p->info[0])
-			p = target_p->info;
-		else
-			p = "(Unknown Location)";
-
-		newMessageLine = (MessageFileLine *) MyMalloc(sizeof(MessageFileLine));
-
-		/* Attempt to format the file in such a way it follows the usual links output
-		 * ie  "servername uplink :hops info"
-		 * Mostly for aesthetic reasons - makes it look pretty in mIRC ;)
-		 * - madmax
-		 */
-
-		ircsprintf(newMessageLine->line, "%s %s :1 %s", target_p->name, me.name, p);
-		newMessageLine->next = (MessageFileLine *) NULL;
-
-		if(MessageFileptr->contentsOfFile)
-		{
-			if(currentMessageLine)
-				currentMessageLine->next = newMessageLine;
-			currentMessageLine = newMessageLine;
-		}
-		else
-		{
-			MessageFileptr->contentsOfFile = newMessageLine;
-			currentMessageLine = newMessageLine;
-		}
-
-		ircsprintf(buff, "%s %s :1 %s\n", target_p->name, me.name, p);
-		fbputs(buff, file);
-	}
-
-	fbclose(file);
-}
-
-
-/*
- * hunt_server - Do the basic thing in delivering the message (command)
- *      across the relays to the specific server (server) for
- *      actions.
- *
- *      Note:   The command is a format string and *MUST* be
- *              of prefixed style (e.g. ":%s COMMAND %s ...").
- *              Command can have only max 8 parameters.
- *
- *      server  parv[server] is the parameter identifying the
- *              target server.
- *
- *      *WARNING*
- *              parv[server] is replaced with the pointer to the
- *              real servername from the matched client (I'm lazy
- *              now --msa).
- *
- *      returns: (see #defines)
- */
-int
-hunt_server(struct Client *client_p, struct Client *source_p, const char *command,
-	    int server, int parc, char *parv[])
-{
-	struct Client *target_p;
-	int wilds;
-	dlink_node *ptr;
-	/*
-	 * Assume it's me, if no server
-	 */
-	if(parc <= server || BadPtr(parv[server]) ||
-	   match(me.name, parv[server]) || match(parv[server], me.name))
-		return (HUNTED_ISME);
-	/*
-	 * These are to pickup matches that would cause the following
-	 * message to go in the wrong direction while doing quick fast
-	 * non-matching lookups.
-	 */
-	if((target_p = find_client(parv[server])))
-		if(target_p->from == source_p->from && !MyConnect(target_p))
-			target_p = NULL;
-	if(!target_p && (target_p = find_server(parv[server])))
-		if(target_p->from == source_p->from && !MyConnect(target_p))
-			target_p = NULL;
-
-	collapse(parv[server]);
-	wilds = (strchr(parv[server], '?') || strchr(parv[server], '*'));
-
-	/*
-	 * Again, if there are no wild cards involved in the server
-	 * name, use the hash lookup
-	 */
-	if(!target_p)
-	{
-		if(!wilds)
-		{
-			if(!(target_p = find_server(parv[server])))
-			{
-				sendto_one(source_p, form_str(ERR_NOSUCHSERVER), me.name,
-					   parv[0], parv[server]);
-				return (HUNTED_NOSUCH);
-			}
-		}
-		else
-		{
-
-			DLINK_FOREACH(ptr, global_client_list.head)
-			{
-				target_p = NULL;
-				if(match(parv[server], ((struct Client *) (ptr->data))->name))
-				{
-					target_p = (struct Client *) ptr->data;
-					break;
-				}
-			}
-		}
-	}
-
-	if(target_p)
-	{
-		if(!IsRegistered(target_p))
-		{
-			sendto_one(source_p, form_str(ERR_NOSUCHSERVER), me.name,
-				   parv[0], parv[server]);
-			return HUNTED_NOSUCH;
-		}
-
-		if(IsMe(target_p) || MyClient(target_p))
-			return HUNTED_ISME;
-
-		if(!match(target_p->name, parv[server]))
-			parv[server] = target_p->name;
-
-		/* This is a little kludgy but should work... */
-		if(IsClient(source_p) &&
-		   ((MyConnect(target_p) && IsCapable(target_p, CAP_UID)) ||
-		    (!MyConnect(target_p) && IsCapable(target_p->from, CAP_UID))))
-			parv[0] = ID(source_p);
-
-		sendto_one(target_p, command, parv[0],
-			   parv[1], parv[2], parv[3], parv[4], parv[5], parv[6], parv[7], parv[8]);
-		return (HUNTED_PASS);
-	}
-
-	sendto_one(source_p, form_str(ERR_NOSUCHSERVER), me.name, parv[0], parv[server]);
-	return (HUNTED_NOSUCH);
-}
-
-/*
- * try_connections - scan through configuration and try new connections.
- * Returns the calendar time when the next call to this
- * function should be made latest. (No harm done if this
- * is called earlier or later...)
- */
-void
-try_connections(void *unused)
-{
-	struct ConfItem *aconf;
-	struct Client *client_p;
-	int connecting = FALSE;
-	int confrq;
-	time_t next = 0;
-	struct Class *cltmp;
-	struct ConfItem *con_conf = NULL;
-
-	Debug((DEBUG_NOTICE, "Connection check at: %s", myctime(CurrentTime)));
-
-	for (aconf = ConfigItemList; aconf; aconf = aconf->next)
-	{
-		/*
-		 * Also when already connecting! (update holdtimes) --SRB 
-		 */
-		if(!(aconf->status & CONF_SERVER) || aconf->port <= 0 ||
-		   !(aconf->flags & CONF_FLAGS_ALLOW_AUTO_CONN))
-			continue;
-		cltmp = ClassPtr(aconf);
-		/*
-		 * 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 >;) ]
-		 */
-		if(aconf->hold > CurrentTime)
-		{
-			if(next > aconf->hold || next == 0)
-				next = aconf->hold;
-			continue;
-		}
-
-		if((confrq = get_con_freq(cltmp)) < MIN_CONN_FREQ)
-			confrq = MIN_CONN_FREQ;
-
-		aconf->hold = CurrentTime + confrq;
-		/*
-		 * Found a CONNECT config with port specified, scan clients
-		 * and see if this server is already connected?
-		 */
-		client_p = find_server(aconf->name);
-
-		if(!client_p && (CurrUsers(cltmp) < MaxUsers(cltmp)) && !connecting)
-		{
-			con_conf = aconf;
-			/* We connect only one at time... */
-			connecting = TRUE;
-		}
-		if((next > aconf->hold) || (next == 0))
-			next = aconf->hold;
-	}
-
-
-	/* TODO: change this to set active flag to 0 when added to event! --Habeeb */
-	if(GlobalSetOptions.autoconn == 0)
-		return;
-
-	if(connecting)
-	{
-		if(con_conf->next)	/* are we already last? */
-		{
-			struct ConfItem **pconf;
-			for (pconf = &ConfigItemList; (aconf = *pconf); pconf = &(aconf->next))
-				/* 
-				 * put the current one at the end and
-				 * make sure we try all connections
-				 */
-				if(aconf == con_conf)
-					*pconf = aconf->next;
-			(*pconf = con_conf)->next = 0;
-		}
-
-		if(con_conf->flags & CONF_FLAGS_ALLOW_AUTO_CONN)
-		{
-			/*
-			 * We used to only print this if serv_connect() actually
-			 * suceeded, but since comm_tcp_connect() can call the callback
-			 * immediately if there is an error, we were getting error messages
-			 * in the wrong order. SO, we just print out the activated line,
-			 * and let serv_connect() / serv_connect_callback() print an
-			 * error afterwards if it fails.
-			 *   -- adrian
-			 */
-#ifndef HIDE_SERVERS_IPS
-			sendto_realops_flags(UMODE_ALL, L_ALL,
-					     "Connection to %s[%s] activated.",
-					     con_conf->name, con_conf->host);
-#else
-			sendto_realops_flags(UMODE_ALL, L_ALL,
-					     "Connection to %s activated.", con_conf->name);
-#endif
-
-			serv_connect(con_conf, 0);
-		}
-	}
-	Debug((DEBUG_NOTICE, "Next connection check : %s", myctime(next)));
-}
-
-int
-check_server(const char *name, struct Client *client_p, int cryptlink)
-{
-	struct ConfItem *aconf = NULL;
-	struct ConfItem *server_aconf = NULL;
-	int error = -1;
-
-	s_assert(NULL != client_p);
-
-	if(client_p == NULL)
-		return error;
-
-	if(!(client_p->localClient->passwd))
-		return -2;
-
-	if(strlen(name) > HOSTLEN)
-		return -4;
-
-	/* loop through looking for all possible connect items that might work */
-	for (aconf = ConfigItemList; aconf; aconf = aconf->next)
-	{
-		if((aconf->status & CONF_SERVER) == 0)
-			continue;
-
-		if(!match(name, aconf->name))
-			continue;
-
-		error = -3;
-
-		/* XXX: Fix me for IPv6 */
-		/* XXX sockhost is the IPv4 ip as a string */
-
-		if(match(aconf->host, client_p->host) ||
-		   match(aconf->host, client_p->localClient->sockhost))
-		{
-			error = -2;
-
-#ifdef HAVE_LIBCRYPTO
-			if(cryptlink && IsConfCryptLink(aconf))
-			{
-				if(aconf->rsa_public_key)
-					server_aconf = aconf;
-			}
-			else if(!(cryptlink || IsConfCryptLink(aconf)))
-#endif /* HAVE_LIBCRYPTO */
-			{
-				if(IsConfEncrypted(aconf))
-				{
-					if(strcmp(aconf->passwd,
-						  crypt(client_p->localClient->passwd,
-							aconf->passwd)) == 0)
-						server_aconf = aconf;
-				}
-				else
-				{
-					if(strcmp(aconf->passwd, client_p->localClient->passwd) ==
-					   0)
-						server_aconf = aconf;
-				}
-			}
-		}
-	}
-
-	if(server_aconf == NULL)
-		return error;
-
-	attach_conf(client_p, server_aconf);
-
-	/* Now find all leaf or hub config items for this server */
-	for (aconf = ConfigItemList; aconf; aconf = aconf->next)
-	{
-		if((aconf->status & (CONF_HUB | CONF_LEAF)) == 0)
-			continue;
-
-		if(!match(name, aconf->name))
-			continue;
-
-		attach_conf(client_p, aconf);
-	}
-
-#ifdef HAVE_LIBZ		/* otherwise, cleait unconditionally */
-	if(!(server_aconf->flags & CONF_FLAGS_COMPRESSED))
-#endif
-		ClearCap(client_p, CAP_ZIP);
-	if(!(server_aconf->flags & CONF_FLAGS_CRYPTLINK))
-		ClearCap(client_p, CAP_ENC);
-
-	if(!IsConfTburst(server_aconf))
-		ClearCap(client_p, CAP_TB);
-
-	if(aconf != NULL)
-	{
-#ifdef IPV6
-		if(IN6_IS_ADDR_UNSPECIFIED((struct in6_addr *) &IN_ADDR(aconf->ipnum)))
-#else
-		if(IN_ADDR(aconf->ipnum) == INADDR_NONE)
-#endif
-			copy_s_addr(IN_ADDR(aconf->ipnum), IN_ADDR(client_p->localClient->ip));
-	}
-	return 0;
-}
-
-/*
- * send_capabilities
- *
- * inputs	- Client pointer to send to
- *		- int flag of capabilities that this server has
- * output	- NONE
- * side effects	- send the CAPAB line to a server  -orabidoo
- *
- */
-void
-send_capabilities(struct Client *client_p, struct ConfItem *aconf,
-		  int cap_can_send, int enc_can_send)
-{
-	struct Capability *cap;
-	char msgbuf[BUFSIZE];
-	char *t;
-	int tl;
-
-#ifdef HAVE_LIBCRYPTO
-	struct EncCapability *epref;
-	char *capend;
-	int sent_cipher = 0;
-#endif
-
-	t = msgbuf;
-
-	for (cap = captab; cap->name; ++cap)
-	{
-		if(cap->cap & cap_can_send)
-		{
-			tl = ircsprintf(t, "%s ", cap->name);
-			t += tl;
-		}
-	}
-
-#ifdef HAVE_LIBCRYPTO
-	if(enc_can_send)
-	{
-		capend = t;
-		strcpy(t, "ENC:");
-		t += 4;
-
-		/* use connect{} specific info if available */
-		if(aconf->cipher_preference)
-			epref = aconf->cipher_preference;
-		else
-			epref = ConfigFileEntry.default_cipher_preference;
-
-		if((epref->cap & enc_can_send))
-		{
-			/* Leave the space -- it is removed later. */
-			tl = ircsprintf(t, "%s ", epref->name);
-			t += tl;
-			sent_cipher = 1;
-		}
-
-		if(!sent_cipher)
-			t = capend;	/* truncate string before ENC:, below */
-	}
-#endif
-
-	t--;
-	*t = '\0';
-	sendto_one(client_p, "CAPAB :%s", msgbuf);
-}
-
-
-/*
- * sendnick_TS
- * 
- * inputs	- client (server) to send nick towards
- * 		- client to send nick for
- * output	- NONE
- * side effects	- NICK message is sent towards given client_p
- */
-void
-sendnick_TS(struct Client *client_p, struct Client *target_p)
-{
-	static char ubuf[12];
-
-	if(!IsPerson(target_p))
-		return;
-
-	send_umode(NULL, target_p, 0, SEND_UMODES, ubuf);
-	if(!*ubuf)
-	{
-		ubuf[0] = '+';
-		ubuf[1] = '\0';
-	}
-
-	if(HasID(target_p) && IsCapable(client_p, CAP_UID))
-		sendto_one(client_p, "CLIENT %s %d %lu %s %s %s %s %s :%s",
-			   target_p->name,
-			   target_p->hopcount + 1,
-			   (unsigned long) target_p->tsinfo,
-			   ubuf,
-			   target_p->username, target_p->host,
-			   target_p->user->server, target_p->user->id, target_p->info);
-	else
-		sendto_one(client_p, "NICK %s %d %lu %s %s %s %s :%s",
-			   target_p->name,
-			   target_p->hopcount + 1,
-			   (unsigned long) target_p->tsinfo,
-			   ubuf,
-			   target_p->username, target_p->host,
-			   target_p->user->server, target_p->info);
-}
-
-/*
- * show_capabilities - show current server capabilities
- *
- * inputs       - pointer to an struct Client
- * output       - pointer to static string
- * side effects - build up string representing capabilities of server listed
- */
-
-const char *
-show_capabilities(struct Client *target_p)
-{
-	static char msgbuf[BUFSIZE];
-	struct Capability *cap;
-	char *t;
-	int tl;
-
-	t = msgbuf;
-	tl = ircsprintf(msgbuf, "TS ");
-	t += tl;
-
-	if(!target_p->localClient->caps)	/* short circuit if no caps */
-	{
-		msgbuf[2] = '\0';
-		return msgbuf;
-	}
-
-	for (cap = captab; cap->cap; ++cap)
-	{
-		if(cap->cap & target_p->localClient->caps)
-		{
-			tl = ircsprintf(t, "%s ", cap->name);
-			t += tl;
-		}
-	}
-
-#ifdef HAVE_LIBCRYPTO
-	if(IsCapable(target_p, CAP_ENC) &&
-	   target_p->localClient->in_cipher && target_p->localClient->out_cipher)
-	{
-		tl = ircsprintf(t, "ENC:%s ", target_p->localClient->in_cipher->name);
-		t += tl;
-	}
-#endif
-
-	t--;
-	*t = '\0';
-
-	return msgbuf;
-}
-
-/*
- * server_estab
- *
- * inputs       - pointer to a struct Client
- * output       -
- * side effects -
- */
-
-int
-server_estab(struct Client *client_p)
-{
-	struct Client *target_p;
-	struct ConfItem *aconf;
-	const char *inpath;
-	static char inpath_ip[HOSTLEN * 2 + USERLEN + 5];
-	char *host;
-	dlink_node *ptr;
-	dlink_node *cptr;
-	int opt = 1;
-
-	s_assert(NULL != client_p);
-	if(client_p == NULL)
-		return -1;
-	ClearAccess(client_p);
-
-	strcpy(inpath_ip, get_client_name(client_p, SHOW_IP));
-	inpath = get_client_name(client_p, MASK_IP);	/* "refresh" inpath with host */
-	host = client_p->name;
-
-	if(!(aconf = find_conf_name(&client_p->localClient->confs, host, CONF_SERVER)))
-	{
-		/* This shouldn't happen, better tell the ops... -A1kmm */
-		sendto_realops_flags(UMODE_ALL, L_ALL, "Warning: Lost connect{} block "
-				     "for server %s(this shouldn't happen)!", host);
-		return exit_client(client_p, client_p, client_p, "Lost connect{} block!");
-	}
-	/* We shouldn't have to check this, it should already done before
-	 * server_estab is called. -A1kmm
-	 */
-	memset((void *) client_p->localClient->passwd, 0, sizeof(client_p->localClient->passwd));
-
-	/* Its got identd , since its a server */
-	SetGotId(client_p);
-
-	/* If there is something in the serv_list, it might be this
-	 * connecting server..
-	 */
-	if(!ServerInfo.hub && serv_list.head)
-	{
-		if(client_p != serv_list.head->data || serv_list.head->next)
-		{
-			ServerStats->is_ref++;
-			sendto_one(client_p, "ERROR :I'm a leaf not a hub");
-			return exit_client(client_p, client_p, client_p, "I'm a leaf");
-		}
-	}
-
-	if(IsUnknown(client_p) && !IsConfCryptLink(aconf))
-	{
-		/*
-		 * jdc -- 1.  Use EmptyString(), not [0] index reference.
-		 *        2.  Check aconf->spasswd, not aconf->passwd.
-		 */
-		if(!EmptyString(aconf->spasswd))
-		{
-			sendto_one(client_p, "PASS %s :TS", aconf->spasswd);
-		}
-
-		/*
-		 * Pass my info to the new server
-		 *
-		 */
-
-		send_capabilities(client_p, aconf, default_server_capabs
-				  | (IsConfCompressed(aconf) ? CAP_ZIP_SUPPORTED : 0)
-				  | (IsConfTburst(aconf) ? CAP_TB : 0), 0);
-
-		setsockopt(client_p->localClient->fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
-		sendto_one(client_p, "SERVER %s 1 :%s%s",
-			   my_name_for_link(me.name, aconf),
-			   ConfigServerHide.hidden ? "(H) " : "",
-			   (me.info[0]) ? (me.info) : "IRCers United");
-		opt = 0;
-		setsockopt(client_p->localClient->fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
-
-	}
-
-	/*
-	 * XXX - this should be in s_bsd
-	 */
-	if(!set_sock_buffers(client_p->localClient->fd, READBUF_SIZE))
-		report_error(L_ALL, SETBUF_ERROR_MSG, get_client_name(client_p, SHOW_IP), errno);
-
-	/* Hand the server off to servlink now */
-
-#ifndef VMS
-	if(IsCapable(client_p, CAP_ENC) || IsCapable(client_p, CAP_ZIP))
-	{
-		if(fork_server(client_p) < 0)
-		{
-			sendto_realops_flags(UMODE_ALL, L_ADMIN,
-					     "Warning: fork failed for server %s -- check servlink_path (%s)",
-					     get_client_name(client_p, HIDE_IP),
-					     ConfigFileEntry.servlink_path);
-			sendto_realops_flags(UMODE_ALL, L_OPER, "Warning: fork failed for server "
-					     "%s -- check servlink_path (%s)",
-					     get_client_name(client_p, MASK_IP),
-					     ConfigFileEntry.servlink_path);
-			return exit_client(client_p, client_p, client_p, "Fork failed");
-		}
-		start_io(client_p);
-		SetServlink(client_p);
-	}
-#endif
-	sendto_one(client_p, "SVINFO %d %d 0 :%lu",
-		   TS_CURRENT, TS_MIN, (unsigned long) CurrentTime);
-
-	det_confs_butmask(client_p, CONF_LEAF | CONF_HUB | CONF_SERVER);
-	/*
-	 ** *WARNING*
-	 **    In the following code in place of plain server's
-	 **    name we send what is returned by get_client_name
-	 **    which may add the "sockhost" after the name. It's
-	 **    *very* *important* that there is a SPACE between
-	 **    the name and sockhost (if present). The receiving
-	 **    server will start the information field from this
-	 **    first blank and thus puts the sockhost into info.
-	 **    ...a bit tricky, but you have been warned, besides
-	 **    code is more neat this way...  --msa
-	 */
-	client_p->servptr = &me;
-
-	if(IsDead(client_p))
-		return CLIENT_EXITED;
-
-	SetServer(client_p);
-
-	/* Update the capability combination usage counts */
-	set_chcap_usage_counts(client_p);
-
-	dlinkAdd(client_p, &client_p->lnode, &me.serv->servers);
-
-	dlinkMoveNode(&client_p->localClient->tnode, &unknown_list, &serv_list);
-
-	Count.server++;
-	Count.myserver++;
-
-	add_server_to_list(client_p);
-	add_to_client_hash_table(client_p->name, client_p);
-	/* doesnt duplicate client_p->serv if allocated this struct already */
-	make_server(client_p);
-	client_p->serv->up = me.name;
-	/* add it to scache */
-	find_or_add(client_p->name);
-	client_p->firsttime = CurrentTime;
-	/* fixing eob timings.. -gnp */
-
-	/* Show the real host/IP to admins */
-	sendto_realops_flags(UMODE_ALL, L_ADMIN,
-			     "Link with %s established: (%s) link",
-#ifdef HIDE_SERVERS_IPS
-			     inpath,
-#else
-			     inpath_ip, 
-#endif
-			     show_capabilities(client_p));
-
-	/* Now show the masked hostname/IP to opers */
-	sendto_realops_flags(UMODE_ALL, L_OPER,
-			     "Link with %s established: (%s) link",
-			     inpath, show_capabilities(client_p));
-
-	ilog(L_NOTICE, "Link with %s established: (%s) link",
-	     log_client_name(client_p, SHOW_IP), show_capabilities(client_p));
-
-	client_p->serv->sconf = aconf;
-
-	if(HasServlink(client_p))
-	{
-		/* we won't overflow FD_DESC_SZ here, as it can hold
-		 * client_p->name + 64
-		 */
-#ifdef HAVE_SOCKETPAIR
-		fd_note(client_p->localClient->fd, "slink data: %s", client_p->name);
-		fd_note(client_p->localClient->ctrlfd, "slink ctrl: %s", client_p->name);
-#else
-		fd_note(client_p->localClient->fd, "slink data (out): %s", client_p->name);
-		fd_note(client_p->localClient->ctrlfd, "slink ctrl (out): %s", client_p->name);
-		fd_note(client_p->localClient->fd_r, "slink data  (in): %s", client_p->name);
-		fd_note(client_p->localClient->ctrlfd_r, "slink ctrl  (in): %s", client_p->name);
-#endif
-	}
-	else
-		fd_note(client_p->localClient->fd, "Server: %s", client_p->name);
-
-	/*
-	 ** Old sendto_serv_but_one() call removed because we now
-	 ** need to send different names to different servers
-	 ** (domain name matching) Send new server to other servers.
-	 */
-	DLINK_FOREACH(ptr, serv_list.head)
-	{
-		target_p = ptr->data;
-
-		if(target_p == client_p)
-			continue;
-
-		if((aconf = target_p->serv->sconf) &&
-		   match(my_name_for_link(me.name, aconf), client_p->name))
-			continue;
-		sendto_one(target_p, ":%s SERVER %s 2 :%s%s",
-			   me.name, client_p->name,
-			   IsHidden(client_p) ? "(H) " : "", client_p->info);
-	}
-
-	/*
-	 ** Pass on my client information to the new server
-	 **
-	 ** First, pass only servers (idea is that if the link gets
-	 ** cancelled beacause the server was already there,
-	 ** there are no NICK's to be cancelled...). Of course,
-	 ** if cancellation occurs, all this info is sent anyway,
-	 ** and I guess the link dies when a read is attempted...? --msa
-	 ** 
-	 ** Note: Link cancellation to occur at this point means
-	 ** that at least two servers from my fragment are building
-	 ** up connection this other fragment at the same time, it's
-	 ** a race condition, not the normal way of operation...
-	 **
-	 ** ALSO NOTE: using the get_client_name for server names--
-	 **    see previous *WARNING*!!! (Also, original inpath
-	 **    is destroyed...)
-	 */
-
-	aconf = client_p->serv->sconf;
-	DLINK_FOREACH(cptr, global_client_list.head)
-	{
-		target_p = (struct Client *) cptr->data;
-		/* target_p->from == target_p for target_p == client_p */
-		if(target_p->from == client_p)
-			continue;
-		if(IsServer(target_p))
-		{
-			if(match(my_name_for_link(me.name, aconf), target_p->name))
-				continue;
-			sendto_one(client_p, ":%s SERVER %s %d :%s%s",
-				   target_p->serv->up,
-				   target_p->name, target_p->hopcount + 1,
-				   IsHidden(target_p) ? "(H) " : "", target_p->info);
-		}
-	}
-
-	server_burst(client_p);
-
-	return 0;
-}
-
-static void
-start_io(struct Client *server)
-{
-	unsigned char *buf;
-	int c = 0;
-	int linecount = 0;
-	int linelen;
-
-	buf = MyMalloc(256);
-
-	if(IsCapable(server, CAP_ZIP))
-	{
-		/* ziplink */
-		buf[c++] = SLINKCMD_SET_ZIP_OUT_LEVEL;
-		buf[c++] = 0;	/* |          */
-		buf[c++] = 1;	/* \ len is 1 */
-		buf[c++] = ConfigFileEntry.compression_level;
-		buf[c++] = SLINKCMD_START_ZIP_IN;
-		buf[c++] = SLINKCMD_START_ZIP_OUT;
-	}
-#ifdef HAVE_LIBCRYPTO
-	if(IsCapable(server, CAP_ENC))
-	{
-		/* Decryption settings */
-		buf[c++] = SLINKCMD_SET_CRYPT_IN_CIPHER;
-		buf[c++] = 0;	/* /                     (upper 8-bits of len) */
-		buf[c++] = 1;	/* \ cipher id is 1 byte (lower 8-bits of len) */
-		buf[c++] = server->localClient->in_cipher->cipherid;
-		buf[c++] = SLINKCMD_SET_CRYPT_IN_KEY;
-		buf[c++] = 0;	/* keylen < 256 */
-		buf[c++] = server->localClient->in_cipher->keylen;
-		memcpy((buf + c), server->localClient->in_key,
-		       server->localClient->in_cipher->keylen);
-		c += server->localClient->in_cipher->keylen;
-		/* Encryption settings */
-		buf[c++] = SLINKCMD_SET_CRYPT_OUT_CIPHER;
-		buf[c++] = 0;	/* /                     (upper 8-bits of len) */
-		buf[c++] = 1;	/* \ cipher id is 1 byte (lower 8-bits of len) */
-		buf[c++] = server->localClient->out_cipher->cipherid;
-		buf[c++] = SLINKCMD_SET_CRYPT_OUT_KEY;
-		buf[c++] = 0;	/* keylen < 256 */
-		buf[c++] = server->localClient->out_cipher->keylen;
-		memcpy((buf + c), server->localClient->out_key,
-		       server->localClient->out_cipher->keylen);
-		c += server->localClient->out_cipher->keylen;
-		buf[c++] = SLINKCMD_START_CRYPT_IN;
-		buf[c++] = SLINKCMD_START_CRYPT_OUT;
-	}
-#endif
-
-	while (1)
-	{
-		linecount++;
-
-		buf = MyRealloc(buf, (c + READBUF_SIZE + 64));
-
-		/* store data in c+3 to allow for SLINKCMD_INJECT_RECVQ and len u16 */
-		linelen = linebuf_get(&server->localClient->buf_recvq, (char *) (buf + c + 3), READBUF_SIZE, LINEBUF_PARTIAL, LINEBUF_RAW);	/* include partial lines & don't
-																		   parse data */
-
-		if(linelen)
-		{
-			buf[c++] = SLINKCMD_INJECT_RECVQ;
-			buf[c++] = (linelen >> 8);
-			buf[c++] = (linelen & 0xff);
-			c += linelen;
-		}
-		else
-			break;
-	}
-
-	while (1)
-	{
-		linecount++;
-
-		buf = MyRealloc(buf, (c + BUF_DATA_SIZE + 64));
-
-		/* store data in c+3 to allow for SLINKCMD_INJECT_RECVQ and len u16 */
-		linelen = linebuf_get(&server->localClient->buf_sendq, (char *) (buf + c + 3), READBUF_SIZE, LINEBUF_PARTIAL, LINEBUF_PARSED);	/* include partial lines */
-
-		if(linelen)
-		{
-			buf[c++] = SLINKCMD_INJECT_SENDQ;
-			buf[c++] = (linelen >> 8);
-			buf[c++] = (linelen & 0xff);
-			c += linelen;
-		}
-		else
-			break;
-	}
-
-	/* start io */
-	buf[c++] = SLINKCMD_INIT;
-
-	server->localClient->slinkq = buf;
-	server->localClient->slinkq_ofs = 0;
-	server->localClient->slinkq_len = c;
-
-	/* schedule a write */
-	send_queued_slink_write(server->localClient->ctrlfd, server);
-}
-
-#ifndef VMS
-/*
- * fork_server
- *
- * inputs       - struct Client *server
- * output       - success: 0 / failure: -1
- * side effect  - fork, and exec SERVLINK to handle this connection
- */
-static int
-fork_server(struct Client *server)
-{
-	int ret;
-	int i;
-	int fd_temp[2];
-	int slink_fds[2][2][2] = { {{0, 0}, {0, 0}},
-	{{0, 0}, {0, 0}}
-	};
-	/* [0][y][z] - ctrl  | [1][y][z] - data  
-	 * [x][0][z] - child | [x][1][z] - parent
-	 * [x][y][0] - read  | [x][y][1] - write
-	 */
-	char fd_str[5][6];	/* store 5x '6' '5' '5' '3' '5' '\0' */
-	char *kid_argv[7];
-
-#ifdef HAVE_SOCKETPAIR
-	/* ctrl */
-	if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd_temp) < 0)
-		goto fork_error;
-
-	slink_fds[0][0][0] = fd_temp[0];
-	slink_fds[0][1][1] = fd_temp[1];
-	slink_fds[0][0][1] = fd_temp[0];
-	slink_fds[0][1][0] = fd_temp[1];
-
-	/* data */
-	if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd_temp) < 0)
-		goto fork_error;
-
-	slink_fds[1][0][0] = fd_temp[0];
-	slink_fds[1][1][1] = fd_temp[1];
-	slink_fds[1][0][1] = fd_temp[0];
-	slink_fds[1][1][0] = fd_temp[1];
-#else
-	/* ctrl parent -> child */
-	if(pipe(fd_temp) < 0)
-		goto fork_error;
-	slink_fds[0][0][0] = fd_temp[0];
-	slink_fds[0][1][1] = fd_temp[1];
-
-	/* ctrl child -> parent */
-	if(pipe(fd_temp) < 0)
-		goto fork_error;
-	slink_fds[0][1][0] = fd_temp[0];
-	slink_fds[0][0][1] = fd_temp[1];
-
-	/* data parent -> child */
-	if(pipe(fd_temp) < 0)
-		goto fork_error;
-	slink_fds[1][0][0] = fd_temp[0];
-	slink_fds[1][1][1] = fd_temp[1];
-
-	/* data child -> parent */
-	if(pipe(fd_temp) < 0)
-		goto fork_error;
-	slink_fds[1][1][0] = fd_temp[0];
-	slink_fds[1][0][1] = fd_temp[1];
-#endif
-#ifdef __CYGWIN__
-	if((ret = vfork()) < 0)
-#else
-	if((ret = fork()) < 0)
-#endif
-		goto fork_error;
-	else if(ret == 0)
-	{
-		/* set our fds as non blocking and close everything else */
-		for (i = 0; i < HARD_FDLIMIT; i++)
-		{
-
-			if((i == slink_fds[0][0][0]) || (i == slink_fds[0][0][1]) ||
-			   (i == slink_fds[0][0][0]) || (i == slink_fds[1][0][1]) ||
-			   (i == server->localClient->fd))
-			{
-				set_non_blocking(i);
-#ifdef USE_SIGIO		/* the servlink process doesn't need O_ASYNC */
-				{
-					int flags;
-					flags = fcntl(i, F_GETFL, 0);
-					flags |= ~O_ASYNC;
-					fcntl(i, F_SETFL, flags);
-				}
-#endif
-			}
-			else
-			{
-#if defined(VMS) || defined(__CYGWIN__)
-				if(i > 2)	/* don't close std* */
-#endif
-					close(i);
-			}
-		}
-
-		sprintf(fd_str[0], "%d", slink_fds[0][0][0]);	/* ctrl read */
-		sprintf(fd_str[1], "%d", slink_fds[0][0][1]);	/* ctrl write */
-		sprintf(fd_str[2], "%d", slink_fds[1][0][0]);	/* data read */
-		sprintf(fd_str[3], "%d", slink_fds[1][0][1]);	/* data write */
-		sprintf(fd_str[4], "%d", server->localClient->fd);	/* network read/write */
-
-		kid_argv[0] = (char *)"-slink"; /* XXX discards const!!! */
-		kid_argv[1] = fd_str[0];
-		kid_argv[2] = fd_str[1];
-		kid_argv[3] = fd_str[2];
-		kid_argv[4] = fd_str[3];
-		kid_argv[5] = fd_str[4];
-		kid_argv[6] = NULL;
-
-		/* exec servlink program */
-		execv(ConfigFileEntry.servlink_path, kid_argv);
-
-		/* We're still here, abort. */
-		_exit(1);
-	}
-	else
-	{
-		fd_close(server->localClient->fd);
-
-		/* close the childs end of the pipes */
-		close(slink_fds[0][0][0]);
-		close(slink_fds[0][0][1]);
-		close(slink_fds[1][0][0]);
-		close(slink_fds[1][0][1]);
-
-		s_assert(server->localClient);
-		server->localClient->ctrlfd = slink_fds[0][1][1];
-		server->localClient->fd = slink_fds[1][1][1];
-
-#ifndef HAVE_SOCKETPAIR
-		server->localClient->ctrlfd_r = slink_fds[0][1][0];
-		server->localClient->fd_r = slink_fds[1][1][0];
-#endif
-
-		if(!set_non_blocking(server->localClient->fd))
-		{
-			report_error(L_ADMIN, NONB_ERROR_MSG,
-#ifdef HIDE_SERVERS_IPS
-				     get_client_name(server, MASK_IP),
-#else
-				     get_client_name(server, SHOW_IP),
-#endif
-				     errno);
-			report_error(L_OPER, NONB_ERROR_MSG, get_client_name(server, MASK_IP),
-				     errno);
-		}
-
-		if(!set_non_blocking(server->localClient->ctrlfd))
-		{
-			report_error(L_ADMIN, NONB_ERROR_MSG,
-#ifdef HIDE_SERVERS_IPS
-				     get_client_name(server, MASK_IP),
-#else
-				     get_client_name(server, SHOW_IP),
-#endif
-				     errno);
-			report_error(L_OPER, NONB_ERROR_MSG,
-				     get_client_name(server, MASK_IP), errno);
-		}
-
-#ifndef HAVE_SOCKETPAIR
-		if(!set_non_blocking(server->localClient->fd_r))
-		{
-			report_error(L_ADMIN, NONB_ERROR_MSG,
-#ifdef HIDE_SERVERS_IPS
-				     get_client_name(server, MASK_IP),
-#else
-				     get_client_name(server, SHOW_IP),
-#endif
-				     errno);
-			report_error(L_OPER, NONB_ERROR_MSG,
-				     get_client_name(server, MASK_IP), errno);
-		}
-		if(!set_non_blocking(server->localClient->ctrlfd_r))
-		{
-			report_error(L_ADMIN, NONB_ERROR_MSG,
-#ifdef HIDE_SERVERS_IPS
-				     get_client_name(server, MASK_IP),
-#else
-				     get_client_name(server, SHOW_IP),
-#endif
-				     errno);
-			report_error(L_OPER, NONB_ERROR_MSG,
-				     get_client_name(server, MASK_IP), errno);
-		}
-#endif
-
-#ifdef HAVE_SOCKETPAIR
-		fd_open(server->localClient->ctrlfd, FD_SOCKET, NULL);
-		fd_open(server->localClient->fd, FD_SOCKET, NULL);
-#else
-		fd_open(server->localClient->ctrlfd, FD_PIPE, NULL);
-		fd_open(server->localClient->fd, FD_PIPE, NULL);
-		fd_open(server->localClient->ctrlfd_r, FD_PIPE, NULL);
-		fd_open(server->localClient->fd_r, FD_PIPE, NULL);
-#endif
-
-		read_ctrl_packet(slink_fds[0][1][0], server);
-		read_packet(slink_fds[1][1][0], server);
-	}
-
-	return 0;
-
-      fork_error:
-	/* this is ugly, but nicer than repeating
-	 * about 50 close() statements everywhre... */
-	close(slink_fds[0][0][0]);
-	close(slink_fds[0][0][1]);
-	close(slink_fds[0][1][0]);
-	close(slink_fds[0][1][1]);
-	close(slink_fds[1][0][0]);
-	close(slink_fds[1][0][1]);
-	close(slink_fds[1][1][0]);
-	close(slink_fds[1][1][1]);
-	return -1;
-}
-#endif
-
-/*
- * server_burst
- *
- * inputs       - struct Client pointer server
- *              -
- * output       - none
- * side effects - send a server burst
- * bugs		- still too long
- */
-static void
-server_burst(struct Client *client_p)
-{
-	struct Client *target_p;
-	struct Channel *chptr;
-	struct hook_burst_channel hinfo;
-	dlink_node *ptr;
-
-	/* first loop nicks then channels, it saves the remote server
-	 * introducing users to channels, then colliding them out of it
-	 */
-	DLINK_FOREACH(ptr, global_client_list.head)
-	{
-		target_p = ptr->data;
-		sendnick_TS(client_p, target_p);
-	}
-
-	DLINK_FOREACH(ptr, global_channel_list.head)
-	{
-		chptr = ptr->data;
-		if(dlink_list_length(&chptr->members) > 0)
-		{
-			send_channel_modes(client_p, chptr);
-			hinfo.chptr = chptr;
-			hinfo.client = client_p;
-			hook_call_event("burst_channel", &hinfo);
-		}
-	}
-
-	if(IsCapable(client_p, CAP_EOB))
-		sendto_one(client_p, ":%s EOB", me.name);
-
-	/* Always send a PING after connect burst is done */
-	sendto_one(client_p, "PING :%s", me.name);
-
-}
-
-/*
- * set_autoconn - set autoconnect mode
- *
- * inputs       - struct Client pointer to oper requesting change
- *              -
- * output       - none
- * side effects -
- */
-void
-set_autoconn(struct Client *source_p, char *parv0, char *name, int newval)
-{
-	struct ConfItem *aconf;
-
-	if(name && (aconf = find_conf_by_name(name, CONF_SERVER)))
-	{
-		if(newval)
-			aconf->flags |= CONF_FLAGS_ALLOW_AUTO_CONN;
-		else
-			aconf->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN;
-
-		sendto_realops_flags(UMODE_ALL, L_ALL,
-				     "%s has changed AUTOCONN for %s to %i", parv0, name, newval);
-		sendto_one(source_p,
-			   ":%s NOTICE %s :AUTOCONN for %s is now set to %i",
-			   me.name, parv0, name, newval);
-	}
-	else if(name)
-	{
-		sendto_one(source_p, ":%s NOTICE %s :Can't find %s", me.name, parv0, name);
-	}
-	else
-	{
-		sendto_one(source_p,
-			   ":%s NOTICE %s :Please specify a server name!", me.name, parv0);
-	}
-}
-
-
-void
-initServerMask(void)
-{
-	freeMask = 0xFFFFFFFFUL;
-}
-
-/*
- * nextFreeMask
- *
- * inputs	- NONE
- * output	- unsigned long next unused mask for use in LL
- * side effects	-
- */
-unsigned long
-nextFreeMask()
-{
-	int i;
-	unsigned long mask;
-
-	mask = 1;
-
-	for (i = 0; i < 32; i++)
-	{
-		if(mask & freeMask)
-		{
-			freeMask &= ~mask;
-			return (mask);
-		}
-		mask <<= 1;
-	}
-	return 0L;		/* watch this special case ... */
-}
-
-/*
- * New server connection code
- * Based upon the stuff floating about in s_bsd.c
- *   -- adrian
- */
-
-/*
- * serv_connect() - initiate a server connection
- *
- * inputs	- pointer to conf 
- *		- pointer to client doing the connet
- * output	-
- * side effects	-
- *
- * This code initiates a connection to a server. It first checks to make
- * sure the given server exists. If this is the case, it creates a socket,
- * creates a client, saves the socket information in the client, and
- * initiates a connection to the server through comm_connect_tcp(). The
- * completion of this goes through serv_completed_connection().
- *
- * We return 1 if the connection is attempted, since we don't know whether
- * it suceeded or not, and 0 if it fails in here somewhere.
- */
-int
-serv_connect(struct ConfItem *aconf, struct Client *by)
-{
-	struct Client *client_p;
-	int fd;
-	char buf[HOSTIPLEN];
-	/* Make sure aconf is useful */
-	s_assert(aconf != NULL);
-	if(aconf == NULL)
-		return 0;
-
-	/* log */
-	inetntop(DEF_FAM, &IN_ADDR(aconf->ipnum), buf, HOSTIPLEN);
-	ilog(L_NOTICE, "Connect to %s[%s] @%s", aconf->user, aconf->host, buf);
-
-	/*
-	 * Make sure this server isn't already connected
-	 * Note: aconf should ALWAYS be a valid C: line
-	 */
-	if((client_p = find_server(aconf->name)))
-	{
-		sendto_realops_flags(UMODE_ALL, L_ADMIN,
-				     "Server %s already present from %s",
-				     aconf->name, get_client_name(client_p, SHOW_IP));
-		sendto_realops_flags(UMODE_ALL, L_OPER,
-				     "Server %s already present from %s",
-				     aconf->name, get_client_name(client_p, MASK_IP));
-		if(by && IsPerson(by) && !MyClient(by))
-			sendto_one(by, ":%s NOTICE %s :Server %s already present from %s",
-				   me.name, by->name, aconf->name,
-				   get_client_name(client_p, MASK_IP));
-		return 0;
-	}
-
-	/* create a socket for the server connection */
-	if((fd = comm_open(DEF_FAM, SOCK_STREAM, 0, NULL)) < 0)
-	{
-		/* Eek, failure to create the socket */
-		report_error(L_ALL, "opening stream socket to %s: %s", aconf->name, errno);
-		return 0;
-	}
-
-	/* servernames are always guaranteed under HOSTLEN chars */
-	fd_note(fd, "Server: %s", aconf->name);
-
-	/* Create a local client */
-	client_p = make_client(NULL);
-
-	/* Copy in the server, hostname, fd */
-	strlcpy(client_p->name, aconf->name, sizeof(client_p->name));
-	strlcpy(client_p->host, aconf->host, sizeof(client_p->host));
-	inetntop(DEF_FAM, &IN_ADDR(aconf->ipnum), client_p->localClient->sockhost, HOSTIPLEN);
-	client_p->localClient->fd = fd;
-
-	/*
-	 * Set up the initial server evilness, ripped straight from
-	 * connect_server(), so don't blame me for it being evil.
-	 *   -- adrian
-	 */
-
-	if(!set_non_blocking(client_p->localClient->fd))
-	{
-		report_error(L_ADMIN, NONB_ERROR_MSG,
-#ifdef HIDE_SERVERS_IPS
-			     get_client_name(client_p, MASK_IP),
-#else
-			     get_client_name(client_p, SHOW_IP),
-#endif
-			     errno);
-		report_error(L_OPER, NONB_ERROR_MSG, get_client_name(client_p, MASK_IP), errno);
-	}
-
-	if(!set_sock_buffers(client_p->localClient->fd, READBUF_SIZE))
-	{
-		report_error(L_ADMIN, SETBUF_ERROR_MSG,
-#ifdef HIDE_SERVERS_IPS
-			     get_client_name(client_p, MASK_IP),
-#else
-			     get_client_name(client_p, SHOW_IP),
-#endif
-			     errno);
-		report_error(L_OPER, SETBUF_ERROR_MSG, get_client_name(client_p, MASK_IP), errno);
-	}
-
-	/*
-	 * Attach config entries to client here rather than in
-	 * serv_connect_callback(). This to avoid null pointer references.
-	 */
-	if(!attach_connect_block(client_p, aconf->name, aconf->host))
-	{
-		sendto_realops_flags(UMODE_ALL, L_ALL,
-				     "Host %s is not enabled for connecting:no C/N-line",
-				     aconf->name);
-		if(by && IsPerson(by) && !MyClient(by))
-			sendto_one(by, ":%s NOTICE %s :Connect to host %s failed.",
-				   me.name, by->name, client_p->name);
-		det_confs_butmask(client_p, 0);
-		free_client(client_p);
-		return 0;
-	}
-	/*
-	 * at this point we have a connection in progress and C/N lines
-	 * attached to the client, the socket info should be saved in the
-	 * client and it should either be resolved or have a valid address.
-	 *
-	 * The socket has been connected or connect is in progress.
-	 */
-	make_server(client_p);
-	if(by && IsPerson(by))
-	{
-		strcpy(client_p->serv->by, by->name);
-		if(client_p->serv->user)
-			free_user(client_p->serv->user, NULL);
-		client_p->serv->user = by->user;
-		by->user->refcnt++;
-	}
-	else
-	{
-		strcpy(client_p->serv->by, "AutoConn.");
-		if(client_p->serv->user)
-			free_user(client_p->serv->user, NULL);
-		client_p->serv->user = NULL;
-	}
-	client_p->serv->up = me.name;
-	SetConnecting(client_p);
-	add_client_to_list(client_p);
-	/* from def_fam */
-	client_p->localClient->aftype = aconf->aftype;
-
-	/* Now, initiate the connection */
-	if(IsConfVhosted(aconf))
-	{
-		struct irc_sockaddr ipn;
-		memset(&ipn, 0, sizeof(struct irc_sockaddr));
-		S_FAM(ipn) = aconf->aftype;
-		S_PORT(ipn) = 0;
-
-		copy_s_addr(S_ADDR(ipn), IN_ADDR(aconf->my_ipnum));
-
-		comm_connect_tcp(client_p->localClient->fd, aconf->host, aconf->port,
-				 (struct sockaddr *) &SOCKADDR(ipn), sizeof(struct irc_sockaddr),
-				 serv_connect_callback, client_p, aconf->aftype,
-				 ConfigFileEntry.connect_timeout);
-	}
-	else if((aconf->aftype == AF_INET) && ServerInfo.specific_ipv4_vhost)
-	{
-		struct irc_sockaddr ipn;
-		memset(&ipn, 0, sizeof(struct irc_sockaddr));
-		S_FAM(ipn) = DEF_FAM;
-		S_PORT(ipn) = 0;
-
-		copy_s_addr(S_ADDR(ipn), IN_ADDR(ServerInfo.ip));
-
-		comm_connect_tcp(client_p->localClient->fd, aconf->host, aconf->port,
-				 (struct sockaddr *) &SOCKADDR(ipn), sizeof(struct irc_sockaddr),
-				 serv_connect_callback, client_p, aconf->aftype,
-				 ConfigFileEntry.connect_timeout);
-	}
-#ifdef IPV6
-	else if((aconf->aftype == AF_INET6) && ServerInfo.specific_ipv6_vhost)
-	{
-		struct irc_sockaddr ipn;
-		memset(&ipn, 0, sizeof(struct irc_sockaddr));
-		S_FAM(ipn) = AF_INET6;
-		S_PORT(ipn) = 0;
-
-		copy_s_addr(S_ADDR(ipn), IN_ADDR(ServerInfo.ip6));
-
-		comm_connect_tcp(client_p->localClient->fd, aconf->host, aconf->port,
-				 (struct sockaddr *) &SOCKADDR(ipn), sizeof(struct irc_sockaddr),
-				 serv_connect_callback, client_p, aconf->aftype,
-				 ConfigFileEntry.connect_timeout);
-	}
-#endif
-	else
-	{
-		comm_connect_tcp(client_p->localClient->fd, aconf->host, aconf->port, NULL, 0,
-				 serv_connect_callback, client_p, aconf->aftype,
-				 ConfigFileEntry.connect_timeout);
-	}
-
-	return 1;
-}
-
-/*
- * serv_connect_callback() - complete a server connection.
- * 
- * This routine is called after the server connection attempt has
- * completed. If unsucessful, an error is sent to ops and the client
- * is closed. If sucessful, it goes through the initialisation/check
- * procedures, the capabilities are sent, and the socket is then
- * marked for reading.
- */
-static void
-serv_connect_callback(int fd, int status, void *data)
-{
-	struct Client *client_p = data;
-	struct ConfItem *aconf;
-
-	/* First, make sure its a real client! */
-	s_assert(client_p != NULL);
-	s_assert(client_p->localClient->fd == fd);
-
-	if(client_p == NULL)
-		return;
-
-	/* Next, for backward purposes, record the ip of the server */
-	copy_s_addr(IN_ADDR(client_p->localClient->ip), S_ADDR(fd_table[fd].connect.hostaddr));
-	/* Check the status */
-	if(status != COMM_OK)
-	{
-		/* We have an error, so report it and quit */
-		/* Admins get to see any IP, mere opers don't *sigh*
-		 */
-		sendto_realops_flags(UMODE_ALL, L_ADMIN,
-				     "Error connecting to %s[%s]: %s", client_p->name,
-#ifdef HIDE_SERVERS_IPS
-				     "255.255.255.255",
-#else
-				     client_p->host, 
-#endif
-				     comm_errstr(status));
-
-		sendto_realops_flags(UMODE_ALL, L_OPER,
-				     "Error connecting to %s: %s",
-				     client_p->name, comm_errstr(status));
-		exit_client(client_p, client_p, &me, comm_errstr(status));
-		return;
-	}
-
-	/* COMM_OK, so continue the connection procedure */
-	/* Get the C/N lines */
-	aconf = find_conf_name(&client_p->localClient->confs, client_p->name, CONF_SERVER);
-	if(!aconf)
-	{
-		sendto_realops_flags(UMODE_ALL, L_ADMIN, "Lost connect{} block for %s",
-#ifdef HIDE_SERVERS_IPS
-				     get_client_name(client_p, MASK_IP));
-#else
-				     get_client_name(client_p, HIDE_IP));
-#endif
-		sendto_realops_flags(UMODE_ALL, L_OPER,
-				     "Lost connect{} block for %s",
-				     get_client_name(client_p, MASK_IP));
-		exit_client(client_p, client_p, &me, "Lost connect{} block");
-		return;
-	}
-	/* Next, send the initial handshake */
-	SetHandshake(client_p);
-
-#ifdef HAVE_LIBCRYPTO
-	/* Handle all CRYPTLINK links in cryptlink_init */
-	if(IsConfCryptLink(aconf))
-	{
-		cryptlink_init(client_p, aconf, fd);
-		return;
-	}
-#endif
-
-	/*
-	 * jdc -- Check and send spasswd, not passwd.
-	 */
-	if(!EmptyString(aconf->spasswd))
-	{
-		sendto_one(client_p, "PASS %s :TS", aconf->spasswd);
-	}
-
-	/*
-	 * Pass my info to the new server
-	 *
-	 */
-
-	send_capabilities(client_p, aconf, default_server_capabs
-			  | (IsConfCompressed(aconf) ? CAP_ZIP_SUPPORTED : 0)
-			  | (IsConfTburst(aconf) ? CAP_TB : 0), 0);
-
-	sendto_one(client_p, "SERVER %s 1 :%s%s",
-		   my_name_for_link(me.name, aconf),
-		   ConfigServerHide.hidden ? "(H) " : "", me.info);
-
-	/* 
-	 * If we've been marked dead because a send failed, just exit
-	 * here now and save everyone the trouble of us ever existing.
-	 */
-	if(IsDead(client_p))
-	{
-		sendto_realops_flags(UMODE_ALL, L_ADMIN,
-				     "%s[%s] went dead during handshake",
-				     client_p->name,
-#ifdef HIDE_SERVERS_IPS
-				     client_p->host);
-#else
-				     "255.255.255.255");
-#endif
-		sendto_realops_flags(UMODE_ALL, L_OPER,
-				     "%s went dead during handshake", client_p->name);
-		exit_client(client_p, client_p, &me, "Went dead during handshake");
-		return;
-	}
-
-	/* don't move to serv_list yet -- we haven't sent a burst! */
-
-	/* If we get here, we're ok, so lets start reading some data */
-	comm_setselect(fd, FDLIST_SERVER, COMM_SELECT_READ, read_packet, client_p, 0);
-}
-
-#ifdef HAVE_LIBCRYPTO
-/*
- * sends a CRYPTLINK SERV command.
- */
-void
-cryptlink_init(struct Client *client_p, struct ConfItem *aconf, int fd)
-{
-	char *encrypted;
-	char *key_to_send;
-	char randkey[CIPHERKEYLEN];
-	int enc_len;
-
-	/* get key */
-	if((!ServerInfo.rsa_private_key) || (!RSA_check_key(ServerInfo.rsa_private_key)))
-	{
-		cryptlink_error(client_p, "SERV", "Invalid RSA private key",
-				"Invalid RSA private key");
-		return;
-	}
-
-	if(!aconf->rsa_public_key)
-	{
-		cryptlink_error(client_p, "SERV", "Invalid RSA public key",
-				"Invalid RSA public key");
-		return;
-	}
-
-	if(get_randomness((unsigned char *) randkey, CIPHERKEYLEN) != 1)
-	{
-		cryptlink_error(client_p, "SERV", "Couldn't generate keyphrase",
-				"Couldn't generate keyphrase");
-		return;
-	}
-
-	encrypted = MyMalloc(RSA_size(ServerInfo.rsa_private_key));
-
-	enc_len = RSA_public_encrypt(CIPHERKEYLEN,
-				     (unsigned char *) randkey,
-				     (unsigned char *) encrypted,
-				     aconf->rsa_public_key, RSA_PKCS1_PADDING);
-
-	memcpy(client_p->localClient->in_key, randkey, CIPHERKEYLEN);
-
-	if(enc_len <= 0)
-	{
-		report_crypto_errors();
-		MyFree(encrypted);
-		cryptlink_error(client_p, "SERV", "Couldn't encrypt data", "Couldn't encrypt data");
-		return;
-	}
-
-	if(!(base64_block(&key_to_send, encrypted, enc_len)))
-	{
-		MyFree(encrypted);
-		cryptlink_error(client_p, "SERV", "Couldn't base64 encode key",
-				"Couldn't base64 encode key");
-		return;
-	}
-
-
-	send_capabilities(client_p, aconf, default_server_capabs
-			  | (IsConfCompressed(aconf) ? CAP_ZIP_SUPPORTED : 0)
-			  | (IsConfTburst(aconf) ? CAP_TB : 0), CAP_ENC_MASK);
-
-	sendto_one(client_p, "CRYPTLINK SERV %s %s :%s%s",
-		   my_name_for_link(me.name, aconf), key_to_send,
-		   ConfigServerHide.hidden ? "(H) " : "", me.info);
-
-	SetHandshake(client_p);
-	SetWaitAuth(client_p);
-
-	MyFree(encrypted);
-	MyFree(key_to_send);
-
-	/*
-	 * If we've been marked dead because a send failed, just exit
-	 * here now and save everyone the trouble of us ever existing.
-	 */
-	if(IsDead(client_p))
-	{
-		cryptlink_error(client_p, "SERV", "Went dead during handshake",
-				"Went dead during handshake");
-		return;
-	}
-
-	/* If we get here, we're ok, so lets start reading some data */
-	if(fd > -1)
-	{
-		comm_setselect(fd, FDLIST_SERVER, COMM_SELECT_READ, read_packet, client_p, 0);
-	}
-}
-
-void
-cryptlink_error(struct Client *client_p, const char *type, const char *reason, const char *client_reason)
-{
-	sendto_realops_flags(UMODE_ALL, L_ADMIN, "%s: CRYPTLINK %s error - %s",
-#ifdef HIDE_SERVERS_IPS
-			     get_client_name(client_p, MASK_IP),
-#else
-			     get_client_name(client_p, SHOW_IP),
-#endif
-			     type, reason);
-	sendto_realops_flags(UMODE_ALL, L_OPER, "%s: CRYPTLINK %s error - %s",
-			     get_client_name(client_p, MASK_IP), type, reason);
-	ilog(L_ERROR, "%s: CRYPTLINK %s error - %s",
-	     log_client_name(client_p, SHOW_IP), type, reason);
-	/*
-	 * If client_reason isn't NULL, then exit the client with the message
-	 * defined in the call.
-	 */
-	if(client_reason != NULL)
-	{
-		exit_client(client_p, client_p, &me, client_reason);
-	}
-	return;
-}
-
-#endif /* HAVE_LIBCRYPTO */
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/s_user.c ircd-ratbox-1.2-3/src/s_user.c
--- ircd-ratbox-1.2-3+ipmask/src/s_user.c	Thu Nov 27 09:19:14 2003
+++ ircd-ratbox-1.2-3/src/s_user.c	Sat Jul 19 03:44:52 2003
@@ -62,7 +62,6 @@
 static int introduce_client(struct Client *client_p, struct Client *source_p,
 			    struct User *user, char *nick);
 int oper_up(struct Client *source_p, struct ConfItem *aconf);
-char *ret_maskip(struct Client *);
 
 extern char *crypt();
 
@@ -91,7 +90,6 @@
 	{UMODE_UNAUTH, 'u'},
 	{UMODE_WALLOP, 'w'},
 	{UMODE_EXTERNAL, 'x'},
-    {UMODE_IPMASK, 'X'},
 	{UMODE_SPY, 'y'},
 	{UMODE_OPERWALL, 'z'},
 	{UMODE_OPERSPY, 'Z'},
@@ -248,8 +246,6 @@
 	ircsprintf(isupportbuffer, FEATURES2, FEATURES2VALUES);
 	sendto_one(source_p, form_str(RPL_ISUPPORT), me.name, source_p->name, isupportbuffer);
 
-	sendto_one(source_p, ":%s 005 %s :This server utilizes IP masking.", me.name, source_p->name);
-
 	return;
 }
 
@@ -472,7 +468,7 @@
 		 ipaddr, HOSTIPLEN);
 	sendto_realops_flags(UMODE_CCONN, L_ALL,
 			     "Client connecting: %s (%s@%s) [%s] {%s} [%s]",
-			     nick, source_p->username, source_p->rhost,
+			     nick, source_p->username, source_p->host,
 #ifdef HIDE_SPOOF_IPS
 			     IsIPSpoof(source_p) ? "255.255.255.255" :
 #endif
@@ -642,22 +638,21 @@
 			continue;
 
 		if(IsCapable(server, CAP_UID) && HasID(source_p))
-			sendto_one(server, "CLIENT %s %d %lu %s %s %s %s %s %s:%s",
+			sendto_one(server, "CLIENT %s %d %lu %s %s %s %s %s :%s",
 				   nick,
 				   source_p->hopcount + 1,
 				   (unsigned long) source_p->tsinfo,
 				   ubuf,
 				   source_p->username, source_p->host, user->server,
-				   user->id,
-                   IsCapable (server, CAP_IPMASK)? source_p->rhost : "", source_p->info);
+				   user->id, source_p->info);
 		else
-			sendto_one(server, "NICK %s %d %lu %s %s %s %s %s :%s",
+			sendto_one(server, "NICK %s %d %lu %s %s %s %s :%s",
 				   nick,
 				   source_p->hopcount + 1,
 				   (unsigned long) source_p->tsinfo,
 				   ubuf,
 				   source_p->username, source_p->host, user->server,
-				   IsCapable (server, CAP_IPMASK)? source_p->rhost : "", source_p->info);
+				   source_p->info);
 	}
 
 	return 0;
@@ -880,7 +875,7 @@
  */
 int
 do_remote_user(char *nick, struct Client *client_p, struct Client *source_p,
-	       char *username, char *host, char *server, char *rhost, char *realname, char *id)
+	       char *username, char *host, char *server, char *realname, char *id)
 {
 	unsigned int oflags;
 	struct User *user;
@@ -903,11 +898,6 @@
 	if(id)
 		strlcpy(source_p->user->id, id, sizeof(source_p->user->id));
 
-	if(rhost)
-		strlcpy(source_p->rhost, rhost, sizeof(source_p->rhost));
-	else
-		strlcpy(source_p->rhost, "unavailable", sizeof(source_p->rhost));
-
 	return register_remote_user(client_p, source_p, source_p->name, username);
 }
 
@@ -1030,49 +1020,6 @@
 					}
 				}
 				break;
-
-                       case 'X':
-                               if (MyClient(source_p))
-                               {
-                                       struct ConfItem* aconf;
-                                       dlink_node *ptr;
-                                       ptr = source_p->localClient->confs.head;
-                                       aconf = ptr->data;
-
-                                       if(what == MODE_ADD)
-                                       {
-                                               if(IsConfDoSpoofIp(aconf))
-                                               {
-                                                       source_p->umodes &= ~UMODE_IPMASK;
-                                                       break;
-                                               }
-
-                                               if(IsMasked(source_p))
-                                               {
-                                                       if(!strcmp(ret_maskip(source_p), source_p->host))
-                                                               break;
-
-                                                       source_p->umodes |= UMODE_IPMASK;
-                                                       strcpy(source_p->host, ret_maskip(source_p));
-                                                       break;
-                                               }
-
-                                               source_p->umodes |= UMODE_IPMASK;
-                                               strcpy(source_p->host, ret_maskip(source_p));
-                                               break;
-                                       }
-
-                                       if(what == MODE_DEL)
-                                       {
-                                               if(!IsMasked(source_p))
-                                                       break;
-
-                                               source_p->umodes &= ~UMODE_IPMASK;
-                                               strcpy(source_p->host, source_p->rhost);
-                                               break;
-                                       }
-                               }
-                               break;
 
 				/* we may not get these,
 				 * but they shouldnt be in default
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/s_user.c.orig ircd-ratbox-1.2-3/src/s_user.c.orig
--- ircd-ratbox-1.2-3+ipmask/src/s_user.c.orig	Sat Jul 19 03:44:52 2003
+++ ircd-ratbox-1.2-3/src/s_user.c.orig	Wed Dec 31 17:00:00 1969
@@ -1,1330 +0,0 @@
-/*
- *  ircd-ratbox: A slightly useful ircd.
- *  s_user.c: User related functions.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002 ircd-ratbox development team
- *
- *  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: s_user.c,v 7.266.2.3 2003/07/19 10:44:52 leeh Exp $
- */
-
-#include "stdinc.h"
-#include "tools.h"
-#include "s_user.h"
-#include "channel.h"
-#include "channel_mode.h"
-#include "class.h"
-#include "client.h"
-#include "common.h"
-#include "fdlist.h"
-#include "hash.h"
-#include "irc_string.h"
-#include "sprintf_irc.h"
-#include "ircd.h"
-#include "listener.h"
-#include "motd.h"
-#include "ircd_handler.h"
-#include "msg.h"
-#include "numeric.h"
-#include "s_bsd.h"
-#include "s_conf.h"
-#include "s_log.h"
-#include "s_serv.h"
-#include "s_stats.h"
-#include "scache.h"
-#include "send.h"
-#include "supported.h"
-#include "whowas.h"
-#include "md5.h"
-#include "memory.h"
-#include "packet.h"
-#include "reject.h"
-
-static void report_and_set_user_flags(struct Client *, struct ConfItem *);
-static int check_X_line(struct Client *client_p, struct Client *source_p);
-void user_welcome(struct Client *source_p);
-static int introduce_client(struct Client *client_p, struct Client *source_p,
-			    struct User *user, char *nick);
-int oper_up(struct Client *source_p, struct ConfItem *aconf);
-
-extern char *crypt();
-
-/* table of ascii char letters to corresponding bitmask */
-
-struct flag_item
-{
-	int mode;
-	char letter;
-};
-
-static struct flag_item user_modes[] = {
-	{UMODE_ADMIN, 'a'},
-	{UMODE_BOTS, 'b'},
-	{UMODE_CCONN, 'c'},
-	{UMODE_DEBUG, 'd'},
-	{UMODE_FULL, 'f'},
-	{UMODE_CALLERID, 'g'},
-	{UMODE_INVISIBLE, 'i'},
-	{UMODE_SKILL, 'k'},
-	{UMODE_LOCOPS, 'l'},
-	{UMODE_NCHANGE, 'n'},
-	{UMODE_OPER, 'o'},
-	{UMODE_REJ, 'r'},
-	{UMODE_SERVNOTICE, 's'},
-	{UMODE_UNAUTH, 'u'},
-	{UMODE_WALLOP, 'w'},
-	{UMODE_EXTERNAL, 'x'},
-	{UMODE_SPY, 'y'},
-	{UMODE_OPERWALL, 'z'},
-	{UMODE_OPERSPY, 'Z'},
-	{0, 0}
-};
-
-/* memory is cheap. map 0-255 to equivalent mode */
-
-int user_modes_from_c_to_bitmask[] = {
-	/* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x0F */
-	/* 0x10 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x1F */
-	/* 0x20 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x2F */
-	/* 0x30 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x3F */
-	0,			/* @ */
-	0,			/* A */
-	0,			/* B */
-	0,			/* C */
-	0,			/* D */
-	0,			/* E */
-	0,			/* F */
-	0,			/* G */
-	0,			/* H */
-	0,			/* I */
-	0,			/* J */
-	0,			/* K */
-	0,			/* L */
-	0,			/* M */
-	0,			/* N */
-	0,			/* O */
-	0,			/* P */
-	0,			/* Q */
-	0,			/* R */
-	0,			/* S */
-	0,			/* T */
-	0,			/* U */
-	0,			/* V */
-	0,			/* W */
-	0,			/* X */
-	0,			/* Y */
-	UMODE_OPERSPY,		/* Z 0x5A */
-	0, 0, 0, 0, 0,		/* 0x5F */
-	/* 0x60 */ 0,
-	UMODE_ADMIN,		/* a */
-	UMODE_BOTS,		/* b */
-	UMODE_CCONN,		/* c */
-	UMODE_DEBUG,		/* d */
-	0,			/* e */
-	UMODE_FULL,		/* f */
-	UMODE_CALLERID,		/* g */
-	0,			/* h */
-	UMODE_INVISIBLE,	/* i */
-	0,			/* j */
-	UMODE_SKILL,		/* k */
-	UMODE_LOCOPS,		/* l */
-	0,			/* m */
-	UMODE_NCHANGE,		/* n */
-	UMODE_OPER,		/* o */
-	0,			/* p */
-	0,			/* q */
-	UMODE_REJ,		/* r */
-	UMODE_SERVNOTICE,	/* s */
-	0,			/* t */
-	UMODE_UNAUTH,		/* u */
-	0,			/* v */
-	UMODE_WALLOP,		/* w */
-	UMODE_EXTERNAL,		/* x */
-	UMODE_SPY,		/* y */
-	UMODE_OPERWALL,		/* z 0x7A */
-	0, 0, 0, 0, 0,		/* 0x7B - 0x7F */
-
-	/* 0x80 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x8F */
-	/* 0x90 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x9F */
-	/* 0xA0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xAF */
-	/* 0xB0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xBF */
-	/* 0xC0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xCF */
-	/* 0xD0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xDF */
-	/* 0xE0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xEF */
-	/* 0xF0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0  /* 0xFF */
-};
-
-/*
- * show_lusers -
- *
- * inputs	- pointer to client
- * output	-
- * side effects	- display to client user counts etc.
- */
-int
-show_lusers(struct Client *source_p)
-{
-	if(!ConfigServerHide.hide_servers || IsOper(source_p))
-		sendto_one(source_p, form_str(RPL_LUSERCLIENT), me.name, source_p->name,
-			   (Count.total - Count.invisi), Count.invisi, Count.server);
-	else
-		sendto_one(source_p, form_str(RPL_LUSERCLIENT), me.name, source_p->name,
-			   (Count.total - Count.invisi), Count.invisi, 1);
-	if(Count.oper > 0)
-		sendto_one(source_p, form_str(RPL_LUSEROP), me.name, source_p->name, Count.oper);
-
-	if(Count.unknown > 0)
-		sendto_one(source_p, form_str(RPL_LUSERUNKNOWN), me.name, source_p->name,
-			   Count.unknown);
-
-	if(Count.chan > 0)
-		sendto_one(source_p, form_str(RPL_LUSERCHANNELS),
-			   me.name, source_p->name, Count.chan);
-
-	if(!ConfigServerHide.hide_servers || IsOper(source_p))
-	{
-		sendto_one(source_p, form_str(RPL_LUSERME),
-			   me.name, source_p->name, Count.local, Count.myserver);
-		sendto_one(source_p, form_str(RPL_LOCALUSERS), me.name, source_p->name,
-			   Count.local, Count.max_loc);
-	}
-	else
-	{
-		sendto_one(source_p, form_str(RPL_LUSERME),
-			   me.name, source_p->name, Count.total, 0);
-		sendto_one(source_p, form_str(RPL_LOCALUSERS),
-			   me.name, source_p->name, Count.total, Count.max_tot);
-	}
-
-	sendto_one(source_p, form_str(RPL_GLOBALUSERS), me.name, source_p->name,
-		   Count.total, Count.max_tot);
-
-	if(!ConfigServerHide.hide_servers || IsOper(source_p))
-		sendto_one(source_p, form_str(RPL_STATSCONN), me.name, source_p->name,
-			   MaxConnectionCount, MaxClientCount, Count.totalrestartcount);
-
-	if(Count.local > MaxClientCount)
-		MaxClientCount = Count.local;
-
-	if((Count.local + Count.myserver) > MaxConnectionCount)
-		MaxConnectionCount = Count.local + Count.myserver;
-
-	return 0;
-}
-
-/*
- * show_isupport
- *
- * inputs	- pointer to client
- * output	- 
- * side effects	- display to client what we support (for them)
- */
-void
-show_isupport(struct Client *source_p)
-{
-	char isupportbuffer[512];
-
-	ircsprintf(isupportbuffer, FEATURES, FEATURESVALUES);
-	sendto_one(source_p, form_str(RPL_ISUPPORT), me.name, source_p->name, isupportbuffer);
-
-	ircsprintf(isupportbuffer, FEATURES2, FEATURES2VALUES);
-	sendto_one(source_p, form_str(RPL_ISUPPORT), me.name, source_p->name, isupportbuffer);
-
-	return;
-}
-
-
-/*
-** register_local_user
-**      This function is called when both NICK and USER messages
-**      have been accepted for the client, in whatever order. Only
-**      after this, is the USER message propagated.
-**
-**      NICK's must be propagated at once when received, although
-**      it would be better to delay them too until full info is
-**      available. Doing it is not so simple though, would have
-**      to implement the following:
-**
-**      (actually it has been implemented already for a while) -orabidoo
-**
-**      1) user telnets in and gives only "NICK foobar" and waits
-**      2) another user far away logs in normally with the nick
-**         "foobar" (quite legal, as this server didn't propagate
-**         it).
-**      3) now this server gets nick "foobar" from outside, but
-**         has alread the same defined locally. Current server
-**         would just issue "KILL foobar" to clean out dups. But,
-**         this is not fair. It should actually request another
-**         nick from local user or kill him/her...
-*/
-
-int
-register_local_user(struct Client *client_p, struct Client *source_p, char *nick, char *username)
-{
-	struct ConfItem *aconf;
-	struct User *user = source_p->user;
-	char tmpstr2[IRCD_BUFSIZE];
-	char ipaddr[HOSTIPLEN];
-	char myusername[USERLEN + 1];
-	int status;
-	dlink_node *ptr;
-	char *id;
-	s_assert(NULL != source_p);
-	s_assert(MyConnect(source_p));
-	s_assert(source_p->username != username);
-
-	if(source_p == NULL)
-		return -1;
-
-	if(!MyConnect(source_p))
-		return -1;
-
-	if(ConfigFileEntry.ping_cookie)
-	{
-		if(!(source_p->flags & FLAGS_PINGSENT) && source_p->localClient->random_ping == 0)
-		{
-			source_p->localClient->random_ping = (unsigned long) rand();
-			sendto_one(source_p, "PING :%lu",
-				   (unsigned long) source_p->localClient->random_ping);
-			source_p->flags |= FLAGS_PINGSENT;
-			return -1;
-		}
-		if(!(source_p->flags2 & FLAGS2_PING_COOKIE))
-		{
-			return -1;
-		}
-	}
-
-
-	user->last = CurrentTime;
-	/* Straight up the maximum rate of flooding... */
-	source_p->localClient->allow_read = MAX_FLOOD_BURST;
-
-	/* XXX - fixme. we shouldnt have to build a users buffer twice.. */
-	if(!IsGotId(source_p) && (strchr(username, '[') != NULL))
-	{
-		char *p;
-		int i = 0;
-
-		p = username;
-
-		while (*p && i < USERLEN)
-		{
-			if(*p != '[')
-				myusername[i++] = *p;
-			p++;
-		}
-
-		myusername[i] = '\0';
-		username = myusername;
-	}
-
-	if((status = check_client(client_p, source_p, username)) < 0)
-		return (CLIENT_EXITED);
-
-	if(!valid_hostname(source_p->host))
-	{
-		sendto_one(source_p,
-			   ":%s NOTICE %s :*** Notice -- You have an illegal character in your hostname",
-			   me.name, source_p->name);
-		strncpy(source_p->host, source_p->localClient->sockhost, HOSTIPLEN + 1);
-	}
-
-	ptr = source_p->localClient->confs.head;
-	aconf = ptr->data;
-
-	if(aconf == NULL)
-	{
-		(void) exit_client(client_p, source_p, &me, "*** Not Authorised");
-		return (CLIENT_EXITED);
-	}
-
-	if(!IsGotId(source_p))
-	{
-		char *p;
-		int i = 0;
-
-		if(IsNeedIdentd(aconf))
-		{
-			ServerStats->is_ref++;
-			sendto_one(source_p,
-				   ":%s NOTICE %s :*** Notice -- You need to install identd to use this server",
-				   me.name, client_p->name);
-			(void) exit_client(client_p, source_p, &me, "Install identd");
-			return (CLIENT_EXITED);
-		}
-
-		p = username;
-
-		if(!IsNoTilde(aconf))
-			source_p->username[i++] = '~';
-
-		while (*p && i < USERLEN)
-		{
-			if(*p != '[')
-				source_p->username[i++] = *p;
-			p++;
-		}
-
-		source_p->username[i] = '\0';
-	}
-
-	/* password check */
-	if(!BadPtr(aconf->passwd))
-	{
-		const char *encr;
-
-		if(IsConfEncrypted(aconf))
-		{
-			if(!BadPtr(source_p->localClient->passwd))
-				encr = crypt(source_p->localClient->passwd, aconf->passwd);
-			else
-				encr = "";
-		}
-		else
-			encr = source_p->localClient->passwd;
-
-		if(strcmp(encr, aconf->passwd))
-		{
-			ServerStats->is_ref++;
-			sendto_one(source_p, form_str(ERR_PASSWDMISMATCH), me.name, source_p->name);
-			(void) exit_client(client_p, source_p, &me, "Bad Password");
-			return (CLIENT_EXITED);
-		}
-	}
-
-	memset(source_p->localClient->passwd, 0, sizeof(source_p->localClient->passwd));
-
-	/* report if user has &^>= etc. and set flags as needed in source_p */
-	report_and_set_user_flags(source_p, aconf);
-
-	/* Limit clients */
-	/*
-	 * We want to be able to have servers and F-line clients
-	 * connect, so save room for "buffer" connections.
-	 * Smaller servers may want to decrease this, and it should
-	 * probably be just a percentage of the MAXCLIENTS...
-	 *   -Taner
-	 */
-	/* Except "F:" clients */
-	if(((Count.local + 1) >= (GlobalSetOptions.maxclients + MAX_BUFFER)
-	    ||
-	    (Count.local + 1) >= (GlobalSetOptions.maxclients - 5)) && !(IsExemptLimits(source_p)))
-	{
-		sendto_realops_flags(UMODE_FULL, L_ALL,
-				     "Too many clients, rejecting %s[%s].", nick, source_p->host);
-
-		ServerStats->is_ref++;
-		(void) exit_client(client_p, source_p, &me, "Sorry, server is full - try later");
-		return (CLIENT_EXITED);
-	}
-
-	/* valid user name check */
-
-	if(!valid_username(source_p->username))
-	{
-		sendto_realops_flags(UMODE_REJ, L_ALL,
-				     "Invalid username: %s (%s@%s)",
-				     nick, source_p->username, source_p->host);
-		ServerStats->is_ref++;
-		ircsprintf(tmpstr2, "Invalid username [%s]", source_p->username);
-		(void) exit_client(client_p, source_p, &me, tmpstr2);
-		return (CLIENT_EXITED);
-	}
-
-	/* kline exemption extends to xline too */	
-	if(!IsExemptKline(source_p) && 
-	  ((status = check_X_line(client_p, source_p)) < 0))
-		return status;
-
-	if(IsDead(client_p))
-		return CLIENT_EXITED;
-
-	if(source_p->user->id[0] == '\0')
-	{
-		for (id = id_get(); find_id(id); id = id_get())
-			;
-		strcpy(source_p->user->id, id);
-		add_to_id_hash_table(id, source_p);
-	}
-
-	inetntop(source_p->localClient->aftype, &IN_ADDR(source_p->localClient->ip),
-		 ipaddr, HOSTIPLEN);
-	sendto_realops_flags(UMODE_CCONN, L_ALL,
-			     "Client connecting: %s (%s@%s) [%s] {%s} [%s]",
-			     nick, source_p->username, source_p->host,
-#ifdef HIDE_SPOOF_IPS
-			     IsIPSpoof(source_p) ? "255.255.255.255" :
-#endif
-			     ipaddr, get_client_class(source_p), source_p->info);
-
-	/* If they have died in send_* don't do anything. */
-	if(IsDead(source_p))
-		return CLIENT_EXITED;
-
-	add_to_hostname_hash_table(source_p->host, source_p);
-
-	source_p->umodes |= UMODE_INVISIBLE;
-
-	Count.invisi++;
-
-	if((++Count.local) > Count.max_loc)
-	{
-		Count.max_loc = Count.local;
-		if(!(Count.max_loc % 10))
-			sendto_realops_flags(UMODE_ALL, L_ALL,
-					     "New Max Local Clients: %d", Count.max_loc);
-	}
-
-	SetClient(source_p);
-
-	/* XXX source_p->servptr is &me, since local client */
-	source_p->servptr = find_server(user->server);
-	dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->users);
-	/* Increment our total user count here */
-	if(++Count.total > Count.max_tot)
-		Count.max_tot = Count.total;
-	source_p->localClient->allow_read = MAX_FLOOD_BURST;
-
-	Count.totalrestartcount++;
-
-	dlinkMoveNode(&source_p->localClient->tnode, &unknown_list, &lclient_list);
-	user_welcome(source_p);
-
-	return (introduce_client(client_p, source_p, user, nick));
-}
-
-/*
- * register_remote_user
- *
- * inputs
- * output
- * side effects	- This function is called when a remote client
- *		  is introduced by a server.
- */
-int
-register_remote_user(struct Client *client_p, struct Client *source_p, char *nick, char *username)
-{
-	struct User *user = source_p->user;
-	struct Client *target_p;
-
-	s_assert(NULL != source_p);
-	s_assert(source_p->username != username);
-
-	if(source_p == NULL)
-		return -1;
-
-	user->last = CurrentTime;
-
-	strlcpy(source_p->username, username, sizeof(source_p->username));
-
-	SetClient(source_p);
-
-	/* Increment our total user count here */
-	if(++Count.total > Count.max_tot)
-		Count.max_tot = Count.total;
-
-	add_to_hostname_hash_table(source_p->host, source_p);
-
-	source_p->servptr = find_server(user->server);
-
-	if(source_p->servptr == NULL)
-	{
-		sendto_realops_flags(UMODE_ALL, L_ALL, "Ghost killed: %s on invalid server %s",
-				     source_p->name, source_p->user->server);
-
-		kill_client(client_p, source_p, "%s (Server doesn't exist)", me.name);
-
-		source_p->flags |= FLAGS_KILLED;
-		return exit_client(NULL, source_p, &me, "Ghosted Client");
-	}
-
-	dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->users);
-	if((target_p = find_server(user->server)) && target_p->from != source_p->from)
-	{
-		sendto_realops_flags(UMODE_DEBUG, L_ALL,
-				     "Bad User [%s] :%s USER %s@%s %s, != %s[%s]",
-				     client_p->name, nick, source_p->username,
-				     source_p->host, user->server,
-				     target_p->name, target_p->from->name);
-		kill_client(client_p, source_p,
-			    "%s (NICK from wrong direction (%s != %s))",
-			    me.name, user->server, target_p->from->name);
-
-		source_p->flags |= FLAGS_KILLED;
-		return exit_client(source_p, source_p, &me, "USER server wrong direction");
-
-	}
-	/*
-	 * Super GhostDetect:
-	 * If we can't find the server the user is supposed to be on,
-	 * then simply blow the user away.        -Taner
-	 */
-	if(!target_p)
-	{
-		kill_client(client_p, source_p, "%s GHOST (no server found)", me.name);
-		sendto_realops_flags(UMODE_ALL, L_ALL, "No server %s for user %s[%s@%s] from %s",
-				     user->server, source_p->name, source_p->username,
-				     source_p->host, source_p->from->name);
-		source_p->flags |= FLAGS_KILLED;
-		return exit_client(source_p, source_p, &me, "Ghosted Client");
-	}
-
-	return (introduce_client(client_p, source_p, user, nick));
-}
-
-/*
- * introduce_clients
- *
- * inputs	-
- * output	-
- * side effects - This common function introduces a client to the rest
- *		  of the net, either from a local client connect or
- *		  from a remote connect.
- */
-static int
-introduce_client(struct Client *client_p, struct Client *source_p, struct User *user, char *nick)
-{
-	dlink_node *server_node;
-	struct Client *server;
-	static char ubuf[12];
-
-	if(MyClient(source_p))
-		send_umode(source_p, source_p, 0, SEND_UMODES, ubuf);
-	else
-		send_umode(NULL, source_p, 0, SEND_UMODES, ubuf);
-
-	if(!*ubuf)
-	{
-		ubuf[0] = '+';
-		ubuf[1] = '\0';
-	}
-
-	/* arghhh one could try not introducing new nicks to ll leafs
-	 * but then you have to introduce them "on the fly" in SJOIN
-	 * not fun.
-	 * Its not going to cost much more bandwidth to simply let new
-	 * nicks just ride on through.
-	 */
-
-	/*
-	 * We now introduce nicks "on the fly" in SJOIN anyway --
-	 * you _need_ to if you aren't going to burst everyone initially.
-	 *
-	 * rewritten to cope with UIDs .. eww eww eww --is
-	 */
-
-	DLINK_FOREACH(server_node, serv_list.head)
-	{
-		server = (struct Client *) server_node->data;
-
-		if(server == client_p)
-			continue;
-
-		if(IsCapable(server, CAP_UID) && HasID(source_p))
-			sendto_one(server, "CLIENT %s %d %lu %s %s %s %s %s :%s",
-				   nick,
-				   source_p->hopcount + 1,
-				   (unsigned long) source_p->tsinfo,
-				   ubuf,
-				   source_p->username, source_p->host, user->server,
-				   user->id, source_p->info);
-		else
-			sendto_one(server, "NICK %s %d %lu %s %s %s %s :%s",
-				   nick,
-				   source_p->hopcount + 1,
-				   (unsigned long) source_p->tsinfo,
-				   ubuf,
-				   source_p->username, source_p->host, user->server,
-				   source_p->info);
-	}
-
-	return 0;
-}
-
-/* 
- * valid_hostname - check hostname for validity
- *
- * Inputs       - pointer to user
- * Output       - YES if valid, NO if not
- * Side effects - NONE
- *
- * NOTE: this doesn't allow a hostname to begin with a dot and
- * will not allow more dots than chars.
- */
-int
-valid_hostname(const char *hostname)
-{
-	const char *p = hostname;
-
-	s_assert(NULL != p);
-
-	if(hostname == NULL)
-		return NO;
-
-	if('.' == *p)
-		return NO;
-
-	while (*p)
-	{
-		if(!IsHostChar(*p))
-			return NO;
-		p++;
-	}
-	return (YES);
-}
-
-/* 
- * valid_username - check username for validity
- *
- * Inputs       - pointer to user
- * Output       - YES if valid, NO if not
- * Side effects - NONE
- * 
- * Absolutely always reject any '*' '!' '?' '@' in an user name
- * reject any odd control characters names.
- * Allow '.' in username to allow for "first.last"
- * style of username
- */
-int
-valid_username(const char *username)
-{
-	int dots = 0;
-	const char *p = username;
-
-	s_assert(NULL != p);
-
-	if(username == NULL)
-		return NO;
-
-	if('~' == *p)
-		++p;
-
-	/* reject usernames that don't start with an alphanum
-	 * i.e. reject jokers who have '-@somehost' or '.@somehost'
-	 * or "-hi-@somehost", "h-----@somehost" would still be accepted.
-	 */
-	if(!IsAlNum(*p))
-		return NO;
-
-	while (*++p)
-	{
-		if((*p == '.') && ConfigFileEntry.dots_in_ident)
-		{
-			dots++;
-			if(dots > ConfigFileEntry.dots_in_ident)
-				return NO;
-			if(!IsUserChar(p[1]))
-				return NO;
-		}
-		else if(!IsUserChar(*p))
-			return NO;
-	}
-	return YES;
-}
-
-/* report_and_set_user_flags
- *
- * Inputs       - pointer to source_p
- *              - pointer to aconf for this user
- * Output       - NONE
- * Side effects -
- * Report to user any special flags they are getting, and set them.
- */
-
-static void
-report_and_set_user_flags(struct Client *source_p, struct ConfItem *aconf)
-{
-	/* If this user is being spoofed, tell them so */
-	if(IsConfDoSpoofIp(aconf))
-	{
-		sendto_one(source_p,
-			   ":%s NOTICE %s :*** Spoofing your IP. congrats.",
-			   me.name, source_p->name);
-	}
-
-	/* If this user is in the exception class, Set it "E lined" */
-	if(IsConfExemptKline(aconf))
-	{
-		SetExemptKline(source_p);
-		sendto_one(source_p,
-			   ":%s NOTICE %s :*** You are exempt from K/D/G/X lines. congrats.",
-			   me.name, source_p->name);
-	}
-
-	if(IsConfExemptGline(aconf))
-	{
-		SetExemptGline(source_p);
-
-		/* dont send both a kline and gline exempt notice */
-		if(!IsConfExemptKline(aconf))
-			sendto_one(source_p,
-				   ":%s NOTICE %s :*** You are exempt from G lines.",
-				   me.name, source_p->name);
-	}
-
-	/* If this user is exempt from user limits set it F lined" */
-	if(IsConfExemptLimits(aconf))
-	{
-		SetExemptLimits(source_p);
-		sendto_one(source_p,
-			   ":%s NOTICE %s :*** You are exempt from user limits. congrats.",
-			   me.name, source_p->name);
-	}
-
-	/* If this user is exempt from idle time outs */
-	if(IsConfIdlelined(aconf))
-	{
-		SetIdlelined(source_p);
-		sendto_one(source_p,
-			   ":%s NOTICE %s :*** You are exempt from idle limits. congrats.",
-			   me.name, source_p->name);
-	}
-
-	if(IsConfExemptFlood(aconf))
-	{
-		SetExemptFlood(source_p);
-		sendto_one(source_p,
-			   ":%s NOTICE %s :*** You are exempt from flood limits.",
-			   me.name, source_p->name);
-	}
-
-	if(IsConfExemptSpambot(aconf))
-	{
-		SetExemptSpambot(source_p);
-		sendto_one(source_p,
-			    ":%s NOTICE %s :*** You are exempt from spambot checks.",
-			    me.name, source_p->name);
-	}
-}
-
-
-/*
- * do_local_user
- *
- * inputs	-
- * output	-
- * side effects -
- */
-int
-do_local_user(char *nick, struct Client *client_p, struct Client *source_p,
-	      char *username, char *host, char *server, char *realname)
-{
-	struct User *user;
-
-	s_assert(NULL != source_p);
-	s_assert(source_p->username != username);
-
-	if(source_p == NULL)
-		return 0;
-
-	if(!IsUnknown(source_p))
-	{
-		sendto_one(source_p, form_str(ERR_ALREADYREGISTRED), me.name, nick);
-		return 0;
-	}
-
-	user = make_user(source_p);
-
-	/*
-	 * don't take the clients word for it, ever
-	 */
-	user->server = me.name;
-
-	strlcpy(source_p->info, realname, sizeof(source_p->info));
-
-	if(!IsGotId(source_p))
-	{
-		/* This is in this location for a reason..If there is no identd
-		 * and ping cookies are enabled..we need to have a copy of this
-		 */
-		strlcpy(source_p->username, username, sizeof(source_p->username));
-	}
-
-	if(source_p->name[0])
-	{
-		/* NICK already received, now I have USER... */
-		return register_local_user(client_p, source_p, source_p->name, username);
-	}
-
-	return 0;
-}
-
-/*
- * do_remote_user
- *
- * inputs	-
- * output	-
- * side effects -
- */
-int
-do_remote_user(char *nick, struct Client *client_p, struct Client *source_p,
-	       char *username, char *host, char *server, char *realname, char *id)
-{
-	unsigned int oflags;
-	struct User *user;
-
-	s_assert(NULL != source_p);
-	s_assert(source_p->username != username);
-
-	if(source_p == NULL)
-		return 0;
-	user = make_user(source_p);
-
-	oflags = source_p->flags;
-
-	/*
-	 * coming from another server, take the servers word for it
-	 */
-	user->server = find_or_add(server);
-	strlcpy(source_p->host, host, sizeof(source_p->host));
-	strlcpy(source_p->info, realname, sizeof(source_p->info));
-	if(id)
-		strlcpy(source_p->user->id, id, sizeof(source_p->user->id));
-
-	return register_remote_user(client_p, source_p, source_p->name, username);
-}
-
-/*
- * user_mode - set get current users mode
- *
- * m_umode() added 15/10/91 By Darren Reed.
- * parv[0] - sender
- * parv[1] - username to change mode for
- * parv[2] - modes to change
- */
-int
-user_mode(struct Client *client_p, struct Client *source_p, int parc, char *parv[])
-{
-	int flag;
-	int i;
-	char **p, *m;
-	struct Client *target_p;
-	int what, setflags;
-	int badflag = NO;	/* Only send one bad flag notice */
-	char buf[BUFSIZE];
-
-	what = MODE_ADD;
-
-	if(parc < 2)
-	{
-		sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "MODE");
-		return 0;
-	}
-
-	if((target_p = find_person(parv[1])) == NULL)
-	{
-		if(MyConnect(source_p))
-			sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL),
-				   me.name, parv[0], parv[1]);
-		return 0;
-	}
-
-	/* Dont know why these were commented out..
-	 * put them back using new sendto() funcs
-	 */
-
-	if(IsServer(source_p))
-	{
-		sendto_realops_flags(UMODE_ALL, L_ADMIN, "*** Mode for User %s from %s",
-				     parv[1], source_p->name);
-		return 0;
-	}
-
-	if(source_p != target_p || target_p->from != source_p->from)
-	{
-		sendto_one(source_p, form_str(ERR_USERSDONTMATCH), me.name, parv[0]);
-		return 0;
-	}
-
-
-	if(parc < 3)
-	{
-		m = buf;
-		*m++ = '+';
-
-		for (i = 0; user_modes[i].letter && (m - buf < BUFSIZE - 4); i++)
-			if(source_p->umodes & user_modes[i].mode)
-				*m++ = user_modes[i].letter;
-		*m = '\0';
-		sendto_one(source_p, form_str(RPL_UMODEIS), me.name, parv[0], buf);
-		return 0;
-	}
-
-	/* find flags already set for user */
-	setflags = source_p->umodes;
-
-	/*
-	 * parse mode change string(s)
-	 */
-	for (p = &parv[2]; p && *p; p++)
-		for (m = *p; *m; m++)
-			switch (*m)
-			{
-			case '+':
-				what = MODE_ADD;
-				break;
-			case '-':
-				what = MODE_DEL;
-				break;
-
-			case 'o':
-				if(what == MODE_ADD)
-				{
-					if(IsServer(client_p) && !IsOper(source_p))
-					{
-						++Count.oper;
-						SetOper(source_p);
-					}
-				}
-				else
-				{
-					/* Only decrement the oper counts if an oper to begin with
-					 * found by Pat Szuta, Perly , perly@xnet.com 
-					 */
-
-					if(!IsOper(source_p))
-						break;
-
-					ClearOper(source_p);
-					source_p->umodes &= ~ConfigFileEntry.oper_only_umodes;
-
-					Count.oper--;
-
-					if(MyConnect(source_p))
-					{
-						dlink_node *dm;
-
-						source_p->flags2 &= ~OPER_FLAGS;
-						dm = dlinkFind(&oper_list, source_p);
-						if(dm != NULL)
-						{
-							dlinkDestroy(dm, &oper_list);
-						}
-					}
-				}
-				break;
-
-				/* we may not get these,
-				 * but they shouldnt be in default
-				 */
-			case ' ':
-			case '\n':
-			case '\r':
-			case '\t':
-				break;
-
-			default:
-				if((flag = user_modes_from_c_to_bitmask[(unsigned char) *m]))
-				{
-					if(MyConnect(source_p) && !IsOper(source_p) &&
-					   (ConfigFileEntry.oper_only_umodes & flag))
-					{
-						badflag = YES;
-					}
-					else
-					{
-						if(what == MODE_ADD)
-							source_p->umodes |= flag;
-						else
-							source_p->umodes &= ~flag;
-					}
-				}
-				else
-				{
-					if(MyConnect(source_p))
-						badflag = YES;
-				}
-				break;
-			}
-
-	if(badflag)
-		sendto_one(source_p, form_str(ERR_UMODEUNKNOWNFLAG), me.name, parv[0]);
-
-	if((source_p->umodes & UMODE_NCHANGE) && !IsOperN(source_p))
-	{
-		sendto_one(source_p, ":%s NOTICE %s :*** You need oper and N flag for +n",
-			   me.name, parv[0]);
-		source_p->umodes &= ~UMODE_NCHANGE;	/* only tcm's really need this */
-	}
-
-	if(MyConnect(source_p) && (source_p->umodes & UMODE_ADMIN) &&
-	   (!IsOperAdmin(source_p) || IsOperHiddenAdmin(source_p)))
-	{
-		sendto_one(source_p, ":%s NOTICE %s :*** You need oper and A flag for +a",
-			   me.name, parv[0]);
-		source_p->umodes &= ~UMODE_ADMIN;
-	}
-
-
-	if(!(setflags & UMODE_INVISIBLE) && IsInvisible(source_p))
-		++Count.invisi;
-	if((setflags & UMODE_INVISIBLE) && !IsInvisible(source_p))
-		--Count.invisi;
-	/*
-	 * compare new flags with old flags and send string which
-	 * will cause servers to update correctly.
-	 */
-	send_umode_out(client_p, source_p, setflags);
-
-	return (0);
-}
-
-/*
- * send the MODE string for user (user) to connection client_p
- * -avalon
- */
-void
-send_umode(struct Client *client_p, struct Client *source_p, int old, int sendmask, char *umode_buf)
-{
-	int i;
-	int flag;
-	char *m;
-	int what = 0;
-
-	/*
-	 * build a string in umode_buf to represent the change in the user's
-	 * mode between the new (source_p->flag) and 'old'.
-	 */
-	m = umode_buf;
-	*m = '\0';
-
-	for (i = 0; user_modes[i].letter; i++)
-	{
-		flag = user_modes[i].mode;
-
-		if(MyClient(source_p) && !(flag & sendmask))
-			continue;
-		if((flag & old) && !(source_p->umodes & flag))
-		{
-			if(what == MODE_DEL)
-				*m++ = user_modes[i].letter;
-			else
-			{
-				what = MODE_DEL;
-				*m++ = '-';
-				*m++ = user_modes[i].letter;
-			}
-		}
-		else if(!(flag & old) && (source_p->umodes & flag))
-		{
-			if(what == MODE_ADD)
-				*m++ = user_modes[i].letter;
-			else
-			{
-				what = MODE_ADD;
-				*m++ = '+';
-				*m++ = user_modes[i].letter;
-			}
-		}
-	}
-	*m = '\0';
-	if(*umode_buf && client_p)
-		sendto_one(client_p, ":%s MODE %s :%s", source_p->name, source_p->name, umode_buf);
-}
-
-/*
- * send_umode_out
- *
- * inputs	-
- * output	- NONE
- * side effects - Only send ubuf out to servers that know about this client
- */
-void
-send_umode_out(struct Client *client_p, struct Client *source_p, int old)
-{
-	struct Client *target_p;
-	char buf[BUFSIZE];
-	dlink_node *ptr;
-
-	send_umode(NULL, source_p, old, SEND_UMODES, buf);
-
-	DLINK_FOREACH(ptr, serv_list.head)
-	{
-		target_p = ptr->data;
-
-		if((target_p != client_p) && (target_p != source_p) && (*buf))
-		{
-			sendto_one(target_p, ":%s MODE %s :%s",
-				   source_p->name, source_p->name, buf);
-		}
-	}
-
-	if(client_p && MyClient(client_p))
-		send_umode(client_p, source_p, old, ALL_UMODES, buf);
-}
-
-/* 
- * user_welcome
- *
- * inputs	- client pointer to client to welcome
- * output	- NONE
- * side effects	-
- */
-void
-user_welcome(struct Client *source_p)
-{
-	sendto_one(source_p, form_str(RPL_WELCOME), me.name, source_p->name,
-		   ServerInfo.network_name, source_p->name);
-	sendto_one(source_p, form_str(RPL_YOURHOST), me.name, source_p->name,
-		   get_listener_name(source_p->localClient->listener), ircd_version);
-
-	sendto_one(source_p, form_str(RPL_CREATED), me.name, source_p->name, creation);
-	sendto_one(source_p, form_str(RPL_MYINFO), me.name, source_p->name, me.name, ircd_version);
-
-	show_isupport(source_p);
-
-	show_lusers(source_p);
-
-	if(ConfigFileEntry.short_motd)
-	{
-		sendto_one(source_p, "NOTICE %s :*** Notice -- motd was last changed at %s",
-			   source_p->name, ConfigFileEntry.motd.lastChangedDate);
-
-		sendto_one(source_p,
-			   "NOTICE %s :*** Notice -- Please read the motd if you haven't read it",
-			   source_p->name);
-
-		sendto_one(source_p, form_str(RPL_MOTDSTART), me.name, source_p->name, me.name);
-
-		sendto_one(source_p,
-			   form_str(RPL_MOTD),
-			   me.name, source_p->name, "*** This is the short motd ***");
-
-		sendto_one(source_p, form_str(RPL_ENDOFMOTD), me.name, source_p->name);
-	}
-	else
-		SendMessageFile(source_p, &ConfigFileEntry.motd);
-
-	if(IsRestricted(source_p))
-	{
-		sendto_one(source_p, form_str(ERR_RESTRICTED), me.name, source_p->name);
-	}
-}
-
-/*
- * check_X_line
- * inputs	- pointer to client to test
- * outupt	- -1 if exiting 0 if ok
- * side effects	-
- */
-static int
-check_X_line(struct Client *client_p, struct Client *source_p)
-{
-	struct ConfItem *aconf;
-	const char *reason;
-
-	if(IsOper(source_p))
-		return 0;
-
-	if((aconf = find_x_conf(source_p->info)) != NULL)
-	{
-		if(aconf->passwd)
-			reason = aconf->passwd;
-		else
-			reason = "NONE";
-
-		if(aconf->port)
-		{
-			if(aconf->port == 1)
-			{
-				sendto_realops_flags(UMODE_REJ, L_ALL,
-						     "X-line Rejecting [%s] [%s], user %s",
-						     source_p->info, reason,
-						     get_client_name(client_p, HIDE_IP));
-			}
-			ServerStats->is_ref++;
-			add_reject(source_p);
-			(void) exit_client(client_p, source_p, &me, "Bad user info");
-			return (CLIENT_EXITED);
-		}
-		else
-			sendto_realops_flags(UMODE_REJ, L_ALL,
-					     "X-line Warning [%s] [%s], user %s",
-					     source_p->info, reason,
-					     get_client_name(client_p, HIDE_IP));
-	}
-
-	return (0);
-}
-
-/*
- * oper_up
- *
- * inputs	- pointer to given client to oper
- *		- pointer to ConfItem to use
- * output	- none
- * side effects	-
- * Blindly opers up given source_p, using aconf info
- * all checks on passwords have already been done.
- * This could also be used by rsa oper routines. 
- */
-
-int
-oper_up(struct Client *source_p, struct ConfItem *aconf)
-{
-	int old = (source_p->umodes & ALL_UMODES);
-	const char *operprivs = NULL;
-	dlink_node *ptr;
-	struct ConfItem *found_aconf;
-
-	SetOper(source_p);
-
-	if(ConfigFileEntry.oper_umodes)
-		source_p->umodes |= ConfigFileEntry.oper_umodes & ALL_UMODES;
-	else
-		source_p->umodes |=
-				(UMODE_SERVNOTICE | UMODE_OPERWALL | UMODE_WALLOP | UMODE_LOCOPS) &
-				ALL_UMODES;
-
-	Count.oper++;
-
-	SetExemptKline(source_p);
-
-	dlinkAddAlloc(source_p, &oper_list);
-
-	if(source_p->localClient->confs.head)
-	{
-		ptr = source_p->localClient->confs.head;
-		if(ptr)
-		{
-			found_aconf = ptr->data;
-			if(found_aconf)
-				operprivs = oper_privs_as_string(source_p, found_aconf->port);
-		}
-	}
-	else
-		operprivs = "";
-
-	if(IsOperAdmin(source_p) && !IsOperHiddenAdmin(source_p))
-		source_p->umodes |= UMODE_ADMIN;
-	if(!IsOperN(source_p))
-		source_p->umodes &= ~UMODE_NCHANGE;
-
-	sendto_realops_flags(UMODE_ALL, L_ALL,
-			     "%s (%s@%s) is now an operator", source_p->name,
-			     source_p->username, source_p->host);
-	send_umode_out(source_p, source_p, old);
-	sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name);
-	sendto_one(source_p, ":%s NOTICE %s :*** Oper privs are %s", me.name,
-		   source_p->name, operprivs);
-	SendMessageFile(source_p, &ConfigFileEntry.opermotd);
-
-	return (1);
-}
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/whowas.c ircd-ratbox-1.2-3/src/whowas.c
--- ircd-ratbox-1.2-3+ipmask/src/whowas.c	Thu Nov 27 09:18:28 2003
+++ ircd-ratbox-1.2-3/src/whowas.c	Thu Jun 26 07:03:21 2003
@@ -88,7 +88,6 @@
 	strlcpy(who->name, client_p->name, sizeof(who->name));
 	strcpy(who->username, client_p->username);
 	strcpy(who->hostname, client_p->host);
-	strcpy(who->rhostname, client_p->rhost);
 	strcpy(who->realname, client_p->info);
 
 	who->servername = client_p->user->server;
diff -uNrd ircd-ratbox-1.2-3+ipmask/src/whowas.c.orig ircd-ratbox-1.2-3/src/whowas.c.orig
--- ircd-ratbox-1.2-3+ipmask/src/whowas.c.orig	Thu Jun 26 07:03:21 2003
+++ ircd-ratbox-1.2-3/src/whowas.c.orig	Wed Dec 31 17:00:00 1969
@@ -1,216 +0,0 @@
-/*
- *  ircd-ratbox: A slightly useful ircd.
- *  whowas.c: WHOWAS user cache.
- *
- *  Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- *  Copyright (C) 1996-2002 Hybrid Development Team
- *  Copyright (C) 2002 ircd-ratbox development team
- *
- *  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: whowas.c,v 7.27.2.1 2003/06/26 14:03:21 androsyn Exp $
- */
-
-#include "stdinc.h"
-
-#include "whowas.h"
-#include "client.h"
-#include "common.h"
-#include "hash.h"
-#include "irc_string.h"
-#include "ircd.h"
-#include "ircd_defs.h"
-#include "numeric.h"
-#include "s_serv.h"
-#include "s_user.h"
-#include "send.h"
-#include "s_conf.h"
-#include "memory.h"
-
-/* internally defined function */
-static void add_whowas_to_clist(struct Whowas **, struct Whowas *);
-static void del_whowas_from_clist(struct Whowas **, struct Whowas *);
-static void add_whowas_to_list(struct Whowas **, struct Whowas *);
-static void del_whowas_from_list(struct Whowas **, struct Whowas *);
-
-struct Whowas WHOWAS[NICKNAMEHISTORYLENGTH];
-struct Whowas *WHOWASHASH[WW_MAX];
-
-static int whowas_next = 0;
-
-unsigned int
-hash_whowas_name(const char *name)
-{
-	unsigned int h = 0;
-
-	while (*name)
-	{
-		h = (h << 4) - (h + (unsigned char) ToLower(*name++));
-	}
-	return (h & (WW_MAX - 1));
-}
-
-void
-add_history(struct Client *client_p, int online)
-{
-	struct Whowas *who = &WHOWAS[whowas_next];
-
-	s_assert(NULL != client_p);
-
-	if(client_p == NULL)
-		return;
-
-	if(who->hashv != -1)
-	{
-		if(who->online)
-			del_whowas_from_clist(&(who->online->whowas), who);
-		del_whowas_from_list(&WHOWASHASH[who->hashv], who);
-	}
-	who->hashv = hash_whowas_name(client_p->name);
-	who->logoff = CurrentTime;
-	/*
-	 * NOTE: strcpy ok here, the sizes in the client struct MUST
-	 * match the sizes in the whowas struct
-	 */
-	strlcpy(who->name, client_p->name, sizeof(who->name));
-	strcpy(who->username, client_p->username);
-	strcpy(who->hostname, client_p->host);
-	strcpy(who->realname, client_p->info);
-
-	who->servername = client_p->user->server;
-
-	if(online)
-	{
-		who->online = client_p;
-		add_whowas_to_clist(&(client_p->whowas), who);
-	}
-	else
-		who->online = NULL;
-	add_whowas_to_list(&WHOWASHASH[who->hashv], who);
-	whowas_next++;
-	if(whowas_next == NICKNAMEHISTORYLENGTH)
-		whowas_next = 0;
-}
-
-void
-off_history(struct Client *client_p)
-{
-	struct Whowas *temp, *next;
-
-	for (temp = client_p->whowas; temp; temp = next)
-	{
-		next = temp->cnext;
-		temp->online = NULL;
-		del_whowas_from_clist(&(client_p->whowas), temp);
-	}
-}
-
-struct Client *
-get_history(char *nick, time_t timelimit)
-{
-	struct Whowas *temp;
-	int blah;
-
-	timelimit = CurrentTime - timelimit;
-	blah = hash_whowas_name(nick);
-	temp = WHOWASHASH[blah];
-	for (; temp; temp = temp->next)
-	{
-		if(irccmp(nick, temp->name))
-			continue;
-		if(temp->logoff < timelimit)
-			continue;
-		return temp->online;
-	}
-	return NULL;
-}
-
-void
-count_whowas_memory(int *wwu, u_long * wwum)
-{
-	struct Whowas *tmp;
-	int i;
-	int u = 0;
-	u_long um = 0;
-
-	/* count the number of used whowas structs in 'u' */
-	/* count up the memory used of whowas structs in um */
-
-	for (i = 0, tmp = &WHOWAS[0]; i < NICKNAMEHISTORYLENGTH; i++, tmp++)
-		if(tmp->hashv != -1)
-		{
-			u++;
-			um += sizeof(struct Whowas);
-		}
-	*wwu = u;
-	*wwum = um;
-	return;
-}
-
-void
-initwhowas()
-{
-	int i;
-
-	for (i = 0; i < NICKNAMEHISTORYLENGTH; i++)
-	{
-		memset((void *) &WHOWAS[i], 0, sizeof(struct Whowas));
-		WHOWAS[i].hashv = -1;
-	}
-	for (i = 0; i < WW_MAX; i++)
-		WHOWASHASH[i] = NULL;
-}
-
-
-static void
-add_whowas_to_clist(struct Whowas **bucket, struct Whowas *whowas)
-{
-	whowas->cprev = NULL;
-	if((whowas->cnext = *bucket) != NULL)
-		whowas->cnext->cprev = whowas;
-	*bucket = whowas;
-}
-
-static void
-del_whowas_from_clist(struct Whowas **bucket, struct Whowas *whowas)
-{
-	if(whowas->cprev)
-		whowas->cprev->cnext = whowas->cnext;
-	else
-		*bucket = whowas->cnext;
-	if(whowas->cnext)
-		whowas->cnext->cprev = whowas->cprev;
-}
-
-static void
-add_whowas_to_list(struct Whowas **bucket, struct Whowas *whowas)
-{
-	whowas->prev = NULL;
-	if((whowas->next = *bucket) != NULL)
-		whowas->next->prev = whowas;
-	*bucket = whowas;
-}
-
-static void
-del_whowas_from_list(struct Whowas **bucket, struct Whowas *whowas)
-{
-	if(whowas->prev)
-		whowas->prev->next = whowas->next;
-	else
-		*bucket = whowas->next;
-	if(whowas->next)
-		whowas->next->prev = whowas->prev;
-}
