"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/managers/plugin_manager.cc" between
snort3-3.1.29.0.tar.gz and snort3-3.1.30.0.tar.gz

About: Snort 3 is a network intrusion prevention and detection system (IDS/IPS) combining the benefits of signature, protocol and anomaly-based inspection.

plugin_manager.cc  (snort3-3.1.29.0):plugin_manager.cc  (snort3-3.1.30.0)
skipping to change at line 41 skipping to change at line 41
#include "framework/codec.h" #include "framework/codec.h"
#include "framework/connector.h" #include "framework/connector.h"
#include "framework/logger.h" #include "framework/logger.h"
#include "framework/mpse.h" #include "framework/mpse.h"
#include "framework/policy_selector.h" #include "framework/policy_selector.h"
#include "helpers/directory.h" #include "helpers/directory.h"
#include "helpers/markup.h" #include "helpers/markup.h"
#include "log/messages.h" #include "log/messages.h"
#include "main/snort_config.h" #include "main/snort_config.h"
#ifdef PIGLET
#include "piglet/piglet_api.h"
#include "piglet/piglet_manager.h"
#endif
#include "action_manager.h" #include "action_manager.h"
#include "codec_manager.h" #include "codec_manager.h"
#include "connector_manager.h" #include "connector_manager.h"
#include "event_manager.h" #include "event_manager.h"
#include "inspector_manager.h" #include "inspector_manager.h"
#include "ips_manager.h" #include "ips_manager.h"
#include "module_manager.h" #include "module_manager.h"
#include "mpse_manager.h" #include "mpse_manager.h"
#include "policy_selector_manager.h" #include "policy_selector_manager.h"
#include "script_manager.h" #include "script_manager.h"
skipping to change at line 84 skipping to change at line 79
{ {
{ "codec", CDAPI_VERSION, sizeof(CodecApi) }, { "codec", CDAPI_VERSION, sizeof(CodecApi) },
{ "inspector", INSAPI_VERSION, sizeof(InspectApi) }, { "inspector", INSAPI_VERSION, sizeof(InspectApi) },
{ "ips_action", ACTAPI_VERSION, sizeof(ActionApi) }, { "ips_action", ACTAPI_VERSION, sizeof(ActionApi) },
{ "ips_option", IPSAPI_VERSION, sizeof(IpsApi) }, { "ips_option", IPSAPI_VERSION, sizeof(IpsApi) },
{ "search_engine", SEAPI_VERSION, sizeof(MpseApi) }, { "search_engine", SEAPI_VERSION, sizeof(MpseApi) },
{ "so_rule", SOAPI_VERSION, sizeof(SoApi) }, { "so_rule", SOAPI_VERSION, sizeof(SoApi) },
{ "logger", LOGAPI_VERSION, sizeof(LogApi) }, { "logger", LOGAPI_VERSION, sizeof(LogApi) },
{ "connector", CONNECTOR_API_VERSION, sizeof(ConnectorApi) }, { "connector", CONNECTOR_API_VERSION, sizeof(ConnectorApi) },
{ "policy_selector", POLICY_SELECTOR_API_VERSION, sizeof(PolicySelectorApi) }, { "policy_selector", POLICY_SELECTOR_API_VERSION, sizeof(PolicySelectorApi) },
#ifdef PIGLET
{ "piglet", PIGLET_API_VERSION, sizeof(Piglet::Api) }
#endif
}; };
#else #else
// this gets around the sequence issue with some compilers // this gets around the sequence issue with some compilers
// but does not fail if we are missing an entry :( // but does not fail if we are missing an entry :(
#define stringify(name) # name #define stringify(name) # name
static Symbol symbols[PT_MAX] = static Symbol symbols[PT_MAX] =
{ {
[PT_CODEC] = { stringify(PT_CODEC), CDAPI_VERSION, sizeof(CodecApi) }, [PT_CODEC] = { stringify(PT_CODEC), CDAPI_VERSION, sizeof(CodecApi) },
[PT_INSPECTOR] = { stringify(PT_INSPECTOR), INSAPI_VERSION, sizeof(InspectAp i) }, [PT_INSPECTOR] = { stringify(PT_INSPECTOR), INSAPI_VERSION, sizeof(InspectAp i) },
[PT_IPS_ACTION] = { stringify(PT_IPS_ACTION), ACTAPI_VERSION, sizeof(ActionA pi) }, [PT_IPS_ACTION] = { stringify(PT_IPS_ACTION), ACTAPI_VERSION, sizeof(ActionA pi) },
skipping to change at line 342 skipping to change at line 334
break; break;
case PT_CONNECTOR: case PT_CONNECTOR:
ConnectorManager::add_plugin((const ConnectorApi*)p.api); ConnectorManager::add_plugin((const ConnectorApi*)p.api);
break; break;
case PT_POLICY_SELECTOR: case PT_POLICY_SELECTOR:
PolicySelectorManager::add_plugin((const PolicySelectorApi*)p.api); PolicySelectorManager::add_plugin((const PolicySelectorApi*)p.api);
break; break;
#ifdef PIGLET
case PT_PIGLET:
Piglet::Manager::add_plugin((const Piglet::Api*)p.api);
break;
#endif
default: default:
assert(false); assert(false);
break; break;
} }
} }
static void load_plugins(const std::string& paths, SnortConfig* sc = nullptr) static void load_plugins(const std::string& paths, SnortConfig* sc = nullptr)
{ {
struct stat sb; struct stat sb;
stringstream paths_stream(paths); stringstream paths_stream(paths);
skipping to change at line 529 skipping to change at line 515
set_key(key, symbols+type, name); set_key(key, symbols+type, name);
auto it = s_plugins.plug_map.find(key); auto it = s_plugins.plug_map.find(key);
if ( it != s_plugins.plug_map.end() ) if ( it != s_plugins.plug_map.end() )
return it->second.api; return it->second.api;
return nullptr; return nullptr;
} }
#ifdef PIGLET
PlugType PluginManager::get_type_from_name(const std::string& name)
{
for ( auto it = s_plugins.plug_map.begin(); it != s_plugins.plug_map.end();
++it )
{
const auto* api = it->second.api;
if ( name == api->name )
return api->type;
}
return PT_MAX;
}
#endif
void PluginManager::instantiate( void PluginManager::instantiate(
const BaseApi* api, Module* mod, SnortConfig* sc) const BaseApi* api, Module* mod, SnortConfig* sc)
{ {
switch ( api->type ) switch ( api->type )
{ {
case PT_CODEC: case PT_CODEC:
CodecManager::instantiate((const CodecApi*)api, mod, sc); CodecManager::instantiate((const CodecApi*)api, mod, sc);
break; break;
case PT_INSPECTOR: case PT_INSPECTOR:
 End of changes. 4 change blocks. 
30 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)