void WarningMessage(const char*,...) { }
// Stubs for search_tool.cc
-SearchTool::SearchTool(bool) { }
+SearchTool::SearchTool(bool multi, const char*) : mpsegrp(nullptr), max_len(0), multi_match(multi)
+{ }
SearchTool::~SearchTool() = default;
void SearchTool::add(const char*, unsigned, int, bool, bool) { }
void SearchTool::add(const char*, unsigned, void*, bool, bool) { }
AppIdSession* AppIdApi::get_appid_session(snort::Flow const&) { return nullptr; }
MpseGroup::~MpseGroup() = default;
-SearchTool::SearchTool(bool)
+SearchTool::SearchTool(bool, const char*)
{
mpsegrp = &mpse_group;
}
{
AppIdSessionApi::AppIdSessionApi(const AppIdSession*, const SfIp&) :
StashGenericObject(STASH_GENERIC_OBJECT_APPID) {}
-SearchTool::SearchTool(bool) { }
+SearchTool::SearchTool(bool, const char*) { }
void SearchTool::reload() { }
static bool test_find_all_done = false;
static bool test_find_all_enabled = false;
namespace snort
{
// Stubs for search_tool.cc
-SearchTool::SearchTool(bool) { }
+SearchTool::SearchTool(bool multi, const char*) : mpsegrp(nullptr), max_len(0), multi_match(multi)
+{ }
SearchTool::~SearchTool() = default;
void SearchTool::add(const char*, unsigned, int, bool, bool) { }
void SearchTool::add(const char*, unsigned, void*, bool, bool) { }
class StreamSplitter* Inspector::get_splitter(bool) { return nullptr; }
// Stubs for search_tool.cc
-SearchTool::SearchTool(bool) { }
+SearchTool::SearchTool(bool, const char*) { }
SearchTool::~SearchTool() = default;
// Stubs for util.cc
time_t packet_time() { return std::time(nullptr); }
// Stubs for search_tool
-SearchTool::SearchTool(bool) {}
+SearchTool::SearchTool(bool, const char*) {}
SearchTool::~SearchTool() = default;
void SearchTool::add(const char*, unsigned, int, bool, bool) {}
void SearchTool::add(const char*, unsigned, void*, bool, bool) {}
unsigned DataBus::get_id(const PubKey&) { return 0; }
-SearchTool::SearchTool(bool) { }
+SearchTool::SearchTool(bool multi, const char*) : mpsegrp(nullptr), max_len(0), multi_match(multi)
+{ }
SearchTool::~SearchTool() = default;
}
DiscoveryFilter::~DiscoveryFilter(){}
SslPatternMatchers::~SslPatternMatchers() = default;
AlpnPatternMatchers::~AlpnPatternMatchers() = default;
CipPatternMatchers::~CipPatternMatchers() = default;
-snort::SearchTool::SearchTool(bool) { }
+snort::SearchTool::SearchTool(bool, const char*) { }
snort::SearchTool::~SearchTool() = default;
void appid_log(const snort::Packet*, unsigned char, char const* fmt, ...)
{
OdpContext* AppIdContext::odp_ctxt = &stub_odp_ctxt;
ThirdPartyAppIdContext* AppIdContext::tp_appid_ctxt = nullptr;
-snort::SearchTool::SearchTool(bool) { }
+snort::SearchTool::SearchTool(bool multi, const char*) : mpsegrp(nullptr), max_len(0), multi_match(multi)
+{ }
snort::SearchTool::~SearchTool() = default;
AppIdDiscovery::~AppIdDiscovery() = default;
namespace snort
{
- SearchTool::SearchTool(bool)
+ SearchTool::SearchTool(bool multi, const char*) : mpsegrp(nullptr), max_len(0), multi_match(multi)
{ s_prep_count = s_count = 0; }
SearchTool::~SearchTool()
namespace snort
{
-SearchTool::SearchTool(bool multi)
+SearchTool::SearchTool(bool multi, const char* override_method)
{
const SnortConfig* sc = SnortConfig::get_conf();
assert(sc and sc->fast_pattern_config);
- const char* method = sc->fast_pattern_config->get_search_method();
+ assert(!override_method || strcmp(override_method, "hyperscan"));
+ const char* method = override_method ? override_method : sc->fast_pattern_config->get_search_method();
if ( strcmp(method, "hyperscan") )
method = "ac_full";
delete mpsegrp;
}
+const char* SearchTool::get_method() const
+{ return mpsegrp->get_normal_mpse()->get_method(); }
+
void SearchTool::add(const char* pat, unsigned len, int id, bool no_case, bool literal)
{ add((const uint8_t*)pat, len, id, no_case, literal); }
class SO_PUBLIC SearchTool
{
public:
- SearchTool(bool multi_match = true);
+ SearchTool(bool multi_match = true, const char* = nullptr);
~SearchTool();
+ const char* get_method() const;
+
void add(const char* pattern, unsigned len, int s_id, bool no_case = true, bool literal = true);
void add(const char* pattern, unsigned len, void* s_context, bool no_case = true, bool literal = true);