~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to src/enums.h

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2006-11-11 10:32:06 UTC
  • Revision ID: james.westby@ubuntu.com-20061111103206-f3p0r9g0vq44rp3r
Tags: upstream-3.0.PRE5
ImportĀ upstreamĀ versionĀ 3.0.PRE5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*
 
3
 * $Id: enums.h,v 1.254 2006/08/21 00:50:41 robertc Exp $
 
4
 *
 
5
 *
 
6
 * SQUID Web Proxy Cache          http://www.squid-cache.org/
 
7
 * ----------------------------------------------------------
 
8
 *
 
9
 *  Squid is the result of efforts by numerous individuals from
 
10
 *  the Internet community; see the CONTRIBUTORS file for full
 
11
 *  details.   Many organizations have provided support for Squid's
 
12
 *  development; see the SPONSORS file for full details.  Squid is
 
13
 *  Copyrighted (C) 2001 by the Regents of the University of
 
14
 *  California; see the COPYRIGHT file for full details.  Squid
 
15
 *  incorporates software developed and/or copyrighted by other
 
16
 *  sources; see the CREDITS file for full details.
 
17
 *
 
18
 *  This program is free software; you can redistribute it and/or modify
 
19
 *  it under the terms of the GNU General Public License as published by
 
20
 *  the Free Software Foundation; either version 2 of the License, or
 
21
 *  (at your option) any later version.
 
22
 *  
 
23
 *  This program is distributed in the hope that it will be useful,
 
24
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
25
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
26
 *  GNU General Public License for more details.
 
27
 *  
 
28
 *  You should have received a copy of the GNU General Public License
 
29
 *  along with this program; if not, write to the Free Software
 
30
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
 
31
 *
 
32
 */
 
33
 
 
34
#ifndef SQUID_ENUMS_H
 
35
#define SQUID_ENUMS_H
 
36
 
 
37
typedef enum {
 
38
    LOG_TAG_NONE,
 
39
    LOG_TCP_HIT,
 
40
    LOG_TCP_MISS,
 
41
    LOG_TCP_REFRESH_UNMODIFIED, // refresh from origin revalidated existing entry
 
42
    LOG_TCP_REFRESH_FAIL,       // refresh from origin failed
 
43
    LOG_TCP_REFRESH_MODIFIED,   // refresh from origin replaced existing entry
 
44
    LOG_TCP_CLIENT_REFRESH_MISS,
 
45
    LOG_TCP_IMS_HIT,
 
46
    LOG_TCP_SWAPFAIL_MISS,
 
47
    LOG_TCP_NEGATIVE_HIT,
 
48
    LOG_TCP_MEM_HIT,
 
49
    LOG_TCP_DENIED,
 
50
    LOG_TCP_DENIED_REPLY,
 
51
    LOG_TCP_OFFLINE_HIT,
 
52
#if LOG_TCP_REDIRECTS
 
53
    LOG_TCP_REDIRECT,
 
54
#endif
 
55
    LOG_UDP_HIT,
 
56
    LOG_UDP_MISS,
 
57
    LOG_UDP_DENIED,
 
58
    LOG_UDP_INVALID,
 
59
    LOG_UDP_MISS_NOFETCH,
 
60
    LOG_ICP_QUERY,
 
61
    LOG_TYPE_MAX
 
62
} log_type;
 
