applayer: add typedef for Parsing functions

pull/3009/head
Pierre Chifflier 8 years ago committed by Victor Julien
parent 6ce45bcf38
commit 7c8bdfd3dd

@ -88,10 +88,7 @@ struct AppLayerParserThreadCtx_ {
typedef struct AppLayerParserProtoCtx_
{
/* 0 - to_server, 1 - to_client. */
int (*Parser[2])(Flow *f, void *protocol_state,
AppLayerParserState *pstate,
uint8_t *input, uint32_t input_len,
void *local_storage);
AppLayerParserFPtr Parser[2];
char logger;
void *(*StateAlloc)(void);
@ -349,10 +346,7 @@ int AppLayerParserConfParserEnabled(const char *ipproto,
int AppLayerParserRegisterParser(uint8_t ipproto, AppProto alproto,
uint8_t direction,
int (*Parser)(Flow *f, void *protocol_state,
AppLayerParserState *pstate,
uint8_t *buf, uint32_t buf_len,
void *local_storage))
AppLayerParserFPtr Parser)
{
SCEnter();

@ -103,6 +103,12 @@ void AppLayerParserThreadCtxFree(AppLayerParserThreadCtx *tctx);
int AppLayerParserConfParserEnabled(const char *ipproto,
const char *alproto_name);
/** \brief Prototype for parsing functions */
typedef int (*AppLayerParserFPtr)(Flow *f, void *protocol_state,
AppLayerParserState *pstate,
uint8_t *buf, uint32_t buf_len,
void *local_storage);
/***** Parser related registration *****/
/**
@ -113,10 +119,7 @@ int AppLayerParserConfParserEnabled(const char *ipproto,
*/
int AppLayerParserRegisterParser(uint8_t ipproto, AppProto alproto,
uint8_t direction,
int (*Parser)(Flow *f, void *protocol_state,
AppLayerParserState *pstate,
uint8_t *buf, uint32_t buf_len,
void *local_storage));
AppLayerParserFPtr Parser);
void AppLayerParserRegisterParserAcceptableDataDirection(uint8_t ipproto,
AppProto alproto,
uint8_t direction);

Loading…
Cancel
Save