detect/file: reduce scope of keyword data structures

pull/7654/head
Victor Julien 3 years ago
parent 73eb7744d8
commit af145ad125

@ -52,6 +52,12 @@
#include "stream-tcp.h"
#include "detect-fileext.h"
typedef struct DetectFileextData_ {
uint8_t *ext; /** file extension to match */
uint16_t len; /** length of the file */
uint32_t flags;
} DetectFileextData;
static int DetectFileextMatch (DetectEngineThreadCtx *, Flow *,
uint8_t, File *, const Signature *, const SigMatchCtx *);
static int DetectFileextSetup (DetectEngineCtx *, Signature *, const char *);

@ -24,13 +24,6 @@
#ifndef __DETECT_FILEEXT_H__
#define __DETECT_FILEEXT_H__
typedef struct DetectFileextData_ {
uint8_t *ext; /** file extension to match */
uint16_t len; /** length of the file */
uint32_t flags;
} DetectFileextData;
/* prototypes */
void DetectFileextRegister (void);

@ -79,6 +79,17 @@ void DetectFilemagicRegister(void)
#else /* HAVE_MAGIC */
typedef struct DetectFilemagicThreadData {
magic_t ctx;
} DetectFilemagicThreadData;
typedef struct DetectFilemagicData {
uint8_t *name; /** name of the file to match */
BmCtx *bm_ctx; /** BM context */
uint16_t len; /** name length */
uint32_t flags;
} DetectFilemagicData;
static int DetectFilemagicMatch (DetectEngineThreadCtx *, Flow *,
uint8_t, File *, const Signature *, const SigMatchCtx *);
static int DetectFilemagicSetup (DetectEngineCtx *, Signature *, const char *);

@ -25,19 +25,6 @@
#define __DETECT_FILEMAGIC_H__
#ifdef HAVE_MAGIC
#include "util-spm-bm.h"
typedef struct DetectFilemagicThreadData {
magic_t ctx;
} DetectFilemagicThreadData;
typedef struct DetectFilemagicData {
uint8_t *name; /** name of the file to match */
BmCtx *bm_ctx; /** BM context */
uint16_t len; /** name length */
uint32_t flags;
} DetectFilemagicData;
/* prototypes */
int FilemagicThreadLookup(magic_t *ctx, File *file);
#endif

@ -55,6 +55,13 @@
#include "detect-filename.h"
#include "app-layer-parser.h"
typedef struct DetectFilenameData {
uint8_t *name; /** name of the file to match */
BmCtx *bm_ctx; /** BM context */
uint16_t len; /** name length */
uint32_t flags;
} DetectFilenameData;
static int DetectFilenameMatch (DetectEngineThreadCtx *, Flow *,
uint8_t, File *, const Signature *, const SigMatchCtx *);
static int DetectFilenameSetup (DetectEngineCtx *, Signature *, const char *);

@ -24,15 +24,6 @@
#ifndef __DETECT_FILENAME_H__
#define __DETECT_FILENAME_H__
#include "util-spm-bm.h"
typedef struct DetectFilenameData {
uint8_t *name; /** name of the file to match */
BmCtx *bm_ctx; /** BM context */
uint16_t len; /** name length */
uint32_t flags;
} DetectFilenameData;
/* prototypes */
void DetectFilenameRegister (void);

Loading…
Cancel
Save