Adds whoAmI method to ModSecurity class

The method returns information about the ModSecurity's version and the platform
that it was compiled. Further it will be used by the audit logs and by the
connectors. msc_who_am_i was added accordingly, to the C api.
This commit is contained in:
Felipe Zimmerle
2015-07-09 11:17:34 -03:00
parent aa8dc9115b
commit 8dab5ac30c
3 changed files with 115 additions and 5 deletions

View File

@@ -76,6 +76,7 @@
#ifdef __cplusplus
#include <ctime>
#include <iostream>
#include <string>
#endif
@@ -94,14 +95,14 @@ typedef struct ModSecurity_t ModSecurity;
#include "modsecurity/rules.h"
#define MODSECURITY_MAJOR "3"
#define MODSECURITY_MINOR "0"
#define MODSECURITY_PATCHLEVEL "0"
#define MODSECURITY_TAG "-alpha"
#define MODSECURITY_VERSION MODSECURITY_MAJOR "." \
MODSECURITY_MINOR "." MODSECURITY_PATCHLEVEL
MODSECURITY_MINOR "." MODSECURITY_PATCHLEVEL \
MODSECURITY_TAG
#ifdef __cplusplus
@@ -122,6 +123,8 @@ class ModSecurity {
ModSecurity();
~ModSecurity() { }
static std::string whoAmI();
/**
*
* The Phases enumerator consists in mapping the different stages of a
@@ -208,6 +211,8 @@ extern "C" {
/** @ingroup ModSecurity_C_API */
ModSecurity *msc_init();
/** @ingroup ModSecurity_C_API */
const char *msc_who_am_i(ModSecurity *msc);
#ifdef __cplusplus
}