"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/service_inspectors/http2_inspect/http2_data_frame.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.

http2_data_frame.cc  (snort3-3.1.36.0):http2_data_frame.cc  (snort3-3.1.38.0)
skipping to change at line 30 skipping to change at line 30
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include "http2_data_frame.h" #include "http2_data_frame.h"
#include "protocols/packet.h" #include "protocols/packet.h"
#include "service_inspectors/http_inspect/http_inspect.h" #include "service_inspectors/http_inspect/http_inspect.h"
#include "service_inspectors/http_inspect/http_stream_splitter.h" #include "service_inspectors/http_inspect/http_stream_splitter.h"
#include "http2_dummy_packet.h"
#include "http2_flow_data.h" #include "http2_flow_data.h"
#include "http2_module.h" #include "http2_module.h"
using namespace HttpCommon; using namespace HttpCommon;
using namespace snort; using namespace snort;
using namespace Http2Enums; using namespace Http2Enums;
Http2DataFrame::Http2DataFrame(const uint8_t* header_buffer, const uint32_t head er_len, Http2DataFrame::Http2DataFrame(const uint8_t* header_buffer, const uint32_t head er_len,
const uint8_t* data_buffer_, const uint32_t data_length_, Http2FlowData* ses sion_data_, const uint8_t* data_buffer_, const uint32_t data_length_, Http2FlowData* ses sion_data_,
HttpCommon::SourceId source_id_, Http2Stream* stream_) : HttpCommon::SourceId source_id_, Http2Stream* stream_) :
Http2Frame(header_buffer, header_len, nullptr, 0, session_data_, source_id_, stream_), Http2Frame(header_buffer, header_len, nullptr, 0, session_data_, source_id_, stream_),
data_length(data_length_), data_length(data_length_),
data_buffer(data_buffer_) data_buffer(data_buffer_)
{} {}
bool Http2DataFrame::valid_sequence(Http2Enums::StreamState state) bool Http2DataFrame::valid_sequence(Http2Enums::StreamState state)
{ {
return (state == Http2Enums::STREAM_EXPECT_BODY) || (state == Http2Enums::ST REAM_BODY); return (state == Http2Enums::STREAM_EXPECT_BODY) || (state == Http2Enums::ST REAM_BODY);
} }
void Http2DataFrame::analyze_http1() void Http2DataFrame::analyze_http1(Packet* p)
{ {
Http2DummyPacket dummy_pkt;
dummy_pkt.flow = session_data->flow;
dummy_pkt.packet_flags = (source_id == SRC_CLIENT) ? PKT_FROM_CLIENT : PKT_F
ROM_SERVER;
dummy_pkt.dsize = data_length;
dummy_pkt.data = data_buffer;
dummy_pkt.xtradata_mask = 0;
// FIXIT-E no checks here // FIXIT-E no checks here
session_data->hi->eval(&dummy_pkt); session_data->hi->eval(p, source_id, data_buffer, data_length);
detection_required = dummy_pkt.is_detection_required();
xtradata_mask = dummy_pkt.xtradata_mask;
} }
void Http2DataFrame::clear() void Http2DataFrame::clear(Packet* p)
{ {
Http2DummyPacket dummy_pkt; session_data->hi->clear(p);
dummy_pkt.flow = session_data->flow;
session_data->hi->clear(&dummy_pkt);
} }
void Http2DataFrame::update_stream_state() void Http2DataFrame::update_stream_state()
{ {
switch (stream->get_state(source_id)) switch (stream->get_state(source_id))
{ {
case STREAM_EXPECT_BODY: case STREAM_EXPECT_BODY:
if (data_length > 0) if (data_length > 0)
{ {
session_data->concurrent_files += 1; session_data->concurrent_files += 1;
 End of changes. 6 change blocks. 
16 lines changed or deleted 4 lines changed or added

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