]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/structs.h
Merged from parent (trunk r10600).
[thirdparty/squid.git] / src / structs.h
index d64ba223fb46e0a682491df55b2c7de5e457d2eb..819d63029baa19796378ab6bccbc294ebb95bde7 100644 (file)
 #include "config.h"
 #include "RefCount.h"
 #include "cbdata.h"
-
-/* needed for various structures still in structs.h */
 #include "dlink.h"
+#include "err_type.h"
+
 /* needed for the global config */
 #include "HttpHeader.h"
 
+/* for ICP_END */
+#include "icp_opcode.h"
+
+#define PEER_MULTICAST_SIBLINGS 1
+
 struct acl_name_list {
     char name[ACL_NAME_SZ];
     acl_name_list *next;
@@ -70,7 +75,7 @@ struct _snmp_request_t {
     long reqid;
     int outlen;
 
-    IpAddress from;
+    Ip::Address from;
 
     struct snmp_pdu *PDU;
     ACLChecklist *acl_checklist;
@@ -87,7 +92,7 @@ struct acl_address {
     acl_address *next;
     ACLList *aclList;
 
-    IpAddress addr;
+    Ip::Address addr;
 };
 
 struct acl_tos {
@@ -121,9 +126,7 @@ struct relist {
 #include "icmp/IcmpConfig.h"
 #endif
 
-#if USE_ZPH_QOS
-#include "ip/QosConfig.h"
-#endif
+#include "HelperChildConfig.h"
 
 /* forward decl for SquidConfig, see RemovalPolicy.h */
 
@@ -160,6 +163,7 @@ struct SquidConfig {
 
     struct {
         time_t read;
+        time_t write;
         time_t lifetime;
         time_t connect;
         time_t forward;
@@ -173,10 +177,7 @@ struct SquidConfig {
         int icp_query_max;     /* msec */
         int icp_query_min;     /* msec */
         int mcast_icp_query;   /* msec */
-#if USE_IDENT
 
-        time_t ident;
-#endif
 #if !USE_DNSSERVERS
 
         time_t idns_retransmit;
@@ -186,6 +187,7 @@ struct SquidConfig {
     } Timeout;
     size_t maxRequestHeaderSize;
     int64_t maxRequestBodySize;
+    int64_t maxChunkedRequestBodySize;
     size_t maxReplyHeaderSize;
     acl_size_t *ReplyBodySize;
 
@@ -219,19 +221,16 @@ struct SquidConfig {
 #if USE_WCCP
 
     struct {
-
-        IpAddress router;
-
-        IpAddress address;
+        Ip::Address router;
+        Ip::Address address;
         int version;
     } Wccp;
 #endif
 #if USE_WCCPv2
 
     struct {
-        IpAddress_list *router;
-
-        IpAddress address;
+        Ip::Address_list *router;
+        Ip::Address address;
         int forwarding_method;
         int return_method;
         int assignment_method;
@@ -248,7 +247,6 @@ struct SquidConfig {
     char *as_whois_server;
 
     struct {
-        char *log;
         char *store;
         char *swap;
 #if USE_USERAGENT_LOG
@@ -268,6 +266,10 @@ struct SquidConfig {
 
         customlog *accesslogs;
 
+#if ICAP_CLIENT
+        customlog *icaplogs;
+#endif
+
         int rotateNumber;
     } Log;
     char *adminEmail;
@@ -297,24 +299,19 @@ struct SquidConfig {
     } Program;
 #if USE_DNSSERVERS
 
-    int dnsChildren;
+    HelperChildConfig dnsChildren;
 #endif
 
-    int redirectChildren;
-    int redirectConcurrency;
+    HelperChildConfig redirectChildren;
     time_t authenticateGCInterval;
     time_t authenticateTTL;
     time_t authenticateIpTTL;
 
     struct {
-#if USE_SQUID_ESI
         char *surrogate_id;
-#endif
-
     } Accel;
     char *appendDomain;
     size_t appendDomainLen;
-    char *debugOptions;
     char *pidFilename;
     char *netdbFilename;
     char *mimeTablePathname;
@@ -333,17 +330,14 @@ struct SquidConfig {
 
     struct {
 
-        IpAddress udp_incoming;
-
-        IpAddress udp_outgoing;
+        Ip::Address udp_incoming;
+        Ip::Address udp_outgoing;
 #if SQUID_SNMP
-
-        IpAddress snmp_incoming;
-
-        IpAddress snmp_outgoing;
+        Ip::Address snmp_incoming;
+        Ip::Address snmp_outgoing;
 #endif
         /* FIXME INET6 : this should really be a CIDR value */
-        IpAddress client_netmask;
+        Ip::Address client_netmask;
     } Addrs;
     size_t tcpRcvBufsz;
     size_t udpMaxHitObjsz;
@@ -399,6 +393,7 @@ struct SquidConfig {
 #if HTTP_VIOLATIONS
 
         int reload_into_ims;
+        int ignore_expect_100;
 #endif
 
         int offline;
@@ -420,11 +415,7 @@ struct SquidConfig {
         int ie_refresh;
         int vary_ignore_expire;
         int pipeline_prefetch;
-
-#if USE_SQUID_ESI
         int surrogate_is_remote;
-#endif
-
         int request_entities;
         int detect_broken_server_pconns;
         int balance_on_multiple_ip;
@@ -436,21 +427,28 @@ struct SquidConfig {
         int httpd_suppress_version_string;
         int global_internal_static;
         int dns_require_A;
-        int debug_override_X;
 
 #if FOLLOW_X_FORWARDED_FOR
         int acl_uses_indirect_client;
         int delay_pool_uses_indirect_client;
         int log_uses_indirect_client;
+#if LINUX_NETFILTER
+        int tproxy_uses_indirect_client;
+#endif
 #endif /* FOLLOW_X_FORWARDED_FOR */
 
         int WIN32_IpAddrChangeMonitor;
+        int memory_cache_first;
+        int memory_cache_disk;
     } onoff;
 
+    int forward_max_tries;
+
     class ACL *aclList;
 
     struct {
         acl_access *http;
+        acl_access *adapted_http;
         acl_access *icp;
         acl_access *miss;
         acl_access *NeverDirect;
@@ -462,13 +460,9 @@ struct SquidConfig {
 
         acl_access *snmp;
 #endif
-
+#if HTTP_VIOLATIONS
         acl_access *brokenPosts;
-#if USE_IDENT
-
-        acl_access *identLookup;
 #endif
-
         acl_access *redirector;
         acl_access *reply;
         acl_address *outgoing_address;
@@ -487,9 +481,11 @@ struct SquidConfig {
         acl_access *followXFF;
 #endif /* FOLLOW_X_FORWARDED_FOR */
 
+#if ICAP_CLIENT
+        acl_access* icap;
+#endif
     } accessList;
     acl_deny_info_list *denyInfoList;
-    authConfig authConfiguration;
 
     struct {
         size_t list_width;
@@ -497,6 +493,7 @@ struct SquidConfig {
         char *anon_user;
         int passive;
         int epsv_all;
+        int epsv;
         int sanitycheck;
         int telnet;
     } Ftp;
@@ -507,6 +504,10 @@ struct SquidConfig {
         int n_allocated;
         int n_configured;
     } cacheSwap;
+    /*
+     * I'm sick of having to keep doing this ..
+     */
+#define INDEXSD(i)   (Config.cacheSwap.swapDirs[(i)].getRaw())
 
     struct {
         char *directory;
@@ -542,12 +543,12 @@ struct SquidConfig {
     } comm_incoming;
     int max_open_disk_fds;
     int uri_whitespace;
-    int64_t rangeOffsetLimit;
+    acl_size_t *rangeOffsetLimit;
 #if MULTICAST_MISS_STREAM
 
     struct {
 
-        IpAddress addr;
+        Ip::Address addr;
         int ttl;
         unsigned short port;
         char *encode_key;
@@ -590,10 +591,6 @@ struct SquidConfig {
     time_t minimum_expiry_time;        /* seconds */
     external_acl *externalAclHelperList;
 
-#if USE_ZPH_QOS
-    QosConfig zph;
-#endif
-
 #if USE_SSL
 
     struct {
@@ -613,10 +610,14 @@ struct SquidConfig {
 
     char *accept_filter;
     int umask;
+    int max_filedescriptors;
+    int workers;
 
 #if USE_LOADABLE_MODULES
     wordlist *loadable_module_names;
 #endif
+
+    int client_ip_max_connections;
 };
 
 SQUIDCEXTERN SquidConfig Config;
@@ -771,7 +772,7 @@ struct _http_state_flags {
 };
 
 struct _ipcache_addrs {
-    IpAddress *in_addrs;
+    Ip::Address *in_addrs;
     unsigned char *bad_mask;
     unsigned char count;
     unsigned char cur;
@@ -813,7 +814,7 @@ struct peer {
     char *host;
     peer_t type;
 
-    IpAddress in_addr;
+    Ip::Address in_addr;
 
     struct {
         int pings_sent;
@@ -837,8 +838,8 @@ struct peer {
         int counts[ICP_END+1];
         u_short port;
     } icp;
-#if USE_HTCP
 
+#if USE_HTCP
     struct {
         double version;
         int counts[2];
@@ -878,6 +879,10 @@ struct peer {
         unsigned int userhash:1;
         unsigned int sourcehash:1;
         unsigned int originserver:1;
+        unsigned int no_tproxy:1;
+#if PEER_MULTICAST_SIBLINGS
+        unsigned int mcast_siblings:1;
+#endif
     } options;
 
     int weight;
@@ -903,7 +908,7 @@ struct peer {
 
     int tcp_up;                        /* 0 if a connect() fails */
 
-    IpAddress addresses[10];
+    Ip::Address addresses[10];
     int n_addresses;
     int rr_count;
     peer *next;
@@ -929,6 +934,7 @@ struct peer {
 
     char *login;               /* Proxy authorization */
     time_t connect_timeout;
+    int connect_fail_limit;
     int max_conn;
     char *domain;              /* Forced domain */
 #if USE_SSL
@@ -997,7 +1003,7 @@ struct _iostats {
 
 
 struct request_flags {
-    request_flags(): range(0),nocache(0),ims(0),auth(0),cachable(0),hierarchical(0),loopdetect(0),proxy_keepalive(0),proxying(0),refresh(0),redirected(0),need_validation(0),accelerated(0),intercepted(0),spoof_client_ip(0),internal(0),internalclient(0),must_keepalive(0),destinationIPLookedUp_(0) {
+    request_flags(): range(0),nocache(0),ims(0),auth(0),cachable(0),hierarchical(0),loopdetect(0),proxy_keepalive(0),proxying(0),refresh(0),redirected(0),need_validation(0),accelerated(0),ignore_cc(0),intercepted(0),spoof_client_ip(0),internal(0),internalclient(0),must_keepalive(0),destinationIPLookedUp_(0) {
 #if HTTP_VIOLATIONS
         nocache_hack = 0;
 #endif
@@ -1023,6 +1029,7 @@ unsigned int proxying:
     unsigned int nocache_hack:1;       /* for changing/ignoring no-cache requests */
 #endif
     unsigned int accelerated:1;
+    unsigned int ignore_cc:1;
     unsigned int intercepted:1;  /**< transparently intercepted request */
     unsigned int spoof_client_ip:1;  /**< spoof client ip if possible */
     unsigned int internal:1;
@@ -1033,6 +1040,7 @@ unsigned int proxying:
     unsigned int connection_proxy_auth:1; /** Request wants connection oriented auth */
     unsigned int pinned:1;      /* Request sent on a pinned connection */
     unsigned int auth_sent:1;   /* Authentication forwarded */
+    unsigned int no_direct:1;  /* Deny direct forwarding unless overriden by always_direct. Used in accelerator mode */
 
     // When adding new flags, please update cloneAdaptationImmune() as needed.
 
@@ -1078,6 +1086,7 @@ struct _refresh_t {
     struct {
         unsigned int icase:1;
         unsigned int refresh_ims:1;
+        unsigned int store_stale:1;
 #if HTTP_VIOLATIONS
         unsigned int override_expire:1;
         unsigned int override_lastmod:1;
@@ -1085,6 +1094,7 @@ struct _refresh_t {
         unsigned int ignore_reload:1;
         unsigned int ignore_no_cache:1;
         unsigned int ignore_no_store:1;
+        unsigned int ignore_must_revalidate:1;
         unsigned int ignore_private:1;
         unsigned int ignore_auth:1;
 #endif
@@ -1195,7 +1205,7 @@ struct _StatCounters {
         int times_used;
     } netdb;
     int page_faults;
-    int select_loops;
+    unsigned long int select_loops;
     int select_fds;
     double select_time;
     double cputime;
@@ -1257,28 +1267,6 @@ struct _HttpHeaderStat {
 };
 
 
-struct _ClientInfo {
-    hash_link hash;            /* must be first */
-
-    IpAddress addr;
-
-    struct {
-        int result_hist[LOG_TYPE_MAX];
-        int n_requests;
-        kb_t kbytes_in;
-        kb_t kbytes_out;
-        kb_t hit_kbytes_out;
-    } Http, Icp;
-
-    struct {
-        time_t time;
-        int n_req;
-        int n_denied;
-    } cutoff;
-    int n_established;         /* number of current established connections */
-    time_t last_seen;
-};
-
 struct _CacheDigest {
     /* public, read-only */
     char *mask;                        /* bit mask */
@@ -1303,21 +1291,6 @@ struct _store_rebuild_data {
     int zero_object_sz;
 };
 
-struct _Logfile {
-    int fd;
-    char path[MAXPATHLEN];
-    char *buf;
-    size_t bufsz;
-    size_t offset;
-
-    struct {
-        unsigned int fatal;
-        unsigned int syslog;
-    } flags;
-
-    int syslog_priority;
-};
-
 class logformat_token;
 
 struct _logformat {
@@ -1326,6 +1299,8 @@ struct _logformat {
     logformat *next;
 };
 
+class Logfile;
+
 struct _customlog {
     char *filename;
     ACLList *aclList;