]>
jfr.im git - irc/quakenet/snircd.git/blob - include/struct.h
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
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)
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.
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.
22 * @brief Structure definitions for users and servers.
23 * @version $Id: struct.h,v 1.9.2.1 2007/01/15 03:08:23 entrope Exp $
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
31 #ifndef INCLUDED_ircd_defs_h
32 #include "ircd_defs.h" /* sizes */
41 /** Describes a server on the network. */
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
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 */
57 int asll_rtt
; /**< AsLL round-trip time */
58 int asll_to
; /**< AsLL upstream lag */
59 int asll_from
; /**< AsLL downstream lag */
60 time_t asll_last
; /**< Last time we sent or received an AsLL ping */
62 char *last_error_msg
; /**< Allocated memory with last message receive with an ERROR */
63 char by
[NICKLEN
+ 1]; /**< Numnick of client who requested the link */
66 /** Describes a user on the network. */
68 struct Client
* server
; /**< client structure of server */
69 struct Membership
* channel
; /**< chain of channel pointer blocks */
70 struct SLink
* invited
; /**< chain of invite pointer blocks */
71 struct Ban
* silence
; /**< chain of silence pointer blocks */
72 char* away
; /**< pointer to away message */
73 time_t last
; /**< last time user sent a message */
74 unsigned int refcnt
; /**< Number of times this block is referenced */
75 unsigned int joined
; /**< number of channels joined */
76 unsigned int invites
; /**< Number of channels we've been invited to */
77 /** Remote account name. Before registration is complete, this is
78 * either empty or contains the username from the USER command.
79 * After registration, that may be prefixed with ~ or it may be
80 * overwritten with the ident response.
82 char username
[USERLEN
+ 1];
83 char host
[HOSTLEN
+ 1]; /**< displayed hostname */
84 char realusername
[USERLEN
+ 1]; /**< actual username */
85 char realhost
[HOSTLEN
+ 1]; /**< actual hostname */
86 char account
[ACCOUNTLEN
+ 1]; /**< IRC account name */
87 time_t acc_create
; /**< IRC account timestamp */
88 unsigned long acc_id
; /**< IRC account unique id */
89 char* opername
; /**< IRC Oper Account name */
92 #endif /* INCLUDED_struct_h */