File: LogTags.h

package info (click to toggle)
squid3 3.4.8-6+deb8u5
  • links: PTS
  • area: main
  • in suites: jessie
  • size: 32,116 kB
  • sloc: cpp: 165,380; ansic: 21,998; sh: 12,166; makefile: 5,974; perl: 2,153; sql: 322; awk: 118
file content (64 lines) | stat: -rw-r--r-- 1,811 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef SQUID_SRC_LOGTAGS_H
#define SQUID_SRC_LOGTAGS_H

/** Squid transaction result code/tag set.
 *
 * These codes indicate how the request was received
 * and some details about its processing pathway.
 *
 * see also http://wiki.squid-cache.org/SquidFaq/SquidLogs#Squid_result_codes
 * for details on particular components.
 */
typedef enum {
    LOG_TAG_NONE = 0,
    LOG_TCP_HIT,
    LOG_TCP_MISS,
    LOG_TCP_REFRESH_UNMODIFIED, // refresh from origin revalidated existing entry
    LOG_TCP_REFRESH_FAIL_OLD,   // refresh from origin failed, stale reply sent
    LOG_TCP_REFRESH_FAIL_ERR,   // refresh from origin failed, error forwarded
    LOG_TCP_REFRESH_MODIFIED,   // refresh from origin replaced existing entry
    LOG_TCP_CLIENT_REFRESH_MISS,
    LOG_TCP_IMS_HIT,
    LOG_TCP_INM_HIT,
    LOG_TCP_SWAPFAIL_MISS,
    LOG_TCP_NEGATIVE_HIT,
    LOG_TCP_MEM_HIT,
    LOG_TCP_DENIED,
    LOG_TCP_DENIED_REPLY,
    LOG_TCP_OFFLINE_HIT,
    LOG_TCP_REDIRECT,
    LOG_UDP_HIT,
    LOG_UDP_MISS,
    LOG_UDP_DENIED,
    LOG_UDP_INVALID,
    LOG_UDP_MISS_NOFETCH,
    LOG_ICP_QUERY,
    LOG_TYPE_MAX
} LogTags;

/// list of string representations for LogTags
extern const char *LogTags_str[];

/// determine if the log tag code indicates a cache HIT
inline bool logTypeIsATcpHit(LogTags code)
{
    return
        (code == LOG_TCP_HIT) ||
        (code == LOG_TCP_IMS_HIT) ||
        (code == LOG_TCP_INM_HIT) ||
        (code == LOG_TCP_REFRESH_FAIL_OLD) ||
        (code == LOG_TCP_REFRESH_UNMODIFIED) ||
        (code == LOG_TCP_NEGATIVE_HIT) ||
        (code == LOG_TCP_MEM_HIT) ||
        (code == LOG_TCP_OFFLINE_HIT);
}

/// iterator for LogTags enumeration
inline LogTags &operator++ (LogTags &aLogType)
{
    int tmp = (int)aLogType;
    aLogType = (LogTags)(++tmp);
    return aLogType;
}

#endif