]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/CacheManager.h
2c6add797c1454c08b7e0836ffa0490b9fa45f04
2 * Copyright (C) 1996-2025 The Squid Software Foundation and contributors
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.
9 #ifndef SQUID_SRC_CACHEMANAGER_H
10 #define SQUID_SRC_CACHEMANAGER_H
12 #include "anyp/forward.h"
13 #include "comm/forward.h"
14 #include "log/forward.h"
15 #include "mgr/Action.h"
16 #include "mgr/ActionProfile.h"
17 #include "mgr/Command.h"
18 #include "mgr/forward.h"
26 * a CacheManager - the menu system for interacting with squid.
27 * This is currently just an adapter to the global cachemgr* routines to
28 * provide looser coupling between modules, but once fully transitioned,
29 * an instance of this class will represent a single independent manager.
30 * TODO: update documentation to reflect the new singleton model.
35 typedef std::vector
<Mgr::ActionProfilePointer
> Menu
;
37 /// initial URL path characters that identify cache manager requests
38 static const SBuf
&WellKnownUrlPathPrefix();
40 /// remembers the given profile while ignoring attempts to register a same-name duplicate
41 void registerProfile(const Mgr::ActionProfilePointer
&);
43 Mgr::ActionProfilePointer
findAction(char const * action
) const;
44 Mgr::Action::Pointer
createNamedAction(const char *actionName
);
45 Mgr::Action::Pointer
createRequestedAction(const Mgr::ActionParams
&);
46 const Menu
& menu() const { return menu_
; }
48 void start(const Comm::ConnectionPointer
&client
, HttpRequest
*request
, StoreEntry
*entry
, const AccessLogEntryPointer
&ale
);
50 static CacheManager
* GetInstance();
51 const char *ActionProtection(const Mgr::ActionProfilePointer
&profile
);
53 /// Add HTTP response headers specific/common to all cache manager replies,
54 /// including cache manager errors and Action reports.
55 /// \param httpOrigin the value of Origin header in the trigger HTTP request (or nil)
56 static void PutCommonResponseHeaders(HttpReply
&, const char *httpOrigin
);
59 CacheManager() {} ///< use Instance() instead
61 Mgr::CommandPointer
ParseUrl(const AnyP::Uri
&);
62 void ParseHeaders(const HttpRequest
* request
, Mgr::ActionParams
¶ms
);
63 int CheckPassword(const Mgr::Command
&cmd
);
64 char *PasswdGet(Mgr::ActionPasswordList
*, const char *);
69 #endif /* SQUID_SRC_CACHEMANAGER_H */