| 29 |
|
#include "config.h" |
| 30 |
|
#include "ircd_defs.h" |
| 31 |
|
#include "client.h" |
| 32 |
– |
#include "hook.h" |
| 32 |
|
#include "conf_class.h" |
| 33 |
|
|
| 34 |
|
|
| 41 |
|
|
| 42 |
|
/* MaskItem->flags */ |
| 43 |
|
#define CONF_FLAGS_DO_IDENTD 0x00000001 |
| 45 |
– |
#define CONF_FLAGS_LIMIT_IP 0x00000002 |
| 44 |
|
#define CONF_FLAGS_NO_TILDE 0x00000004 |
| 45 |
|
#define CONF_FLAGS_NEED_IDENTD 0x00000008 |
| 46 |
< |
#define CONF_FLAGS_NOMATCH_IP 0x00000010 |
| 47 |
< |
#define CONF_FLAGS_EXEMPTKLINE 0x00000020 |
| 48 |
< |
#define CONF_FLAGS_NOLIMIT 0x00000040 |
| 49 |
< |
#define CONF_FLAGS_SPOOF_IP 0x00000080 |
| 50 |
< |
#define CONF_FLAGS_SPOOF_NOTICE 0x00000100 |
| 51 |
< |
#define CONF_FLAGS_REDIR 0x00000200 |
| 52 |
< |
#define CONF_FLAGS_EXEMPTGLINE 0x00000400 |
| 53 |
< |
#define CONF_FLAGS_CAN_FLOOD 0x00000800 |
| 54 |
< |
#define CONF_FLAGS_NEED_PASSWORD 0x00001000 |
| 55 |
< |
#define CONF_FLAGS_ALLOW_AUTO_CONN 0x00002000 |
| 56 |
< |
#define CONF_FLAGS_ENCRYPTED 0x00004000 |
| 57 |
< |
#define CONF_FLAGS_IN_DATABASE 0x00008000 |
| 58 |
< |
#define CONF_FLAGS_EXEMPTRESV 0x00010000 |
| 59 |
< |
#define CONF_FLAGS_SSL 0x00020000 |
| 62 |
< |
#define CONF_FLAGS_WEBIRC 0x00040000 |
| 46 |
> |
#define CONF_FLAGS_EXEMPTKLINE 0x00000010 |
| 47 |
> |
#define CONF_FLAGS_NOLIMIT 0x00000020 |
| 48 |
> |
#define CONF_FLAGS_SPOOF_IP 0x00000040 |
| 49 |
> |
#define CONF_FLAGS_SPOOF_NOTICE 0x00000080 |
| 50 |
> |
#define CONF_FLAGS_REDIR 0x00000100 |
| 51 |
> |
#define CONF_FLAGS_EXEMPTGLINE 0x00000200 |
| 52 |
> |
#define CONF_FLAGS_CAN_FLOOD 0x00000400 |
| 53 |
> |
#define CONF_FLAGS_NEED_PASSWORD 0x00000800 |
| 54 |
> |
#define CONF_FLAGS_ALLOW_AUTO_CONN 0x00001000 |
| 55 |
> |
#define CONF_FLAGS_ENCRYPTED 0x00002000 |
| 56 |
> |
#define CONF_FLAGS_IN_DATABASE 0x00004000 |
| 57 |
> |
#define CONF_FLAGS_EXEMPTRESV 0x00008000 |
| 58 |
> |
#define CONF_FLAGS_SSL 0x00010000 |
| 59 |
> |
#define CONF_FLAGS_WEBIRC 0x00020000 |
| 60 |
|
|
| 61 |
|
/* Macros for struct MaskItem */ |
| 62 |
|
#define IsConfWebIRC(x) ((x)->flags & CONF_FLAGS_WEBIRC) |
| 66 |
– |
#define IsLimitIp(x) ((x)->flags & CONF_FLAGS_LIMIT_IP) |
| 63 |
|
#define IsNoTilde(x) ((x)->flags & CONF_FLAGS_NO_TILDE) |
| 64 |
|
#define IsConfCanFlood(x) ((x)->flags & CONF_FLAGS_CAN_FLOOD) |
| 65 |
|
#define IsNeedPassword(x) ((x)->flags & CONF_FLAGS_NEED_PASSWORD) |
| 66 |
|
#define IsNeedIdentd(x) ((x)->flags & CONF_FLAGS_NEED_IDENTD) |
| 71 |
– |
#define IsNoMatchIp(x) ((x)->flags & CONF_FLAGS_NOMATCH_IP) |
| 67 |
|
#define IsConfExemptKline(x) ((x)->flags & CONF_FLAGS_EXEMPTKLINE) |
| 68 |
|
#define IsConfExemptLimits(x) ((x)->flags & CONF_FLAGS_NOLIMIT) |
| 69 |
|
#define IsConfExemptGline(x) ((x)->flags & CONF_FLAGS_EXEMPTGLINE) |
| 120 |
|
CONF_OPER = 1 << 12, |
| 121 |
|
}; |
| 122 |
|
|
| 123 |
+ |
enum |
| 124 |
+ |
{ |
| 125 |
+ |
NOT_AUTHORIZED = -1, |
| 126 |
+ |
I_LINE_FULL = -2, |
| 127 |
+ |
TOO_MANY = -3, |
| 128 |
+ |
BANNED_CLIENT = -4, |
| 129 |
+ |
TOO_FAST = -5 |
| 130 |
+ |
}; |
| 131 |
+ |
|
| 132 |
|
struct conf_parser_context |
| 133 |
|
{ |
| 134 |
|
unsigned int boot; |
| 208 |
|
struct config_file_entry |
| 209 |
|
{ |
| 210 |
|
const char *dpath; /* DPATH if set from command line */ |
| 211 |
+ |
const char *mpath; |
| 212 |
+ |
const char *spath; |
| 213 |
|
const char *configfile; |
| 214 |
|
const char *klinefile; |
| 215 |
|
const char *glinefile; |
| 216 |
|
const char *xlinefile; |
| 217 |
|
const char *dlinefile; |
| 218 |
|
const char *resvfile; |
| 213 |
– |
char *mpath; |
| 214 |
– |
char *rpath; |
| 219 |
|
|
| 220 |
|
char *egdpool_path; |
| 221 |
|
char *service_name; |
| 255 |
|
int gline_request_time; |
| 256 |
|
int oper_only_umodes; |
| 257 |
|
int oper_umodes; |
| 258 |
< |
int max_targets; |
| 258 |
> |
unsigned int max_targets; |
| 259 |
|
int caller_id_wait; |
| 260 |
|
int min_nonwildcard; |
| 261 |
|
int min_nonwildcard_simple; |
| 392 |
|
extern time_t valid_tkline(const char *, const int); |
| 393 |
|
extern int match_conf_password(const char *, const struct MaskItem *); |
| 394 |
|
|
| 391 |
– |
#define NOT_AUTHORIZED (-1) |
| 392 |
– |
#define I_LINE_FULL (-2) |
| 393 |
– |
#define TOO_MANY (-3) |
| 394 |
– |
#define BANNED_CLIENT (-4) |
| 395 |
– |
#define TOO_FAST (-5) |
| 396 |
– |
|
| 395 |
|
#define CLEANUP_TKLINES_TIME 60 |
| 396 |
|
|
| 397 |
|
extern void cluster_a_line(struct Client *, const char *, int, int, const char *,...); |