6 #ifndef INCLUDED_s_conf_h
7 #define INCLUDED_s_conf_h
8 #ifndef INCLUDED_time_h
9 #include <time.h> /* struct tm */
10 #define INCLUDED_time_h
12 #ifndef INCLUDED_sys_types_h
13 #include <sys/types.h>
14 #define INCLUDED_sys_types_h
28 /*-----------------------------------------------------------------------------
32 #define CONF_ILLEGAL 0x80000000
33 #define CONF_MATCH 0x40000000
34 #define CONF_CLIENT 0x0002
35 #define CONF_SERVER 0x0004
36 #define CONF_OPERATOR 0x0020
37 #define CONF_LEAF 0x1000
38 #define CONF_HUB 0x4000
39 #define CONF_UWORLD 0x8000
41 #define CONF_CLIENT_MASK (CONF_CLIENT | CONF_OPERATOR | CONF_SERVER)
43 #define IsIllegal(x) ((x)->status & CONF_ILLEGAL)
51 struct ConfItem *next;
52 unsigned int status; /* If CONF_ILLEGAL, delete when no clients */
53 unsigned int clients; /* Number of *LOCAL* clients using this */
54 struct ConnectionClass *conn_class; /* Class of connection */
55 struct irc_sockaddr origin; /* local address */
56 struct irc_sockaddr address; /* ip and port */
61 time_t hold; /* Hold until this time (calendar time) */
62 int dns_pending; /* a dns request is pending */
63 unsigned char bits; /* Number of bits for ipkills. */
64 struct Privs privs; /* Priviledges for opers. */
65 /* Used to detect if a privilege has been touched. */
66 struct Privs privs_dirty;
70 struct ServerConf* next;
74 struct irc_in_addr address;
78 struct ConnectionClass* conn_class;
89 struct DenyConf* next;
93 struct irc_in_addr address;
95 unsigned char bits; /* Number of bits for ipkills */
98 #define DENY_FLAGS_FILE 0x0001 /* Comment is a filename */
99 #define DENY_FLAGS_IP 0x0002 /* K-line by IP address */
100 #define DENY_FLAGS_REALNAME 0x0004 /* K-line by real name */
103 * A line: A:<line 1>:<line 2>:<line 3>
108 unsigned int numeric;
116 struct MotdItem *next;
120 struct MotdConf* next;
134 struct CRuleConf* next;
138 struct CRuleNode* node;
142 struct TRecord *next;
144 struct MotdItem *tmotd;
148 enum AuthorizationCheckResult {
150 ACR_NO_AUTHORIZATION,
151 ACR_TOO_MANY_IN_CLASS,
152 ACR_TOO_MANY_FROM_IP,
153 ACR_ALREADY_AUTHORIZED,
158 struct nick_host *next;
159 int nicklen; /* offset of @ part of server string */
160 char nick[1]; /* start of nick@server string */
169 struct nick_host *services;
176 extern struct ConfItem* GlobalConfList;
177 extern int GlobalConfCount;
178 extern struct tm motd_tm;
179 extern struct MotdItem* motd;
180 extern struct MotdItem* rmotd;
181 extern struct TRecord* tdata;
182 extern struct s_map* GlobalServiceMapList;
183 extern struct qline* GlobalQuarantineList;
189 extern int init_conf(void);
191 extern const struct LocalConf* conf_get_local(void);
192 extern const struct MotdConf* conf_get_motd_list(void);
193 extern const struct CRuleConf* conf_get_crule_list(void);
194 extern const struct DenyConf* conf_get_deny_list(void);
196 extern const char* conf_eval_crule(const char* name, int mask);
198 extern struct ConfItem* attach_confs_byhost(struct Client* cptr, const char* host, int statmask);
199 extern struct ConfItem* find_conf_byhost(struct SLink* lp, const char* host, int statmask);
200 extern struct ConfItem* find_conf_byname(struct SLink* lp, const char *name, int statmask);
201 extern struct ConfItem* conf_find_server(const char* name);
203 extern void det_confs_butmask(struct Client *cptr, int mask);
204 extern enum AuthorizationCheckResult attach_conf(struct Client *cptr, struct ConfItem *aconf);
205 extern struct ConfItem* find_conf_exact(const char* name, const char* user,
206 const char* host, int statmask);
207 extern enum AuthorizationCheckResult conf_check_client(struct Client *cptr);
208 extern int conf_check_server(struct Client *cptr);
209 extern struct ConfItem* find_conf_name(const char* name, int statmask);
210 extern int rehash(struct Client *cptr, int sig);
211 extern void read_tlines(void);
212 extern int find_kill(struct Client *cptr);
213 extern int find_restrict(struct Client *cptr);
214 extern struct MotdItem* read_motd(const char* motdfile);
215 extern const char *find_quarantine(const char* chname);
216 extern void lookup_confhost(struct ConfItem *aconf);
218 extern void yyerror(const char *msg);
220 #endif /* INCLUDED_s_conf_h */