suricata
stream-tcp-reassemble.c File Reference
#include "suricata-common.h"
#include "suricata.h"
#include "detect.h"
#include "flow.h"
#include "threads.h"
#include "conf.h"
#include "flow-util.h"
#include "threadvars.h"
#include "tm-threads.h"
#include "util-pool.h"
#include "util-unittest.h"
#include "util-print.h"
#include "util-host-os-info.h"
#include "util-unittest-helper.h"
#include "util-byte.h"
#include "util-device.h"
#include "stream-tcp.h"
#include "stream-tcp-private.h"
#include "stream-tcp-cache.h"
#include "stream-tcp-reassemble.h"
#include "stream-tcp-inline.h"
#include "stream-tcp-list.h"
#include "stream-tcp-util.h"
#include "stream.h"
#include "util-debug.h"
#include "app-layer-protos.h"
#include "app-layer.h"
#include "app-layer-events.h"
#include "app-layer-parser.h"
#include "app-layer-frames.h"
#include "detect-engine-state.h"
#include "util-profiling.h"
#include "util-validate.h"
#include "util-exception-policy.h"
#include "tests/stream-tcp-reassemble.c"
Include dependency graph for stream-tcp-reassemble.c:

Go to the source code of this file.

Macros

#define STREAMTCP_STREAM_FLAG_FLUSH_FLAGS
 
#define SET_ISN(stream, setseq)
 
#define MISSED_START(isn)
 
#define MISSED_END
 
#define MISSED_STEP(seq, seg, seglen, buf, buflen)
 
#define MISSED_ADD_PAYLOAD(seq, seg, seglen)   StreamTcpUTAddPayload(&tv, ra_ctx, &ssn, stream, (seq), (uint8_t *)(seg), (seglen));
 

Functions

 SC_ATOMIC_DECLARE (uint64_t, ra_memuse)
 
bool IsTcpSessionDumpingEnabled (void)
 
void EnableTcpSessionDumping (void)
 
TcpSegmentStreamTcpGetSegment (ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx)
 get a segment from the pool More...
 
void StreamTcpCreateTestPacket (uint8_t *payload, uint8_t value, uint8_t payload_len, uint8_t len)
 The Function to create the packet with given payload, which is used to test the reassembly of the engine. More...
 
void StreamTcpReassembleInitMemuse (void)
 
void StreamTcpReassembleIncrMemuse (uint64_t size)
 Function to Increment the memory usage counter for the TCP reassembly segments. More...
 
void StreamTcpReassembleDecrMemuse (uint64_t size)
 Function to Decrease the memory usage counter for the TCP reassembly segments. More...
 
uint64_t StreamTcpReassembleMemuseGlobalCounter (void)
 
int StreamTcpReassembleCheckMemcap (uint64_t size)
 Function to Check the reassembly memory usage counter against the allowed max memory usage for TCP segments. More...
 
int StreamTcpReassembleSetMemcap (uint64_t size)
 Update memcap value. More...
 
uint64_t StreamTcpReassembleGetMemcap (void)
 Return memcap value. More...
 
void * StreamTcpReassembleRealloc (void *optr, size_t orig_size, size_t size)
 
void StreamTcpSegmentReturntoPool (TcpSegment *seg)
 Function to return the segment back to the pool. More...
 
void StreamTcpReturnStreamSegments (TcpStream *stream)
 return all segments in this stream into the pool(s) More...
 
uint64_t StreamDataRightEdge (const TcpStream *stream, const bool eof)
 
uint64_t StreamTcpGetUsable (const TcpStream *stream, const bool eof)
 
void StreamTcpDisableAppLayer (Flow *f)
 
int StreamTcpAppLayerIsDisabled (Flow *f)
 
int StreamTcpReassembleInit (bool quiet)
 
void StreamTcpReassembleFree (bool quiet)
 
TcpReassemblyThreadCtxStreamTcpReassembleInitThreadCtx (ThreadVars *tv)
 
void StreamTcpReassembleFreeThreadCtx (TcpReassemblyThreadCtx *ra_ctx)
 
int StreamTcpReassembleDepthReached (Packet *p)
 check if stream in pkt direction has depth reached More...
 
uint32_t StreamDataAvailableForProtoDetect (TcpStream *stream)
 
int StreamTcpReassembleHandleSegmentHandleData (ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpSession *ssn, TcpStream *stream, Packet *p)
 Insert a packets TCP data into the stream reassembly engine. More...
 
