]> git.ipfire.org Git - thirdparty/squid.git/blob - src/AccessLogEntry.h
Merged from trunk.
[thirdparty/squid.git] / src / AccessLogEntry.h
1 /*
2 * $Id: AccessLogEntry.h,v 1.9 2008/02/26 00:15:48 rousskov Exp $
3 *
4 *
5 * SQUID Web Proxy Cache http://www.squid-cache.org/
6 * ----------------------------------------------------------
7 *
8 * Squid is the result of efforts by numerous individuals from
9 * the Internet community; see the CONTRIBUTORS file for full
10 * details. Many organizations have provided support for Squid's
11 * development; see the SPONSORS file for full details. Squid is
12 * Copyrighted (C) 2001 by the Regents of the University of
13 * California; see the COPYRIGHT file for full details. Squid
14 * incorporates software developed and/or copyrighted by other
15 * sources; see the CREDITS file for full details.
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
21 *
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
30 *
31 * Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
32 */
33 #ifndef SQUID_HTTPACCESSLOGENTRY_H
34 #define SQUID_HTTPACCESSLOGENTRY_H
35
36 #include "HttpVersion.h"
37 #include "HttpRequestMethod.h"
38 #include "HierarchyLogEntry.h"
39 #include "IPAddress.h"
40 #include "HttpRequestMethod.h"
41
42 /* forward decls */
43 class HttpReply;
44 class HttpRequest;
45
46 class AccessLogEntry
47 {
48
49 public:
50 AccessLogEntry() : url(NULL) , reply(NULL), request(NULL) {}
51
52 const char *url;
53
54 class HttpDetails
55 {
56
57 public:
58 HttpDetails() : method(METHOD_NONE), code(0), content_type(NULL) {}
59
60 HttpRequestMethod method;
61 int code;
62 const char *content_type;
63 HttpVersion version;
64 } http;
65
66 class ICPDetails
67 {
68
69 public:
70 ICPDetails() : opcode(ICP_INVALID) {}
71
72 icp_opcode opcode;
73 } icp;
74
75 class CacheDetails
76 {
77
78 public:
79 CacheDetails() : caddr(),
80 requestSize(0),
81 replySize(0),
82 highOffset(0),
83 objectSize(0),
84 code (LOG_TAG_NONE),
85 msec(0),
86 rfc931 (NULL),
87 authuser (NULL),
88 extuser(NULL)
89 #if USE_SSL
90 ,ssluser(NULL)
91 #endif
92 {;
93 }
94
95 IPAddress caddr;
96 int64_t requestSize;
97 int64_t replySize;
98 int64_t highOffset;
99 int64_t objectSize;
100 log_type code;
101 int msec;
102 const char *rfc931;
103 const char *authuser;
104 const char *extuser;
105 #if USE_SSL
106
107 const char *ssluser;
108 #endif
109
110 } cache;
111
112 class Headers
113 {
114
115 public:
116 Headers() : request(NULL), reply(NULL) {}
117
118 char *request;
119 char *reply;
120 } headers;
121
122 // Why is this a sub-class and not a set of real "private:" fields?
123 // It looks like its duplicating HTTPRequestMethod anyway!
124 class Private
125 {
126
127 public:
128 Private() : method_str(NULL) {}
129
130 const char *method_str;
131 } _private;
132 HierarchyLogEntry hier;
133 HttpReply *reply;
134 HttpRequest *request;
135 };
136
137 class ACLChecklist;
138 class StoreEntry;
139 class logformat_token;
140
141 /* Should be in 'AccessLog.h' as the driver */
142 extern void accessLogLog(AccessLogEntry *, ACLChecklist * checklist);
143 extern void accessLogRotate(void);
144 extern void accessLogClose(void);
145 extern void accessLogInit(void);
146 extern void accessLogFreeMemory(AccessLogEntry * aLogEntry);
147 extern const char *accessLogTime(time_t);
148 extern int accessLogParseLogFormat(logformat_token ** fmt, char *def);
149 extern void accessLogDumpLogFormat(StoreEntry * entry, const char *name, logformat * definitions);
150 extern void accessLogFreeLogFormat(logformat_token ** fmt);
151
152 #endif /* SQUID_HTTPACCESSLOGENTRY_H */