suricata
stream-tcp-list.c File Reference
#include "suricata-common.h"
#include "rust.h"
#include "stream-tcp-private.h"
#include "stream-tcp.h"
#include "stream-tcp-reassemble.h"
#include "stream-tcp-inline.h"
#include "stream-tcp-list.h"
#include "util-streaming-buffer.h"
#include "util-print.h"
#include "util-validate.h"
#include "app-layer-frames.h"
#include "tests/stream-tcp-list.c"
Include dependency graph for stream-tcp-list.c:

Go to the source code of this file.

Functions

void StreamTcpReassembleConfigEnableOverlapCheck (void)
 
 RB_GENERATE (TCPSEG, TcpSegment, rb, TcpSegmentCompare)
 
int TcpSegmentCompare (struct TcpSegment *a, struct TcpSegment *b)
 compare function for the Segment tree
 
int StreamTcpReassembleInsertSegment (ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpStream *stream, TcpSegment *seg, Packet *p, uint8_t *pkt_data, uint16_t pkt_datalen)
 
void StreamTcpPruneSession (Flow *f, uint8_t flags)
 Remove idle TcpSegments from TcpSession.
 

Detailed Description

Segment list functions for insertions, overlap handling, removal and more.

Definition in file stream-tcp-list.c.

Function Documentation

◆ RB_GENERATE()

RB_GENERATE ( TCPSEG  ,
TcpSegment  ,
rb  ,
TcpSegmentCompare   
)

◆ StreamTcpPruneSession()

◆ StreamTcpReassembleConfigEnableOverlapCheck()

void StreamTcpReassembleConfigEnableOverlapCheck ( void  )

Definition at line 40 of file stream-tcp-list.c.

◆ StreamTcpReassembleInsertSegment()

int StreamTcpReassembleInsertSegment ( ThreadVars tv,
TcpReassemblyThreadCtx ra_ctx,
TcpStream stream,
TcpSegment seg,
Packet p,
uint8_t *  pkt_data,
uint16_t  pkt_datalen 
)

◆ TcpSegmentCompare()

int TcpSegmentCompare ( struct TcpSegment a,
struct TcpSegment b 
)

compare function for the Segment tree

Main sort point is the sequence number. When sequence numbers are equal compare payload_len as well. This way the tree is sorted by seq, and in case of duplicate seqs we are sorted small to large.

Definition at line 51 of file stream-tcp-list.c.

References TcpSegment::payload_len, TcpSegment::seq, SEQ_GT, and SEQ_LT.