Patched Joergs solution for the content-length in.
[privoxy.git] / filters.h
1 #ifndef _FILTERS_H
2 #define _FILTERS_H
3 #define FILTERS_H_VERSION "$Id: filters.h,v 1.3 2001/05/22 18:46:04 oes Exp $"
4 /*********************************************************************
5  *
6  * File        :  $Source: /cvsroot/ijbswa/current/filters.h,v $
7  *
8  * Purpose     :  Declares functions to parse/crunch headers and pages.
9  *                Functions declared include:
10  *                   `acl_addr', `add_stats', `block_acl', `block_imageurl',
11  *                   `block_url', `url_permissions', `domaincmp', `dsplit',
12  *                   `filter_popups', `forward_url'
13  *                   `ij_untrusted_url', `intercept_url', `re_process_buffer',
14  *                   `show_proxy_args', and `trust_url'
15  *
16  * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
17  *                IJBSWA team.  http://ijbswa.sourceforge.net
18  *
19  *                Based on the Internet Junkbuster originally written
20  *                by and Copyright (C) 1997 Anonymous Coders and 
21  *                Junkbusters Corporation.  http://www.junkbusters.com
22  *
23  *                This program is free software; you can redistribute it 
24  *                and/or modify it under the terms of the GNU General
25  *                Public License as published by the Free Software
26  *                Foundation; either version 2 of the License, or (at
27  *                your option) any later version.
28  *
29  *                This program is distributed in the hope that it will
30  *                be useful, but WITHOUT ANY WARRANTY; without even the
31  *                implied warranty of MERCHANTABILITY or FITNESS FOR A
32  *                PARTICULAR PURPOSE.  See the GNU General Public
33  *                License for more details.
34  *
35  *                The GNU General Public License should be included with
36  *                this file.  If not, you can view it at
37  *                http://www.gnu.org/copyleft/gpl.html
38  *                or write to the Free Software Foundation, Inc., 59
39  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
40  *
41  * Revisions   :
42  *    $Log: filters.h,v $
43  *    Revision 1.3  2001/05/22 18:46:04  oes
44  *
45  *    - Enabled filtering banners by size rather than URL
46  *      by adding patterns that replace all standard banner
47  *      sizes with the "Junkbuster" gif to the re_filterfile
48  *
49  *    - Enabled filtering WebBugs by providing a pattern
50  *      which kills all 1x1 images
51  *
52  *    - Added support for PCRE_UNGREEDY behaviour to pcrs,
53  *      which is selected by the (nonstandard and therefore
54  *      capital) letter 'U' in the option string.
55  *      It causes the quantifiers to be ungreedy by default.
56  *      Appending a ? turns back to greedy (!).
57  *
58  *    - Added a new interceptor ijb-send-banner, which
59  *      sends back the "Junkbuster" gif. Without imagelist or
60  *      MSIE detection support, or if tinygif = 1, or the
61  *      URL isn't recognized as an imageurl, a lame HTML
62  *      explanation is sent instead.
63  *
64  *    - Added new feature, which permits blocking remote
65  *      script redirects and firing back a local redirect
66  *      to the browser.
67  *      The feature is conditionally compiled, i.e. it
68  *      can be disabled with --disable-fast-redirects,
69  *      plus it must be activated by a "fast-redirects"
70  *      line in the config file, has its own log level
71  *      and of course wants to be displayed by show-proxy-args
72  *      Note: Boy, all the #ifdefs in 1001 locations and
73  *      all the fumbling with configure.in and acconfig.h
74  *      were *way* more work than the feature itself :-(
75  *
76  *    - Because a generic redirect template was needed for
77  *      this, tinygif = 3 now uses the same.
78  *
79  *    - Moved GIFs, and other static HTTP response templates
80  *      to project.h
81  *
82  *    - Some minor fixes
83  *
84  *    - Removed some >400 CRs again (Jon, you really worked
85  *      a lot! ;-)
86  *
87  *    Revision 1.2  2001/05/20 01:21:20  jongfoster
88  *    Version 2.9.4 checkin.
89  *    - Merged popupfile and cookiefile, and added control over PCRS
90  *      filtering, in new "permissionsfile".
91  *    - Implemented LOG_LEVEL_FATAL, so that if there is a configuration
92  *      file error you now get a message box (in the Win32 GUI) rather
93  *      than the program exiting with no explanation.
94  *    - Made killpopup use the PCRS MIME-type checking and HTTP-header
95  *      skipping.
96  *    - Removed tabs from "config"
97  *    - Moved duplicated url parsing code in "loaders.c" to a new funcition.
98  *    - Bumped up version number.
99  *
100  *    Revision 1.1.1.1  2001/05/15 13:58:52  oes
101  *    Initial import of version 2.9.3 source tree
102  *
103  *
104  *********************************************************************/
105 \f
106
107 #include "project.h"
108
109 #ifdef __cplusplus
110 extern "C" {
111 #endif
112
113 #ifdef ACL_FILES
114 extern int block_acl(struct access_control_addr *dst, struct client_state *csp);
115 extern int acl_addr(char *aspec, struct access_control_addr *aca);
116 #endif /* def ACL_FILES */
117
118 extern char *block_url(struct http_request *http, struct client_state *csp);
119 #ifdef TRUST_FILES
120 extern char *trust_url(struct http_request *http, struct client_state *csp);
121 #endif /* def TRUST_FILES */
122 extern char *intercept_url(struct http_request *http, struct client_state *csp);
123 extern char *redirect_url(struct http_request *http, struct client_state *csp);
124
125 #if defined(DETECT_MSIE_IMAGES) || defined(USE_IMAGE_LIST)
126 extern int block_imageurl(struct http_request *http, struct client_state *csp);
127 #endif /* defined(DETECT_MSIE_IMAGES) || defined(USE_IMAGE_LIST) */
128
129 #ifdef USE_IMAGE_LIST
130 extern int block_imageurl_using_imagelist(struct http_request *http, struct client_state *csp);
131 #endif /* def USE_IMAGE_LIST */
132
133 extern int url_permissions(struct http_request *http, struct client_state *csp);
134 extern const struct gateway *forward_url(struct http_request *http, struct client_state *csp);
135
136 extern struct url_spec dsplit(char *domain);
137 extern int domaincmp(struct url_spec *pattern, struct url_spec *fqdn);
138
139 extern char *show_proxy_args(struct http_request *http, struct client_state *csp);
140 extern char *ijb_send_banner(struct http_request *http, struct client_state *csp);
141
142 #ifdef TRUST_FILES
143 extern char *ij_untrusted_url(struct http_request *http, struct client_state *csp);
144 #endif /* def TRUST_FILES */
145
146 #ifdef STATISTICS
147 extern char *add_stats(char *s);
148 #endif /* def STATISTICS */
149
150 #ifdef PCRS
151 extern void re_process_buffer(struct client_state *csp);
152 #endif /* def PCRS */
153
154 /* Revision control strings from this header and associated .c file */
155 extern const char filters_rcs[];
156 extern const char filters_h_rcs[];
157
158 #ifdef __cplusplus
159 } /* extern "C" */
160 #endif
161
162 #endif /* ndef _FILTERS_H */
163
164 /*
165   Local Variables:
166   tab-width: 3
167   end:
168 */