detect: reduce datatype scope for various keywords

pull/7652/head
Victor Julien 3 years ago
parent ad76502df0
commit 9fa0033966

@ -51,6 +51,16 @@
#define MAX_ALPROTO_NAME 50
typedef struct DetectAppLayerEventData_ {
AppProto alproto;
uint8_t event_id;
/* it's used to check if there are event set into the detect engine */
bool needs_detctx;
char *arg;
} DetectAppLayerEventData;
static int DetectAppLayerEventPktMatch(DetectEngineThreadCtx *det_ctx,
Packet *p, const Signature *s, const SigMatchCtx *ctx);
static int DetectAppLayerEventSetupP1(DetectEngineCtx *, Signature *, const char *);

@ -24,16 +24,6 @@
#ifndef __DETECT_APP_LAYER_EVENT_H__
#define __DETECT_APP_LAYER_EVENT_H__
typedef struct DetectAppLayerEventData_ {
AppProto alproto;
uint8_t event_id;
/* it's used to check if there are event set into the detect engine */
bool needs_detctx;
char *arg;
} DetectAppLayerEventData;
int DetectAppLayerEventPrepare(DetectEngineCtx *de_ctx, Signature *s);
void DetectAppLayerEventRegister(void);

@ -38,6 +38,11 @@
static void DetectAppLayerProtocolRegisterTests(void);
#endif
typedef struct DetectAppLayerProtocolData_ {
AppProto alproto;
uint8_t negated;
} DetectAppLayerProtocolData;
static int DetectAppLayerProtocolPacketMatch(
DetectEngineThreadCtx *det_ctx,
Packet *p, const Signature *s, const SigMatchCtx *ctx)

@ -24,11 +24,6 @@
#ifndef __DETECT_APP_LAYER_PROTOCOL__H__
#define __DETECT_APP_LAYER_PROTOCOL__H__
typedef struct DetectAppLayerProtocolData_ {
AppProto alproto;
uint8_t negated;
} DetectAppLayerProtocolData;
void DetectAppLayerProtocolRegister(void);
#endif /* __DETECT_APP_LAYER_PROTOCOL__H__ */

@ -27,6 +27,12 @@
/* Arbitrary maximum buffer size for decoded base64 data. */
#define BASE64_DECODE_MAX 65535
typedef struct DetectBase64Decode_ {
uint32_t bytes;
uint32_t offset;
uint8_t relative;
} DetectBase64Decode;
static const char decode_pattern[] = "\\s*(bytes\\s+(\\d+),?)?"
"\\s*(offset\\s+(\\d+),?)?"
"\\s*(\\w+)?";

@ -18,13 +18,6 @@
#ifndef __DETECT_BASE64_DECODE_H__
#define __DETECT_BASE64_DECODE_H__
typedef struct DetectBase64Decode_ {
uint32_t bytes;
uint32_t offset;
uint8_t relative;
} DetectBase64Decode;
void DetectBase64DecodeRegister(void);
int DetectBase64DecodeDoMatch(DetectEngineThreadCtx *, const Signature *,
const SigMatchData *, const uint8_t *, uint32_t);

@ -40,6 +40,15 @@
#include "util-profiling.h"
#include "detect-engine-build.h"
#define DETECT_CSUM_VALID "valid"
#define DETECT_CSUM_INVALID "invalid"
typedef struct DetectCsumData_ {
/* Indicates if the csum-<protocol> keyword in a rule holds the
keyvalue "valid" or "invalid" */
int16_t valid;
} DetectCsumData;
/* prototypes for the "ipv4-csum" rule keyword */
static int DetectIPV4CsumMatch(DetectEngineThreadCtx *,
Packet *, const Signature *, const SigMatchCtx *);

@ -24,15 +24,6 @@
#ifndef __DETECT_CSUM_H__
#define __DETECT_CSUM_H__
#define DETECT_CSUM_VALID "valid"
#define DETECT_CSUM_INVALID "invalid"
typedef struct DetectCsumData_ {
/* Indicates if the csum-<protocol> keyword in a rule holds the
keyvalue "valid" or "invalid" */
int16_t valid;
} DetectCsumData;
void DetectCsumRegister(void);
#endif /* __DETECT_CSUM_H__ */

Loading…
Cancel
Save