Squashed commit of the following:
commit
f1e4d6ffe603d131d5cd4a97af3ce5af9e083ec7
Author: Michael Altizer <mialtize@cisco.com>
Date: Thu Apr 13 14:40:35 2017 -0400
build: Fix FreeBSD compilation issues
// Implements rate_filter feature for snort
+#include <ctime>
+
#include "actions/actions.h"
#include "main/policy.h"
int16_t snortId_for_ftp_data;
int16_t snortId_for_http2;
-void map_app_names_to_snort_ids()
+static void map_app_names_to_snort_ids()
{
/* init globals for snortId compares */
snortId_for_unsynchronized = snort_conf->proto_ref->add("unsynchronized");
ClientDetector();
virtual ~ClientDetector() { }
- virtual void do_custom_init() override { };
+ virtual void do_custom_init() override { }
virtual int validate(AppIdDiscoveryArgs&) override;
virtual void register_appid(AppId, unsigned extractsInfo) override;
};
ClientDiscovery& ClientDiscovery::get_instance()
{
- static THREAD_LOCAL ClientDiscovery* discovery_manager = new ClientDiscovery;
+ static THREAD_LOCAL ClientDiscovery* discovery_manager = nullptr;
+ if (!discovery_manager)
+ discovery_manager = new ClientDiscovery;
return *discovery_manager;
}
~SipEventHandler() { }
static SipEventHandler& get_instance()
{
- static THREAD_LOCAL SipEventHandler* seh = new SipEventHandler;
+ static THREAD_LOCAL SipEventHandler* seh = nullptr;
+ if (!seh)
+ seh = new SipEventHandler;
return *seh;
}
}
}
-void destroy_host_url_patterns(HostUrlPatterns** pattern_list)
+static void destroy_host_url_patterns(HostUrlPatterns** pattern_list)
{
if (!(*pattern_list))
return;
return mlmpAddPattern((tMlmpTree*)matcher, patterns, detector);
}
-void destroy_host_url_matcher(tMlmpTree** host_url_matcher)
+static void destroy_host_url_matcher(tMlmpTree** host_url_matcher)
{
if (host_url_matcher && *host_url_matcher)
{
}
}
-int match_query_elements(
+static int match_query_elements(
tMlpPattern* packetData,
tMlpPattern* userPattern,
char* appVersion,
HttpPatternMatchers* HttpPatternMatchers::get_instance()
{
- static THREAD_LOCAL HttpPatternMatchers* http_matchers = new HttpPatternMatchers;
+ static THREAD_LOCAL HttpPatternMatchers* http_matchers = nullptr;
+ if (!http_matchers)
+ http_matchers = new HttpPatternMatchers;
return http_matchers;
}
ServiceDiscovery& ServiceDiscovery::get_instance()
{
- static THREAD_LOCAL ServiceDiscovery* discovery_manager = new ServiceDiscovery;
+ static THREAD_LOCAL ServiceDiscovery* discovery_manager = nullptr;
+ if (!discovery_manager)
+ discovery_manager = new ServiceDiscovery;
return *discovery_manager;
}
#ifndef CSV_FORMATTER_H
#define CSV_FORMATTER_H
+#include <ctime>
+
#include "perf_formatter.h"
class CSVFormatter : public PerfFormatter
// ouput open.
//
+#include <ctime>
#include <string>
#include <vector>
//
#include <cstdio>
+#include <ctime>
#include "perf_formatter.h"
#include "perf_monitor.h"