uint8_t StreamNeedsReassembly (const TcpSession *ssn, uint8_t direction)
 see what if any work the TCP session still needs More...
 
int StreamTcpReassembleAppLayer (ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpSession *ssn, TcpStream *stream, Packet *p, enum StreamUpdateDir dir)
 Update the stream reassembly upon receiving a packet. More...
 
bool StreamReassembleRawHasDataReady (TcpSession *ssn, Packet *p)
 does the stream engine have data to inspect? More...
 
void StreamReassembleRawUpdateProgress (TcpSession *ssn, Packet *p, const uint64_t progress)
 update stream engine after detection More...
 
int StreamReassembleForFrame (TcpSession *ssn, TcpStream *stream, StreamReassembleRawFunc Callback, void *cb_data, const uint64_t offset, const bool eof)
 
int StreamReassembleRaw (TcpSession *ssn, const Packet *p, StreamReassembleRawFunc Callback, void *cb_data, uint64_t *progress_out, bool respect_inspect_depth)
 
int StreamReassembleLog (const TcpSession *ssn, const TcpStream *stream, StreamReassembleRawFunc Callback, void *cb_data, const uint64_t progress_in, uint64_t *progress_out, const bool eof)
 
int StreamTcpReassembleHandleSegment (ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpSession *ssn, TcpStream *stream, Packet *p)
 
void StreamTcpReassembleTriggerRawReassembly (TcpSession *ssn, int direction)
 Trigger RAW stream reassembly. More...
 
void StreamTcpReassemblySetMinInspectDepth (TcpSession *ssn, int direction, uint32_t depth)
 
int UTHCheckGapAtPosition (TcpStream *stream, int pos, uint64_t offset, uint32_t len)
 
int UTHCheckDataAtPosition (TcpStream *stream, int pos, uint64_t offset, const char *data, uint32_t len)
 
void StreamTcpReassembleRegisterTests (void)
 The Function Register the Unit tests to test the reassembly engine for various OS policies. More...
 

Variables

thread_local uint64_t t_pcapcnt = UINT64_MAX
 
PoolThreadsegment_thread_pool = NULL
 

Detailed Description

Author
Gurvinder Singh gurvi.nosp@m.nder.nosp@m.singh.nosp@m.dahi.nosp@m.ya@gm.nosp@m.ail..nosp@m.com
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t

Reference: Judy Novak, Steve Sturges: Target-Based TCP Stream Reassembly August, 2007

Definition in file stream-tcp-reassemble.c.

Macro Definition Documentation

◆ MISSED_ADD_PAYLOAD

#define MISSED_ADD_PAYLOAD (   seq,
  seg,
  seglen 
)    StreamTcpUTAddPayload(&tv, ra_ctx, &ssn, stream, (seq), (uint8_t *)(seg), (seglen));

Definition at line 2212 of file stream-tcp-reassemble.c.

◆ MISSED_END

#define MISSED_END
Value:
StreamTcpUTDeinit(ra_ctx); \
PASS

Definition at line 2203 of file stream-tcp-reassemble.c.

◆ MISSED_START

#define MISSED_START (   isn)
Value:
TcpReassemblyThreadCtx *ra_ctx = NULL; \
TcpSession ssn; \
ThreadVars tv; \
memset(&tv, 0, sizeof(tv)); \
StreamTcpUTSetupStream(&ssn.server, (isn)); \
StreamTcpUTSetupStream(&ssn.client, (isn)); \
\
TcpStream *stream = &ssn.client;

Definition at line 2189 of file stream-tcp-reassemble.c.

◆ MISSED_STEP

#define MISSED_STEP (   seq,
  seg,
  seglen,
  buf,
  buflen 
)
Value:
StreamTcpUTAddPayload(&tv, ra_ctx, &ssn, stream, (seq), (uint8_t *)(seg), (seglen)); \
FAIL_IF(!(VALIDATE(stream, (uint8_t *)(buf), (buflen))));

Definition at line 2208 of file stream-tcp-reassemble.c.

◆ SET_ISN

#define SET_ISN (   stream,
  setseq 
)
Value:
(stream)->isn = (setseq); \
(stream)->base_seq = (setseq) + 1

unit tests and it's support functions below

Definition at line 2146 of file stream-tcp-reassemble.c.

◆ STREAMTCP_STREAM_FLAG_FLUSH_FLAGS

Function Documentation

◆ EnableTcpSessionDumping()

void EnableTcpSessionDumping ( void  )

