]>
Commit | Line | Data |
---|---|---|
189935b1 | 1 | /* |
2 | * IRC - Internet Relay Chat, include/struct.h | |
3 | * Copyright (C) 1990 Jarkko Oikarinen and | |
4 | * University of Oulu, Computing Center | |
5 | * Copyright (C) 1996 -1997 Carlo Wood | |
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, or (at your option) | |
10 | * 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., 675 Mass Ave, Cambridge, MA 02139, USA. | |
20 | */ | |
21 | /** @file | |
22 | * @brief Structure definitions for users and servers. | |
23 | * @version $Id: struct.h,v 1.9 2005/03/31 04:05:55 entrope Exp $ | |
24 | */ | |
25 | #ifndef INCLUDED_struct_h | |
26 | #define INCLUDED_struct_h | |
27 | #ifndef INCLUDED_sys_types_h | |
28 | #include <sys/types.h> /* time_t */ | |
29 | #define INCLUDED_sys_types_h | |
30 | #endif | |
31 | #ifndef INCLUDED_ircd_defs_h | |
32 | #include "ircd_defs.h" /* sizes */ | |
33 | #endif | |
34 | ||
35 | struct DLink; | |
36 | struct Client; | |
37 | struct User; | |
38 | struct Membership; | |
39 | struct SLink; | |
40 | ||
41 | /** Describes a server on the network. */ | |
42 | struct Server { | |
43 | struct Client* up; /**< Server one closer to me */ | |
44 | struct DLink* down; /**< List with downlink servers */ | |
45 | struct DLink* updown; /**< own Dlink in up->serv->down struct */ | |
46 | struct Client** client_list; /**< List with client pointers on this server */ | |
47 | struct User* user; /**< who activated this connection */ | |
48 | time_t timestamp; /**< Remotely determined connect try time */ | |
49 | time_t ghost; /**< Local time at which a new server | |
50 | caused a Ghost */ | |
51 | int lag; /**< Approximation of the amount of lag to this server */ | |
52 | unsigned int clients; /**< Number of clients on the server */ | |
53 | unsigned short prot; /**< Major protocol */ | |
54 | unsigned int nn_mask; /**< Number of clients supported by server, minus 1 */ | |
55 | char nn_capacity[4]; /**< Numeric representation of server capacity */ | |
56 | ||
57 | int asll_rtt; /**< AsLL round-trip time */ | |
58 | int asll_to; /**< AsLL upstream lag */ | |
59 | int asll_from; /**< AsLL downstream lag */ | |
60 | ||
61 | char *last_error_msg; /**< Allocated memory with last message receive with an ERROR */ | |
62 | char by[NICKLEN + 1]; /**< Numnick of client who requested the link */ | |
63 | }; | |
64 | ||
65 | /** Describes a user on the network. */ | |
66 | struct User { | |
67 | struct Client* server; /**< client structure of server */ | |
68 | struct Membership* channel; /**< chain of channel pointer blocks */ | |
69 | struct SLink* invited; /**< chain of invite pointer blocks */ | |
70 | struct Ban* silence; /**< chain of silence pointer blocks */ | |
71 | char* away; /**< pointer to away message */ | |
72 | time_t last; /**< last time user sent a message */ | |
73 | unsigned int refcnt; /**< Number of times this block is referenced */ | |
74 | unsigned int joined; /**< number of channels joined */ | |
75 | unsigned int invites; /**< Number of channels we've been invited to */ | |
76 | /** Remote account name. Before registration is complete, this is | |
77 | * either empty or contains the username from the USER command. | |
78 | * After registration, that may be prefixed with ~ or it may be | |
79 | * overwritten with the ident response. | |
80 | */ | |
81 | char username[USERLEN + 1]; | |
b5feb63f | 82 | char host[HOSTLEN + 1]; /**< displayed hostname */ |
83 | char realhost[HOSTLEN + 1]; /**< actual hostname */ | |
84 | char account[ACCOUNTLEN + 1]; /**< IRC account name */ | |
85 | time_t acc_create; /**< IRC account timestamp */ | |
189935b1 | 86 | }; |
87 | ||
88 | #endif /* INCLUDED_struct_h */ |