context_storage.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 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_SRC_SSL_CONTEXT_STORAGE_H
10 #define SQUID_SRC_SSL_CONTEXT_STORAGE_H
11 
12 #if USE_OPENSSL
13 
14 #include "base/ClpMap.h"
15 #include "CacheManager.h"
16 #include "compat/openssl.h"
17 #include "ip/Address.h"
18 #include "mgr/Action.h"
19 #include "mgr/Command.h"
20 #include "security/Context.h"
21 #include "ssl/gadgets.h"
22 
23 #include <list>
24 #include <map>
25 #if HAVE_OPENSSL_SSL_H
26 #include <openssl/ssl.h>
27 #endif
28 
29 namespace Ssl
30 {
31 
36 {
37 public:
39  static Pointer Create(const Mgr::Command::Pointer &cmd);
40  void dump (StoreEntry *sentry) override;
45  bool aggregatable() const override { return false; }
46 };
47 
49  return 1024; // TODO: Calculate approximate memory usage by the context.
50 }
52 
55 {
57 public:
61  void addLocalStorage(Ip::Address const & address, size_t size_of_store);
65  void reconfigureStart();
66 private:
68  void reconfigureFinish();
70  std::map<Ip::Address, size_t> configureStorage;
73  std::map<Ip::Address, LocalContextStorage *> storage;
74 };
75 
78 } //namespace Ssl
79 #endif // USE_OPENSSL
80 
81 #endif /* SQUID_SRC_SSL_CONTEXT_STORAGE_H */
82 
uint64_t MemoryUsedByContext(const Security::ContextPointer &)
std::shared_ptr< SSL_CTX > ContextPointer
Definition: Context.h:29
const CommandPointer cmd
the command that caused this action
Definition: Action.h:90
std::map< Ip::Address, size_t > configureStorage
Storage used on configure or reconfigure.
void dump(StoreEntry *sentry) override
CertificateStorageAction(const Mgr::Command::Pointer &cmd)
LocalContextStorage * getLocalStorage(Ip::Address const &address)
Return the local storage for the given listening address/port.
Definition: ClpMap.h:40
Definition: Xaction.cc:39
bool aggregatable() const override
void reconfigureFinish()
Called by getLocalStorage method.
GlobalContextStorage TheGlobalContextStorage
Global cache for store all SSL server certificates.
void reconfigureStart()
When reconfigring should be called this method.
static Pointer Create(const Mgr::Command::Pointer &cmd)
void addLocalStorage(Ip::Address const &address, size_t size_of_store)
Create new SSL context storage for the local listening address/port.
std::map< Ip::Address, LocalContextStorage * > storage
Map for storing all local ip address and their local storages.
Class for storing/manipulating LocalContextStorage per local listening address/port.

 

Introduction

Documentation

Support

Miscellaneous