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
CoreOmega
int session_count
size_t session_size

Define Documentation

#define BURSTING   2

Definition at line 272 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 89 of file core.h.

#define CONFIG_NAME   EPATH "/security.cfg"

Definition at line 16 of file core.h.

#define CONNECTING   1

Definition at line 271 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 InitDefaults(), main(), and open_log().

#define EPATH   ETC_DIR

Definition at line 8 of file core.h.

Referenced by main().

#define ERR_STATE   -3

SYNC STATES

Definition at line 267 of file core.h.

#define HASH ( x,
 )     hash_safe(x,y)
#define IS_CON   3

Definition at line 277 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 85 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 88 of file core.h.

Referenced by get_hostname().

#define MAXSTRING   18

Definition at line 86 of file core.h.

#define MODULE_MAX   100

Definition at line 90 of file core.h.

#define MPATH   MODULE_DIR

Definition at line 9 of file core.h.

Referenced by find_module_dir().

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

Free work around and sanity checker

Definition at line 31 of file core.h.

Referenced by DelCmd().

#define NICKMAX   30

Definition at line 87 of file core.h.

#define NOT_CON   0

Definition at line 278 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 268 of file core.h.

#define RUNNING   3

Definition at line 273 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 81 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 280 of file core.h.

#define SHUTDOWN   -1

Definition at line 269 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 270 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 201 of file core.h.

typedef int32_t int32

Definition at line 203 of file core.h.

typedef u_int16_t uint16

Definition at line 202 of file core.h.

typedef u_int32_t uint32

Definition at line 204 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 216 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 448 of file main.c.

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

void init_core (  ) 

PROTOTYPES

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 OneTimeAround (  ) 

Definition at line 333 of file main.c.

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

Referenced by Run().

void Rehash ( int   ) 

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 SaveAll ( int   ) 
void SetTime (  ) 

Definition at line 363 of file main.c.

References curdate, lastdate, and ServerTime.

Referenced by main(), and OneTimeAround().


Variable Documentation

int backtrc

Definition at line 95 of file core.h.

Referenced by SetSig().

Definition at line 98 of file core.h.

struct tm* curdate

TIME

Definition at line 291 of file core.h.

Referenced by SetTime().

char datadir[MAXPATH]

Definition at line 193 of file core.h.

Referenced by InitDefaults(), and VerifyConf().

int debug

Definition at line 94 of file core.h.

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

Definition at line 100 of file core.h.

time_t last_attempt

Definition at line 101 of file core.h.

struct tm* lastdate

Definition at line 293 of file core.h.

Referenced by SetTime().

Definition at line 244 of file core.h.

char logchan[32]

Definition at line 192 of file core.h.

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

Link* Me

Definition at line 245 of file core.h.

int nofork

Definition at line 96 of file core.h.

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

Definition at line 336 of file core.h.

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

pid_t pid

Definition at line 92 of file core.h.

Referenced by DaemonSeed().

int recvbytes

Definition at line 103 of file core.h.

Referenced by sock_readline().

int sentbytes

Definition at line 104 of file core.h.

Referenced by send_line(), and sendto_socket().

time_t ServerTime

Definition at line 296 of file core.h.

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

Definition at line 357 of file core.h.

size_t session_size

Definition at line 359 of file core.h.

time_t starttime

Definition at line 106 of file core.h.

Referenced by main().

Definition at line 243 of file core.h.

Referenced by ev_ping(), and uplink_cleanup().

int UseTokens

TOKEN STUFF

Definition at line 303 of file core.h.

Referenced by SendToken().

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