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