mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Refactoring: new structure for logging alerts
Disruptive actions were moved to actions::disruptive namespace
This commit is contained in:
@@ -23,11 +23,47 @@ namespace modsecurity {
|
||||
typedef struct ModSecurityIntervention_t {
|
||||
int status;
|
||||
int pause;
|
||||
const char *url;
|
||||
const char *log;
|
||||
char *url;
|
||||
char *log;
|
||||
int disruptive;
|
||||
} ModSecurityIntervention;
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace intervention {
|
||||
static void reset(ModSecurityIntervention_t *i) {
|
||||
i->status = 200;
|
||||
i->pause = 0;
|
||||
i->disruptive = 0;
|
||||
}
|
||||
|
||||
static void clean(ModSecurityIntervention_t *i) {
|
||||
i->url = NULL;
|
||||
i->log = NULL;
|
||||
reset(i);
|
||||
}
|
||||
|
||||
static void freeUrl(ModSecurityIntervention_t *i) {
|
||||
if (i->url) {
|
||||
free(i->url);
|
||||
i->url = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void freeLog(ModSecurityIntervention_t *i) {
|
||||
if (i->log) {
|
||||
free(i->log);
|
||||
i->log = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void free(ModSecurityIntervention_t *i) {
|
||||
freeUrl(i);
|
||||
freeLog(i);
|
||||
}
|
||||
|
||||
} // namespace modsecurity
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // namespace modsecurity
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user