Definition at line 94 of file stream-tcp-reassemble.c.

◆ IsTcpSessionDumpingEnabled()

bool IsTcpSessionDumpingEnabled ( void  )
inline

Definition at line 89 of file stream-tcp-reassemble.c.

◆ SC_ATOMIC_DECLARE()

SC_ATOMIC_DECLARE ( uint64_t  ,
ra_memuse   
)

◆ StreamDataAvailableForProtoDetect()

◆ StreamDataRightEdge()

uint64_t StreamDataRightEdge ( const TcpStream stream,
const bool  eof 
)

Definition at line 416 of file stream-tcp-reassemble.c.

References TcpStream_::base_seq, MIN, TcpStream_::segs_right_edge, STREAM_BASE_OFFSET, and StreamTcpInlineMode().

Here is the call graph for this function:

◆ StreamNeedsReassembly()

uint8_t StreamNeedsReassembly ( const TcpSession ssn,
uint8_t  direction 
)

◆ StreamReassembleForFrame()

int StreamReassembleForFrame ( TcpSession ssn,
TcpStream stream,
StreamReassembleRawFunc  Callback,
void *  cb_data,
const uint64_t  offset,
const bool  eof 
)

Definition at line 1839 of file stream-tcp-reassemble.c.

References SCLogDebug, and STREAM_APP_PROGRESS.

◆ StreamReassembleLog()

int StreamReassembleLog ( const TcpSession ssn,
const TcpStream stream,
StreamReassembleRawFunc  Callback,
void *  cb_data,
const uint64_t  progress_in,
uint64_t *  progress_out,
const bool  eof 
)

◆ StreamReassembleRaw()

int StreamReassembleRaw ( TcpSession ssn,
const Packet p,
StreamReassembleRawFunc  Callback,
void *  cb_data,
uint64_t *  progress_out,
bool  respect_inspect_depth 
)

Definition at line 1851 of file stream-tcp-reassemble.c.

References StreamTcpInlineMode().

Referenced by DetectEngineInspectStreamPayload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StreamReassembleRawHasDataReady()

bool StreamReassembleRawHasDataReady ( TcpSession ssn,
Packet p 
)

does the stream engine have data to inspect?

Returns true if there is data to inspect. In IDS case this is about ACK'd data in the packet's direction.

In the IPS case this is about the packet itself.

Definition at line 1460 of file stream-tcp-reassemble.c.

References TcpStream_::base_seq, TcpSession_::client, TcpStream_::flags, PKT_IS_TOSERVER, RB_EMPTY, TcpStream_::seg_tree, TcpStream_::segs_right_edge, TcpSession_::server, STREAM_BASE_OFFSET, STREAM_RAW_PROGRESS, STREAMTCP_STREAM_FLAG_DISABLE_RAW, STREAMTCP_STREAM_FLAG_NOREASSEMBLY, and StreamTcpInlineMode().

Here is the call graph for this function:

◆ StreamReassembleRawUpdateProgress()

void StreamReassembleRawUpdateProgress ( TcpSession ssn,
Packet p,
const uint64_t  progress 
)

update stream engine after detection

Tasked with progressing the 'progress' for Raw reassembly. 2 main scenario's:

  1. progress is != 0, so we use this
  2. progress is 0, meaning the detect engine didn't touch raw at all. In this case we need to look into progressing raw anyway.

Additionally, this function is tasked with disabling raw reassembly if the app-layer requested to disable it.

Definition at line 1506 of file stream-tcp-reassemble.c.

References TcpSession_::client, TcpStream_::flags, TcpSession_::flags, PKT_IS_TOSERVER, TcpStream_::raw_progress_rel, TcpSession_::server, STREAM_APP_PROGRESS, STREAM_RAW_PROGRESS, STREAMTCP_FLAG_APP_LAYER_DISABLED, and STREAMTCP_STREAM_FLAG_TRIGGER_RAW.

◆ StreamTcpAppLayerIsDisabled()

int StreamTcpAppLayerIsDisabled ( Flow f)
Parameters
flocked flow

Definition at line 462 of file stream-tcp-reassemble.c.

References TcpSession_::flags, Flow_::proto, Flow_::protoctx, and STREAMTCP_FLAG_APP_LAYER_DISABLED.

◆ StreamTcpCreateTestPacket()

void StreamTcpCreateTestPacket ( uint8_t *  payload,
uint8_t  value,
uint8_t  payload_len,
uint8_t  len 
)

