3 #define CGI_H_VERSION "$Id: cgi.h,v 1.1 2001/06/03 11:04:49 oes Exp $"
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.
41 * Revision 1.1 2001/06/03 11:04:49 oes
48 * adapted to new enlist_unique arg format
52 * introduced confdir option
54 * filters.c filtrers.h
56 * extracted-CGI relevant stuff
64 * support for new cgi mechansim
68 * functions for new list type: "map"
69 * extended enlist_unique
76 * deleted const struct interceptors
84 * added struct http_response
85 * changes struct interceptors to struct cgi_dispatcher
86 * moved HTML stuff to cgi.h
97 **********************************************************************/
106 extern struct http_response *cgi_dispatch(struct client_state *csp);
107 extern int make_http_response(struct http_response *rsp);
108 extern void free_http_response(struct http_response *rsp);
110 extern struct map *parse_cgi(char *argstring);
111 char *dump_map(struct map *map);
113 extern int cgi_default(struct client_state *csp, struct http_response *rsp,
114 struct map *parameters);
115 int cgi_show_status(struct client_state *csp, struct http_response *rsp,
116 struct map *parameters);
118 extern char *ijb_show_url_info(struct http_request *http, struct client_state *csp);
120 extern char *redirect_url(struct http_request *http, struct client_state *csp);
121 extern int cgi_send_banner(struct client_state *csp, struct http_response *rsp,
122 struct map *parameters);
127 extern char *ij_untrusted_url(struct http_request *http, struct client_state *csp);
128 #endif /* def TRUST_FILES */
133 extern char *add_stats(char *s);
134 #endif /* def STATISTICS */
136 static const char CJBGIF[] =
137 "GIF89aD\000\013\000\360\000\000\000\000\000\377\377\377!"
138 "\371\004\001\000\000\001\000,\000\000\000\000D\000\013\000"
139 "\000\002a\214\217\251\313\355\277\000\200G&K\025\316hC\037"
140 "\200\234\230Y\2309\235S\230\266\206\372J\253<\3131\253\271"
141 "\270\215\342\254\013\203\371\202\264\334P\207\332\020o\266"
142 "N\215I\332=\211\312\3513\266:\026AK)\364\370\365aobr\305"
143 "\372\003S\275\274k2\354\254z\347?\335\274x\306^9\374\276"
146 static const char CBLANKGIF[] =
147 "GIF89a\001\000\001\000\200\000\000\377\377\377\000\000"
148 "\000!\371\004\001\000\000\000\000,\000\000\000\000\001"
149 "\000\001\000\000\002\002D\001\000;";
151 static const char CBLOCK[] =
153 "HTTP/1.0 403 Request for blocked URL\n"
154 #else /* ifndef AMIGA */
155 "HTTP/1.0 202 Request for blocked URL\n"
156 #endif /* ndef AMIGA */
158 "Last-Modified: Thu Jul 31, 1997 07:42:22 pm GMT\n"
159 "Expires: Thu Jul 31, 1997 07:42:22 pm GMT\n"
160 "Content-Type: text/html\n\n"
163 "<title>Internet Junkbuster: Request for blocked URL</title>\n"
169 "<p align=center>Your request for <b>%s%s</b>\n"
170 "was blocked.<br><a href=\"http://i.j.b/show-url-info?url=%s%s\">See why</a>"
172 " or <a href=\"http://%s" FORCE_PREFIX "%s\">"
173 "go there anyway.</a>"
174 #endif /* def FORCE_LOAD */
180 static const char CTRUST[] =
182 "HTTP/1.0 403 Request for untrusted URL\n"
183 #else /* ifndef AMIGA */
184 "HTTP/1.0 202 Request for untrusted URL\n"
185 #endif /* ndef AMIGA */
187 "Last-Modified: Thu Jul 31, 1997 07:42:22 pm GMT\n"
188 "Expires: Thu Jul 31, 1997 07:42:22 pm GMT\n"
189 "Content-Type: text/html\n\n"
192 "<title>Internet Junkbuster: Request for untrusted URL</title>\n"
196 "<a href=http://i.j.b/ij-untrusted-url?%s+%s+%s>"
202 #endif /* def TRUST_FILES */
205 static const char C_HOME_PAGE[] =
208 "<title>Internet Junkbuster: Information</title>\n"
214 "<p><a href=\"" HOME_PAGE_URL "\">JunkBuster web site</a></p>\n"
215 "<p><a href=\"http://i.j.b/show-proxy-arg\">Proxy configuration</a></p>\n"
216 "<p><a href=\"http://i.j.b/show-url-info\">Look up a URL</a></p>\n"
220 static const char C_URL_INFO_HEADER[] =
223 "Expires: Thu Jul 31, 1997 07:42:22 pm GMT\n"
224 "Content-Type: text/html\n\n"
227 "<title>Internet Junkbuster: URL Info</title>\n"
233 "<p>Information for: <a href=\"http://%s\">http://%s</a></p>\n";
234 static const char C_URL_INFO_FOOTER[] =
239 static const char C_URL_INFO_FORM[] =
242 "Expires: Thu Jul 31, 1997 07:42:22 pm GMT\n"
243 "Content-Type: text/html\n\n"
246 "<title>Internet Junkbuster: URL Info</title>\n"
252 "<form method=\"GET\" action=\"http://i.j.b/show-url-info\">\n"
253 "<p>Please enter a URL, without the leading "http://":</p>"
254 "<p><input type=\"text\" name=\"url\" size=\"80\">"
255 "<input type=\"submit\" value=\"Info\"></p>\n"
260 static const char CFAIL[] =
261 "HTTP/1.0 503 Connect failed\n"
262 "Content-Type: text/html\n\n"
265 "<title>Internet Junkbuster: Connect failed</title>\n"
271 "TCP connection to '%s' failed: %s.\n<br>"
275 static const char CNXDOM[] =
276 "HTTP/1.0 404 Non-existent domain\n"
277 "Content-Type: text/html\n\n"
280 "<title>Internet Junkbuster: Non-existent domain</title>\n"
286 "No such domain: %s\n"
290 static const char CNOBANNER[] =
291 "HTTP/1.0 200 No Banner\n"
292 "Content-Type: text/html\n\n"
295 "<title>Internet Junkbuster: No Banner</title>\n"
301 "You asked for a banner that this proxy can't produce because either configuration does not permit.\n<br>"
302 "or the URL didn't end with .gif\n"
307 /* Revision control strings from this header and associated .c file */
308 extern const char cgi_rcs[];
309 extern const char cgi_h_rcs[];
315 #endif /* ndef _CGI_H */