ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/global.h
Revision: 1.6
Committed: Sat Sep 22 14:27:26 2007 UTC (16 years, 8 months ago) by pippijn
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +3 -14 lines
Log Message:
split up ermyth into ermyth-modules, libermyth (currently just ermyth-util) and ermyth-core

File Contents

# User Rev Content
1 pippijn 1.5 /**
2     * global.h: Global data
3     *
4     * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team
5     * Rights to this code are as documented in COPYING.
6     *
7     *
8     * Portions of this file were derived from sources bearing the following license:
9 pippijn 1.3 * Copyright © 2003-2004 E. Will et al.
10     * Copyright © 2005-2006 Atheme Development Group
11 pippijn 1.2 * Rights to this code are as documented in doc/pod/license.pod.
12 pippijn 1.1 *
13 pippijn 1.6 * $Id: global.h,v 1.5 2007-09-16 18:54:42 pippijn Exp $
14 pippijn 1.1 */
15    
16     #ifndef _GLOBAL_H
17     #define _GLOBAL_H
18    
19     /* me, a struct containing basic configuration options and some dynamic
20     * information about our uplink and program state */
21     struct me_t
22     {
23 pippijn 1.3 char *name; /* server's name on IRC */
24     char *desc; /* server's description */
25     char *actual; /* the reported name of the uplink */
26     char *vhost; /* IP we bind outgoing stuff to */
27     unsigned recontime; /* time between reconnection attempts */
28     unsigned restarttime; /* time before restarting */
29     char *netname; /* IRC network name */
30     char *hidehostsuffix; /* host suffix for P10 +x etc */
31     char *adminname; /* SRA's name (for ADMIN) */
32     char *adminemail; /* SRA's email (for ADMIN */
33     char *mta; /* path to mta program */
34     char *numeric; /* server numeric */
35    
36     int maxfd; /* how many fds do we have? */
37     unsigned mdlimit; /* metadata entry limit */
38     time_t start; /* starting time */
39     server_t *me; /* pointer to our server struct */
40     bool connected; /* are we connected? */
41     bool bursting; /* are we bursting? */
42     bool recvsvr; /* received server peer */
43    
44     unsigned maxlogins; /* maximum logins per username */
45     unsigned maxusers; /* maximum usernames from one email */
46     unsigned maxnicks; /* maximum nicks from one username */
47     unsigned maxchans; /* maximum chans from one username */
48     unsigned auth; /* registration auth type */
49     unsigned emaillimit; /* maximum number of emails sent */
50     time_t emailtime; /* ... in this amount of time */
51 pippijn 1.1
52 pippijn 1.3 time_t uplinkpong; /* when the uplink last sent a PONG */
53 pippijn 1.1
54 pippijn 1.3 char *execname; /* executable name */
55 pippijn 1.1
56     int argc;
57     char **argv;
58    
59 pippijn 1.3 void init ();
60 pippijn 1.6 void cleanup ();
61 pippijn 1.3
62 pippijn 1.1 me_t &operator = (const me_t &rhs);
63 pippijn 1.3 ~me_t ()
64     {
65 pippijn 1.6 cleanup ();
66 pippijn 1.3 }
67 pippijn 1.1 };
68    
69     E me_t me;
70    
71     /* values for me.auth */
72     #define AUTH_NONE 0
73     #define AUTH_EMAIL 1
74    
75     /* config_options, a struct containing other global configuration options */
76 pippijn 1.3 struct conf_option_t
77 pippijn 1.1 {
78 pippijn 1.3 char *chan; /* channel we join/msg */
79    
80     unsigned flood_msgs; /* messages determining flood */
81     time_t flood_time; /* time determining flood */
82     time_t kline_time; /* default expire for klines */
83     unsigned commit_interval; /* interval between commits */
84 pippijn 1.1
85 pippijn 1.3 bool silent; /* stop sending WALLOPS? */
86     bool join_chans; /* join registered channels? */
87     bool leave_chans; /* leave channels when empty? */
88     bool secure; /* require /msg <service>@host? */
89 pippijn 1.1
90 pippijn 1.3 unsigned defuflags; /* default username flags */
91     unsigned defcflags; /* default channel flags */
92 pippijn 1.1
93 pippijn 1.3 bool raw; /* enable raw/inject? */
94 pippijn 1.1
95 pippijn 1.3 char *global; /* nick for global noticer */
96     char *languagefile; /* path to language file (if any) */
97 pippijn 1.1
98 pippijn 1.3 bool verbose_wallops; /* verbose wallops? :) */
99     bool use_privmsg; /* use privmsg instead of notice */
100 pippijn 1.1
101 pippijn 1.3 unsigned default_clone_limit; /* default clone limit */
102 pippijn 1.1 };
103    
104 pippijn 1.3 struct database_t
105 pippijn 1.1 {
106     char *user;
107     char *pass;
108     char *database;
109     char *host;
110 pippijn 1.3 unsigned port;
111 pippijn 1.1 };
112    
113     /* keep track of how many of what we have */
114 pippijn 1.3 struct cnt_t
115 pippijn 1.1 {
116 pippijn 1.3 unsigned event;
117     unsigned soper;
118     unsigned svsignore;
119     unsigned tld;
120     unsigned kline;
121     unsigned server;
122     unsigned user;
123     unsigned chan;
124     unsigned chanuser;
125     unsigned myuser;
126     unsigned mynick;
127     unsigned mychan;
128     unsigned chanacs;
129     unsigned node;
130     unsigned bin;
131     unsigned bout;
132     unsigned uplink;
133     unsigned operclass;
134     unsigned myuser_access;
135 pippijn 1.1 };
136    
137 pippijn 1.3 E cnt_t cnt;
138     E database_t database_options;
139     E conf_option_t config_options;
140 pippijn 1.1
141     /* run flags */
142     E int runflags;
143    
144 pippijn 1.3 #define RF_LIVE 0x00000001 /* don't fork */
145     #define RF_SHUTDOWN 0x00000002 /* shut down */
146     #define RF_STARTING 0x00000004 /* starting up */
147     #define RF_RESTART 0x00000008 /* restart */
148     #define RF_REHASHING 0x00000010 /* rehashing */
149 pippijn 1.1
150     /* conf.c */
151     E bool conf_parse (char *);
152     E void conf_init (void);
153     E bool conf_rehash (void);
154     E bool conf_check (void);
155    
156 pippijn 1.3 /* confparse.c */
157 pippijn 1.1 E void config_free (config_file_t *cfptr);
158     E config_file_t *config_load (char *filename);
159     E config_entry_t *config_find (config_entry_t *ceptr, char *name);
160    
161     /* node.c */
162     E void init_nodes (void);
163     /* The following currently only do uplinks -- jilles */
164     E void mark_all_illegal (void);
165     E void unmark_all_illegal (void);
166     E void remove_illegals (void);
167    
168     /* atheme.c */
169     E bool cold_start;
170     E char *config_file;
171    
172     /* version.c */
173 pippijn 1.4 E char const website[];
174 pippijn 1.3 E char const generation[];
175     E char const creation[];
176     E char const platform[];
177     E char const version[];
178     E char const revision[];
179     E char const osinfo[];
180     E char const * const infotext[];
181 pippijn 1.1
182     #endif