]>
Commit | Line | Data |
---|---|---|
450e0c10 | 1 | |
2 | /* | |
cc192b50 | 3 | * $Id: AccessLogEntry.h,v 1.7 2007/12/14 23:11:45 amosjeffries Exp $ |
450e0c10 | 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" | |
b24880fe | 39 | #include "HierarchyLogEntry.h" |
cc192b50 | 40 | #include "IPAddress.h" |
450e0c10 | 41 | |
62ee09ca | 42 | /* forward decls */ |
43 | ||
44 | class CacheManager; | |
45 | ||
450e0c10 | 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 | method_t method; | |
61 | int code; | |
62 | const char *content_type; | |
63 | HttpVersion version; | |
64 | } | |
65 | ||
66 | http; | |
67 | ||
68 | class ICPDetails | |
69 | { | |
70 | ||
71 | public: | |
72 | ICPDetails() : opcode(ICP_INVALID) {} | |
73 | ||
74 | icp_opcode opcode; | |
75 | } | |
76 | ||
77 | icp; | |
78 | ||
79 | class CacheDetails | |
80 | { | |
81 | ||
82 | public: | |
cc192b50 | 83 | CacheDetails() : caddr(), |
84 | size(0), | |
450e0c10 | 85 | highOffset(0), |
86 | objectSize(0), | |
87 | code (LOG_TAG_NONE), | |
88 | msec(0), | |
89 | rfc931 (NULL), | |
90 | authuser (NULL), | |
91 | extuser(NULL) | |
92 | #if USE_SSL | |
93 | ,ssluser(NULL) | |
94 | #endif | |
95 | { | |
cc192b50 | 96 | ; |
450e0c10 | 97 | } |
98 | ||
cc192b50 | 99 | IPAddress caddr; |
47f6e231 | 100 | int64_t size; |
101 | int64_t highOffset; | |
102 | int64_t objectSize; | |
450e0c10 | 103 | log_type code; |
104 | int msec; | |
105 | const char *rfc931; | |
106 | const char *authuser; | |
661ef4eb | 107 | const char *extuser; |
450e0c10 | 108 | #if USE_SSL |
109 | ||
110 | const char *ssluser; | |
111 | #endif | |
112 | ||
450e0c10 | 113 | } |
114 | ||
115 | cache; | |
116 | ||
117 | class Headers | |
118 | { | |
119 | ||
120 | public: | |
121 | Headers() : request(NULL), reply(NULL) {} | |
122 | ||
123 | char *request; | |
124 | char *reply; | |
125 | } | |
126 | ||
127 | headers; | |
128 | ||
129 | class Private | |
130 | { | |
131 | ||
132 | public: | |
133 | Private() : method_str(NULL) {} | |
134 | ||
135 | const char *method_str; | |
136 | } | |
137 | ||
138 | _private; | |
139 | HierarchyLogEntry hier; | |
140 | HttpReply *reply; | |
141 | HttpRequest *request; | |
142 | }; | |
143 | ||
144 | /* Should be in 'AccessLog.h' as the driver */ | |
62ee09ca | 145 | extern void accessLogLog(AccessLogEntry *, ACLChecklist * checklist); |
146 | extern void accessLogRotate(void); | |
147 | extern void accessLogClose(void); | |
148 | extern void accessLogInit(void); | |
149 | extern void accessLogRegisterWithCacheManager(CacheManager & manager); | |
150 | extern void accessLogFreeMemory(AccessLogEntry * aLogEntry); | |
151 | extern const char *accessLogTime(time_t); | |
152 | extern int accessLogParseLogFormat(logformat_token ** fmt, char *def); | |
153 | extern void accessLogDumpLogFormat(StoreEntry * entry, const char *name, logformat * definitions); | |
154 | extern void accessLogFreeLogFormat(logformat_token ** fmt); | |
450e0c10 | 155 | |
156 | #endif /* SQUID_HTTPACCESSLOGENTRY_H */ |