suricata
app-layer-events.c File Reference
#include "app-layer-events.h"
#include "util-enum.h"
Include dependency graph for app-layer-events.c:

Go to the source code of this file.

Macros

#define DECODER_EVENTS_BUFFER_STEPS   8
 

Functions

int SCAppLayerGetEventIdByName (const char *event_name, SCEnumCharMap *table, uint8_t *event_id)
 
int AppLayerGetEventInfoById (uint8_t event_id, const char **event_name, AppLayerEventType *event_type)
 
int AppLayerGetPktEventInfo (const char *event_name, uint8_t *event_id)
 
void AppLayerDecoderEventsSetEventRaw (AppLayerDecoderEvents **sevents, uint8_t event)
 Set an app layer decoder event. More...
 
void AppLayerDecoderEventsResetEvents (AppLayerDecoderEvents *events)
 
void AppLayerDecoderEventsFreeEvents (AppLayerDecoderEvents **events)
 
int DetectEngineGetEventInfo (const char *event_name, uint8_t *event_id, AppLayerEventType *event_type)
 

Variables

SCEnumCharMap app_layer_event_pkt_table []
 
SCEnumCharMap det_ctx_event_table []
 

Detailed Description

Macro Definition Documentation

◆ DECODER_EVENTS_BUFFER_STEPS

#define DECODER_EVENTS_BUFFER_STEPS   8

Definition at line 86 of file app-layer-events.c.

Function Documentation

◆ AppLayerDecoderEventsFreeEvents()

void AppLayerDecoderEventsFreeEvents ( AppLayerDecoderEvents **  events)

Definition at line 136 of file app-layer-events.c.

References SCFree.

Referenced by AppLayerParserStateFree(), and PacketDestructor().

Here is the caller graph for this function:

◆ AppLayerDecoderEventsResetEvents()

void AppLayerDecoderEventsResetEvents ( AppLayerDecoderEvents events)

◆ AppLayerDecoderEventsSetEventRaw()

void AppLayerDecoderEventsSetEventRaw ( AppLayerDecoderEvents **  sevents,
uint8_t  event 
)

Set an app layer decoder event.

Parameters
seventsPointer to a AppLayerDecoderEvents pointer. If *sevents is NULL memory will be allocated.
eventThe event to be stored.

Definition at line 94 of file app-layer-events.c.

References DECODER_EVENTS_BUFFER_STEPS, SCCalloc, and SCRealloc.

Referenced by AppLayerHandleUdp(), and DetectEngineSetEvent().

Here is the caller graph for this function:

◆ AppLayerGetEventInfoById()

int AppLayerGetEventInfoById ( uint8_t  event_id,
const char **  event_name,
AppLayerEventType *  event_type 
)

Definition at line 63 of file app-layer-events.c.

References app_layer_event_pkt_table, SCLogError, and SCMapEnumValueToName().

Here is the call graph for this function:

◆ AppLayerGetPktEventInfo()

int AppLayerGetPktEventInfo ( const char *  event_name,
uint8_t *  event_id 
)

Definition at line 80 of file app-layer-events.c.

References app_layer_event_pkt_table, and SCAppLayerGetEventIdByName().

Here is the call graph for this function:

◆ DetectEngineGetEventInfo()

int DetectEngineGetEventInfo ( const char *  event_name,
uint8_t *  event_id,
AppLayerEventType *  event_type 
)

Definition at line 167 of file app-layer-events.c.

References det_ctx_event_table, and SCAppLayerGetEventIdByName().

Here is the call graph for this function:

◆ SCAppLayerGetEventIdByName()

int SCAppLayerGetEventIdByName ( const char *  event_name,
SCEnumCharMap table,
uint8_t *  event_id 
)

Definition at line 28 of file app-layer-events.c.

References SCLogError, and SCMapEnumNameToValue().

Referenced by AppLayerGetPktEventInfo(), and DetectEngineGetEventInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ app_layer_event_pkt_table

