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
16 #ifndef INCLUDED_netinet_in_h
17 #include <netinet/in.h> /* struct in_addr */
18 #define INCLUDED_netinet_in_h
31 /*-----------------------------------------------------------------------------
35 #define CONF_ILLEGAL 0x80000000
36 #define CONF_MATCH 0x40000000
37 #define CONF_CLIENT 0x0002
38 #define CONF_SERVER 0x0004
39 #define CONF_LOCOP 0x0010
40 #define CONF_OPERATOR 0x0020
41 #define CONF_LEAF 0x1000
42 #define CONF_HUB 0x4000
43 #define CONF_UWORLD 0x8000
45 #define CONF_OPS (CONF_OPERATOR | CONF_LOCOP)
46 #define CONF_CLIENT_MASK (CONF_CLIENT | CONF_OPS | CONF_SERVER)
48 #define IsIllegal(x) ((x)->status & CONF_ILLEGAL)
56 struct ConfItem *next;
57 unsigned int status; /* If CONF_ILLEGAL, delete when no clients */
58 unsigned int clients; /* Number of *LOCAL* clients using this */
59 struct ConnectionClass *conn_class; /* Class of connection */
60 struct in_addr ipnum; /* ip number of host field */
64 time_t hold; /* Hold until this time (calendar time) */
65 int dns_pending; /* a dns request is pending */
67 unsigned char bits; /* Number of bits for ipkills. */
68 struct Privs privs; /* Priviledges for opers. */
72 struct ServerConf* next;
76 struct in_addr address;
81 struct ConnectionClass* conn_class;
85 struct DenyConf* next;
91 char bits; /* Number of bits for ipkills */
94 #define DENY_FLAGS_FILE 0x0001 /* Comment is a filename */
95 #define DENY_FLAGS_IP 0x0002 /* K-line by IP address */
96 #define DENY_FLAGS_REALNAME 0x0004 /* K-line by real name */
99 * A line: A:<line 1>:<line 2>:<line 3>
104 struct in_addr vhost_address;
105 unsigned int numeric;
113 struct MotdItem *next;
117 struct MotdConf* next;
131 struct CRuleConf* next;
135 struct CRuleNode* node;
139 struct TRecord *next;
141 struct MotdItem *tmotd;
145 enum AuthorizationCheckResult {
147 ACR_NO_AUTHORIZATION,
148 ACR_TOO_MANY_IN_CLASS,
149 ACR_TOO_MANY_FROM_IP,
150 ACR_ALREADY_AUTHORIZED,
158 extern struct ConfItem* GlobalConfList;
159 extern int GlobalConfCount;
160 extern struct tm motd_tm;
161 extern struct MotdItem* motd;
162 extern struct MotdItem* rmotd;
163 extern struct TRecord* tdata;
169 extern int init_conf(void);
171 extern const struct LocalConf* conf_get_local(void);
172 extern const struct MotdConf* conf_get_motd_list(void);
173 extern const struct CRuleConf* conf_get_crule_list(void);
174 extern const struct DenyConf* conf_get_deny_list(void);
176 extern const char* conf_eval_crule(const char* name, int mask);
178 extern struct ConfItem* attach_confs_byhost(struct Client* cptr, const char* host, int statmask);
179 extern struct ConfItem* find_conf_byhost(struct SLink* lp, const char* host, int statmask);
180 extern struct ConfItem* find_conf_byname(struct SLink* lp, const char *name, int statmask);
181 extern struct ConfItem* conf_find_server(const char* name);
183 extern void det_confs_butmask(struct Client *cptr, int mask);
184 extern enum AuthorizationCheckResult attach_conf(struct Client *cptr, struct ConfItem *aconf);
185 extern struct ConfItem* find_conf_exact(const char* name, const char* user,
186 const char* host, int statmask);
187 extern enum AuthorizationCheckResult conf_check_client(struct Client *cptr);
188 extern int conf_check_server(struct Client *cptr);
189 extern struct ConfItem* find_conf_name(const char* name, int statmask);
190 extern int rehash(struct Client *cptr, int sig);
191 extern void read_tlines(void);
192 extern int find_kill(struct Client *cptr);
193 extern int find_restrict(struct Client *cptr);
194 extern struct MotdItem* read_motd(const char* motdfile);
196 extern void set_initial_oper_privs(struct ConfItem *oper, int flags);
197 extern void lookup_confhost(struct ConfItem *aconf);
199 extern void yyerror(const char *msg);
201 #endif /* INCLUDED_s_conf_h */