applayer: add typedef for Parsing functions

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

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

@ -103,6 +103,12 @@ void AppLayerParserThreadCtxFree(AppLayerParserThreadCtx *tctx);
int AppLayerParserConfParserEnabled(const char *ipproto, int AppLayerParserConfParserEnabled(const char *ipproto,
const char *alproto_name); 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 *****/ /***** Parser related registration *****/
/** /**
@ -113,10 +119,7 @@ int AppLayerParserConfParserEnabled(const char *ipproto,
*/ */
int AppLayerParserRegisterParser(uint8_t ipproto, AppProto alproto, int AppLayerParserRegisterParser(uint8_t ipproto, AppProto alproto,
uint8_t direction, uint8_t direction,
int (*Parser)(Flow *f, void *protocol_state, AppLayerParserFPtr Parser);
AppLayerParserState *pstate,
uint8_t *buf, uint32_t buf_len,
void *local_storage));
void AppLayerParserRegisterParserAcceptableDataDirection(uint8_t ipproto, void AppLayerParserRegisterParserAcceptableDataDirection(uint8_t ipproto,
AppProto alproto, AppProto alproto,
uint8_t direction); uint8_t direction);

Loading…
Cancel
Save