int DecodeConfig::get_max_depth(int decode_depth)
{
- sync_all_depths();
-
if ( file_depth and decode_depth )
return (file_depth > decode_depth) ? file_depth : decode_depth;
xtra_host_id = Stream::reg_xtra_data_cb(get_xtra_host);
xtra_jsnorm_id = Stream::reg_xtra_data_cb(get_xtra_jsnorm);
+ config_decode();
+
return true;
}
break;
case SEC_HEADER:
current_section = new HttpMsgHeader(
- data, dsize, session_data, source_id, buf_owner, flow, params);
+ data, dsize, session_data, source_id, buf_owner, flow, params,
+ decode_conf);
break;
case SEC_BODY_CL:
current_section = new HttpMsgBodyCl(
static int get_xtra_uri(snort::Flow*, uint8_t**, uint32_t*, uint32_t*);
static int get_xtra_host(snort::Flow*, uint8_t** buf, uint32_t* len, uint32_t* type);
static int get_xtra_jsnorm(snort::Flow*, uint8_t**, uint32_t*, uint32_t*);
+ void config_decode() { decode_conf.sync_all_depths(); }
private:
friend HttpApi;
static uint32_t xtra_uri_id;
static uint32_t xtra_host_id;
static uint32_t xtra_jsnorm_id;
+ snort::DecodeConfig decode_conf;
};
#endif
#include "http_api.h"
#include "http_common.h"
#include "http_enum.h"
+#include "http_inspect.h"
#include "http_msg_request.h"
#include "http_msg_body.h"
#include "pub_sub/http_events.h"
HttpMsgHeader::HttpMsgHeader(const uint8_t* buffer, const uint16_t buf_size,
HttpFlowData* session_data_, SourceId source_id_, bool buf_owner, Flow* flow_,
- const HttpParaList* params_) :
- HttpMsgHeadShared(buffer, buf_size, session_data_, source_id_, buf_owner, flow_, params_)
+ const HttpParaList* params_, DecodeConfig decode_conf_) :
+ HttpMsgHeadShared(buffer, buf_size, session_data_, source_id_, buf_owner, flow_, params_),
+ decode_conf(decode_conf_)
{
transaction->set_header(this, source_id);
get_related_sections();
public:
HttpMsgHeader(const uint8_t* buffer, const uint16_t buf_size, HttpFlowData* session_data_,
HttpCommon::SourceId source_id_, bool buf_owner, snort::Flow* flow_,
- const HttpParaList* params_);
+ const HttpParaList* params_, snort::DecodeConfig decode_conf);
HttpEnums::InspectSection get_inspection_section() const override
{ return HttpEnums::IS_HEADER; }
bool detection_required() const override { return true; }