4
0

mini_httpd.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (C) 2000,2001 Florian Sander
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #define HTTPD_VERSION "1.1.0"
  19. static void process_get_request(int);
  20. struct http_connection_data {
  21. int traffic;
  22. int code;
  23. char *browser;
  24. char *referer;
  25. char *path;
  26. char *cmd;
  27. char *postparams;
  28. int getpostparams;
  29. int content_length;
  30. struct llist_2string *cookies;
  31. struct llist_2string *params;
  32. struct llist_1string *headers;
  33. struct llist_1string *langs;
  34. };
  35. static void init_httpd();
  36. //static int expmem_httpd();
  37. static void unload_httpd();
  38. static void start_httpd(int);
  39. static void stop_httpd();
  40. static void init_http_connection_data(int);
  41. static void free_http_connection_data(int);
  42. static void http_activity(int, char *, int);
  43. static void send_http_header(int, int);
  44. static void add_cookies(int, char *);
  45. static char *get_cookie_value(int, char *);
  46. static void add_params(int, char *);
  47. static char *get_param_value(int, char *);
  48. #ifndef OLDBOT
  49. static void outdone_http(int);
  50. #endif
  51. static void display_http(int, char *);
  52. static void display_httpd_accept(int, char *);
  53. static void timeout_http(int);
  54. static void timeout_listen_httpd(int);
  55. static void kill_http(int, void *);
  56. static int expmem_http(void *);
  57. static void out_http(int, char *, void *);
  58. static void httpd_accept(int, char *, int);
  59. static int http_flood();
  60. static void eof_http(int);
  61. static char *decode_url(char *);
  62. static char *encode_url(char *);
  63. static char *csplit(char **, char);
  64. static void append_postparam_string(int, char *);
  65. static void process_request(int);
  66. static void add_language(int, char *);
  67. static char *text2html(char *);