Go to the documentation of this file.
32 SCLogError(
"event \"%s\" not present in enum table.", event_name);
35 }
else if (value < -1 || value > UINT8_MAX) {
36 SCLogError(
"event \"%s\" has out of range value", event_name);
40 *event_id = (uint8_t)value;
47 {
"APPLAYER_MISMATCH_PROTOCOL_BOTH_DIRECTIONS",
49 {
"APPLAYER_WRONG_DIRECTION_FIRST_DATA",
51 {
"APPLAYER_DETECT_PROTOCOL_ONLY_ONE_DIRECTION",
53 {
"APPLAYER_PROTO_DETECTION_SKIPPED",
55 {
"APPLAYER_NO_TLS_AFTER_STARTTLS",
57 {
"APPLAYER_UNEXPECTED_PROTOCOL",
64 uint8_t event_id,
const char **event_name, AppLayerEventType *event_type)
67 if (*event_name == NULL) {
69 "app-layer-event's enum map table.",
75 *event_type = APP_LAYER_EVENT_TYPE_PACKET;
85 #define DECODER_EVENTS_BUFFER_STEPS 8
96 if (*sevents == NULL) {
98 if (new_devents == NULL)
101 *sevents = new_devents;
104 if ((*sevents)->cnt == UCHAR_MAX) {
108 if ((*sevents)->cnt == (*sevents)->events_buffer_size) {
110 if (UCHAR_MAX - (*sevents)->cnt < steps)
111 steps = UCHAR_MAX - (*sevents)->cnt < steps;
113 void *ptr =
SCRealloc((*sevents)->events,
114 ((*sevents)->cnt + steps) *
sizeof(uint8_t));
120 (*sevents)->events = ptr;
121 (*sevents)->events_buffer_size += steps;
124 (*sevents)->events[(*sevents)->cnt++] = event;
129 if (events != NULL) {
138 if (events && *events != NULL) {
139 if ((*events)->events != NULL)
140 SCFree((*events)->events);
168 const char *event_name, uint8_t *event_id, AppLayerEventType *event_type)
171 *event_type = APP_LAYER_EVENT_TYPE_TRANSACTION;
@ DETECT_EVENT_TOO_MANY_BUFFERS
@ APPLAYER_UNEXPECTED_PROTOCOL
@ FILE_DECODER_EVENT_LZMA_UNKNOWN_ERROR
SCEnumCharMap det_ctx_event_table[]
@ FILE_DECODER_EVENT_LZMA_DECODER_ERROR
uint8_t event_last_logged
@ FILE_DECODER_EVENT_Z_UNKNOWN_ERROR
void AppLayerDecoderEventsFreeEvents(AppLayerDecoderEvents **events)
int DetectEngineGetEventInfo(const char *event_name, uint8_t *event_id, AppLayerEventType *event_type)
@ APPLAYER_PROTO_DETECTION_SKIPPED
@ FILE_DECODER_EVENT_LZMA_XZ_ERROR
void AppLayerDecoderEventsResetEvents(AppLayerDecoderEvents *events)
Data structure to store app layer decoder events.
@ APPLAYER_NO_TLS_AFTER_STARTTLS
@ APPLAYER_MISMATCH_PROTOCOL_BOTH_DIRECTIONS
int AppLayerGetPktEventInfo(const char *event_name, uint8_t *event_id)
@ FILE_DECODER_EVENT_Z_STREAM_ERROR
@ FILE_DECODER_EVENT_INVALID_SWF_LENGTH
@ FILE_DECODER_EVENT_LZMA_IO_ERROR
@ FILE_DECODER_EVENT_Z_BUF_ERROR
#define SCRealloc(ptr, sz)
const char * SCMapEnumValueToName(int enum_value, SCEnumCharMap *table)
Maps an enum value to a string name, from the supplied table.
SCEnumCharMap app_layer_event_pkt_table[]
int SCMapEnumNameToValue(const char *enum_name, SCEnumCharMap *table)
Maps a string name to an enum value from the supplied table. Please specify the last element of any m...
void AppLayerDecoderEventsSetEventRaw(AppLayerDecoderEvents **sevents, uint8_t event)
Set an app layer decoder event.
#define DECODER_EVENTS_BUFFER_STEPS
@ APPLAYER_DETECT_PROTOCOL_ONLY_ONE_DIRECTION
@ FILE_DECODER_EVENT_NO_MEM
#define SCLogError(...)
Macro used to log ERROR messages.
@ FILE_DECODER_EVENT_Z_DATA_ERROR
int AppLayerGetEventInfoById(uint8_t event_id, const char **event_name, AppLayerEventType *event_type)
@ FILE_DECODER_EVENT_INVALID_SWF_VERSION
@ APPLAYER_WRONG_DIRECTION_FIRST_DATA
@ FILE_DECODER_EVENT_LZMA_HEADER_TOO_SHORT_ERROR
int SCAppLayerGetEventIdByName(const char *event_name, SCEnumCharMap *table, uint8_t *event_id)
@ FILE_DECODER_EVENT_LZMA_MEMLIMIT_ERROR