In rfc2553_connect_to(), remove a useless check for NULL
[privoxy.git] / filters.h
1 #ifndef FILTERS_H_INCLUDED
2 #define FILTERS_H_INCLUDED
3 #define FILTERS_H_VERSION "$Id: filters.h,v 1.40 2010/09/14 07:14:56 fabiankeil 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_actions', `filter_popups', `forward_url'
12  *                   `ij_untrusted_url', `intercept_url', `re_process_buffer',
13  *                   `show_proxy_args', and `trust_url'
14  *
15  * Copyright   :  Written by and Copyright (C) 2001-2010 the
16  *                Privoxy team. http://www.privoxy.org/
17  *
18  *                Based on the Internet Junkbuster originally written
19  *                by and Copyright (C) 1997 Anonymous Coders and 
20  *                Junkbusters Corporation.  http://www.junkbusters.com
21  *
22  *                This program is free software; you can redistribute it 
23  *                and/or modify it under the terms of the GNU General
24  *                Public License as published by the Free Software
25  *                Foundation; either version 2 of the License, or (at
26  *                your option) any later version.
27  *
28  *                This program is distributed in the hope that it will
29  *                be useful, but WITHOUT ANY WARRANTY; without even the
30  *                implied warranty of MERCHANTABILITY or FITNESS FOR A
31  *                PARTICULAR PURPOSE.  See the GNU General Public
32  *                License for more details.
33  *
34  *                The GNU General Public License should be included with
35  *                this file.  If not, you can view it at
36  *                http://www.gnu.org/copyleft/gpl.html
37  *                or write to the Free Software Foundation, Inc., 59
38  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
39  *
40  *********************************************************************/
41
42
43 #include "project.h"
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48
49
50 struct access_control_addr;
51 struct client_state;
52 struct http_request;
53 struct http_response;
54 struct current_action_spec;
55 struct url_actions;
56 struct url_spec;
57
58
59 /*
60  * ACL checking
61  */
62 #ifdef FEATURE_ACL
63 extern int block_acl(const struct access_control_addr *dst, const struct client_state *csp);
64 extern int acl_addr(const char *aspec, struct access_control_addr *aca);
65 #endif /* def FEATURE_ACL */
66
67 /*
68  * Interceptors
69  */
70 extern struct http_response *block_url(struct client_state *csp);
71 extern struct http_response *redirect_url(struct client_state *csp);
72 #ifdef FEATURE_TRUST
73 extern struct http_response *trust_url(struct client_state *csp);
74 #endif /* def FEATURE_TRUST */
75
76 /*
77  * Request inspectors
78  */
79 #ifdef FEATURE_TRUST
80 extern int is_untrusted_url(const struct client_state *csp);
81 #endif /* def FEATURE_TRUST */
82 #ifdef FEATURE_IMAGE_BLOCKING
83 extern int is_imageurl(const struct client_state *csp);
84 #endif /* def FEATURE_IMAGE_BLOCKING */
85 extern int connect_port_is_forbidden(const struct client_state *csp);
86
87 /*
88  * Determining applicable actions
89  */
90 extern void get_url_actions(struct client_state *csp,
91                             struct http_request *http);
92 extern void apply_url_actions(struct current_action_spec *action, 
93                               struct http_request *http, 
94                               struct url_actions *b);
95 /*
96  * Determining parent proxies
97  */
98 extern const struct forward_spec *forward_url(struct client_state *csp,
99                                               const struct http_request *http);
100
101 /*
102  * Content modification
103  */
104 extern char *execute_content_filters(struct client_state *csp);
105 extern char *execute_single_pcrs_command(char *subject, const char *pcrs_command, int *hits);
106 extern char *rewrite_url(char *old_url, const char *pcrs_command);
107 extern char *get_last_url(char *subject, const char *redirect_mode);
108
109 extern pcrs_job *compile_dynamic_pcrs_job_list(const struct client_state *csp, const struct re_filterfile_spec *b);
110
111 extern int content_requires_filtering(struct client_state *csp);
112 extern int content_filters_enabled(const struct current_action_spec *action);
113 extern int filters_available(const struct client_state *csp);
114
115 /*
116  * Handling Max-Forwards:
117  */
118 extern struct http_response *direct_response(struct client_state *csp);
119
120
121 /*
122  * Solaris fix:
123  */
124 #ifndef INADDR_NONE
125 #define INADDR_NONE -1
126 #endif     
127
128 /* 
129  * Revision control strings from this header and associated .c file
130  */
131 extern const char filters_rcs[];
132 extern const char filters_h_rcs[];
133
134 #ifdef __cplusplus
135 } /* extern "C" */
136 #endif
137
138 #endif /* ndef FILTERS_H_INCLUDED */
139
140 /*
141   Local Variables:
142   tab-width: 3
143   end:
144 */