SCEnumCharMap app_layer_event_pkt_table[]
Initial value:
= {
{ "APPLAYER_MISMATCH_PROTOCOL_BOTH_DIRECTIONS",
{ "APPLAYER_WRONG_DIRECTION_FIRST_DATA",
{ "APPLAYER_DETECT_PROTOCOL_ONLY_ONE_DIRECTION",
{ "APPLAYER_PROTO_DETECTION_SKIPPED",
{ "APPLAYER_NO_TLS_AFTER_STARTTLS",
{ "APPLAYER_UNEXPECTED_PROTOCOL",
{ NULL,
-1 },
}

Definition at line 46 of file app-layer-events.c.

Referenced by AppLayerGetEventInfoById(), and AppLayerGetPktEventInfo().

◆ det_ctx_event_table

SCEnumCharMap det_ctx_event_table[]
Initial value:
= {
{ "NO_MEMORY", FILE_DECODER_EVENT_NO_MEM },
{ "INVALID_SWF_LENGTH", FILE_DECODER_EVENT_INVALID_SWF_LENGTH },
{ "INVALID_SWF_VERSION", FILE_DECODER_EVENT_INVALID_SWF_VERSION },
{ "Z_DATA_ERROR", FILE_DECODER_EVENT_Z_DATA_ERROR },
{ "Z_STREAM_ERROR", FILE_DECODER_EVENT_Z_STREAM_ERROR },
{ "Z_BUF_ERROR", FILE_DECODER_EVENT_Z_BUF_ERROR },
{ "Z_UNKNOWN_ERROR", FILE_DECODER_EVENT_Z_UNKNOWN_ERROR },
{ "LZMA_IO_ERROR", FILE_DECODER_EVENT_LZMA_IO_ERROR },
{ "LZMA_HEADER_TOO_SHORT_ERROR", FILE_DECODER_EVENT_LZMA_HEADER_TOO_SHORT_ERROR },
{ "LZMA_DECODER_ERROR", FILE_DECODER_EVENT_LZMA_DECODER_ERROR },
{ "LZMA_MEMLIMIT_ERROR", FILE_DECODER_EVENT_LZMA_MEMLIMIT_ERROR },
{ "LZMA_XZ_ERROR", FILE_DECODER_EVENT_LZMA_XZ_ERROR },
{ "LZMA_UNKNOWN_ERROR", FILE_DECODER_EVENT_LZMA_UNKNOWN_ERROR },
{
"TOO_MANY_BUFFERS",
},
{ NULL, -1 },
}

Definition at line 146 of file app-layer-events.c.

Referenced by DetectEngineGetEventInfo().

DETECT_EVENT_TOO_MANY_BUFFERS
@ DETECT_EVENT_TOO_MANY_BUFFERS
Definition: detect.h:1332
APPLAYER_UNEXPECTED_PROTOCOL
@ APPLAYER_UNEXPECTED_PROTOCOL
Definition: app-layer-events.h:54
FILE_DECODER_EVENT_LZMA_UNKNOWN_ERROR
@ FILE_DECODER_EVENT_LZMA_UNKNOWN_ERROR
Definition: detect.h:1330
FILE_DECODER_EVENT_LZMA_DECODER_ERROR
@ FILE_DECODER_EVENT_LZMA_DECODER_ERROR
Definition: detect.h:1327
FILE_DECODER_EVENT_Z_UNKNOWN_ERROR
@ FILE_DECODER_EVENT_Z_UNKNOWN_ERROR
Definition: detect.h:1324
APPLAYER_PROTO_DETECTION_SKIPPED
@ APPLAYER_PROTO_DETECTION_SKIPPED
Definition: app-layer-events.h:52
FILE_DECODER_EVENT_LZMA_XZ_ERROR
@ FILE_DECODER_EVENT_LZMA_XZ_ERROR
Definition: detect.h:1329
APPLAYER_NO_TLS_AFTER_STARTTLS
@ APPLAYER_NO_TLS_AFTER_STARTTLS
Definition: app-layer-events.h:53
APPLAYER_MISMATCH_PROTOCOL_BOTH_DIRECTIONS
@ APPLAYER_MISMATCH_PROTOCOL_BOTH_DIRECTIONS
Definition: app-layer-events.h:49
FILE_DECODER_EVENT_Z_STREAM_ERROR
@ FILE_DECODER_EVENT_Z_STREAM_ERROR
Definition: detect.h:1322
FILE_DECODER_EVENT_INVALID_SWF_LENGTH
@ FILE_DECODER_EVENT_INVALID_SWF_LENGTH
Definition: detect.h:1319
FILE_DECODER_EVENT_LZMA_IO_ERROR
@ FILE_DECODER_EVENT_LZMA_IO_ERROR
Definition: detect.h:1325
FILE_DECODER_EVENT_Z_BUF_ERROR
@ FILE_DECODER_EVENT_Z_BUF_ERROR
Definition: detect.h:1323
APPLAYER_DETECT_PROTOCOL_ONLY_ONE_DIRECTION
@ APPLAYER_DETECT_PROTOCOL_ONLY_ONE_DIRECTION
Definition: app-layer-events.h:51
FILE_DECODER_EVENT_NO_MEM
@ FILE_DECODER_EVENT_NO_MEM
Definition: detect.h:1318
FILE_DECODER_EVENT_Z_DATA_ERROR
@ FILE_DECODER_EVENT_Z_DATA_ERROR
Definition: detect.h:1321
FILE_DECODER_EVENT_INVALID_SWF_VERSION
@ FILE_DECODER_EVENT_INVALID_SWF_VERSION
Definition: detect.h:1320
APPLAYER_WRONG_DIRECTION_FIRST_DATA
@ APPLAYER_WRONG_DIRECTION_FIRST_DATA
Definition: app-layer-events.h:50
FILE_DECODER_EVENT_LZMA_HEADER_TOO_SHORT_ERROR
@ FILE_DECODER_EVENT_LZMA_HEADER_TOO_SHORT_ERROR
Definition: detect.h:1326
FILE_DECODER_EVENT_LZMA_MEMLIMIT_ERROR
@ FILE_DECODER_EVENT_LZMA_MEMLIMIT_ERROR
Definition: detect.h:1328