]> git.ipfire.org Git - thirdparty/squid.git/blame - src/AccessLogEntry.h
Author: wessels & Christos Tsantilas
[thirdparty/squid.git] / src / AccessLogEntry.h
CommitLineData
450e0c10 1
2/*
47f6e231 3 * $Id: AccessLogEntry.h,v 1.6 2007/08/13 17:20:51 hno 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"
450e0c10 40
62ee09ca 41/* forward decls */
42
43class CacheManager;
44
450e0c10 45class AccessLogEntry
46{
47
48public:
49 AccessLogEntry() : url(NULL) , reply(NULL), request(NULL) {}
50
51 const char *url;
52
53 class HttpDetails
54 {
55
56 public:
57 HttpDetails() : method(METHOD_NONE), code(0), content_type(NULL) {}
58
59 method_t method;
60 int code;
61 const char *content_type;
62 HttpVersion version;
63 }
64
65 http;
66
67 class ICPDetails
68 {
69
70 public:
71 ICPDetails() : opcode(ICP_INVALID) {}
72
73 icp_opcode opcode;
74 }
75
76 icp;
77
78 class CacheDetails
79 {
80
81 public:
82 CacheDetails() : size(0),
83 highOffset(0),
84 objectSize(0),
85 code (LOG_TAG_NONE),
86 msec(0),
87 rfc931 (NULL),
88 authuser (NULL),
89 extuser(NULL)
90#if USE_SSL
91 ,ssluser(NULL)
92#endif
93 {
94 memset(&caddr, '\0', sizeof(caddr));
95 }
96
ddfcbc22 97 struct IN_ADDR caddr;
47f6e231 98 int64_t size;
99 int64_t highOffset;
100 int64_t objectSize;
450e0c10 101 log_type code;
102 int msec;
103 const char *rfc931;
104 const char *authuser;
661ef4eb 105 const char *extuser;
450e0c10 106#if USE_SSL
107
108 const char *ssluser;
109#endif
110
450e0c10 111 }
112
113 cache;
114
115 class Headers
116 {
117
118 public:
119 Headers() : request(NULL), reply(NULL) {}
120
121 char *request;
122 char *reply;
123 }
124
125 headers;
126
127 class Private
128 {
129
130 public:
131 Private() : method_str(NULL) {}
132
133 const char *method_str;
134 }
135
136 _private;
137 HierarchyLogEntry hier;
138 HttpReply *reply;
139 HttpRequest *request;
140};
141
142/* Should be in 'AccessLog.h' as the driver */
62ee09ca 143extern void accessLogLog(AccessLogEntry *, ACLChecklist * checklist);
144extern void accessLogRotate(void);
145extern void accessLogClose(void);
146extern void accessLogInit(void);
147extern void accessLogRegisterWithCacheManager(CacheManager & manager);
148extern void accessLogFreeMemory(AccessLogEntry * aLogEntry);
149extern const char *accessLogTime(time_t);
150extern int accessLogParseLogFormat(logformat_token ** fmt, char *def);
151extern void accessLogDumpLogFormat(StoreEntry * entry, const char *name, logformat * definitions);
152extern void accessLogFreeLogFormat(logformat_token ** fmt);
450e0c10 153
154#endif /* SQUID_HTTPACCESSLOGENTRY_H */