suricata
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.

Functions

 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

Author
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t

Stream engine TCP SACK handling.

Definition in file stream-tcp-sack.c.

Function Documentation

RB_GENERATE ( TCPSACK  ,
StreamTcpSackRecord  ,
rb  ,
TcpSackCompare   
)
void StreamTcpSackFreeList ( TcpStream stream)

Free SACK tree from a stream.

Parameters
streamStream to cleanup

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

References FAIL_IF, FAIL_IF_NOT, FAIL_IF_NULL, TcpStream_::last_ack, StreamTcpSackRecord::le, PASS, RB_FOREACH_SAFE, RB_MIN, StreamTcpSackRecord::re, TcpStream_::sack_size, TcpStream_::sack_tree, SCEnter, SCReturn, StreamTcpSackFreeList(), StreamTcpSackPruneList(), and TcpStream_::window.

Referenced by StreamTcpSackFreeList(), and StreamTcpStreamCleanup().

Here is the call graph for this function:

Here is the caller graph for this function:

void StreamTcpSackPruneList ( TcpStream stream)
void StreamTcpSackRegisterTests ( void  )

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

References UtRegisterTest().

Referenced by StreamTcpRegisterTests().

Here is the call graph for this function:

Here is the caller graph for this function:

int StreamTcpSackUpdatePacket ( TcpStream stream,
Packet p 
)

Update stream with SACK records from a TCP packet.

Parameters
streamThe stream to update.
ppacket to get the SACK records from
Return values
-1error
0ok

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, SCReturnInt, SEQ_GEQ, SEQ_GT, SEQ_LEQ, StreamTcpSackPruneList(), TCP_GET_SACK_CNT, and TCP_GET_SACK_PTR.

Here is the call graph for this function: