stream: add util to get absolute right edge of data

pull/8482/head
Victor Julien 4 years ago
parent a95934b5ee
commit 8ff2543343

@ -411,6 +411,16 @@ uint64_t StreamTcpGetAcked(const TcpStream *stream)
return GetAbsLastAck(stream); return GetAbsLastAck(stream);
} }
// may contain gaps
uint64_t StreamDataRightEdge(const TcpStream *stream, const bool eof)
{
uint64_t right_edge = STREAM_BASE_OFFSET(stream) + stream->segs_right_edge - stream->base_seq;
if (!eof && StreamTcpInlineMode() == FALSE) {
right_edge = MIN(GetAbsLastAck(stream), right_edge);
}
return right_edge;
}
uint64_t StreamTcpGetUsable(const TcpStream *stream, const bool eof) uint64_t StreamTcpGetUsable(const TcpStream *stream, const bool eof)
{ {
uint64_t right_edge = StreamingBufferGetConsecutiveDataRightEdge(&stream->sb); uint64_t right_edge = StreamingBufferGetConsecutiveDataRightEdge(&stream->sb);

@ -212,6 +212,7 @@ void StreamTcpUpdateAppLayerProgress(TcpSession *ssn, char direction,
uint64_t StreamTcpGetAcked(const TcpStream *stream); uint64_t StreamTcpGetAcked(const TcpStream *stream);
uint64_t StreamTcpGetUsable(const TcpStream *stream, const bool eof); uint64_t StreamTcpGetUsable(const TcpStream *stream, const bool eof);
uint64_t StreamDataRightEdge(const TcpStream *stream, const bool eof);
void StreamTcpThreadCacheEnable(void); void StreamTcpThreadCacheEnable(void);
void StreamTcpThreadCacheCleanup(void); void StreamTcpThreadCacheCleanup(void);

Loading…
Cancel
Save