]> git.ipfire.org Git - thirdparty/squid.git/blob - src/AccessLogEntry.h
f211d6de367025fc6127c6014e728d9d7e9cca4e
[thirdparty/squid.git] / src / AccessLogEntry.h
1
2 /*
3 * $Id: AccessLogEntry.h,v 1.9 2008/02/26 00:15:48 rousskov Exp $
4 *
5 *
6 * SQUID Web Proxy Cache http://www.squid-cache.org/
7 * ----------------------------------------------------------
8 *
9 * Squid is the result of efforts by numerous individuals from
10 * the Internet community; see the CONTRIBUTORS file for full
11 * details. Many organizations have provided support for Squid's
12 * development; see the SPONSORS file for full details. Squid is
13 * Copyrighted (C) 2001 by the Regents of the University of
14 * California; see the COPYRIGHT file for full details. Squid
15 * incorporates software developed and/or copyrighted by other
16 * sources; see the CREDITS file for full details.
17 *
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
22 *
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
27 *
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
31 *
32 * Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
33 */
34
35 #ifndef SQUID_HTTPACCESSLOGENTRY_H
36 #define SQUID_HTTPACCESSLOGENTRY_H
37
38 #include "HttpVersion.h"
39 #include "HttpRequestMethod.h"
40 #include "HierarchyLogEntry.h"
41 #include "IPAddress.h"
42
43 /* forward decls */
44
45 class CacheManager;
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 class Private
131 {
132
133 public:
134 Private() : method_str(NULL) {}
135
136 const char *method_str;
137 }
138
139 _private;
140 HierarchyLogEntry hier;
141 HttpReply *reply;
142 HttpRequest *request;
143 };
144
145 /* Should be in 'AccessLog.h' as the driver */
146 extern void accessLogLog(AccessLogEntry *, ACLChecklist * checklist);
147 extern void accessLogRotate(void);
148 extern void accessLogClose(void);
149 extern void accessLogInit(void);
150 extern void accessLogRegisterWithCacheManager(CacheManager & manager);
151 extern void accessLogFreeMemory(AccessLogEntry * aLogEntry);
152 extern const char *accessLogTime(time_t);
153 extern int accessLogParseLogFormat(logformat_token ** fmt, char *def);
154 extern void accessLogDumpLogFormat(StoreEntry * entry, const char *name, logformat * definitions);
155 extern void accessLogFreeLogFormat(logformat_token ** fmt);
156
157 #endif /* SQUID_HTTPACCESSLOGENTRY_H */