]>
Commit | Line | Data |
---|---|---|
02c8dde5 AJ |
1 | #ifndef SQUID_SRC_LOGTAGS_H |
2 | #define SQUID_SRC_LOGTAGS_H | |
3 | ||
4 | /** Squid transaction result code/tag set. | |
5 | * | |
6 | * These codes indicate how the request was received | |
7 | * and some details about its processing pathway. | |
8 | * | |
9 | * see also http://wiki.squid-cache.org/SquidFaq/SquidLogs#Squid_result_codes | |
10 | * for details on particular components. | |
11 | */ | |
12 | typedef enum { | |
13 | LOG_TAG_NONE = 0, | |
14 | LOG_TCP_HIT, | |
15 | LOG_TCP_MISS, | |
16 | LOG_TCP_REFRESH_UNMODIFIED, // refresh from origin revalidated existing entry | |
17 | LOG_TCP_REFRESH_FAIL_OLD, // refresh from origin failed, stale reply sent | |
18 | LOG_TCP_REFRESH_FAIL_ERR, // refresh from origin failed, error forwarded | |
19 | LOG_TCP_REFRESH_MODIFIED, // refresh from origin replaced existing entry | |
20 | LOG_TCP_CLIENT_REFRESH_MISS, | |
21 | LOG_TCP_IMS_HIT, | |
22 | LOG_TCP_SWAPFAIL_MISS, | |
23 | LOG_TCP_NEGATIVE_HIT, | |
24 | LOG_TCP_MEM_HIT, | |
25 | LOG_TCP_DENIED, | |
26 | LOG_TCP_DENIED_REPLY, | |
27 | LOG_TCP_OFFLINE_HIT, | |
28 | LOG_TCP_REDIRECT, | |
8a713747 | 29 | LOG_TCP_TUNNEL, // a binary tunnel was established for this transaction |
02c8dde5 AJ |
30 | LOG_UDP_HIT, |
31 | LOG_UDP_MISS, | |
32 | LOG_UDP_DENIED, | |
33 | LOG_UDP_INVALID, | |
34 | LOG_UDP_MISS_NOFETCH, | |
35 | LOG_ICP_QUERY, | |
36 | LOG_TYPE_MAX | |
37 | } LogTags; | |
38 | ||
39 | /// list of string representations for LogTags | |
40 | extern const char *LogTags_str[]; | |
41 | ||
42 | /// determine if the log tag code indicates a cache HIT | |
43 | inline bool logTypeIsATcpHit(LogTags code) | |
44 | { | |
45 | return | |
46 | (code == LOG_TCP_HIT) || | |
47 | (code == LOG_TCP_IMS_HIT) || | |
48 | (code == LOG_TCP_REFRESH_FAIL_OLD) || | |
49 | (code == LOG_TCP_REFRESH_UNMODIFIED) || | |
50 | (code == LOG_TCP_NEGATIVE_HIT) || | |
51 | (code == LOG_TCP_MEM_HIT) || | |
52 | (code == LOG_TCP_OFFLINE_HIT); | |
53 | } | |
54 | ||
55 | /// iterator for LogTags enumeration | |
56 | inline LogTags &operator++ (LogTags &aLogType) | |
57 | { | |
58 | int tmp = (int)aLogType; | |
59 | aLogType = (LogTags)(++tmp); | |
60 | return aLogType; | |
61 | } | |
62 | ||
63 | #endif |