Rename AppLayerParserParserState -> AppLayerParserState

pull/753/head
Victor Julien 13 years ago
parent c23742a0a7
commit cd0627cd39

@ -117,7 +117,7 @@ typedef struct AppLayerParserCtx_ {
AppLayerParserProtoCtx ctxs[FLOW_PROTO_MAX][ALPROTO_MAX]; AppLayerParserProtoCtx ctxs[FLOW_PROTO_MAX][ALPROTO_MAX];
} AppLayerParserCtx; } AppLayerParserCtx;
typedef struct AppLayerParserParserState_ { typedef struct AppLayerParserState_ {
uint8_t flags; uint8_t flags;
/* Indicates the current transaction that is being inspected. /* Indicates the current transaction that is being inspected.
@ -132,7 +132,7 @@ typedef struct AppLayerParserParserState_ {
/* Used to store decoder events. */ /* Used to store decoder events. */
AppLayerDecoderEvents *decoder_events; AppLayerDecoderEvents *decoder_events;
} AppLayerParserParserState; } AppLayerParserState;
/* Static global version of the parser context. /* Static global version of the parser context.
* Post 2.0 let's look at changing this to move it out to app-layer.c. */ * Post 2.0 let's look at changing this to move it out to app-layer.c. */
@ -143,7 +143,7 @@ static void AppLayerParserTransactionsCleanup(uint16_t ipproto, AppProto alproto
{ {
SCEnter(); SCEnter();
AppLayerParserParserState *parser_state_store = pstate; AppLayerParserState *parser_state_store = pstate;
uint64_t inspect = 0, log = 0; uint64_t inspect = 0, log = 0;
uint64_t min; uint64_t min;
AppLayerParserProtoCtx *ctx = &alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto]; AppLayerParserProtoCtx *ctx = &alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto];
@ -174,7 +174,7 @@ void *AppLayerParserAllocAppLayerParserParserState(void)
{ {
SCEnter(); SCEnter();
AppLayerParserParserState *pstate = (AppLayerParserParserState *)SCMalloc(sizeof(*pstate)); AppLayerParserState *pstate = (AppLayerParserState *)SCMalloc(sizeof(*pstate));
if (pstate == NULL) if (pstate == NULL)
goto end; goto end;
memset(pstate, 0, sizeof(*pstate)); memset(pstate, 0, sizeof(*pstate));
@ -187,8 +187,8 @@ void AppLayerParserDeAllocAppLayerParserParserState(void *pstate)
{ {
SCEnter(); SCEnter();
if (((AppLayerParserParserState *)pstate)->decoder_events != NULL) if (((AppLayerParserState *)pstate)->decoder_events != NULL)
AppLayerDecoderEventsFreeEvents(((AppLayerParserParserState *)pstate)->decoder_events); AppLayerDecoderEventsFreeEvents(((AppLayerParserState *)pstate)->decoder_events);
SCFree(pstate); SCFree(pstate);
SCReturn; SCReturn;
@ -524,14 +524,14 @@ uint64_t AppLayerParserGetTransactionLogId(void *pstate)
{ {
SCEnter(); SCEnter();
SCReturnCT(((AppLayerParserParserState *)pstate)->log_id, "uint64_t"); SCReturnCT(((AppLayerParserState *)pstate)->log_id, "uint64_t");
} }
void AppLayerParserSetTransactionLogId(void *pstate) void AppLayerParserSetTransactionLogId(void *pstate)
{ {
SCEnter(); SCEnter();
((AppLayerParserParserState *)pstate)->log_id++; ((AppLayerParserState *)pstate)->log_id++;
SCReturn; SCReturn;
} }
@ -540,7 +540,7 @@ uint64_t AppLayerParserGetTransactionInspectId(void *pstate, uint8_t direction)
{ {
SCEnter(); SCEnter();
SCReturnCT(((AppLayerParserParserState *)pstate)-> SCReturnCT(((AppLayerParserState *)pstate)->
inspect_id[direction & STREAM_TOSERVER ? 0 : 1], "uint64_t"); inspect_id[direction & STREAM_TOSERVER ? 0 : 1], "uint64_t");
} }
@ -567,7 +567,7 @@ void AppLayerParserSetTransactionInspectId(void *pstate,
else else
break; break;
} }
((AppLayerParserParserState *)pstate)->inspect_id[dir] = idx; ((AppLayerParserState *)pstate)->inspect_id[dir] = idx;
SCReturn; SCReturn;
} }
@ -576,13 +576,13 @@ AppLayerDecoderEvents *AppLayerParserGetDecoderEvents(void *pstate)
{ {
SCEnter(); SCEnter();
SCReturnPtr(((AppLayerParserParserState *)pstate)->decoder_events, SCReturnPtr(((AppLayerParserState *)pstate)->decoder_events,
"AppLayerDecoderEvents *"); "AppLayerDecoderEvents *");
} }
void AppLayerParserSetDecoderEvents(void *pstate, AppLayerDecoderEvents *devents) void AppLayerParserSetDecoderEvents(void *pstate, AppLayerDecoderEvents *devents)
{ {
(((AppLayerParserParserState *)pstate)->decoder_events) = devents; (((AppLayerParserState *)pstate)->decoder_events) = devents;
} }
AppLayerDecoderEvents *AppLayerParserGetEventsByTx(uint16_t ipproto, AppProto alproto, AppLayerDecoderEvents *AppLayerParserGetEventsByTx(uint16_t ipproto, AppProto alproto,
@ -605,7 +605,7 @@ AppLayerDecoderEvents *AppLayerParserGetEventsByTx(uint16_t ipproto, AppProto al
uint16_t AppLayerParserGetStateVersion(void *pstate) uint16_t AppLayerParserGetStateVersion(void *pstate)
{ {
SCEnter(); SCEnter();
SCReturnCT((pstate == NULL) ? 0 : ((AppLayerParserParserState *)pstate)->version, SCReturnCT((pstate == NULL) ? 0 : ((AppLayerParserState *)pstate)->version,
"uint16_t"); "uint16_t");
} }
@ -678,7 +678,7 @@ uint64_t AppLayerParserGetTransactionActive(uint16_t ipproto, AppProto alproto,
{ {
SCEnter(); SCEnter();
AppLayerParserParserState *state = (AppLayerParserParserState *)pstate; AppLayerParserState *state = (AppLayerParserState *)pstate;
uint64_t active_id; uint64_t active_id;
uint64_t log_id = state->log_id; uint64_t log_id = state->log_id;
@ -699,7 +699,7 @@ int AppLayerParserParse(void *tctx, Flow *f, AppProto alproto,
{ {
SCEnter(); SCEnter();
AppLayerParserParserState *pstate = NULL; AppLayerParserState *pstate = NULL;
AppLayerParserProtoCtx *p = &alp_ctx.ctxs[FlowGetProtoMapping(f->proto)][alproto]; AppLayerParserProtoCtx *p = &alp_ctx.ctxs[FlowGetProtoMapping(f->proto)][alproto];
TcpSession *ssn = NULL; TcpSession *ssn = NULL;
void *alstate = NULL; void *alstate = NULL;
@ -805,7 +805,7 @@ void AppLayerParserSetEOF(void *pstate)
AppLayerParserParserStateSetFlag(pstate, APP_LAYER_PARSER_EOF); AppLayerParserParserStateSetFlag(pstate, APP_LAYER_PARSER_EOF);
/* increase version so we will inspect it one more time /* increase version so we will inspect it one more time
* with the EOF flags now set */ * with the EOF flags now set */
((AppLayerParserParserState *)pstate)->version++; ((AppLayerParserState *)pstate)->version++;
end: end:
SCReturn; SCReturn;
@ -958,14 +958,14 @@ void AppLayerParserRegisterProtocolParsers(void)
void AppLayerParserParserStateSetFlag(void *pstate, uint8_t flag) void AppLayerParserParserStateSetFlag(void *pstate, uint8_t flag)
{ {
SCEnter(); SCEnter();
((AppLayerParserParserState *)pstate)->flags |= flag; ((AppLayerParserState *)pstate)->flags |= flag;
SCReturn; SCReturn;
} }
int AppLayerParserParserStateIssetFlag(void *pstate, uint8_t flag) int AppLayerParserParserStateIssetFlag(void *pstate, uint8_t flag)
{ {
SCEnter(); SCEnter();
SCReturnInt(((AppLayerParserParserState *)pstate)->flags & flag); SCReturnInt(((AppLayerParserState *)pstate)->flags & flag);
} }
@ -989,7 +989,7 @@ void AppLayerParserPrintDetailsParserState(void *pstate)
if (pstate == NULL) if (pstate == NULL)
SCReturn; SCReturn;
AppLayerParserParserState *p = (AppLayerParserParserState *)pstate; AppLayerParserState *p = (AppLayerParserState *)pstate;
SCLogDebug("AppLayerParser parser state information for parser state p(%p). " SCLogDebug("AppLayerParser parser state information for parser state p(%p). "
"p->inspect_id[0](%"PRIu64"), " "p->inspect_id[0](%"PRIu64"), "
"p->inspect_id[1](%"PRIu64"), " "p->inspect_id[1](%"PRIu64"), "

Loading…
Cancel
Save