63
 
 
64
typedef enum {
 
65
    ERR_NONE,
 
66
    ERR_READ_TIMEOUT,
 
67
    ERR_LIFETIME_EXP,
 
68
    ERR_READ_ERROR,
 
69
    ERR_WRITE_ERROR,
 
70
    ERR_SHUTTING_DOWN,
 
71
    ERR_CONNECT_FAIL,
 
72
    ERR_INVALID_REQ,
 
73
    ERR_UNSUP_REQ,
 
74
    ERR_INVALID_URL,
 
75
    ERR_SOCKET_FAILURE,
 
76
    ERR_DNS_FAIL,
 
77
    ERR_CANNOT_FORWARD,
 
78
    ERR_FORWARDING_DENIED,
 
79
    ERR_NO_RELAY,
 
80
    ERR_ZERO_SIZE_OBJECT,
 
81
    ERR_FTP_DISABLED,
 
82
    ERR_FTP_FAILURE,
 
83
    ERR_URN_RESOLVE,
 
84
    ERR_ACCESS_DENIED,
 
85
    ERR_CACHE_ACCESS_DENIED,
 
86
    ERR_CACHE_MGR_ACCESS_DENIED,
 
87
    ERR_SQUID_SIGNATURE,        /* not really an error */
 
88
    ERR_FTP_PUT_CREATED,        /* !error,a note that the file was created */
 
89
    ERR_FTP_PUT_MODIFIED,       /* modified, !created */
 
90
    ERR_FTP_PUT_ERROR,
 
91
    ERR_FTP_NOT_FOUND,
 
92
    ERR_FTP_FORBIDDEN,
 
93
    ERR_FTP_UNAVAILABLE,
 
94
    ERR_ONLY_IF_CACHED_MISS,    /* failure to satisfy only-if-cached request */
 
95
    ERR_TOO_BIG,
 
96
    TCP_RESET,
 
97
    ERR_ESI,                    /* Failure to perform ESI processing */
 
98
    ERR_INVALID_RESP,
 
99
    ERR_ICAP_FAILURE,
 
100
    ERR_MAX
 
101
} err_type;
 
102
 
 
103
enum fd_type {
 
104
    FD_NONE,
 
105
    FD_LOG,
 
106
    FD_FILE,
 
107
    FD_SOCKET,
 
108
    FD_PIPE,
 
109
    FD_UNKNOWN
 
110
};
 
111
 
 
112
enum {
 
113
    FD_READ,
 
114
    FD_WRITE
 
115
};
 
116
 
 
117
typedef enum {
 
118
    PEER_NONE,
 
119
    PEER_SIBLING,
 
120
    PEER_PARENT,
 
121
    PEER_MULTICAST
 
122
} peer_t;
 
123
 
 
124
typedef enum {
 
125
    LOOKUP_NONE,
 
126
    LOOKUP_HIT,
 
127
    LOOKUP_MISS
 
128
} lookup_t;
 
129
 
 
130
typedef enum {
 
131
    CC_BADHDR = -1,
 
132
    CC_PUBLIC = 0,
 
133
    CC_PRIVATE,
 
134
    CC_NO_CACHE,
 
135
    CC_NO_STORE,
 
136
    CC_NO_TRANSFORM,
 
137
    CC_MUST_REVALIDATE,
 
138
    CC_PROXY_REVALIDATE,
 
139
    CC_MAX_AGE,
 
140
    CC_S_MAXAGE,
 
141
    CC_MAX_STALE,
 
142
    CC_ONLY_IF_CACHED,
 
143
    CC_OTHER,
 
144
    CC_ENUM_END
 
145
} http_hdr_cc_type;
 
146
 
 
147
typedef enum {
 
148
    SC_NO_STORE,
 
149
    SC_NO_STORE_REMOTE,
 
150
    SC_MAX_AGE,
 
151
    SC_CONTENT,
 
152
    SC_OTHER,
 
153
    SC_ENUM_END
 
154
} http_hdr_sc_type;
 
155
 
 
156
typedef enum {
 
157
    HIER_NONE,
 
158
    HIER_DIRECT,
 
159
    SIBLING_HIT,
 
160
    PARENT_HIT,
 
161
    DEFAULT_PARENT,
 
162
    SINGLE_PARENT,
 
163
    FIRSTUP_PARENT,
 
164
    FIRST_PARENT_MISS,
 
165
    CLOSEST_PARENT_MISS,
 
166
    CLOSEST_PARENT,
 
167
    CLOSEST_DIRECT,
 
168
    NO_DIRECT_FAIL,
 
169
    SOURCE_FASTEST,
 
170
    ROUNDROBIN_PARENT,
 
171
#if USE_CACHE_DIGESTS
 
172
    CD_PARENT_HIT,
 
173
    CD_SIBLING_HIT,
 
174
#endif
 
175
#if USE_CARP
 
176
    CARP,
 
177
#endif
 
178
    ANY_OLD_PARENT,
 
179
    HIER_MAX
 
180
} hier_code;
 
