uint8_t flags;
/* State version, incremented for each update. Can wrap around. */
- uint16_t version;
+ uint8_t version;
/* Indicates the current transaction that is being inspected.
* We have a var per direction. */
uint64_t inspect_id[2];
uint16_t AppLayerParserGetStateVersion(AppLayerParserState *pstate)
{
SCEnter();
- SCReturnCT((pstate == NULL) ? 0 : pstate->version, "uint16_t");
+ SCReturnCT((pstate == NULL) ? 0 : pstate->version, "uint8_t");
}
FileContainer *AppLayerParserGetFiles(uint8_t ipproto, AppProto alproto,
goto error;
}
pstate->version++;
- SCLogDebug("app layer parser state version incremented to %"PRIu16,
+ SCLogDebug("app layer parser state version incremented to %"PRIu8,
pstate->version);
if (flags & STREAM_EOF)
"p->inspect_id[0](%"PRIu64"), "
"p->inspect_id[1](%"PRIu64"), "
"p->log_id(%"PRIu64"), "
- "p->version(%"PRIu16"), "
+ "p->version(%"PRIu8"), "
"p->decoder_events(%p).",
pstate, p->inspect_id[0], p->inspect_id[1], p->log_id,
p->version, p->decoder_events);
}
static void DeStateStoreStateVersion(Flow *f,
- uint16_t alversion, uint8_t direction)
+ const uint8_t alversion, uint8_t direction)
{
f->detect_alversion[direction & STREAM_TOSERVER ? 0 : 1] = alversion;
}
* \retval 1 inspectable state
* \retval 2 inspectable state, but no update
*/
-int DeStateFlowHasInspectableState(Flow *f, AppProto alproto, uint16_t alversion, uint8_t flags)
+int DeStateFlowHasInspectableState(Flow *f, AppProto alproto,
+ const uint8_t alversion, uint8_t flags)
{
int r = 0;
}
static int StoreState(DetectEngineThreadCtx *det_ctx,
- Flow *f, const uint8_t flags, const uint16_t alversion,
+ Flow *f, const uint8_t flags, const uint8_t alversion,
Signature *s, SigMatch *sm, const uint32_t inspect_flags,
const uint16_t file_no_match)
{
* \param check_before_add check for duplicates before adding the sig
*/
static void StoreStateTx(DetectEngineThreadCtx *det_ctx,
- Flow *f, const uint8_t flags, const uint16_t alversion,
+ Flow *f, const uint8_t flags, const uint8_t alversion,
const uint64_t tx_id, void *tx,
Signature *s, SigMatch *sm,
const uint32_t inspect_flags, const uint16_t file_no_match, int check_before_add)
int DeStateDetectStartDetection(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Packet *p, Flow *f, uint8_t flags,
- AppProto alproto, uint16_t alversion)
+ AppProto alproto, const uint8_t alversion)
{
SigMatch *sm = NULL;
uint16_t file_no_match = 0;
void DeStateDetectContinueDetection(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Packet *p, Flow *f, uint8_t flags,
- AppProto alproto, uint16_t alversion)
+ AppProto alproto, const uint8_t alversion)
{
uint16_t file_no_match = 0;
SigIntId store_cnt = 0;
* \retval 1 Has state.
* \retval 0 Has no state.
*/
-int DeStateFlowHasInspectableState(Flow *f, AppProto alproto, uint16_t alversion, uint8_t flags);
+int DeStateFlowHasInspectableState(Flow *f, AppProto alproto, uint8_t alversion, uint8_t flags);
/**
* \brief Match app layer sig list against app state and store relevant match
int DeStateDetectStartDetection(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Signature *s, Packet *p, Flow *f, uint8_t flags,
- AppProto alproto, uint16_t alversion);
+ AppProto alproto, uint8_t alversion);
/**
* \brief Continue DeState detection of the signatures stored in the state.
void DeStateDetectContinueDetection(ThreadVars *tv, DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
Packet *p, Flow *f, uint8_t flags,
- AppProto alproto, uint16_t alversion);
+ AppProto alproto, uint8_t alversion);
/**
* \brief Update the inspect id.