1 |
adx |
30 |
/* |
2 |
|
|
* ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). |
3 |
|
|
* whowas.h: Header for the whowas functions. |
4 |
|
|
* |
5 |
|
|
* Copyright (C) 2002 by the past and present ircd coders, and others. |
6 |
|
|
* |
7 |
|
|
* This program is free software; you can redistribute it and/or modify |
8 |
|
|
* it under the terms of the GNU General Public License as published by |
9 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
10 |
|
|
* (at your option) any later version. |
11 |
|
|
* |
12 |
|
|
* This program is distributed in the hope that it will be useful, |
13 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
|
|
* GNU General Public License for more details. |
16 |
|
|
* |
17 |
|
|
* You should have received a copy of the GNU General Public License |
18 |
|
|
* along with this program; if not, write to the Free Software |
19 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
20 |
|
|
* USA |
21 |
|
|
* |
22 |
knight |
31 |
* $Id$ |
23 |
adx |
30 |
*/ |
24 |
|
|
|
25 |
|
|
#ifndef INCLUDED_whowas_h |
26 |
|
|
#define INCLUDED_whowas_h |
27 |
|
|
|
28 |
|
|
#include "ircd_defs.h" |
29 |
|
|
#include "client.h" |
30 |
michael |
912 |
#include "config.h" |
31 |
adx |
30 |
|
32 |
michael |
1358 |
|
33 |
adx |
30 |
struct Whowas |
34 |
|
|
{ |
35 |
|
|
int hashv; |
36 |
|
|
time_t logoff; |
37 |
michael |
1431 |
char name[NICKLEN + 1]; |
38 |
michael |
1358 |
char username[USERLEN + 1]; |
39 |
adx |
30 |
char hostname[HOSTLEN + 1]; |
40 |
|
|
char realname[REALLEN + 1]; |
41 |
|
|
char servername[HOSTLEN + 1]; |
42 |
|
|
struct Client *online; /* Pointer to new nickname for chasing or NULL */ |
43 |
michael |
1358 |
dlink_node tnode; /* for hash table... */ |
44 |
|
|
dlink_node cnode; /* for client struct linked list */ |
45 |
adx |
30 |
}; |
46 |
|
|
|
47 |
|
|
/* |
48 |
|
|
** initwhowas |
49 |
|
|
*/ |
50 |
michael |
1358 |
extern void whowas_init(void); |
51 |
adx |
30 |
|
52 |
|
|
/* |
53 |
|
|
** add_history |
54 |
|
|
** Add the currently defined name of the client to history. |
55 |
|
|
** usually called before changing to a new name (nick). |
56 |
|
|
** Client must be a fully registered user. |
57 |
|
|
*/ |
58 |
|
|
extern void add_history(struct Client *, int); |
59 |
|
|
|
60 |
|
|
/* |
61 |
|
|
** off_history |
62 |
|
|
** This must be called when the client structure is about to |
63 |
|
|
** be released. History mechanism keeps pointers to client |
64 |
|
|
** structures and it must know when they cease to exist. This |
65 |
|
|
** also implicitly calls AddHistory. |
66 |
|
|
*/ |
67 |
|
|
extern void off_history(struct Client *); |
68 |
|
|
|
69 |
|
|
/* |
70 |
|
|
** get_history |
71 |
|
|
** Return the current client that was using the given |
72 |
|
|
** nickname within the timelimit. Returns NULL, if no |
73 |
|
|
** one found... |
74 |
|
|
*/ |
75 |
|
|
extern struct Client *get_history(const char *, time_t); |
76 |
|
|
|
77 |
|
|
/* |
78 |
|
|
** for debugging...counts related structures stored in whowas array. |
79 |
|
|
*/ |
80 |
michael |
948 |
extern void count_whowas_memory(unsigned int *, uint64_t *); |
81 |
michael |
1358 |
extern dlink_list WHOWASHASH[]; |
82 |
adx |
30 |
#endif /* INCLUDED_whowas_h */ |