"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/network_inspectors/reputation/reputation_parse.cc" between
snort3-3.1.36.0.tar.gz and snort3-3.1.38.0.tar.gz

About: Snort 3 is a network intrusion prevention and detection system (IDS/IPS) combining the benefits of signature, protocol and anomaly-based inspection.

reputation_parse.cc  (snort3-3.1.36.0):reputation_parse.cc  (snort3-3.1.38.0)
skipping to change at line 33 skipping to change at line 33
#include "reputation_parse.h" #include "reputation_parse.h"
#include <netinet/in.h> #include <netinet/in.h>
#include <cassert> #include <cassert>
#include <climits> #include <climits>
#include <fstream> #include <fstream>
#include <limits> #include <limits>
#include "main/snort_config.h"
#include "log/messages.h" #include "log/messages.h"
#include "parser/config_file.h" #include "parser/config_file.h"
#include "sfip/sf_cidr.h" #include "sfip/sf_cidr.h"
#include "utils/util.h" #include "utils/util.h"
#include "utils/util_cstring.h" #include "utils/util_cstring.h"
#include "reputation_config.h" #include "reputation_config.h"
#include "reputation_inspect.h" #include "reputation_inspect.h"
using namespace snort; using namespace snort;
skipping to change at line 547 skipping to change at line 548
return; return;
/*convert list info to ip entry info*/ /*convert list info to ip entry info*/
ip_info_ptr = segment_snort_calloc(1,sizeof(IPrepInfo)); ip_info_ptr = segment_snort_calloc(1,sizeof(IPrepInfo));
if (!(ip_info_ptr)) if (!(ip_info_ptr))
return; return;
base = (uint8_t*)data.ip_list; base = (uint8_t*)data.ip_list;
ip_info = ((IPrepInfo*)&base[ip_info_ptr]); ip_info = ((IPrepInfo*)&base[ip_info_ptr]);
ip_info->list_indexes[0] = list_info->list_index; ip_info->list_indexes[0] = list_info->list_index;
LogMessage(" Processing %s file %s\n", list_type_name, full_path_filename if ( SnortConfig::log_verbose() )
); {
LogMessage(" Processing %s file %s\n", list_type_name, full_path_filen
ame);
}
if ((fp = fopen(full_path_filename, "r")) == nullptr) if ((fp = fopen(full_path_filename, "r")) == nullptr)
{ {
ErrorMessage("Unable to open address file %s, Error: %s\n", full_path_fi lename, ErrorMessage("Unable to open address file %s, Error: %s\n", full_path_fi lename,
get_error(errno)); get_error(errno));
return; return;
} }
num_loaded_before = sfrt_flat_num_entries(data.ip_list); num_loaded_before = sfrt_flat_num_entries(data.ip_list);
while ( fgets(linebuf, MAX_ADDR_LINE_LENGTH, fp) ) while ( fgets(linebuf, MAX_ADDR_LINE_LENGTH, fp) )
skipping to change at line 610 skipping to change at line 614
total_duplicates += duplicate_count; total_duplicates += duplicate_count;
total_invalids += invalid_count; total_invalids += invalid_count;
/*Print out the summary*/ /*Print out the summary*/
if (fail_count > MAX_MSGS_TO_PRINT) if (fail_count > MAX_MSGS_TO_PRINT)
ErrorMessage(" Additional addresses failed insertion but were not lis ted.\n"); ErrorMessage(" Additional addresses failed insertion but were not lis ted.\n");
if (invalid_count > MAX_MSGS_TO_PRINT) if (invalid_count > MAX_MSGS_TO_PRINT)
ErrorMessage(" Additional invalid addresses were not listed.\n"); ErrorMessage(" Additional invalid addresses were not listed.\n");
if (duplicate_count > MAX_MSGS_TO_PRINT) if (duplicate_count > MAX_MSGS_TO_PRINT)
ErrorMessage(" Additional duplicate addresses were not listed.\n"); ErrorMessage(" Additional duplicate addresses were not listed.\n");
LogMessage(" Reputation entries loaded: %u, invalid: %u, re-defined: %u ( if ( SnortConfig::log_verbose() )
from file %s)\n", {
sfrt_flat_num_entries(data.ip_list) - num_loaded_before, LogMessage(" Reputation entries loaded: %u, invalid: %u, re-defined:
invalid_count, duplicate_count, full_path_filename); %u (from file %s)\n",
sfrt_flat_num_entries(data.ip_list) - num_loaded_before,
invalid_count, duplicate_count, full_path_filename);
}
fclose(fp); fclose(fp);
} }
void ip_list_init(uint32_t max_entries, const ReputationConfig& config, Reputati onData& data) void ip_list_init(uint32_t max_entries, const ReputationConfig& config, Reputati onData& data)
{ {
if ( !data.ip_list ) if ( !data.ip_list )
{ {
uint32_t mem_size; uint32_t mem_size;
mem_size = estimate_size(max_entries, config.memcap); mem_size = estimate_size(max_entries, config.memcap);
 End of changes. 3 change blocks. 
6 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)