source: squid-ssl/trunk/fuentes/src/LogTags.h @ 5495

Last change on this file since 5495 was 5495, checked in by Juanma, 23 months ago

Initial release

File size: 2.1 KB
Line 
1/*
2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#ifndef SQUID_SRC_LOGTAGS_H
10#define SQUID_SRC_LOGTAGS_H
11
12/** Squid transaction result code/tag set.
13 *
14 * These codes indicate how the request was received
15 * and some details about its processing pathway.
16 *
17 * see also http://wiki.squid-cache.org/SquidFaq/SquidLogs#Squid_result_codes
18 * for details on particular components.
19 */
20typedef enum {
21    LOG_TAG_NONE = 0,
22    LOG_TCP_HIT,
23    LOG_TCP_MISS,
24    LOG_TCP_REFRESH_UNMODIFIED, // refresh from origin revalidated existing entry
25    LOG_TCP_REFRESH_FAIL_OLD,   // refresh from origin failed, stale reply sent
26    LOG_TCP_REFRESH_FAIL_ERR,   // refresh from origin failed, error forwarded
27    LOG_TCP_REFRESH_MODIFIED,   // refresh from origin replaced existing entry
28    LOG_TCP_CLIENT_REFRESH_MISS,
29    LOG_TCP_IMS_HIT,
30    LOG_TCP_INM_HIT,
31    LOG_TCP_SWAPFAIL_MISS,
32    LOG_TCP_NEGATIVE_HIT,
33    LOG_TCP_MEM_HIT,
34    LOG_TCP_DENIED,
35    LOG_TCP_DENIED_REPLY,
36    LOG_TCP_OFFLINE_HIT,
37    LOG_TCP_REDIRECT,
38    LOG_TCP_TUNNEL,             // a binary tunnel was established for this transaction
39    LOG_UDP_HIT,
40    LOG_UDP_MISS,
41    LOG_UDP_DENIED,
42    LOG_UDP_INVALID,
43    LOG_UDP_MISS_NOFETCH,
44    LOG_ICP_QUERY,
45    LOG_TYPE_MAX
46} LogTags;
47
48/// list of string representations for LogTags
49extern const char *LogTags_str[];
50
51/// determine if the log tag code indicates a cache HIT
52inline bool logTypeIsATcpHit(LogTags code)
53{
54    return
55        (code == LOG_TCP_HIT) ||
56        (code == LOG_TCP_IMS_HIT) ||
57        (code == LOG_TCP_INM_HIT) ||
58        (code == LOG_TCP_REFRESH_FAIL_OLD) ||
59        (code == LOG_TCP_REFRESH_UNMODIFIED) ||
60        (code == LOG_TCP_NEGATIVE_HIT) ||
61        (code == LOG_TCP_MEM_HIT) ||
62        (code == LOG_TCP_OFFLINE_HIT);
63}
64
65/// iterator for LogTags enumeration
66inline LogTags &operator++ (LogTags &aLogType)
67{
68    int tmp = (int)aLogType;
69    aLogType = (LogTags)(++tmp);
70    return aLogType;
71}
72
73#endif
74
Note: See TracBrowser for help on using the repository browser.