The Function to create the packet with given payload, which is used to test the reassembly of the engine.

Parameters
payloadThe variable used to store the payload contents of the current packet.
valueThe value which current payload will have for this packet
payload_lenThe length of the filed payload for current packet.
lenLength of the payload array

Definition at line 2159 of file stream-tcp-reassemble.c.

References len, and payload_len.

◆ StreamTcpDisableAppLayer()

void StreamTcpDisableAppLayer ( Flow f)

◆ StreamTcpGetSegment()

TcpSegment * StreamTcpGetSegment ( ThreadVars tv,
TcpReassemblyThreadCtx ra_ctx 
)

◆ StreamTcpGetUsable()

uint64_t StreamTcpGetUsable ( const TcpStream stream,
const bool  eof 
)

Definition at line 425 of file stream-tcp-reassemble.c.

Referenced by FrameJsonLogOneFrame().

Here is the caller graph for this function:

◆ StreamTcpReassembleAppLayer()

int StreamTcpReassembleAppLayer ( ThreadVars tv,
TcpReassemblyThreadCtx ra_ctx,
TcpSession ssn,
TcpStream stream,
Packet p,
enum StreamUpdateDir  dir 
)

Update the stream reassembly upon receiving a packet.

For IDS mode, the stream is in the opposite direction of the packet, as the ACK-packet is ACK'ing the stream.

One of the utilities call by this function AppLayerHandleTCPData(), has a feature where it will call this very same function for the stream opposing the stream it is called with. This shouldn't cause any issues, since processing of each stream is independent of the other stream.

Definition at line 1348 of file stream-tcp-reassemble.c.

References AppLayerHandleTCPData(), TcpStream_::flags, TcpSession_::flags, Packet_::flags, Packet_::flow, PKT_PSEUDO_STREAM_END, RB_MIN, SCEnter, SCLogDebug, SCReturnInt, TcpStream_::seg_tree, TcpSession_::state, STREAM_APP_PROGRESS, STREAM_HAS_SEEN_DATA, STREAM_RIGHT_EDGE, STREAMTCP_FLAG_APP_LAYER_DISABLED, STREAMTCP_STREAM_FLAG_NOREASSEMBLY, TCP_CLOSING, and tv.

Here is the call graph for this function:

◆ StreamTcpReassembleCheckMemcap()

int StreamTcpReassembleCheckMemcap ( uint64_t  size)

Function to Check the reassembly memory usage counter against the allowed max memory usage for TCP segments.

Parameters
sizeSize of the TCP segment and its payload length memory allocated
Return values
1if in bounds
0if not in bounds

Definition at line 162 of file stream-tcp-reassemble.c.

References SC_ATOMIC_GET, SCLogNotice, stream_config, t_pcapcnt, and unlikely.

Referenced by StreamTcpReassembleRealloc().

Here is the caller graph for this function:

◆ StreamTcpReassembleDecrMemuse()

void StreamTcpReassembleDecrMemuse ( uint64_t  size)

Function to Decrease the memory usage counter for the TCP reassembly segments.

Parameters
sizeSize of the TCP segment and its payload length memory allocated

Definition at line 127 of file stream-tcp-reassemble.c.

References BUG_ON, RunmodeIsUnittests(), SC_ATOMIC_GET, SC_ATOMIC_SUB, SCLogDebug, and StreamTcpReassembleMemuseGlobalCounter().

Referenced by StreamTcpReassembleRealloc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StreamTcpReassembleDepthReached()

int StreamTcpReassembleDepthReached ( Packet p)

check if stream in pkt direction has depth reached

Parameters
ppacket with LOCKED flow
Return values
1stream has depth reached
0stream does not have depth reached

Definition at line 615 of file stream-tcp-reassemble.c.

References TcpSession_::client, TcpStream_::flags, Packet_::flow, FLOW_PKT_TOSERVER, Packet_::flowflags, Flow_::protoctx, TcpSession_::server, and STREAMTCP_STREAM_FLAG_DEPTH_REACHED.

◆ StreamTcpReassembleFree()

void StreamTcpReassembleFree ( bool  quiet)

Definition at line 538 of file stream-tcp-reassemble.c.

References SCMutexLock.

Referenced by StreamTcpFreeConfig().

Here is the caller graph for this function:

◆ StreamTcpReassembleFreeThreadCtx()

void StreamTcpReassembleFreeThreadCtx ( TcpReassemblyThreadCtx ra_ctx)

