Restore stats_spy hook that was removed in commit 401f2454671ca233e35b0e6e4f3fa4c43cd...
[seven-1.x.git] / src / ircd_state.c
blob8428896e11863e796b5edb7af3a4573da7727373
1 /*
2 * charybdis: An advanced ircd.
3 * ircd_state.c: Functions for backing up and synchronizing IRCd's state
5 * Copyright (c) 2006 William Pitcock <nenolod@nenolod.net>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met:
11 * 1. Redistributions of source code must retain the above copyright notice,
12 * this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * 3. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
30 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
34 #include "stdinc.h"
35 #include "setup.h"
36 #include "config.h"
38 #include "client.h"
39 #include "tools.h"
40 #include "tools.h"
41 #include "ircd.h"
42 #include "channel.h"
43 #include "class.h"
44 #include "client.h"
45 #include "common.h"
46 #include "event.h"
47 #include "hash.h"
48 #include "irc_string.h"
49 #include "ircd_signal.h"
50 #include "sprintf_irc.h"
51 #include "msg.h" /* msgtab */
52 #include "hostmask.h"
53 #include "numeric.h"
54 #include "parse.h"
55 #include "res.h"
56 #include "restart.h"
57 #include "s_auth.h"
58 #include "commio.h"
59 #include "s_conf.h"
60 #include "s_log.h"
61 #include "s_serv.h" /* try_connections */
62 #include "s_user.h"
63 #include "s_stats.h"
64 #include "scache.h"
65 #include "send.h"
66 #include "whowas.h"
67 #include "modules.h"
68 #include "memory.h"
69 #include "hook.h"
70 #include "ircd_getopt.h"
71 #include "balloc.h"
72 #include "newconf.h"
73 #include "patricia.h"
74 #include "reject.h"
75 #include "s_conf.h"
76 #include "s_newconf.h"
77 #include "cache.h"
78 #include "monitor.h"
79 #include "libseven.h"
80 #include "patchlevel.h"
81 #include "serno.h"
83 dlink_list lclient_list = { NULL, NULL, 0 };
84 dlink_list global_client_list = { NULL, NULL, 0 };
85 dlink_list global_channel_list = { NULL, NULL, 0 };
87 dlink_list unknown_list; /* unknown clients ON this server only */
88 dlink_list serv_list; /* local servers to this server ONLY */
89 dlink_list global_serv_list; /* global servers on the network */
90 dlink_list local_oper_list; /* our opers, duplicated in lclient_list */
91 dlink_list oper_list; /* network opers */
93 /* /quote set variables */
94 struct SetOptions GlobalSetOptions;
96 /* configuration set from ircd.conf */
97 struct config_file_entry ConfigFileEntry;
98 /* server info set from ircd.conf */
99 struct server_info ServerInfo;
100 /* admin info set from ircd.conf */
101 struct admin_info AdminInfo;
103 struct Counter Count;
105 struct timeval SystemTime;
106 int ServerRunning; /* GLOBAL - server execution state */
107 struct Client me; /* That's me */
108 struct LocalUser meLocalUser; /* That's also part of me */
110 time_t startup_time;
112 int default_server_capabs = CAP_MASK;
114 int splitmode;
115 int splitchecking;
116 int split_users;
117 int split_servers;
118 int eob_count;
120 unsigned long initialVMTop = 0; /* top of virtual memory at init */
121 const char *logFileName = LPATH;
122 const char *pidFileName = PPATH;
124 char **myargv;
125 int dorehash = 0;
126 int dorehashbans = 0;
127 int doremotd = 0;
128 int kline_queued = 0;
129 int server_state_foreground = 0;
130 int opers_see_all_users = 0;
132 int testing_conf = 0;
134 struct config_channel_entry ConfigChannel;
135 BlockHeap *channel_heap;
136 BlockHeap *ban_heap;
137 BlockHeap *topic_heap;
138 BlockHeap *member_heap;
140 BlockHeap *client_heap = NULL;
141 BlockHeap *lclient_heap = NULL;
142 BlockHeap *pclient_heap = NULL;
144 char current_uid[IDLEN];
146 /* patricia */
147 BlockHeap *prefix_heap;
148 BlockHeap *node_heap;
149 BlockHeap *patricia_heap;
151 BlockHeap *linebuf_heap;
153 BlockHeap *dnode_heap;
155 #ifdef NOTYET
157 void seven_initstate(struct IRCdState *self)
162 #endif