181
 
 
182
typedef enum {
 
183
    ICP_INVALID,
 
184
    ICP_QUERY,
 
185
    ICP_HIT,
 
186
    ICP_MISS,
 
187
    ICP_ERR,
 
188
    ICP_SEND,
 
189
    ICP_SENDA,
 
190
    ICP_DATABEG,
 
191
    ICP_DATA,
 
192
    ICP_DATAEND,
 
193
    ICP_SECHO,
 
194
    ICP_DECHO,
 
195
    ICP_NOTIFY,
 
196
    ICP_INVALIDATE,
 
197
    ICP_DELETE,
 
198
    ICP_UNUSED15,
 
199
    ICP_UNUSED16,
 
200
    ICP_UNUSED17,
 
201
    ICP_UNUSED18,
 
202
    ICP_UNUSED19,
 
203
    ICP_UNUSED20,
 
204
    ICP_MISS_NOFETCH,
 
205
    ICP_DENIED,
 
206
    ICP_HIT_OBJ,
 
207
    ICP_END
 
208
} icp_opcode;
 
209
 
 
210
typedef enum _mem_status_t {
 
211
    NOT_IN_MEMORY,
 
212
    IN_MEMORY
 
213
} mem_status_t;
 
214
 
 
215
enum {
 
216
    PING_NONE,
 
217
    PING_WAITING,
 
218
    PING_DONE
 
219
};
 
220
 
 
221
enum {
 
222
    STORE_OK,
 
223
    STORE_PENDING
 
224
};
 
225
 
 
226
enum {
 
227
    SWAPOUT_NONE,
 
228
    SWAPOUT_WRITING,
 
229
    SWAPOUT_DONE
 
230
};
 
231
 
 
232
typedef enum {
 
233
    STORE_NON_CLIENT,
 
234
    STORE_MEM_CLIENT,
 
235
    STORE_DISK_CLIENT
 
236
} store_client_t;
 
237
 
 
238
typedef enum {
 
239
    PROTO_NONE,
 
240
    PROTO_HTTP,
 
241
    PROTO_FTP,
 
242
    PROTO_GOPHER,
 
243
    PROTO_WAIS,
 
244
    PROTO_CACHEOBJ,
 
245
    PROTO_ICP,
 
246
#if USE_HTCP
 
247
    PROTO_HTCP,
 
248
#endif
 
249
    PROTO_URN,
 
250
    PROTO_WHOIS,
 
251
    PROTO_INTERNAL,
 
252
    PROTO_HTTPS,
 
253
    PROTO_MAX
 
254
} protocol_t;
 