Definition at line 595 of file stream-tcp-reassemble.c.

References TcpReassemblyThreadCtx_::app_tctx, AppLayerDestroyCtxThread(), SCEnter, SCFree, SCReturn, and StreamTcpThreadCacheCleanup().

Referenced by StreamTcpThreadDeinit(), and StreamTcpUTDeinit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StreamTcpReassembleGetMemcap()

uint64_t StreamTcpReassembleGetMemcap ( void  )

Return memcap value.

Returns
memcap memcap value

Definition at line 198 of file stream-tcp-reassemble.c.

References SC_ATOMIC_GET, and stream_config.

◆ StreamTcpReassembleHandleSegment()

◆ StreamTcpReassembleHandleSegmentHandleData()

int StreamTcpReassembleHandleSegmentHandleData ( ThreadVars tv,
TcpReassemblyThreadCtx ra_ctx,
TcpSession ssn,
TcpStream stream,
Packet p 
)

Insert a packets TCP data into the stream reassembly engine.

Return values
0good segment, as far as we checked.
-1insert failure due to memcap

If the retval is 0 the segment is inserted correctly, or overlap is handled, or it wasn't added because of reassembly depth.

Definition at line 736 of file stream-tcp-reassemble.c.

References TcpSession_::data_first_seen_dir, TcpStream_::flags, TcpSession_::flags, TcpStream_::os_policy, PKT_IS_TOSERVER, SCEnter, SCLogDebug, SCReturnInt, STREAMTCP_FLAG_APP_LAYER_DISABLED, STREAMTCP_STREAM_FLAG_NEW_RAW_DISABLED, and StreamTcpSetOSPolicy().

Referenced by StreamTcpUTAddPayload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StreamTcpReassembleIncrMemuse()

void StreamTcpReassembleIncrMemuse ( uint64_t  size)

Function to Increment the memory usage counter for the TCP reassembly segments.

Parameters
sizeSize of the TCP segment and its payload length memory allocated

Definition at line 114 of file stream-tcp-reassemble.c.

References SC_ATOMIC_ADD, SCLogDebug, and StreamTcpReassembleMemuseGlobalCounter().

Referenced by StreamTcpReassembleRealloc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StreamTcpReassembleInit()

int StreamTcpReassembleInit ( bool  quiet)

Definition at line 522 of file stream-tcp-reassemble.c.

References StreamTcpReassembleInitMemuse().

Here is the call graph for this function:

◆ StreamTcpReassembleInitMemuse()

void StreamTcpReassembleInitMemuse ( void  )

Definition at line 103 of file stream-tcp-reassemble.c.

References SC_ATOMIC_INIT.

Referenced by StreamTcpReassembleInit(), and UtRunTests().

Here is the caller graph for this function:

◆ StreamTcpReassembleInitThreadCtx()

TcpReassemblyThreadCtx* StreamTcpReassembleInitThreadCtx ( ThreadVars tv)

Definition at line 556 of file stream-tcp-reassemble.c.

References TcpReassemblyThreadCtx_::app_tctx, AppLayerGetCtxThread(), SCCalloc, SCEnter, SCMutexLock, tv, and unlikely.

Referenced by StreamTcpUTInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StreamTcpReassembleMemuseGlobalCounter()

uint64_t StreamTcpReassembleMemuseGlobalCounter ( void  )

Definition at line 148 of file stream-tcp-reassemble.c.

References SC_ATOMIC_GET.

Referenced by StreamTcpReassembleDecrMemuse(), and StreamTcpReassembleIncrMemuse().

Here is the caller graph for this function:

◆ StreamTcpReassembleRealloc()

void* StreamTcpReassembleRealloc ( void *  optr,
size_t  orig_size,
size_t  size 
)

◆ StreamTcpReassembleRegisterTests()

void StreamTcpReassembleRegisterTests ( void  )

The Function Register the Unit tests to test the reassembly engine for various OS policies.

Definition at line 3855 of file stream-tcp-reassemble.c.

References UtRegisterTest().

Here is the call graph for this function:

◆ StreamTcpReassembleSetMemcap()

int StreamTcpReassembleSetMemcap ( uint64_t  size)

Update memcap value.

Parameters
sizenew memcap value

Definition at line 183 of file stream-tcp-reassemble.c.

References SC_ATOMIC_GET, SC_ATOMIC_SET, and stream_config.

◆ StreamTcpReassembleTriggerRawReassembly()

