2 * ircd-ratbox: A slightly useful ircd.
3 * whowas.h: Header for the whowas functions.
5 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
6 * Copyright (C) 1996-2002 Hybrid Development Team
7 * Copyright (C) 2002-2004 ircd-ratbox development team
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 #ifndef INCLUDED_whowas_h
25 #define INCLUDED_whowas_h
27 #include "ircd_defs.h"
37 also removed away information. *tough*
42 struct whowas_top
*wtop
;
43 rb_dlink_node wnode
; /* for the wtop linked list */
44 rb_dlink_node cnode
; /* node for online clients */
45 rb_dlink_node whowas_node
; /* node for the whowas linked list */
46 char name
[NICKLEN
+ 1];
47 char username
[USERLEN
+ 1];
48 char hostname
[HOSTLEN
+ 1];
49 char sockhost
[HOSTIPLEN
+ 1];
50 char realname
[REALLEN
+ 1];
51 char suser
[NICKLEN
+ 1];
53 const char *servername
;
55 struct Client
*online
; /* Pointer to new nickname for chasing or NULL */
59 #define WHOWAS_IP_SPOOFING 0x1
60 #define WHOWAS_DYNSPOOF 0x2
65 extern void whowas_init(void);
69 ** Add the currently defined name of the client to history.
70 ** usually called before changing to a new name (nick).
71 ** Client must be a fully registered user (specifically,
72 ** the user structure must have been allocated).
74 void whowas_add_history(struct Client
*, int);
78 ** This must be called when the client structure is about to
79 ** be released. History mechanism keeps pointers to client
80 ** structures and it must know when they cease to exist. This
81 ** also implicitly calls AddHistory.
83 void whowas_off_history(struct Client
*);
87 ** Return the current client that was using the given
88 ** nickname within the timelimit. Returns NULL, if no
91 struct Client
*whowas_get_history(const char *, time_t);
93 /* Time limit in seconds */
95 rb_dlink_list
*whowas_get_list(const char *name
);
96 void whowas_set_size(int whowas_length
);
97 void whowas_memory_usage(size_t *count
, size_t *memused
);
99 #endif /* INCLUDED_whowas_h */