Updates of the dynamic plugin code.

Includes:

    - Cleanup of the plugin API, in particular generally changing
      const char* to std::string

    - Renaming environment variable BRO_PLUGINS to BRO_PLUGIN_PATH,
      defaulting to <prefix>/lib/bro/plugins

    - Reworking how dynamic plugins are searched and activated. See
      doc/devel/plugins.rst for details.

    - New @load-plugin directive to explicitly activate a plugin

    - Support for Darwin. (Linux untested right now)

    - The init-plugin updates come with support for "make test", "make
      sdist", and "make bdist" (see how-to).

    - Test updates.

Notes: The new hook mechanism, which allows plugins to hook into Bro's
core a well-defined points, is still essentially untested.
This commit is contained in:
Robin Sommer 2013-12-16 10:08:38 -08:00
parent 987452beff
commit a80dd10215
18 changed files with 257 additions and 143 deletions

View file

@ -664,6 +664,13 @@ string strreplace(const string& s, const string& o, const string& n)
return r;
}
std::string strstrip(std::string s)
{
s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
return s;
}
int hmac_key_set = 0;
uint8 shared_hmac_md5_key[16];
@ -942,7 +949,7 @@ const char* bro_magic_path()
const char* bro_plugin_path()
{
const char* path = getenv("BRO_PLUGINS");
const char* path = getenv("BRO_PLUGIN_PATH");
if ( ! path )
path = BRO_PLUGIN_INSTALL_PATH;