"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/flow/flow.cc" between
snort3-3.1.29.0.tar.gz and snort3-3.1.30.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.

flow.cc  (snort3-3.1.29.0):flow.cc  (snort3-3.1.30.0)
skipping to change at line 26 skipping to change at line 26
// with this program; if not, write to the Free Software Foundation, Inc., // with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include "flow.h" #include "flow.h"
#include "detection/context_switcher.h"
#include "detection/detection_engine.h" #include "detection/detection_engine.h"
#include "flow/flow_key.h" #include "flow/flow_key.h"
#include "flow/ha.h" #include "flow/ha.h"
#include "flow/session.h" #include "flow/session.h"
#include "framework/data_bus.h" #include "framework/data_bus.h"
#include "helpers/bitop.h" #include "helpers/bitop.h"
#include "main/analyzer.h"
#include "memory/memory_cap.h" #include "memory/memory_cap.h"
#include "protocols/packet.h" #include "protocols/packet.h"
#include "protocols/tcp.h" #include "protocols/tcp.h"
#include "sfip/sf_ip.h" #include "sfip/sf_ip.h"
#include "utils/stats.h" #include "utils/stats.h"
#include "utils/util.h" #include "utils/util.h"
using namespace snort; using namespace snort;
Flow::Flow() Flow::Flow()
skipping to change at line 151 skipping to change at line 153
} }
filtering_state.clear(); filtering_state.clear();
} }
void Flow::flush(bool do_cleanup) void Flow::flush(bool do_cleanup)
{ {
if ( session ) if ( session )
{ {
DetectionEngine::onload(this); DetectionEngine::onload(this);
if ( do_cleanup ) if ( !do_cleanup )
session->clear();
else if ( Analyzer::get_switcher()->get_context() )
session->flush();
else
{ {
DetectionEngine::set_next_packet(); DetectionEngine::set_next_packet();
DetectionEngine de; DetectionEngine de;
session->flush(); session->flush();
de.get_context()->clear_callbacks();
} }
else
session->clear();
} }
if ( was_blocked() ) if ( was_blocked() )
free_flow_data(); free_flow_data();
} }
void Flow::reset(bool do_cleanup) void Flow::reset(bool do_cleanup)
{ {
if ( session ) if ( session )
{ {
DetectionEngine::onload(this); DetectionEngine::onload(this);
if ( do_cleanup ) if ( !do_cleanup )
session->clear();
else if ( Analyzer::get_switcher()->get_context() )
session->cleanup();
else
{ {
DetectionEngine::set_next_packet(); DetectionEngine::set_next_packet();
DetectionEngine de; DetectionEngine de;
session->cleanup(); session->cleanup();
de.get_context()->clear_callbacks();
} }
else
session->clear();
} }
free_flow_data(); free_flow_data();
clean(); clean();
// FIXIT-M cleanup() winds up calling clear() // FIXIT-M cleanup() winds up calling clear()
if ( ssn_client ) if ( ssn_client )
{ {
ssn_client->rem_ref(); ssn_client->rem_ref();
ssn_client = nullptr; ssn_client = nullptr;
 End of changes. 10 change blocks. 
11 lines changed or deleted 16 lines changed or added

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