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
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.
33 * $Id: main.c 867 2006-02-16 14:25:09Z nenolod $
47 #include "irc_string.h"
48 #include "ircd_signal.h"
49 #include "sprintf_irc.h"
51 #include "msg.h" /* msgtab */
60 #include "s_serv.h" /* try_connections */
68 #include "ircd_getopt.h"
73 #include "s_newconf.h"
76 #include "patchlevel.h"
79 rb_dlink_list lclient_list
= { NULL
, NULL
, 0 };
80 rb_dlink_list global_client_list
= { NULL
, NULL
, 0 };
81 rb_dlink_list global_channel_list
= { NULL
, NULL
, 0 };
83 rb_dlink_list unknown_list
; /* unknown clients ON this server only */
84 rb_dlink_list serv_list
; /* local servers to this server ONLY */
85 rb_dlink_list global_serv_list
; /* global servers on the network */
86 rb_dlink_list local_oper_list
; /* our opers, duplicated in lclient_list */
87 rb_dlink_list oper_list
; /* network opers */
89 /* /quote set variables */
90 struct SetOptions GlobalSetOptions
;
92 /* configuration set from ircd.conf */
93 struct config_file_entry ConfigFileEntry
;
94 /* server info set from ircd.conf */
95 struct server_info ServerInfo
;
96 /* admin info set from ircd.conf */
97 struct admin_info AdminInfo
;
101 struct timeval SystemTime
;
102 int ServerRunning
; /* GLOBAL - server execution state */
103 struct Client me
; /* That's me */
104 struct LocalUser meLocalUser
; /* That's also part of me */
108 int default_server_capabs
= CAP_MASK
;
116 unsigned long initialVMTop
= 0; /* top of virtual memory at init */
117 const char *logFileName
= LPATH
;
118 const char *pidFileName
= PPATH
;
122 int dorehashbans
= 0;
124 int kline_queued
= 0;
125 int server_state_foreground
= 0;
126 int opers_see_all_users
= 0;
128 int testing_conf
= 0;
130 struct config_channel_entry ConfigChannel
;
131 BlockHeap
*channel_heap
;
133 BlockHeap
*topic_heap
;
134 BlockHeap
*member_heap
;
136 BlockHeap
*client_heap
= NULL
;
137 BlockHeap
*lclient_heap
= NULL
;
138 BlockHeap
*pclient_heap
= NULL
;
140 char current_uid
[IDLEN
];
143 BlockHeap
*prefix_heap
;
144 BlockHeap
*node_heap
;
145 BlockHeap
*patricia_heap
;
147 BlockHeap
*linebuf_heap
;
149 BlockHeap
*dnode_heap
;
153 void charybdis_initstate(struct IRCdState
*self
)