]> git.ipfire.org Git - thirdparty/squid.git/blob - src/HttpHdrSc.h
Merged from trunk rev.14126
[thirdparty/squid.git] / src / HttpHdrSc.h
1 /*
2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 #ifndef SQUID_HTTPHDRSURROGATECONTROL_H
10 #define SQUID_HTTPHDRSURROGATECONTROL_H
11
12 #include "HttpHdrScTarget.h"
13
14 class StatHist;
15
16 /* http surogate control header field */
17
18 class HttpHdrSc
19 {
20 MEMPROXY_CLASS(HttpHdrSc);
21
22 public:
23 HttpHdrSc(const HttpHdrSc &);
24 HttpHdrSc() {}
25 ~HttpHdrSc();
26
27 bool parse(const String *str);
28 void packInto(Packable * p) const;
29 void updateStats(StatHist *) const;
30 HttpHdrScTarget * getMergedTarget (const char *ourtarget); //todo: make const?
31 void setMaxAge(char const *target, int max_age);
32 void addTarget(HttpHdrScTarget *t) {
33 dlinkAdd(t, &t->node, &targets);
34 }
35 void addTargetAtTail(HttpHdrScTarget *t) {
36 dlinkAddTail (t, &t->node, &targets);
37 }
38
39 dlink_list targets;
40 private:
41 HttpHdrScTarget * findTarget (const char *target);
42
43 };
44
45 /* Http Surrogate Control Header Field */
46 void httpHdrScStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
47 void httpHdrScInitModule (void);
48 void httpHdrScCleanModule (void);
49 HttpHdrSc *httpHdrScParseCreate(String const &);
50 void httpHdrScSetMaxAge(HttpHdrSc *, char const *, int);
51
52 #endif /* SQUID_HTTPHDRSURROGATECONTROL_H */
53