|
|
@ -106,6 +106,9 @@ typedef struct AppLayerParserProtoCtx_
|
|
|
|
int (*StateGetEventInfo)(const char *event_name,
|
|
|
|
int (*StateGetEventInfo)(const char *event_name,
|
|
|
|
int *event_id, AppLayerEventType *event_type);
|
|
|
|
int *event_id, AppLayerEventType *event_type);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DetectEngineState *(*GetTxDetectState)(void *tx);
|
|
|
|
|
|
|
|
int (*SetTxDetectState)(void *tx, DetectEngineState *);
|
|
|
|
|
|
|
|
|
|
|
|
/* Indicates the direction the parser is ready to see the data
|
|
|
|
/* Indicates the direction the parser is ready to see the data
|
|
|
|
* the first time for a flow. Values accepted -
|
|
|
|
* the first time for a flow. Values accepted -
|
|
|
|
* STREAM_TOSERVER, STREAM_TOCLIENT */
|
|
|
|
* STREAM_TOSERVER, STREAM_TOCLIENT */
|
|
|
@ -468,6 +471,18 @@ void AppLayerParserRegisterGetEventInfo(uint8_t ipproto, AppProto alproto,
|
|
|
|
SCReturn;
|
|
|
|
SCReturn;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AppLayerParserRegisterDetectStateFuncs(uint8_t ipproto, AppProto alproto,
|
|
|
|
|
|
|
|
DetectEngineState *(*GetTxDetectState)(void *tx),
|
|
|
|
|
|
|
|
int (*SetTxDetectState)(void *tx, DetectEngineState *))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SCEnter();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetTxDetectState = GetTxDetectState;
|
|
|
|
|
|
|
|
alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].SetTxDetectState = SetTxDetectState;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SCReturn;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***** Get and transaction functions *****/
|
|
|
|
/***** Get and transaction functions *****/
|
|
|
|
|
|
|
|
|
|
|
|
void *AppLayerParserGetProtocolParserLocalStorage(uint8_t ipproto, AppProto alproto)
|
|
|
|
void *AppLayerParserGetProtocolParserLocalStorage(uint8_t ipproto, AppProto alproto)
|
|
|
@ -782,6 +797,31 @@ uint64_t AppLayerParserGetTransactionActive(uint8_t ipproto, AppProto alproto,
|
|
|
|
SCReturnCT(active_id, "uint64_t");
|
|
|
|
SCReturnCT(active_id, "uint64_t");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int AppLayerParserSupportsTxDetectState(uint8_t ipproto, AppProto alproto)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetTxDetectState != NULL)
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DetectEngineState *AppLayerParserGetTxDetectState(uint8_t ipproto, AppProto alproto, void *tx)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SCEnter();
|
|
|
|
|
|
|
|
DetectEngineState *s;
|
|
|
|
|
|
|
|
s = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetTxDetectState(tx);
|
|
|
|
|
|
|
|
SCReturnPtr(s, "DetectEngineState");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int AppLayerParserSetTxDetectState(uint8_t ipproto, AppProto alproto, void *tx, DetectEngineState *s)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int r;
|
|
|
|
|
|
|
|
SCEnter();
|
|
|
|
|
|
|
|
if ((alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetTxDetectState(tx) != NULL))
|
|
|
|
|
|
|
|
SCReturnInt(-EBUSY);
|
|
|
|
|
|
|
|
r = alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].SetTxDetectState(tx, s);
|
|
|
|
|
|
|
|
SCReturnInt(r);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***** General *****/
|
|
|
|
/***** General *****/
|
|
|
|
|
|
|
|
|
|
|
|
int AppLayerParserParse(AppLayerParserThreadCtx *alp_tctx, Flow *f, AppProto alproto,
|
|
|
|
int AppLayerParserParse(AppLayerParserThreadCtx *alp_tctx, Flow *f, AppProto alproto,
|
|
|
|