diff --git a/src/flow.c b/src/flow.c index 9f4d145084..3bad4bba37 100644 --- a/src/flow.c +++ b/src/flow.c @@ -187,6 +187,23 @@ int FlowHasAlerts(const Flow *f) return 0; } +bool FlowHasGaps(const Flow *f, uint8_t way) +{ + if (f->proto == IPPROTO_TCP) { + TcpSession *ssn = (TcpSession *)f->protoctx; + if (ssn != NULL) { + if (way == STREAM_TOCLIENT) { + if (ssn->server.flags & STREAMTCP_STREAM_FLAG_HAS_GAP) + return 1; + } else { + if (ssn->client.flags & STREAMTCP_STREAM_FLAG_HAS_GAP) + return 1; + } + } + } + return 0; +} + /** \brief Set flag to indicate to change proto for the flow * * \param f flow diff --git a/src/flow.h b/src/flow.h index a4ecf78358..a238ff0b99 100644 --- a/src/flow.h +++ b/src/flow.h @@ -568,6 +568,7 @@ void FlowShutdown(void); void FlowSetIPOnlyFlag(Flow *, int); void FlowSetHasAlertsFlag(Flow *); int FlowHasAlerts(const Flow *); +bool FlowHasGaps(const Flow *, uint8_t way); void FlowSetChangeProtoFlag(Flow *); void FlowUnsetChangeProtoFlag(Flow *); int FlowChangeProto(Flow *);