* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
- *
- * $Id$
*/
-#include "ratbox_lib.h"
+#include "rb_lib.h"
#include "stdinc.h"
#include "setup.h"
#include "config.h"
#include "hostmask.h"
#include "numeric.h"
#include "parse.h"
-#include "res.h"
#include "restart.h"
#include "s_auth.h"
#include "s_conf.h"
#include "chmode.h"
#include "privilege.h"
#include "bandbi.h"
+#include "authd.h"
+#include "operhash.h"
/* /quote set variables */
struct SetOptions GlobalSetOptions;
const char *pidFileName = PPATH;
char **myargv;
-int dorehash = 0;
-int dorehashbans = 0;
-int doremotd = 0;
-int kline_queued = 0;
-int server_state_foreground = 0;
-int opers_see_all_users = 0;
-int ssl_ok = 0;
-int zlib_ok = 1;
+bool dorehash = false;
+bool dorehashbans = false;
+bool doremotd = false;
+bool kline_queued = false;
+bool server_state_foreground = false;
+bool opers_see_all_users = false;
+bool ssl_ok = false;
+bool zlib_ok = true;
int testing_conf = 0;
time_t startup_time;
if(dorehash)
{
rehash(1);
- dorehash = 0;
+ dorehash = false;
}
if(dorehashbans)
{
rehash_bans(1);
- dorehashbans = 0;
+ dorehashbans = false;
}
if(doremotd)
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"Got signal SIGUSR1, reloading ircd motd file");
cache_user_motd();
- doremotd = 0;
+ doremotd = false;
}
}
{
unsigned int pid = (unsigned int) getpid();
- rb_snprintf(buff, sizeof(buff), "%u\n", pid);
+ snprintf(buff, sizeof(buff), "%u\n", pid);
if((fputs(buff, fb) == -1))
{
ilog(L_MAIN, "Error writing %u to pid file %s (%s)",
static void
ircd_log_cb(const char *str)
{
- ilog(L_MAIN, "libratbox reports: %s", str);
+ ilog(L_MAIN, "librb reports: %s", str);
}
static void
ircd_restart_cb(const char *str)
{
- inotice("libratbox has called the restart callback: %s", str);
+ inotice("librb has called the restart callback: %s", str);
restart(str);
}
if(str != NULL)
{
/* Try to get the message out to currently logged in operators. */
- sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "libratbox has called the die callback..aborting: %s", str);
- inotice("libratbox has called the die callback..aborting: %s", str);
+ sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "librb has called the die callback..aborting: %s", str);
+ inotice("librb has called the die callback..aborting: %s", str);
}
else
- inotice("libratbox has called the die callback..aborting");
+ inotice("librb has called the die callback..aborting");
unlink(pidFileName);
exit(EXIT_FAILURE);
*/
setup_corefile();
+ /* initialise operhash fairly early. */
+ init_operhash();
+
memset(&me, 0, sizeof(me));
memset(&meLocalUser, 0, sizeof(meLocalUser));
me.localClient = &meLocalUser;
setup_signals();
if (testing_conf)
- server_state_foreground = 1;
+ server_state_foreground = true;
/* Make sure fd 0, 1 and 2 are in use -- jilles */
do
init_hook();
init_channels();
initclass();
- initwhowas();
+ whowas_init();
init_reject();
init_cache();
init_monitor();
load_core_modules(1);
init_auth(); /* Initialise the auth code */
- init_resolver(); /* Needs to be setup before the io loop */
+ init_authd(); /* Start up authd. */
+ init_dns(); /* Start up DNS query system */
+
privilegeset_set_new("default", "", 0);
if (testing_conf)
fprintf(stderr, "\nBeginning config test\n");
- read_conf_files(YES); /* cold start init conf files */
+ read_conf_files(true); /* cold start init conf files */
mod_add_path(MODULE_DIR);
mod_add_path(MODULE_DIR "/autoload");
if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params, ServerInfo.ssl_cipher_list))
{
ilog(L_MAIN, "WARNING: Unable to setup SSL.");
- ssl_ok = 0;
+ ssl_ok = false;
}
else
- ssl_ok = 1;
+ ssl_ok = true;
}
if (testing_conf)