#ifdef UNITTESTS
static int g_file_data_buffer_id = 0;
+static int g_http_uri_buffer_id = 0;
static int DetectByteExtractTest01(void)
{
goto end;
}
- sm = s->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = s->sm_lists[g_http_uri_buffer_id];
if (sm->type != DETECT_CONTENT) {
result = 0;
goto end;
goto end;
}
- sm = s->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = s->sm_lists[g_http_uri_buffer_id];
if (sm->type != DETECT_CONTENT) {
result = 0;
goto end;
goto end;
}
- sm = s->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = s->sm_lists[g_http_uri_buffer_id];
if (sm->type != DETECT_CONTENT) {
result = 0;
goto end;
goto end;
}
- sm = s->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = s->sm_lists[g_http_uri_buffer_id];
if (sm->type != DETECT_CONTENT) {
result = 0;
goto end;
if (sm->next != NULL)
goto end;
- sm = s->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = s->sm_lists[g_http_uri_buffer_id];
if (sm->type != DETECT_CONTENT) {
result = 0;
goto end;
goto end;
}
- sm = s->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = s->sm_lists[g_http_uri_buffer_id];
if (sm->type != DETECT_CONTENT) {
result = 0;
goto end;
if (sm->next != NULL)
goto end;
- sm = s->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = s->sm_lists[g_http_uri_buffer_id];
if (sm->type != DETECT_CONTENT) {
result = 0;
goto end;
if (sm->next != NULL)
goto end;
- if (s->sm_lists_tail[DETECT_SM_LIST_UMATCH] == NULL) {
+ if (s->sm_lists_tail[g_http_uri_buffer_id] == NULL) {
result = 0;
goto end;
}
- sm = s->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = s->sm_lists[g_http_uri_buffer_id];
if (sm->type != DETECT_CONTENT) {
result = 0;
goto end;
if (sm->next != NULL)
goto end;
- if (s->sm_lists_tail[DETECT_SM_LIST_UMATCH] == NULL) {
+ if (s->sm_lists_tail[g_http_uri_buffer_id] == NULL) {
result = 0;
goto end;
}
- sm = s->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = s->sm_lists[g_http_uri_buffer_id];
if (sm->type != DETECT_CONTENT) {
result = 0;
goto end;
{
#ifdef UNITTESTS
g_file_data_buffer_id = DetectBufferTypeGetByName("file_data");
+ g_http_uri_buffer_id = DetectBufferTypeGetByName("http_uri");
UtRegisterTest("DetectByteExtractTest01", DetectByteExtractTest01);
UtRegisterTest("DetectByteExtractTest02", DetectByteExtractTest02);
int list_type = SigMatchListSMBelongsTo(s, mpm_sm);
if (list_type == DETECT_SM_LIST_PMATCH)
fprintf(fp_engine_analysis_FD, "content\n");
- else if (list_type == DETECT_SM_LIST_UMATCH)
- fprintf(fp_engine_analysis_FD, "http uri content\n");
else if (list_type == DETECT_SM_LIST_HRUDMATCH)
fprintf(fp_engine_analysis_FD, "http raw uri content\n");
else if (list_type == DETECT_SM_LIST_HHDMATCH)
fprintf(rule_engine_analysis_FD, "%s",
payload ? (stream ? "payload and reassembled stream" : "payload") : "reassembled stream");
}
- else if (list_type == DETECT_SM_LIST_UMATCH)
- fprintf(rule_engine_analysis_FD, "http uri content");
else if (list_type == DETECT_SM_LIST_HRUDMATCH)
fprintf(rule_engine_analysis_FD, "http raw uri content");
else if (list_type == DETECT_SM_LIST_HHDMATCH)
const int nlists = DetectBufferTypeMaxId();
const int filedata_id = DetectBufferTypeGetByName("file_data");
const int httpmethod_id = DetectBufferTypeGetByName("http_method");
+ const int httpuri_id = DetectBufferTypeGetByName("http_uri");
if (s->init_data->init_flags & SIG_FLAG_INIT_BIDIREC) {
rule_bidirectional = 1;
http_client_body_buf += 1;
raw_http_buf += 1;
}
- else if (list_id == DETECT_SM_LIST_UMATCH) {
+ else if (list_id == httpuri_id) {
rule_pcre_http += 1;
norm_http_buf += 1;
http_uri_buf += 1;
}
else if (sm->type == DETECT_CONTENT) {
- if (list_id == DETECT_SM_LIST_UMATCH
+ if (list_id == httpuri_id
|| list_id == DETECT_SM_LIST_HHDMATCH
|| list_id == DETECT_SM_LIST_HCDMATCH) {
rule_content_http += 1;
warn_encoding_norm_http_buf += 1;
rule_warning += 1;
}
- if (list_id == DETECT_SM_LIST_UMATCH) {
+ if (list_id == httpuri_id) {
http_uri_buf += 1;
}
else if (list_id == DETECT_SM_LIST_HHDMATCH) {
case DETECT_SM_LIST_PMATCH:
return "packet/stream payload";
- case DETECT_SM_LIST_UMATCH:
- return "http uri";
case DETECT_SM_LIST_HRUDMATCH:
return "http raw uri";
case DETECT_SM_LIST_HCBDMATCH:
#ifdef UNITTESTS
static int g_file_data_buffer_id = 0;
static int g_http_method_buffer_id = 0;
+static int g_http_uri_buffer_id = 0;
/**
* \test Checks if a fast_pattern is registered in a Signature
goto end;
result = 0;
- sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = de_ctx->sig_list->sm_lists[g_http_uri_buffer_id];
while (sm != NULL) {
if (sm->type == DETECT_CONTENT) {
if ( ((DetectContentData *)sm->ctx)->flags &
goto end;
result = 0;
- sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = de_ctx->sig_list->sm_lists[g_http_uri_buffer_id];
while (sm != NULL) {
if (sm->type == DETECT_CONTENT) {
if ( ((DetectContentData *)sm->ctx)->flags &
goto end;
result = 0;
- sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = de_ctx->sig_list->sm_lists[g_http_uri_buffer_id];
DetectContentData *ud = (DetectContentData *)sm->ctx;
if (sm->type == DETECT_CONTENT) {
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
goto end;
result = 0;
- sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = de_ctx->sig_list->sm_lists[g_http_uri_buffer_id];
DetectContentData *ud = (DetectContentData *)sm->ctx;
if (sm->type == DETECT_CONTENT) {
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP) &&
"(uricontent:\"one\"; uricontent:\"two\"; within:30; uricontent:\"two\"; fast_pattern:only; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP) &&
"(uricontent:\"one\"; uricontent:\"two\"; offset:30; uricontent:\"two\"; fast_pattern:only; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP) &&
"(uricontent:\"one\"; uricontent:\"two\"; depth:30; uricontent:\"two\"; fast_pattern:only; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP) &&
"(uricontent:!\"one\"; fast_pattern; uricontent:\"two\"; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_NEGATED &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
"(uricontent:\"one\"; uricontent:\"oneonetwo\"; fast_pattern:3,4; uricontent:\"three\"; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; uricontent:\"oneonetwo\"; fast_pattern:3,4; uricontent:\"three\"; distance:30; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; uricontent:\"oneonetwo\"; fast_pattern:3,4; uricontent:\"three\"; within:30; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; uricontent:\"oneonetwo\"; fast_pattern:3,4; uricontent:\"three\"; offset:30; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; uricontent:\"oneonetwo\"; fast_pattern:3,4; uricontent:\"three\"; depth:30; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; uricontent:\"two\"; distance:10; uricontent:\"oneonethree\"; fast_pattern:3,4; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; uricontent:\"two\"; within:10; uricontent:\"oneonethree\"; fast_pattern:3,4; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; uricontent:\"two\"; offset:10; uricontent:\"oneonethree\"; fast_pattern:3,4; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; uricontent:\"two\"; depth:10; uricontent:\"oneonethree\"; fast_pattern:3,4; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; uricontent:!\"oneonetwo\"; fast_pattern:3,4; uricontent:\"three\"; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_NEGATED &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
"(uricontent:\"one\"; content:!\"oneonetwo\"; fast_pattern:3,4; http_uri; uricontent:\"three\"; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_NEGATED &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
goto end;
result = 0;
- sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = de_ctx->sig_list->sm_lists[g_http_uri_buffer_id];
while (sm != NULL) {
if (sm->type == DETECT_CONTENT) {
if ( ((DetectContentData *)sm->ctx)->flags &
goto end;
result = 0;
- sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = de_ctx->sig_list->sm_lists[g_http_uri_buffer_id];
while (sm != NULL) {
if (sm->type == DETECT_CONTENT) {
if ( ((DetectContentData *)sm->ctx)->flags &
goto end;
result = 0;
- sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = de_ctx->sig_list->sm_lists[g_http_uri_buffer_id];
DetectContentData *ud = (DetectContentData *)sm->ctx;
if (sm->type == DETECT_CONTENT) {
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
goto end;
result = 0;
- sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = de_ctx->sig_list->sm_lists[g_http_uri_buffer_id];
DetectContentData *ud = (DetectContentData *)sm->ctx;
if (sm->type == DETECT_CONTENT) {
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP) &&
"(uricontent:\"one\"; uricontent:\"two\"; within:30; content:\"two\"; fast_pattern:only; http_uri; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP) &&
"(uricontent:\"one\"; uricontent:\"two\"; offset:30; content:\"two\"; fast_pattern:only; http_uri; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP) &&
"(uricontent:\"one\"; uricontent:\"two\"; depth:30; content:\"two\"; fast_pattern:only; http_uri; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP) &&
"(content:!\"one\"; fast_pattern; http_uri; uricontent:\"two\"; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_NEGATED &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
"(uricontent:\"one\"; content:\"oneonetwo\"; fast_pattern:3,4; http_uri; uricontent:\"three\"; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; content:\"oneonetwo\"; fast_pattern:3,4; http_uri; uricontent:\"three\"; distance:30; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; content:\"oneonetwo\"; fast_pattern:3,4; http_uri; uricontent:\"three\"; within:30; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; content:\"oneonetwo\"; fast_pattern:3,4; http_uri; uricontent:\"three\"; offset:30; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; content:\"oneonetwo\"; fast_pattern:3,4; http_uri; uricontent:\"three\"; depth:30; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; uricontent:\"two\"; distance:10; content:\"oneonethree\"; fast_pattern:3,4; http_uri; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; uricontent:\"two\"; within:10; content:\"oneonethree\"; fast_pattern:3,4; http_uri; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; uricontent:\"two\"; offset:10; content:\"oneonethree\"; fast_pattern:3,4; http_uri; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; uricontent:\"two\"; depth:10; content:\"oneonethree\"; fast_pattern:3,4; http_uri; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
ud->flags & DETECT_CONTENT_FAST_PATTERN_CHOP &&
"(uricontent:\"one\"; content:!\"oneonetwo\"; fast_pattern:3,4; http_uri; uricontent:\"three\"; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_NEGATED &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
"(uricontent:\"one\"; content:!\"oneonetwo\"; fast_pattern:3,4; http_uri; uricontent:\"three\"; sid:1;)");
if (de_ctx->sig_list == NULL)
goto end;
- DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
+ DetectContentData *ud = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
if (ud->flags & DETECT_CONTENT_FAST_PATTERN &&
ud->flags & DETECT_CONTENT_NEGATED &&
!(ud->flags & DETECT_CONTENT_FAST_PATTERN_ONLY) &&
#ifdef UNITTESTS
g_file_data_buffer_id = DetectBufferTypeGetByName("file_data");
g_http_method_buffer_id = DetectBufferTypeGetByName("http_method");
+ g_http_uri_buffer_id = DetectBufferTypeGetByName("http_uri");
UtRegisterTest("DetectFastPatternTest01", DetectFastPatternTest01);
UtRegisterTest("DetectFastPatternTest02", DetectFastPatternTest02);
#include "stream-tcp-reassemble.h"
+static int g_http_uri_buffer_id = 0;
+
/**
* \test Checks if a http_cookie is registered in a Signature, if content is not
* specified in the signature
*/
-int DetectHttpCookieTest01(void)
+static int DetectHttpCookieTest01(void)
{
DetectEngineCtx *de_ctx = NULL;
int result = 0;
* \test Checks if a http_cookie is registered in a Signature, if some parameter
* is specified with http_cookie in the signature
*/
-int DetectHttpCookieTest02(void)
+static int DetectHttpCookieTest02(void)
{
DetectEngineCtx *de_ctx = NULL;
int result = 0;
/**
* \test Checks if a http_cookie is registered in a Signature
*/
-int DetectHttpCookieTest03(void)
+static int DetectHttpCookieTest03(void)
{
SigMatch *sm = NULL;
DetectEngineCtx *de_ctx = NULL;
* \test Checks if a http_cookie is registered in a Signature, when fast_pattern
* is also specified in the signature (now it should)
*/
-int DetectHttpCookieTest04(void)
+static int DetectHttpCookieTest04(void)
{
DetectEngineCtx *de_ctx = NULL;
int result = 0;
* \test Checks if a http_cookie is registered in a Signature, when rawbytes is
* also specified in the signature
*/
-int DetectHttpCookieTest05(void)
+static int DetectHttpCookieTest05(void)
{
DetectEngineCtx *de_ctx = NULL;
int result = 0;
* \test Checks if a http_cookie is registered in a Signature, when rawbytes is
* also specified in the signature
*/
-int DetectHttpCookieTest06(void)
+static int DetectHttpCookieTest06(void)
{
DetectEngineCtx *de_ctx = NULL;
int result = 0;
if (s->sm_lists[DETECT_SM_LIST_HCDMATCH]->type != DETECT_CONTENT)
goto end;
- if (s->sm_lists[DETECT_SM_LIST_UMATCH] == NULL) {
+ if (s->sm_lists[g_http_uri_buffer_id] == NULL) {
printf("expected another SigMatch, got NULL: ");
goto end;
}
- if (s->sm_lists[DETECT_SM_LIST_UMATCH]->type != DETECT_CONTENT) {
+ if (s->sm_lists[g_http_uri_buffer_id]->type != DETECT_CONTENT) {
goto end;
}
void DetectHttpCookieRegisterTests (void)
{
#ifdef UNITTESTS /* UNITTESTS */
+ g_http_uri_buffer_id = DetectBufferTypeGetByName("http_uri");
+
UtRegisterTest("DetectHttpCookieTest01", DetectHttpCookieTest01);
UtRegisterTest("DetectHttpCookieTest02", DetectHttpCookieTest02);
UtRegisterTest("DetectHttpCookieTest03", DetectHttpCookieTest03);
#include "detect-engine-uri.h"
#include "stream-tcp.h"
-int DetectHttpUriSetup (DetectEngineCtx *, Signature *, char *);
-void DetectHttpUriRegisterTests(void);
+static void DetectHttpUriRegisterTests(void);
+static void DetectHttpUriSetupCallback(Signature *s);
+
+static int g_http_uri_buffer_id = 0;
/**
* \brief Registration function for keyword: http_uri
sigmatch_table[DETECT_AL_HTTP_URI].flags |= SIGMATCH_NOOPT;
sigmatch_table[DETECT_AL_HTTP_URI].flags |= SIGMATCH_PAYLOAD;
- DetectMpmAppLayerRegister("http_uri", SIG_FLAG_TOSERVER,
- DETECT_SM_LIST_UMATCH, 2,
+ DetectAppLayerMpmRegister("http_uri", SIG_FLAG_TOSERVER, 2,
PrefilterTxUriRegister);
- DetectAppLayerInspectEngineRegister(ALPROTO_HTTP, SIG_FLAG_TOSERVER,
- DETECT_SM_LIST_UMATCH,
+ DetectAppLayerInspectEngineRegister2("http_uri", ALPROTO_HTTP, SIG_FLAG_TOSERVER,
DetectEngineInspectHttpUri);
+
+ DetectBufferTypeSetDescriptionByName("http_uri",
+ "http request uri");
+
+ DetectBufferTypeRegisterSetupCallback("http_uri",
+ DetectHttpUriSetupCallback);
+
+ g_http_uri_buffer_id = DetectBufferTypeGetByName("http_uri");
}
{
return DetectEngineContentModifierBufferSetup(de_ctx, s, str,
DETECT_AL_HTTP_URI,
- DETECT_SM_LIST_UMATCH,
+ g_http_uri_buffer_id,
ALPROTO_HTTP,
NULL);
}
+static void DetectHttpUriSetupCallback(Signature *s)
+{
+ SCLogDebug("callback invoked by %u", s->id);
+ s->mask |= SIG_MASK_REQUIRE_HTTP_STATE;
+}
/******************************** UNITESTS **********************************/
#ifdef UNITTESTS
+#include "detect-isdataat.h"
#include "stream-tcp-reassemble.h"
/**
* \test Checks if a http_uri is registered in a Signature, if content is not
* specified in the signature
*/
-int DetectHttpUriTest01(void)
+static int DetectHttpUriTest01(void)
{
DetectEngineCtx *de_ctx = NULL;
int result = 0;
* \test Checks if a http_uri is registered in a Signature, if some parameter
* is specified with http_uri in the signature
*/
-int DetectHttpUriTest02(void)
+static int DetectHttpUriTest02(void)
{
DetectEngineCtx *de_ctx = NULL;
int result = 0;
/**
* \test Checks if a http_uri is registered in a Signature
*/
-int DetectHttpUriTest03(void)
+static int DetectHttpUriTest03(void)
{
SigMatch *sm = NULL;
DetectEngineCtx *de_ctx = NULL;
goto end;
}
- sm = de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH];
+ sm = de_ctx->sig_list->sm_lists[g_http_uri_buffer_id];
if (sm == NULL) {
printf("no sigmatch(es): ");
goto end;
* \test Checks if a http_uri is registered in a Signature, when rawbytes is
* also specified in the signature
*/
-int DetectHttpUriTest04(void)
+static int DetectHttpUriTest04(void)
{
DetectEngineCtx *de_ctx = NULL;
int result = 0;
* \test Checks if a http_uri is successfully converted to a uricontent
*
*/
-int DetectHttpUriTest05(void)
+static int DetectHttpUriTest05(void)
{
DetectEngineCtx *de_ctx = NULL;
Signature *s = NULL;
printf("sig failed to parse\n");
goto end;
}
- if (s->sm_lists[DETECT_SM_LIST_UMATCH] == NULL)
+ if (s->sm_lists[g_http_uri_buffer_id] == NULL)
goto end;
- if (s->sm_lists[DETECT_SM_LIST_UMATCH]->type != DETECT_CONTENT) {
+ if (s->sm_lists[g_http_uri_buffer_id]->type != DETECT_CONTENT) {
printf("wrong type\n");
goto end;
}
char *str = "we are testing http_uri keyword";
- int uricomp = memcmp((const char *)((DetectContentData*) s->sm_lists[DETECT_SM_LIST_UMATCH]->ctx)->content, str, strlen(str)-1);
- int urilen = ((DetectContentData*) s->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx)->content_len;
+ int uricomp = memcmp((const char *)((DetectContentData*) s->sm_lists[g_http_uri_buffer_id]->ctx)->content, str, strlen(str)-1);
+ int urilen = ((DetectContentData*) s->sm_lists_tail[g_http_uri_buffer_id]->ctx)->content_len;
if (uricomp != 0 ||
urilen != strlen("we are testing http_uri keyword")) {
printf("sig failed to parse, content not setup properly\n");
return result;
}
-int DetectHttpUriTest12(void)
+static int DetectHttpUriTest12(void)
{
DetectEngineCtx *de_ctx = NULL;
int result = 0;
goto end;
}
- if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH] == NULL) {
- printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH] == NULL\n");
+ if (de_ctx->sig_list->sm_lists[g_http_uri_buffer_id] == NULL) {
+ printf("de_ctx->sig_list->sm_lists[g_http_uri_buffer_id] == NULL\n");
goto end;
}
- DetectContentData *ud1 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
- DetectContentData *ud2 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud1 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
+ DetectContentData *ud2 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud1->flags != DETECT_CONTENT_RELATIVE_NEXT ||
memcmp(ud1->content, "one", ud1->content_len) != 0 ||
ud2->flags != DETECT_CONTENT_DISTANCE ||
return result;
}
-int DetectHttpUriTest13(void)
+static int DetectHttpUriTest13(void)
{
DetectEngineCtx *de_ctx = NULL;
int result = 0;
goto end;
}
- if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH] == NULL) {
- printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH] == NULL\n");
+ if (de_ctx->sig_list->sm_lists[g_http_uri_buffer_id] == NULL) {
+ printf("de_ctx->sig_list->sm_lists[g_http_uri_buffer_id] == NULL\n");
goto end;
}
- DetectContentData *ud1 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
- DetectContentData *ud2 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud1 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
+ DetectContentData *ud2 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud1->flags != DETECT_CONTENT_RELATIVE_NEXT ||
memcmp(ud1->content, "one", ud1->content_len) != 0 ||
ud2->flags != DETECT_CONTENT_WITHIN ||
return result;
}
-int DetectHttpUriTest14(void)
+static int DetectHttpUriTest14(void)
{
DetectEngineCtx *de_ctx = NULL;
int result = 0;
return result;
}
-int DetectHttpUriTest15(void)
+static int DetectHttpUriTest15(void)
{
DetectEngineCtx *de_ctx = NULL;
int result = 0;
goto end;
}
- if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH] == NULL) {
- printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH] == NULL\n");
+ if (de_ctx->sig_list->sm_lists[g_http_uri_buffer_id] == NULL) {
+ printf("de_ctx->sig_list->sm_lists[g_http_uri_buffer_id] == NULL\n");
goto end;
}
- DetectContentData *cd = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *cd = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (memcmp(cd->content, "one", cd->content_len) != 0 ||
cd->flags != DETECT_CONTENT_WITHIN) {
goto end;
return result;
}
-int DetectHttpUriTest16(void)
+static int DetectHttpUriTest16(void)
{
DetectEngineCtx *de_ctx = NULL;
int result = 0;
return result;
}
-int DetectHttpUriTest17(void)
+static int DetectHttpUriTest17(void)
{
DetectEngineCtx *de_ctx = NULL;
int result = 0;
goto end;
}
- if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH] == NULL) {
- printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH] == NULL\n");
+ if (de_ctx->sig_list->sm_lists[g_http_uri_buffer_id] == NULL) {
+ printf("de_ctx->sig_list->sm_lists[g_http_uri_buffer_id] == NULL\n");
goto end;
}
- DetectContentData *ud1 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
- DetectContentData *ud2 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud1 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
+ DetectContentData *ud2 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud1->flags != DETECT_CONTENT_RELATIVE_NEXT ||
memcmp(ud1->content, "one", ud1->content_len) != 0 ||
ud2->flags != DETECT_CONTENT_DISTANCE ||
return result;
}
-int DetectHttpUriTest18(void)
+static int DetectHttpUriTest18(void)
{
DetectEngineCtx *de_ctx = NULL;
int result = 0;
goto end;
}
- if (de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH] == NULL) {
- printf("de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH] == NULL\n");
+ if (de_ctx->sig_list->sm_lists[g_http_uri_buffer_id] == NULL) {
+ printf("de_ctx->sig_list->sm_lists[g_http_uri_buffer_id] == NULL\n");
goto end;
}
- DetectContentData *ud1 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->prev->ctx;
- DetectContentData *ud2 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ DetectContentData *ud1 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->prev->ctx;
+ DetectContentData *ud2 = (DetectContentData *)de_ctx->sig_list->sm_lists_tail[g_http_uri_buffer_id]->ctx;
if (ud1->flags != DETECT_CONTENT_RELATIVE_NEXT ||
memcmp(ud1->content, "one", ud1->content_len) != 0 ||
ud2->flags != DETECT_CONTENT_WITHIN ||
return result;
}
+static int DetectHttpUriIsdataatParseTest(void)
+{
+ DetectEngineCtx *de_ctx = DetectEngineCtxInit();
+ FAIL_IF_NULL(de_ctx);
+ de_ctx->flags |= DE_QUIET;
+
+ Signature *s = DetectEngineAppendSig(de_ctx,
+ "alert tcp any any -> any any ("
+ "content:\"one\"; http_uri; "
+ "isdataat:!4,relative; sid:1;)");
+ FAIL_IF_NULL(s);
+
+ SigMatch *sm = s->init_data->smlists_tail[g_http_uri_buffer_id];
+ FAIL_IF_NULL(sm);
+ FAIL_IF_NOT(sm->type == DETECT_ISDATAAT);
+
+ DetectIsdataatData *data = (DetectIsdataatData *)sm->ctx;
+ FAIL_IF_NOT(data->flags & ISDATAAT_RELATIVE);
+ FAIL_IF_NOT(data->flags & ISDATAAT_NEGATED);
+ FAIL_IF(data->flags & ISDATAAT_RAWBYTES);
+
+ DetectEngineCtxFree(de_ctx);
+ PASS;
+}
+
#endif /* UNITTESTS */
/**
* \brief Register the UNITTESTS for the http_uri keyword
*/
-void DetectHttpUriRegisterTests (void)
+static void DetectHttpUriRegisterTests (void)
{
#ifdef UNITTESTS /* UNITTESTS */
UtRegisterTest("DetectHttpUriTest01", DetectHttpUriTest01);
UtRegisterTest("DetectHttpUriTest16", DetectHttpUriTest16);
UtRegisterTest("DetectHttpUriTest17", DetectHttpUriTest17);
UtRegisterTest("DetectHttpUriTest18", DetectHttpUriTest18);
+
+ UtRegisterTest("DetectHttpUriIsdataatParseTest",
+ DetectHttpUriIsdataatParseTest);
#endif /* UNITTESTS */
}
#define _DETECT_HTTP_URI_H
/* prototypes */
+int DetectHttpUriSetup (DetectEngineCtx *, Signature *, char *);
void DetectHttpUriRegister (void);
-int DetectHttpUriSetup(DetectEngineCtx *de_ctx, Signature *s, char *str);
-int DetectHttpUriDoMatch(DetectEngineThreadCtx *det_ctx, Signature *s,
- SigMatch *sm, Flow *f, uint8_t flags, void *state);
-
#endif /* _DETECT_HTTP_URI_H */
return result;
}
-int DetectIsdataatTestParse07(void)
-{
- DetectEngineCtx *de_ctx = NULL;
- int result = 0;
- Signature *s = NULL;
- DetectIsdataatData *data = NULL;
-
- de_ctx = DetectEngineCtxInit();
- if (de_ctx == NULL)
- goto end;
-
- de_ctx->flags |= DE_QUIET;
- de_ctx->sig_list = SigInit(de_ctx, "alert tcp any any -> any any "
- "(msg:\"Testing bytejump_body\"; "
- "uricontent:\"one\"; "
- "isdataat:!4,relative; sid:1;)");
- if (de_ctx->sig_list == NULL) {
- goto end;
- }
-
- s = de_ctx->sig_list;
- if (s->sm_lists_tail[DETECT_SM_LIST_UMATCH] == NULL) {
- goto end;
- }
-
- result = 1;
-
- result &= (s->sm_lists_tail[DETECT_SM_LIST_UMATCH]->type == DETECT_ISDATAAT);
- data = (DetectIsdataatData *)s->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
- if ( !(data->flags & ISDATAAT_RELATIVE) ||
- (data->flags & ISDATAAT_RAWBYTES) ||
- !(data->flags & ISDATAAT_NEGATED) ) {
- result = 0;
- goto end;
- }
-
- end:
- SigGroupCleanup(de_ctx);
- SigCleanSignatures(de_ctx);
- DetectEngineCtxFree(de_ctx);
-
- return result;
-}
-
-int DetectIsdataatTestParse08(void)
-{
- DetectEngineCtx *de_ctx = NULL;
- int result = 0;
- Signature *s = NULL;
- DetectIsdataatData *data = NULL;
-
- de_ctx = DetectEngineCtxInit();
- if (de_ctx == NULL)
- goto end;
-
- de_ctx->flags |= DE_QUIET;
- de_ctx->sig_list = SigInit(de_ctx, "alert tcp any any -> any any "
- "(msg:\"Testing bytejump_body\"; "
- "content:\"one\"; http_uri; "
- "isdataat:!4,relative; sid:1;)");
- if (de_ctx->sig_list == NULL) {
- goto end;
- }
-
- s = de_ctx->sig_list;
- if (s->sm_lists_tail[DETECT_SM_LIST_UMATCH] == NULL) {
- goto end;
- }
-
- result = 1;
-
- result &= (s->sm_lists_tail[DETECT_SM_LIST_UMATCH]->type == DETECT_ISDATAAT);
- data = (DetectIsdataatData *)s->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
- if ( !(data->flags & ISDATAAT_RELATIVE) ||
- (data->flags & ISDATAAT_RAWBYTES) ||
- !(data->flags & ISDATAAT_NEGATED) ) {
- result = 0;
- goto end;
- }
-
- end:
- SigGroupCleanup(de_ctx);
- SigCleanSignatures(de_ctx);
- DetectEngineCtxFree(de_ctx);
-
- return result;
-}
-
int DetectIsdataatTestParse09(void)
{
DetectEngineCtx *de_ctx = NULL;
UtRegisterTest("DetectIsdataatTestParse04", DetectIsdataatTestParse04);
UtRegisterTest("DetectIsdataatTestParse05", DetectIsdataatTestParse05);
UtRegisterTest("DetectIsdataatTestParse06", DetectIsdataatTestParse06);
- UtRegisterTest("DetectIsdataatTestParse07", DetectIsdataatTestParse07);
- UtRegisterTest("DetectIsdataatTestParse08", DetectIsdataatTestParse08);
UtRegisterTest("DetectIsdataatTestParse09", DetectIsdataatTestParse09);
UtRegisterTest("DetectIsdataatTestParse10", DetectIsdataatTestParse10);
UtRegisterTest("DetectIsdataatTestParse11", DetectIsdataatTestParse11);
SigMatchAppendSMToList(s, sm, list);
} else if (lua->flags & DATATYPE_HTTP_REQUEST_BODY)
SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_HCBDMATCH);
- else if (lua->flags & DATATYPE_HTTP_URI)
- SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_UMATCH);
- else if (lua->flags & DATATYPE_HTTP_URI_RAW)
+ else if (lua->flags & DATATYPE_HTTP_URI) {
+ int list = DetectBufferTypeGetByName("http_uri");
+ SigMatchAppendSMToList(s, sm, list);
+ } else if (lua->flags & DATATYPE_HTTP_URI_RAW)
SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_HRUDMATCH);
else if (lua->flags & DATATYPE_HTTP_REQUEST_COOKIE)
SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_HCDMATCH);
switch (list) {
CASE_CODE_STRING(DETECT_SM_LIST_MATCH, "packet");
CASE_CODE_STRING(DETECT_SM_LIST_PMATCH, "payload");
- CASE_CODE_STRING(DETECT_SM_LIST_UMATCH, "http_uri");
CASE_CODE_STRING(DETECT_SM_LIST_HRUDMATCH, "http_raw_uri");
CASE_CODE_STRING(DETECT_SM_LIST_HCBDMATCH, "http_client_body");
CASE_CODE_STRING(DETECT_SM_LIST_HHDMATCH, "http_header");
switch (list) {
CASE_CODE(DETECT_SM_LIST_MATCH);
CASE_CODE(DETECT_SM_LIST_PMATCH);
- CASE_CODE(DETECT_SM_LIST_UMATCH);
CASE_CODE(DETECT_SM_LIST_HRUDMATCH);
CASE_CODE(DETECT_SM_LIST_HCBDMATCH);
CASE_CODE(DETECT_SM_LIST_HHDMATCH);
continue;
if (fd->flags & FLOW_PKT_TOCLIENT) {
- /* check for uricontent + from_server/to_client */
- if (s->init_data->smlists[DETECT_SM_LIST_UMATCH] != NULL ||
- s->init_data->smlists[DETECT_SM_LIST_HRUDMATCH] != NULL ||
+ /* check for request + from_server/to_client */
+ if (s->init_data->smlists[DETECT_SM_LIST_HRUDMATCH] != NULL ||
s->init_data->smlists[DETECT_SM_LIST_HCBDMATCH] != NULL ||
s->init_data->smlists[DETECT_SM_LIST_HUADMATCH] != NULL) {
SCLogError(SC_ERR_INVALID_SIGNATURE, "can't use uricontent "
}
}
- if (s->init_data->smlists_tail[DETECT_SM_LIST_UMATCH] ||
- s->init_data->smlists_tail[DETECT_SM_LIST_HRUDMATCH] ||
+ if (s->init_data->smlists_tail[DETECT_SM_LIST_HRUDMATCH] ||
s->init_data->smlists_tail[DETECT_SM_LIST_HCBDMATCH] ||
s->init_data->smlists_tail[DETECT_SM_LIST_HHDMATCH] ||
s->init_data->smlists_tail[DETECT_SM_LIST_HRHDMATCH] ||
/* buffer selection */
- case 'U': /* snort's option */
+ case 'U': { /* snort's option */
if (pd->flags & DETECT_PCRE_RAWBYTES) {
SCLogError(SC_ERR_INVALID_SIGNATURE, "regex modifier 'U' inconsistent with 'B'");
goto error;
}
- *sm_list = DetectPcreSetList(*sm_list, DETECT_SM_LIST_UMATCH);
+ int list = DetectBufferTypeGetByName("http_uri");
+ *sm_list = DetectPcreSetList(*sm_list, list);
break;
+ }
case 'V':
if (pd->flags & DETECT_PCRE_RAWBYTES) {
SCLogError(SC_ERR_INVALID_SIGNATURE, "regex modifier 'V' inconsistent with 'B'");
case 'D': /* snort's option */
*sm_list = DetectPcreSetList(*sm_list, DETECT_SM_LIST_HRHDMATCH);
break;
- case 'M': /* snort's option */
+ case 'M': { /* snort's option */
if (pd->flags & DETECT_PCRE_RAWBYTES) {
SCLogError(SC_ERR_INVALID_SIGNATURE, "regex modifier 'M' inconsistent with 'B'");
goto error;
int list = DetectBufferTypeGetByName("http_method");
*sm_list = DetectPcreSetList(*sm_list, list);
break;
+ }
case 'C': /* snort's option */
if (pd->flags & DETECT_PCRE_RAWBYTES) {
SCLogError(SC_ERR_INVALID_SIGNATURE, "regex modifier 'C' inconsistent with 'B'");
if (DetectPcreParseCapture(regexstr, de_ctx, pd) < 0)
goto error;
- if (parsed_sm_list == DETECT_SM_LIST_UMATCH ||
- parsed_sm_list == DETECT_SM_LIST_HRUDMATCH ||
+ if (parsed_sm_list == DETECT_SM_LIST_HRUDMATCH ||
parsed_sm_list == DETECT_SM_LIST_HCBDMATCH ||
parsed_sm_list == DETECT_SM_LIST_HHDMATCH ||
parsed_sm_list == DETECT_SM_LIST_HRHDMATCH ||
sm_list = parsed_sm_list;
break;
- case DETECT_SM_LIST_UMATCH:
case DETECT_SM_LIST_HRUDMATCH:
case DETECT_SM_LIST_HHDMATCH:
case DETECT_SM_LIST_HRHDMATCH:
/* prototypes */
static int DetectUricontentSetup (DetectEngineCtx *, Signature *, char *);
-void HttpUriRegisterTests(void);
+static void DetectUricontentRegisterTests(void);
+static void DetectUricontentFree(void *);
-int DetectAppLayerUricontentMatch (ThreadVars *, DetectEngineThreadCtx *,
- Flow *, uint8_t , void *,
- Signature *, SigMatch *);
-void DetectUricontentFree(void *);
+static int g_http_uri_buffer_id = 0;
/**
* \brief Registration function for uricontent: keyword
sigmatch_table[DETECT_URICONTENT].Match = NULL;
sigmatch_table[DETECT_URICONTENT].Setup = DetectUricontentSetup;
sigmatch_table[DETECT_URICONTENT].Free = DetectUricontentFree;
- sigmatch_table[DETECT_URICONTENT].RegisterTests = HttpUriRegisterTests;
+ sigmatch_table[DETECT_URICONTENT].RegisterTests = DetectUricontentRegisterTests;
sigmatch_table[DETECT_URICONTENT].flags |= SIGMATCH_PAYLOAD;
+
+ g_http_uri_buffer_id = DetectBufferTypeRegister("http_uri");
}
/**
#ifdef UNITTESTS
+#include "detect-isdataat.h"
#include "stream-tcp-reassemble.h"
/** \test Test case where path traversal has been sent as a path string in the
"\" Test uricontent\"; content:\"me\"; uricontent:\"me\"; sid:1;)");
FAIL_IF_NULL(s);
- BUG_ON(s->sm_lists[DETECT_SM_LIST_UMATCH] == NULL);
- FAIL_IF_NOT(de_ctx->sig_list->sm_lists[DETECT_SM_LIST_UMATCH]->type == DETECT_CONTENT);
+ BUG_ON(s->sm_lists[g_http_uri_buffer_id] == NULL);
+ FAIL_IF_NOT(de_ctx->sig_list->sm_lists[g_http_uri_buffer_id]->type == DETECT_CONTENT);
DetectEngineCtxFree(de_ctx);
PASS;
"\" Test uricontent\"; "
"uricontent:\"foo\"; sid:1;)");
if (s == NULL ||
- s->sm_lists[DETECT_SM_LIST_UMATCH] == NULL ||
+ s->sm_lists[g_http_uri_buffer_id] == NULL ||
s->sm_lists[DETECT_SM_LIST_PMATCH] != NULL ||
s->sm_lists[DETECT_SM_LIST_MATCH] != NULL)
{
"\" Test uricontent and content\"; "
"uricontent:\"foo\"; content:\"bar\";sid:1;)");
if (s == NULL ||
- s->sm_lists[DETECT_SM_LIST_UMATCH] == NULL ||
+ s->sm_lists[g_http_uri_buffer_id] == NULL ||
s->sm_lists[DETECT_SM_LIST_PMATCH] == NULL ||
s->sm_lists[DETECT_SM_LIST_MATCH] != NULL)
{
"uricontent:\"foo\"; content:\"bar\";"
" depth:10; offset: 5; sid:1;)");
if (s == NULL ||
- s->sm_lists[DETECT_SM_LIST_UMATCH] == NULL ||
+ s->sm_lists[g_http_uri_buffer_id] == NULL ||
s->sm_lists[DETECT_SM_LIST_PMATCH] == NULL ||
((DetectContentData *)s->sm_lists[DETECT_SM_LIST_PMATCH]->ctx)->depth != 15 ||
((DetectContentData *)s->sm_lists[DETECT_SM_LIST_PMATCH]->ctx)->offset != 5 ||
"content:\"foo\"; uricontent:\"bar\";"
" depth:10; offset: 5; sid:1;)");
if (s == NULL ||
- s->sm_lists[DETECT_SM_LIST_UMATCH] == NULL ||
+ s->sm_lists[g_http_uri_buffer_id] == NULL ||
s->sm_lists[DETECT_SM_LIST_PMATCH] == NULL ||
- ((DetectContentData *)s->sm_lists[DETECT_SM_LIST_UMATCH]->ctx)->depth != 15 ||
- ((DetectContentData *)s->sm_lists[DETECT_SM_LIST_UMATCH]->ctx)->offset != 5 ||
+ ((DetectContentData *)s->sm_lists[g_http_uri_buffer_id]->ctx)->depth != 15 ||
+ ((DetectContentData *)s->sm_lists[g_http_uri_buffer_id]->ctx)->offset != 5 ||
s->sm_lists[DETECT_SM_LIST_MATCH] != NULL)
{
printf("sig 4 failed to parse: ");
"\"two_contents\"; within:30; sid:1;)");
if (s == NULL) {
goto end;
- } else if (s->sm_lists[DETECT_SM_LIST_UMATCH] == NULL ||
+ } else if (s->sm_lists[g_http_uri_buffer_id] == NULL ||
s->sm_lists[DETECT_SM_LIST_PMATCH] == NULL ||
((DetectContentData*) s->sm_lists[DETECT_SM_LIST_PMATCH]->ctx)->depth != 15 ||
((DetectContentData*) s->sm_lists[DETECT_SM_LIST_PMATCH]->ctx)->offset != 5 ||
"\"two_uricontents\"; within:30; sid:1;)");
if (s == NULL) {
goto end;
- } else if (s->sm_lists[DETECT_SM_LIST_UMATCH] == NULL ||
+ } else if (s->sm_lists[g_http_uri_buffer_id] == NULL ||
s->sm_lists[DETECT_SM_LIST_PMATCH] == NULL ||
((DetectContentData*) s->sm_lists[DETECT_SM_LIST_PMATCH]->ctx)->depth != 15 ||
((DetectContentData*) s->sm_lists[DETECT_SM_LIST_PMATCH]->ctx)->offset != 5 ||
- ((DetectContentData*) s->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx)->within != 30 ||
+ ((DetectContentData*) s->sm_lists_tail[g_http_uri_buffer_id]->ctx)->within != 30 ||
s->sm_lists[DETECT_SM_LIST_MATCH] != NULL)
{
printf("sig 8 failed to parse: ");
- DetectUricontentPrint((DetectContentData*) s->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx);
+ DetectUricontentPrint((DetectContentData*) s->sm_lists_tail[g_http_uri_buffer_id]->ctx);
goto end;
}
if (s == NULL) {
goto end;
} else if (
- s->sm_lists[DETECT_SM_LIST_UMATCH] == NULL ||
+ s->sm_lists[g_http_uri_buffer_id] == NULL ||
s->sm_lists[DETECT_SM_LIST_PMATCH] == NULL ||
((DetectContentData*) s->sm_lists[DETECT_SM_LIST_PMATCH]->ctx)->depth != 15 ||
((DetectContentData*) s->sm_lists[DETECT_SM_LIST_PMATCH]->ctx)->offset != 5 ||
if (s == NULL) {
goto end;
} else if (
- s->sm_lists[DETECT_SM_LIST_UMATCH] == NULL ||
+ s->sm_lists[g_http_uri_buffer_id] == NULL ||
s->sm_lists[DETECT_SM_LIST_PMATCH] == NULL ||
((DetectContentData*) s->sm_lists[DETECT_SM_LIST_PMATCH]->ctx)->depth != 15 ||
((DetectContentData*) s->sm_lists[DETECT_SM_LIST_PMATCH]->ctx)->offset != 5 ||
- ((DetectContentData*) s->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx)->distance != 30 ||
+ ((DetectContentData*) s->sm_lists_tail[g_http_uri_buffer_id]->ctx)->distance != 30 ||
s->sm_lists[DETECT_SM_LIST_MATCH] != NULL)
{
printf("sig 10 failed to parse: ");
- DetectUricontentPrint((DetectContentData*) s->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx);
+ DetectUricontentPrint((DetectContentData*) s->sm_lists_tail[g_http_uri_buffer_id]->ctx);
goto end;
}
goto end;
}
- if (s->sm_lists[DETECT_SM_LIST_UMATCH] == NULL || s->sm_lists[DETECT_SM_LIST_PMATCH] == NULL) {
- printf("umatch %p or pmatch %p: ", s->sm_lists[DETECT_SM_LIST_UMATCH], s->sm_lists[DETECT_SM_LIST_PMATCH]);
+ if (s->sm_lists[g_http_uri_buffer_id] == NULL || s->sm_lists[DETECT_SM_LIST_PMATCH] == NULL) {
+ printf("umatch %p or pmatch %p: ", s->sm_lists[g_http_uri_buffer_id], s->sm_lists[DETECT_SM_LIST_PMATCH]);
goto end;
}
if ( ((DetectContentData*) s->sm_lists[DETECT_SM_LIST_PMATCH]->ctx)->depth != 15 ||
((DetectContentData*) s->sm_lists[DETECT_SM_LIST_PMATCH]->ctx)->offset != 5 ||
- ((DetectContentData*) s->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx)->distance != 30 ||
- ((DetectContentData*) s->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx)->within != 60 ||
+ ((DetectContentData*) s->sm_lists_tail[g_http_uri_buffer_id]->ctx)->distance != 30 ||
+ ((DetectContentData*) s->sm_lists_tail[g_http_uri_buffer_id]->ctx)->within != 60 ||
((DetectContentData*) s->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx)->distance != 45 ||
((DetectContentData*) s->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx)->within != 70 ||
s->sm_lists[DETECT_SM_LIST_MATCH] != NULL) {
printf("sig 10 failed to parse, content not setup properly: ");
DetectContentPrint((DetectContentData*) s->sm_lists[DETECT_SM_LIST_PMATCH]->ctx);
- DetectUricontentPrint((DetectContentData*) s->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx);
+ DetectUricontentPrint((DetectContentData*) s->sm_lists_tail[g_http_uri_buffer_id]->ctx);
DetectContentPrint((DetectContentData*) s->sm_lists_tail[DETECT_SM_LIST_PMATCH]->ctx);
goto end;
}
goto end;
}
- if (s->sm_lists_tail[DETECT_SM_LIST_UMATCH] == NULL || s->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx == NULL) {
+ if (s->sm_lists_tail[g_http_uri_buffer_id] == NULL || s->sm_lists_tail[g_http_uri_buffer_id]->ctx == NULL) {
printf("de_ctx->pmatch_tail == NULL && de_ctx->pmatch_tail->ctx == NULL: ");
goto end;
}
- ud = (DetectContentData *)s->sm_lists_tail[DETECT_SM_LIST_UMATCH]->ctx;
+ ud = (DetectContentData *)s->sm_lists_tail[g_http_uri_buffer_id]->ctx;
result = (strncmp("boo", (char *)ud->content, ud->content_len) == 0);
end:
return result;
}
+static int DetectUricontentIsdataatParseTest(void)
+{
+ DetectEngineCtx *de_ctx = DetectEngineCtxInit();
+ FAIL_IF_NULL(de_ctx);
+ de_ctx->flags |= DE_QUIET;
+
+ Signature *s = DetectEngineAppendSig(de_ctx,
+ "alert tcp any any -> any any ("
+ "uricontent:\"one\"; "
+ "isdataat:!4,relative; sid:1;)");
+ FAIL_IF_NULL(s);
+
+ SigMatch *sm = s->init_data->smlists_tail[g_http_uri_buffer_id];
+ FAIL_IF_NULL(sm);
+ FAIL_IF_NOT(sm->type == DETECT_ISDATAAT);
+
+ DetectIsdataatData *data = (DetectIsdataatData *)sm->ctx;
+ FAIL_IF_NOT(data->flags & ISDATAAT_RELATIVE);
+ FAIL_IF_NOT(data->flags & ISDATAAT_NEGATED);
+ FAIL_IF(data->flags & ISDATAAT_RAWBYTES);
+
+ DetectEngineCtxFree(de_ctx);
+ PASS;
+}
+
#endif /* UNITTESTS */
-void HttpUriRegisterTests(void)
+static void DetectUricontentRegisterTests(void)
{
#ifdef UNITTESTS
UtRegisterTest("HTTPUriTest01", HTTPUriTest01);
UtRegisterTest("DetectUriContentParseTest22", DetectUriContentParseTest22);
UtRegisterTest("DetectUriContentParseTest23", DetectUriContentParseTest23);
UtRegisterTest("DetectUriContentParseTest24", DetectUriContentParseTest24);
+
+ UtRegisterTest("DetectUricontentIsdataatParseTest",
+ DetectUricontentIsdataatParseTest);
#endif /* UNITTESTS */
}
#include "detect.h"
#include "detect-parse.h"
+#include "detect-engine.h"
#include "detect-engine-state.h"
#include "detect-urilen.h"
void DetectUrilenFree (void *);
void DetectUrilenRegisterTests (void);
+static int g_http_uri_buffer_id = 0;
+
/**
* \brief Registration function for urilen: keyword
*/
sigmatch_table[DETECT_AL_URILEN].flags |= SIGMATCH_PAYLOAD;
DetectSetupParseRegexes(PARSE_REGEX, &parse_regex, &parse_regex_study);
+
+ g_http_uri_buffer_id = DetectBufferTypeRegister("http_uri");
}
/**
if (urilend->raw_buffer)
SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_HRUDMATCH);
else
- SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_UMATCH);
+ SigMatchAppendSMToList(s, sm, g_http_uri_buffer_id);
/* Flagged the signature as to inspect the app layer data */
s->flags |= SIG_FLAG_APPLAYER;
if (s->init_data->smlists[DETECT_SM_LIST_PMATCH] != NULL)
return 0;
- if (s->init_data->smlists[DETECT_SM_LIST_UMATCH] != NULL)
- return 0;
-
if (s->init_data->smlists[DETECT_SM_LIST_HCBDMATCH] != NULL)
return 0;
if (s->init_data->smlists[DETECT_SM_LIST_PMATCH] != NULL)
return 0;
- if (s->init_data->smlists[DETECT_SM_LIST_UMATCH] != NULL)
- return 0;
-
if (s->init_data->smlists[DETECT_SM_LIST_HCBDMATCH] != NULL)
return 0;
}
if (s->init_data->smlists[DETECT_SM_LIST_PMATCH] != NULL ||
- s->init_data->smlists[DETECT_SM_LIST_UMATCH] != NULL ||
s->init_data->smlists[DETECT_SM_LIST_AMATCH] != NULL ||
s->init_data->smlists[DETECT_SM_LIST_HCBDMATCH] != NULL ||
s->init_data->smlists[DETECT_SM_LIST_HHDMATCH] != NULL ||
SCLogDebug("sig requires dce state");
}
- if (s->init_data->smlists[DETECT_SM_LIST_UMATCH] != NULL) {
- s->mask |= SIG_MASK_REQUIRE_HTTP_STATE;
- SCLogDebug("sig requires http state");
- }
-
if (s->init_data->smlists[DETECT_SM_LIST_HCBDMATCH] != NULL) {
s->mask |= SIG_MASK_REQUIRE_HTTP_STATE;
SCLogDebug("sig requires http app state");
DETECT_SM_LIST_BUILTIN_MAX,
- /* list for http_uri keyword and the ones relative to it */
- DETECT_SM_LIST_UMATCH = DETECT_SM_LIST_BUILTIN_MAX,
/* list for http_raw_uri keyword and the ones relative to it */
- DETECT_SM_LIST_HRUDMATCH,
+ DETECT_SM_LIST_HRUDMATCH = DETECT_SM_LIST_BUILTIN_MAX,
/* list for http_client_body keyword and the ones relative to it */
DETECT_SM_LIST_HCBDMATCH,
/* list for http_header keyword and the ones relative to it */