void StreamTcpReassembleTriggerRawReassembly ( TcpSession ssn,
int  direction 
)

Trigger RAW stream reassembly.

Used by AppLayerTriggerRawStreamReassembly to trigger RAW stream reassembly from the applayer, for example upon completion of a HTTP request.

It sets a flag in the stream so that the next Raw call will return the data.

Parameters
ssnTcpSession

Definition at line 2108 of file stream-tcp-reassemble.c.

References BUG_ON, TcpSession_::client, TcpStream_::flags, SCLogDebug, TcpSession_::server, and STREAMTCP_STREAM_FLAG_TRIGGER_RAW.

Referenced by AppLayerParserTriggerRawStreamReassembly().

Here is the caller graph for this function:

◆ StreamTcpReassemblySetMinInspectDepth()

void StreamTcpReassemblySetMinInspectDepth ( TcpSession ssn,
int  direction,
uint32_t  depth 
)

Definition at line 2125 of file stream-tcp-reassemble.c.

References BUG_ON, TcpSession_::client, TcpStream_::min_inspect_depth, SCLogDebug, and TcpSession_::server.

Referenced by SMTPProcessDataChunk().

Here is the caller graph for this function:

◆ StreamTcpReturnStreamSegments()

void StreamTcpReturnStreamSegments ( TcpStream stream)

return all segments in this stream into the pool(s)

Parameters
streamthe stream to cleanup

Definition at line 396 of file stream-tcp-reassemble.c.

References RB_FOREACH_SAFE, RB_REMOVE, TcpStream_::seg_tree, and StreamTcpSegmentReturntoPool().

Referenced by StreamTcpPruneSession(), StreamTcpSessionPktFree(), and StreamTcpStreamCleanup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StreamTcpSegmentReturntoPool()

void StreamTcpSegmentReturntoPool ( TcpSegment seg)

Function to return the segment back to the pool.

Parameters
segSegment which will be returned back to the pool.

Definition at line 379 of file stream-tcp-reassemble.c.

References TcpSegment::pcap_hdr_storage, TcpSegmentPcapHdrStorage_::pktlen, and StreamTcpThreadCacheReturnSegment().

Referenced by StreamTcpReturnStreamSegments().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UTHCheckDataAtPosition()

int UTHCheckDataAtPosition ( TcpStream stream,
int  pos,
uint64_t  offset,
const char *  data,
uint32_t  len 
)

◆ UTHCheckGapAtPosition()

int UTHCheckGapAtPosition ( TcpStream stream,
int  pos,
uint64_t  offset,
uint32_t  len 
)

Variable Documentation

◆ segment_thread_pool

PoolThread* segment_thread_pool = NULL

◆ t_pcapcnt

thread_local uint64_t t_pcapcnt = UINT64_MAX

Definition at line 78 of file stream-tcp-reassemble.c.

Referenced by StreamTcp(), and StreamTcpReassembleCheckMemcap().

StreamTcpUTAddPayload
int StreamTcpUTAddPayload(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpSession *ssn, TcpStream *stream, uint32_t seq, uint8_t *payload, uint16_t len)
wrapper for StreamTcpReassembleHandleSegmentHandleData
Definition: stream-tcp-util.c:97
seq
uint32_t seq
Definition: stream-tcp-private.h:2
STREAMTCP_STREAM_FLAG_DEPTH_REACHED
#define STREAMTCP_STREAM_FLAG_DEPTH_REACHED
Definition: stream-tcp-private.h:223
StreamTcpUTInit
void StreamTcpUTInit(TcpReassemblyThreadCtx **ra_ctx)
Definition: stream-tcp-util.c:44
VALIDATE
#define VALIDATE(e)
StreamTcpUTClearSession
void StreamTcpUTClearSession(TcpSession *ssn)
Definition: stream-tcp-util.c:71
STREAMTCP_STREAM_FLAG_NEW_RAW_DISABLED
#define STREAMTCP_STREAM_FLAG_NEW_RAW_DISABLED
Definition: stream-tcp-private.h:236
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:32
StreamTcpUTSetupSession
void StreamTcpUTSetupSession(TcpSession *ssn)
Definition: stream-tcp-util.c:62
TcpReassemblyThreadCtx_
Definition: stream-tcp-reassemble.h:61
STREAMTCP_STREAM_FLAG_TRIGGER_RAW
#define STREAMTCP_STREAM_FLAG_TRIGGER_RAW
Definition: stream-tcp-private.h:225