255
 
 
256
typedef enum {
 
257
    HTTP_STATUS_NONE = 0,
 
258
    HTTP_CONTINUE = 100,
 
259
    HTTP_SWITCHING_PROTOCOLS = 101,
 
260
    HTTP_PROCESSING = 102,      /* RFC2518 section 10.1 */
 
261
    HTTP_OK = 200,
 
262
    HTTP_CREATED = 201,
 
263
    HTTP_ACCEPTED = 202,
 
264
    HTTP_NON_AUTHORITATIVE_INFORMATION = 203,
 
265
    HTTP_NO_CONTENT = 204,
 
266
    HTTP_RESET_CONTENT = 205,
 
267
    HTTP_PARTIAL_CONTENT = 206,
 
268
    HTTP_MULTI_STATUS = 207,    /* RFC2518 section 10.2 */
 
269
    HTTP_MULTIPLE_CHOICES = 300,
 
270
    HTTP_MOVED_PERMANENTLY = 301,
 
271
    HTTP_MOVED_TEMPORARILY = 302,
 
272
    HTTP_SEE_OTHER = 303,
 
273
    HTTP_NOT_MODIFIED = 304,
 
274
    HTTP_USE_PROXY = 305,
 
275
    HTTP_TEMPORARY_REDIRECT = 307,
 
276
    HTTP_BAD_REQUEST = 400,
 
277
    HTTP_UNAUTHORIZED = 401,
 
278
    HTTP_PAYMENT_REQUIRED = 402,
 
279
    HTTP_FORBIDDEN = 403,
 
280
    HTTP_NOT_FOUND = 404,
 
281
    HTTP_METHOD_NOT_ALLOWED = 405,
 
282
    HTTP_NOT_ACCEPTABLE = 406,
 
283
    HTTP_PROXY_AUTHENTICATION_REQUIRED = 407,
 
284
    HTTP_REQUEST_TIMEOUT = 408,
 
285
    HTTP_CONFLICT = 409,
 
286
    HTTP_GONE = 410,
 
287
    HTTP_LENGTH_REQUIRED = 411,
 
288
    HTTP_PRECONDITION_FAILED = 412,
 
289
    HTTP_REQUEST_ENTITY_TOO_LARGE = 413,
 
290
    HTTP_REQUEST_URI_TOO_LARGE = 414,
 
291
    HTTP_UNSUPPORTED_MEDIA_TYPE = 415,
 
292
    HTTP_UNPROCESSABLE_ENTITY = 422,    /* RFC2518 section 10.3 */
 
293
    HTTP_LOCKED = 423,          /* RFC2518 section 10.4 */
 
294
    HTTP_FAILED_DEPENDENCY = 424,       /* RFC2518 section 10.5 */
 
295
    HTTP_INTERNAL_SERVER_ERROR = 500,
 
296
    HTTP_NOT_IMPLEMENTED = 501,
 
297
    HTTP_BAD_GATEWAY = 502,
 
298
    HTTP_SERVICE_UNAVAILABLE = 503,
 
299
    HTTP_GATEWAY_TIMEOUT = 504,
 
300
    HTTP_HTTP_VERSION_NOT_SUPPORTED = 505,
 
301
    HTTP_INSUFFICIENT_STORAGE = 507,    /* RFC2518 section 10.6 */
 
302
    HTTP_INVALID_HEADER = 600,  /* Squid header parsing error */
 
303
    HTTP_HEADER_TOO_LARGE = 601 /* Header too large to process */
 
304
} http_status;
 
305
 
 
306
/*
 
307
 * These are for StoreEntry->flag, which is defined as a SHORT
 
308
 *
 
309
 * NOTE: These flags are written to swap.state, so think very carefully
 
310
 * about deleting or re-assigning!
 
311
 */
 
312
enum {
 
313
    ENTRY_SPECIAL,
 
314
    ENTRY_REVALIDATE,
 
315
    DELAY_SENDING,
 
316
    RELEASE_REQUEST,
 
317
    REFRESH_REQUEST,
 
318
    ENTRY_CACHABLE,
 
319
    ENTRY_DISPATCHED,
 
320
    KEY_PRIVATE,
 
321
    ENTRY_FWD_HDR_WAIT,
 
322
    ENTRY_NEGCACHED,
 
323
    ENTRY_VALIDATED,
 
324
    ENTRY_BAD_LENGTH,
 
325
    ENTRY_ABORTED
 
326
#if UNUSED_CODE
 
327
    ENTRY_DONT_LOG
 
328
#endif
 
329
};
 
330
 
 
331
/*
 
332
 * These are for client Streams. Each node in the stream can be queried for
 
333
 * its status
 
334
 */
 
335
typedef enum {
 
336
    STREAM_NONE,                /* No particular status */
 
337
    STREAM_COMPLETE,            /* All data has been flushed, no more reads allowed */
 
338
    /* an unpredicted end has occured, no more
 
339
     * reads occured, but no need to tell 
 
340
     * downstream that an error occured
 
341
     */
 
342
    STREAM_UNPLANNED_COMPLETE,
 
343
    /* An error has occured in this node or an above one,
 
344
     * and the node is not generating an error body / it's
 
345
     * midstream
 
346
     */
 
347
    STREAM_FAILED
 
348
} clientStream_status_t;
 
349
 
 
350
typedef enum {
 
351
    ACCESS_DENIED,
 
352
    ACCESS_ALLOWED,
 
353
    ACCESS_REQ_PROXY_AUTH
 
354
} allow_t;
 
