Author: Bleep <tomh@inxpress.net>
[ircu2.10.12-pk.git] / include / struct.h
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  * $Id$
22  */
23 #ifndef INCLUDED_struct_h
24 #define INCLUDED_struct_h
25 #ifndef INCLUDED_sys_types_h
26 #include <sys/types.h>      /* time_t */
27 #define INCLUDED_sys_types_h
28 #endif
29 #ifndef INCLUDED_ircd_defs_h
30 #include "ircd_defs.h"       /* sizes */
31 #endif
32
33 struct DLink;
34 struct Client;
35 struct User;
36 struct Membership;
37 struct SLink;
38
39 struct Server {
40   struct Server*  nexts;
41   struct Client*  up;           /* Server one closer to me */
42   struct DLink*   down;         /* List with downlink servers */
43   struct DLink*   updown;       /* own Dlink in up->serv->down struct */
44   struct Client** client_list;  /* List with client pointers on this server */
45   struct User*    user;         /* who activated this connection */
46   time_t          timestamp;    /* Remotely determined connect try time */
47   time_t          ghost;        /* Local time at which a new server
48                                    caused a Ghost */
49   int             lag;          /* Approximation of the amount of lag to this server */                          
50   unsigned int    clients;      /* Number of clients on the network */
51   unsigned short  prot;         /* Major protocol */
52   unsigned short  nn_last;      /* Last numeric nick for p9 servers only */
53   unsigned int    nn_mask;      /* [Remote] FD_SETSIZE - 1 */
54   char          nn_capacity[4]; /* numeric representation of server capacity */
55
56   char *last_error_msg;         /* Allocated memory with last message receive with an ERROR */
57   char by[NICKLEN + 1];
58 };
59
60 struct User {
61   struct User*       nextu;
62   struct Client*     server;         /* client structure of server */
63   struct Membership* channel;        /* chain of channel pointer blocks */
64   struct SLink*      invited;        /* chain of invite pointer blocks */
65   struct SLink*      silence;        /* chain of silence pointer blocks */
66   char*              away;           /* pointer to away message */
67   time_t             last;
68   unsigned int       refcnt;          /* Number of times this block is referenced */
69   unsigned int       joined;          /* number of channels joined */
70   unsigned int       invites;         /* Number of channels we've been invited to */
71   char               username[USERLEN + 1];
72   char               host[HOSTLEN + 1];
73 };
74
75 #endif /* INCLUDED_struct_h */