Mercurial > dnsbl
comparison src/context.h @ 75:1142e46be550
start coding on new config syntax
author | carl |
---|---|
date | Wed, 13 Jul 2005 23:04:14 -0700 |
parents | b7449114ebb0 |
children | 81f1e400e8ab |
comparison
equal
deleted
inserted
replaced
74:b7449114ebb0 | 75:1142e46be550 |
---|---|
6 | 6 |
7 | 7 |
8 enum status {oksofar, // not rejected yet | 8 enum status {oksofar, // not rejected yet |
9 white, // whitelisted | 9 white, // whitelisted |
10 black, // blacklisted | 10 black, // blacklisted |
11 reject, // rejected by a dns list | 11 reject}; // rejected by a dns list |
12 reject_tag, // too many bad html tags | |
13 reject_host}; // too many hosts/urls in body | |
14 | 12 |
15 class DNSBL; | 13 class DNSBL; |
16 class CONTEXT; | 14 class CONTEXT; |
17 class recorder; | 15 class recorder; |
18 | 16 |
68 void add_to(char *to) {env_to.insert(to);}; | 66 void add_to(char *to) {env_to.insert(to);}; |
69 void add_from(char *from, char *status) {env_from[from] = status;}; | 67 void add_from(char *from, char *status) {env_from[from] = status;}; |
70 void add_from_context(char *from, CONTEXTP con) {env_from_context[from] = con;}; | 68 void add_from_context(char *from, CONTEXTP con) {env_from_context[from] = con;}; |
71 void set_from_default(char *status) {env_from_default = status;}; | 69 void set_from_default(char *status) {env_from_default = status;}; |
72 char* find_from(char *from); | 70 char* find_from(char *from); |
73 CONTEXTP find_from_context(char *from); | 71 CONTEXTP find_context(char *from); |
74 CONTEXTP find_from_context_name(char *name); | 72 CONTEXTP find_from_context_name(char *name); |
75 | 73 |
76 void set_content_filtering(bool filter) {content_filtering = filter;}; | 74 void set_content_filtering(bool filter) {content_filtering = filter;}; |
77 void set_content_suffix(char *suffix) {content_suffix = suffix;}; | 75 void set_content_suffix(char *suffix) {content_suffix = suffix;}; |
78 void set_content_message(char *message) {content_message = message;}; | 76 void set_content_message(char *message) {content_message = message;}; |
120 // the default context is also used for some of the content filtering values | 118 // the default context is also used for some of the content filtering values |
121 | 119 |
122 CONFIG(); | 120 CONFIG(); |
123 ~CONFIG(); | 121 ~CONFIG(); |
124 void add_context(CONTEXTP con); | 122 void add_context(CONTEXTP con); |
125 void add_to(char *to, CONTEXTP con) {env_to[to] = con;}; | 123 void add_to(char *to, CONTEXTP con); |
126 CONTEXTP find_context(char *to, char *from); | 124 CONTEXTP find_context(char *to); |
127 | 125 |
128 char* get_content_suffix() {return default_context->get_content_suffix() ;}; | 126 char* get_content_suffix() {return default_context->get_content_suffix() ;}; |
129 char* get_content_message() {return default_context->get_content_message() ;}; | 127 char* get_content_message() {return default_context->get_content_message() ;}; |
130 string_set& get_content_host_ignore() {return default_context->get_content_host_ignore() ;}; | 128 string_set& get_content_host_ignore() {return default_context->get_content_host_ignore() ;}; |
131 string_set& get_content_tlds() {return default_context->get_content_tlds() ;}; | 129 string_set& get_content_tlds() {return default_context->get_content_tlds() ;}; |
150 extern char *token_html_tags; | 148 extern char *token_html_tags; |
151 extern char *token_ignore; | 149 extern char *token_ignore; |
152 extern char *token_include; | 150 extern char *token_include; |
153 extern char *token_inherit; | 151 extern char *token_inherit; |
154 extern char *token_lbrace; | 152 extern char *token_lbrace; |
153 extern char *token_mailhost; | |
155 extern char *token_many; | 154 extern char *token_many; |
156 extern char *token_off; | 155 extern char *token_off; |
157 extern char *token_ok; | 156 extern char *token_ok; |
158 extern char *token_ok2; | 157 extern char *token_ok2; |
159 extern char *token_on; | 158 extern char *token_on; |
160 extern char *token_rbrace; | 159 extern char *token_rbrace; |
161 extern char *token_semi; | 160 extern char *token_semi; |
162 extern char *token_soft; | 161 extern char *token_soft; |
162 extern char *token_substitute; | |
163 extern char *token_tld; | 163 extern char *token_tld; |
164 extern char *token_unknown; | 164 extern char *token_unknown; |
165 extern char *token_white; | 165 extern char *token_white; |
166 | 166 |
167 extern string_set all_strings; // owns all the strings, only modified by the config loader thread | 167 extern string_set all_strings; // owns all the strings, only modified by the config loader thread |