diff --git a/scripts/policy/frameworks/files/entropy.bro b/scripts/policy/frameworks/files/entropy-test-all-files.bro similarity index 71% rename from scripts/policy/frameworks/files/entropy.bro rename to scripts/policy/frameworks/files/entropy-test-all-files.bro index 89dcead7d6..fd02b9ecaa 100644 --- a/scripts/policy/frameworks/files/entropy.bro +++ b/scripts/policy/frameworks/files/entropy-test-all-files.bro @@ -3,7 +3,8 @@ module Files; export { redef record Files::Info += { - ## The information density of the contents of the file, expressed as a number of bits per character. + ## The information density of the contents of the file, + ## expressed as a number of bits per character. entropy: double &log &optional; }; } diff --git a/src/file_analysis/analyzer/entropy/Plugin.cc b/src/file_analysis/analyzer/entropy/Plugin.cc index 3eeae62480..f1dd954cba 100644 --- a/src/file_analysis/analyzer/entropy/Plugin.cc +++ b/src/file_analysis/analyzer/entropy/Plugin.cc @@ -1,29 +1,24 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" -#include "file_analysis/Component.h" #include "Entropy.h" -namespace plugin { namespace Bro_FileEntropy { +namespace plugin { +namespace Bro_FileEntropy { class Plugin : public plugin::Plugin { -protected: - void InitPreScript() +public: + plugin::Configuration Configure() { - SetName("Bro::FileEntropy"); - SetVersion(-1); - SetAPIVersion(BRO_PLUGIN_API_VERSION); - SetDynamicPlugin(false); + AddComponent(new ::file_analysis::Component("ENTROPY", ::file_analysis::Entropy::Instantiate)); - SetDescription("Entropy test file content"); - - AddComponent(new ::file_analysis::Component("ENTROPY", - ::file_analysis::Entropy::Instantiate)); - - extern std::list > __bif_events_init(); - AddBifInitFunction(&__bif_events_init); + plugin::Configuration config; + config.name = "Bro::FileEntropy"; + config.description = "Entropy test file content"; + return config; } -}; +} plugin; -Plugin __plugin; - -} } +} +}