+2000-09-17 Thomas Helvey <helveytw@home.com>
+ * ircd/*.c: merged in changes from 2.10.10.pl12, cleanup
+ merge conflicts.
+ * ircd/*.h: merged in changes from 2.10.10.pl12, cleanup
+ merge conflicts
+
2000-09-16 Thomas Helvey <helveytw@home.com>
* ircd/s_conf.c: add code for server struct
* ircd/client.c: copy of class.c sort of, new file for client
* Merge in u2_10_10_beta06 changes --Bleep
* Start ircu2.10.11 development, beta branch u2_10_10 --Bleep
#-----------------------------------------------------------------------------
-#
-# ChangeLog for ircu2.10.11
-#
-# $Id: ChangeLog,v 1.164 2000-09-17 03:41:37 bleep Exp $
-#
-# Insert new changes at beginning of the change list.
-#
#
# ChangeLog for ircu2.10.10
#
-# $Id: ChangeLog.10,v 1.7 2000-03-28 06:40:56 bleep Exp $
#
# Insert new changes at beginning of the change list.
#
+--------------------------- Released 2.10.10.pl11.(release)
+* Fixed G-lined (reason), thanks to dfx -- Isomer
+* Added reason to the "G-lined (reason)" quit messages. -- Isomer
+* Removed 'for nick[1.2.3.4]' from quit messages, they're redundant
+ and make hub hiding more reliable --Isomer
+* ircd/s_user.c (hunt_server): add 'No such server' message back
+ --Isomer
+* ircd/s_bsd.c: remove ALWAYSFLUSH - the problem wasn't ircu's fault
+ -- Isomer
+* ircd/m_names.c (m_names): don't add a space if the user's a
+ zombie; fixes an overrun where we generate a huge number of spaces
+ in the names reply without length-checking them properly -- Kev
+* added 'ALWAYSFLUSH', if you thought the furgeson flusher was bad...
+ --Isomer
+* Fixed /USERHOST again. Horribly embarrased. Thanks again Liandrin
+ --Isomer
+* Added extra field to /stats Y showing how many people are in that class.
+ Information was previously available via /trace, however tended to flood
+ you off if you weren't on a good connection. Requested by Mr_RIP
+ -- Isomer
+* Fixed 'BADCHAN' resetting itself to 'Y', reported by Gator --Isomer
+--------------------------- Released 2.10.10.pl10
+* Released 2.10.10.pl10
+* Backported /names optimisation from 2.10.11.
+ '/names 0' now returns verbose listing, '/names' simply returns
+ ENDOFNAMES. Disallow harmfull /names usage. --Gte
+* Fixed ERR_NOSUCHNICK bug in userhost, thanks to Liandrin --Isomer
+* Conceal more bugs in IPcheck --Isomer
+* Add 'POST' as a unregistered command to disconnect people abusing web
+ proxies --Isomer.
+* Conceal bugs in IPcheck --Isomer
+* Fix for changing the wrong define --Isomer
+* Fix for the easter buggy. --Isomer
+* Fix for rpong --Run
+* Fix for other IPcheck bug, thanks BLMet. --Bleep
+* Fix for IPcheck bug, rewrite IPcheck from scratch (mostly),
+ add changes for new code to s_user.c, ircd.c --Bleep
+* Shorten connection timeout for auth queries to 60 seconds
+ If connection is from localhost use the server alias for the
+ client host. --Bleep
+* Fix for ident bug --Isomer
+* Fix for rping/rpong --Gte
+* Add m_pong to parser handler --Bleep
+* Fix for EXTENDED_NUMERICS bug doh!!! --Bleep
* Fix for Max Undernet Server bug --Bleep
* Fix for PRIVMSG<->NOTICE translation from hubs --Bleep
* Fix for Bogus protocol strings for P9 servers --Bleep
fi
comment 'Bad Channel G-Lines allow operators to add channel masks to a list which prohibits local clients from being able joining channels which match the mask. Remote BadChan Glines allow Uworld to add or remove channels from the servers internal list of badchans'
- BADCHAN=y
bool 'Do you want to enable Bad Channel G-lines' BADCHAN y
if [ "$BADCHAN" = "y" ]; then
echo " "
# it is not allowed to jupe others as well.
U:Uworld.EU.undernet.org:EuWorld,E,protocol,StatServ,NoteServ,Undernet:*
-U:Uworld2.undernet.org:UWorld2,ChanSvr,ChanSaver,ChanServ,COM1,COM2,COM3,COM4:*
-U:Uworld.undernet.org:Uworld,X,W,NickSvr,NickSaver,NickServ,LPT1,LPT2,AUX:*
+U:Uworld2.undernet.org:UWorld2,W,ChanSvr,ChanSaver,ChanServ,COM1,COM2,COM3,COM4:*
+U:Uworld.undernet.org:Uworld,X,NickSvr,NickSaver,NickServ,LPT1,LPT2,AUX:*
#
# While running your server, you will most probably encounter individuals
#include <sys/types.h> /* time_t, size_t */
#define INCLUDED_sys_types_h
#endif
+#ifndef INCLUDED_netinet_in_h
+#include <netinet/in.h> /* in_addr */
+#define INCLUDED_netinet_in_h
+#endif
struct Client;
-/*----------------------------------------------------------------------------
+/*
* Prototypes
- *--------------------------------------------------------------------------*/
-extern void ip_registry_expire(void);
-extern int ip_registry_check_local(unsigned int addr, time_t* next_target_out);
-extern void ip_registry_add_local(unsigned int addr);
-extern int ip_registry_remote_connect(struct Client *cptr);
-extern void ip_registry_connect_succeeded(struct Client *cptr);
-extern void ip_registry_local_disconnect(struct Client *cptr);
-extern void ip_registry_remote_disconnect(struct Client *cptr);
-extern void ip_registry_connect_succeeded(struct Client *cptr);
-extern int ip_registry_count(unsigned int addr);
+ */
+extern int IPcheck_local_connect(struct in_addr ip, time_t* next_target_out);
+extern void IPcheck_connect_fail(struct in_addr ip);
+extern void IPcheck_connect_succeeded(struct Client *cptr);
+extern int IPcheck_remote_connect(struct Client *cptr, int is_burst);
+extern void IPcheck_disconnect(struct Client *cptr);
+extern unsigned short IPcheck_nr(struct Client* cptr);
+extern void IPcheck_expire();
#endif /* INCLUDED_ipcheck_h */
#define TOK_CLEARMODE "CM"
#define CMD_CLEARMODE MSG_CLEARMODE, TOK_CLEARMODE
+#define MSG_POST "POST" /* POST */
+#define TOK_POST "POST"
+
/*
* Constants
*/
*
* $Id$
*
+ *
+ * This file should be edited in a window with a width of 141 characters
+ * ick
*/
#include "IPcheck.h"
#include "client.h"
#include "ircd.h"
-#include "numnicks.h"
+#include "numnicks.h" /* NumNick, NumServ (GODMODE) */
#include "ircd_alloc.h"
-#include "msg.h"
-#include "s_bsd.h"
-#include "s_debug.h"
-#include "s_user.h"
+#include "s_bsd.h" /* SetIPChecked */
+#include "s_debug.h" /* Debug */
+#include "s_user.h" /* TARGET_DELAY */
#include "send.h"
#include <assert.h>
-#include <arpa/inet.h>
-#include <stdio.h>
-#include <string.h>
-
-#if 0
-#warning Nick collisions are horribly broken in
-#warning this version, and its known to core on
-#warning a whim. If your even concidering
-#warning running this on something resembling a
-#warning production network, dont bother, its
-#warning not worth your time. To those of you
-#warning who grabbed the latest CVS version to
-#warning bug test it, thanks, but I recommend
-#warning you stick to previous versions for the
-#warning time being.
-#error --- Broken code ---
-#endif
+
struct IPTargetEntry {
int count;
};
struct IPRegistryEntry {
- struct IPRegistryEntry *next;
- struct IPTargetEntry *target;
+ struct IPRegistryEntry* next;
+ struct IPTargetEntry* target;
unsigned int addr;
- time_t last_connect;
- unsigned char connected;
+ int last_connect;
+ unsigned short connected;
unsigned char attempts;
};
-
/*
* Hash table for IPv4 address registry
*
* Hash table size must be a power of 2
* Use 64K hash table to conserve memory
*/
-/*----------------------------------------------------------------------------
- * Compile-time Configuration
- *--------------------------------------------------------------------------*/
#define IP_REGISTRY_TABLE_SIZE 0x10000
#define MASK_16 0xffff
-/* We allow 6 connections in 60 seconds */
-#define IPCHECK_CLONE_LIMIT 6
-#define IPCHECK_CLONE_PERIOD 60
-#define IPCHECK_CLONE_DELAY 600
-
-
-/*----------------------------------------------------------------------------
- * Handy Macros
- *--------------------------------------------------------------------------*/
-#define NOW (CurrentTime)
-#define CONNECTED_SINCE(x) (NOW - (x->last_connect))
+#define NOW ((unsigned short)(CurrentTime & MASK_16))
+#define CONNECTED_SINCE(x) (NOW - (x))
+#define IPCHECK_CLONE_LIMIT 4
+#define IPCHECK_CLONE_PERIOD 40
+#define IPCHECK_CLONE_DELAY 600
-/*----------------------------------------------------------------------------
- * Global Data (ugly!)
- *--------------------------------------------------------------------------*/
-static struct IPRegistryEntry *hashTable[IP_REGISTRY_TABLE_SIZE];
-static struct IPRegistryEntry *freeList = 0;
+static struct IPRegistryEntry* hashTable[IP_REGISTRY_TABLE_SIZE];
+static struct IPRegistryEntry* freeList = 0;
-/*----------------------------------------------------------------------------
- * ip_registry_hash: Create a hash key for an IP registry entry and return
- * the value. (Is unsigned int really a good type to give
- * to the IP argument? Ugly. This should probably be a
- * struct in_addr. This is asking for trouble. --ZS)
- *--------------------------------------------------------------------------*/
static unsigned int ip_registry_hash(unsigned int ip)
{
return ((ip >> 16) ^ ip) & (IP_REGISTRY_TABLE_SIZE - 1);
}
-
-/*----------------------------------------------------------------------------
- * ip_registry_find: Find a given IP registry entry and return it.
- *--------------------------------------------------------------------------*/
-static struct IPRegistryEntry *ip_registry_find(unsigned int ip)
+static struct IPRegistryEntry* ip_registry_find(unsigned int ip)
{
- struct IPRegistryEntry *entry = 0;
-
- for (entry = hashTable[ip_registry_hash(ip)]; entry; entry = entry->next) {
+ struct IPRegistryEntry* entry = hashTable[ip_registry_hash(ip)];
+ for ( ; entry; entry = entry->next) {
if (entry->addr == ip)
- return entry;
+ break;
}
-
- return NULL;
+ return entry;
}
-
-/*----------------------------------------------------------------------------
- * ip_registry_add: Add an entry to the IP registry
- *--------------------------------------------------------------------------*/
-static void ip_registry_add(struct IPRegistryEntry *entry)
+static void ip_registry_add(struct IPRegistryEntry* entry)
{
unsigned int bucket = ip_registry_hash(entry->addr);
-
entry->next = hashTable[bucket];
hashTable[bucket] = entry;
}
-
-/*----------------------------------------------------------------------------
- * ip_registry_remove: Remove an entry from the IP registry
- *--------------------------------------------------------------------------*/
-static void ip_registry_remove(struct IPRegistryEntry* entry)
+static void ip_registry_remove(struct IPRegistryEntry* entry)
{
unsigned int bucket = ip_registry_hash(entry->addr);
-
if (hashTable[bucket] == entry)
hashTable[bucket] = entry->next;
else {
- struct IPRegistryEntry *prev;
-
- for (prev = hashTable[bucket]; prev; prev = prev->next) {
+ struct IPRegistryEntry* prev = hashTable[bucket];
+ for ( ; prev; prev = prev->next) {
if (prev->next == entry) {
prev->next = entry->next;
break;
}
}
-
-/*----------------------------------------------------------------------------
- * ip_registry_new_entry(): Creates and initializes an IP Registry entry.
- * NOW ALSO ADDS IT TO THE LIST! --ZS
- *--------------------------------------------------------------------------*/
-static struct IPRegistryEntry *ip_registry_new_entry(unsigned int addr, int attempt)
+static struct IPRegistryEntry* ip_registry_new_entry()
{
struct IPRegistryEntry* entry = freeList;
-
if (entry)
freeList = entry->next;
else
- entry = (struct IPRegistryEntry *)MyMalloc(sizeof(struct IPRegistryEntry));
+ entry = (struct IPRegistryEntry*) MyMalloc(sizeof(struct IPRegistryEntry));
assert(0 != entry);
-
memset(entry, 0, sizeof(struct IPRegistryEntry));
entry->last_connect = NOW; /* Seconds since last connect attempt */
entry->connected = 1; /* connected clients for this IP */
- entry->attempts = attempt; /* Number attempts for this IP */
- entry->addr = addr; /* Entry's IP Address */
-
- ip_registry_add(entry);
-
+ entry->attempts = 1; /* Number attempts for this IP */
return entry;
}
-
-/*----------------------------------------------------------------------------
- * ip_registry_delete_entry: Frees an entry and adds the structure to a list
- * of free structures. (We should probably reclaim
- * the freelist every once in a while! This is
- * potentially a way to DoS the server... -ZS)
- *--------------------------------------------------------------------------*/
-static void ip_registry_delete_entry(struct IPRegistryEntry *entry)
+static void ip_registry_delete_entry(struct IPRegistryEntry* entry)
{
if (entry->target)
MyFree(entry->target);
-
entry->next = freeList;
freeList = entry;
}
-
-/*----------------------------------------------------------------------------
- * ip_registry_update_free_targets:
- *--------------------------------------------------------------------------*/
-static unsigned int ip_registry_update_free_targets(struct IPRegistryEntry *entry)
+static unsigned int ip_registry_update_free_targets(struct IPRegistryEntry* entry)
{
unsigned int free_targets = STARTTARGETS;
if (entry->target) {
- free_targets = (entry->target->count +
- (CONNECTED_SINCE(entry) / TARGET_DELAY));
-
+ free_targets = entry->target->count + (CONNECTED_SINCE(entry->last_connect) / TARGET_DELAY);
if (free_targets > STARTTARGETS)
free_targets = STARTTARGETS;
-
entry->target->count = free_targets;
}
-
return free_targets;
}
-
-/*----------------------------------------------------------------------------
- * ip_registry_expire_entry: expire an IP entry if it needs to be. If an
- * entry isn't expired, then also check the target
- * list to see if it needs to be expired.
- *--------------------------------------------------------------------------*/
-static void ip_registry_expire_entry(struct IPRegistryEntry *entry)
+static void ip_registry_expire_entry(struct IPRegistryEntry* entry)
{
/*
* Don't touch this number, it has statistical significance
* XXX - blah blah blah
- * ZS - Just -what- statistical significance does it -have-?
- * Iso - Noone knows, we've just been told not to touch it.
*/
- if (CONNECTED_SINCE(entry) > 120 && 0 != entry->target) {
- MyFree(entry->target);
- entry->target = 0;
- }
- if (CONNECTED_SINCE(entry) > 600) {
+ if (CONNECTED_SINCE(entry->last_connect) > 600) {
+ /*
+ * expired
+ */
ip_registry_remove(entry);
ip_registry_delete_entry(entry);
}
+ else if (CONNECTED_SINCE(entry->last_connect) > 120 && 0 != entry->target) {
+ /*
+ * Expire storage of targets
+ */
+ MyFree(entry->target);
+ entry->target = 0;
+ }
}
-
-/*----------------------------------------------------------------------------
- * ip_registry_expire: Expire all of the needed entries in the hash table
- *--------------------------------------------------------------------------*/
-void ip_registry_expire(void)
+/*
+ * ip_registry_expire
+ */
+static void ip_registry_expire()
{
- struct IPRegistryEntry *entry;
- struct IPRegistryEntry *entry_next;
- static time_t next_expire = 0;
int i;
-
- /* Only do this if we're ready to */
- if (next_expire >= CurrentTime)
- return;
+ struct IPRegistryEntry* entry;
+ struct IPRegistryEntry* entry_next;
for (i = 0; i < IP_REGISTRY_TABLE_SIZE; ++i) {
for (entry = hashTable[i]; entry; entry = entry_next) {
ip_registry_expire_entry(entry);
}
}
-
- next_expire = CurrentTime + 60;
}
-
-/*----------------------------------------------------------------------------
+/*
+ * IPcheck_local_connect
*
* Event:
* A new connection was accept()-ed with IP number `cptr->ip.s_addr'.
*
* Throttling:
*
- * A connection should be rejected when a connection from the same IP
- * number was received IPCHECK_CLONE_LIMIT times before this connect
- * attempt, with reconnect intervals of IPCHECK_CLONE_PERIOD seconds
- * or less.
+ * A connection should be rejected when a connection from the same IP number was
+ * received IPCHECK_CLONE_LIMIT times before this connect attempt, with
+ * reconnect intervals of IPCHECK_CLONE_PERIOD seconds or less.
*
* Free target inheritance:
*
* structure, or left at STARTTARGETS. This can be done by changing
* cptr->nexttarget to be `now - (TARGET_DELAY * (FREE_TARGETS - 1))',
* where FREE_TARGETS may range from 0 till STARTTARGETS.
- *--------------------------------------------------------------------------*/
-int ip_registry_check_local(unsigned int addr, time_t *next_target_out)
+ */
+int ip_registry_check_local(unsigned int addr, time_t* next_target_out)
{
- struct IPRegistryEntry *entry = ip_registry_find(addr);
+ struct IPRegistryEntry* entry = ip_registry_find(addr);
unsigned int free_targets = STARTTARGETS;
- assert(0 != next_target_out);
-
- /* If they've never connected before, let them on */
if (0 == entry) {
- Debug((DEBUG_DEBUG,"IPcheck: Local user allowed - unseen"));
- entry = ip_registry_new_entry(addr, 1);
+ entry = ip_registry_new_entry();
+ entry->addr = addr; /* The IP number of registry entry */
+ ip_registry_add(entry);
return 1;
}
-
- /* Keep track of how many people have connected */
- entry->connected++;
-
- /* Do not allow more than 250 connects from a single IP, EVER. */
- if (250 <= entry->connected) {
- Debug((DEBUG_DEBUG,"IPcheck: Local user disallowed - Too many connections"));
- entry->connected--;
+ /* Note that this also connects server connects.
+ * It is hard and not interesting, to change that.
+ *
+ * Don't allow more then 255 connects from one IP number, ever
+ */
+ if (0 == ++entry->connected)
return 0;
- }
- /* If our threshhold has elapsed, reset the counter so we don't throttle,
- * IPCHECK_CLONE_LIMIT connections every IPCHECK_CLONE_PERIOD
- */
- if (CONNECTED_SINCE(entry) > IPCHECK_CLONE_PERIOD) {
+ if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_PERIOD)
entry->attempts = 0;
- entry->last_connect = NOW;
- }
-
- /* Count the number of recent attempts */
- entry->attempts++;
-
- if (250 <= entry->attempts)
- --entry->attempts; /* Disallow overflow */
-
free_targets = ip_registry_update_free_targets(entry);
+ entry->last_connect = NOW;
+
+ if (0 == ++entry->attempts) /* Check for overflow */
+ --entry->attempts;
- /* Have they connected less than IPCHECK_CLONE_LIMIT times && next_target_out */
- if (entry->attempts < IPCHECK_CLONE_LIMIT && next_target_out) {
+ if (entry->attempts < IPCHECK_CLONE_LIMIT) {
+ if (next_target_out)
*next_target_out = CurrentTime - (TARGET_DELAY * free_targets - 1);
- entry->last_connect = NOW;
- Debug((DEBUG_DEBUG,"IPcheck: Local user allowed"));
- return 1;
}
-
- /* If the server is younger than IPCHECK_CLONE_DELAY then the person
- * is allowed on.
- */
- if ((CurrentTime - me.since) < IPCHECK_CLONE_DELAY) {
- Debug((DEBUG_DEBUG,"IPcheck: Local user allowed during server startup"));
+ else if ((CurrentTime - me.since) > IPCHECK_CLONE_DELAY) {
+ /*
+ * Don't refuse connection when we just rebooted the server
+ */
+#ifdef NOTHROTTLE
return 1;
+#else
+ --entry->connected;
+ return 0;
+#endif
}
-
- /* Otherwise they're throttled */
- entry->connected--;
- Debug((DEBUG_DEBUG,"IPcheck: Throttling local user"));
- return 0;
+ return 1;
}
/*
- * Add someone to the ip registry without throttling them.
- * This is used for server connections.
+ * IPcheck_remote_connect
+ *
+ * Event:
+ * A remote client connected to Undernet, with IP number `cptr->ip.s_addr'
+ * and hostname `hostname'.
+ *
+ * Action:
+ * Update the IPcheck registry.
+ * Return 0 on failure, 1 on success.
*/
-void ip_registry_add_local(unsigned int addr)
+int ip_registry_check_remote(struct Client* cptr, int is_burst)
{
- struct IPRegistryEntry *entry = ip_registry_find(addr);
-
- /* If they've never connected before, let them on */
+ struct IPRegistryEntry* entry = ip_registry_find(cptr->ip.s_addr);
+
+ /*
+ * Mark that we did add/update an IPregistry entry
+ */
+ SetIPChecked(cptr);
if (0 == entry) {
- Debug((DEBUG_DEBUG,"IPcheck: Local user allowed - unseen"));
- entry = ip_registry_new_entry(addr, 1);
- return;
+ entry = ip_registry_new_entry();
+ entry->addr = cptr->ip.s_addr;
+ if (is_burst)
+ entry->attempts = 0;
+ ip_registry_add(entry);
}
-
- /* Keep track of how many people have connected */
- entry->connected++;
-
- assert(250 <= entry->connected);
-
- return;
+ else {
+ if (0 == ++entry->connected) {
+ /*
+ * Don't allow more then 255 connects from one IP number, ever
+ */
+ return 0;
+ }
+ if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_PERIOD)
+ entry->attempts = 0;
+ if (!is_burst) {
+ if (0 == ++entry->attempts) {
+ /*
+ * Check for overflow
+ */
+ --entry->attempts;
+ }
+ ip_registry_update_free_targets(entry);
+ entry->last_connect = NOW;
+ }
+ }
+ return 1;
}
-/*----------------------------------------------------------------------------
- * ip_registry_remote_connect
+/*
+ * IPcheck_connect_fail
*
- * Does anything that needs to be done once we actually have a client
- * structure to play with on a remote connection.
- * returns:
- * 1 - allowed to connect
- * 0 - disallowed.
- *--------------------------------------------------------------------------*/
-int ip_registry_remote_connect(struct Client *cptr)
+ * Event:
+ * This local client failed to connect due to legal reasons.
+ *
+ * Action:
+ * Neutralize the effect of calling IPcheck_local_connect, in such
+ * a way that the client won't be penalized when trying to reconnect
+ * again.
+ */
+void ip_registry_connect_fail(unsigned int addr)
{
- struct IPRegistryEntry *entry = ip_registry_find(cptr->ip.s_addr);
- assert(0 != cptr);
-
- /* If they've never connected before, let them on */
- if (0 == entry) {
- entry = ip_registry_new_entry(cptr->ip.s_addr, 1);
- SetIPChecked(cptr);
- Debug((DEBUG_DEBUG,"IPcheck: First remote connection. connected=%i",entry->connected));
- return 1;
- }
-
- /* Keep track of how many people have connected */
- entry->connected++;
- SetIPChecked(cptr);
-
- /* Do not allow more than 250 connections from one IP.
- * This can happen by having 128 clients on one server, and 128 on another
- * and then the servers joining after a netsplit
- */
- if (250 <= entry->connected) {
- sendto_ops("IPcheck Ghost! [%s]",inet_ntoa(cptr->ip));
- Debug((DEBUG_DEBUG,"IPcheck: Too many connected from IP: %i",entry->connected));
- return 0;
- }
-
- Debug((DEBUG_DEBUG,"IPcheck: %i people connected",entry->connected));
-
- /* They are allowed to connect */
- return 1;
+ struct IPRegistryEntry* entry = ip_registry_find(addr);
+ if (entry)
+ --entry->attempts;
}
-/*----------------------------------------------------------------------------
+/*
* IPcheck_connect_succeeded
*
* Event:
* A client succeeded to finish the registration.
*
* Finish IPcheck registration of a successfully, locally connected client.
- *--------------------------------------------------------------------------*/
+ */
void ip_registry_connect_succeeded(struct Client *cptr)
{
+ const char* tr = "";
unsigned int free_targets = STARTTARGETS;
- struct IPRegistryEntry *entry;
-
- assert(cptr);
-
- entry = ip_registry_find(cptr->ip.s_addr);
-
-
- assert(entry);
+ struct IPRegistryEntry* entry = ip_registry_find(cptr->ip.s_addr);
+ if (!entry) {
+ Debug((DEBUG_ERROR, "Missing registry entry for: %s", cptr->sock_ip));
+ return;
+ }
if (entry->target) {
memcpy(cptr->targets, entry->target->targets, MAXTARGETS);
free_targets = entry->target->count;
+ tr = " tr";
}
-
- sendcmdto_one(&me, CMD_NOTICE, cptr, "%C :connected %u attempts %u/%u free targets %u/%u%s"
- " IPcheck: %s",
- cptr, entry->connected, entry->attempts, IPCHECK_CLONE_LIMIT,
- free_targets, STARTTARGETS,
- ((entry->target) ? " [Inherited Targets]" : ""),
- ((CurrentTime - me.since) < IPCHECK_CLONE_DELAY) ? "Disabled" : "Enabled");
-
- SetIPChecked(cptr);
+ sendto_one(cptr, ":%s NOTICE %s :on %u ca %u(%u) ft %u(%u)%s",
+ me.name, cptr->name, entry->connected, entry->attempts,
+ IPCHECK_CLONE_LIMIT, free_targets, STARTTARGETS, tr);
}
-
-/*----------------------------------------------------------------------------
+/*
* IPcheck_disconnect
*
* Event:
- * A local client disconnected.
+ * A local client disconnected or a remote client left Undernet.
*
* Action:
* Update the IPcheck registry.
* Remove all expired IPregistry structures from the hash bucket
* that belongs to this clients IP number.
- *--------------------------------------------------------------------------*/
-void ip_registry_local_disconnect(struct Client *cptr)
+ */
+void ip_registry_disconnect(struct Client *cptr)
{
- struct IPRegistryEntry *entry;
- unsigned int free_targets;
-
- assert(0 != cptr);
-
- entry = ip_registry_find(cptr->ip.s_addr);
-
- Debug((DEBUG_DEBUG,"IPcheck: Local Disconnect"));
-
- assert(IsIPChecked(cptr));
-
- assert(entry);
-
- assert(entry->connected > 0);
-
- if (entry->connected > 0) {
- entry->connected--;
+ struct IPRegistryEntry* entry = ip_registry_find(cptr->ip.s_addr);
+ if (0 == entry) {
+ /*
+ * trying to find an entry for a server causes this to happen,
+ * servers should never have FLAGS_IPCHECK set
+ */
+ return;
}
-
/*
- * If this was the last one, set `last_connect' to disconnect time
- * (used for expiration) Note that we reset attempts here as well if our
- * threshhold hasn't been crossed.
+ * If this was the last one, set `last_connect' to disconnect time (used for expiration)
*/
- if (0 == entry->connected) {
+ if (0 == --entry->connected) {
+ if (CONNECTED_SINCE(entry->last_connect) > IPCHECK_CLONE_LIMIT * IPCHECK_CLONE_PERIOD) {
+ /*
+ * Otherwise we'd penetalize for this old value if the client reconnects within 20 seconds
+ */
+ entry->attempts = 0;
+ }
ip_registry_update_free_targets(entry);
entry->last_connect = NOW;
}
-
- assert(MyConnect(cptr));
-
- if (0 == entry->target) {
- entry->target = (struct IPTargetEntry *)MyMalloc(sizeof(struct IPTargetEntry));
+ if (MyConnect(cptr)) {
+ unsigned int free_targets;
+ /*
+ * Copy the clients targets
+ */
+ if (0 == entry->target) {
+ entry->target = (struct IPTargetEntry*) MyMalloc(sizeof(struct IPTargetEntry));
+ entry->target->count = STARTTARGETS;
+ }
assert(0 != entry->target);
- entry->target->count = STARTTARGETS;
- }
- memcpy(entry->target->targets, cptr->targets, MAXTARGETS);
- /*
- * This calculation can be pretty unfair towards large multi-user hosts,
- * but there is "nothing" we can do without also allowing spam bots to
- * send more messages or by drastically increasing the ammount of memory
- * used in the IPregistry.
- *
- * The problem is that when a client disconnects, leaving no free targets,
- * then the next client from that IP number has to pay for it (getting no
- * free targets). But ALSO the next client, and the next client, and the
- * next client etc - until another client disconnects that DOES leave free
- * targets. The reason for this is that if there are 10 SPAM bots, and
- * they all disconnect at once, then they ALL should get no free targets
- * when reconnecting. We'd need to store an entry per client (instead of
- * per IP number) to avoid this.
- */
- if (cptr->nexttarget < CurrentTime)
- free_targets = (CurrentTime - cptr->nexttarget) / TARGET_DELAY + 1;
- else
- free_targets = 0;
-
- /* Add bonus, if you've been connected for more than 10 minutes you
- * get a free target every TARGET_DELAY seconds.
- * this is pretty fuzzy, but it will help in some cases.
- */
- if ((CurrentTime - cptr->firsttime) > 600)
- free_targets += (CurrentTime - cptr->firsttime - 600) / TARGET_DELAY;
+ memcpy(entry->target->targets, cptr->targets, MAXTARGETS);
+ /*
+ * This calculation can be pretty unfair towards large multi-user hosts, but
+ * there is "nothing" we can do without also allowing spam bots to send more
+ * messages or by drastically increasing the ammount of memory used in the IPregistry.
+ *
+ * The problem is that when a client disconnects, leaving no free targets, then
+ * the next client from that IP number has to pay for it (getting no free targets).
+ * But ALSO the next client, and the next client, and the next client etc - until
+ * another client disconnects that DOES leave free targets. The reason for this
+ * is that if there are 10 SPAM bots, and they all disconnect at once, then they
+ * ALL should get no free targets when reconnecting. We'd need to store an entry
+ * per client (instead of per IP number) to avoid this.
+ */
+ if (cptr->nexttarget < CurrentTime) {
+ /*
+ * Number of free targets
+ */
+ free_targets = (CurrentTime - cptr->nexttarget) / TARGET_DELAY + 1;
+ }
+ else
+ free_targets = 0;
+ /*
+ * Add bonus, this is pretty fuzzy, but it will help in some cases.
+ */
+ if ((CurrentTime - cptr->firsttime) > 600)
+ /*
+ * Was longer then 10 minutes online?
+ */
+ free_targets += (CurrentTime - cptr->firsttime - 600) / TARGET_DELAY;
+ /*
+ * Finally, store smallest value for Judgement Day
+ */
+ if (free_targets < entry->target->count)
+ entry->target->count = free_targets;
+ }
+}
- /* Finally, store smallest value for Judgement Day */
- if (free_targets < entry->target->count)
- entry->target->count = free_targets;
-
+/*
+ * IPcheck_nr
+ *
+ * Returns number of clients with the same IP number
+ */
+int ip_registry_count(unsigned int addr)
+{
+ struct IPRegistryEntry* entry = ip_registry_find(addr);
+ return (entry) ? entry->connected : 0;
}
-/*----------------------------------------------------------------------------
- * ip_registry_remote_disconnect
+/*
+ * IPcheck_local_connect
*
* Event:
- * A remote client disconnected.
+ * A new connection was accept()-ed with IP number `cptr->ip.s_addr'.
*
* Action:
* Update the IPcheck registry.
- * Remove all expired IPregistry structures from the hash bucket
- * that belongs to this clients IP number.
- *--------------------------------------------------------------------------*/
-void ip_registry_remote_disconnect(struct Client *cptr)
+ * Return:
+ * 1 : You're allowed to connect.
+ * 0 : You're not allowed to connect.
+ *
+ * Throttling:
+ *
+ * A connection should be rejected when a connection from the same IP number was
+ * received IPCHECK_CLONE_LIMIT times before this connect attempt, with
+ * reconnect intervals of IPCHECK_CLONE_PERIOD seconds or less.
+ *
+ * Free target inheritance:
+ *
+ * When the client is accepted, then the number of Free Targets
+ * of the cptr is set to the value stored in the found IPregistry
+ * structure, or left at STARTTARGETS. This can be done by changing
+ * cptr->nexttarget to be `now - (TARGET_DELAY * (FREE_TARGETS - 1))',
+ * where FREE_TARGETS may range from 0 till STARTTARGETS.
+ */
+int IPcheck_local_connect(struct in_addr a, time_t* next_target_out)
{
- struct IPRegistryEntry *entry;
+ assert(0 != next_target_out);
+ return ip_registry_check_local(a.s_addr, next_target_out);
+}
+/*
+ * IPcheck_remote_connect
+ *
+ * Event:
+ * A remote client connected to Undernet, with IP number `cptr->ip.s_addr'
+ * and hostname `hostname'.
+ *
+ * Action:
+ * Update the IPcheck registry.
+ * Return 0 on failure, 1 on success.
+ */
+int IPcheck_remote_connect(struct Client *cptr, int is_burst)
+{
assert(0 != cptr);
+ return ip_registry_check_remote(cptr, is_burst);
+}
- entry = ip_registry_find(cptr->ip.s_addr);
-
- assert(entry);
-
- assert(entry->connected > 0);
- Debug((DEBUG_DEBUG,"IPcheck: Remote Disconnect"));
+/*
+ * IPcheck_connect_fail
+ *
+ * Event:
+ * This local client failed to connect due to legal reasons.
+ *
+ * Action:
+ * Neutralize the effect of calling IPcheck_local_connect, in such
+ * a way that the client won't be penalized when trying to reconnect
+ * again.
+ */
+void IPcheck_connect_fail(struct in_addr a)
+{
+ ip_registry_connect_fail(a.s_addr);
+}
- if (entry->connected > 0) {
- entry->connected--;
- }
+/*
+ * IPcheck_connect_succeeded
+ *
+ * Event:
+ * A client succeeded to finish the registration.
+ *
+ * Finish IPcheck registration of a successfully, locally connected client.
+ */
+void IPcheck_connect_succeeded(struct Client *cptr)
+{
+ assert(0 != cptr);
+ ip_registry_connect_succeeded(cptr);
+}
- /*
- * If this was the last one, set `last_connect' to disconnect time
- * (used for expiration) Note that we reset attempts here as well if our
- * threshhold hasn't been crossed.
- */
- if (0 == entry->connected) {
- ip_registry_update_free_targets(entry);
- entry->last_connect=NOW;
- }
+/*
+ * IPcheck_disconnect
+ *
+ * Event:
+ * A local client disconnected or a remote client left Undernet.
+ *
+ * Action:
+ * Update the IPcheck registry.
+ * Remove all expired IPregistry structures from the hash bucket
+ * that belongs to this clients IP number.
+ */
+void IPcheck_disconnect(struct Client *cptr)
+{
+ assert(0 != cptr);
+ ip_registry_disconnect(cptr);
}
-/*----------------------------------------------------------------------------
+/*
* IPcheck_nr
*
* Returns number of clients with the same IP number
- *--------------------------------------------------------------------------*/
-int ip_registry_count(unsigned int addr)
+ */
+unsigned short IPcheck_nr(struct Client *cptr)
{
- struct IPRegistryEntry *entry = ip_registry_find(addr);
- return (entry) ? entry->connected : 0;
+ assert(0 != cptr);
+ return ip_registry_count(cptr->ip.s_addr);
}
+
+void IPcheck_expire()
+{
+ static time_t next_expire = 0;
+ if (next_expire < CurrentTime) {
+ ip_registry_expire();
+ next_expire = CurrentTime + 60;
+ }
+}
+
+
IPcheck.c \
channel.c \
class.c \
+ client.c \
crule.c \
dbuf.c \
fda.c \
# DO NOT DELETE THIS LINE -- make depend depends on it.
IPcheck.o: IPcheck.c ../include/IPcheck.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/numnicks.h ../include/ircd_alloc.h \
- ../include/fda.h ../include/msg.h ../include/s_bsd.h \
- ../include/s_debug.h ../include/s_user.h ../include/send.h
+ ../include/fda.h ../include/s_bsd.h ../include/s_debug.h \
+ ../include/s_user.h ../include/send.h
channel.o: channel.c ../include/channel.h ../config/config.h \
../config/setup.h ../include/ircd_defs.h ../include/client.h \
../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/s_user.h ../include/send.h ../include/sprintf_irc.h \
../include/support.h ../include/sys.h ../include/whowas.h
class.o: class.c ../include/class.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_reply.h ../include/list.h \
../include/numeric.h ../include/s_conf.h ../include/s_debug.h \
../include/send.h
crule.o: crule.c ../include/crule.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
../include/ircd_chattr.h ../include/ircd_string.h ../include/match.h \
fileio.o: fileio.c ../include/fileio.h ../include/ircd_alloc.h \
../include/fda.h
gline.o: gline.c ../include/gline.h ../config/config.h \
- ../config/setup.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+ ../config/setup.h ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/match.h ../include/numeric.h \
- ../include/s_bsd.h ../include/s_misc.h ../include/send.h \
- ../include/support.h ../include/msg.h ../include/numnicks.h \
- ../include/sys.h
-hash.o: hash.c ../include/hash.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/channel.h \
- ../config/config.h ../config/setup.h ../include/ircd_chattr.h \
- ../include/ircd_string.h ../include/ircd.h ../include/struct.h \
- ../include/msg.h ../include/send.h ../include/support.h \
- ../include/sys.h
+ ../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \
+ ../include/send.h ../include/support.h ../include/msg.h \
+ ../include/numnicks.h ../include/sys.h
+hash.o: hash.c ../include/hash.h ../include/client.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
+ ../include/channel.h ../config/config.h ../config/setup.h \
+ ../include/ircd_chattr.h ../include/ircd_string.h ../include/ircd.h \
+ ../include/struct.h ../include/msg.h ../include/send.h \
+ ../include/support.h ../include/sys.h
ircd.o: ircd.c ../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_defs.h ../include/IPcheck.h \
../include/class.h ../include/client.h ../include/dbuf.h \
../include/ircd_string.h ../config/config.h ../config/setup.h \
../include/ircd_chattr.h ../include/s_debug.h ../include/ircd_defs.h
ircd_log.o: ircd_log.c ../include/ircd_log.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
../config/config.h ../config/setup.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/s_debug.h ../include/struct.h
ircd_osdep.o: ircd_osdep.c ../include/ircd_osdep.h
../include/numeric.h ../include/numnicks.h ../include/s_debug.h \
../include/s_misc.h ../include/s_user.h ../include/send.h
ircd_reply.o: ircd_reply.c ../include/ircd_reply.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_snprintf.h ../include/numeric.h \
../include/s_conf.h ../include/s_debug.h ../include/send.h
ircd_signal.o: ircd_signal.c ../include/ircd_signal.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_defs.h
-ircd_snprintf.o: ircd_snprintf.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/channel.h \
- ../config/config.h ../config/setup.h ../include/ircd_snprintf.h \
- ../include/struct.h
+ircd_snprintf.o: ircd_snprintf.c ../include/client.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
+ ../include/channel.h ../config/config.h ../config/setup.h \
+ ../include/ircd_snprintf.h ../include/struct.h
ircd_string.o: ircd_string.c ../include/ircd_string.h \
../config/config.h ../config/setup.h ../include/ircd_chattr.h \
- ../include/ircd_defs.h chattr.tab.c
+ ../include/ircd_defs.h ../include/ircd_log.h chattr.tab.c
ircd_xopen.o: ircd_xopen.c ../include/ircd_xopen.h
jupe.o: jupe.c ../include/jupe.h ../config/config.h ../config/setup.h \
- ../include/client.h ../include/dbuf.h ../include/ircd_defs.h \
+ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \
../include/ircd_handler.h ../include/hash.h ../include/ircd.h \
../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
../include/ircd_reply.h ../include/ircd_string.h \
../include/s_misc.h ../include/send.h ../include/support.h \
../include/sys.h
list.o: list.c ../include/list.h ../include/class.h \
- ../include/client.h ../include/dbuf.h ../include/ircd_defs.h \
+ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \
../include/ircd_handler.h ../include/ircd.h ../config/config.h \
../config/setup.h ../include/struct.h ../include/ircd_alloc.h \
../include/fda.h ../include/ircd_reply.h ../include/ircd_string.h \
../include/numeric.h ../include/s_bsd.h ../include/s_conf.h \
../include/s_misc.h ../include/send.h ../include/sprintf_irc.h \
../include/sys.h
-m_admin.o: m_admin.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h \
- ../include/ircd_reply.h ../include/msg.h ../include/numeric.h \
- ../include/numnicks.h ../include/s_conf.h ../include/s_user.h
-m_away.o: m_away.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_admin.o: m_admin.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \
+ ../include/msg.h ../include/numeric.h ../include/numnicks.h \
+ ../include/s_conf.h ../include/s_user.h
+m_away.o: m_away.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
../include/msg.h ../include/numeric.h ../include/numnicks.h \
../include/s_conf.h ../include/s_misc.h ../include/send.h \
../include/support.h
-m_clearmode.o: m_clearmode.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/channel.h \
- ../config/config.h ../config/setup.h ../include/hash.h \
- ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \
- ../include/fda.h ../include/ircd_reply.h ../include/ircd_string.h \
- ../include/ircd_chattr.h ../include/list.h ../include/msg.h \
- ../include/numeric.h ../include/numnicks.h ../include/send.h \
- ../include/support.h
-m_close.o: m_close.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_clearmode.o: m_clearmode.c ../include/client.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
+ ../include/channel.h ../config/config.h ../config/setup.h \
+ ../include/hash.h ../include/ircd.h ../include/struct.h \
+ ../include/ircd_alloc.h ../include/fda.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../include/ircd_chattr.h ../include/list.h \
+ ../include/msg.h ../include/numeric.h ../include/numnicks.h \
+ ../include/send.h ../include/support.h
+m_close.o: m_close.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
../include/ircd_reply.h ../include/numeric.h ../include/s_bsd.h \
../include/send.h
-m_connect.o: m_connect.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/crule.h \
+m_connect.o: m_connect.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/crule.h \
../include/hash.h ../include/ircd.h ../config/config.h \
../config/setup.h ../include/struct.h ../include/ircd_log.h \
../include/ircd_reply.h ../include/ircd_string.h \
../include/msg.h ../include/numeric.h ../include/numnicks.h \
../include/s_bsd.h ../include/s_conf.h ../include/s_user.h \
../include/send.h
-m_cprivmsg.o: m_cprivmsg.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h \
- ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \
- ../config/setup.h ../include/ircd_chattr.h ../include/s_user.h
+m_cprivmsg.o: m_cprivmsg.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../config/config.h ../config/setup.h \
+ ../include/ircd_chattr.h ../include/s_user.h
m_create.o: m_create.c ../include/channel.h ../config/config.h \
../config/setup.h ../include/ircd_defs.h ../include/client.h \
../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
../include/numeric.h ../include/numnicks.h ../include/s_debug.h \
../include/send.h
-m_defaults.o: m_defaults.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_defaults.o: m_defaults.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
../include/ircd_reply.h ../include/numeric.h ../include/numnicks.h \
../include/send.h ../include/supported.h ../include/channel.h \
../include/version.h
-m_destruct.o: m_destruct.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_destruct.o: m_destruct.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
../include/numnicks.h ../include/send.h
-m_desynch.o: m_desynch.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_desynch.o: m_desynch.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
../include/numnicks.h ../include/s_bsd.h ../include/send.h
-m_die.o: m_die.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_die.o: m_die.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
../include/ircd.h ../include/struct.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
../include/numeric.h ../include/numnicks.h ../include/send.h
-m_error.o: m_error.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_error.o: m_error.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/numeric.h ../include/numnicks.h \
../include/s_debug.h ../include/s_misc.h ../include/send.h
-m_gline.o: m_gline.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/gline.h \
+m_gline.o: m_gline.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/gline.h \
../config/config.h ../config/setup.h ../include/hash.h \
../include/ircd.h ../include/struct.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \
../include/msg.h ../include/numeric.h ../include/numnicks.h \
../include/s_conf.h ../include/s_misc.h ../include/send.h \
../include/support.h
-m_help.o: m_help.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_help.o: m_help.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
../include/numnicks.h ../include/send.h
-m_info.o: m_info.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_info.o: m_info.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/list.h \
../include/msg.h ../include/numeric.h ../include/numnicks.h \
../include/s_user.h ../include/send.h
-m_ison.o: m_ison.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_ison.o: m_ison.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/numeric.h ../include/send.h
../include/ircd_string.h ../include/msg.h ../include/numeric.h \
../include/numnicks.h ../include/s_debug.h ../include/s_user.h \
../include/send.h ../include/handlers.h
-m_jupe.o: m_jupe.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/jupe.h \
+m_jupe.o: m_jupe.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/jupe.h \
../config/config.h ../config/setup.h ../include/hash.h \
../include/ircd.h ../include/struct.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \
../include/ircd.h ../include/struct.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
../include/numeric.h ../include/numnicks.h ../include/send.h
-m_kill.o: m_kill.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_kill.o: m_kill.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_log.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
../include/numeric.h ../include/numnicks.h ../include/s_misc.h \
../include/send.h ../include/whowas.h
-m_links.o: m_links.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_links.o: m_links.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/match.h ../include/msg.h \
../include/fda.h ../include/ircd_chattr.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/msg.h ../include/numeric.h \
../include/numnicks.h ../include/send.h
-m_lusers.o: m_lusers.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_lusers.o: m_lusers.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
../include/numnicks.h ../include/querycmds.h ../include/s_user.h \
../include/s_serv.h ../include/send.h
-m_map.o: m_map.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_map.o: m_map.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/map.h ../include/numeric.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
../include/numnicks.h ../include/s_conf.h ../include/s_debug.h \
../include/s_user.h ../include/send.h
-m_motd.o: m_motd.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_motd.o: m_motd.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/match.h ../include/msg.h \
../include/numeric.h ../include/numnicks.h ../include/s_user.h \
../include/send.h
m_nick.o: m_nick.c ../include/IPcheck.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
../include/hash.h ../include/ircd.h ../config/config.h \
../config/setup.h ../include/struct.h ../include/ircd_chattr.h \
../include/ircd_reply.h ../include/ircd_string.h ../include/msg.h \
../include/numeric.h ../include/numnicks.h ../include/s_debug.h \
../include/s_misc.h ../include/s_user.h ../include/send.h
-m_notice.o: m_notice.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h \
- ../include/ircd_chattr.h ../include/ircd_relay.h \
- ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \
- ../config/setup.h ../include/match.h ../include/msg.h \
- ../include/numeric.h ../include/send.h ../include/handlers.h
-m_oper.o: m_oper.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_notice.o: m_notice.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_chattr.h \
+ ../include/ircd_relay.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../config/config.h ../config/setup.h \
+ ../include/match.h ../include/msg.h ../include/numeric.h \
+ ../include/send.h ../include/handlers.h
+m_oper.o: m_oper.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_log.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/ircd_chattr.h \
../include/ircd_xopen.h ../include/msg.h ../include/numeric.h \
../include/numnicks.h ../include/querycmds.h ../include/s_conf.h \
- ../include/s_debug.h ../include/s_user.h ../include/send.h
-m_opmode.o: m_opmode.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/channel.h \
+ ../include/s_debug.h ../include/s_user.h ../include/s_misc.h \
+ ../include/send.h ../include/support.h
+m_opmode.o: m_opmode.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/channel.h \
../config/config.h ../config/setup.h ../include/hash.h \
../include/ircd.h ../include/struct.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
../include/ircd.h ../include/struct.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/ircd_chattr.h \
../include/numeric.h ../include/numnicks.h ../include/send.h
-m_pass.o: m_pass.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h \
- ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \
- ../config/setup.h ../include/ircd_chattr.h ../include/send.h
-m_ping.o: m_ping.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_pass.o: m_pass.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../config/config.h ../config/setup.h \
+ ../include/ircd_chattr.h ../include/send.h
+m_ping.o: m_ping.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \
../config/setup.h ../include/ircd_chattr.h ../include/ircd.h \
../include/struct.h ../include/msg.h ../include/numeric.h \
../include/numnicks.h ../include/s_debug.h ../include/send.h
-m_pong.o: m_pong.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_pong.o: m_pong.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
../include/numnicks.h ../include/s_user.h ../include/send.h
-m_privmsg.o: m_privmsg.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_privmsg.o: m_privmsg.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
../include/ircd_chattr.h ../include/ircd_relay.h \
../include/ircd_reply.h ../include/ircd_string.h ../include/match.h \
../include/msg.h ../include/numeric.h ../include/send.h
-m_proto.o: m_proto.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_proto.o: m_proto.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
../include/ircd_alloc.h ../include/fda.h ../include/ircd_chattr.h \
../include/ircd_reply.h ../include/ircd_string.h ../include/numeric.h \
../config/setup.h ../include/ircd_defs.h ../include/client.h \
../include/dbuf.h ../include/ircd_handler.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/struct.h ../include/s_misc.h
-m_rehash.o: m_rehash.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_rehash.o: m_rehash.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
../include/ircd_log.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/ircd_chattr.h \
../include/numeric.h ../include/s_conf.h ../include/send.h
-m_restart.o: m_restart.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_restart.o: m_restart.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
../include/ircd_log.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/ircd_chattr.h \
../include/numeric.h ../include/numnicks.h ../include/send.h
-m_rping.o: m_rping.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_rping.o: m_rping.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
../include/numnicks.h ../include/opercmds.h ../include/s_user.h \
../include/send.h
-m_rpong.o: m_rpong.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_rpong.o: m_rpong.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
../include/numnicks.h ../include/opercmds.h ../include/send.h
-m_server.o: m_server.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/crule.h \
- ../include/hash.h ../include/ircd.h ../config/config.h \
- ../config/setup.h ../include/struct.h ../include/ircd_log.h \
- ../include/ircd_reply.h ../include/ircd_string.h \
- ../include/ircd_chattr.h ../include/jupe.h ../include/list.h \
- ../include/match.h ../include/msg.h ../include/numeric.h \
- ../include/numnicks.h ../include/querycmds.h ../include/s_bsd.h \
- ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \
- ../include/s_serv.h ../include/send.h ../include/userload.h
-m_settime.o: m_settime.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_server.o: m_server.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
+ ../include/ircd.h ../config/config.h ../config/setup.h \
+ ../include/struct.h ../include/ircd_log.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../include/ircd_chattr.h ../include/jupe.h \
+ ../include/list.h ../include/match.h ../include/msg.h \
+ ../include/numeric.h ../include/numnicks.h ../include/querycmds.h \
+ ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \
+ ../include/s_misc.h ../include/s_serv.h ../include/send.h \
+ ../include/userload.h
+m_settime.o: m_settime.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/list.h ../include/msg.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/list.h \
../include/msg.h ../include/numeric.h ../include/numnicks.h \
../include/s_user.h ../include/send.h
-m_squit.o: m_squit.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_squit.o: m_squit.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_chattr.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/numeric.h ../include/numnicks.h \
../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \
../include/s_serv.h ../include/s_user.h ../include/send.h \
../include/userload.h
-m_time.o: m_time.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_time.o: m_time.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
../include/numeric.h ../include/numnicks.h ../include/send.h
m_trace.o: m_trace.c ../include/class.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
../include/hash.h ../include/ircd.h ../config/config.h \
../config/setup.h ../include/struct.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \
../include/msg.h ../include/numeric.h ../include/numnicks.h \
../include/s_bsd.h ../include/s_conf.h ../include/s_user.h \
../include/send.h ../include/version.h
-m_uping.o: m_uping.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_uping.o: m_uping.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/match.h ../include/msg.h \
../include/numeric.h ../include/numnicks.h ../include/s_conf.h \
../include/s_user.h ../include/send.h ../include/uping.h
-m_user.o: m_user.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
+m_user.o: m_user.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd.h \
../config/config.h ../config/setup.h ../include/struct.h \
../include/ircd_chattr.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/numeric.h ../include/numnicks.h \
../include/s_debug.h ../include/s_misc.h ../include/s_user.h \
../include/send.h
-m_userhost.o: m_userhost.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h \
- ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \
- ../config/setup.h ../include/ircd_chattr.h ../include/numeric.h \
- ../include/s_user.h ../include/struct.h
-m_userip.o: m_userip.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h \
- ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \
- ../config/setup.h ../include/ircd_chattr.h ../include/numeric.h \
- ../include/s_user.h ../include/struct.h
-m_version.o: m_version.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_userhost.o: m_userhost.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../config/config.h ../config/setup.h \
+ ../include/ircd_chattr.h ../include/numeric.h ../include/s_user.h \
+ ../include/struct.h
+m_userip.o: m_userip.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../config/config.h ../config/setup.h \
+ ../include/ircd_chattr.h ../include/numeric.h ../include/s_user.h \
+ ../include/struct.h
+m_version.o: m_version.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
../include/numeric.h ../include/numnicks.h ../include/s_user.h \
../include/send.h
-m_wallops.o: m_wallops.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h \
- ../include/ircd_reply.h ../include/ircd_string.h ../config/config.h \
- ../config/setup.h ../include/ircd_chattr.h ../include/msg.h \
- ../include/numeric.h ../include/send.h
+m_wallops.o: m_wallops.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/ircd_reply.h \
+ ../include/ircd_string.h ../config/config.h ../config/setup.h \
+ ../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
+ ../include/send.h
m_who.o: m_who.c ../include/channel.h ../config/config.h \
../config/setup.h ../include/ircd_defs.h ../include/client.h \
../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \
../include/msg.h ../include/numeric.h ../include/numnicks.h \
../include/s_user.h ../include/send.h ../include/whocmds.h
-m_whowas.o: m_whowas.c ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/hash.h \
+m_whowas.o: m_whowas.c ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/hash.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_reply.h ../include/ircd_string.h \
../include/ircd_chattr.h ../include/msg.h ../include/numeric.h \
../include/numnicks.h ../include/s_user.h ../include/s_misc.h \
../include/send.h ../include/whowas.h
-map.o: map.c ../include/map.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
- ../config/config.h ../config/setup.h ../include/struct.h \
- ../include/ircd_reply.h ../include/list.h ../include/match.h \
- ../include/numeric.h ../include/numnicks.h ../include/querycmds.h \
- ../include/send.h
+map.o: map.c ../include/map.h ../include/client.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
+ ../include/ircd.h ../config/config.h ../config/setup.h \
+ ../include/struct.h ../include/ircd_reply.h ../include/list.h \
+ ../include/match.h ../include/numeric.h ../include/numnicks.h \
+ ../include/querycmds.h ../include/send.h
match.o: match.c ../include/match.h ../include/ircd_chattr.h
numnicks.o: numnicks.c ../include/numnicks.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/match.h \
../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h
opercmds.o: opercmds.c ../include/opercmds.h ../include/class.h \
- ../include/client.h ../include/dbuf.h ../include/ircd_defs.h \
- ../include/ircd_handler.h ../include/crule.h ../include/ircd.h \
- ../config/config.h ../config/setup.h ../include/struct.h \
- ../include/ircd_chattr.h ../include/ircd_reply.h \
- ../include/ircd_string.h ../include/listener.h ../include/match.h \
- ../include/msg.h ../include/numeric.h ../include/numnicks.h \
- ../include/s_conf.h ../include/send.h
+ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \
+ ../include/ircd_handler.h ../include/ircd.h ../config/config.h \
+ ../config/setup.h ../include/struct.h ../include/ircd_chattr.h \
+ ../include/ircd_reply.h ../include/ircd_string.h \
+ ../include/listener.h ../include/match.h ../include/msg.h \
+ ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \
+ ../include/send.h
packet.o: packet.c ../include/packet.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_chattr.h ../include/parse.h \
../include/s_bsd.h ../include/s_misc.h ../include/send.h
parse.o: parse.c ../include/parse.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
../include/channel.h ../config/config.h ../config/setup.h \
../include/handlers.h ../include/hash.h ../include/ircd.h \
../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
querycmds.o: querycmds.c ../include/querycmds.h
random.o: random.c ../include/random.h ../config/config.h \
../config/setup.h
-res.o: res.c ../include/res.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/ircd.h \
- ../config/config.h ../config/setup.h ../include/struct.h \
- ../include/ircd_alloc.h ../include/fda.h ../include/ircd_log.h \
- ../include/ircd_osdep.h ../include/ircd_reply.h \
+res.o: res.c ../include/res.h ../include/client.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
+ ../include/ircd.h ../config/config.h ../config/setup.h \
+ ../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
+ ../include/ircd_log.h ../include/ircd_osdep.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/msg.h \
../include/numeric.h ../include/s_bsd.h ../include/s_debug.h \
../include/s_misc.h ../include/send.h ../include/sprintf_irc.h \
../include/support.h ../include/sys.h
s_auth.o: s_auth.c ../include/s_auth.h ../config/config.h \
- ../config/setup.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/IPcheck.h \
+ ../config/setup.h ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/IPcheck.h \
../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \
../include/fda.h ../include/ircd_chattr.h ../include/ircd_log.h \
../include/ircd_osdep.h ../include/ircd_string.h ../include/list.h \
../include/s_bsd.h ../include/s_debug.h ../include/s_misc.h \
../include/send.h ../include/sprintf_irc.h ../include/sys.h
s_bsd.o: s_bsd.c ../include/s_bsd.h ../config/config.h \
- ../config/setup.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/IPcheck.h \
+ ../config/setup.h ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/IPcheck.h \
../include/channel.h ../include/class.h ../include/hash.h \
../include/ircd_log.h ../include/ircd_osdep.h ../include/ircd_reply.h \
../include/ircd_string.h ../include/ircd_chattr.h ../include/ircd.h \
../include/send.h ../include/sprintf_irc.h ../include/support.h \
../include/sys.h ../include/uping.h ../include/version.h
s_conf.o: s_conf.c ../include/s_conf.h ../include/IPcheck.h \
- ../include/class.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_defs.h ../include/ircd_handler.h ../include/crule.h \
+ ../include/class.h ../include/client.h ../include/ircd_defs.h \
+ ../include/dbuf.h ../include/ircd_handler.h ../include/crule.h \
../include/fileio.h ../include/gline.h ../config/config.h \
../config/setup.h ../include/hash.h ../include/ircd.h \
../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
s_serv.o: s_serv.c ../include/s_serv.h ../include/IPcheck.h \
../include/channel.h ../config/config.h ../config/setup.h \
../include/ircd_defs.h ../include/client.h ../include/dbuf.h \
- ../include/ircd_handler.h ../include/crule.h ../include/gline.h \
- ../include/hash.h ../include/ircd.h ../include/struct.h \
- ../include/ircd_alloc.h ../include/fda.h ../include/ircd_reply.h \
- ../include/ircd_string.h ../include/ircd_chattr.h \
- ../include/ircd_snprintf.h ../include/ircd_xopen.h ../include/jupe.h \
- ../include/list.h ../include/msg.h ../include/match.h \
- ../include/numeric.h ../include/numnicks.h ../include/parse.h \
- ../include/querycmds.h ../include/s_bsd.h ../include/s_conf.h \
- ../include/s_debug.h ../include/s_misc.h ../include/s_user.h \
- ../include/send.h ../include/sprintf_irc.h ../include/sys.h \
- ../include/userload.h
+ ../include/ircd_handler.h ../include/gline.h ../include/hash.h \
+ ../include/ircd.h ../include/struct.h ../include/ircd_alloc.h \
+ ../include/fda.h ../include/ircd_reply.h ../include/ircd_string.h \
+ ../include/ircd_chattr.h ../include/ircd_snprintf.h \
+ ../include/ircd_xopen.h ../include/jupe.h ../include/list.h \
+ ../include/msg.h ../include/match.h ../include/numeric.h \
+ ../include/numnicks.h ../include/parse.h ../include/querycmds.h \
+ ../include/s_bsd.h ../include/s_conf.h ../include/s_debug.h \
+ ../include/s_misc.h ../include/s_user.h ../include/send.h \
+ ../include/sprintf_irc.h ../include/sys.h ../include/userload.h
s_stats.o: s_stats.c ../include/s_stats.h ../include/class.h \
- ../include/client.h ../include/dbuf.h ../include/ircd_defs.h \
- ../include/ircd_handler.h ../include/crule.h ../include/ircd.h \
- ../config/config.h ../config/setup.h ../include/struct.h \
- ../include/ircd_chattr.h ../include/ircd_reply.h \
- ../include/ircd_string.h ../include/listener.h ../include/match.h \
- ../include/msg.h ../include/numeric.h ../include/numnicks.h \
- ../include/s_conf.h ../include/s_user.h ../include/send.h
+ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \
+ ../include/ircd_handler.h ../include/ircd.h ../config/config.h \
+ ../config/setup.h ../include/struct.h ../include/ircd_chattr.h \
+ ../include/ircd_reply.h ../include/ircd_string.h \
+ ../include/listener.h ../include/match.h ../include/msg.h \
+ ../include/numeric.h ../include/numnicks.h ../include/s_conf.h \
+ ../include/s_user.h ../include/send.h
s_user.o: s_user.c ../include/s_user.h ../include/IPcheck.h \
../include/channel.h ../config/config.h ../config/setup.h \
../include/ircd_defs.h ../include/class.h ../include/client.h \
../include/s_misc.h ../include/s_user.h ../include/send.h \
../include/sys.h
userload.o: userload.c ../include/userload.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/msg.h ../include/numnicks.h \
../include/querycmds.h ../include/s_misc.h ../include/send.h \
../include/userload.h ../include/version.h ../include/whowas.h \
../include/msg.h
whowas.o: whowas.c ../include/whowas.h ../include/client.h \
- ../include/dbuf.h ../include/ircd_defs.h ../include/ircd_handler.h \
+ ../include/ircd_defs.h ../include/dbuf.h ../include/ircd_handler.h \
../include/ircd.h ../config/config.h ../config/setup.h \
../include/struct.h ../include/ircd_alloc.h ../include/fda.h \
../include/ircd_chattr.h ../include/ircd_string.h ../include/list.h \
assert(0 != chptr);
/* Servers don't have member links */
- if (IsServer(cptr))
+ if (IsServer(cptr)||IsMe(cptr))
return 0;
/* +k users are typically on a LOT of channels. So we iterate over who
* $Id$
*/
#include "ircd.h"
-
#include "IPcheck.h"
#include "class.h"
#include "client.h"
/* timeout pending queries that haven't been responded to */
timeout_auth_queries(CurrentTime);
- ip_registry_expire();
+ IPcheck_expire();
if (GlobalRehashFlag) {
rehash(&me, 1);
}
}
-
/*----------------------------------------------------------------------------
* check_file_access: random helper function to make sure that a file is
* accessible in a certain way, and complain if not.
}
uping_init();
+
read_tlines();
rmotd = read_motd(RPATH);
NTL_HDR_strCasediff { NTL_SRC_strCasediff }
#endif /* !FORCEINLINE */
-/*=============================================================================
+/*
* Other functions visible externally
*/
#include "class.h"
#include "client.h"
-#include "IPcheck.h"
#include "ircd.h"
#include "ircd_alloc.h"
#include "ircd_reply.h"
if (cptr->dns_reply)
--cptr->dns_reply->ref_count;
if (-1 < cptr->fd) {
- ip_registry_local_disconnect(cptr);
close(cptr->fd);
}
DBufClear(&cptr->sendQ);
flag = 1;
if (mlen + idx + NICKLEN + 5 > BUFSIZE)
/* space, modifier, nick, \r \n \0 */
- {
- send_reply(sptr, RPL_NAMREPLY, buf);
+ {
+ sendto_one(sptr, rpl_str(RPL_NAMREPLY), me.name, sptr->name, buf);
strcpy(buf, "* ");
ircd_strncpy(buf + 2, chptr->chname, len + 1);
buf[len + 2] = 0;
char* s;
char* para = parc > 1 ? parv[1] : 0;
- if (parc > 2 && hunt_server_cmd(sptr, CMD_NAMES, cptr, 1, "%s %C", 2, parc,
- parv))
+ if (parc > 2 && hunt_server_cmd(sptr, CMD_NAMES, cptr, 1, "%s %C", 2, parc, parv))
return 0;
- if (EmptyString(para))
+ if (EmptyString(para)) {
+ send_reply(sptr, RPL_ENDOFNAMES, "*");
return 0;
+ }
else if (*para == '0')
*para = '\0';
- s = strchr(para, ','); /* Recursively call m_names for each comma-seperated channel. */
+ s = strchr(para, ','); /* Recursively call m_names for each comma-seperated channel. Eww. */
if (s) {
parv[1] = ++s;
m_names(cptr, sptr, parc, parv);
send_reply(sptr, RPL_ENDOFNAMES, chptr ? chptr->chname : para);
return 1;
}
-
}
else
{
char* s;
char* para = parc > 1 ? parv[1] : 0;
- if (parc > 2 && hunt_server_cmd(sptr, CMD_NAMES, cptr, 1, "%s %C", 2, parc,
- parv))
+ if (parc > 2 && hunt_server_cmd(sptr, CMD_NAMES, cptr, 1, "%s %C", 2, parc, parv))
return 0;
- if (EmptyString(para))
+ if (EmptyString(para)) {
+ send_reply(sptr, RPL_ENDOFNAMES, "*");
return 0;
+ }
else if (*para == '0')
*para = '\0';
*/
if (IsUnknown(acptr) && MyConnect(acptr)) {
++ServerStats->is_ref;
+ IPcheck_connect_fail(acptr->ip);
exit_client(cptr, acptr, &me, "Overridden by other sign on");
return set_nick_name(cptr, sptr, nick, parc, parv);
}
*/
if (IsUnknown(acptr) && MyConnect(acptr)) {
++ServerStats->is_ref;
+ IPcheck_connect_fail(acptr->ip);
exit_client(cptr, acptr, &me, "Overridden by other sign on");
return set_nick_name(cptr, sptr, nick, parc, parv);
}
if (IsUnknown(acptr) && MyConnect(acptr))
{
++ServerStats->is_ref;
+ IPcheck_connect_fail(acptr->ip);
exit_client(cptr, acptr, &me, "Overridden by other sign on");
return set_nick_name(cptr, sptr, nick, parc, parv);
}
*/
/*
- * when n2k comes, define this for more capacity
+ * Lets have *LOTS* of connections...
*/
-#undef EXTENDED_NUMERICS
+#define EXTENDED_NUMERICS
/* These must be the same on ALL servers ! Do not change ! */
/* UNREG, CLIENT, SERVER, OPER, SERVICE */
{ m_proto, m_proto, m_proto, m_proto, m_ignore }
},
+ /* This command is an alias for QUIT during the unregistered part of
+ * of the server. This is because someone jumping via a broken web
+ * proxy will send a 'POST' as their first command - which we will
+ * obviously disconnect them immediately for, stopping people abusing
+ * open gateways
+ */
+ {
+ MSG_POST,
+ TOK_POST,
+ 0, MAXPARA, MFLG_SLOW, 0,
+ /* UNREG, CLIENT, SERVER, OPER, SERVICE */
+ { m_quit, m_ignore, m_ignore, m_ignore, m_ignore }
+ },
{ 0 }
};
if (IsDNSPending(auth))
delete_resolver_queries(auth);
+ IPcheck_disconnect(auth->client);
Count_unknowndisconnects(UserStats);
free_client(auth->client);
free_auth_request(auth);
++client->dns_reply->ref_count;
ircd_strncpy(client->sockhost, client->dns_reply->hp->h_name, HOSTLEN);
if (IsUserPort(auth->client))
- sendheader(client, REPORT_FIN_DNSC);
+ sendheader(client, REPORT_FIN_DNSC);
}
else
SetDNSPending(auth);
static time_t last_notice = 0;
int errtmp = errno; /* debug may change 'errno' */
const char* errmsg = (err) ? strerror(err) : "";
+
if (!errmsg)
errmsg = "Unknown error";
}
else
sendto_opmask_butone(0, SNO_OLDSNO, "Connect to %s failed: host lookup",
- aconf->name);
+ aconf->name);
}
/*
if (!msg)
msg = "Unknown error";
sendto_opmask_butone(0, SNO_OLDSNO, "Connection failed to %s: %s",
- cptr->name, msg);
+ cptr->name, msg);
return 0;
}
if (!(aconf = find_conf_byname(cptr->confs, cptr->name, CONF_SERVER))) {
cptr->flags |= FLAGS_PINGSENT;
sendrawto_one(cptr, MSG_SERVER " %s 1 %Tu %Tu J%s %s%s :%s",
- me.name, me.serv->timestamp, newts, MAJOR_PROTOCOL,
- NumServCap(&me), me.info);
+ me.name, me.serv->timestamp, newts, MAJOR_PROTOCOL,
+ NumServCap(&me), me.info);
return (IsDead(cptr)) ? 0 : 1;
}
if (-1 < cptr->fd) {
flush_connections(cptr);
- ip_registry_local_disconnect(cptr);
LocalClientArray[cptr->fd] = 0;
close(cptr->fd);
cptr->fd = -1;
*
* If they're throttled, murder them, but tell them why first.
*/
- if ( !ip_registry_check_local(addr.sin_addr.s_addr,&next_target) ) {
- ++ServerStats->is_ref;
- write(fd,throttle_message,strlen(throttle_message));
- close(fd);
- return;
+ if (!IPcheck_local_connect(addr.sin_addr, &next_target) && !listener->server) {
+ ++ServerStats->is_ref;
+ write(fd, throttle_message, strlen(throttle_message));
+ close(fd);
+ return;
}
new_client = make_client(0, ((listener->server) ?
- STAT_UNKNOWN_SERVER : STAT_UNKNOWN_USER));
+ STAT_UNKNOWN_SERVER : STAT_UNKNOWN_USER));
/*
* Copy ascii address to 'sockhost' just in case. Then we have something
++listener->ref_count;
Count_newunknown(UserStats);
- ip_registry_connect_succeeded(new_client);
/* if we've made it this far we can put the client on the auth query pile */
start_auth(new_client);
}
const char* msg = (cptr->error) ? strerror(cptr->error) : "EOF from client";
if (!msg)
msg = "Unknown error";
- exit_client_msg(cptr, cptr, &me, "Read error: %s",
- msg);
+ exit_client_msg(cptr, cptr, &me, "Read error: %s", msg);
}
}
return 0;
const char* msg = (cptr->error) ? strerror(cptr->error) : "EOF from client";
if (!msg)
msg = "Unknown error";
- exit_client_msg(cptr, cptr, &me, "Read error: %s",
- msg);
+ exit_client_msg(cptr, cptr, &me, "Read error: %s", msg);
}
}
return 0;
if (aconf->dns_pending) {
sendto_opmask_butone(0, SNO_OLDSNO, "Server %s connect DNS pending",
- aconf->name);
+ aconf->name);
return 0;
}
Debug((DEBUG_NOTICE, "Connect to %s[@%s]", aconf->name,
if ((cptr = FindClient(aconf->name))) {
if (IsServer(cptr) || IsMe(cptr)) {
sendto_opmask_butone(0, SNO_OLDSNO, "Server %s already present from %s",
- aconf->name, cptr->from->name);
+ aconf->name, cptr->from->name);
if (by && IsUser(by) && !MyUser(by)) {
- sendcmdto_one(&me, CMD_NOTICE, by, "%C :Server %s already present "
- "from %s", by, aconf->name, cptr->from->name);
+ sendcmdto_one(&me, CMD_NOTICE, by, "%C :Server %s already present "
+ "from %s", by, aconf->name, cptr->from->name);
}
return 0;
}
else if (IsHandshake(cptr) || IsConnecting(cptr)) {
if (by && IsUser(by)) {
- sendcmdto_one(&me, CMD_NOTICE, by, "%C :Connection to %s already in "
- "progress", by, cptr->name);
+ sendcmdto_one(&me, CMD_NOTICE, by, "%C :Connection to %s already in "
+ "progress", by, cptr->name);
}
return 0;
}
if (!find_conf_byhost(cptr->confs, aconf->host, CONF_SERVER)) {
sendto_opmask_butone(0, SNO_OLDSNO, "Host %s is not enabled for "
- "connecting: no C-line", aconf->name);
+ "connecting: no C-line", aconf->name);
if (by && IsUser(by) && !MyUser(by)) {
sendcmdto_one(&me, CMD_NOTICE, by, "%C :Connect to host %s failed: no "
- "C-line", by, aconf->name);
+ "C-line", by, aconf->name);
}
det_confs_butmask(cptr, 0);
free_client(cptr);
if (!connect_inet(aconf, cptr)) {
if (by && IsUser(by) && !MyUser(by)) {
sendcmdto_one(&me, CMD_NOTICE, by, "%C :Couldn't connect to %s", by,
- cptr->name);
+ cptr->name);
}
det_confs_butmask(cptr, 0);
free_client(cptr);
LocalClientArray[cptr->fd] = cptr;
Count_newunknown(UserStats);
- ip_registry_add_local(aconf->ipnum.s_addr);
/* Actually we lie, the connect hasn't succeeded yet, but we have a valid
* cptr, so we register it now.
* Maybe these two calls should be merged.
*/
- ip_registry_connect_succeeded(cptr);
add_client_to_list(cptr);
hAddClient(cptr);
nextping = CurrentTime;
!aconf->passwd[2])
number = (*aconf->passwd-'0')*10+(aconf->passwd[1]-'0');
}
- if (ip_registry_count(cptr->ip.s_addr) > number)
+ if (IPcheck_nr(cptr) > number)
return ACR_TOO_MANY_FROM_IP;
return attach_conf(cptr, aconf);
}
*
* Returns:
* "name[user@ip#.port]" if 'showip' is true;
- * "name[sockethost]", if name and sockhost are different and
- * showip is false; else
- * "name".
+ * "name" if 'showip' is false.
*
* NOTE 1:
* Watch out the allocation of "nbuf", if either sptr->name
if (showip)
sprintf_irc(nbuf, "%s[%s@%s]", sptr->name,
(IsIdented(sptr)) ? sptr->username : "", sptr->sock_ip);
- else {
- if (0 != ircd_strcmp(sptr->name, sptr->sockhost))
- sprintf_irc(nbuf, "%s[%s]", sptr->name, sptr->sockhost);
- else
+ else
return sptr->name;
- }
return nbuf;
}
return sptr->name;
Count_clientdisconnects(bcptr, UserStats);
else {
Count_remoteclientquits(UserStats, bcptr);
- ip_registry_remote_disconnect(bcptr);
}
}
else if (IsServer(bcptr))
else if (IsUnknown(bcptr) || IsConnecting(bcptr) || IsHandshake(bcptr))
Count_unknowndisconnects(UserStats);
+ /*
+ * Update IPregistry
+ */
+ if (IsIPChecked(bcptr))
+ IPcheck_disconnect(bcptr);
/*
* Remove from serv->client_list
#endif
remove_client_from_list(bcptr);
}
+
/*
* exit_downlinks - added by Run 25-9-94
*
#endif /* 0 */
int exit_new_server(struct Client *cptr, struct Client *sptr, const char *host,
- time_t timestamp, const char *pattern, ...)
+ time_t timestamp, const char *pattern, ...)
{
struct VarData vd;
int retval = 0;
* and thus make_server was called, and serv->prot set. --Run
*/
int server_estab(struct Client *cptr, struct ConfItem *aconf,
- struct Jupe *ajupe)
+ struct Jupe *ajupe)
{
struct Client* acptr = 0;
const char* inpath;
* Pass my info to the new server
*/
sendrawto_one(cptr, MSG_SERVER " %s 1 %Tu %Tu J%s %s%s :%s", me.name,
- me.serv->timestamp, cptr->serv->timestamp, MAJOR_PROTOCOL,
- NumServCap(&me), *me.info ? me.info : "IRCers United");
+ me.serv->timestamp, cptr->serv->timestamp, MAJOR_PROTOCOL,
+ NumServCap(&me), *me.info ? me.info : "IRCers United");
+ /*
+ * Don't charge this IP# for connecting
+ * XXX - if this comes from a server port, it will not have been added
+ * to the IP check registry, see add_connection in s_bsd.c
+ */
+ IPcheck_connect_fail(cptr->ip);
}
det_confs_butmask(cptr, CONF_LEAF | CONF_HUB | CONF_SERVER | CONF_UWORLD);
(acptr = findNUser(cptr->serv->by))) {
if (acptr->user == cptr->serv->user) {
sendcmdto_one(&me, CMD_NOTICE, acptr, "%C :Link with %s established.",
- acptr, inpath);
+ acptr, inpath);
}
else {
/*
cptr->serv->up = &me;
cptr->serv->updown = add_dlink(&me.serv->down, cptr);
sendto_opmask_butone(0, SNO_NETWORK, "Net junction: %s %s", me.name,
- cptr->name);
+ cptr->name);
SetJunction(cptr);
/*
* Old sendto_serv_but_one() call removed because we now
continue;
if (ajupe)
sendcmdto_one(&me, CMD_SERVER, acptr,
- "%s 2 0 %Tu J%02u %s%s 0 %%%Tu :%s", cptr->name,
- cptr->serv->timestamp, Protocol(cptr), NumServCap(cptr),
- JupeLastMod(ajupe), cptr->info);
+ "%s 2 0 %Tu J%02u %s%s 0 %%%Tu :%s", cptr->name,
+ cptr->serv->timestamp, Protocol(cptr), NumServCap(cptr),
+ JupeLastMod(ajupe), cptr->info);
else
sendcmdto_one(&me, CMD_SERVER, acptr,
- "%s 2 0 %Tu J%02u %s%s 0 :%s", cptr->name,
- cptr->serv->timestamp, Protocol(cptr), NumServCap(cptr),
- cptr->info);
+ "%s 2 0 %Tu J%02u %s%s 0 :%s", cptr->name,
+ cptr->serv->timestamp, Protocol(cptr), NumServCap(cptr),
+ cptr->info);
}
/*
0 != ircd_strcmp(acptr->name, acptr->sockhost) &&
0 != ircd_strncmp(acptr->info, "JUPE", 4));
if ((ajupe = jupe_find(acptr->name)) && !JupeIsLocal(ajupe))
- sendcmdto_one(acptr->serv->up, CMD_SERVER, cptr,
- "%s %d 0 %Tu %s%u %s%s 0 %%%Tu :%s", acptr->name,
- acptr->hopcount + 1, acptr->serv->timestamp,
- protocol_str, Protocol(acptr), NumServCap(acptr),
- JupeLastMod(ajupe), acptr->info);
+ sendcmdto_one(acptr->serv->up, CMD_SERVER, cptr,
+ "%s %d 0 %Tu %s%u %s%s 0 %%%Tu :%s", acptr->name,
+ acptr->hopcount + 1, acptr->serv->timestamp,
+ protocol_str, Protocol(acptr), NumServCap(acptr),
+ JupeLastMod(ajupe), acptr->info);
else
- sendcmdto_one(acptr->serv->up, CMD_SERVER, cptr,
- "%s %d 0 %Tu %s%u %s%s 0 :%s", acptr->name,
- acptr->hopcount + 1, acptr->serv->timestamp,
- protocol_str, Protocol(acptr), NumServCap(acptr),
- acptr->info);
+ sendcmdto_one(acptr->serv->up, CMD_SERVER, cptr,
+ "%s %d 0 %Tu %s%u %s%s 0 :%s", acptr->name,
+ acptr->hopcount + 1, acptr->serv->timestamp,
+ protocol_str, Protocol(acptr), NumServCap(acptr),
+ acptr->info);
}
}
char *s = umode_str(acptr);
struct Gline *agline = 0;
if ((agline = gline_lookup(acptr, GLINE_GLOBAL | GLINE_LASTMOD)))
- sendcmdto_one(acptr->user->server, CMD_NICK, cptr,
- "%s %d %Tu %s %s %s%s%s%%%Tu:%s@%s %s %s%s :%s",
- acptr->name, acptr->hopcount + 1, acptr->lastnick,
- acptr->user->username, acptr->user->host,
- *s ? "+" : "", s, *s ? " " : "",
- GlineLastMod(agline), GlineUser(agline),
- GlineHost(agline),
- inttobase64(xxx_buf, ntohl(acptr->ip.s_addr), 6),
- NumNick(acptr), acptr->info);
+ sendcmdto_one(acptr->user->server, CMD_NICK, cptr,
+ "%s %d %Tu %s %s %s%s%s%%%Tu:%s@%s %s %s%s :%s",
+ acptr->name, acptr->hopcount + 1, acptr->lastnick,
+ acptr->user->username, acptr->user->host,
+ *s ? "+" : "", s, *s ? " " : "",
+ GlineLastMod(agline), GlineUser(agline),
+ GlineHost(agline),
+ inttobase64(xxx_buf, ntohl(acptr->ip.s_addr), 6),
+ NumNick(acptr), acptr->info);
else
- sendcmdto_one(acptr->user->server, CMD_NICK, cptr,
- "%s %d %Tu %s %s %s%s%s%s %s%s :%s",
- acptr->name, acptr->hopcount + 1, acptr->lastnick,
- acptr->user->username, acptr->user->host,
- *s ? "+" : "", s, *s ? " " : "",
- inttobase64(xxx_buf, ntohl(acptr->ip.s_addr), 6),
- NumNick(acptr), acptr->info);
+ sendcmdto_one(acptr->user->server, CMD_NICK, cptr,
+ "%s %d %Tu %s %s %s%s%s%s %s%s :%s",
+ acptr->name, acptr->hopcount + 1, acptr->lastnick,
+ acptr->user->username, acptr->user->host,
+ *s ? "+" : "", s, *s ? " " : "",
+ inttobase64(xxx_buf, ntohl(acptr->ip.s_addr), 6),
+ NumNick(acptr), acptr->info);
}
}
/*
{
/* Make sure it's a server */
if (!strchr(parv[server], '*')) {
- if (0 == (acptr = FindClient(parv[server])))
+ if (0 == (acptr = FindClient(parv[server]))) {
+ sendto_one(sptr, err_str(ERR_NOSUCHSERVER),
+ me.name, parv[0], parv[server]);
return HUNTED_NOSUCH;
+ }
if (acptr->user)
acptr = acptr->user->server;
}
}
int hunt_server_cmd(struct Client *from, const char *cmd, const char *tok,
- struct Client *one, int MustBeOper, const char *pattern,
- int server, int parc, char *parv[])
+ struct Client *one, int MustBeOper, const char *pattern,
+ int server, int parc, char *parv[])
{
struct Client *acptr;
char *to;
parv[server] = (char *) acptr; /* HACK! HACK! HACK! ARGH! */
sendcmdto_one(from, cmd, tok, acptr, pattern, parv[1], parv[2], parv[3],
- parv[4], parv[5], parv[6], parv[7], parv[8]);
+ parv[4], parv[5], parv[6], parv[7], parv[8]);
return (HUNTED_PASS);
}
break;
case ACR_NO_AUTHORIZATION:
sendto_opmask_butone(0, SNO_UNAUTH, "Unauthorized connection from %s.",
- get_client_name(sptr, HIDE_IP));
+ get_client_name(sptr, HIDE_IP));
++ServerStats->is_ref;
return exit_client(cptr, sptr, &me,
- "No Authorization - use another server");
+ "No Authorization - use another server");
case ACR_TOO_MANY_IN_CLASS:
if (CurrentTime - last_too_many1 >= (time_t) 60)
{
last_too_many1 = CurrentTime;
sendto_opmask_butone(0, SNO_TOOMANY, "Too many connections in "
- "class for %s.",
- get_client_name(sptr, HIDE_IP));
+ "class for %s.",
+ get_client_name(sptr, HIDE_IP));
}
++ServerStats->is_ref;
+ IPcheck_connect_fail(sptr->ip);
return exit_client(cptr, sptr, &me,
- "Sorry, your connection class is full - try "
- "again later or try another server");
+ "Sorry, your connection class is full - try "
+ "again later or try another server");
case ACR_TOO_MANY_FROM_IP:
if (CurrentTime - last_too_many2 >= (time_t) 60)
{
last_too_many2 = CurrentTime;
sendto_opmask_butone(0, SNO_TOOMANY, "Too many connections from "
- "same IP for %s.",
- get_client_name(sptr, HIDE_IP));
+ "same IP for %s.",
+ get_client_name(sptr, HIDE_IP));
}
++ServerStats->is_ref;
return exit_client(cptr, sptr, &me,
- "Too many connections from your host");
+ "Too many connections from your host");
case ACR_ALREADY_AUTHORIZED:
/* Can this ever happen? */
case ACR_BAD_SOCKET:
++ServerStats->is_ref;
+ IPcheck_connect_fail(sptr->ip);
return exit_client(cptr, sptr, &me, "Unknown error -- Try again");
}
ircd_strncpy(user->host, sptr->sockhost, HOSTLEN);
&& strcmp(sptr->passwd, aconf->passwd))
{
ServerStats->is_ref++;
+ IPcheck_connect_fail(sptr->ip);
send_reply(sptr, ERR_PASSWDMISMATCH);
return exit_client(cptr, sptr, &me, "Bad Password");
}
*/
if (find_kill(sptr)) {
ServerStats->is_ref++;
+ IPcheck_connect_fail(sptr->ip);
return exit_client(cptr, sptr, &me, "K-lined");
}
/*
ServerStats->is_ref++;
send_reply(cptr, SND_EXPLICIT | ERR_INVALIDUSERNAME,
- ":Your username is invalid.");
+ ":Your username is invalid.");
send_reply(cptr, SND_EXPLICIT | ERR_INVALIDUSERNAME,
- ":Connect with your real username, in lowercase.");
+ ":Connect with your real username, in lowercase.");
send_reply(cptr, SND_EXPLICIT | ERR_INVALIDUSERNAME,
- ":If your mail address were foo@bar.com, your username "
- "would be foo.");
+ ":If your mail address were foo@bar.com, your username "
+ "would be foo.");
return exit_client(cptr, sptr, &me, "USER: Bad username");
}
Count_unknownbecomesclient(sptr, UserStats);
nextping = CurrentTime;
if (sptr->snomask & SNO_NOISY)
set_snomask(sptr, sptr->snomask & SNO_NOISY, SNO_ADD);
+ IPcheck_connect_succeeded(sptr);
}
else
/* if (IsServer(cptr)) */
if (acptr->from != sptr->from)
{
sendcmdto_one(&me, CMD_KILL, cptr, "%C :%s (%s != %s[%s])",
- sptr, me.name, user->server->name, acptr->from->name,
- acptr->from->sockhost);
+ sptr, me.name, user->server->name, acptr->from->name,
+ acptr->from->sockhost);
sptr->flags |= FLAGS_KILLED;
return exit_client(cptr, sptr, &me, "NICK server wrong direction");
}
if (IsBurst(acptr) || Protocol(acptr) < 10)
break;
}
+ if (!IPcheck_remote_connect(sptr, (acptr != &me))) {
+ /*
+ * We ran out of bits to count this
+ */
+ sendcmdto_one(&me, CMD_KILL, sptr, "%C :%s (Too many connections from your host -- Ghost)",
+ sptr, me.name);
+ return exit_client(cptr, sptr, &me,"Too many connections from your host -- throttled");
+ }
}
tmpstr = umode_str(sptr);
if (agline)
sendcmdto_serv_butone(user->server, CMD_NICK, cptr,
- "%s %d %Tu %s %s %s%s%s%%%Tu:%s@%s %s %s%s :%s",
- nick, sptr->hopcount + 1, sptr->lastnick,
- user->username, user->host,
- *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "",
- GlineLastMod(agline), GlineUser(agline),
- GlineHost(agline),
- inttobase64(ip_base64, ntohl(sptr->ip.s_addr), 6),
- NumNick(sptr), sptr->info);
+ "%s %d %Tu %s %s %s%s%s%%%Tu:%s@%s %s %s%s :%s",
+ nick, sptr->hopcount + 1, sptr->lastnick,
+ user->username, user->host,
+ *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "",
+ GlineLastMod(agline), GlineUser(agline),
+ GlineHost(agline),
+ inttobase64(ip_base64, ntohl(sptr->ip.s_addr), 6),
+ NumNick(sptr), sptr->info);
else
sendcmdto_serv_butone(user->server, CMD_NICK, cptr,
- "%s %d %Tu %s %s %s%s%s%s %s%s :%s",
- nick, sptr->hopcount + 1, sptr->lastnick,
- user->username, user->host,
- *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "",
- inttobase64(ip_base64, ntohl(sptr->ip.s_addr), 6),
- NumNick(sptr), sptr->info);
+ "%s %d %Tu %s %s %s%s%s%s %s%s :%s",
+ nick, sptr->hopcount + 1, sptr->lastnick,
+ user->username, user->host,
+ *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "",
+ inttobase64(ip_base64, ntohl(sptr->ip.s_addr), 6),
+ NumNick(sptr), sptr->info);
/* Send umode to client */
if (MyUser(sptr))
lastmod = atoi(parv[parc - 4] + 1);
if (lastmod &&
- (agline = gline_find(t, GLINE_EXACT | GLINE_GLOBAL | GLINE_LASTMOD))
- && GlineLastMod(agline) > lastmod && !IsBurstOrBurstAck(cptr))
- gline_resend(cptr, agline);
- }
- if (!ip_registry_remote_connect(new_client)) {
- sendcmdto_one(&me, CMD_KILL, new_client, "%C :%s (Too many connections from your host -- Ghost)",
- new_client,me.name);
- return exit_client(cptr,new_client,&me,"Too many connections from your host -- throttled");
+ (agline = gline_find(t, GLINE_EXACT | GLINE_GLOBAL | GLINE_LASTMOD))
+ && GlineLastMod(agline) > lastmod && !IsBurstOrBurstAck(cptr))
+ gline_resend(cptr, agline);
}
- sendto_ops("Registering new remote client");
return register_user(cptr, new_client, new_client->name, parv[4], agline);
}
else if (sptr->name[0]) {
if (MyUser(sptr)) {
const char* channel_name;
if ((channel_name = find_no_nickchange_channel(sptr))) {
- return send_reply(cptr, ERR_BANNICKCHANGE, channel_name);
+ return send_reply(cptr, ERR_BANNICKCHANGE, channel_name);
}
/*
* Refuse nick change if the last nick change was less
*/
if (CurrentTime < cptr->nextnick) {
cptr->nextnick += 2;
- send_reply(cptr, ERR_NICKTOOFAST, parv[1],
- cptr->nextnick - CurrentTime);
+ send_reply(cptr, ERR_NICKTOOFAST, parv[1],
+ cptr->nextnick - CurrentTime);
/* Send error message */
- sendcmdto_one(cptr, CMD_NICK, cptr, "%s", cptr->name);
+ sendcmdto_one(cptr, CMD_NICK, cptr, "%s", cptr->name);
/* bounce NICK to user */
return 0; /* ignore nick change! */
}
sendcmdto_common_channels(sptr, CMD_NICK, ":%s", nick);
add_history(sptr, 1);
sendcmdto_serv_butone(sptr, CMD_NICK, cptr, "%s %Tu", nick,
- sptr->lastnick);
+ sptr->lastnick);
}
else
sendcmdto_one(sptr, CMD_NICK, sptr, ":%s", nick);
* No server flooding
*/
sptr->nexttarget += 2;
- send_reply(sptr, ERR_TARGETTOOFAST, name,
- sptr->nexttarget - CurrentTime);
+ send_reply(sptr, ERR_TARGETTOOFAST, name,
+ sptr->nexttarget - CurrentTime);
}
return 1;
}
if (5 == ++arg_count)
break;
}
- if (users_found)
- send_buffer(sptr, buf);
+ send_buffer(sptr, buf);
}
{
if (IsServer(cptr))
sendcmdto_flag_butone(&me, CMD_WALLOPS, 0, FLAGS_WALLOP,
- ":MODE for User %s from %s!%s", parv[1],
- cptr->name, sptr->name);
+ ":MODE for User %s from %s!%s", parv[1],
+ cptr->name, sptr->name);
else
send_reply(sptr, ERR_USERSDONTMATCH);
return 0;
{
if (!MyConnect(sptr))
{
- sendcmdto_one(acptr, CMD_SILENCE, sptr->from, "%C %s", sptr,
- lp->value.cp);
+ sendcmdto_one(acptr, CMD_SILENCE, sptr->from, "%C %s", sptr,
+ lp->value.cp);
}
return 1;
}
len += strlen(lp->value.cp);
if ((len > MAXSILELENGTH) || (++cnt >= MAXSILES))
{
- send_reply(sptr, ERR_SILELISTFULL, mask);
+ send_reply(sptr, ERR_SILELISTFULL, mask);
return -1;
}
else if (!mmatch(lp->value.cp, mask))
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/*=============================================================================
+/*
* TABLE GENERATOR
* The following part of code is NOT included in the actual server's
* or library source, it's just used to build the above tables
sendcmdto_one(&me, CMD_NOTICE, pptr->client, "%C :Sending %d ping%s to %s",
pptr->client, pptr->count, (pptr->count == 1) ? "" : "s",
pptr->name);
-
pptr->timeout = CurrentTime + UPINGTIMEOUT;
pptr->active = 1;
}