Rename functions related to AppLayerState to be more consistent.
HTPHandleError(hstate);
/* if the TCP connection is closed, then close the HTTP connection */
- if (AppLayerParserParserStateIssetFlag(pstate, APP_LAYER_PARSER_EOF) &&
+ if (AppLayerParserStateIssetFlag(pstate, APP_LAYER_PARSER_EOF) &&
!(hstate->flags & HTP_FLAG_STATE_CLOSED_TS))
{
htp_connp_close(hstate->connp, &ts);
}
/* if we the TCP connection is closed, then close the HTTP connection */
- if (AppLayerParserParserStateIssetFlag(pstate, APP_LAYER_PARSER_EOF) &&
+ if (AppLayerParserStateIssetFlag(pstate, APP_LAYER_PARSER_EOF) &&
!(hstate->flags & HTP_FLAG_STATE_CLOSED_TC))
{
htp_connp_close(hstate->connp, &ts);
memset(&hstate, 0x00, sizeof(hstate));
Flow flow;
memset(&flow, 0x00, sizeof(flow));
- void *parser = AppLayerParserAllocAppLayerParserParserState();
+ void *parser = AppLayerParserStateAlloc();
memset(&parser, 0x00, sizeof(parser));
htp_tx_t tx;
memset(&tx, 0, sizeof(tx));
SCReturn;
}
-void *AppLayerParserAllocAppLayerParserParserState(void)
+void *AppLayerParserStateAlloc(void)
{
SCEnter();
SCReturnPtr(pstate, "pstate");
}
-void AppLayerParserDeAllocAppLayerParserParserState(void *pstate)
+void AppLayerParserStateFree(void *pstate)
{
SCEnter();
/* Get the parser state (if any) */
pstate = f->alparser;
if (pstate == NULL) {
- f->alparser = pstate = AppLayerParserAllocAppLayerParserParserState();
+ f->alparser = pstate = AppLayerParserStateAlloc();
if (pstate == NULL)
goto error;
}
pstate->version);
if (flags & STREAM_EOF)
- AppLayerParserParserStateSetFlag(pstate, APP_LAYER_PARSER_EOF);
+ AppLayerParserStateSetFlag(pstate, APP_LAYER_PARSER_EOF);
alstate = f->alstate;
if (alstate == NULL) {
if (pstate == NULL)
goto end;
- AppLayerParserParserStateSetFlag(pstate, APP_LAYER_PARSER_EOF);
+ AppLayerParserStateSetFlag(pstate, APP_LAYER_PARSER_EOF);
/* increase version so we will inspect it one more time
* with the EOF flags now set */
((AppLayerParserState *)pstate)->version++;
/***** Cleanup *****/
-void AppLayerParserCleanupParserState(uint16_t ipproto, AppProto alproto, void *alstate, void *pstate)
+void AppLayerParserStateCleanup(uint16_t ipproto, AppProto alproto, void *alstate, void *pstate)
{
SCEnter();
/* free the app layer parser api state */
if (pstate != NULL)
- AppLayerParserDeAllocAppLayerParserParserState(pstate);
+ AppLayerParserStateFree(pstate);
SCReturn;
}
}
-void AppLayerParserParserStateSetFlag(void *pstate, uint8_t flag)
+void AppLayerParserStateSetFlag(void *pstate, uint8_t flag)
{
SCEnter();
((AppLayerParserState *)pstate)->flags |= flag;
SCReturn;
}
-int AppLayerParserParserStateIssetFlag(void *pstate, uint8_t flag)
+int AppLayerParserStateIssetFlag(void *pstate, uint8_t flag)
{
SCEnter();
SCReturnInt(((AppLayerParserState *)pstate)->flags & flag);
}
#ifdef DEBUG
-void AppLayerParserPrintDetailsParserState(void *pstate)
+void AppLayerParserStatePrintDetails(void *pstate)
{
SCEnter();
/***** Cleanup *****/
-void AppLayerParserCleanupParserState(uint16_t ipproto, AppProto alproto, void *alstate, void *pstate);
+void AppLayerParserStateCleanup(uint16_t ipproto, AppProto alproto, void *alstate, void *pstate);
void AppLayerParserRegisterProtocolParsers(void);
-void AppLayerParserParserStateSetFlag(void *pstate, uint8_t flag);
-int AppLayerParserParserStateIssetFlag(void *pstate, uint8_t flag);
+void AppLayerParserStateSetFlag(void *pstate, uint8_t flag);
+int AppLayerParserStateIssetFlag(void *pstate, uint8_t flag);
void AppLayerParserStreamTruncated(uint16_t ipproto, AppProto alproto, void *alstate,
uint8_t direction);
-void *AppLayerParserAllocAppLayerParserParserState(void);
-void AppLayerParserDeAllocAppLayerParserParserState(void *pstate);
+void *AppLayerParserStateAlloc(void);
+void AppLayerParserStateFree(void *pstate);
#ifdef DEBUG
-void AppLayerParserPrintDetailsParserState(void *pstate);
+void AppLayerParserStatePrintDetails(void *pstate);
#endif
/***** Unittests *****/
if (reply_code == SMTP_REPLY_220) {
/* we are entering STARRTTLS data mode */
state->parser_state |= SMTP_PARSER_STATE_COMMAND_DATA_MODE;
- AppLayerParserParserStateSetFlag(pstate,
+ AppLayerParserStateSetFlag(pstate,
APP_LAYER_PARSER_NO_INSPECTION |
APP_LAYER_PARSER_NO_REASSEMBLY);
} else {
if ((ssl_state->flags & SSL_AL_FLAG_SSL_CLIENT_SSN_ENCRYPTED) &&
(ssl_state->flags & SSL_AL_FLAG_SSL_SERVER_SSN_ENCRYPTED)) {
- AppLayerParserParserStateSetFlag(pstate,
+ AppLayerParserStateSetFlag(pstate,
APP_LAYER_PARSER_NO_INSPECTION);
if (ssl_config.no_reassemble == 1)
- AppLayerParserParserStateSetFlag(pstate, APP_LAYER_PARSER_NO_REASSEMBLY);
+ AppLayerParserStateSetFlag(pstate, APP_LAYER_PARSER_NO_REASSEMBLY);
SCLogDebug("SSLv2 No reassembly & inspection has been set");
}
}
if ((ssl_state->flags & SSL_AL_FLAG_CLIENT_CHANGE_CIPHER_SPEC) &&
(ssl_state->flags & SSL_AL_FLAG_SERVER_CHANGE_CIPHER_SPEC)) {
/* set flags */
- AppLayerParserParserStateSetFlag(pstate, APP_LAYER_PARSER_NO_INSPECTION);
+ AppLayerParserStateSetFlag(pstate, APP_LAYER_PARSER_NO_INSPECTION);
if (ssl_config.no_reassemble == 1)
- AppLayerParserParserStateSetFlag(pstate, APP_LAYER_PARSER_NO_REASSEMBLY);
+ AppLayerParserStateSetFlag(pstate, APP_LAYER_PARSER_NO_REASSEMBLY);
}
break;
goto end;
}
- if (!AppLayerParserParserStateIssetFlag(f.alparser, APP_LAYER_PARSER_NO_INSPECTION) &&
+ if (!AppLayerParserStateIssetFlag(f.alparser, APP_LAYER_PARSER_NO_INSPECTION) &&
!(ssn.client.flags & STREAMTCP_STREAM_FLAG_NOREASSEMBLY) &&
!(ssn.server.flags & STREAMTCP_STREAM_FLAG_NOREASSEMBLY)) {
printf("The flags should be set\n");
p->pcap_cnt, p->flowflags & FLOW_PKT_TOSERVER ? "toserver" : "toclient",
p->flags & PKT_STREAM_EST ? "established" : "stateless",
smsg ? "yes" : "no");
- AppLayerParserPrintDetailsParserState(f->alparser);
+ AppLayerParserStatePrintDetails(f->alparser);
}
#endif
if (f == NULL || f->proto == 0)
return;
- AppLayerParserCleanupParserState(f->proto, f->alproto, f->alstate, f->alparser);
+ AppLayerParserStateCleanup(f->proto, f->alproto, f->alstate, f->alparser);
f->alstate = NULL;
f->alparser = NULL;
return;
continue;
}
- if (!AppLayerParserParserStateIssetFlag(p->flow->alparser, APP_LAYER_PARSER_EOF)) {
+ if (!AppLayerParserStateIssetFlag(p->flow->alparser, APP_LAYER_PARSER_EOF)) {
tx_progress = AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, tx, STREAM_TOSERVER);
if (tx_progress < tx_progress_done_value_ts)
break;