Removed FLOW_AL_STREAM_TOSERVER and FLOW_AL_STREAM_TOCLIENT. Use STREAM_TOSERVER and STREAM_TOCLIENT instead

remotes/origin/master-1.1.x
Anoop Saldanha 15 years ago committed by Victor Julien
parent ac5584a863
commit 0c94d910e4

@ -360,7 +360,7 @@ uint16_t AppLayerDetectGetProto(AlpProtoDetectCtx *ctx, AlpProtoDetectThreadCtx
AlpProtoDetectDirection *dir; AlpProtoDetectDirection *dir;
AlpProtoDetectDirectionThread *tdir; AlpProtoDetectDirectionThread *tdir;
if (flags & FLOW_AL_STREAM_TOSERVER) { if (flags & STREAM_TOSERVER) {
dir = &ctx->toserver; dir = &ctx->toserver;
tdir = &tctx->toserver; tdir = &tctx->toserver;
} else { } else {

@ -132,15 +132,6 @@ int AppLayerHandleTCPData(AlpProtoDetectThreadCtx *dp_ctx, Flow *f,
alproto = f->alproto; alproto = f->alproto;
/* Copy some needed flags */
if (flags & STREAM_TOSERVER) {
f->alflags |= FLOW_AL_STREAM_TOSERVER;
SCLogDebug("STREAM_TOSERVER");
} else if (flags & STREAM_TOCLIENT) {
f->alflags |= FLOW_AL_STREAM_TOCLIENT;
SCLogDebug("STREAM_TOCLIENT");
}
SCLogDebug("data_len %u flags %02X", data_len, flags); SCLogDebug("data_len %u flags %02X", data_len, flags);
if (!(f->alflags & FLOW_AL_NO_APPLAYER_INSPECTION)) { if (!(f->alflags & FLOW_AL_NO_APPLAYER_INSPECTION)) {
/* if we don't know the proto yet and we have received a stream /* if we don't know the proto yet and we have received a stream
@ -163,7 +154,7 @@ int AppLayerHandleTCPData(AlpProtoDetectThreadCtx *dp_ctx, Flow *f,
} }
#endif #endif
alproto = AppLayerDetectGetProto(&alp_proto_ctx, dp_ctx, alproto = AppLayerDetectGetProto(&alp_proto_ctx, dp_ctx,
data, data_len, f->alflags, IPPROTO_TCP); data, data_len, flags, IPPROTO_TCP);
if (alproto != ALPROTO_UNKNOWN) { if (alproto != ALPROTO_UNKNOWN) {
/* store the proto and setup the L7 data array */ /* store the proto and setup the L7 data array */
FlowL7DataPtrInit(f); FlowL7DataPtrInit(f);
@ -322,12 +313,6 @@ int AppLayerHandleMsg(AlpProtoDetectThreadCtx *dp_ctx, StreamMsg *smsg)
if (ssn != NULL) { if (ssn != NULL) {
alproto = smsg->flow->alproto; alproto = smsg->flow->alproto;
/* Copy some needed flags */
if (smsg->flags & STREAM_TOSERVER)
smsg->flow->alflags |= FLOW_AL_STREAM_TOSERVER;
if (smsg->flags & STREAM_TOCLIENT)
smsg->flow->alflags |= FLOW_AL_STREAM_TOCLIENT;
if (!(smsg->flow->alflags & FLOW_AL_NO_APPLAYER_INSPECTION)) { if (!(smsg->flow->alflags & FLOW_AL_NO_APPLAYER_INSPECTION)) {
/* if we don't know the proto yet and we have received a stream /* if we don't know the proto yet and we have received a stream
* initializer message, we run proto detection. * initializer message, we run proto detection.
@ -476,10 +461,11 @@ int AppLayerHandleUdp(AlpProtoDetectThreadCtx *dp_ctx, Flow *f, Packet *p)
alproto = f->alproto; alproto = f->alproto;
uint8_t flags = 0;
if (p->flowflags & FLOW_PKT_TOSERVER) { if (p->flowflags & FLOW_PKT_TOSERVER) {
f->alflags |= FLOW_AL_STREAM_TOSERVER; flags |= STREAM_TOSERVER;
} else { } else {
f->alflags |= FLOW_AL_STREAM_TOCLIENT; flags |= STREAM_TOCLIENT;
} }
/* if we don't know the proto yet and we have received a stream /* if we don't know the proto yet and we have received a stream
@ -495,7 +481,7 @@ int AppLayerHandleUdp(AlpProtoDetectThreadCtx *dp_ctx, Flow *f, Packet *p)
//printf("=> Init Stream Data -- end\n"); //printf("=> Init Stream Data -- end\n");
alproto = AppLayerDetectGetProto(&alp_proto_ctx, dp_ctx, alproto = AppLayerDetectGetProto(&alp_proto_ctx, dp_ctx,
p->payload, p->payload_len, f->alflags, IPPROTO_UDP); p->payload, p->payload_len, flags, IPPROTO_UDP);
if (alproto != ALPROTO_UNKNOWN) { if (alproto != ALPROTO_UNKNOWN) {
/* store the proto and setup the L7 data array */ /* store the proto and setup the L7 data array */
FlowL7DataPtrInit(f); FlowL7DataPtrInit(f);

@ -216,8 +216,6 @@ typedef struct Flow_
/** Flow Application Level flags */ /** Flow Application Level flags */
#define FLOW_AL_NO_APPLAYER_INSPECTION 0x04 /** \todo move to flow flags later */ #define FLOW_AL_NO_APPLAYER_INSPECTION 0x04 /** \todo move to flow flags later */
#define FLOW_AL_STREAM_TOSERVER 0x20
#define FLOW_AL_STREAM_TOCLIENT 0x40
enum { enum {
FLOW_STATE_NEW = 0, FLOW_STATE_NEW = 0,

Loading…
Cancel
Save