From: Tom Peters Date: Wed, 10 Dec 2014 19:41:23 +0000 (-0500) Subject: minor refactors X-Git-Tag: 3.0.0-233~1078^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a815cb7f1905f4f5ac3f7e70cedb8ba42d95e304;p=thirdparty%2Fsnort3.git minor refactors --- diff --git a/src/service_inspectors/nhttp_inspect/nhttp_flow_data.h b/src/service_inspectors/nhttp_inspect/nhttp_flow_data.h index cd5a8d310..27ab2608e 100644 --- a/src/service_inspectors/nhttp_inspect/nhttp_flow_data.h +++ b/src/service_inspectors/nhttp_inspect/nhttp_flow_data.h @@ -56,8 +56,6 @@ private: NHttpStartSplitter start_splitter[2]; NHttpHeaderSplitter header_splitter[2]; NHttpChunkSplitter chunk_splitter[2]; - uint32_t unused_octets_visible[2] = { 0, 0 }; - uint32_t header_octets_visible[2] = { 0, 0 }; uint8_t *section_buffer[2] = { nullptr, nullptr }; int32_t section_buffer_length[2] = { 0, 0 }; bool section_buffer_owned[2] = { true, true }; @@ -72,17 +70,19 @@ private: bool zero_chunk[2] = { false, false }; bool tcp_close[2] = { false, false }; uint64_t infractions[2] = { 0, 0 }; + uint32_t unused_octets_visible[2] = { 0, 0 }; + uint32_t header_octets_visible[2] = { 0, 0 }; // Inspector => StreamSplitter (facts about the message section that is coming next) NHttpEnums::SectionType type_expected[2] = { NHttpEnums::SEC_REQUEST, NHttpEnums::SEC_STATUS }; - int64_t data_length[2] = { NHttpEnums::STAT_NOTPRESENT, NHttpEnums::STAT_NOTPRESENT }; // length of the data from Content-Length field + int64_t data_length[2] = { NHttpEnums::STAT_NOTPRESENT, NHttpEnums::STAT_NOTPRESENT }; // length of the data from Content-Length field // Inspector's internal data about the current message NHttpEnums::VersionId version_id[2] = { NHttpEnums::VERS__NOTPRESENT, NHttpEnums::VERS__NOTPRESENT }; NHttpEnums::MethodId method_id = NHttpEnums::METH__NOTPRESENT; int32_t status_code_num = NHttpEnums::STAT_NOTPRESENT; - int64_t body_octets[2] = { NHttpEnums::STAT_NOTPRESENT, NHttpEnums::STAT_NOTPRESENT }; // number of user data octets seen so far (regular body or chunks) + int64_t body_octets[2] = { NHttpEnums::STAT_NOTPRESENT, NHttpEnums::STAT_NOTPRESENT }; // number of user data octets seen so far (regular body or chunks) // Transaction management including pipelining NHttpTransaction* transaction[2] = { nullptr, nullptr }; diff --git a/src/service_inspectors/nhttp_inspect/nhttp_inspect.cc b/src/service_inspectors/nhttp_inspect/nhttp_inspect.cc index c3059fa18..8d7c761d0 100644 --- a/src/service_inspectors/nhttp_inspect/nhttp_inspect.cc +++ b/src/service_inspectors/nhttp_inspect/nhttp_inspect.cc @@ -78,7 +78,7 @@ bool NHttpInspect::get_buf(unsigned id, Packet*, InspectionBuffer& b) } ProcessResult NHttpInspect::process(const uint8_t* data, const uint16_t dsize, Flow* const flow, SourceId source_id, - bool buf_owner) + bool buf_owner) const { NHttpFlowData* session_data = (NHttpFlowData*)flow->get_application_data(NHttpFlowData::nhttp_flow_id); assert(session_data != nullptr); diff --git a/src/service_inspectors/nhttp_inspect/nhttp_inspect.h b/src/service_inspectors/nhttp_inspect/nhttp_inspect.h index 93aadf8c6..235e5a4e9 100644 --- a/src/service_inspectors/nhttp_inspect/nhttp_inspect.h +++ b/src/service_inspectors/nhttp_inspect/nhttp_inspect.h @@ -50,7 +50,7 @@ private: friend NHttpStreamSplitter; NHttpEnums::ProcessResult process(const uint8_t* data, const uint16_t dsize, Flow* const flow, - NHttpEnums::SourceId source_id_, bool buf_owner); + NHttpEnums::SourceId source_id_, bool buf_owner) const; }; #endif