]> git.ipfire.org Git - thirdparty/squid.git/blame - src/defines.h
Fix memmove() arg bug. should be conn->in.offset, not in.size
[thirdparty/squid.git] / src / defines.h
CommitLineData
a8258824 1
2#ifndef TRUE
3#define TRUE 1
4#endif
5#ifndef FALSE
6#define FALSE 0
7#endif
8
a8258824 9#define ACL_NAME_SZ 32
10#define BROWSERNAMELEN 128
11
12#define ACL_SUNDAY 0x01
13#define ACL_MONDAY 0x02
14#define ACL_TUESDAY 0x04
15#define ACL_WEDNESDAY 0x08
16#define ACL_THURSDAY 0x10
17#define ACL_FRIDAY 0x20
18#define ACL_SATURDAY 0x40
19#define ACL_ALLWEEK 0x7F
20#define ACL_WEEKDAYS 0x3E
21
22#define DefaultDnsChildrenMax 32 /* 32 processes */
23#define DefaultRedirectChildrenMax 32 /* 32 processes */
24#define MAXHTTPPORTS 12
25
26#define COMM_OK (0)
27#define COMM_ERROR (-1)
a8258824 28#define COMM_NOMESSAGE (-3)
29#define COMM_TIMEOUT (-4)
30#define COMM_SHUTDOWN (-5)
31#define COMM_INPROGRESS (-6)
32#define COMM_ERR_CONNECT (-7)
33#define COMM_ERR_DNS (-8)
96f1be5d 34#define COMM_ERR_CLOSING (-9)
a8258824 35
a8258824 36/* Select types. */
37#define COMM_SELECT_READ (0x1)
38#define COMM_SELECT_WRITE (0x2)
39#define MAX_DEBUG_SECTIONS 100
40
79a15e0a 41#define COMM_NONBLOCKING 0x01
42#define COMM_NOCLOEXEC 0x02
43
a8258824 44#ifdef HAVE_SYSLOG
45#define debug(SECTION, LEVEL) \
46 ((_db_level = (LEVEL)) > debugLevels[SECTION]) ? (void) 0 : _db_print
47#else
48#define debug(SECTION, LEVEL) \
49 ((LEVEL) > debugLevels[SECTION]) ? (void) 0 : _db_print
50#endif
51#define safe_free(x) if (x) { xxfree(x); x = NULL; }
52
53#define DISK_OK (0)
54#define DISK_ERROR (-1)
55#define DISK_EOF (-2)
a8258824 56#define DISK_NO_SPACE_LEFT (-6)
57
a8258824 58#define DNS_INBUF_SZ 4096
59
a8258824 60#define FD_DESC_SZ 64
61
7c63efed 62#define FQDN_FLAG_UNUSED_01 0x01
a8258824 63#define FQDN_LOOKUP_IF_MISS 0x02
a8258824 64#define FQDN_MAX_NAMES 5
a8258824 65#define FQDNCACHE_AV_FACTOR 1000
66
67/*
68 * Here are some good prime number choices. It's important not to
69 * choose a prime number that is too close to exact powers of 2.
70 */
71#if 0
72#undef HASH_SIZE 103 /* prime number < 128 */
73#undef HASH_SIZE 229 /* prime number < 256 */
74#undef HASH_SIZE 467 /* prime number < 512 */
75#undef HASH_SIZE 977 /* prime number < 1024 */
76#undef HASH_SIZE 1979 /* prime number < 2048 */
77#undef HASH_SIZE 4019 /* prime number < 4096 */
78#undef HASH_SIZE 6037 /* prime number < 6144 */
79#undef HASH_SIZE 7951 /* prime number < 8192 */
80#undef HASH_SIZE 12149 /* prime number < 12288 */
81#undef HASH_SIZE 16231 /* prime number < 16384 */
82#undef HASH_SIZE 33493 /* prime number < 32768 */
83#undef HASH_SIZE 65357 /* prime number < 65536 */
84#endif
85
f9e5a344 86#define DEFAULT_HASH_SIZE 7951 /* prime number < 8192 */
a8258824 87
88#define HTTP_REPLY_FIELD_SZ 128
89
90#define BUF_TYPE_8K 1
91#define BUF_TYPE_MALLOC 2
92
93#define ANONYMIZER_NONE 0
94#define ANONYMIZER_STANDARD 1
95#define ANONYMIZER_PARANOID 2
96
a8258824 97#define ICP_IDENT_SZ 64
98#define IDENT_NONE 0
99#define IDENT_PENDING 1
100#define IDENT_DONE 2
101
7c63efed 102#define IP_UNUSED_FLAG_01 0x01
a8258824 103#define IP_LOOKUP_IF_MISS 0x02
a8258824 104
105#define IPCACHE_AV_FACTOR 1000
106
107#define MAX_MIME 4096
108
109/* Mark a neighbor cache as dead if it doesn't answer this many pings */
110#define HIER_MAX_DEFICIT 20
111
a8258824 112#define ICP_FLAG_HIT_OBJ 0x80000000ul
113#define ICP_FLAG_SRC_RTT 0x40000000ul
114
a8258824 115/* Version */
a8258824 116#define ICP_VERSION_2 2
117#define ICP_VERSION_3 3
118#define ICP_VERSION_CURRENT ICP_VERSION_2
119
120#define DIRECT_NO 0
121#define DIRECT_MAYBE 1
122#define DIRECT_YES 2
123
a8258824 124#define REDIRECT_AV_FACTOR 1000
125
126#define REDIRECT_NONE 0
127#define REDIRECT_PENDING 1
128#define REDIRECT_DONE 2
129
a8258824 130#define CONNECT_PORT 443
131
132#define current_stacksize(stack) ((stack)->top - (stack)->base)
133
134/* logfile status */
135#define LOG_ENABLE 1
136#define LOG_DISABLE 0
137
138#define SM_PAGE_SIZE 4096
139#define DISK_PAGE_SIZE 8192
140
79a15e0a 141#if UNUSED_CODE
a8258824 142#define BIT_SET(flag, bit) ((flag) |= (bit))
d3f89c29 143#define BIT_CLR(flag, bit) ((flag) &= ~(bit))
a8258824 144#define BIT_TEST(flag, bit) ((flag) & (bit))
79a15e0a 145#endif
a8258824 146
147#define EBIT_SET(flag, bit) ((flag) |= ((1<<bit)))
d3f89c29 148#define EBIT_CLR(flag, bit) ((flag) &= ~((1<<bit)))
a8258824 149#define EBIT_TEST(flag, bit) ((flag) & ((1<<bit)))
150
a8258824 151#define MAX_FILES_PER_DIR (1<<20)
152
153#define MAX_URL 4096
154#define MAX_LOGIN_SZ 128
155
a8258824 156#define PEER_MAX_ADDRESSES 10
157#define RTT_AV_FACTOR 1000
158
159/* flags for peer->mcast.flags */
160#define PEER_COUNT_EVENT_PENDING 1
161#define PEER_COUNTING 2
162#define ICP_AUTH_SIZE (2) /* size of authenticator field */
4f117cb4 163
164#define ICON_MENU "anthony-dir.gif"
165#define ICON_DIRUP "anthony-dirup.gif"
166#define ICON_LINK "anthony-link.gif"
9b312a19 167
168#define AUTH_MSG_SZ 4096
169#define HTTP_REPLY_BUF_SZ 4096
603a02fd 170
03d7b07f 171#if !defined(ERROR_BUF_SZ) && defined(MAX_URL)
172#define ERROR_BUF_SZ (MAX_URL << 2)
173#endif
174
8350fe9b 175#define READ_AHEAD_GAP (1<<14)
6ccb94e5 176
177#if SQUID_SNMP
178#define VIEWINCLUDED 1
179#define VIEWEXCLUDED 2
180#endif