/* * Copyright © 2003-2004 E. Will et al. * Copyright © 2005-2006 Atheme Development Group * Rights to this code are as documented in doc/pod/license.pod. * * Global data * * $Id: global.h,v 1.2 2007/07/21 01:29:07 pippijn Exp $ */ #ifndef _GLOBAL_H #define _GLOBAL_H /* me, a struct containing basic configuration options and some dynamic * information about our uplink and program state */ struct me_t { char *name; /* server's name on IRC */ char *desc; /* server's description */ char *actual; /* the reported name of the uplink */ char *vhost; /* IP we bind outgoing stuff to */ unsigned int recontime; /* time between reconnection attempts */ unsigned int restarttime; /* time before restarting */ char *netname; /* IRC network name */ char *hidehostsuffix; /* host suffix for P10 +x etc */ char *adminname; /* SRA's name (for ADMIN) */ char *adminemail; /* SRA's email (for ADMIN */ char *mta; /* path to mta program */ char *numeric; /* server numeric */ int maxfd; /* how many fds do we have? */ unsigned int mdlimit; /* metadata entry limit */ time_t start; /* starting time */ server_t *me; /* pointer to our server struct */ bool connected; /* are we connected? */ bool bursting; /* are we bursting? */ bool recvsvr; /* received server peer */ unsigned int maxlogins; /* maximum logins per username */ unsigned int maxusers; /* maximum usernames from one email */ unsigned int maxnicks; /* maximum nicks from one username */ unsigned int maxchans; /* maximum chans from one username */ unsigned int auth; /* registration auth type */ unsigned int emaillimit; /* maximum number of emails sent */ time_t emailtime; /* ... in this amount of time */ time_t uplinkpong; /* when the uplink last sent a PONG */ char *execname; /* executable name */ char *language_name; /* language file name */ char *language_translator; /* translator name */ int argc; char **argv; me_t &operator = (const me_t &rhs); ~me_t (); void destroy (); }; E me_t me; /* values for me.auth */ #define AUTH_NONE 0 #define AUTH_EMAIL 1 /* config_options, a struct containing other global configuration options */ struct ConfOption { char *chan; /* channel we join/msg */ unsigned int flood_msgs; /* messages determining flood */ time_t flood_time; /* time determining flood */ time_t kline_time; /* default expire for klines */ unsigned int commit_interval; /* interval between commits */ bool silent; /* stop sending WALLOPS? */ bool join_chans; /* join registered channels? */ bool leave_chans; /* leave channels when empty? */ bool secure; /* require /msg @host? */ unsigned int defuflags; /* default username flags */ unsigned int defcflags; /* default channel flags */ bool raw; /* enable raw/inject? */ char *global; /* nick for global noticer */ char *languagefile; /* path to language file (if any) */ bool verbose_wallops; /* verbose wallops? :) */ bool use_privmsg; /* use privmsg instead of notice */ }; struct Database { char *user; char *pass; char *database; char *host; unsigned int port; }; /* keep track of how many of what we have */ struct cnt { unsigned int event; unsigned int soper; unsigned int svsignore; unsigned int tld; unsigned int kline; unsigned int server; unsigned int user; unsigned int chan; unsigned int chanuser; unsigned int myuser; unsigned int mynick; unsigned int mychan; unsigned int chanacs; unsigned int node; unsigned int bin; unsigned int bout; unsigned int uplink; unsigned int operclass; unsigned int myuser_access; }; struct claro_state_t { unsigned int node; unsigned int event; time_t currtime; unsigned int maxfd; }; E claro_state_t claro_state; E struct cnt cnt; E Database database_options; E ConfOption config_options; #define NOW claro_state.currtime /* run flags */ E int runflags; #define RF_LIVE 0x00000001 /* don't fork */ #define RF_SHUTDOWN 0x00000002 /* shut down */ #define RF_STARTING 0x00000004 /* starting up */ #define RF_RESTART 0x00000008 /* restart */ #define RF_REHASHING 0x00000010 /* rehashing */ /* conf.c */ E bool conf_parse (char *); E void conf_init (void); E bool conf_rehash (void); E bool conf_check (void); /* confp.c */ E void config_free (config_file_t *cfptr); E config_file_t *config_load (char *filename); E config_entry_t *config_find (config_entry_t *ceptr, char *name); /* node.c */ E void init_nodes (void); /* The following currently only do uplinks -- jilles */ E void mark_all_illegal (void); E void unmark_all_illegal (void); E void remove_illegals (void); /* atheme.c */ E bool cold_start; E char *config_file; /* version.c */ E const char *generation; E const char *creation; E const char *platform; E const char *version; E const char *revision; E const char *osinfo; E const char *infotext[]; #endif