suricata
stream-tcp-inline.c File Reference
#include "suricata-common.h"
#include "decode.h"
#include "stream-tcp-private.h"
#include "stream-tcp-inline.h"
#include "util-memcmp.h"
#include "util-print.h"
#include "util-validate.h"
#include "util-unittest.h"
#include "util-unittest-helper.h"
#include "tests/stream-tcp-inline.c"
Include dependency graph for stream-tcp-inline.c:

Go to the source code of this file.

Functions

int StreamTcpInlineSegmentCompare (const TcpStream *stream, const Packet *p, const TcpSegment *seg)
 Compare the shared data portion of two segments. More...
 
void StreamTcpInlineSegmentReplacePacket (const TcpStream *stream, Packet *p, const TcpSegment *seg)
 Replace (part of) the payload portion of a packet by the data in a TCP segment. More...
 

Detailed Description

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

Functions for the "inline mode" of the stream engine.

Definition in file stream-tcp-inline.c.

Function Documentation

◆ StreamTcpInlineSegmentCompare()

int StreamTcpInlineSegmentCompare ( const TcpStream stream,
const Packet p,
const TcpSegment seg 
)

Compare the shared data portion of two segments.

If no data is shared, 0 will be returned.

Parameters
seg1first segment
seg2second segment
Return values
0shared data is the same (or no data is shared)
1shared data is different

Definition at line 49 of file stream-tcp-inline.c.

References TcpStream_::base_seq, DEBUG_VALIDATE_BUG_ON, TcpStream_::sb, TcpSegment::sbseg, SCEnter, SCReturnInt, TcpSegment::seq, SEQ_LEQ, StreamingBufferSegmentGetData(), and TCP_SEG_LEN.

Here is the call graph for this function:

◆ StreamTcpInlineSegmentReplacePacket()

void StreamTcpInlineSegmentReplacePacket ( const TcpStream stream,
Packet p,
const TcpSegment seg 
)

Replace (part of) the payload portion of a packet by the data in a TCP segment.

Parameters
pPacket
segTCP segment
Todo:

What about reassembled fragments?

What about unwrapped tunnel packets?

Definition at line 121 of file stream-tcp-inline.c.

References SCEnter.