]> git.ipfire.org Git - thirdparty/squid.git/blame_incremental - src/HttpHdrSc.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / HttpHdrSc.h
... / ...
CommitLineData
1/*
2 * Copyright (C) 1996-2020 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 "dlink.h"
13#include "mem/forward.h"
14#include "SquidString.h"
15
16class HttpHdrScTarget;
17class Packable;
18class StatHist;
19class StoreEntry;
20
21typedef enum {
22 SC_NO_STORE,
23 SC_NO_STORE_REMOTE,
24 SC_MAX_AGE,
25 SC_CONTENT,
26 SC_OTHER,
27 SC_ENUM_END /* also used to mean "invalid" */
28} http_hdr_sc_type;
29
30/* http surogate control header field */
31class HttpHdrSc
32{
33 MEMPROXY_CLASS(HttpHdrSc);
34
35public:
36 HttpHdrSc(const HttpHdrSc &);
37 HttpHdrSc() {}
38 ~HttpHdrSc();
39
40 bool parse(const String *str);
41 void packInto(Packable * p) const;
42 void updateStats(StatHist *) const;
43 HttpHdrScTarget * getMergedTarget (const char *ourtarget); //todo: make const?
44 void setMaxAge(char const *target, int max_age);
45 void addTarget(HttpHdrScTarget *t);
46 void addTargetAtTail(HttpHdrScTarget *t);
47
48 dlink_list targets;
49private:
50 HttpHdrScTarget * findTarget (const char *target);
51
52};
53
54/* Http Surrogate Control Header Field */
55void httpHdrScStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
56void httpHdrScInitModule (void);
57HttpHdrSc *httpHdrScParseCreate(String const &);
58void httpHdrScSetMaxAge(HttpHdrSc *, char const *, int);
59
60#endif /* SQUID_HTTPHDRSURROGATECONTROL_H */
61