|
|
|
|
@ -30,10 +30,13 @@
|
|
|
|
|
#include "detect-parse.h"
|
|
|
|
|
#include "detect-engine-content-inspection.h"
|
|
|
|
|
#include "rust.h"
|
|
|
|
|
#include "app-layer-parser.h"
|
|
|
|
|
#include "util-validate.h"
|
|
|
|
|
|
|
|
|
|
int SCDetectHelperBufferProgressRegister(
|
|
|
|
|
const char *name, AppProto alproto, uint8_t direction, uint8_t progress)
|
|
|
|
|
{
|
|
|
|
|
DEBUG_VALIDATE_BUG_ON(AppLayerParserSupportsSubStates(alproto));
|
|
|
|
|
if (direction & STREAM_TOSERVER) {
|
|
|
|
|
DetectAppLayerInspectEngineRegister(
|
|
|
|
|
name, alproto, SIG_FLAG_TOSERVER, progress, DetectEngineInspectGenericList, NULL);
|
|
|
|
|
@ -48,6 +51,7 @@ int SCDetectHelperBufferProgressRegister(
|
|
|
|
|
int SCDetectHelperBufferProgressRegisterSubState(
|
|
|
|
|
const char *name, AppProto alproto, uint8_t direction, uint8_t sub_state, uint8_t progress)
|
|
|
|
|
{
|
|
|
|
|
DEBUG_VALIDATE_BUG_ON(AppLayerParserSupportsSubStates(alproto) && sub_state == 0);
|
|
|
|
|
if (direction & STREAM_TOSERVER) {
|
|
|
|
|
DetectAppLayerInspectEngineRegisterSubState(name, alproto, SIG_FLAG_TOSERVER, sub_state,
|
|
|
|
|
(uint8_t)progress, DetectEngineInspectGenericList, NULL);
|
|
|
|
|
@ -62,6 +66,7 @@ int SCDetectHelperBufferProgressRegisterSubState(
|
|
|
|
|
int SCDetectHelperBufferMpmRegister(const char *name, const char *desc, AppProto alproto,
|
|
|
|
|
uint8_t direction, InspectionSingleBufferGetDataPtr GetData)
|
|
|
|
|
{
|
|
|
|
|
DEBUG_VALIDATE_BUG_ON(AppLayerParserSupportsSubStates(alproto));
|
|
|
|
|
if (direction & STREAM_TOSERVER) {
|
|
|
|
|
DetectAppLayerInspectEngineRegisterSingle(
|
|
|
|
|
name, alproto, SIG_FLAG_TOSERVER, 0, DetectEngineInspectBufferSingle, GetData);
|
|
|
|
|
@ -81,6 +86,7 @@ int SCDetectHelperBufferMpmRegister(const char *name, const char *desc, AppProto
|
|
|
|
|
int SCDetectRegisterMpmGeneric(const char *name, const char *desc, AppProto alproto,
|
|
|
|
|
uint8_t direction, InspectionBufferGetDataPtr GetData, uint8_t progress)
|
|
|
|
|
{
|
|
|
|
|
DEBUG_VALIDATE_BUG_ON(AppLayerParserSupportsSubStates(alproto));
|
|
|
|
|
if (direction & STREAM_TOSERVER) {
|
|
|
|
|
DetectAppLayerInspectEngineRegister(name, alproto, SIG_FLAG_TOSERVER, progress,
|
|
|
|
|
DetectEngineInspectBufferGeneric, GetData);
|
|
|
|
|
@ -100,6 +106,7 @@ int SCDetectRegisterMpmGeneric(const char *name, const char *desc, AppProto alpr
|
|
|
|
|
int SCDetectHelperBufferProgressMpmRegister(const char *name, const char *desc, AppProto alproto,
|
|
|
|
|
uint8_t direction, InspectionSingleBufferGetDataPtr GetData, uint8_t progress)
|
|
|
|
|
{
|
|
|
|
|
DEBUG_VALIDATE_BUG_ON(AppLayerParserSupportsSubStates(alproto));
|
|
|
|
|
if (direction & STREAM_TOSERVER) {
|
|
|
|
|
DetectAppLayerInspectEngineRegisterSingle(name, alproto, SIG_FLAG_TOSERVER, progress,
|
|
|
|
|
DetectEngineInspectBufferSingle, GetData);
|
|
|
|
|
@ -120,6 +127,7 @@ int SCDetectHelperMultiBufferProgressMpmRegister(const char *name, const char *d
|
|
|
|
|
AppProto alproto, uint8_t direction, InspectionMultiBufferGetDataPtr GetData,
|
|
|
|
|
uint8_t progress)
|
|
|
|
|
{
|
|
|
|
|
DEBUG_VALIDATE_BUG_ON(AppLayerParserSupportsSubStates(alproto));
|
|
|
|
|
if (direction & STREAM_TOSERVER) {
|
|
|
|
|
DetectAppLayerMultiRegister(name, alproto, SIG_FLAG_TOSERVER, progress, GetData, 2);
|
|
|
|
|
}
|
|
|
|
|
@ -135,6 +143,7 @@ int SCDetectHelperMultiBufferProgressMpmRegisterSubState(const char *name, const
|
|
|
|
|
AppProto alproto, uint8_t direction, InspectionMultiBufferGetDataPtr GetData,
|
|
|
|
|
uint8_t sub_state, uint8_t progress)
|
|
|
|
|
{
|
|
|
|
|
DEBUG_VALIDATE_BUG_ON(AppLayerParserSupportsSubStates(alproto) && sub_state == 0);
|
|
|
|
|
if (direction & STREAM_TOSERVER) {
|
|
|
|
|
DetectAppLayerMultiRegisterSubState(
|
|
|
|
|
name, alproto, SIG_FLAG_TOSERVER, sub_state, progress, GetData, 2);
|
|
|
|
|
@ -151,6 +160,7 @@ int SCDetectHelperMultiBufferProgressMpmRegisterSubState(const char *name, const
|
|
|
|
|
int SCDetectHelperMultiBufferMpmRegister(const char *name, const char *desc, AppProto alproto,
|
|
|
|
|
uint8_t direction, InspectionMultiBufferGetDataPtr GetData)
|
|
|
|
|
{
|
|
|
|
|
DEBUG_VALIDATE_BUG_ON(AppLayerParserSupportsSubStates(alproto));
|
|
|
|
|
return SCDetectHelperMultiBufferProgressMpmRegister(name, desc, alproto, direction, GetData, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|