]> 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 CacheManager;
44 class HttpReply;
45 class HttpRequest;
46
47 class AccessLogEntry
48 {
49
50 public:
51 AccessLogEntry() : url(NULL) , reply(NULL), request(NULL) {}
52
53 const char *url;
54
55 class HttpDetails
56 {
57
58 public:
59 HttpDetails() : method(METHOD_NONE), code(0), content_type(NULL) {}
60
61 HttpRequestMethod method;
62 int code;
63 const char *content_type;
64 HttpVersion version;
65 }
66
67 http;
68
69 class ICPDetails
70 {
71
72 public:
73 ICPDetails() : opcode(ICP_INVALID) {}
74
75 icp_opcode opcode;
76 }
77
78 icp;
79
80 class CacheDetails
81 {
82
83 public:
84 CacheDetails() : caddr(),
85 size(0),
86 highOffset(0),
87 objectSize(0),
88 code (LOG_TAG_NONE),
89 msec(0),
90 rfc931 (NULL),
91 authuser (NULL),
92 extuser(NULL)
93 #if USE_SSL
94 ,ssluser(NULL)
95 #endif
96 {
97 ;
98 }
99
100 IPAddress caddr;
101 int64_t size;
102 int64_t highOffset;
103 int64_t objectSize;
104 log_type code;
105 int msec;
106 const char *rfc931;
107 const char *authuser;
108 const char *extuser;
109 #if USE_SSL
110
111 const char *ssluser;
112 #endif
113
114 }
115
116 cache;
117
118 class Headers
119 {
120
121 public:
122 Headers() : request(NULL), reply(NULL) {}
123
124 char *request;
125 char *reply;
126 }
127
128 headers;
129
130 // Why is this a sub-class and not a set of real "private:" fields?
131 // It looks like its duplicating HTTPRequestMethod anyway!
132 class Private
133 {
134
135 public:
136 Private() : method_str(NULL) {}
137
138 const char *method_str;
139 }
140
141 _private;
142 HierarchyLogEntry hier;
143 HttpReply *reply;
144 HttpRequest *request;
145 };
146
147 class ACLChecklist;
148 class StoreEntry;
149 class logformat_token;
150
151 /* Should be in 'AccessLog.h' as the driver */
152 extern void accessLogLog(AccessLogEntry *, ACLChecklist * checklist);
153 extern void accessLogRotate(void);
154 extern void accessLogClose(void);
155 extern void accessLogInit(void);
156 extern void accessLogRegisterWithCacheManager(CacheManager & manager);
157 extern void accessLogFreeMemory(AccessLogEntry * aLogEntry);
158 extern const char *accessLogTime(time_t);
159 extern int accessLogParseLogFormat(logformat_token ** fmt, char *def);
160 extern void accessLogDumpLogFormat(StoreEntry * entry, const char *name, logformat * definitions);
161 extern void accessLogFreeLogFormat(logformat_token ** fmt);
162
163 #endif /* SQUID_HTTPACCESSLOGENTRY_H */