filters.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #ifndef FILTERS_H_INCLUDED
  2. #define FILTERS_H_INCLUDED
  3. /*********************************************************************
  4. *
  5. * File : $Source: /cvsroot/ijbswa/current/filters.h,v $
  6. *
  7. * Purpose : Declares functions to parse/crunch headers and pages.
  8. *
  9. * Copyright : Written by and Copyright (C) 2001-2010 the
  10. * Privoxy team. https://www.privoxy.org/
  11. *
  12. * Based on the Internet Junkbuster originally written
  13. * by and Copyright (C) 1997 Anonymous Coders and
  14. * Junkbusters Corporation. http://www.junkbusters.com
  15. *
  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.
  21. *
  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.
  27. *
  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.
  33. *
  34. *********************************************************************/
  35. #include "project.h"
  36. /*
  37. * ACL checking
  38. */
  39. #ifdef FEATURE_ACL
  40. extern int block_acl(const struct access_control_addr *dst, const struct client_state *csp);
  41. extern int acl_addr(const char *aspec, struct access_control_addr *aca);
  42. #endif /* def FEATURE_ACL */
  43. /*
  44. * Interceptors
  45. */
  46. extern struct http_response *block_url(struct client_state *csp);
  47. extern struct http_response *redirect_url(struct client_state *csp);
  48. #ifdef FEATURE_TRUST
  49. extern struct http_response *trust_url(struct client_state *csp);
  50. #endif /* def FEATURE_TRUST */
  51. /*
  52. * Request inspectors
  53. */
  54. #ifdef FEATURE_TRUST
  55. extern int is_untrusted_url(const struct client_state *csp);
  56. #endif /* def FEATURE_TRUST */
  57. #ifdef FEATURE_IMAGE_BLOCKING
  58. extern int is_imageurl(const struct client_state *csp);
  59. #endif /* def FEATURE_IMAGE_BLOCKING */
  60. extern int connect_port_is_forbidden(const struct client_state *csp);
  61. /*
  62. * Determining applicable actions
  63. */
  64. extern void get_url_actions(struct client_state *csp,
  65. struct http_request *http);
  66. extern struct re_filterfile_spec *get_filter(const struct client_state *csp,
  67. const char *requested_name,
  68. enum filter_type requested_type);
  69. /*
  70. * Determining parent proxies
  71. */
  72. extern const struct forward_spec *forward_url(struct client_state *csp,
  73. const struct http_request *http);
  74. /*
  75. * Content modification
  76. */
  77. extern char *execute_content_filters(struct client_state *csp);
  78. extern char *execute_single_pcrs_command(char *subject, const char *pcrs_command, int *hits);
  79. extern char *rewrite_url(char *old_url, const char *pcrs_command);
  80. extern pcrs_job *compile_dynamic_pcrs_job_list(const struct client_state *csp, const struct re_filterfile_spec *b);
  81. extern int content_requires_filtering(struct client_state *csp);
  82. extern int content_filters_enabled(const struct current_action_spec *action);
  83. extern int filters_available(const struct client_state *csp);
  84. /*
  85. * Handling Max-Forwards:
  86. */
  87. extern struct http_response *direct_response(struct client_state *csp);
  88. #ifdef FUZZ
  89. extern char *gif_deanimate_response(struct client_state *csp);
  90. extern jb_err remove_chunked_transfer_coding(char *buffer, size_t *size);
  91. #endif
  92. #ifdef FEATURE_EXTENDED_STATISTICS
  93. extern void register_filter_for_statistics(const char *filter);
  94. extern void update_filter_statistics(const char *filter, int hits);
  95. extern void get_filter_statistics(const char *filter,
  96. unsigned long long *executions,
  97. unsigned long long *pages_modified,
  98. unsigned long long *hits);
  99. extern void register_block_reason_for_statistics(const char *block_reason);
  100. extern void get_block_reason_count(const char *block_reason,
  101. unsigned long long *count);
  102. #endif
  103. #endif /* ndef FILTERS_H_INCLUDED */
  104. /*
  105. Local Variables:
  106. tab-width: 3
  107. end:
  108. */