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 */
72 unsigned short int port;
73 time_t hold; /* Hold until this time (calendar time) */
74 int dns_pending; /* a dns request is pending */
75 struct ConfClass* confClass; /* Class of connection */
76 struct ConfItem* next;
81 struct MotdItem *next;
86 struct MotdItem *tmotd;
91 enum AuthorizationCheckResult {
94 ACR_TOO_MANY_IN_CLASS,
96 ACR_ALREADY_AUTHORIZED,
103 extern struct ConfItem* GlobalConfList;
104 extern int GlobalConfCount;
105 extern struct tm motd_tm;
106 extern struct MotdItem* motd;
107 extern struct MotdItem* rmotd;
108 extern struct TRecord* tdata;
113 extern struct ConfItem* attach_confs_byhost(struct Client* cptr,
114 const char* host, int statmask);
115 extern struct ConfItem* find_conf_byhost(struct SLink* lp, const char* host,
117 extern struct ConfItem* find_conf_byname(struct SLink* lp, const char *name,
119 extern struct ConfItem* conf_find_server(const char* name);
120 const char* conf_eval_crule(struct ConfItem* conf);
122 extern void det_confs_butmask(struct Client *cptr, int mask);
123 extern int attach_iline(struct Client *cptr);
124 extern int detach_conf(struct Client *cptr, struct ConfItem *aconf);
125 extern int attach_conf(struct Client *cptr, struct ConfItem *aconf);
126 extern struct ConfItem* find_admin(void);
127 extern struct ConfItem* find_me(void);
128 extern struct ConfItem* find_conf_exact(const char* name,
130 const char* host, int statmask);
131 extern enum AuthorizationCheckResult conf_check_client(struct Client *cptr);
132 extern int conf_check_server(struct Client *cptr);
133 extern struct ConfItem* find_conf_name(const char* name, int statmask);
134 extern int rehash(struct Client *cptr, int sig);
135 extern int initconf(int opt);
136 extern void read_tlines(void);
137 extern int find_kill(struct Client *cptr);
138 extern int find_restrict(struct Client *cptr);
139 extern int m_killcomment(struct Client *sptr, char *parv, char *filename);
140 extern struct MotdItem* read_motd(const char* motdfile);
142 #endif /* INCLUDED_s_conf_h */