]> jfr.im git - solanum.git/blob - include/whowas.h
Add .travis.yml
[solanum.git] / include / whowas.h
1 /*
2 * ircd-ratbox: A slightly useful ircd.
3 * whowas.h: Header for the whowas functions.
4 *
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
8 *
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.
13 *
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.
18 *
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
22 * USA
23 *
24 * $Id: whowas.h 1717 2006-07-04 14:41:11Z jilles $
25 */
26 #ifndef INCLUDED_whowas_h
27 #define INCLUDED_whowas_h
28
29 #include "ircd_defs.h"
30 #include "client.h"
31
32 #include "setup.h"
33
34 struct User;
35 struct Client;
36
37 /*
38 lets speed this up...
39 also removed away information. *tough*
40 - Dianora
41 */
42 struct Whowas
43 {
44 struct whowas_top *wtop;
45 rb_dlink_node wnode; /* for the wtop linked list */
46 rb_dlink_node cnode; /* node for online clients */
47 rb_dlink_node whowas_node; /* node for the whowas linked list */
48 char name[NICKLEN + 1];
49 char username[USERLEN + 1];
50 char hostname[HOSTLEN + 1];
51 char sockhost[HOSTIPLEN + 1];
52 char realname[REALLEN + 1];
53 char suser[NICKLEN + 1];
54 unsigned char flags;
55 const char *servername;
56 time_t logoff;
57 struct Client *online; /* Pointer to new nickname for chasing or NULL */
58 };
59
60 /* Flags */
61 #define WHOWAS_IP_SPOOFING 0x1
62 #define WHOWAS_DYNSPOOF 0x2
63
64 /*
65 ** initwhowas
66 */
67 extern void whowas_init(void);
68
69 /*
70 ** add_history
71 ** Add the currently defined name of the client to history.
72 ** usually called before changing to a new name (nick).
73 ** Client must be a fully registered user (specifically,
74 ** the user structure must have been allocated).
75 */
76 void whowas_add_history(struct Client *, int);
77
78 /*
79 ** off_history
80 ** This must be called when the client structure is about to
81 ** be released. History mechanism keeps pointers to client
82 ** structures and it must know when they cease to exist. This
83 ** also implicitly calls AddHistory.
84 */
85 void whowas_off_history(struct Client *);
86
87 /*
88 ** get_history
89 ** Return the current client that was using the given
90 ** nickname within the timelimit. Returns NULL, if no
91 ** one found...
92 */
93 struct Client *whowas_get_history(const char *, time_t);
94 /* Nick name */
95 /* Time limit in seconds */
96
97 rb_dlink_list *whowas_get_list(const char *name);
98 void whowas_set_size(int whowas_length);
99 void whowas_memory_usage(size_t *count, size_t *memused);
100
101 #endif /* INCLUDED_whowas_h */