@ -107,6 +107,9 @@ typedef struct AppLayerParserProtoCtx_
int ( * StateGetEventInfo ) ( const char * event_name ,
int * event_id , AppLayerEventType * event_type ) ;
int ( * StateGetTxLogged ) ( void * alstate , void * tx , uint32_t logger ) ;
void ( * StateSetTxLogged ) ( void * alstate , void * tx , uint32_t logger ) ;
int ( * StateHasTxDetectState ) ( void * alstate ) ;
DetectEngineState * ( * GetTxDetectState ) ( void * tx ) ;
int ( * SetTxDetectState ) ( void * alstate , void * tx , DetectEngineState * ) ;
@ -386,6 +389,21 @@ void AppLayerParserRegisterHasEventsFunc(uint8_t ipproto, AppProto alproto,
SCReturn ;
}
void AppLayerParserRegisterLoggerFuncs ( uint8_t ipproto , AppProto alproto ,
int ( * StateGetTxLogged ) ( void * , void * , uint32_t ) ,
void ( * StateSetTxLogged ) ( void * , void * , uint32_t ) )
{
SCEnter ( ) ;
alp_ctx . ctxs [ FlowGetProtoMapping ( ipproto ) ] [ alproto ] . StateGetTxLogged =
StateGetTxLogged ;
alp_ctx . ctxs [ FlowGetProtoMapping ( ipproto ) ] [ alproto ] . StateSetTxLogged =
StateSetTxLogged ;
SCReturn ;
}
void AppLayerParserRegisterLogger ( uint8_t ipproto , AppProto alproto )
{
SCEnter ( ) ;
@ -518,6 +536,35 @@ void AppLayerParserDestroyProtocolParserLocalStorage(uint8_t ipproto, AppProto a
SCReturn ;
}
void AppLayerParserSetTxLogged ( uint8_t ipproto , AppProto alproto ,
void * alstate , void * tx , uint32_t logger )
{
SCEnter ( ) ;
if ( alp_ctx . ctxs [ FlowGetProtoMapping ( ipproto ) ] [ alproto ] .
StateSetTxLogged ! = NULL ) {
alp_ctx . ctxs [ FlowGetProtoMapping ( ipproto ) ] [ alproto ] .
StateSetTxLogged ( alstate , tx , logger ) ;
}
SCReturn ;
}
int AppLayerParserGetTxLogged ( uint8_t ipproto , AppProto alproto ,
void * alstate , void * tx , uint32_t logger )
{
SCEnter ( ) ;
uint8_t r = 0 ;
if ( alp_ctx . ctxs [ FlowGetProtoMapping ( ipproto ) ] [ alproto ] .
StateGetTxLogged ! = NULL ) {
r = alp_ctx . ctxs [ FlowGetProtoMapping ( ipproto ) ] [ alproto ] .
StateGetTxLogged ( alstate , tx , logger ) ;
}
SCReturnInt ( r ) ;
}
uint64_t AppLayerParserGetTransactionLogId ( AppLayerParserState * pstate )
{
SCEnter ( ) ;