THREAD_LOCAL const Trace* stream_trace = nullptr;
void Active::drop_packet(snort::Packet const*, bool) { }
-Analyzer* Analyzer::get_local_analyzer() { return nullptr; }
-void Analyzer::resume(unsigned long) { }
void Active::set_drop_reason(char const*) { }
-DetectionEngine::DetectionEngine() { context = nullptr; }
-ExpectCache::~ExpectCache() = default;
-DetectionEngine::~DetectionEngine() = default;
-const SnortConfig* SnortConfig::get_conf() { return nullptr; }
-void DetectionEngine::disable_all(Packet*) { }
ExpectCache::ExpectCache(uint32_t) { }
+ExpectCache::~ExpectCache() = default;
bool ExpectCache::check(Packet*, Flow*) { return true; }
bool ExpectCache::is_expected(Packet*) { return true; }
+void DetectionEngine::disable_all(Packet*) { }
Flow* HighAvailabilityManager::import(Packet&, FlowKey&) { return nullptr; }
bool HighAvailabilityManager::in_standby(Flow*) { return false; }
SfIpRet SfIp::set(void const*, int) { return SFIP_SUCCESS; }
-void snort::trace_vprintf(const char*, TraceLevel, const char*, const Packet*, const char*, va_list) {}
-uint8_t snort::TraceApi::get_constraints_generation() { return 0; }
-void snort::TraceApi::filter(const Packet&) {}
+const SnortConfig* SnortConfig::get_conf() { return nullptr; }
+uint8_t TraceApi::get_constraints_generation() { return 0; }
+void TraceApi::filter(const Packet&) {}
void ThreadConfig::preemptive_kick() {}
namespace snort
void Flow::set_mpls_layer_per_dir(Packet*) { }
time_t packet_time() { return 0; }
-void packet_gettimeofday(struct timeval* tv) { *tv = {}; }
+
+void trace_vprintf(const char*, TraceLevel, const char*, const Packet*, const char*, va_list) {}
namespace ip
{
FlowCacheConfig fcg;
fcg.max_flows = 5;
fcg.prune_flows = 3;
-
+
for(uint8_t i = to_utype(PktType::NONE); i <= to_utype(PktType::MAX); i++)
fcg.proto[i].nominal_timeout = 5;
-
+
FlowCache *cache = new FlowCache(fcg);
int port = 1;
continue;
CHECK(cache->prune_one(PruneReason::NONE, true, i) == false);
}
-
+
//pruning should happen for UDP
CHECK(cache->prune_one(PruneReason::NONE, true, to_utype(PktType::UDP)) == true);
const uint64_t start = 50;
heap->total = start;
- MemoryConfig config { cap, 100, 0, 2, true };
+ MemoryConfig config { (size_t)cap, 100, 0, 2, true };
MemoryCap::start(config, pruner);
MemoryCap::thread_init();
TEST(memory, prune3)
{
uint64_t cap = 100;
- MemoryConfig config { cap, 100, 0, 1, true };
+ MemoryConfig config { (size_t)cap, 100, 0, 1, true };
MemoryCap::start(config, pruner);
MemoryCap::thread_init();
TEST(memory, two_cycles)
{
uint64_t cap = 100;
- MemoryConfig config { cap, 100, 0, 1, true };
+ MemoryConfig config { (size_t)cap, 100, 0, 1, true };
MemoryCap::start(config, pruner);
MemoryCap::thread_init();
const uint64_t start = 50;
heap->total = start;
- MemoryConfig config { cap, 100, 0, 2, true };
+ MemoryConfig config { (size_t)cap, 100, 0, 2, true };
MemoryCap::start(config, pruner);
MemoryCap::thread_init();
const uint64_t start = 50;
heap->total = start;
- MemoryConfig config { cap, 100, 0, 2, true };
+ MemoryConfig config { (size_t)cap, 100, 0, 2, true };
MemoryCap::start(config, pruner);
MemoryCap::thread_init();
ConfigLogger::log_value("memcap", memcap);
}
+static bool once = false;
+
void AppIdContext::pterm()
{
if (odp_thread_local_ctxt)
{
odp_ctxt->get_app_info_mgr().cleanup_appid_info_table();
delete odp_ctxt;
+ odp_ctxt = nullptr;
}
+
+ if (appidDebug)
+ {
+ delete appidDebug;
+ appidDebug = nullptr;
+ }
+
+ once = false;
}
bool AppIdContext::init_appid(SnortConfig* sc, AppIdInspector& inspector)
if (!odp_thread_local_ctxt)
odp_thread_local_ctxt = new OdpThreadContext;
- static bool once = false;
if (!once)
{
odp_ctxt->get_client_disco_mgr().initialize(inspector);
AppIdInspector::~AppIdInspector()
{
- if (ctxt)
- delete ctxt;
+ delete ctxt;
delete config;
}