]> git.ipfire.org Git - thirdparty/squid.git/blame - src/HttpHdrSc.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / HttpHdrSc.h
CommitLineData
7ede6971 1/*
77b1029d 2 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
7ede6971 3 *
bbc27441
AJ
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.
7ede6971 7 */
8
9#ifndef SQUID_HTTPHDRSURROGATECONTROL_H
10#define SQUID_HTTPHDRSURROGATECONTROL_H
11
b56ab9e7 12#include "dlink.h"
1da82544 13#include "mem/forward.h"
b56ab9e7 14#include "SquidString.h"
7ede6971 15
b56ab9e7 16class HttpHdrScTarget;
b56ab9e7 17class Packable;
1da82544 18class StatHist;
b56ab9e7
FC
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;
582c2af2 29
7ede6971 30/* http surogate control header field */
7ede6971 31class HttpHdrSc
32{
741c2986 33 MEMPROXY_CLASS(HttpHdrSc);
7ede6971 34
35public:
45a58345
FC
36 HttpHdrSc(const HttpHdrSc &);
37 HttpHdrSc() {}
38 ~HttpHdrSc();
39
40 bool parse(const String *str);
17802cf1 41 void packInto(Packable * p) const;
45a58345
FC
42 void updateStats(StatHist *) const;
43 HttpHdrScTarget * getMergedTarget (const char *ourtarget); //todo: make const?
44 void setMaxAge(char const *target, int max_age);
b56ab9e7
FC
45 void addTarget(HttpHdrScTarget *t);
46 void addTargetAtTail(HttpHdrScTarget *t);
45a58345 47
7ede6971 48 dlink_list targets;
45a58345
FC
49private:
50 HttpHdrScTarget * findTarget (const char *target);
51
7ede6971 52};
53
7ede6971 54/* Http Surrogate Control Header Field */
8a648e8d
FC
55void httpHdrScStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
56void httpHdrScInitModule (void);
8a648e8d
FC
57HttpHdrSc *httpHdrScParseCreate(String const &);
58void httpHdrScSetMaxAge(HttpHdrSc *, char const *, int);
7ede6971 59
60#endif /* SQUID_HTTPHDRSURROGATECONTROL_H */
f53969cc 61