]> git.ipfire.org Git - thirdparty/squid.git/blame - src/HttpHdrSc.h
Maintenance: automate header guards 2/3 (#1655)
[thirdparty/squid.git] / src / HttpHdrSc.h
CommitLineData
7ede6971 1/*
b8ae064d 2 * Copyright (C) 1996-2023 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
ff9d9458
FC
9#ifndef SQUID_SRC_HTTPHDRSC_H
10#define SQUID_SRC_HTTPHDRSC_H
7ede6971 11
24673a9e
AJ
12#include "http/forward.h"
13#include "HttpHdrScTarget.h"
8b082ed9 14#include "mem/PoolingAllocator.h"
b56ab9e7 15#include "SquidString.h"
7ede6971 16
24673a9e
AJ
17#include <list>
18
b56ab9e7 19class Packable;
1da82544 20class StatHist;
b56ab9e7
FC
21class StoreEntry;
22
7ede6971 23/* http surogate control header field */
7ede6971 24class HttpHdrSc
25{
741c2986 26 MEMPROXY_CLASS(HttpHdrSc);
7ede6971 27
28public:
45a58345 29 bool parse(const String *str);
17802cf1 30 void packInto(Packable * p) const;
45a58345 31 void updateStats(StatHist *) const;
9837567d 32 HttpHdrScTarget * getMergedTarget(const char *ourtarget); // TODO: make const?
45a58345 33 void setMaxAge(char const *target, int max_age);
45a58345 34
45a58345
FC
35private:
36 HttpHdrScTarget * findTarget (const char *target);
37
24673a9e 38 std::list<HttpHdrScTarget, PoolingAllocator<HttpHdrScTarget>> targets;
7ede6971 39};
40
7ede6971 41/* Http Surrogate Control Header Field */
8a648e8d
FC
42void httpHdrScStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
43void httpHdrScInitModule (void);
8a648e8d
FC
44HttpHdrSc *httpHdrScParseCreate(String const &);
45void httpHdrScSetMaxAge(HttpHdrSc *, char const *, int);
7ede6971 46
8b082ed9 47http_hdr_sc_type &operator++(http_hdr_sc_type &);
ff9d9458 48#endif /* SQUID_SRC_HTTPHDRSC_H */
f53969cc 49