if (sigmatch_table[smd->type].FileMatch != NULL) {
KEYWORD_PROFILING_START;
match = sigmatch_table[smd->type].
- FileMatch(tv, det_ctx, f, flags, file, s, smd);
+ FileMatch(tv, det_ctx, f, flags, file, s, smd->ctx);
KEYWORD_PROFILING_END(det_ctx, smd->type, (match > 0));
if (match == 0) {
r = DETECT_ENGINE_INSPECT_SIG_CANT_MATCH;
if (fd->scope > FILESTORE_SCOPE_DEFAULT) {
KEYWORD_PROFILING_START;
match = sigmatch_table[smd->type].
- FileMatch(tv, det_ctx, f, flags, /* no file */NULL, s, smd);
+ FileMatch(tv, det_ctx, f, flags, /* no file */NULL, s, smd->ctx);
KEYWORD_PROFILING_END(det_ctx, smd->type, (match > 0));
if (match == 1) {
#include "detect-fileext.h"
static int DetectFileextMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *,
- uint8_t, File *, const Signature *, const SigMatchData *);
+ uint8_t, File *, const Signature *, const SigMatchCtx *);
static int DetectFileextSetup (DetectEngineCtx *, Signature *, char *);
static void DetectFileextRegisterTests(void);
static void DetectFileextFree(void *);
* \retval 1 match
*/
static int DetectFileextMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx,
- Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatchData *m)
+ Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatchCtx *m)
{
SCEnter();
int ret = 0;
- DetectFileextData *fileext = (DetectFileextData *)m->ctx;
+ DetectFileextData *fileext = (DetectFileextData *)m;
if (file->name == NULL)
SCReturnInt(0);
#else /* HAVE_MAGIC */
static int DetectFilemagicMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *,
- uint8_t, File *, const Signature *, const SigMatchData *);
+ uint8_t, File *, const Signature *, const SigMatchCtx *);
static int DetectFilemagicSetup (DetectEngineCtx *, Signature *, char *);
static void DetectFilemagicRegisterTests(void);
static void DetectFilemagicFree(void *);
* \retval 1 match
*/
static int DetectFilemagicMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx,
- Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatchData *m)
+ Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatchCtx *m)
{
SCEnter();
int ret = 0;
- DetectFilemagicData *filemagic = (DetectFilemagicData *)m->ctx;
+ DetectFilemagicData *filemagic = (DetectFilemagicData *)m;
if (file->txid < det_ctx->tx_id)
SCReturnInt(0);
#include "app-layer-parser.h"
static int DetectFilenameMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *,
- uint8_t, File *, const Signature *, const SigMatchData *);
+ uint8_t, File *, const Signature *, const SigMatchCtx *);
static int DetectFilenameSetup (DetectEngineCtx *, Signature *, char *);
static void DetectFilenameRegisterTests(void);
static void DetectFilenameFree(void *);
* \retval 1 match
*/
static int DetectFilenameMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx,
- Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatchData *m)
+ Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatchCtx *m)
{
SCEnter();
int ret = 0;
- DetectFilenameData *filename = (DetectFilenameData *)m->ctx;
+ DetectFilenameData *filename = (DetectFilenameData *)m;
if (file->name == NULL)
SCReturnInt(0);
/*prototypes*/
static int DetectFilesizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f,
- uint8_t flags, File *file, const Signature *s, const SigMatchData *m);
+ uint8_t flags, File *file, const Signature *s, const SigMatchCtx *m);
static int DetectFilesizeSetup (DetectEngineCtx *, Signature *, char *);
static void DetectFilesizeFree (void *);
static void DetectFilesizeRegisterTests (void);
* \retval 1 match
*/
static int DetectFilesizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f,
- uint8_t flags, File *file, const Signature *s, const SigMatchData *m)
+ uint8_t flags, File *file, const Signature *s, const SigMatchCtx *m)
{
SCEnter();
- DetectFilesizeData *fsd = (DetectFilesizeData *)m->ctx;
+ DetectFilesizeData *fsd = (DetectFilesizeData *)m;
int ret = 0;
uint64_t file_size = FileTrackedSize(file);
static pcre_extra *parse_regex_study;
static int DetectFilestoreMatch (ThreadVars *, DetectEngineThreadCtx *,
- Flow *, uint8_t, File *, const Signature *, const SigMatchData *);
+ Flow *, uint8_t, File *, const Signature *, const SigMatchCtx *);
static int DetectFilestoreSetup (DetectEngineCtx *, Signature *, char *);
static void DetectFilestoreFree(void *);
static void DetectFilestoreRegisterTests(void);
* needs to be put behind a api.
*/
static int DetectFilestoreMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f,
- uint8_t flags, File *file, const Signature *s, const SigMatchData *m)
+ uint8_t flags, File *file, const Signature *s, const SigMatchCtx *m)
{
uint16_t file_id = 0;
int (*FileMatch)(ThreadVars *, /**< thread local vars */
DetectEngineThreadCtx *,
Flow *, /**< *LOCKED* flow */
- uint8_t flags, File *, const Signature *, const SigMatchData *);
+ uint8_t flags, File *, const Signature *, const SigMatchCtx *);
/** keyword setup function pointer */
int (*Setup)(DetectEngineCtx *, Signature *, char *);
* \retval 1 match
*/
int DetectFileHashMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx,
- Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatchData *m)
+ Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatchCtx *m)
{
SCEnter();
int ret = 0;
- DetectFileHashData *filehash = (DetectFileHashData *)m->ctx;
+ DetectFileHashData *filehash = (DetectFileHashData *)m;
if (file->txid < det_ctx->tx_id) {
SCReturnInt(0);
int LoadHashTable(ROHashTable *, char *, char *, int, uint32_t);
int DetectFileHashMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t,
- File *, const Signature *, const SigMatchData *);
+ File *, const Signature *, const SigMatchCtx *);
int DetectFileHashSetup(DetectEngineCtx *, Signature *, char *, uint32_t, int);
void DetectFileHashFree(void *);