1 #ifndef FILTERS_H_INCLUDED
2 #define FILTERS_H_INCLUDED
3 /*********************************************************************
5 * File : $Source: /cvsroot/ijbswa/current/filters.h,v $
7 * Purpose : Declares functions to parse/crunch headers and pages.
9 * Copyright : Written by and Copyright (C) 2001-2010 the
10 * Privoxy team. https://www.privoxy.org/
12 * Based on the Internet Junkbuster originally written
13 * by and Copyright (C) 1997 Anonymous Coders and
14 * Junkbusters Corporation. http://www.junkbusters.com
16 * This program is free software; you can redistribute it
17 * and/or modify it under the terms of the GNU General
18 * Public License as published by the Free Software
19 * Foundation; either version 2 of the License, or (at
20 * your option) any later version.
22 * This program is distributed in the hope that it will
23 * be useful, but WITHOUT ANY WARRANTY; without even the
24 * implied warranty of MERCHANTABILITY or FITNESS FOR A
25 * PARTICULAR PURPOSE. See the GNU General Public
26 * License for more details.
28 * The GNU General Public License should be included with
29 * this file. If not, you can view it at
30 * http://www.gnu.org/copyleft/gpl.html
31 * or write to the Free Software Foundation, Inc., 59
32 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 *********************************************************************/
43 extern int block_acl(const struct access_control_addr *dst, const struct client_state *csp);
44 extern int acl_addr(const char *aspec, struct access_control_addr *aca);
45 #endif /* def FEATURE_ACL */
50 extern struct http_response *block_url(struct client_state *csp);
51 extern struct http_response *redirect_url(struct client_state *csp);
53 extern struct http_response *trust_url(struct client_state *csp);
54 #endif /* def FEATURE_TRUST */
60 extern int is_untrusted_url(const struct client_state *csp);
61 #endif /* def FEATURE_TRUST */
62 #ifdef FEATURE_IMAGE_BLOCKING
63 extern int is_imageurl(const struct client_state *csp);
64 #endif /* def FEATURE_IMAGE_BLOCKING */
65 extern int connect_port_is_forbidden(const struct client_state *csp);
68 * Determining applicable actions
70 extern void get_url_actions(struct client_state *csp,
71 struct http_request *http);
73 extern struct re_filterfile_spec *get_filter(const struct client_state *csp,
74 const char *requested_name,
75 enum filter_type requested_type);
78 * Determining parent proxies
80 extern const struct forward_spec *forward_url(struct client_state *csp,
81 const struct http_request *http);
84 * Content modification
86 extern char *execute_content_filters(struct client_state *csp);
87 extern int execute_client_body_filters(struct client_state *csp, size_t *content_length);
88 extern jb_err execute_client_body_taggers(struct client_state *csp, size_t content_length);
89 extern char *execute_single_pcrs_command(char *subject, const char *pcrs_command, int *hits);
90 extern char *rewrite_url(char *old_url, const char *pcrs_command);
92 extern pcrs_job *compile_dynamic_pcrs_job_list(const struct client_state *csp, const struct re_filterfile_spec *b);
94 extern int content_requires_filtering(struct client_state *csp);
95 extern int content_filters_enabled(const struct current_action_spec *action);
96 extern int client_body_filters_enabled(const struct current_action_spec *action);
97 extern int client_body_taggers_enabled(const struct current_action_spec *action);
98 extern int filters_available(const struct client_state *csp);
101 * Handling Max-Forwards:
103 extern struct http_response *direct_response(struct client_state *csp);
105 extern int get_bytes_missing_from_chunked_data(char *buffer, size_t size, size_t offset);
106 extern int chunked_data_is_complete(char *buffer, size_t size, size_t offset);
109 extern char *gif_deanimate_response(struct client_state *csp);
110 extern jb_err remove_chunked_transfer_coding(char *buffer, size_t *size);
113 #ifdef FEATURE_EXTENDED_STATISTICS
114 extern void register_filter_for_statistics(const char *filter);
115 extern void update_filter_statistics(const char *filter, int hits);
116 extern void get_filter_statistics(const char *filter,
117 unsigned long long *executions,
118 unsigned long long *pages_modified,
119 unsigned long long *hits);
121 extern void register_block_reason_for_statistics(const char *block_reason);
122 extern void get_block_reason_count(const char *block_reason,
123 unsigned long long *count);
126 #endif /* ndef FILTERS_H_INCLUDED */