355
 
 
356
typedef enum {
 
357
    AUTH_ACL_CHALLENGE = -2,
 
358
    AUTH_ACL_HELPER = -1,
 
359
    AUTH_ACL_CANNOT_AUTHENTICATE = 0,
 
360
    AUTH_AUTHENTICATED = 1
 
361
} auth_acl_t;
 
362
 
 
363
typedef enum {
 
364
    AUTH_UNKNOWN,               /* default */
 
365
    AUTH_BASIC,
 
366
    AUTH_NTLM,
 
367
    AUTH_DIGEST,
 
368
    AUTH_NEGOTIATE,
 
369
    AUTH_BROKEN                 /* known type, but broken data */
 
370
} auth_type_t;
 
371
 
 
372
/* stateful helper callback response codes */
 
373
typedef enum {
 
374
    S_HELPER_UNKNOWN,
 
375
    S_HELPER_RESERVE,
 
376
    S_HELPER_RELEASE,
 
377
    S_HELPER_DEFER
 
378
} stateful_helper_callback_t;
 
379
 
 
380
/* stateful helper reservation info */
 
381
typedef enum {
 
382
    S_HELPER_FREE,              /* available for requests */
 
383
    S_HELPER_RESERVED,          /* in a reserved state - no active request, but state data in the helper shouldn't be disturbed */
 
384
    S_HELPER_DEFERRED           /* available for requests, and at least one more will come from a previous caller with the server pointer */
 
385
} stateful_helper_reserve_t;
 
386
 
 
387
 
 
388
#if SQUID_SNMP
 
389
enum {
 
390
    SNMP_C_VIEW,
 
391
    SNMP_C_USER,
 
392
    SNMP_C_COMMUNITY
 
393
};
 
394
 
 
395
#endif
 
396
 
 
397
typedef enum {
 
398
    MEM_NONE,
 
399
    MEM_2K_BUF,
 
400
    MEM_4K_BUF,
 
401
    MEM_8K_BUF,
 
402
    MEM_16K_BUF,
 
403
    MEM_32K_BUF,
 
404
    MEM_64K_BUF,
 
405
    MEM_ACL_DENY_INFO_LIST,
 
406
    MEM_ACL_NAME_LIST,
 
407
#if USE_CACHE_DIGESTS
 
408
    MEM_CACHE_DIGEST,
 
409
#endif
 
410
    MEM_CLIENT_INFO,
 
411
    MEM_LINK_LIST,
 
412
    MEM_DLINK_NODE,
 
413
    MEM_DONTFREE,
 
414
    MEM_DREAD_CTRL,
 
415
    MEM_DWRITE_Q,
 
416
    MEM_FQDNCACHE_ENTRY,
 
417
    MEM_FWD_SERVER,
 
418
    MEM_HTTP_HDR_CC,
 
419
    MEM_HTTP_HDR_CONTENT_RANGE,
 
420
    MEM_IPCACHE_ENTRY,
 
421
    MEM_MD5_DIGEST,
 
422
    MEM_NETDBENTRY,
 
423
    MEM_NET_DB_NAME,
 
424
    MEM_RELIST,
 
425
#if !USE_DNSSERVERS
 
426
    MEM_IDNS_QUERY,
 
427
#endif
 
428
    MEM_MAX
 
429
} mem_type;
 
430
 
 
431
/*
 
432
 * NOTE!  We must preserve the order of this list!
 
433
 */
 
434
enum {
 
435
    STORE_META_VOID,            /* should not come up */
 
436
    STORE_META_KEY_URL,         /* key w/ keytype */
 
437
    STORE_META_KEY_SHA,
 
438
    STORE_META_KEY_MD5,
 
439
    STORE_META_URL,             /* the url , if not in the header */
 
440
    STORE_META_STD,             /* standard metadata */
 
441
    STORE_META_HITMETERING,     /* reserved for hit metering */
 
442
    STORE_META_VALID,
 
443
    STORE_META_VARY_HEADERS,    /* Stores Vary request headers */
 
444
    STORE_META_END
 
445
};
 
