Omega Security Services 0.7.3

core.h File Reference

Go to the source code of this file.

Data Structures

struct  memcounts
struct  Conf
struct  ProtocolInfo
struct  Link
struct  CMode
struct  Core

Defines

#define DPATH   PREFIX
#define EPATH   ETC_DIR
#define MPATH   MODULE_DIR
#define CPATH   MODULE_DIR "/core/"
#define PPATH   MODULE_DIR "/protocol/"
#define LPATH   "/logs/"
#define CONTRIB_PATH   MODULE_DIR "/contrib/"
#define SPATH   PREFIX "/bin/security"
#define CONFIG_NAME   EPATH "/security.cfg"
#define TMP_DIR   PREFIX "/var/tmp"
#define CLIENT_MOD_DIR   MODULE_DIR "/client/"
#define MAXPATH   255
#define HASH(x, y)   hash_safe(x,y)
#define MyFree(x)
#define s_assert(expr)   assert(expr)
#define MAXPARA   15
#define MAXSTRING   18
#define NICKMAX   30
#define MAXSERV   63
#define CMD_HASH_MAX   597
#define MODULE_MAX   100
#define ERR_STATE   -3
#define QUIT   -2
#define SHUTDOWN   -1
#define STARTUP   0
#define CONNECTING   1
#define BURSTING   2
#define RUNNING   3
#define IS_CON   3
#define NOT_CON   0
#define serv_state(state)   (((state) != sync_state)? 0 : 1)

Typedefs

typedef int16_t int16
typedef u_int16_t uint16
typedef int32_t int32
typedef u_int32_t uint32

Functions

CoreCore_Construct ()
void init_core ()
int check_for_pid ()
void Exit (int)
void Rehash (int)
void OneTimeAround ()
void SaveAll (int)
void SetTime ()
void init_lists (void)

Variables

pid_t pid
int debug
int backtrc
int nofork
int connect_attempts
int introduce_attempts
time_t last_attempt
int recvbytes
int sentbytes
time_t starttime
struct memcounts memcounts
Conf CfgSettings
struct ProtocolInfo ProtocolInfo
char logchan [32]
char datadir [MAXPATH]
LinkUplink
LinkLinks
LinkMe
int sync_state
struct tm * curdate
struct tm * lastdate
time_t ServerTime
int UseTokens
int logcmds
CoreOmega
int session_count
size_t session_size
int skip_banner

Define Documentation

#define BURSTING   2

Definition at line 267 of file core.h.

Referenced by AddToChannelU(), NewClient(), and sendto_channel().

#define CLIENT_MOD_DIR   MODULE_DIR "/client/"

Definition at line 19 of file core.h.

Referenced by find_module_dir().

#define CMD_HASH_MAX   597

Definition at line 87 of file core.h.

#define CONFIG_NAME   EPATH "/security.cfg"

Definition at line 16 of file core.h.

#define CONNECTING   1

Definition at line 266 of file core.h.

Referenced by uplink_cleanup().

#define CONTRIB_PATH   MODULE_DIR "/contrib/"

Definition at line 13 of file core.h.

Referenced by find_module_dir().

#define CPATH   MODULE_DIR "/core/"

Definition at line 10 of file core.h.

Referenced by find_module_dir(), and load_modules().

#define DPATH   PREFIX

Definition at line 7 of file core.h.

Referenced by main(), open_log(), and VerifyConf().

#define EPATH   ETC_DIR

Definition at line 8 of file core.h.

Referenced by main().

#define ERR_STATE   -3

SYNC STATES

Definition at line 262 of file core.h.

#define IS_CON   3

Definition at line 272 of file core.h.

#define LPATH   "/logs/"

Definition at line 12 of file core.h.

Referenced by open_log().

#define MAXPARA   15

Definition at line 83 of file core.h.

Referenced by parse(), and string_to_array().

#define MAXPATH   255

Definition at line 21 of file core.h.

Referenced by create_mod_temp().

#define MAXSERV   63

Definition at line 86 of file core.h.

Referenced by get_hostname().

#define MAXSTRING   18

Definition at line 84 of file core.h.

#define MODULE_MAX   100

Definition at line 88 of file core.h.

#define MPATH   MODULE_DIR

Definition at line 9 of file core.h.

Referenced by find_module_dir().

#define MyFree (   x)
Value:
do {                            \
        assert((x) != NULL);    \
                                \
        if((x) != NULL)         \
        {                       \
             free(x);           \
             x = NULL;          \
        }                       \
} while (0)

Free work around and sanity checker

Definition at line 29 of file core.h.

#define NICKMAX   30

Definition at line 85 of file core.h.

#define NOT_CON   0

