parsers.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef PARSERS_H_INCLUDED
  2. #define PARSERS_H_INCLUDED
  3. /*********************************************************************
  4. *
  5. * File : $Source: /cvsroot/ijbswa/current/parsers.h,v $
  6. *
  7. * Purpose : Declares functions to parse/crunch headers and pages.
  8. * Functions declared include:
  9. * `add_to_iob', `client_cookie_adder', `client_from',
  10. * `client_referrer', `client_send_cookie', `client_ua',
  11. * `client_uagent', `client_x_forwarded',
  12. * `client_x_forwarded_adder', `client_xtra_adder',
  13. * `content_type', `crumble', `destroy_list', `enlist',
  14. * `flush_socket', `free_http_request', `get_header',
  15. * `parse_http_request', `sed',
  16. * and `server_set_cookie'.
  17. *
  18. * Copyright : Written by and Copyright (C) 2001 members of the
  19. * Privoxy team. https://www.privoxy.org/
  20. *
  21. * Based on the Internet Junkbuster originally written
  22. * by and Copyright (C) 1997 Anonymous Coders and
  23. * Junkbusters Corporation. http://www.junkbusters.com
  24. *
  25. * This program is free software; you can redistribute it
  26. * and/or modify it under the terms of the GNU General
  27. * Public License as published by the Free Software
  28. * Foundation; either version 2 of the License, or (at
  29. * your option) any later version.
  30. *
  31. * This program is distributed in the hope that it will
  32. * be useful, but WITHOUT ANY WARRANTY; without even the
  33. * implied warranty of MERCHANTABILITY or FITNESS FOR A
  34. * PARTICULAR PURPOSE. See the GNU General Public
  35. * License for more details.
  36. *
  37. * The GNU General Public License should be included with
  38. * this file. If not, you can view it at
  39. * http://www.gnu.org/copyleft/gpl.html
  40. * or write to the Free Software Foundation, Inc., 59
  41. * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  42. *
  43. *********************************************************************/
  44. #include "project.h"
  45. /* Used for sed()'s second argument. */
  46. #define FILTER_CLIENT_HEADERS 0
  47. #define FILTER_SERVER_HEADERS 1
  48. extern long flush_iob(jb_socket fd, struct iob *iob, unsigned int delay);
  49. extern jb_err add_to_iob(struct iob *iob, const size_t buffer_limit, char *src, long n);
  50. extern void clear_iob(struct iob *iob);
  51. extern jb_err decompress_iob(struct client_state *csp);
  52. extern char *get_header(struct iob *iob);
  53. extern char *get_header_value(const struct list *header_list, const char *header_name);
  54. extern jb_err sed(struct client_state *csp, int filter_server_headers);
  55. #ifdef FEATURE_HTTPS_INSPECTION
  56. extern jb_err sed_https(struct client_state *csp);
  57. #endif
  58. extern jb_err update_server_headers(struct client_state *csp);
  59. extern void get_http_time(int time_offset, char *buf, size_t buffer_size);
  60. extern jb_err get_destination_from_headers(const struct list *headers, struct http_request *http);
  61. #ifdef FEATURE_HTTPS_INSPECTION
  62. extern jb_err get_destination_from_https_headers(const struct list *headers, struct http_request *http);
  63. #endif
  64. extern unsigned long long get_expected_content_length(struct list *headers);
  65. extern jb_err client_transfer_encoding(struct client_state *csp, char **header);
  66. #ifdef FEATURE_FORCE_LOAD
  67. extern int strclean(char *string, const char *substring);
  68. #endif /* def FEATURE_FORCE_LOAD */
  69. #endif /* ndef PARSERS_H_INCLUDED */
  70. /*
  71. Local Variables:
  72. tab-width: 3
  73. end:
  74. */