mirror of
https://github.com/openappsec/openappsec.git
synced 2025-10-02 04:27:43 +03:00
My 11th 2023 update
This commit is contained in:
36
components/security_apps/ips/include/ips_configuration.h
Normal file
36
components/security_apps/ips/include/ips_configuration.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef __IPS_CONFIGURATION_H__
|
||||
#define __IPS_CONFIGURATION_H__
|
||||
|
||||
#include "config.h"
|
||||
|
||||
class IPSConfiguration
|
||||
{
|
||||
public:
|
||||
enum class ContextType { NORMAL, KEEP, HISTORY };
|
||||
|
||||
class Context {
|
||||
public:
|
||||
Context() : type(ContextType::NORMAL), history_size(0) {}
|
||||
Context(ContextType type, uint history);
|
||||
|
||||
ContextType getType() const { return type; }
|
||||
uint getHistorySize() const;
|
||||
|
||||
private:
|
||||
ContextType type;
|
||||
uint history_size;
|
||||
};
|
||||
|
||||
IPSConfiguration() {}
|
||||
IPSConfiguration(const std::map<std::string, Context> &initial_conf) : context_config(initial_conf) {}
|
||||
|
||||
void load(cereal::JSONInputArchive &ar);
|
||||
|
||||
Context getContext(const std::string &name) const;
|
||||
uint getHistorySize(const std::string &name) const;
|
||||
|
||||
private:
|
||||
std::map<std::string, Context> context_config;
|
||||
};
|
||||
|
||||
#endif // __IPS_CONFIGURATION_H__
|
Reference in New Issue
Block a user