main.c File Reference

#include "stdinc.h"
#include "server.h"

Go to the source code of this file.

Functions

static void showHelp ()
void Run (void)
void DaemonSeed (void)
void Banner (void)
void Load_Dbs (void)
static void AtExit (void)
void do_restart (void)
void psr_HandleEvent (Socket *s, int et)
int main (int argc, char **argv, char **env)
int check_for_pid ()
void OneTimeAround ()
void SetTime ()
void Exit (int status)
void Rehash (int status)
void init_lists ()

Variables

int uselogchan
ServCmdsservcmds_list = NULL
UserCmdsusercmds_list = NULL
Modulemodule_list = NULL
char ** my_env
char ** my_argv

Function Documentation

static void AtExit ( void   )  [static]

AtExit() Called by atexit when program terminates this insures we have proper cleanup :)

Returns:
void - must return void

Definition at line 393 of file main.c.

References CfgSettings, close_log(), dest_all_threads(), DestAccList(), destroy_config_tree(), destroy_event_list(), Event(), Omega, Conf::pidfile, SHUTDOWN, socket_cleanup(), sync_state, and uplink_cleanup().

Referenced by main().

void Banner ( void   ) 

Definition at line 154 of file main.c.

References COMPILE_DATE, PACKAGE_VERSION, SYSUNAME_SHORT, and VERSION_STRING.

Referenced by Run().

int check_for_pid (  ) 

Move this to its own function

return 0 if there is no pid or -1 if there is no file else return the current active pid.

Definition at line 216 of file main.c.

References CfgSettings, and Conf::pidfile.

Referenced by DaemonSeed().

void DaemonSeed ( void   ) 

Definition at line 171 of file main.c.

References CfgSettings, check_for_pid(), nofork, pid, and Conf::pidfile.

Referenced by main().

void do_restart ( void   ) 

Definition at line 468 of file main.c.

References CfgSettings, Event(), my_argv, Conf::pidfile, SPATH, and uplink_cleanup().

Referenced by SigHandler().

void Exit ( int  status  ) 

Our exit function - since everything is pretty much handled in AtExit we are just calling exit(0) for the time being

Definition at line 448 of file main.c.

Referenced by Core_Construct(), load_modules(), main(), and SigHandler().

void init_lists ( void   ) 

Definition at line 482 of file main.c.

References access_flags, accesslist, connected_sockets, events, servlist, sockets, sockevents, and userlist.

Referenced by main().

void Load_Dbs ( void   ) 

Load_Dbs()

Definition at line 437 of file main.c.

int main ( int  argc,
char **  argv,
char **  env 
)
void OneTimeAround (  ) 

Definition at line 333 of file main.c.

References alog(), LOG_SOCKET, receive(), RunTimedEvents(), SetTime(), and SOCK_ERR_OK.

Referenced by Run().

void psr_HandleEvent ( Socket s,
int  et 
)

Definition at line 265 of file parser.c.

References EVENT_READ, GetLine(), and parse().

void Rehash ( int  status  ) 

Definition at line 456 of file main.c.

References CfgSettings, Conf::conf_name, config_load(), destroy_config_tree(), Event(), and sendto_logchan().

Referenced by Core_Construct(), and SigHandler().

void Run ( void   ) 

Todo:
This is temporary tell we get a better system in place problem is that the access flags are doubled upon ConfReload and this will cause access to fail... so for now destroy our access list and allow the rehash to recreate it - gonna work on fixing this next time around.

Definition at line 249 of file main.c.

References add_new_socket(), AddEvent, AddEventEx(), Banner(), burst_local_users(), CfgSettings, Connect(), Link::eos, ev_connectuplink(), ev_housekeeping(), ev_ping(), EVENT_UNLIMITED, Socket::flags, get_config_bool(), init_modules(), init_uid(), introduce_users(), ircd_connect(), Core::me, Socket::name, new_serv(), Omega, OneTimeAround(), open_log(), Conf::port, protocol_init(), psr_HandleEvent(), psr_init(), Conf::servername, servsock, SetSig(), Conf::sid, Link::sid, SOCK_UPLINK, strlcpy(), Conf::uplink, VerifyConf(), and Conf::vhost.

Referenced by main().

void SetTime (  ) 

Definition at line 363 of file main.c.

References curdate, lastdate, and ServerTime.

Referenced by main(), and OneTimeAround().

static void showHelp (  )  [static]

Definition at line 498 of file main.c.

Referenced by main().


Variable Documentation

Definition at line 19 of file main.c.

char ** my_argv

Definition at line 27 of file main.c.

Referenced by do_restart(), and main().

char** my_env

Definition at line 27 of file main.c.

Referenced by main().

Definition at line 16 of file main.c.

Definition at line 5 of file log.h.

Referenced by main(), sendto_logchan(), and uplink_cleanup().

Definition at line 17 of file main.c.

Generated on Mon Jul 19 21:53:05 2010 for Omega Security Services by  doxygen 1.6.3