]> jfr.im git - irc/rqf/shadowircd.git/blob - src/ircd_state.c
[svn] - the new plan:
[irc/rqf/shadowircd.git] / src / ircd_state.c
1 /*
2 * charybdis: An advanced ircd.
3 * ircd_state.c: Functions for backing up and synchronizing IRCd's state
4 *
5 * Copyright (c) 2006 William Pitcock <nenolod@nenolod.net>
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met:
10 *
11 * 1. Redistributions of source code must retain the above copyright notice,
12 * this list of conditions and the following disclaimer.
13 *
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.
17 *
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.
20 *
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.
32 *
33 * $Id: main.c 867 2006-02-16 14:25:09Z nenolod $
34 */
35
36 #include "stdinc.h"
37 #include "setup.h"
38 #include "config.h"
39
40 #include "client.h"
41 #include "tools.h"
42 #include "tools.h"
43 #include "ircd.h"
44 #include "channel.h"
45 #include "class.h"
46 #include "client.h"
47 #include "common.h"
48 #include "event.h"
49 #include "hash.h"
50 #include "irc_string.h"
51 #include "ircd_signal.h"
52 #include "sprintf_irc.h"
53 #include "s_gline.h"
54 #include "msg.h" /* msgtab */
55 #include "hostmask.h"
56 #include "numeric.h"
57 #include "parse.h"
58 #include "res.h"
59 #include "restart.h"
60 #include "s_auth.h"
61 #include "commio.h"
62 #include "s_conf.h"
63 #include "s_log.h"
64 #include "s_serv.h" /* try_connections */
65 #include "s_user.h"
66 #include "s_stats.h"
67 #include "scache.h"
68 #include "send.h"
69 #include "whowas.h"
70 #include "modules.h"
71 #include "memory.h"
72 #include "hook.h"
73 #include "ircd_getopt.h"
74 #include "balloc.h"
75 #include "newconf.h"
76 #include "patricia.h"
77 #include "reject.h"
78 #include "s_conf.h"
79 #include "s_newconf.h"
80 #include "cache.h"
81 #include "monitor.h"
82 #include "libcharybdis.h"
83 #include "patchlevel.h"
84 #include "serno.h"
85
86 dlink_list lclient_list = { NULL, NULL, 0 };
87 dlink_list global_client_list = { NULL, NULL, 0 };
88 dlink_list global_channel_list = { NULL, NULL, 0 };
89
90 dlink_list unknown_list; /* unknown clients ON this server only */
91 dlink_list serv_list; /* local servers to this server ONLY */
92 dlink_list global_serv_list; /* global servers on the network */
93 dlink_list local_oper_list; /* our opers, duplicated in lclient_list */
94 dlink_list oper_list; /* network opers */
95
96 /* /quote set variables */
97 struct SetOptions GlobalSetOptions;
98
99 /* configuration set from ircd.conf */
100 struct config_file_entry ConfigFileEntry;
101 /* server info set from ircd.conf */
102 struct server_info ServerInfo;
103 /* admin info set from ircd.conf */
104 struct admin_info AdminInfo;
105
106 struct Counter Count;
107
108 struct timeval SystemTime;
109 int ServerRunning; /* GLOBAL - server execution state */
110 struct Client me; /* That's me */
111 struct LocalUser meLocalUser; /* That's also part of me */
112
113 time_t startup_time;
114
115 int default_server_capabs = CAP_MASK;
116
117 int splitmode;
118 int splitchecking;
119 int split_users;
120 int split_servers;
121 int eob_count;
122
123 unsigned long initialVMTop = 0; /* top of virtual memory at init */
124 const char *logFileName = LPATH;
125 const char *pidFileName = PPATH;
126
127 char **myargv;
128 int dorehash = 0;
129 int dorehashbans = 0;
130 int doremotd = 0;
131 int kline_queued = 0;
132 int server_state_foreground = 0;
133 int opers_see_all_users = 0;
134
135 int testing_conf = 0;
136
137 struct config_channel_entry ConfigChannel;
138 BlockHeap *channel_heap;
139 BlockHeap *ban_heap;
140 BlockHeap *topic_heap;
141 BlockHeap *member_heap;
142
143 BlockHeap *client_heap = NULL;
144 BlockHeap *lclient_heap = NULL;
145 BlockHeap *pclient_heap = NULL;
146
147 char current_uid[IDLEN];
148
149 /* patricia */
150 BlockHeap *prefix_heap;
151 BlockHeap *node_heap;
152 BlockHeap *patricia_heap;
153
154 BlockHeap *linebuf_heap;
155
156 BlockHeap *dnode_heap;
157
158 #ifdef NOTYET
159
160 void charybdis_initstate(struct IRCdState *self)
161 {
162
163 }
164
165 #endif