|
|
|
@ -122,6 +122,9 @@ typedef struct AppLayerParserProtoCtx_
|
|
|
|
|
|
|
|
|
|
void (*SetStreamDepthFlag)(void *tx, uint8_t flags);
|
|
|
|
|
|
|
|
|
|
AppLayerParserGetFrameIdByNameFn GetFrameIdByName;
|
|
|
|
|
AppLayerParserGetFrameNameByIdFn GetFrameNameById;
|
|
|
|
|
|
|
|
|
|
/* each app-layer has its own value */
|
|
|
|
|
uint32_t stream_depth;
|
|
|
|
|
|
|
|
|
@ -535,6 +538,16 @@ void AppLayerParserRegisterGetEventInfoById(uint8_t ipproto, AppProto alproto,
|
|
|
|
|
SCReturn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AppLayerParserRegisterGetFrameFuncs(uint8_t ipproto, AppProto alproto,
|
|
|
|
|
AppLayerParserGetFrameIdByNameFn GetIdByNameFunc,
|
|
|
|
|
AppLayerParserGetFrameNameByIdFn GetNameByIdFunc)
|
|
|
|
|
{
|
|
|
|
|
SCEnter();
|
|
|
|
|
alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetFrameIdByName = GetIdByNameFunc;
|
|
|
|
|
alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetFrameNameById = GetNameByIdFunc;
|
|
|
|
|
SCReturn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AppLayerParserRegisterGetEventInfo(uint8_t ipproto, AppProto alproto,
|
|
|
|
|
int (*StateGetEventInfo)(const char *event_name, int *event_id,
|
|
|
|
|
AppLayerEventType *event_type))
|
|
|
|
@ -1449,6 +1462,24 @@ void AppLayerParserSetStreamDepthFlag(uint8_t ipproto, AppProto alproto, void *s
|
|
|
|
|
SCReturn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int AppLayerParserGetFrameIdByName(uint8_t ipproto, AppProto alproto, const char *name)
|
|
|
|
|
{
|
|
|
|
|
if (alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetFrameIdByName != NULL) {
|
|
|
|
|
return alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetFrameIdByName(name);
|
|
|
|
|
} else {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const char *AppLayerParserGetFrameNameById(uint8_t ipproto, AppProto alproto, const uint8_t id)
|
|
|
|
|
{
|
|
|
|
|
if (alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetFrameNameById != NULL) {
|
|
|
|
|
return alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetFrameNameById(id);
|
|
|
|
|
} else {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***** Cleanup *****/
|
|
|
|
|
|
|
|
|
|
void AppLayerParserStateProtoCleanup(
|
|
|
|
|