stream-tcp-sack.c File Reference
#include "suricata-common.h"
#include "stream-tcp.h"
#include "stream-tcp-private.h"
#include "stream-tcp-sack.h"
#include "util-unittest.h"
Include dependency graph for stream-tcp-sack.c:

Go to the source code of this file.


 RB_GENERATE (TCPSACK, StreamTcpSackRecord, rb, TcpSackCompare)
int TcpSackCompare (struct StreamTcpSackRecord *a, struct StreamTcpSackRecord *b)
int StreamTcpSackUpdatePacket (TcpStream *stream, Packet *p)
 Update stream with SACK records from a TCP packet. More...
void StreamTcpSackPruneList (TcpStream *stream)
void StreamTcpSackFreeList (TcpStream *stream)
 Free SACK tree from a stream. More...
void StreamTcpSackRegisterTests (void)

Detailed Description

Victor Julien

Stream engine TCP SACK handling.

Definition in file stream-tcp-sack.c.

Function Documentation


StreamTcpSackRecord  ,
rb  ,

◆ StreamTcpSackFreeList()

void StreamTcpSackFreeList ( TcpStream stream)

Free SACK tree from a stream.

streamStream to cleanup

Definition at line 332 of file stream-tcp-sack.c.

References StreamTcpSackRecord::le, RB_FOREACH_SAFE, StreamTcpSackRecord::re, TcpStream_::sack_size, TcpStream_::sack_tree, and SCEnter.

Referenced by StreamTcpStreamCleanup().

Here is the caller graph for this function:

◆ StreamTcpSackPruneList()

◆ StreamTcpSackRegisterTests()

void StreamTcpSackRegisterTests ( void  )

Definition at line 804 of file stream-tcp-sack.c.

References UtRegisterTest().

Here is the call graph for this function:

◆ StreamTcpSackUpdatePacket()

int StreamTcpSackUpdatePacket ( TcpStream stream,
Packet p 

Update stream with SACK records from a TCP packet.

streamThe stream to update.
ppacket to get the SACK records from
Return values

Definition at line 249 of file stream-tcp-sack.c.

References TcpStream_::last_ack, StreamTcpSackRecord::le, TCPOptSackRecord_::le, next, TcpStream_::next_win, StreamTcpSackRecord::re, TCPOptSackRecord_::re, SCLogDebug, SCNtohl, SEQ_GEQ, SEQ_GT, SEQ_LEQ, TCP_GET_SACK_CNT, and TCP_GET_SACK_PTR.

◆ TcpSackCompare()

int TcpSackCompare ( struct StreamTcpSackRecord a,
struct StreamTcpSackRecord b 

Definition at line 34 of file stream-tcp-sack.c.

References StreamTcpSackRecord::le, StreamTcpSackRecord::re, SEQ_EQ, SEQ_GT, and SEQ_LT.