Definition at line 273 of file core.h.

#define PPATH   MODULE_DIR "/protocol/"

Definition at line 11 of file core.h.

Referenced by find_module_dir().

#define QUIT   -2

Definition at line 263 of file core.h.

#define RUNNING   3

Definition at line 268 of file core.h.

Referenced by load_modules(), run_mod_que(), and sendto_logchan().

#define s_assert (   expr)    assert(expr)

Use built in debug commands. These commands bypass the command system and are only for debuging the CORE - There is no documentation on these commands...

Definition at line 79 of file core.h.

Referenced by AddUser(), generate_p10_uid(), generate_uid(), mutex_state(), parse(), read_chanmode_string(), read_usermode_string(), and valid_hostname().

#define serv_state (   state)    (((state) != sync_state)? 0 : 1)

Definition at line 275 of file core.h.

#define SHUTDOWN   -1

Definition at line 264 of file core.h.

Referenced by AtExit().

#define SPATH   PREFIX "/bin/security"

Definition at line 14 of file core.h.

Referenced by do_restart().

#define STARTUP   0

Definition at line 265 of file core.h.

Referenced by Core_Construct().

#define TMP_DIR   PREFIX "/var/tmp"

Definition at line 18 of file core.h.

Referenced by create_mod_temp().


Typedef Documentation

typedef int16_t int16

INT WORK AROUND

Definition at line 196 of file core.h.

typedef int32_t int32

Definition at line 198 of file core.h.

typedef u_int16_t uint16

Definition at line 197 of file core.h.

typedef u_int32_t uint32

Definition at line 199 of file core.h.


Function Documentation

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 231 of file main.c.

References CfgSettings, and Conf::pidfile.

Referenced by DaemonSeed().

Core* Core_Construct ( )

Definition at line 31 of file core.c.

References Core::age, alog(), Exit(), Core::exit, Core::log, Rehash(), Core::rehash, STARTUP, Core::state, and sync_state.

Referenced by main().

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 454 of file main.c.

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

void init_core ( )

PROTOTYPES

void init_lists ( void  )

Definition at line 491 of file main.c.

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

Referenced by main().

void OneTimeAround ( )

Definition at line 339 of file main.c.

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

Referenced by Run().

void Rehash ( int  )

Definition at line 462 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 SaveAll ( int  )
void SetTime ( )

Definition at line 371 of file main.c.

References curdate, lastdate, and ServerTime.

Referenced by main(), and OneTimeAround().


Variable Documentation

int backtrc

Definition at line 93 of file core.h.

Referenced by SetSig().

Definition at line 96 of file core.h.

struct tm* curdate

TIME

Definition at line 286 of file core.h.

Referenced by SetTime().

char datadir[MAXPATH]

Definition at line 188 of file core.h.

Referenced by InitDefaults(), and VerifyConf().

int debug

Definition at line 92 of file core.h.

Referenced by add_protocol(), alog(), do_cmd(), Event(), init_modules(), and main().

Definition at line 98 of file core.h.

time_t last_attempt

Definition at line 99 of file core.h.

struct tm* lastdate

Definition at line 288 of file core.h.

Referenced by SetTime().

Definition at line 239 of file core.h.

char logchan[32]

Definition at line 187 of file core.h.

Referenced by foo_connect(), main(), sendto_logchan(), and VerifyConf().

int logcmds

Definition at line 299 of file core.h.

Referenced by do_cmd(), InitDefaults(), and VerifyConf().

Link* Me

Definition at line 240 of file core.h.

int nofork

Definition at line 94 of file core.h.

Referenced by add_protocol(), alog(), DaemonSeed(), and main().

Definition at line 331 of file core.h.

Referenced by AtExit(), main(), Run(), sendto_one_numeric(), and uplink_cleanup().

pid_t pid

Definition at line 90 of file core.h.

Referenced by DaemonSeed().

int recvbytes

Definition at line 101 of file core.h.

Referenced by sock_readline().

int sentbytes

Definition at line 102 of file core.h.

Referenced by send_line(), and sendto_socket().

time_t ServerTime

Definition at line 291 of file core.h.

Referenced by alog(), RunTimedEvents(), and SetTime().

Definition at line 352 of file core.h.

size_t session_size

Definition at line 353 of file core.h.

Definition at line 354 of file core.h.

Referenced by add_protocol(), Banner(), load_modules(), main(), and run_mod_que().

time_t starttime

Definition at line 104 of file core.h.

Referenced by main().

Definition at line 238 of file core.h.

Referenced by ev_ping(), and uplink_cleanup().

int UseTokens

TOKEN STUFF

Definition at line 298 of file core.h.

Referenced by SendToken().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines