/*
* NeoIRCd: NeoStats Group. Based on Hybird7
* s_serv.c: Server related functions.
*
* 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: s_serv.c,v 1.16 2003/03/06 14:01:51 fishwaldo Exp $
*/
#include "stdinc.h"
#ifdef HAVE_LIBCRYPTO
#include <openssl/rsa.h>
#include "rsa.h"
#endif
#include <netinet/tcp.h>
#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 "ircd.h"
#include "ircd_defs.h"
#include "list.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"
#include "resv.h"
#include "s_gline.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;
struct Client *uplink=NULL;
static void start_io(struct Client *server);
static void burst_members(struct Client *client_p, dlink_list *list);
static void burst_ll_members(struct Client *client_p, dlink_list *list);
static void add_lazylinkchannel(struct Client *client_p, struct Channel *chptr);
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 },
{ "LL", CAP_LL },
{ "EOB", CAP_EOB },
{ "HUB", CAP_HUB },
{ "UID",