diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index b254a5c87c..f6b37a2cfe 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -803,7 +803,7 @@ int AppLayerParse(Flow *f, uint8_t proto, uint8_t flags, uint8_t *input, ssn = f->protoctx; /** Do this check before calling AppLayerParse */ - if (flags & FLOW_AL_STREAM_GAP) { + if (flags & STREAM_GAP) { SCLogDebug("stream gap detected (missing packets), this is not yet supported."); goto error; } @@ -831,7 +831,7 @@ int AppLayerParse(Flow *f, uint8_t proto, uint8_t flags, uint8_t *input, } AppLayerParserState *parser_state = NULL; - if (flags & FLOW_AL_STREAM_TOSERVER) { + if (flags & STREAM_TOSERVER) { SCLogDebug("to_server msg (flow %p)", f); parser_state = &parser_state_store->to_server; @@ -864,7 +864,7 @@ int AppLayerParse(Flow *f, uint8_t proto, uint8_t flags, uint8_t *input, SCReturnInt(0); } - if (flags & FLOW_AL_STREAM_EOF) + if (flags & STREAM_EOF) parser_state->flags |= APP_LAYER_PARSER_EOF; /* See if we already have a 'app layer' state */ @@ -904,9 +904,9 @@ int AppLayerParse(Flow *f, uint8_t proto, uint8_t flags, uint8_t *input, if (parser_state->flags & APP_LAYER_PARSER_NO_REASSEMBLY) { if (ssn != NULL) { StreamTcpSetSessionNoReassemblyFlag(ssn, - flags & FLOW_AL_STREAM_TOCLIENT ? 1 : 0); + flags & STREAM_TOCLIENT ? 1 : 0); StreamTcpSetSessionNoReassemblyFlag(ssn, - flags & FLOW_AL_STREAM_TOSERVER ? 1 : 0); + flags & STREAM_TOSERVER ? 1 : 0); } } } diff --git a/src/app-layer.c b/src/app-layer.c index 62c43edd73..cfa4761568 100644 --- a/src/app-layer.c +++ b/src/app-layer.c @@ -141,16 +141,6 @@ int AppLayerHandleTCPData(AlpProtoDetectThreadCtx *dp_ctx, Flow *f, SCLogDebug("STREAM_TOCLIENT"); } - if (flags & STREAM_GAP) { - f->alflags |= FLOW_AL_STREAM_GAP; - SCLogDebug("STREAM_GAP"); - } - - if (flags & STREAM_EOF) { - f->alflags |= FLOW_AL_STREAM_EOF; - SCLogDebug("STREAM_EOF"); - } - SCLogDebug("data_len %u flags %02X", data_len, flags); if (!(f->alflags & FLOW_AL_NO_APPLAYER_INSPECTION)) { /* if we don't know the proto yet and we have received a stream @@ -182,7 +172,7 @@ int AppLayerHandleTCPData(AlpProtoDetectThreadCtx *dp_ctx, Flow *f, ssn->flags |= STREAMTCP_FLAG_APPPROTO_DETECTION_COMPLETED; f->alflags |= FLOW_AL_PROTO_DETECT_DONE; - r = AppLayerParse(f, alproto, f->alflags, data, data_len); + r = AppLayerParse(f, alproto, flags, data, data_len); } else { if (flags & STREAM_TOSERVER) { SCLogDebug("alp_proto_ctx.toserver.max_len %u", alp_proto_ctx.toserver.max_len); @@ -342,10 +332,6 @@ int AppLayerHandleMsg(AlpProtoDetectThreadCtx *dp_ctx, StreamMsg *smsg) smsg->flow->alflags |= FLOW_AL_STREAM_TOSERVER; if (smsg->flags & STREAM_TOCLIENT) smsg->flow->alflags |= FLOW_AL_STREAM_TOCLIENT; - if (smsg->flags & STREAM_GAP) - smsg->flow->alflags |= FLOW_AL_STREAM_GAP; - if (smsg->flags & STREAM_EOF) - smsg->flow->alflags |= FLOW_AL_STREAM_EOF; if (!(smsg->flow->alflags & FLOW_AL_NO_APPLAYER_INSPECTION)) { /* if we don't know the proto yet and we have received a stream diff --git a/src/flow.h b/src/flow.h index c9f58f9e16..25fe520526 100644 --- a/src/flow.h +++ b/src/flow.h @@ -216,11 +216,8 @@ typedef struct Flow_ #define FLOW_AL_PROTO_UNKNOWN 0x01 #define FLOW_AL_PROTO_DETECT_DONE 0x02 #define FLOW_AL_NO_APPLAYER_INSPECTION 0x04 /** \todo move to flow flags later */ -#define FLOW_AL_STREAM_START 0x08 -#define FLOW_AL_STREAM_EOF 0x10 #define FLOW_AL_STREAM_TOSERVER 0x20 #define FLOW_AL_STREAM_TOCLIENT 0x40 -#define FLOW_AL_STREAM_GAP 0x80 enum { FLOW_STATE_NEW = 0, diff --git a/src/stream.h b/src/stream.h index 401fb53f13..eea8aa30c4 100644 --- a/src/stream.h +++ b/src/stream.h @@ -26,11 +26,11 @@ #include "flow.h" -#define STREAM_START FLOW_AL_STREAM_START -#define STREAM_EOF FLOW_AL_STREAM_EOF -#define STREAM_TOSERVER FLOW_AL_STREAM_TOSERVER -#define STREAM_TOCLIENT FLOW_AL_STREAM_TOCLIENT -#define STREAM_GAP FLOW_AL_STREAM_GAP +#define STREAM_START 0x01 +#define STREAM_EOF 0x02 +#define STREAM_TOSERVER 0x04 +#define STREAM_TOCLIENT 0x08 +#define STREAM_GAP 0x10 /** size of the data chunks sent to the app layer parser. */ #define MSG_DATA_SIZE 4024 /* 4096 - 72 (size of rest of the struct) */