- (Fix:) Copied CODE_STATUS #define from config.h.in
[privoxy.git] / project.h
1 #ifndef _PROJECT_H
2 #define _PROJECT_H
3 #define PROJECT_H_VERSION "$Id: project.h,v 1.19 2001/06/29 13:33:36 oes Exp $"
4 /*********************************************************************
5  *
6  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
7  *
8  * Purpose     :  Defines data structures which are widely used in the
9  *                project.  Does not define any variables or functions
10  *                (though it does declare some macros).
11  *
12  * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
13  *                IJBSWA team.  http://ijbswa.sourceforge.net
14  *
15  *                Based on the Internet Junkbuster originally written
16  *                by and Copyright (C) 1997 Anonymous Coders and 
17  *                Junkbusters Corporation.  http://www.junkbusters.com
18  *
19  *                This program is free software; you can redistribute it 
20  *                and/or modify it under the terms of the GNU General
21  *                Public License as published by the Free Software
22  *                Foundation; either version 2 of the License, or (at
23  *                your option) any later version.
24  *
25  *                This program is distributed in the hope that it will
26  *                be useful, but WITHOUT ANY WARRANTY; without even the
27  *                implied warranty of MERCHANTABILITY or FITNESS FOR A
28  *                PARTICULAR PURPOSE.  See the GNU General Public
29  *                License for more details.
30  *
31  *                The GNU General Public License should be included with
32  *                this file.  If not, you can view it at
33  *                http://www.gnu.org/copyleft/gpl.html
34  *                or write to the Free Software Foundation, Inc., 59
35  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
36  *
37  * Revisions   :
38  *    $Log: project.h,v $
39  *    Revision 1.19  2001/06/29 13:33:36  oes
40  *    - Improved comments
41  *    - Introduced http_request.host_ip_addr_str
42  *    - Introduced http_response.head_length
43  *    - Introduced config.my_ip_addr_str, config.my_hostname,
44  *      config.admin_address and config.proxy_info_url
45  *    - Removed config.proxy_args_header and config.proxy_args_trailer,
46  *      renamed config.proxy_args_invocation to config.proxy_args
47  *    - Removed HTML snipplets and GIFs
48  *    - Removed logentry from cancelled commit
49  *
50  *    Revision 1.18  2001/06/09 10:57:39  jongfoster
51  *    Adding definition of BUFFER_SIZE.
52  *    Changing struct cgi_dispatcher to use "const" strings.
53  *
54  *    Revision 1.17  2001/06/07 23:15:09  jongfoster
55  *    Merging ACL and forward files into config file.
56  *    Moving struct gateway members into struct forward_spec
57  *    Removing config->proxy_args_gateways
58  *    Cosmetic: Adding a few comments
59  *
60  *    Revision 1.16  2001/06/04 18:31:58  swa
61  *    files are now prefixed with either `confdir' or `logdir'.
62  *    `make redhat-dist' replaces both entries confdir and logdir
63  *    with redhat values
64  *
65  *    Revision 1.15  2001/06/04 11:28:53  swa
66  *    redirect did not work due to missing /
67  *
68  *    Revision 1.14  2001/06/03 11:03:48  oes
69  *    Added struct map,
70  *    added struct http_response,
71  *    changed struct interceptors to struct cgi_dispatcher,
72  *    moved HTML stuff to cgi.h
73  *
74  *    Revision 1.13  2001/06/01 20:05:36  jongfoster
75  *    Support for +image-blocker{}: added ACTION_IMAGE_BLOCKER
76  *    constant, and removed csp->tinygif.
77  *
78  *    Revision 1.12  2001/06/01 18:49:17  jongfoster
79  *    Replaced "list_share" with "list" - the tiny memory gain was not
80  *    worth the extra complexity.
81  *
82  *    Revision 1.11  2001/06/01 10:32:47  oes
83  *    Added constants for anchoring selection bitmap
84  *
85  *    Revision 1.10  2001/05/31 21:33:53  jongfoster
86  *    Changes for new actions file, replacing permissionsfile
87  *    and parts of the config file.  Also added support for
88  *    list_shared.
89  *
90  *    Revision 1.9  2001/05/31 17:32:31  oes
91  *
92  *     - Enhanced domain part globbing with infix and prefix asterisk
93  *       matching and optional unanchored operation
94  *
95  *    Revision 1.8  2001/05/29 20:09:15  joergs
96  *    HTTP_REDIRECT_TEMPLATE fixed.
97  *
98  *    Revision 1.7  2001/05/29 09:50:24  jongfoster
99  *    Unified blocklist/imagelist/actionslist.
100  *    File format is still under discussion, but the internal changes
101  *    are (mostly) done.
102  *
103  *    Also modified interceptor behaviour:
104  *    - We now intercept all URLs beginning with one of the following
105  *      prefixes (and *only* these prefixes):
106  *        * http://i.j.b/
107  *        * http://ijbswa.sf.net/config/
108  *        * http://ijbswa.sourceforge.net/config/
109  *    - New interceptors "home page" - go to http://i.j.b/ to see it.
110  *    - Internal changes so that intercepted and fast redirect pages
111  *      are not replaced with an image.
112  *    - Interceptors now have the option to send a binary page direct
113  *      to the client. (i.e. ijb-send-banner uses this)
114  *    - Implemented show-url-info interceptor.  (Which is why I needed
115  *      the above interceptors changes - a typical URL is
116  *      "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif".
117  *      The previous mechanism would not have intercepted that, and
118  *      if it had been intercepted then it then it would have replaced
119  *      it with an image.)
120  *
121  *    Revision 1.6  2001/05/27 22:17:04  oes
122  *
123  *    - re_process_buffer no longer writes the modified buffer
124  *      to the client, which was very ugly. It now returns the
125  *      buffer, which it is then written by chat.
126  *
127  *    - content_length now adjusts the Content-Length: header
128  *      for modified documents rather than crunch()ing it.
129  *      (Length info in csp->content_length, which is 0 for
130  *      unmodified documents)
131  *
132  *    - For this to work, sed() is called twice when filtering.
133  *
134  *    Revision 1.5  2001/05/26 00:28:36  jongfoster
135  *    Automatic reloading of config file.
136  *    Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32).
137  *    Most of the global variables have been moved to a new
138  *    struct configuration_spec, accessed through csp->config->globalname
139  *    Most of the globals remaining are used by the Win32 GUI.
140  *
141  *    Revision 1.4  2001/05/22 18:46:04  oes
142  *
143  *    - Enabled filtering banners by size rather than URL
144  *      by adding patterns that replace all standard banner
145  *      sizes with the "Junkbuster" gif to the re_filterfile
146  *
147  *    - Enabled filtering WebBugs by providing a pattern
148  *      which kills all 1x1 images
149  *
150  *    - Added support for PCRE_UNGREEDY behaviour to pcrs,
151  *      which is selected by the (nonstandard and therefore
152  *      capital) letter 'U' in the option string.
153  *      It causes the quantifiers to be ungreedy by default.
154  *      Appending a ? turns back to greedy (!).
155  *
156  *    - Added a new interceptor ijb-send-banner, which
157  *      sends back the "Junkbuster" gif. Without imagelist or
158  *      MSIE detection support, or if tinygif = 1, or the
159  *      URL isn't recognized as an imageurl, a lame HTML
160  *      explanation is sent instead.
161  *
162  *    - Added new feature, which permits blocking remote
163  *      script redirects and firing back a local redirect
164  *      to the browser.
165  *      The feature is conditionally compiled, i.e. it
166  *      can be disabled with --disable-fast-redirects,
167  *      plus it must be activated by a "fast-redirects"
168  *      line in the config file, has its own log level
169  *      and of course wants to be displayed by show-proxy-args
170  *      Note: Boy, all the #ifdefs in 1001 locations and
171  *      all the fumbling with configure.in and acconfig.h
172  *      were *way* more work than the feature itself :-(
173  *
174  *    - Because a generic redirect template was needed for
175  *      this, tinygif = 3 now uses the same.
176  *
177  *    - Moved GIFs, and other static HTTP response templates
178  *      to project.h
179  *
180  *    - Some minor fixes
181  *
182  *    - Removed some >400 CRs again (Jon, you really worked
183  *      a lot! ;-)
184  *
185  *    Revision 1.3  2001/05/20 01:21:20  jongfoster
186  *    Version 2.9.4 checkin.
187  *    - Merged popupfile and cookiefile, and added control over PCRS
188  *      filtering, in new "actionsfile".
189  *    - Implemented LOG_LEVEL_FATAL, so that if there is a configuration
190  *      file error you now get a message box (in the Win32 GUI) rather
191  *      than the program exiting with no explanation.
192  *    - Made killpopup use the PCRS MIME-type checking and HTTP-header
193  *      skipping.
194  *    - Removed tabs from "config"
195  *    - Moved duplicated url parsing code in "loaders.c" to a new funcition.
196  *    - Bumped up version number.
197  *
198  *    Revision 1.2  2001/05/17 23:01:01  oes
199  *     - Cleaned CRLF's from the sources and related files
200  *
201  *    Revision 1.1.1.1  2001/05/15 13:59:03  oes
202  *    Initial import of version 2.9.3 source tree
203  *
204  *
205  *********************************************************************/
206 \f
207
208 /* Declare struct FILE for vars and funcs. */
209 #include <stdio.h>
210
211 /* Need time_t for file_list */
212 #include <time.h>
213
214 /*
215  * Include appropriate regular expression libraries.
216  *
217  * PCRS           ==> Include pcre
218  * REGEX && PCRE  ==> Include pcre and pcreposix
219  * REGEX && !PCRE ==> Include gnu_regex
220  *
221  * STATIC  ==> Use  #include "pcre.h"  (compiling at same time)
222  * !STATIC ==> Use  #include <pcre.h>  (System library)
223  *
224  */
225 #if (defined(REGEX) && defined(PCRE)) || defined(PCRS)
226 #  ifdef STATIC
227 #    include "pcre.h"
228 #  else
229 #    include <pcre.h>
230 #  endif
231 #endif /* (defined(REGEX) && defined(PCRE)) || defined(PCRS) */
232
233 #if defined(REGEX) && defined(PCRE)
234 #  ifdef STATIC
235 #    include "pcreposix.h"
236 #  else
237 #    include <pcreposix.h>
238 #  endif
239 #endif /* defined(REGEX) && defined(PCRE) */
240
241 #if defined(REGEX) && !defined(PCRE)
242 #  include "gnu_regex.h"
243 #endif
244
245 #ifdef PCRS
246 #include "pcrs.h"
247 #endif /* def PCRS */
248
249 #ifdef AMIGA 
250 #include "amiga.h" 
251 #endif /* def AMIGA */
252
253 #ifdef __cplusplus
254 extern "C" {
255 #endif
256
257 #define BUFFER_SIZE 5000
258
259 #define FOREVER 1
260
261 /* Default IP and port to listen on */
262 #define HADDR_DEFAULT   "127.0.0.1"
263 #define HADDR_PORT      8000
264
265
266 /* Need this for struct client_state */
267 struct configuration_spec;
268
269 /* Generic linked list of strings */
270 struct list /* FIXME: Why not separate entries and header? */
271 {
272    char *       str;  /* valid in an entry */
273    struct list *last; /* valid in header */
274    struct list *next;
275 };
276
277 struct map
278 {
279   char *name;
280   char *value;
281   struct map *next;
282 };
283
284 struct http_request
285 {
286    char *cmd;
287    char *gpc;
288    char *host;
289    char *host_ip_addr_str; /* NULL before connect_to() */
290    int   port;
291    char *path;
292    char *ver;
293    char *hostport; /* "host[:port]" */
294    int   ssl;
295 };
296
297 /* Response generated by CGI, blocker, or error handler */
298 struct http_response
299 {
300   char *status;           /* HTTP status (string)*/
301   struct list headers[1]; /* List of header lines */
302   char *head;             /* Formatted http response head */
303   int   head_length;      /* Length of http response head */
304   char *body;             /* HTTP document body */
305   int   content_length;   /* Length of body, REQUIRED if binary body*/
306 };
307
308 /* A URL pattern */
309 struct url_spec
310 {
311    char  *spec;        /* The string which was parsed to produce this       */
312                        /* url_spec.  Used for debugging or display only.    */
313
314    /* Hostname matching: */
315    char  *domain;      /* Fully qalified domain name (FQDN) pattern.        */
316                        /* May contain "*".                                  */
317    char  *dbuf;        /* Buffer with '\0'-delimited fqdn                   */
318    char **dvec;        /* Domain ptr vector into dbuf                       */
319    int    dcnt;        /* How many domains in fqdn?                         */
320    int    unanchored;  /* Bitmap - flags are ANCHOR_LEFT and ANCHOR_RIGHT   */
321
322    /* Port matching: */
323    int   port;         /* The port number, or 0 to match all ports.         */
324
325    /* Path matching: */
326    char *path;         /* The path prefix (if not using regex), or source   */
327                        /* for the regex.                                    */
328    int   pathlen;      /* ==strlen(path).  Needed for prefix matching.      */
329 #ifdef REGEX
330    regex_t *preg;      /* Regex for matching path part                      */
331 #endif
332 };
333
334 #define ANCHOR_LEFT  1
335 #define ANCHOR_RIGHT 2
336
337
338
339 /* An I/O buffer */
340 struct iob
341 {
342    char *buf;
343    char *cur;
344    char *eod;
345 };
346
347
348 #define IOB_PEEK(CSP) ((CSP->iob->cur > CSP->iob->eod) ? (CSP->iob->eod - CSP->iob->cur) : 0)
349 #define IOB_RESET(CSP) if(CSP->iob->buf) free(CSP->iob->buf); memset(CSP->iob, '\0', sizeof(CSP->iob));
350
351
352
353 #define ACTION_MASK_ALL        (~0U)
354
355 #define ACTION_MOST_COMPATIBLE 0x0000U
356
357 #define ACTION_BLOCK           0x0001U
358 #define ACTION_FAST_REDIRECTS  0x0002U
359 #define ACTION_FILTER          0x0004U
360 #define ACTION_HIDE_FORWARDED  0x0008U
361 #define ACTION_HIDE_FROM       0x0010U
362 #define ACTION_HIDE_REFERER    0x0020U /* sic - follow HTTP, not English */
363 #define ACTION_HIDE_USER_AGENT 0x0040U
364 #define ACTION_IMAGE           0x0080U
365 #define ACTION_IMAGE_BLOCKER   0x0100U
366 #define ACTION_NO_COOKIE_READ  0x0200U
367 #define ACTION_NO_COOKIE_SET   0x0400U
368 #define ACTION_NO_POPUPS       0x0800U
369 #define ACTION_VANILLA_WAFER   0x1000U
370
371 #define ACTION_STRING_FROM          0
372 #define ACTION_STRING_IMAGE_BLOCKER 1
373 #define ACTION_STRING_REFERER       2
374 #define ACTION_STRING_USER_AGENT    3
375 #define ACTION_STRING_COUNT         4
376
377 #define ACTION_MULTI_ADD_HEADER     0
378 #define ACTION_MULTI_WAFER          1
379 #define ACTION_MULTI_COUNT          2
380
381 /*
382  * This structure contains a list of actions to apply to a URL.
383  * It only contains positive instructions - no "-" options.
384  * It is not used to store the actions list itself, only for
385  * url_actions() to return the current values.
386  */
387 struct current_action_spec
388 {
389    unsigned flags;    /* a bit set to "1" = add action    */
390
391    /* For those actions that require parameters: */
392
393    /* each entry is valid if & only if corresponding entry in "add" set. */
394    char * string[ACTION_STRING_COUNT];
395
396    /* Strings to add */
397    struct list multi[ACTION_MULTI_COUNT][1];
398 };
399
400
401 /*
402  * This structure contains a set of changes to actions.
403  * It can contain both positive and negative instructions.
404  * It is used to store an entry in the actions list.
405  */
406 struct action_spec
407 {
408    unsigned mask;   /* a bit set to "0" = remove action */
409    unsigned add;    /* a bit set to "1" = add action    */
410
411    /* For those actions that require parameters: */
412
413    /* each entry is valid if & only if corresponding entry in "add" set. */
414    char * string[ACTION_STRING_COUNT];
415
416    /* Strings to remove. */
417    struct list multi_remove[ACTION_MULTI_COUNT][1];
418
419    /* If nonzero, remove *all* strings. */
420    int         multi_remove_all[ACTION_MULTI_COUNT];
421
422    /* Strings to add */
423    struct list multi_add[ACTION_MULTI_COUNT][1];
424 };
425
426 /*
427  * This structure is used to store the actions list.
428  *
429  * It contains a URL pattern, and the chages to the actions.
430  * It is a linked list.
431  */
432 struct url_actions
433 {
434    struct url_spec url[1];
435
436    struct action_spec action[1];
437
438    struct url_actions * next;
439 };
440
441
442 /* Constants defining bitmask for csp->accept_types */
443
444 #ifdef DETECT_MSIE_IMAGES
445
446 /* MSIE detected by user-agent string */
447 #define ACCEPT_TYPE_IS_MSIE     0x0001
448
449 /*
450  * *If* this is MSIE, it wants an image.  (Or this is a shift-reload, or
451  * it's got an image from this URL before...  yuck!)
452  * Only meaningful if ACCEPT_TYPE_IS_MSIE set 
453  */
454 #define ACCEPT_TYPE_MSIE_IMAGE  0x0002
455
456 /*
457  * *If* this is MSIE, it wants a HTML document.
458  * Only meaningful if ACCEPT_TYPE_IS_MSIE set
459  */
460 #define ACCEPT_TYPE_MSIE_HTML   0x0004
461
462 #endif /* def DETECT_MSIE_IMAGES */
463
464
465 struct client_state
466 {
467    /* The proxy's configuration */
468    struct configuration_spec * config;
469
470    /* The actions to perform on the current request */
471    struct current_action_spec  action[1];
472
473    /* socket to talk to client (web browser) */
474    int  cfd;
475
476    /* socket to talk to server (web server or proxy) */
477    int  sfd;
478
479
480 #ifdef STATISTICS
481    /* 1 if this URL was rejected, 0 otherwise. Allows actual stats inc to 
482     * occur in main thread only for thread-safety. 
483     */
484    int  rejected;
485 #endif /* def STATISTICS */
486
487 #ifdef FORCE_LOAD
488    int force;
489 #endif /* def FORCE_LOAD */
490
491 #ifdef TOGGLE
492    int   toggled_on;
493 #endif /* def TOGGLE */
494
495    /*
496     * Client PC's IP address, as reported by the accept()_ function.
497     * Both as string and number
498     */
499    char *ip_addr_str;
500    long  ip_addr_long;
501
502
503    /* Our IP address and hostname, i.e. the IP address that
504       the client used to reach us, and the associated hostname,
505       both as strings
506     */
507    char *my_ip_addr_str;
508    char *my_hostname;
509
510 #ifdef TRUST_FILES
511    /* The referer in this request, if one was specified. */
512    char *referrer;
513 #endif /* def TRUST_FILES */
514
515 #if defined(DETECT_MSIE_IMAGES)
516    /* Types the client will accept.
517     * Bitmask - see ACCEPT_TYPE_XXX constants.
518     */
519    int accept_types;
520 #endif /* defined(DETECT_MSIE_IMAGES) */
521
522    /* The URL that was requested */
523    struct http_request http[1];
524
525    /* An I/O buffer used for buffering data read from the client */
526    struct iob iob[1];
527
528    /* List of all headers for this request */
529    struct list headers[1];
530
531    /* List of all cookies for this request */
532    struct list cookie_list[1];
533
534 #if defined(PCRS) || defined(KILLPOPUPS)
535    /* Nonzero if this has a text MIME type */
536    int is_text;
537 #endif /* defined(PCRS) || defined(KILLPOPUPS) */
538
539    /* The "X-Forwarded-For:" header sent by the client */
540    char   *x_forwarded;
541
542    /*
543     * Nonzero if this client is processing data.
544     * Set to zero when the thread associated with this structure dies.
545     */
546    int active;
547
548    /* files associated with this client */
549    struct file_list *actions_list;
550
551 #ifdef PCRS
552      struct file_list *rlist;   /* Perl re_filterfile */
553      size_t content_length;     /* Length after processing */ 
554 #endif /* def PCRS */
555
556 #ifdef TRUST_FILES
557    struct file_list *tlist;   /* trustfile */
558 #endif /* def TRUST_FILES */
559
560    struct client_state *next;
561 };
562
563
564 struct parsers
565 {
566    char *str;
567    char  len;
568    char *(*parser)(const struct parsers *, char *, struct client_state *);
569 };
570
571 struct cgi_dispatcher
572 {
573    const char *name;
574    int         name_length;
575    int         (*handler)(struct client_state *csp, struct http_response *rsp, struct map *parameters);
576    const char *description;
577 };
578
579 struct file_list
580 {
581    /*
582     * this is a pointer to the data structures associated with the file.
583     * Read-only once the structure has been created.
584     */
585    void *f;
586    
587    /* Normally NULL.  When we are finished with file (i.e. when we have
588     * loaded a new one), set to a pointer to an unloader function.
589     * Unloader will be called by sweep() (called from main loop) when
590     * all clients using this file are done.  This prevents threading 
591     * problems.
592     */
593    void (*unloader)(void *);
594
595    /* Used internally by sweep().  Do not access from elsewhere. */
596    int active;
597
598 #ifndef SPLIT_PROXY_ARGS
599    /* String to be displayed as part of show-proxy-args display.
600     * Read-only once the structure has been created.
601     */
602    char *proxy_args;
603 #endif /* ndef SPLIT_PROXY_ARGS */
604
605    /* Following variables allow us to check if file has been changed.
606     * Read-only once the structure has been created.
607     */
608    time_t lastmodified;
609    char * filename;
610
611    /* Pointer to next entry in the linked list of all "file_list"s.
612     * This linked list is so that sweep() can navigate it.
613     * Since sweep() can remove items from the list, we must be careful
614     * to only access this value from main thread (when we know sweep
615     * won't be running).
616     */
617    struct file_list *next;
618 };
619
620
621 #ifdef TRUST_FILES
622 struct block_spec
623 {
624    struct url_spec url[1];
625    int    reject;
626    struct block_spec *next;
627 };
628 #endif /* def TRUST_FILES */
629
630
631 #define SOCKS_NONE    0    /* Don't use a SOCKS server */
632 #define SOCKS_4      40    /* original SOCKS 4 protocol */
633 #define SOCKS_4A     41    /* as modified for hosts w/o external DNS */
634
635 struct forward_spec
636 {
637    struct url_spec url[1];
638
639    /* Connection type - must be a SOCKS_xxx constant */
640    int   type;
641
642    /* SOCKS server */
643    char *gateway_host;
644    int   gateway_port;
645
646    /* Parent HTTP proxy */
647    char *forward_host;
648    int   forward_port;
649
650    /* For the linked list */
651    struct forward_spec *next;
652 };
653
654
655 #ifdef PCRS
656 struct re_filterfile_spec
657 {
658    struct list patterns[1];
659    pcrs_job *joblist;
660 };
661 #endif /* def PCRS */
662
663
664 #ifdef ACL_FILES
665 #define ACL_PERMIT   1  /* accept connection request */
666 #define ACL_DENY     2  /* reject connection request */
667
668 struct access_control_addr
669 {
670    unsigned long addr;
671    unsigned long mask;
672    unsigned long port;
673 };
674
675 struct access_control_list
676 {
677    struct access_control_addr src[1];
678    struct access_control_addr dst[1];
679
680    short action;
681    struct access_control_list *next;
682 };
683 #endif /* def ACL_FILES */
684
685
686 /* Maximum number of loaders (actions, re_filter, ...) */
687 #define NLOADERS 8
688
689 /*
690  * Data loaded from the configuration file.
691  *
692  * (Anomaly: toggle is still handled through a global, not this structure)
693  */
694 struct configuration_spec
695 {
696    int debug;
697    int multi_threaded;
698
699    const char *logfile;
700
701    const char *confdir;
702    const char *logdir;
703    const char *actions_file;
704
705    /* The administrator's email address */
706    char *admin_address;
707
708    /* A URL with info on this proxy */
709    char *proxy_info_url;
710
711 #ifdef PCRS
712    const char *re_filterfile;
713 #endif /* def PCRS */
714
715 #ifdef JAR_FILES
716    const char * jarfile;
717    FILE * jar;
718 #endif /* def JAR_FILES */
719
720    /*
721     * Port and IP to bind to.
722     * Defaults to HADDR_DEFAULT:HADDR_PORT == 127.0.0.1:8000
723     */
724    const char *haddr;
725    int         hport;
726
727 #ifndef SPLIT_PROXY_ARGS
728    const char *suppress_message;
729 #endif /* ndef SPLIT_PROXY_ARGS */
730
731 #ifndef SPLIT_PROXY_ARGS
732    /* suppress listing config files */
733    int suppress_blocklists;
734 #endif /* ndef SPLIT_PROXY_ARGS */
735
736 #ifdef TRUST_FILES
737    const char * trustfile;
738
739    struct list trust_info[1];
740    struct url_spec *trust_list[64];
741 #endif /* def TRUST_FILES */
742
743 #ifdef ACL_FILES
744    struct access_control_list *acl;
745 #endif /* def ACL_FILES */
746
747    struct forward_spec *forward;
748
749    /* All options from the config file, HTML-formatted */
750    char *proxy_args;
751
752    /* the configuration file object. */
753    struct file_list *config_file_list;
754
755    /* List of loaders */
756    int (*loaders[NLOADERS])(struct client_state *);
757
758    /* bool, nonzero if we need to bind() to the new port */
759    int need_bind;
760 };
761
762
763 #define SZ(X)  (sizeof(X) / sizeof(*X))
764
765 #ifdef FORCE_LOAD
766 #define FORCE_PREFIX "/IJB-FORCE-LOAD"
767 #endif /* def FORCE_LOAD */
768
769 /* Hardwired URLs */
770 #define HOME_PAGE_URL  "http://ijbswa.sourceforge.net"
771 #define REDIRECT_URL HOME_PAGE_URL "/redirect.php?v=" VERSION "&to="
772 #define CGI_PREFIX_HOST "i.j.b"
773
774 /* HTTP snipplets */
775 static const char CSUCCEED[] =
776    "HTTP/1.0 200 Connection established\n"
777    "Proxy-Agent: IJ/" VERSION "\n\n";
778
779 static const char CHEADER[] =
780    "HTTP/1.0 400 Invalid header received from browser\n\n";
781
782 #ifdef __cplusplus
783 } /* extern "C" */
784 #endif
785
786 #endif /* ndef _PROJECT_H */
787
788 /*
789   Local Variables:
790   tab-width: 3
791   end:
792 */