| 1 |
#ifndef CONFIG_H |
| 2 |
#define CONFIG_H |
| 3 |
|
| 4 |
#include <stdio.h> |
| 5 |
#include <time.h> |
| 6 |
#include "list.h" |
| 7 |
#include "libopm/src/opm_types.h" |
| 8 |
|
| 9 |
extern char linebuf[512]; |
| 10 |
extern int linenum; |
| 11 |
|
| 12 |
extern void yyerror(const char *); |
| 13 |
extern void config_load(const char *); |
| 14 |
|
| 15 |
|
| 16 |
struct IRCConf |
| 17 |
{ |
| 18 |
char *nick; |
| 19 |
char *username; |
| 20 |
char *realname; |
| 21 |
char *server; |
| 22 |
int port; |
| 23 |
time_t readtimeout; |
| 24 |
char *password; |
| 25 |
char *vhost; |
| 26 |
char *nickserv; |
| 27 |
char *oper; |
| 28 |
char *mode; |
| 29 |
char *away; |
| 30 |
char *connregex; |
| 31 |
char *kline; |
| 32 |
list_t *channels; /* List of ChannelConf */ |
| 33 |
list_t *performs; /* List of char * */ |
| 34 |
}; |
| 35 |
|
| 36 |
struct ChannelConf |
| 37 |
{ |
| 38 |
char *name; |
| 39 |
char *key; |
| 40 |
char *invite; |
| 41 |
}; |
| 42 |
|
| 43 |
struct OptionsConf |
| 44 |
{ |
| 45 |
int negcache; |
| 46 |
time_t negcache_rebuild; |
| 47 |
unsigned int dns_fdlimit; |
| 48 |
char *pidfile; |
| 49 |
char *scanlog; |
| 50 |
}; |
| 51 |
|
| 52 |
struct UserConf |
| 53 |
{ |
| 54 |
list_t *masks; /* List of char * */ |
| 55 |
list_t *scanners; /* List of char * */ |
| 56 |
}; |
| 57 |
|
| 58 |
struct ScannerConf |
| 59 |
{ |
| 60 |
char *name; |
| 61 |
list_t *protocols; |
| 62 |
char *vhost; |
| 63 |
int fd; |
| 64 |
char *target_ip; |
| 65 |
int target_port; |
| 66 |
int timeout; |
| 67 |
int max_read; |
| 68 |
list_t *target_string; |
| 69 |
int target_string_created; |
| 70 |
}; |
| 71 |
|
| 72 |
struct ProtocolConf |
| 73 |
{ |
| 74 |
int type; |
| 75 |
unsigned int port; |
| 76 |
}; |
| 77 |
|
| 78 |
struct OpmConf |
| 79 |
{ |
| 80 |
list_t *blacklists; |
| 81 |
char *dnsbl_from; |
| 82 |
char *dnsbl_to; |
| 83 |
char *sendmail; |
| 84 |
}; |
| 85 |
|
| 86 |
enum BlacklistType |
| 87 |
{ |
| 88 |
A_BITMASK = 1, |
| 89 |
A_REPLY |
| 90 |
}; |
| 91 |
|
| 92 |
struct BlacklistConf |
| 93 |
{ |
| 94 |
char *name; |
| 95 |
char *kline; |
| 96 |
enum BlacklistType type; |
| 97 |
int ban_unknown; |
| 98 |
list_t *reply; |
| 99 |
unsigned int stats_recv; |
| 100 |
}; |
| 101 |
|
| 102 |
struct BlacklistReplyConf |
| 103 |
{ |
| 104 |
char number; |
| 105 |
char *type; |
| 106 |
}; |
| 107 |
|
| 108 |
struct ExemptConf |
| 109 |
{ |
| 110 |
list_t *masks; |
| 111 |
}; |
| 112 |
|
| 113 |
|
| 114 |
/* Extern to actual config data declared in config.c */ |
| 115 |
extern struct IRCConf *IRCItem; |
| 116 |
extern struct OptionsConf *OptionsItem; |
| 117 |
extern struct OpmConf *OpmItem; |
| 118 |
extern struct ExemptConf *ExemptItem; |
| 119 |
extern list_t *UserItemList; |
| 120 |
extern list_t *ScannerItemList; |
| 121 |
|
| 122 |
#endif /* CONFIG_H */ |