From 8eac1156c658a501993f3965e6df1402dd7f6c0f Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 21 Dec 2016 17:58:26 +0100 Subject: [PATCH] app-layer-events: remove unused API options --- src/app-layer-events.h | 3 +-- src/detect-app-layer-event.c | 31 ++----------------------------- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/src/app-layer-events.h b/src/app-layer-events.h index 11dfb9e60d..0261a26f92 100644 --- a/src/app-layer-events.h +++ b/src/app-layer-events.h @@ -50,8 +50,7 @@ enum { /* the event types for app events */ typedef enum AppLayerEventType_ { - APP_LAYER_EVENT_TYPE_GENERAL = 1, - APP_LAYER_EVENT_TYPE_TRANSACTION, + APP_LAYER_EVENT_TYPE_TRANSACTION = 1, APP_LAYER_EVENT_TYPE_PACKET, } AppLayerEventType; diff --git a/src/detect-app-layer-event.c b/src/detect-app-layer-event.c index a4207899f4..c7128c27a7 100644 --- a/src/detect-app-layer-event.c +++ b/src/detect-app-layer-event.c @@ -50,8 +50,6 @@ static int DetectAppLayerEventPktMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx); -static int DetectAppLayerEventAppMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, - uint8_t, void *, const Signature *, const SigMatchData *); static int DetectAppLayerEventSetupP1(DetectEngineCtx *, Signature *, char *); static void DetectAppLayerEventRegisterTests(void); static void DetectAppLayerEventFree(void *); @@ -71,8 +69,6 @@ void DetectAppLayerEventRegister(void) sigmatch_table[DETECT_AL_APP_LAYER_EVENT].name = "app-layer-event"; sigmatch_table[DETECT_AL_APP_LAYER_EVENT].Match = DetectAppLayerEventPktMatch; - sigmatch_table[DETECT_AL_APP_LAYER_EVENT].AppLayerMatch = - DetectAppLayerEventAppMatch; sigmatch_table[DETECT_AL_APP_LAYER_EVENT].Setup = DetectAppLayerEventSetupP1; sigmatch_table[DETECT_AL_APP_LAYER_EVENT].Free = DetectAppLayerEventFree; sigmatch_table[DETECT_AL_APP_LAYER_EVENT].RegisterTests = @@ -150,26 +146,6 @@ static int DetectAppLayerEventPktMatch(ThreadVars *t, DetectEngineThreadCtx *det aled->event_id); } -static int DetectAppLayerEventAppMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Flow *f, uint8_t flags, void *state, - const Signature *s, const SigMatchData *m) -{ - SCEnter(); - AppLayerDecoderEvents *decoder_events = NULL; - int r = 0; - DetectAppLayerEventData *aled = (DetectAppLayerEventData *)m->ctx; - - if (r == 0) { - decoder_events = AppLayerParserGetDecoderEvents(f->alparser); - if (decoder_events != NULL && - AppLayerDecoderEventsIsEventSet(decoder_events, aled->event_id)) { - r = 1; - } - } - - SCReturnInt(r); -} - static void DetectAppLayerEventSetupCallback(Signature *s) { SigMatch *sm; @@ -336,10 +312,7 @@ static int DetectAppLayerEventSetupP2(Signature *s, /* DetectAppLayerEventParseAppP2 prints errors */ return -1; } - if (event_type == APP_LAYER_EVENT_TYPE_GENERAL) - SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_AMATCH); - else - SigMatchAppendSMToList(s, sm, g_applayer_events_list_id); + SigMatchAppendSMToList(s, sm, g_applayer_events_list_id); /* We should have set this flag already in SetupP1 */ s->flags |= SIG_FLAG_APPLAYER; @@ -456,7 +429,7 @@ static int DetectAppLayerEventTestGetEventInfo(const char *event_name, return -1; } - *event_type = APP_LAYER_EVENT_TYPE_GENERAL; + *event_type = APP_LAYER_EVENT_TYPE_TRANSACTION; return 0; } -- 2.47.2