#include "../cd_geneve.cc"
#include "utils/endian.h"
+#include "main/thread_config.h"
#include <CppUTest/CommandLineTestRunner.h>
#include <CppUTest/TestHarness.h>
bool TextLog_Print(TextLog* const, const char*, ...) { return false; }
void Codec::codec_event(const CodecData&, CodecSid) { }
bool SnortConfig::tunnel_bypass_enabled(unsigned short) const { return false; }
+ unsigned get_instance_id()
+ { return 0; }
+ unsigned ThreadConfig::get_instance_max() { return 1; }
}
// Geneve data with 2 variable options.
#endif
#include "connectors/file_connector/file_connector_module.h"
+#include "main/thread_config.h"
#include "profiler/profiler.h"
#include <CppUTest/CommandLineTestRunner.h>
using namespace snort;
+
THREAD_LOCAL SimpleStats file_connector_stats;
THREAD_LOCAL ProfileStats file_connector_perfstats;
{
char* snort_strdup(const char* s)
{ return strdup(s); }
+unsigned get_instance_id()
+{ return 0; }
+unsigned ThreadConfig::get_instance_max() { return 1; }
}
TEST_GROUP(file_connector_module)
#include "connectors/file_connector/file_connector.h"
#include "connectors/file_connector/file_connector_module.h"
+#include "main/thread_config.h"
#include <CppUTest/CommandLineTestRunner.h>
#include <CppUTest/TestHarness.h>
using namespace snort;
+
extern const BaseApi* file_connector;
const ConnectorApi* fc_api = nullptr;
{
const char* get_instance_file(std::string& file, const char* name)
{ file += name; return nullptr; }
+unsigned get_instance_id()
+{ return 0; }
+unsigned ThreadConfig::get_instance_max() { return 1; }
}
FileConnectorModule::FileConnectorModule() :
#endif
#include "connectors/tcp_connector/tcp_connector_module.h"
+#include "main/thread_config.h"
#include "profiler/profiler.h"
#include <CppUTest/CommandLineTestRunner.h>
using namespace snort;
+
THREAD_LOCAL SimpleStats tcp_connector_stats;
THREAD_LOCAL ProfileStats tcp_connector_perfstats;
{
char* snort_strdup(const char* s)
{ return strdup(s); }
+
+unsigned get_instance_id()
+{ return 0; }
+unsigned ThreadConfig::get_instance_max() { return 1; }
}
TEST_GROUP(tcp_connector_module)
#include <sys/socket.h>
#include <unistd.h>
+#include "main/thread_config.h"
+
#include <CppUTest/CommandLineTestRunner.h>
#include <CppUTest/TestHarness.h>
{
unsigned get_instance_id()
{ return s_instance; }
+unsigned ThreadConfig::get_instance_max() { return 1; }
void ErrorMessage(const char*, ...) { }
void LogMessage(const char*, ...) { }
const SnortConfig* sc = SnortConfig::get_conf();
for ( auto* req : idle )
+ {
+ ModuleManager::add_thread_stats_entry("search_engine");
+ ModuleManager::add_thread_stats_entry("detection");
req->thread = new std::thread(worker, req, sc, i++);
+ }
}
ThreadRegexOffload::~ThreadRegexOffload()
#include "flow/ha.h"
#include "flow/session.h"
#include "main/analyzer.h"
+#include "main/thread_config.h"
#include "managers/inspector_manager.h"
#include "packet_io/active.h"
#include "protocols/icmp4.h"
#endif
#include "module.h"
+#include "main/thread_config.h"
#include "trace/trace.h"
const PegInfo* q = get_pegs();
assert(q);
+ for ( unsigned thread_index = 0; thread_index < dump_stats_counts.size(); thread_index++)
+ {
+ for ( int i = 0; i < num_counts; i++ )
+ {
+ if ( q[i].type == CountType::NOW )
+ {
+ dump_stats_counts[thread_index][i] = 0;
+ counts[thread_index][i] = 0;
+ dump_stats_results[i] = 0;
+ }
+ }
+ }
+}
- for ( int i = 0; i < num_counts; i++ )
+void Module::main_accumulate_stats()
+{
+ const PegInfo* q = get_pegs();
+
+ if ( !q )
+ return;
+
+ if (!global_stats())
{
- if ( q[i].type == CountType::NOW )
- counts[i] = 0;
+ for ( int i = 0; i < num_counts; i++ )
+ {
+ for ( unsigned thread_index = 0; thread_index < dump_stats_counts.size(); thread_index++)
+ {
+ if ( q[i].type == CountType::SUM || q[i].type == CountType::NOW)
+ {
+ dump_stats_results[i] += dump_stats_counts[thread_index][i];
+ }
+ else if ( q[i].type == CountType::MAX)
+ {
+ if (dump_stats_counts[thread_index][i] > dump_stats_results[i])
+ dump_stats_results[i] = dump_stats_counts[thread_index][i];
+ }
+ }
+ }
}
}
+
void Module::sum_stats(bool dump_stats)
{
if ( num_counts < 0 )
+ {
+ init_stats();
reset_stats();
+ }
PegCount* p = get_counts();
const PegInfo* q = get_pegs();
return;
assert(q);
- if(dump_stats && !dump_stats_initialized)
+
+ unsigned instance_id = get_instance_id();
+ if (dump_stats and !dump_stats_initialized[instance_id])
{
- for (unsigned long i=0; i<counts.size(); i++)
- dump_stats_counts[i] = counts[i];
- dump_stats_initialized = true;
+ dump_stats_counts[instance_id] = counts[instance_id];
+ dump_stats_initialized[instance_id] = 1;
}
if ( global_stats() )
{
for ( int i = 0; i < num_counts; i++ )
- set_peg_count(i, p[i], dump_stats);
+ {
+ // we need each thread to update the same variable since it is global stats.
+ // we need the latest info updated by the last thread
+ if (dump_stats)
+ dump_stats_results[i] = p[i];
+ else
+ counts[0][i] = p[i];
+ }
}
else
{
case CountType::SUM:
add_peg_count(i, p[i], dump_stats);
- if(!dump_stats)
+ if (!dump_stats)
p[i] = 0;
break;
case CountType::NOW:
- if ( dump_stats )
+ if (dump_stats)
add_peg_count(i, p[i], dump_stats);
break;
{
if ( num_counts > 0 )
{
- ::show_stats(&dump_stats_counts[0], get_pegs(), num_counts, get_name());
- dump_stats_initialized = false;
+ ::show_stats(&dump_stats_results[0], get_pegs(), num_counts, get_name());
+ dump_stats_initialized.assign(dump_stats_initialized.size(), 0);
+ std::fill(dump_stats_results.begin(), dump_stats_results.end(), 0);
}
}
-void Module::reset_stats()
+void Module::init_stats(bool new_thread)
{
- PegCount* p = get_counts();
-
- if ( !p )
- return;
-
const PegInfo* pegs = get_pegs();
if ( !pegs )
while ( pegs[num_counts].name )
++num_counts;
+ }
+
+ unsigned number_of_threads = new_thread ? 1 : ThreadConfig::get_instance_max();
- counts.resize(num_counts);
- dump_stats_counts.resize(num_counts);
+ for ( unsigned thread_index = 0; thread_index < number_of_threads; thread_index++)
+ {
+ std::vector<PegCount> stats(num_counts);
+ std::vector<PegCount> dump_stats(num_counts);
+ counts.push_back(stats);
+ dump_stats_counts.push_back(dump_stats);
+ dump_stats_initialized.push_back(0);
}
+ dump_stats_results.resize(num_counts);
+}
+
+
+void Module::reset_stats()
+{
+ PegCount* p = get_counts();
+
+ if ( !p )
+ return;
+
+ const PegInfo* pegs = get_pegs();
+
+ if ( !pegs )
+ return;
+
for ( int i = 0; i < num_counts; i++ )
{
- counts[i] = 0;
- dump_stats_counts[i] = 0;
+ counts[get_instance_id()][i] = 0;
+ dump_stats_counts[get_instance_id()][i] = 0;
if ( pegs[i].type != CountType::NOW )
p[i] = 0;
for ( unsigned i = 0; infos[i].name; i++ )
{
if ( strcmp(name, infos[i].name) == 0 )
- return counts[i];
+ return dump_stats_results[i];
}
assert(false); // wrong name = programmer error
return 0;
virtual void show_interval_stats(IndexVec&, FILE*);
virtual void show_stats();
virtual void reset_stats();
+ virtual void init_stats(bool new_thread=false);
+ virtual void main_accumulate_stats();
virtual void show_dynamic_stats() {}
void clear_global_active_counters();
void set_params(const Parameter* p)
{ params = p; }
-
- bool dump_stats_initialized = false;
-
- std::vector<PegCount> counts;
- std::vector<PegCount> dump_stats_counts;
+ std::vector<unsigned> dump_stats_initialized;
+ std::vector<std::vector<PegCount>> counts;
+ std::vector<std::vector<PegCount>> dump_stats_counts;
+ std::vector<PegCount> dump_stats_results;
int num_counts = -1;
- void set_peg_count(int index, PegCount value, bool dump_stats = false)
+ void set_peg_count(int index, PegCount value, bool dump_stats)
+ {
+ assert(index < num_counts);
+ if (dump_stats)
+ dump_stats_counts[get_instance_id()][index] = value;
+ else
+ counts[get_instance_id()][index] = value;
+ }
+
+ void set_max_peg_count(int index, PegCount value, bool dump_stats)
{
assert(index < num_counts);
- if(dump_stats)
- dump_stats_counts[index] = value;
+ if (dump_stats)
+ {
+ if(value > dump_stats_counts[get_instance_id()][index])
+ dump_stats_counts[get_instance_id()][index] = value;
+ }
else
- counts[index] = value;
+ {
+ if(value > counts[get_instance_id()][index])
+ counts[get_instance_id()][index] = value;
+ }
}
- void add_peg_count(int index, PegCount value, bool dump_stats = false)
+ void add_peg_count(int index, PegCount value, bool dump_stats)
{
assert(index < num_counts);
- if(dump_stats)
- dump_stats_counts[index] += value;
+ if (dump_stats)
+ dump_stats_counts[get_instance_id()][index] += value;
else
- counts[index] += value;
+ counts[get_instance_id()][index] += value;
}
private:
friend ModuleManager;
void init(const char*, const char* = nullptr);
+
const char* name;
const char* help;
bool list;
int table_level = 0;
- void set_max_peg_count(int index, PegCount value, bool dump_stats = false)
- {
- assert(index < num_counts);
- if(dump_stats)
- {
- if(value > dump_stats_counts[index])
- dump_stats_counts[index] = value;
- }
- else
- {
- if(value > counts[index])
- counts[index] = value;
- }
- }
};
}
#endif
void HostCacheModule::sum_stats(bool dump_stats)
{
Module::sum_stats(dump_stats);
- host_cache.sum_stats(dump_stats);
}
void HostCacheModule::reset_stats()
void invalidate();
void update_counts();
void reset_counts();
- void sum_stats(bool dump_stats);
std::shared_ptr<Value> operator[](const Key& key);
}
}
-template<typename Key, typename Value>
-void HostCacheSegmented<Key, Value>::sum_stats(bool dump_stats)
-{
- std::lock_guard<std::mutex> guard(stats_lock);
- if ( !dump_stats )
- {
- const PegInfo* pegs = get_pegs();
-
- for (auto cache : seg_list)
- {
- PegCount* cache_counts = reinterpret_cast<PegCount*> (&cache->stats);
- cache->lock();
- for (int i = 0; pegs[i].type != CountType::END; i++)
- {
- if ( pegs[i].type == CountType::SUM )
- cache_counts[i] = 0;
- }
- cache->unlock();
- }
- }
-}
template<typename Key, typename Value>
std::shared_ptr<Value> HostCacheSegmented<Key, Value>:: find_else_create(const Key& key, bool* new_data)
#include "host_tracker/host_cache.h"
#include "host_tracker/host_cache_segmented.h"
#include "main/snort_config.h"
+#include "main/thread_config.h"
#include "managers/module_manager.h"
#include <CppUTest/CommandLineTestRunner.h>
bool Snort::is_reloading() { return false; }
void SnortConfig::register_reload_handler(ReloadResourceTuner* rrt) { delete rrt; }
void FatalError(const char* fmt, ...) { (void)fmt; exit(1); }
+unsigned get_instance_id()
+{ return 0; }
+unsigned ThreadConfig::get_instance_max() { return 1; }
} // end of namespace snort
void show_stats(PegCount*, const PegInfo*, unsigned, const char*) { }
#include "host_tracker/host_cache_segmented.h"
#include "host_tracker/host_tracker_module.h"
#include "main/snort_config.h"
+#include "main/thread_config.h"
#include "target_based/snort_protocols.h"
#include <CppUTest/CommandLineTestRunner.h>
{ return strdup(s); }
time_t packet_time() { return 0; }
void FatalError(const char* fmt, ...) { (void)fmt; exit(1); }
+unsigned get_instance_id()
+{ return 0; }
+unsigned ThreadConfig::get_instance_max() { return 1; }
}
// Fake show_stats to avoid bringing in a ton of dependencies.
PcreData* get_data();
+ bool global_stats() const override
+ { return true; }
+
Usage get_usage() const override
{ return DETECT; }
#include "framework/module.h"
#include "log/messages.h"
#include "main/snort_config.h"
+#include "main/thread_config.h"
#include "ports/port_group.h"
#include "profiler/profiler_defs.h"
#include "protocols/packet.h"
unsigned get_instance_id()
{ return 0; }
+unsigned ThreadConfig::get_instance_max() { return 1; }
char* snort_strdup(const char* s)
{ return strdup(s); }
HighAvailabilityManager::configure(sc->ha_config);
memory::MemoryCap::init(sc->thread_config->get_instance_max());
+ ModuleManager::init_stats();
ModuleManager::reset_stats(sc);
if (sc->alert_before_pass())
static std::unordered_map<std::string, const Parameter*> s_pmap;
static unsigned s_errors = 0;
+const char* ModuleManager::dynamic_stats_modules = "file_id appid";
set<uint32_t> ModuleManager::gids;
mutex ModuleManager::stats_mutex;
ModHook* mh = get_hook(name);
if ( mh )
- pc = &mh->mod->dump_stats_counts[0];
+ pc = &mh->mod->dump_stats_counts[0][0];
return pc;
}
+void ModuleManager::accumulate_dump_stats()
+{
+ auto mod_hooks = get_all_modhooks();
+ for ( auto* mh : mod_hooks )
+ {
+ mh->mod->main_accumulate_stats();
+ }
+}
+
+void ModuleManager::init_stats()
+{
+ auto mod_hooks = get_all_modhooks();
+ for ( auto* mh : mod_hooks )
+ {
+ mh->mod->init_stats();
+ }
+}
+
+void ModuleManager::add_thread_stats_entry(const char* name)
+{
+ ModHook* mh = get_hook(name);
+ if ( mh )
+ mh->mod->init_stats(true);
+}
+
void ModuleManager::dump_stats(const char* skip, bool dynamic)
{
auto mod_hooks = get_all_modhooks();
{
if ( !skip || !strstr(skip, mh->mod->get_name()) )
{
- lock_guard<mutex> lock(stats_mutex);
- if ( dynamic )
- mh->mod->show_dynamic_stats();
+ if (strstr(dynamic_stats_modules, mh->mod->get_name()) || mh->mod->global_stats())
+ {
+ lock_guard<mutex> lock(stats_mutex);
+ if ( dynamic )
+ mh->mod->show_dynamic_stats();
+ else
+ mh->mod->show_stats();
+ }
else
- mh->mod->show_stats();
+ {
+ if ( dynamic )
+ mh->mod->show_dynamic_stats();
+ else
+ mh->mod->show_stats();
+ }
}
}
}
if ( except and !strcmp(mh->mod->name, except) )
continue;
- lock_guard<mutex> lock(stats_mutex);
- mh->mod->prep_counts(true);
- mh->mod->sum_stats(true);
+ if (strstr(dynamic_stats_modules, mh->mod->get_name()) || mh->mod->global_stats())
+ {
+ lock_guard<mutex> lock(stats_mutex);
+ mh->mod->prep_counts(true);
+ mh->mod->sum_stats(true);
+ }
+ else
+ {
+ mh->mod->prep_counts(true);
+ mh->mod->sum_stats(true);
+ }
}
}
ModHook* mh = get_hook(name);
if ( mh )
{
- lock_guard<mutex> lock(stats_mutex);
- mh->mod->prep_counts(true);
- mh->mod->sum_stats(true);
+ if (strstr(dynamic_stats_modules, mh->mod->get_name()) || mh->mod->global_stats())
+ {
+ lock_guard<mutex> lock(stats_mutex);
+ mh->mod->prep_counts(true);
+ mh->mod->sum_stats(true);
+ }
+ else
+ {
+ mh->mod->prep_counts(true);
+ mh->mod->sum_stats(true);
+ }
}
}
for ( auto* mh : mod_hooks )
{
- lock_guard<mutex> lock(stats_mutex);
- mh->mod->reset_stats();
+ if (strstr(dynamic_stats_modules, mh->mod->get_name()) || mh->mod->global_stats())
+ {
+ lock_guard<mutex> lock(stats_mutex);
+ mh->mod->reset_stats();
+ }
+ else
+ {
+ mh->mod->reset_stats();
+ }
}
}
for ( auto* mh : mod_hooks )
{
- lock_guard<mutex> lock(stats_mutex);
- mh->mod->clear_global_active_counters();
+ if (strstr(dynamic_stats_modules, mh->mod->get_name()) || mh->mod->global_stats())
+ {
+ lock_guard<mutex> lock(stats_mutex);
+ mh->mod->clear_global_active_counters();
+ }
+ else
+ {
+ mh->mod->clear_global_active_counters();
+ }
}
}
ModHook* mh = get_hook(clear_counter_type_string_map[type]);
if ( mh and mh->mod )
{
- lock_guard<mutex> lock(stats_mutex);
- mh->mod->reset_stats();
+ if (strstr(dynamic_stats_modules, mh->mod->get_name()) || mh->mod->global_stats())
+ {
+ lock_guard<mutex> lock(stats_mutex);
+ mh->mod->reset_stats();
+ }
+ else
+ {
+ mh->mod->reset_stats();
+ }
}
}
else
if ( type == TYPE_ALL or !ignore )
{
- lock_guard<mutex> lock(stats_mutex);
- mh->mod->reset_stats();
+ if (strstr(dynamic_stats_modules, mh->mod->get_name()) || mh->mod->global_stats())
+ {
+ lock_guard<mutex> lock(stats_mutex);
+ mh->mod->reset_stats();
+ }
+ else
+ {
+ mh->mod->reset_stats();
+ }
}
}
}
static PegCount* get_stats(const char* name);
static void dump_stats(const char* skip = nullptr, bool dynamic = false);
+ static void accumulate_dump_stats();
+ static void init_stats();
+ static void add_thread_stats_entry(const char* name);
- static void accumulate(const char* except = nullptr);
+ static void accumulate(const char* except = "snort");
static void accumulate_module(const char* name);
static void reset_stats(SnortConfig*);
static std::set<uint32_t> gids;
SO_PUBLIC static std::mutex stats_mutex;
+ SO_PUBLIC static const char* dynamic_stats_modules;
};
}
void TraceApi::filter(const Packet&) { }
PegCount Module::get_global_count(const char*) const { return 0; }
void Module::sum_stats(bool) { }
+void Module::init_stats(bool) { }
+void Module::main_accumulate_stats() { }
void Module::show_interval_stats(IndexVec&, FILE*) { }
void Module::show_stats() { }
void Module::reset_stats() { }
#include "framework/data_bus.h"
#include "framework/module.cc"
#include "framework/mpse_batch.h"
+#include "main/thread_config.h"
#include "network_inspectors/appid/appid_utils/sf_mlmp.cc"
#include "protocols/protocol_ids.h"
#include "service_inspectors/sip/sip_parser.h"
assert(mpsegrp);
return 0;
}
+unsigned get_instance_id()
+{ return 0; }
+unsigned ThreadConfig::get_instance_max() { return 1; }
}
AppIdInspector::AppIdInspector(AppIdModule&) { }
#include "network_inspectors/appid/detector_plugins/http_url_patterns.cc"
+#include "main/thread_config.h"
#include "protocols/protocol_ids.h"
#include "framework/module.cc"
#include "network_inspectors/appid/appid_utils/sf_mlmp.cc"
memcpy(mp_arg, &mock_mp, sizeof(MatchedPatterns*));
return 0;
}
+unsigned get_instance_id()
+{ return 0; }
+unsigned ThreadConfig::get_instance_max() { return 1; }
}
void ApplicationDescriptor::set_id(const Packet&, AppIdSession&, AppidSessionDirection, AppId, AppidChangeBits&) { }
PegCount Module::get_global_count(char const*) const { return 0; }
void Module::show_interval_stats(std::vector<unsigned int, std::allocator<unsigned int> >&, FILE*) {}
void Module::show_stats(){}
-void Module::sum_stats(bool ){}
+void Module::sum_stats(bool){}
+void Module::main_accumulate_stats(){}
void Module::reset_stats() {}
AppIdSessionApi::AppIdSessionApi(const AppIdSession*, const SfIp&) :
void Module::sum_stats(bool) {}
void Module::show_interval_stats(std::vector<unsigned>&, FILE*) {}
void Module::show_stats() {}
+void Module::init_stats(bool) {}
void Module::reset_stats() {}
+void Module::main_accumulate_stats() {}
PegCount Module::get_global_count(char const*) const { return 0; }
// Stubs for logs
Module::Module(char const*, char const*) {}
void Module::sum_stats(bool) {}
+void Module::main_accumulate_stats() { }
void Module::show_interval_stats(std::vector<unsigned int, std::allocator<unsigned int> >&, FILE*) {}
void Module::show_stats() {}
+void Module::init_stats(bool) {}
void Module::reset_stats() {}
PegCount Module::get_global_count(char const*) const { return 0; }
{
for ( const ModuleConfig& mod : modules )
{
- lock_guard<mutex> lock(ModuleManager::stats_mutex);
- mod.ptr->sum_stats(false);
+ if (strstr(ModuleManager::dynamic_stats_modules, mod.ptr->get_name()) || mod.ptr->global_stats())
+ {
+ lock_guard<mutex> lock(ModuleManager::stats_mutex);
+ mod.ptr->sum_stats(false);
+ }
+ else
+ {
+ mod.ptr->sum_stats(false);
+ }
}
}
}
void sum_stats(bool) override {}
+ void init_stats(bool) override {Module::init_stats();}
+
void real_sum_stats() { Module::sum_stats(false); }
Usage get_usage() const override
config.format = PerfFormat::MOCK;
MockModule mod;
+ mod.init_stats(false);
ModuleConfig mod_cfg;
mod_cfg.ptr = &mod;
mod_cfg.pegs = {0, 2, 4};
{ return strdup(s); }
void Module::sum_stats(bool) {}
+void Module::main_accumulate_stats() {}
void Module::show_stats() {}
+void Module::init_stats(bool) {}
void Module::reset_stats() {}
PegCount Module::get_global_count(char const*) const
{ return 0; }
#include "detection/detection_engine.h"
#include "flow/flow.h"
+#include "main/thread_config.h"
#include "packet_io/active.h"
#include "protocols/packet.h"
#include "utils/util.h"
DataBus::~DataBus() = default;
SnortConfig::SnortConfig(snort::SnortConfig const*, const char*) { }
SnortConfig::~SnortConfig() = default;
+unsigned get_instance_id()
+{ return 0; }
+unsigned ThreadConfig::get_instance_max() { return 1; }
IpsContext ips_context;
SnortConfig conf;
#include "framework/base_api.h"
#include "framework/mpse_batch.h"
#include "main/snort_config.h"
+#include "main/thread_config.h"
#include "managers/mpse_manager.h"
#include "mpse_test_stubs.h"
using namespace snort;
+namespace snort
+{
+ unsigned get_instance_id() { return 0; }
+ unsigned ThreadConfig::get_instance_max() { return 1; }
+}
+
//-------------------------------------------------------------------------
// stubs, spies, etc.
//-------------------------------------------------------------------------
#include "framework/mpse.h"
#include "framework/mpse_batch.h"
#include "main/snort_config.h"
+#include "main/thread_config.h"
#include "mpse_test_stubs.h"
using namespace snort;
+namespace snort
+{
+ unsigned get_instance_id() { return 0; }
+ unsigned ThreadConfig::get_instance_max() { return 1; }
+}
+
//-------------------------------------------------------------------------
// stubs, spies, etc.
//-------------------------------------------------------------------------
DataBus::DataBus() = default;
DataBus::~DataBus() = default;
-unsigned get_instance_id()
-{ return 0; }
-
THREAD_LOCAL PatMatQStat pmqs;
unsigned parse_errors = 0;
#include "helpers/literal_search.h"
#include "log/messages.h"
+#include "main/thread_config.h"
#include "service_inspectors/http_inspect/http_js_norm.h"
#include "service_inspectors/http_inspect/http_module.h"
#include "service_inspectors/http_inspect/http_str_to_code.h"
void DecodeConfig::set_decompress_vba(bool) {}
SearchTool::~SearchTool() {}
+unsigned get_instance_id()
+{ return 0; }
+unsigned ThreadConfig::get_instance_max() { return 1; }
}
void show_stats(PegCount*, const PegInfo*, unsigned, const char*) { }
#include "helpers/literal_search.h"
#include "log/messages.h"
+#include "main/thread_config.h"
#include "service_inspectors/http_inspect/http_js_norm.h"
#include "service_inspectors/http_inspect/http_uri_norm.h"
void DecodeConfig::set_decompress_zip(bool) {}
void DecodeConfig::set_decompress_vba(bool) {}
SearchTool::~SearchTool() {}
+unsigned get_instance_id()
+{ return 0; }
+unsigned ThreadConfig::get_instance_max() { return 1; }
}
snort::SearchTool* js_create_mpse_open_tag() { return nullptr; }
#include "side_channel/side_channel_module.h"
#include "log/messages.h"
+#include "main/thread_config.h"
#include "profiler/profiler.h"
#include <CppUTest/CommandLineTestRunner.h>
char* snort_strdup(const char* s)
{ return strdup(s); }
+unsigned get_instance_id()
+{ return 0; }
+unsigned ThreadConfig::get_instance_max() { return 1; }
}
TEST_GROUP(side_channel_module)
PegCount Module::get_global_count(char const*) const { return 0; }
void Module::show_interval_stats(std::vector<unsigned int, std::allocator<unsigned int> >&, FILE*) {}
void Module::show_stats(){}
+void Module::init_stats(bool){}
void Module::sum_stats(bool){}
+void Module::main_accumulate_stats(){}
void Module::reset_stats() {}
class TraceTestModule : public Module
void DropStats(ControlConn* ctrlcon)
{
s_ctrlcon = ctrlcon;
+ ModuleManager::accumulate_dump_stats();
LogLabel("Packet Statistics");
ModuleManager::get_module("daq")->show_stats();
PacketManager::dump_stats();