Provide a function to set the app layer tx eof flag. Use this in FFR code instead of diretly setting the flag. This cleans up the API as well

remotes/origin/master-1.1.x
Anoop Saldanha 14 years ago committed by Victor Julien
parent b406af451b
commit c13ad8c28a

@ -56,7 +56,7 @@
#include "util-debug.h"
uint16_t app_layer_sid = 0;
static uint16_t app_layer_sid = 0;
static AppLayerProto al_proto_table[ALPROTO_MAX]; /**< Application layer protocol
table mapped to their
corresponding parsers */
@ -174,6 +174,17 @@ static int AlpStoreField(AppLayerParserResult *output, uint16_t idx,
SCReturnInt(0);
}
void AppLayerSetEOF(Flow *f)
{
AppLayerParserStateStore *parser_state_store =
(AppLayerParserStateStore *)f->aldata[app_layer_sid];
if (parser_state_store != NULL) {
parser_state_store->id_flags |= APP_LAYER_TRANSACTION_EOF;
parser_state_store->to_client.flags |= APP_LAYER_PARSER_EOF;
parser_state_store->to_server.flags |= APP_LAYER_PARSER_EOF;
}
}
/** \brief Parse a field up to we reach the size limit
*
* \retval 1 Field found and stored.

@ -251,6 +251,7 @@ int AlpParseFieldByDelimiter(AppLayerParserResult *, AppLayerParserState *,
uint16_t, const uint8_t *, uint8_t, uint8_t *,
uint32_t, uint32_t *);
uint16_t AlpGetStateIdx(uint16_t);
void AppLayerSetEOF(Flow *);
uint16_t AppLayerGetProtoByName(const char *);

@ -214,11 +214,7 @@ static inline Packet *FlowForceReassemblyPseudoPacketSetup(Packet *p,
memset(&p->ts, 0, sizeof(struct timeval));
TimeGet(&p->ts);
AppLayerParserStateStore *parser_state_store =
(AppLayerParserStateStore *)f->aldata[app_layer_sid];
if (parser_state_store != NULL) {
parser_state_store->id_flags |= APP_LAYER_TRANSACTION_EOF;
}
AppLayerSetEOF(f);
return p;
}

Loading…
Cancel
Save