uint8_t flags, uint8_t *input, uint32_t input_len)
{
SCEnter();
-
+#ifdef DEBUG_VALIDATION
+ BUG_ON(f->protomap != FlowGetProtoMapping(f->proto));
+#endif
AppLayerParserState *pstate = NULL;
- AppLayerParserProtoCtx *p = &alp_ctx.ctxs[FlowGetProtoMapping(f->proto)][alproto];
- TcpSession *ssn = NULL;
+ AppLayerParserProtoCtx *p = &alp_ctx.ctxs[f->protomap][alproto];
void *alstate = NULL;
/* we don't have the parser registered for this protocol */
if (p->StateAlloc == NULL)
goto end;
- /* Used only if it's TCP */
- ssn = f->protoctx;
-
/* Do this check before calling AppLayerParse */
if (flags & STREAM_GAP) {
SCLogDebug("stream gap detected (missing packets), "
/* invoke the parser */
if (p->Parser[(flags & STREAM_TOSERVER) ? 0 : 1](f, alstate, pstate,
input, input_len,
- alp_tctx->alproto_local_storage[FlowGetProtoMapping(f->proto)][alproto]) < 0)
+ alp_tctx->alproto_local_storage[f->protomap][alproto]) < 0)
{
goto error;
}
FlowSetSessionNoApplayerInspectionFlag(f);
/* Set the no reassembly flag for both the stream in this TcpSession */
- if (pstate->flags & APP_LAYER_PARSER_NO_REASSEMBLY) {
+ if (f->proto == IPPROTO_TCP && pstate->flags & APP_LAYER_PARSER_NO_REASSEMBLY) {
+ /* Used only if it's TCP */
+ TcpSession *ssn = f->protoctx;
if (ssn != NULL) {
StreamTcpSetSessionNoReassemblyFlag(ssn,
flags & STREAM_TOCLIENT ? 1 : 0);
end:
SCReturnInt(0);
error:
- if (ssn != NULL) {
- /* Set the no app layer inspection flag for both
- * the stream in this Flow */
- FlowSetSessionNoApplayerInspectionFlag(f);
- AppLayerParserSetEOF(pstate);
- }
+ /* Set the no app layer inspection flag for both
+ * the stream in this Flow */
+ FlowSetSessionNoApplayerInspectionFlag(f);
+ AppLayerParserSetEOF(pstate);
SCReturnInt(-1);
}
goto end;
f->alproto = ALPROTO_TEST;
f->proto = IPPROTO_UDP;
+ f->protomap = FlowGetProtoMapping(f->proto);
StreamTcpInitConfig(TRUE);
FLOW_INITIALIZE(&f);
f.flags |= FLOW_IPV4;
f.proto = IPPROTO_UDP;
+ f.protomap = FlowGetProtoMapping(f.proto);
p->flow = &f;
p->flags |= PKT_HAS_FLOW;
FLOW_INITIALIZE(&f);
f.flags |= FLOW_IPV4;
f.proto = IPPROTO_UDP;
+ f.protomap = FlowGetProtoMapping(f.proto);
f.alproto = ALPROTO_DNS;
p1->flow = &f;
f.protoctx = (void *)&ssn;
f.flags |= FLOW_IPV4;
f.proto = IPPROTO_TCP;
+ f.protomap = FlowGetProtoMapping(f.proto);
p->flow = &f;
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.protoctx = (void *)&ssn;
f.flags |= FLOW_IPV4;
f.proto = IPPROTO_TCP;
+ f.protomap = FlowGetProtoMapping(f.proto);
f.alproto = ALPROTO_DNS;
p1->flow = &f;
f.protoctx = (void *)&ssn;
f.flags |= FLOW_IPV4;
f.proto = IPPROTO_TCP;
+ f.protomap = FlowGetProtoMapping(f.proto);
f.alproto = ALPROTO_DNS;
p1->flow = &f;
FLOW_INITIALIZE(&f);
f.flags |= FLOW_IPV4;
f.proto = IPPROTO_UDP;
+ f.protomap = FlowGetProtoMapping(f.proto);
p->flow = &f;
p->flags |= PKT_HAS_FLOW;
FLOW_INITIALIZE(&f);
f.flags |= FLOW_IPV4;
f.proto = IPPROTO_UDP;
+ f.protomap = FlowGetProtoMapping(f.proto);
f.alproto = ALPROTO_DNS;
p1->flow = &f;