3 #define CGI_H_VERSION "$Id: $"
4 /*********************************************************************
6 * File : $Source: /cvsroot/ijbswa/current/cgi.h,v $
8 * Purpose : Declares functions to intercept request, generate
9 * html or gif answers, and to compose HTTP resonses.
11 * Functions declared include:
14 * Copyright : Written by and Copyright (C) 2001 the SourceForge
15 * IJBSWA team. http://ijbswa.sourceforge.net
17 * Based on the Internet Junkbuster originally written
18 * by and Copyright (C) 1997 Anonymous Coders and
19 * Junkbusters Corporation. http://www.junkbusters.com
21 * This program is free software; you can redistribute it
22 * and/or modify it under the terms of the GNU General
23 * Public License as published by the Free Software
24 * Foundation; either version 2 of the License, or (at
25 * your option) any later version.
27 * This program is distributed in the hope that it will
28 * be useful, but WITHOUT ANY WARRANTY; without even the
29 * implied warranty of MERCHANTABILITY or FITNESS FOR A
30 * PARTICULAR PURPOSE. See the GNU General Public
31 * License for more details.
33 * The GNU General Public License should be included with
34 * this file. If not, you can view it at
35 * http://www.gnu.org/copyleft/gpl.html
36 * or write to the Free Software Foundation, Inc., 59
37 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
43 **********************************************************************/
52 extern struct http_response *cgi_dispatch(struct client_state *csp);
53 extern int make_http_response(struct http_response *rsp);
54 extern void free_http_response(struct http_response *rsp);
56 extern struct map *parse_cgi(char *argstring);
57 char *dump_map(struct map *map);
59 extern int cgi_default(struct client_state *csp, struct http_response *rsp,
60 struct map *parameters);
61 int cgi_show_status(struct client_state *csp, struct http_response *rsp,
62 struct map *parameters);
64 extern char *ijb_show_url_info(struct http_request *http, struct client_state *csp);
66 extern char *redirect_url(struct http_request *http, struct client_state *csp);
67 extern int cgi_send_banner(struct client_state *csp, struct http_response *rsp,
68 struct map *parameters);
73 extern char *ij_untrusted_url(struct http_request *http, struct client_state *csp);
74 #endif /* def TRUST_FILES */
79 extern char *add_stats(char *s);
80 #endif /* def STATISTICS */
82 static const char CJBGIF[] =
83 "GIF89aD\000\013\000\360\000\000\000\000\000\377\377\377!"
84 "\371\004\001\000\000\001\000,\000\000\000\000D\000\013\000"
85 "\000\002a\214\217\251\313\355\277\000\200G&K\025\316hC\037"
86 "\200\234\230Y\2309\235S\230\266\206\372J\253<\3131\253\271"
87 "\270\215\342\254\013\203\371\202\264\334P\207\332\020o\266"
88 "N\215I\332=\211\312\3513\266:\026AK)\364\370\365aobr\305"
89 "\372\003S\275\274k2\354\254z\347?\335\274x\306^9\374\276"
92 static const char CBLANKGIF[] =
93 "GIF89a\001\000\001\000\200\000\000\377\377\377\000\000"
94 "\000!\371\004\001\000\000\000\000,\000\000\000\000\001"
95 "\000\001\000\000\002\002D\001\000;";
97 static const char CBLOCK[] =
99 "HTTP/1.0 403 Request for blocked URL\n"
100 #else /* ifndef AMIGA */
101 "HTTP/1.0 202 Request for blocked URL\n"
102 #endif /* ndef AMIGA */
104 "Last-Modified: Thu Jul 31, 1997 07:42:22 pm GMT\n"
105 "Expires: Thu Jul 31, 1997 07:42:22 pm GMT\n"
106 "Content-Type: text/html\n\n"
109 "<title>Internet Junkbuster: Request for blocked URL</title>\n"
115 "<p align=center>Your request for <b>%s%s</b>\n"
116 "was blocked.<br><a href=\"http://i.j.b/show-url-info?url=%s%s\">See why</a>"
118 " or <a href=\"http://%s" FORCE_PREFIX "%s\">"
119 "go there anyway.</a>"
120 #endif /* def FORCE_LOAD */
126 static const char CTRUST[] =
128 "HTTP/1.0 403 Request for untrusted URL\n"
129 #else /* ifndef AMIGA */
130 "HTTP/1.0 202 Request for untrusted URL\n"
131 #endif /* ndef AMIGA */
133 "Last-Modified: Thu Jul 31, 1997 07:42:22 pm GMT\n"
134 "Expires: Thu Jul 31, 1997 07:42:22 pm GMT\n"
135 "Content-Type: text/html\n\n"
138 "<title>Internet Junkbuster: Request for untrusted URL</title>\n"
142 "<a href=http://i.j.b/ij-untrusted-url?%s+%s+%s>"
148 #endif /* def TRUST_FILES */
151 static const char C_HOME_PAGE[] =
154 "<title>Internet Junkbuster: Information</title>\n"
160 "<p><a href=\"" HOME_PAGE_URL "\">JunkBuster web site</a></p>\n"
161 "<p><a href=\"http://i.j.b/show-proxy-arg\">Proxy configuration</a></p>\n"
162 "<p><a href=\"http://i.j.b/show-url-info\">Look up a URL</a></p>\n"
166 static const char C_URL_INFO_HEADER[] =
169 "Expires: Thu Jul 31, 1997 07:42:22 pm GMT\n"
170 "Content-Type: text/html\n\n"
173 "<title>Internet Junkbuster: URL Info</title>\n"
179 "<p>Information for: <a href=\"http://%s\">http://%s</a></p>\n";
180 static const char C_URL_INFO_FOOTER[] =
185 static const char C_URL_INFO_FORM[] =
188 "Expires: Thu Jul 31, 1997 07:42:22 pm GMT\n"
189 "Content-Type: text/html\n\n"
192 "<title>Internet Junkbuster: URL Info</title>\n"
198 "<form method=\"GET\" action=\"http://i.j.b/show-url-info\">\n"
199 "<p>Please enter a URL, without the leading "http://":</p>"
200 "<p><input type=\"text\" name=\"url\" size=\"80\">"
201 "<input type=\"submit\" value=\"Info\"></p>\n"
206 static const char CFAIL[] =
207 "HTTP/1.0 503 Connect failed\n"
208 "Content-Type: text/html\n\n"
211 "<title>Internet Junkbuster: Connect failed</title>\n"
217 "TCP connection to '%s' failed: %s.\n<br>"
221 static const char CNXDOM[] =
222 "HTTP/1.0 404 Non-existent domain\n"
223 "Content-Type: text/html\n\n"
226 "<title>Internet Junkbuster: Non-existent domain</title>\n"
232 "No such domain: %s\n"
236 static const char CNOBANNER[] =
237 "HTTP/1.0 200 No Banner\n"
238 "Content-Type: text/html\n\n"
241 "<title>Internet Junkbuster: No Banner</title>\n"
247 "You asked for a banner that this proxy can't produce because either configuration does not permit.\n<br>"
248 "or the URL didn't end with .gif\n"
253 /* Revision control strings from this header and associated .c file */
254 extern const char cgi_rcs[];
255 extern const char cgi_h_rcs[];
261 #endif /* ndef _CGI_H */