mpm raw uri: remove unused function args

pull/2310/head
Victor Julien 9 years ago
parent d461c7888a
commit 3d5807ba44

@ -68,14 +68,12 @@
* \retval ret Number of matches. * \retval ret Number of matches.
*/ */
static inline uint32_t HttpRawUriPatternSearch(DetectEngineThreadCtx *det_ctx, static inline uint32_t HttpRawUriPatternSearch(DetectEngineThreadCtx *det_ctx,
const uint8_t *uri, const uint32_t uri_len, const uint8_t *uri, const uint32_t uri_len)
const uint8_t flags)
{ {
SCEnter(); SCEnter();
uint32_t ret = 0; uint32_t ret = 0;
DEBUG_VALIDATE_BUG_ON(flags & STREAM_TOCLIENT);
DEBUG_VALIDATE_BUG_ON(det_ctx->sgh->mpm_hrud_ctx_ts == NULL); DEBUG_VALIDATE_BUG_ON(det_ctx->sgh->mpm_hrud_ctx_ts == NULL);
if (uri_len >= det_ctx->sgh->mpm_hrud_ctx_ts->minlen) { if (uri_len >= det_ctx->sgh->mpm_hrud_ctx_ts->minlen) {
@ -92,9 +90,7 @@ static inline uint32_t HttpRawUriPatternSearch(DetectEngineThreadCtx *det_ctx,
* *
* \retval cnt Number of matches reported by the mpm algo. * \retval cnt Number of matches reported by the mpm algo.
*/ */
int DetectEngineRunHttpRawUriMpm(DetectEngineThreadCtx *det_ctx, Flow *f, int DetectEngineRunHttpRawUriMpm(DetectEngineThreadCtx *det_ctx, void *txv)
HtpState *htp_state, uint8_t flags,
void *txv, uint64_t idx)
{ {
SCEnter(); SCEnter();
@ -105,7 +101,7 @@ int DetectEngineRunHttpRawUriMpm(DetectEngineThreadCtx *det_ctx, Flow *f,
cnt = HttpRawUriPatternSearch(det_ctx, cnt = HttpRawUriPatternSearch(det_ctx,
(const uint8_t *)bstr_ptr(tx->request_uri), (const uint8_t *)bstr_ptr(tx->request_uri),
bstr_len(tx->request_uri), flags); bstr_len(tx->request_uri));
end: end:
SCReturnInt(cnt); SCReturnInt(cnt);
} }
@ -2262,7 +2258,7 @@ static int DetectEngineHttpRawUriTest17(void)
/* start the search phase */ /* start the search phase */
det_ctx->sgh = SigMatchSignaturesGetSgh(de_ctx, det_ctx, p1); det_ctx->sgh = SigMatchSignaturesGetSgh(de_ctx, det_ctx, p1);
uint32_t r = HttpRawUriPatternSearch(det_ctx, http1_buf, http1_len, STREAM_TOSERVER); uint32_t r = HttpRawUriPatternSearch(det_ctx, http1_buf, http1_len);
if (r != 1) { if (r != 1) {
printf("expected 1 result, got %"PRIu32": ", r); printf("expected 1 result, got %"PRIu32": ", r);
goto end; goto end;
@ -2334,7 +2330,7 @@ static int DetectEngineHttpRawUriTest18(void)
/* start the search phase */ /* start the search phase */
det_ctx->sgh = SigMatchSignaturesGetSgh(de_ctx, det_ctx, p1); det_ctx->sgh = SigMatchSignaturesGetSgh(de_ctx, det_ctx, p1);
uint32_t r = HttpRawUriPatternSearch(det_ctx, http1_buf, http1_len, STREAM_TOSERVER); uint32_t r = HttpRawUriPatternSearch(det_ctx, http1_buf, http1_len);
if (r != 0) { if (r != 0) {
printf("expected 0 result, got %"PRIu32": ", r); printf("expected 0 result, got %"PRIu32": ", r);
goto end; goto end;
@ -2406,7 +2402,7 @@ static int DetectEngineHttpRawUriTest19(void)
/* start the search phase */ /* start the search phase */
det_ctx->sgh = SigMatchSignaturesGetSgh(de_ctx, det_ctx, p1); det_ctx->sgh = SigMatchSignaturesGetSgh(de_ctx, det_ctx, p1);
uint32_t r = HttpRawUriPatternSearch(det_ctx, http1_buf, http1_len, STREAM_TOSERVER); uint32_t r = HttpRawUriPatternSearch(det_ctx, http1_buf, http1_len);
if (r != 0) { if (r != 0) {
printf("expected 0 result, got %"PRIu32": ", r); printf("expected 0 result, got %"PRIu32": ", r);
goto end; goto end;
@ -2478,7 +2474,7 @@ static int DetectEngineHttpRawUriTest20(void)
/* start the search phase */ /* start the search phase */
det_ctx->sgh = SigMatchSignaturesGetSgh(de_ctx, det_ctx, p1); det_ctx->sgh = SigMatchSignaturesGetSgh(de_ctx, det_ctx, p1);
uint32_t r = HttpRawUriPatternSearch(det_ctx, http1_buf, http1_len, STREAM_TOSERVER); uint32_t r = HttpRawUriPatternSearch(det_ctx, http1_buf, http1_len);
if (r < 1) { if (r < 1) {
printf("expected result >= 1, got %"PRIu32": ", r); printf("expected result >= 1, got %"PRIu32": ", r);
goto end; goto end;

@ -26,9 +26,8 @@
#include "app-layer-htp.h" #include "app-layer-htp.h"
int DetectEngineRunHttpRawUriMpm(DetectEngineThreadCtx *det_ctx, Flow *f, int DetectEngineRunHttpRawUriMpm(DetectEngineThreadCtx *det_ctx, void *txv);
HtpState *htp_state, uint8_t flags,
void *tx, uint64_t idx);
int DetectEngineInspectHttpRawUri(ThreadVars *tv, int DetectEngineInspectHttpRawUri(ThreadVars *tv,
DetectEngineCtx *de_ctx, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx, DetectEngineThreadCtx *det_ctx,

@ -909,7 +909,7 @@ static inline void DetectMpmPrefilter(DetectEngineCtx *de_ctx,
} }
if (det_ctx->sgh->flags & SIG_GROUP_HEAD_MPM_HRUD) { if (det_ctx->sgh->flags & SIG_GROUP_HEAD_MPM_HRUD) {
PACKET_PROFILING_DETECT_START(p, PROF_DETECT_MPM_HRUD); PACKET_PROFILING_DETECT_START(p, PROF_DETECT_MPM_HRUD);
DetectEngineRunHttpRawUriMpm(det_ctx, p->flow, alstate, flags, tx, idx); DetectEngineRunHttpRawUriMpm(det_ctx, tx);
PACKET_PROFILING_DETECT_END(p, PROF_DETECT_MPM_HRUD); PACKET_PROFILING_DETECT_END(p, PROF_DETECT_MPM_HRUD);
} }
if (det_ctx->sgh->flags & SIG_GROUP_HEAD_MPM_HMD) { if (det_ctx->sgh->flags & SIG_GROUP_HEAD_MPM_HMD) {

Loading…
Cancel
Save