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_ME 0x0040
42 #define CONF_KILL 0x0080
43 #define CONF_ADMIN 0x0100
44 #define CONF_CLASS 0x0400
45 #define CONF_LEAF 0x1000
46 #define CONF_LISTEN_PORT 0x2000
47 #define CONF_HUB 0x4000
48 #define CONF_UWORLD 0x8000
49 #define CONF_CRULEALL 0x00200000
50 #define CONF_CRULEAUTO 0x00400000
51 #define CONF_TLINES 0x00800000
52 #define CONF_IPKILL 0x00010000
54 #define CONF_OPS (CONF_OPERATOR | CONF_LOCOP)
55 #define CONF_CLIENT_MASK (CONF_CLIENT | CONF_OPS | CONF_SERVER)
56 #define CONF_CRULE (CONF_CRULEALL | CONF_CRULEAUTO)
57 #define CONF_KLINE (CONF_KILL | CONF_IPKILL)
59 #define IsIllegal(x) ((x)->status & CONF_ILLEGAL)
66 unsigned int status; /* If CONF_ILLEGAL, delete when no clients */
67 unsigned int clients; /* Number of *LOCAL* clients using this */
68 struct in_addr ipnum; /* ip number of host field */
69 char bits; /* Number of bits for ipkills */
73 unsigned short int port;
74 time_t hold; /* Hold until this time (calendar time) */
75 int dns_pending; /* a dns request is pending */
76 struct ConfClass* confClass; /* Class of connection */
77 struct ConfItem* next;
81 * A line: A:<line 1>:<line 2>:<line 3>
95 struct MotdItem *next;
101 struct MotdConf* next;
106 struct MotdItem *tmotd;
108 struct TRecord *next;
111 enum AuthorizationCheckResult {
113 ACR_NO_AUTHORIZATION,
114 ACR_TOO_MANY_IN_CLASS,
115 ACR_TOO_MANY_FROM_IP,
116 ACR_ALREADY_AUTHORIZED,
123 extern struct ConfItem* GlobalConfList;
124 extern int GlobalConfCount;
125 extern struct tm motd_tm;
126 extern struct MotdItem* motd;
127 extern struct MotdItem* rmotd;
128 extern struct TRecord* tdata;
134 extern const struct LocalConf* conf_get_local(void);
135 extern const struct MotdConf* conf_get_motd_list(void);
137 extern struct ConfItem* attach_confs_byhost(struct Client* cptr,
138 const char* host, int statmask);
139 extern struct ConfItem* find_conf_byhost(struct SLink* lp, const char* host,
141 extern struct ConfItem* find_conf_byname(struct SLink* lp, const char *name,
143 extern struct ConfItem* conf_find_server(const char* name);
144 const char* conf_eval_crule(struct ConfItem* conf);
146 extern void det_confs_butmask(struct Client *cptr, int mask);
147 extern int detach_conf(struct Client *cptr, struct ConfItem *aconf);
148 extern enum AuthorizationCheckResult attach_conf(struct Client *cptr, struct ConfItem *aconf);
149 extern struct ConfItem* find_me(void);
150 extern struct ConfItem* find_conf_exact(const char* name,
152 const char* host, int statmask);
153 extern enum AuthorizationCheckResult conf_check_client(struct Client *cptr);
154 extern int conf_check_server(struct Client *cptr);
155 extern struct ConfItem* find_conf_name(const char* name, int statmask);
156 extern int rehash(struct Client *cptr, int sig);
157 extern int conf_init(void);
158 extern void read_tlines(void);
159 extern int find_kill(struct Client *cptr);
160 extern int find_restrict(struct Client *cptr);
161 extern int m_killcomment(struct Client *sptr, char *parv, char *filename);
162 extern struct MotdItem* read_motd(const char* motdfile);
164 #endif /* INCLUDED_s_conf_h */