Add tests for change-x-forwarded-for{}.
[privoxy.git] / project.h
index 98717fd..8bf3020 100644 (file)
--- a/project.h
+++ b/project.h
@@ -1,7 +1,7 @@
 #ifndef PROJECT_H_INCLUDED
 #define PROJECT_H_INCLUDED
 /** Version string. */
-#define PROJECT_H_VERSION "$Id: project.h,v 1.112 2008/04/06 15:18:34 fabiankeil Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.117 2008/08/30 12:03:07 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
  *
  * Revisions   :
  *    $Log: project.h,v $
+ *    Revision 1.117  2008/08/30 12:03:07  fabiankeil
+ *    Remove FEATURE_COOKIE_JAR.
+ *
+ *    Revision 1.116  2008/05/20 16:05:02  fabiankeil
+ *    Move parsers structure definition from project.h to parsers.h.
+ *
+ *    Revision 1.115  2008/05/19 16:57:20  fabiankeil
+ *    Declare all members of the parsers structure immutable.
+ *
+ *    Revision 1.114  2008/04/11 16:35:39  fabiankeil
+ *    Oops, I forgot to shorten the URL_SPEC_INITIALIZER in my last commit.
+ *
+ *    Revision 1.113  2008/04/10 14:41:04  fabiankeil
+ *    Ditch url_spec's path member now that it's no longer used.
+ *
  *    Revision 1.112  2008/04/06 15:18:34  fabiankeil
  *    Oh well, rename the --enable-pcre-host-patterns option to
  *    --enable-extended-host-patterns as it's not really PCRE syntax.
@@ -960,9 +975,9 @@ struct url_spec
  * If you declare a static url_spec, this is the value to initialize it to zero.
  */
 #ifndef FEATURE_EXTENDED_HOST_PATTERNS
-#define URL_SPEC_INITIALIZER { NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL }
+#define URL_SPEC_INITIALIZER { NULL, NULL, NULL, 0, 0, NULL, NULL, NULL }
 #else
-#define URL_SPEC_INITIALIZER { NULL, NULL, NULL, NULL, NULL, NULL }
+#define URL_SPEC_INITIALIZER { NULL, NULL, NULL, NULL, NULL }
 #endif /* def FEATURE_EXTENDED_HOST_PATTERNS */
 
 /**
@@ -1093,6 +1108,8 @@ struct iob
 #define ACTION_OVERWRITE_LAST_MODIFIED               0x02000000UL
 /** Action bitmap: Replace or block Accept-Language header */
 #define ACTION_HIDE_ACCEPT_LANGUAGE                  0x04000000UL
+/** Action bitmap: Remove or add "X-Forwarded-For" header. */
+#define ACTION_CHANGE_X_FORWARDED_FOR                0x08000000UL
 
 
 /** Action string index: How to deanimate GIFs */
@@ -1129,8 +1146,10 @@ struct iob
 #define ACTION_STRING_FORWARD_OVERRIDE     15
 /** Action string index: Reason for the block. */
 #define ACTION_STRING_BLOCK                16
+/** Action string index: what to do with the "X-Forwarded-For" header. */
+#define ACTION_STRING_CHANGE_X_FORWARDED_FOR 17
 /** Number of string actions. */
-#define ACTION_STRING_COUNT                17
+#define ACTION_STRING_COUNT                18
 
 
 /* To make the ugly hack in sed easier to understand */
@@ -1363,6 +1382,13 @@ struct client_state
    /** MIME-Type key, see CT_* above */
    unsigned int content_type;
 
+   /** The "X-Forwarded-For:" header sent by the client */
+   /*
+    * XXX: this is a hack that causes problems if
+    * there's more than one X-Forwarded-For header.
+    */
+   char *x_forwarded_for;
+
    /** Actions files associated with this client */
    struct file_list *actions_list[MAX_AF_FILES];
 
@@ -1401,22 +1427,6 @@ typedef jb_err (*add_header_func_ptr)(struct client_state *);
 typedef jb_err (*parser_func_ptr    )(struct client_state *, char **);
 
 
-/**
- * List of functions to run on a list of headers
- */
-struct parsers
-{
-   /** The header prefix to match */
-   char   *str;
-   
-   /** The length of the prefix to match */
-   size_t len;
-   
-   /** The function to apply to this line */
-   parser_func_ptr parser;
-};
-
-
 /**
  * List of available CGI functions.
  */
@@ -1689,16 +1699,6 @@ struct configuration_spec
    /** The hostname to show on CGI pages, or NULL to use the real one. */
    const char *hostname;
 
-#ifdef FEATURE_COOKIE_JAR
-
-   /** The file name of the cookie jar file */
-   const char * jarfile;
-
-   /** The handle to the cookie jar file */
-   FILE * jar;
-
-#endif /* def FEATURE_COOKIE_JAR */
-
    /** IP address to bind to.  Defaults to HADDR_DEFAULT == 127.0.0.1. */
    const char *haddr;