// All the infractions we might find while parsing and analyzing a message
enum Infraction
{
- INF_TRUNCATED = 0,
+ INF_NOT_USED_1 = 0,
INF_HEAD_TOO_LONG,
INF_BAD_REQ_LINE,
INF_BAD_STAT_LINE,
latest_section->analyze();
latest_section->update_flow();
- latest_section->gen_events();
#ifdef REG_TEST
if (NHttpTestManager::use_test_output())
}
body_octets += msg_text.length;
-
- if (tcp_close && (body_octets < data_length))
- infractions += INF_TRUNCATED;
}
void NHttpMsgBody::do_file_processing()
}
}
-void NHttpMsgBody::gen_events()
-{
-}
-
void NHttpMsgBody::print_section(FILE* output)
{
NHttpMsgSection::print_message_title(output, "body");
const NHttpParaList* params_);
void analyze() override;
void print_section(FILE* output) override;
- void gen_events() override;
void update_flow() override;
Field& get_detect_data() { return detect_data; }
const Field& get_detect_buf() const override { return detect_data; }
transaction->set_body(this);
}
-void NHttpMsgChunk::gen_events() { }
-
void NHttpMsgChunk::print_section(FILE* output)
{
NHttpMsgSection::print_message_title(output, "chunked body");
NHttpEnums::SourceId source_id_, bool buf_owner, Flow* flow_,
const NHttpParaList* params_);
void print_section(FILE* output) override;
- void gen_events() override;
void update_flow() override;
};
transaction->set_header(this, source_id);
}
-void NHttpMsgHeader::gen_events()
-{
- if (get_header_count(HEAD_CONTENT_LENGTH) > 1)
- events.create_event(EVENT_MULTIPLE_CONTLEN);
-}
-
void NHttpMsgHeader::print_section(FILE* output)
{
NHttpMsgSection::print_message_title(output, "header");
{
session_data->section_type[source_id] = SEC__NOTCOMPUTE;
+ // FIXIT-L put this test here for now. May want to integrate into the following code and
+ // do more careful checks for inappropriate Content-Length.
+ if (get_header_count(HEAD_CONTENT_LENGTH) > 1)
+ events.create_event(EVENT_MULTIPLE_CONTLEN);
+
// The following logic to determine body type is by no means the last word on this topic.
// FIXIT-H need to distinguish methods such as POST that should have a body from those that
// should not.
NHttpEnums::SourceId source_id_, bool buf_owner, Flow* flow_,
const NHttpParaList* params_);
void print_section(FILE* output) override;
- void gen_events() override;
void update_flow() override;
private:
// Dummy configurations to support MIME processing
// Minimum necessary processing for every message
virtual void analyze() = 0;
- // Internal client that triggers JIT processing for optional inspections
- virtual void gen_events() = 0;
-
// Manages the splitter and communication between message sections
virtual void update_flow() = 0;
start_line.start = msg_text.start;
start_line.length = msg_text.length;
parse_start_line();
+ gen_events();
}
void NHttpMsgStart::derive_version_id()
}
}
-void NHttpMsgStart::gen_events() { }
-
{
public:
void analyze() override;
- void gen_events() override;
protected:
NHttpMsgStart(const uint8_t* buffer, const uint16_t buf_size, NHttpFlowData* session_data_,
: NHttpMsgSection(buffer, buf_size, session_data_, source_id_, buf_owner, flow_, params_)
{ }
virtual void parse_start_line() = 0;
+ virtual void gen_events() {};
void derive_version_id();
Field start_line;
transaction->set_trailer(this, source_id);
}
-void NHttpMsgTrailer::gen_events()
-{
-}
-
void NHttpMsgTrailer::print_section(FILE* output)
{
NHttpMsgSection::print_message_title(output, "trailer");
NHttpEnums::SourceId source_id_, bool buf_owner, Flow* flow_,
const NHttpParaList* params_);
void print_section(FILE* output) override;
- void gen_events() override;
void update_flow() override;
};