snort.cc (snort3-3.1.29.0) | : | snort.cc (snort3-3.1.30.0) | ||
---|---|---|---|---|
skipping to change at line 78 | skipping to change at line 78 | |||
#include "service_inspectors/service_inspectors.h" | #include "service_inspectors/service_inspectors.h" | |||
#include "side_channel/side_channel.h" | #include "side_channel/side_channel.h" | |||
#include "stream/stream_inspectors.h" | #include "stream/stream_inspectors.h" | |||
#include "target_based/host_attributes.h" | #include "target_based/host_attributes.h" | |||
#include "time/periodic.h" | #include "time/periodic.h" | |||
#include "trace/trace_api.h" | #include "trace/trace_api.h" | |||
#include "trace/trace_config.h" | #include "trace/trace_config.h" | |||
#include "trace/trace_logger.h" | #include "trace/trace_logger.h" | |||
#include "utils/util.h" | #include "utils/util.h" | |||
#ifdef PIGLET | ||||
#include "piglet/piglet.h" | ||||
#include "piglet/piglet_manager.h" | ||||
#include "piglet_plugins/piglet_plugins.h" | ||||
#endif | ||||
#ifdef SHELL | #ifdef SHELL | |||
#include "control/control_mgmt.h" | #include "control/control_mgmt.h" | |||
#include "ac_shell_cmd.h" | #include "ac_shell_cmd.h" | |||
#endif | #endif | |||
#include "snort_config.h" | #include "snort_config.h" | |||
#include "thread_config.h" | #include "thread_config.h" | |||
using namespace snort; | using namespace snort; | |||
using namespace std; | using namespace std; | |||
skipping to change at line 120 | skipping to change at line 114 | |||
StoreSnortInfoStrings(); | StoreSnortInfoStrings(); | |||
#endif | #endif | |||
InitProtoNames(); | InitProtoNames(); | |||
load_actions(); | load_actions(); | |||
load_codecs(); | load_codecs(); | |||
load_connectors(); | load_connectors(); | |||
load_ips_options(); | load_ips_options(); | |||
load_loggers(); | load_loggers(); | |||
#ifdef PIGLET | ||||
load_piglets(); | ||||
#endif | ||||
load_search_engines(); | load_search_engines(); | |||
load_policy_selectors(); | load_policy_selectors(); | |||
load_stream_inspectors(); | load_stream_inspectors(); | |||
load_network_inspectors(); | load_network_inspectors(); | |||
load_service_inspectors(); | load_service_inspectors(); | |||
snort_cmd_line_conf = parse_cmd_line(argc, argv); | snort_cmd_line_conf = parse_cmd_line(argc, argv); | |||
SnortConfig::set_conf(snort_cmd_line_conf); | SnortConfig::set_conf(snort_cmd_line_conf); | |||
LogMessage("--------------------------------------------------\n"); | LogMessage("--------------------------------------------------\n"); | |||
#ifdef BUILD | #ifdef BUILD | |||
LogMessage("%s Snort++ %s-%s\n", get_prompt(), VERSION, BUILD); | LogMessage("%s Snort++ %s-%s\n", get_prompt(), VERSION, BUILD); | |||
#else | #else | |||
LogMessage("%s Snort++ %s\n", get_prompt(), VERSION); | LogMessage("%s Snort++ %s\n", get_prompt(), VERSION); | |||
#endif | #endif | |||
LogMessage("--------------------------------------------------\n"); | LogMessage("--------------------------------------------------\n"); | |||
#ifdef PIGLET | ||||
Piglet::Manager::init(); | ||||
#endif | ||||
SideChannelManager::pre_config_init(); | SideChannelManager::pre_config_init(); | |||
ScriptManager::load_scripts(snort_cmd_line_conf->script_paths); | ScriptManager::load_scripts(snort_cmd_line_conf->script_paths); | |||
PluginManager::load_plugins(snort_cmd_line_conf->plugin_path); | PluginManager::load_plugins(snort_cmd_line_conf->plugin_path); | |||
/* load_plugins() must be called before init() so that | /* load_plugins() must be called before init() so that | |||
TraceModule can properly generate its Parameter table */ | TraceModule can properly generate its Parameter table */ | |||
ModuleManager::init(); | ModuleManager::init(); | |||
ModuleManager::load_params(); | ModuleManager::load_params(); | |||
skipping to change at line 176 | skipping to change at line 163 | |||
// since the first trace call may happen somewhere after this point | // since the first trace call may happen somewhere after this point | |||
TraceApi::thread_init(sc->trace_config); | TraceApi::thread_init(sc->trace_config); | |||
PluginManager::load_so_plugins(sc); | PluginManager::load_so_plugins(sc); | |||
if ( SnortConfig::log_show_plugins() ) | if ( SnortConfig::log_show_plugins() ) | |||
{ | { | |||
ModuleManager::dump_modules(); | ModuleManager::dump_modules(); | |||
PluginManager::dump_plugins(); | PluginManager::dump_plugins(); | |||
} | } | |||
#ifdef PIGLET | ||||
if ( !Piglet::piglet_mode() ) | ||||
#endif | ||||
CodecManager::instantiate(); | CodecManager::instantiate(); | |||
#ifdef PIGLET | ||||
if ( !Piglet::piglet_mode() ) | ||||
#endif | ||||
if ( !sc->output.empty() ) | if ( !sc->output.empty() ) | |||
EventManager::instantiate(sc->output.c_str(), sc); | EventManager::instantiate(sc->output.c_str(), sc); | |||
HighAvailabilityManager::configure(sc->ha_config); | HighAvailabilityManager::configure(sc->ha_config); | |||
ModuleManager::reset_stats(sc); | ModuleManager::reset_stats(sc); | |||
if (sc->alert_before_pass()) | if (sc->alert_before_pass()) | |||
sc->rule_order = Actions::get_default_priorities(true); | sc->rule_order = Actions::get_default_priorities(true); | |||
skipping to change at line 240 | skipping to change at line 221 | |||
detection_filter_init(sc->detection_filter_config); | detection_filter_init(sc->detection_filter_config); | |||
const MpseApi* search_api = sc->fast_pattern_config->get_search_api(); | const MpseApi* search_api = sc->fast_pattern_config->get_search_api(); | |||
const MpseApi* offload_search_api = sc->fast_pattern_config->get_offload_sea rch_api(); | const MpseApi* offload_search_api = sc->fast_pattern_config->get_offload_sea rch_api(); | |||
MpseManager::activate_search_engine(search_api, sc); | MpseManager::activate_search_engine(search_api, sc); | |||
if ((offload_search_api != nullptr) and (offload_search_api != search_api)) | if ((offload_search_api != nullptr) and (offload_search_api != search_api)) | |||
MpseManager::activate_search_engine(offload_search_api, sc); | MpseManager::activate_search_engine(offload_search_api, sc); | |||
#ifdef PIGLET | ||||
if ( !Piglet::piglet_mode() ) | ||||
#endif | ||||
/* Finish up the pcap list and put in the queues */ | /* Finish up the pcap list and put in the queues */ | |||
Trough::setup(); | Trough::setup(); | |||
// FIXIT-L refactor stuff done here and in snort_config.cc::VerifyReload() | // FIXIT-L refactor stuff done here and in snort_config.cc::VerifyReload() | |||
if ( sc->bpf_filter.empty() && !sc->bpf_file.empty() ) | if ( sc->bpf_filter.empty() && !sc->bpf_file.empty() ) | |||
sc->bpf_filter = read_infile("bpf_file", sc->bpf_file.c_str()); | sc->bpf_filter = read_infile("bpf_file", sc->bpf_file.c_str()); | |||
if ( !sc->bpf_filter.empty() ) | if ( !sc->bpf_filter.empty() ) | |||
LogMessage("Snort BPF option: %s\n", sc->bpf_filter.c_str()); | LogMessage("Snort BPF option: %s\n", sc->bpf_filter.c_str()); | |||
skipping to change at line 336 | skipping to change at line 314 | |||
static bool already_exiting = false; | static bool already_exiting = false; | |||
if ( already_exiting ) | if ( already_exiting ) | |||
return; | return; | |||
already_exiting = true; | already_exiting = true; | |||
const SnortConfig* sc = SnortConfig::get_conf(); | const SnortConfig* sc = SnortConfig::get_conf(); | |||
IpsManager::global_term(sc); | IpsManager::global_term(sc); | |||
HostAttributesManager::term(); | HostAttributesManager::term(); | |||
#ifdef PIGLET | ||||
if ( !Piglet::piglet_mode() ) | ||||
#endif | ||||
Trough::cleanup(); | Trough::cleanup(); | |||
ClosePidFile(); | ClosePidFile(); | |||
/* remove pid file */ | /* remove pid file */ | |||
if ( !sc->pid_filename.empty() ) | if ( !sc->pid_filename.empty() ) | |||
{ | { | |||
int ret = unlink(sc->pid_filename.c_str()); | int ret = unlink(sc->pid_filename.c_str()); | |||
if (ret != 0) | if (ret != 0) | |||
{ | { | |||
ErrorMessage("Could not remove pid file %s: %s\n", | ErrorMessage("Could not remove pid file %s: %s\n", | |||
End of changes. 8 change blocks. | ||||
26 lines changed or deleted | 0 lines changed or added |