5 #include <netinet/in.h>
8 /*=============================================================================
12 /*-----------------------------------------------------------------------------
16 #define CONF_ILLEGAL 0x80000000
17 #define CONF_MATCH 0x40000000
18 #define CONF_CLIENT 0x0002
19 #define CONF_CONNECT_SERVER 0x0004
20 #define CONF_NOCONNECT_SERVER 0x0008
21 #define CONF_LOCOP 0x0010
22 #define CONF_OPERATOR 0x0020
23 #define CONF_ME 0x0040
24 #define CONF_KILL 0x0080
25 #define CONF_ADMIN 0x0100
27 #define CONF_RESTRICT 0x0200
29 #define CONF_CLASS 0x0400
30 #define CONF_LEAF 0x1000
31 #define CONF_LISTEN_PORT 0x2000
32 #define CONF_HUB 0x4000
33 #define CONF_UWORLD 0x8000
34 #define CONF_CRULEALL 0x00200000
35 #define CONF_CRULEAUTO 0x00400000
36 #define CONF_TLINES 0x00800000
37 #define CONF_IPKILL 0x00010000
39 #define CONF_OPS (CONF_OPERATOR | CONF_LOCOP)
40 #define CONF_SERVER_MASK (CONF_CONNECT_SERVER | CONF_NOCONNECT_SERVER)
41 #define CONF_CLIENT_MASK (CONF_CLIENT | CONF_OPS | CONF_SERVER_MASK)
42 #define CONF_CRULE (CONF_CRULEALL | CONF_CRULEAUTO)
43 #define CONF_KLINE (CONF_KILL | CONF_IPKILL)
45 #define IsIllegal(x) ((x)->status & CONF_ILLEGAL)
47 /*=============================================================================
52 unsigned int status; /* If CONF_ILLEGAL, delete when no clients */
53 unsigned int clients; /* Number of *LOCAL* clients using this */
54 struct in_addr ipnum; /* ip number of host field */
58 unsigned short int port;
59 time_t hold; /* Hold action until this time
62 struct ConfClass *confClass; /* Class of connection */
64 struct ConfItem *next;
69 struct MotdItem *next;
74 struct MotdItem *tmotd;
79 enum AuthorizationCheckResult {
82 ACR_TOO_MANY_IN_CLASS,
84 ACR_ALREADY_AUTHORIZED,
88 /*=============================================================================
92 extern aConfItem *find_conf_host(Link *lp, char *host, int statmask);
93 extern void det_confs_butmask(aClient *cptr, int mask);
94 extern enum AuthorizationCheckResult attach_Iline(aClient *cptr,
95 struct hostent *hp, char *sockhost);
96 extern aConfItem *count_cnlines(Link *lp);
97 extern int detach_conf(aClient *cptr, aConfItem *aconf);
98 extern enum AuthorizationCheckResult attach_conf(aClient *cptr,
100 extern aConfItem *find_admin(void);
101 extern aConfItem *find_me(void);
102 extern aConfItem *attach_confs(aClient *cptr, const char *name, int statmask);
103 extern aConfItem *attach_confs_host(aClient *cptr, char *host, int statmask);
104 extern aConfItem *find_conf_exact(char *name, char *user, char *host,
106 extern aConfItem *find_conf_name(char *name, int statmask);
107 extern aConfItem *find_conf(Link *lp, const char *name, int statmask);
108 extern aConfItem *find_conf_ip(Link *lp, char *ip, char *user, int statmask);
109 extern int rehash(aClient *cptr, int sig);
110 extern int initconf(int opt);
111 extern void read_tlines(void);
112 extern int find_kill(aClient *cptr);
113 extern int find_restrict(aClient *cptr);
114 extern int m_killcomment(aClient *sptr, char *parv, char *filename);
115 extern aMotdItem *read_motd(char *motdfile);
117 extern aConfItem *conf;
118 extern aGline *gline;
119 extern struct tm motd_tm;
120 extern aMotdItem *motd;
121 extern aMotdItem *rmotd;
122 extern atrecord *tdata;
124 #endif /* S_CONF_H */