446
 
 
447
enum {
 
448
    STORE_LOG_CREATE,
 
449
    STORE_LOG_SWAPIN,
 
450
    STORE_LOG_SWAPOUT,
 
451
    STORE_LOG_RELEASE,
 
452
    STORE_LOG_SWAPOUTFAIL
 
453
};
 
454
 
 
455
typedef enum {
 
456
    SWAP_LOG_NOP,
 
457
    SWAP_LOG_ADD,
 
458
    SWAP_LOG_DEL,
 
459
    SWAP_LOG_MAX
 
460
} swap_log_op;
 
461
 
 
462
 
 
463
/* parse state of HttpReply or HttpRequest */
 
464
typedef enum {
 
465
    psReadyToParseStartLine = 0,
 
466
    psReadyToParseHeaders,
 
467
    psParsed,
 
468
    psError
 
469
} HttpMsgParseState;
 
470
 
 
471
 
 
472
enum {
 
473
    MEDIAN_HTTP,
 
474
    MEDIAN_ICP_QUERY,
 
475
    MEDIAN_DNS,
 
476
    MEDIAN_HIT,
 
477
    MEDIAN_MISS,
 
478
    MEDIAN_NM,
 
479
    MEDIAN_NH,
 
480
    MEDIAN_ICP_REPLY
 
481
};
 
482
 
 
483
enum {
 
484
    SENT,
 
485
    RECV
 
486
};
 
487
 
 
488
/*
 
489
 * These are field indicators for raw cache-cache netdb transfers
 
490
 */
 
491
enum {
 
492
    NETDB_EX_NONE,
 
493
    NETDB_EX_NETWORK,
 
494
    NETDB_EX_RTT,
 
495
    NETDB_EX_HOPS
 
496
};
 
497
 
 
498
/*
 
499
 * Return codes from checkVary(request)
 
500
 */
 
501
enum {
 
502
    VARY_NONE,
 
503
    VARY_MATCH,
 
504
    VARY_OTHER,
 
505
    VARY_CANCEL
 
506
};
 
507
 
 
508
/*
 
509
 * Store digest state enum
 
510
 */
 
511
typedef enum {
 
512
    DIGEST_READ_NONE,
 
513
    DIGEST_READ_REPLY,
 
514
    DIGEST_READ_HEADERS,
 
515
    DIGEST_READ_CBLOCK,
 
516
    DIGEST_READ_MASK,
 
517
    DIGEST_READ_DONE
 
518
} digest_read_state_t;
 
519
 
 
520
/* Distinguish between Request and Reply (for header mangling) */
 
521
enum {
 
522
    ROR_REQUEST,
 
523
    ROR_REPLY
 
524
};
 
525
 
 
526
 
 
527
/* CygWin & Windows NT Port */
 
528
#ifdef _SQUID_WIN32_
 
529
/*
 
530
 * Supported Windows OS types codes
 
531
 */
 
532
enum {
 
533
    _WIN_OS_UNKNOWN,
 
534
    _WIN_OS_WIN32S,
 
535
    _WIN_OS_WIN95,
 
536
    _WIN_OS_WIN98,
 
537
    _WIN_OS_WINME,
 
538
    _WIN_OS_WINNT,
 
539
    _WIN_OS_WIN2K,
 
540
    _WIN_OS_WINXP,
 
541
    _WIN_OS_WINNET,
 
542
    _WIN_OS_WINLON
 
543
};
 
544
 
 
545
#endif
 
546
 
 
547
typedef enum {
 
548
    CLF_UNKNOWN,
 
549
    CLF_AUTO,
 
550
    CLF_CUSTOM,
 
551
    CLF_SQUID,
 
552
    CLF_COMMON,
 
553
    CLF_NONE
 
554
} customlog_type;
 
555
 
 
556
enum {
 
557
    DISABLE_PMTU_OFF,
 
558
    DISABLE_PMTU_ALWAYS,
 
559
    DISABLE_PMTU_TRANSPARENT
 
560
};
 
561
 
 
562
#endif /* SQUID_ENUMS_H */