suricata
stream-tcp-reassemble.c File Reference
#include "suricata-common.h"
#include "suricata.h"
#include "debug.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-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 "detect-engine-state.h"
#include "util-profiling.h"
#include "util-validate.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)
 

Functions

 SC_ATOMIC_DECLARE (uint64_t, ra_memuse)
 
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 StreamTcpReassemblePseudoPacketCreate (TcpStream *, Packet *, PacketQueue *)
 
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 usgae for TCP segments. More...
 
int StreamTcpReassembleSetMemcap (uint64_t size)
 Update memcap value. More...
 
uint64_t StreamTcpReassembleGetMemcap ()
 Return memcap value. More...
 
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...
 
void StreamTcpDisableAppLayer (Flow *f)
 
int StreamTcpAppLayerIsDisabled (Flow *f)
 
int StreamTcpReassembleInit (char quiet)
 
void StreamTcpReassembleFree (char quiet)
 
TcpReassemblyThreadCtxStreamTcpReassembleInitThreadCtx (ThreadVars *tv)
 
void StreamTcpReassembleFreeThreadCtx (TcpReassemblyThreadCtx *ra_ctx)
 
int StreamTcpReassembleDepthReached (Packet *p)
 check if stream in pkt direction has depth reached More...
 
int StreamTcpReassembleHandleSegmentHandleData (ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpSession *ssn, TcpStream *stream, Packet *p)
 Insert a packets TCP data into the stream reassembly engine. More...
 
int 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, uint64_t progress)
 update stream engine after detection More...
 
int StreamReassembleRaw (TcpSession *ssn, const Packet *p, StreamReassembleRawFunc Callback, void *cb_data, uint64_t *progress_out, bool respect_inspect_depth)
 
int StreamReassembleLog (TcpSession *ssn, TcpStream *stream, StreamReassembleRawFunc Callback, void *cb_data, uint64_t progress_in, uint64_t *progress_out, bool eof)
 
int StreamTcpReassembleHandleSegment (ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpSession *ssn, TcpStream *stream, Packet *p, PacketQueue *pq)
 
void StreamTcpReassembleTriggerRawReassembly (TcpSession *ssn, int direction)
 Trigger RAW stream reassembly. More...
 
void StreamTcpReassemblySetMinInspectDepth (TcpSession *ssn, int direction, uint32_t depth)
 
int StreamTcpCheckStreamContents (uint8_t *stream_policy, uint16_t sp_size, TcpStream *stream)
 The Function Checks the reassembled stream contents against predefined stream contents according to OS policy used. More...
 
void StreamTcpReassembleRegisterTests (void)
 The Function Register the Unit tests to test the reassembly engine for various OS policies. More...
 

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

#define MISSED_END
Value:
#define PASS
Pass the test.
void StreamTcpUTDeinit(TcpReassemblyThreadCtx *ra_ctx)
void StreamTcpUTClearSession(TcpSession *ssn)

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

#define MISSED_START (   isn)
Value:
TcpReassemblyThreadCtx *ra_ctx = NULL; \
memset(&tv, 0, sizeof(tv)); \
StreamTcpUTSetupStream(&ssn.server, (isn)); \
StreamTcpUTSetupStream(&ssn.client, (isn)); \
\
TcpStream *stream = &ssn.client;
void StreamTcpUTInit(TcpReassemblyThreadCtx **ra_ctx)
struct ThreadVars_ ThreadVars
Per thread variable structure.
struct TcpStream_ TcpStream
void StreamTcpUTSetupStream(TcpStream *s, uint32_t isn)
struct TcpSession_ TcpSession
void StreamTcpUTSetupSession(TcpSession *ssn)

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

#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))));
#define FAIL_IF(expr)
Fail a test if expression evaluates to false.
Definition: util-unittest.h:71
uint32_t seq
int StreamTcpUTAddPayload(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpSession *ssn, TcpStream *stream, uint32_t seq, uint8_t *payload, uint16_t len)
wrapper for StreamTcpReassembleHandleSegmentHandleData

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

#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 1857 of file stream-tcp-reassemble.c.

#define STREAMTCP_STREAM_FLAG_FLUSH_FLAGS

Function Documentation

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

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

References TcpStream_::flags, SCEnter, SCReturnInt, STREAMTCP_STREAM_FLAG_NOREASSEMBLY, StreamTcpReassembleAppLayer(), and UPDATE_DIR_OPPOSING.

Here is the call graph for this function:

int StreamReassembleRaw ( TcpSession ssn,
const Packet p,
StreamReassembleRawFunc  Callback,
void *  cb_data,
uint64_t *  progress_out,
bool  respect_inspect_depth 
)
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 1199 of file stream-tcp-reassemble.c.

References StreamingBuffer_::buf_offset, TcpSession_::client, FALSE, TcpStream_::flags, Packet_::flags, Packet_::payload_len, PKT_IS_TOSERVER, PKT_STREAM_ADD, RB_EMPTY, TcpStream_::sb, TcpStream_::seg_tree, TcpSession_::server, STREAM_BASE_OFFSET, STREAM_RAW_PROGRESS, STREAMTCP_STREAM_FLAG_DISABLE_RAW, STREAMTCP_STREAM_FLAG_NOREASSEMBLY, and StreamTcpInlineMode().

Referenced by SigMatchSignaturesGetSgh().

Here is the call graph for this function:

Here is the caller graph for this function:

void StreamReassembleRawUpdateProgress ( TcpSession ssn,
Packet p,
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 1243 of file stream-tcp-reassemble.c.

References TcpStream_::base_seq, StreamingBuffer_::buf_offset, BUG_ON, TcpSession_::client, DEBUG_VALIDATE_BUG_ON, TcpStream_::flags, TcpSession_::flags, Packet_::flags, TcpStream_::last_ack, StreamingBufferBlock::len, TcpStream_::min_inspect_depth, StreamingBufferBlock::offset, Packet_::payload, payload_len, Packet_::payload_len, Packet_::pcap_cnt, PKT_IS_TOSERVER, PKT_STREAM_ADD, TcpStream_::raw_progress_rel, RB_EMPTY, TcpStreamCnf_::reassembly_toclient_chunk_size, TcpStreamCnf_::reassembly_toserver_chunk_size, TcpStream_::sb, SBB_RB_FIND_INCLUSIVE(), StreamingBuffer_::sbb_tree, SCEnter, SCLogDebug, TcpSession_::server, STREAM_APP_PROGRESS, STREAM_BASE_OFFSET, stream_config, STREAM_RAW_PROGRESS, StreamingBufferGetData(), StreamingBufferSBBGetData(), STREAMTCP_FLAG_APP_LAYER_DISABLED, STREAMTCP_STREAM_FLAG_DISABLE_RAW, STREAMTCP_STREAM_FLAG_GAP, STREAMTCP_STREAM_FLAG_NEW_RAW_DISABLED, STREAMTCP_STREAM_FLAG_NOREASSEMBLY, STREAMTCP_STREAM_FLAG_TRIGGER_RAW, TCP_GET_SEQ, and TcpStream_::window.

Referenced by SigMatchSignaturesGetSgh().

Here is the call graph for this function:

Here is the caller graph for this function:

int StreamTcpCheckStreamContents ( uint8_t *  stream_policy,
uint16_t  sp_size,
TcpStream stream 
)

The Function Checks the reassembled stream contents against predefined stream contents according to OS policy used.

Parameters
stream_policyPredefined value of stream for different OS policies
streamReassembled stream returned from the reassembly functions

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

References PrintRawDataFp(), TcpStream_::sb, SCLogInfo, SCReturnInt, and StreamingBufferCompareRawData().

Here is the call graph for this function:

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 1871 of file stream-tcp-reassemble.c.

References len, and payload_len.

void StreamTcpDisableAppLayer ( Flow f)
Parameters
flocked flow

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

References TcpSession_::client, Flow_::protoctx, TcpSession_::server, StreamTcpDisableAppLayerReassembly, and StreamTcpSetStreamFlagAppProtoDetectionCompleted.

Referenced by AppLayerIncTxCounter(), AppLayerParserParse(), and StreamTcpPacket().

Here is the caller graph for this function:

TcpSegment * StreamTcpGetSegment ( ThreadVars tv,
TcpReassemblyThreadCtx ra_ctx 
)

get a segment from the pool

Return values
segSegment from the pool or NULL

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

References TcpReassemblyThreadCtx_::counter_tcp_segment_memcap, PoolThreadGetById(), TcpSegment::sbseg, SCLogDebug, TcpReassemblyThreadCtx_::segment_thread_pool_id, and StatsIncr().

Referenced by StreamTcpReassembleHandleSegmentHandleData(), StreamTcpUTAddSegmentWithByte(), and StreamTcpUTAddSegmentWithPayload().

Here is the call graph for this function:

Here is the caller graph for this function:

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 1086 of file stream-tcp-reassemble.c.

References TcpReassemblyThreadCtx_::app_tctx, AppLayerHandleTCPData(), TcpStream_::flags, TcpSession_::flags, Packet_::flags, Packet_::flow, StreamingBufferBlock::offset, offset, PKT_PSEUDO_STREAM_END, RB_EMPTY, RB_MIN, TcpStream_::sb, SBB_RB_FIND_INCLUSIVE(), StreamingBuffer_::sbb_tree, SCEnter, SCLogDebug, SCReturnInt, TcpStream_::seg_tree, TcpSession_::state, STREAM_APP_PROGRESS, STREAM_HAS_SEEN_DATA, STREAM_RIGHT_EDGE, StreamingBufferGetData(), StreamingBufferGetDataAtOffset(), StreamingBufferSBBGetData(), STREAMTCP_FLAG_APP_LAYER_DISABLED, STREAMTCP_STREAM_FLAG_NOREASSEMBLY, and TCP_CLOSING.

Referenced by AppLayerIncTxCounter(), StreamReassembleLog(), and StreamTcpReassembleHandleSegment().

Here is the call graph for this function:

Here is the caller graph for this function:

int StreamTcpReassembleCheckMemcap ( uint64_t  size)

Function to Check the reassembly memory usage counter against the allowed max memory usgae 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 146 of file stream-tcp-reassemble.c.

References SC_ATOMIC_GET, and stream_config.

Referenced by StreamTcpReassembleGetMemcap().

Here is the caller graph for this function:

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 111 of file stream-tcp-reassemble.c.

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

Referenced by StreamTcpReassembleGetMemcap().

Here is the call graph for this function:

Here is the caller graph for this function:

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 487 of file stream-tcp-reassemble.c.

References TcpStream_::base_seq, TcpSession_::client, DEBUG_VALIDATE_BUG_ON, TcpStream_::flags, Packet_::flow, FLOW_PKT_TOSERVER, Packet_::flowflags, TcpStream_::isn, Flow_::protoctx, TcpSession_::reassembly_depth, SCEnter, SCLogDebug, SCReturnUInt, seq, SEQ_GEQ, SEQ_GT, SEQ_LEQ, SEQ_LT, TcpSession_::server, STREAM_BASE_OFFSET, and STREAMTCP_STREAM_FLAG_DEPTH_REACHED.

Referenced by OutputRegisterFiledataLogger(), and OutputRegisterFileLogger().

Here is the caller graph for this function:

void StreamTcpReassembleFree ( char  quiet)

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

References PoolThreadFree(), SCLogInfo, SCMutexDestroy, SCMutexLock, and SCMutexUnlock.

Referenced by StreamTcpFreeConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

void StreamTcpReassembleFreeThreadCtx ( TcpReassemblyThreadCtx ra_ctx)

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

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

Referenced by StreamTcpReassembleInitThreadCtx(), StreamTcpThreadDeinit(), and StreamTcpUTDeinit().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t StreamTcpReassembleGetMemcap ( void  )

Return memcap value.

Returns
memcap memcap value

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

References SC_ATOMIC_GET, SCCalloc, SCFree, SCLogDebug, SCMalloc, SCMutexLock, SCMutexUnlock, SCRealloc, stream_config, StreamTcpReassembleCheckMemcap(), StreamTcpReassembleDecrMemuse(), StreamTcpReassembleIncrMemuse(), and unlikely.

Referenced by RunModeUnixSocketGetDefaultMode().

Here is the call graph for this function:

Here is the caller graph for this function:

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.
-1badness, reason to drop in inline mode

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 594 of file stream-tcp-reassemble.c.

References Packet_::app_layer_events, APPLAYER_PROTO_DETECTION_SKIPPED, AppLayerDecoderEventsSetEventRaw(), TcpStream_::base_seq, TcpReassemblyThreadCtx_::counter_tcp_stream_depth, TcpSession_::data_first_seen_dir, DEBUG_VALIDATE_BUG_ON, TcpStream_::flags, TcpSession_::flags, Packet_::flags, FLOW_PKT_TOSERVER, Packet_::flowflags, TcpStream_::last_ack, TcpStream_::os_policy, Packet_::payload, Packet_::payload_len, PKT_IS_TOSERVER, PKT_PSEUDO_STREAM_END, RB_EMPTY, TcpStreamCnf_::reassembly_toclient_chunk_size, TcpStreamCnf_::reassembly_toserver_chunk_size, SCEnter, SCLogDebug, SCReturnInt, TcpStream_::seg_tree, TcpSegment::seq, TcpSession_::state, StatsIncr(), STREAM_BASE_OFFSET, stream_config, STREAM_DEPTH, STREAM_EOF, STREAM_MIDSTREAM, STREAM_RAW_PROGRESS, STREAM_REASSEMBLY_NO_SEGMENT, STREAM_START, STREAM_TOCLIENT, STREAM_TOSERVER, STREAMTCP_FLAG_APP_LAYER_DISABLED, STREAMTCP_FLAG_MIDSTREAM, STREAMTCP_STREAM_FLAG_APPPROTO_DETECTION_COMPLETED, STREAMTCP_STREAM_FLAG_APPPROTO_DETECTION_SKIPPED, STREAMTCP_STREAM_FLAG_DEPTH_REACHED, STREAMTCP_STREAM_FLAG_FLUSH_FLAGS, STREAMTCP_STREAM_FLAG_NEW_RAW_DISABLED, STREAMTCP_STREAM_FLAG_TRIGGER_RAW, StreamTcpGetSegment(), StreamTcpReassembleInsertSegment(), StreamTcpSetEvent, StreamTcpSetOSPolicy(), TCP_CLOSED, TCP_GET_SEQ, TCP_SEG_LEN, TCP_TIME_WAIT, and UPDATE_DIR_OPPOSING.

Referenced by StreamTcpReassembleHandleSegment(), and StreamTcpUTAddPayload().

Here is the call graph for this function:

Here is the caller graph for this function:

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 98 of file stream-tcp-reassemble.c.

References SC_ATOMIC_ADD, SCLogDebug, and StreamTcpReassembleMemuseGlobalCounter().

Referenced by StreamTcpReassembleGetMemcap().

Here is the call graph for this function:

Here is the caller graph for this function:

int StreamTcpReassembleInit ( char  quiet)

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

References SCMutexInit, StatsRegisterGlobalCounter(), StreamTcpReassembleInitMemuse(), and StreamTcpReassembleMemuseGlobalCounter().

Referenced by StreamTcpInitConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

void StreamTcpReassembleInitMemuse ( void  )

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

References SC_ATOMIC_INIT.

Referenced by StreamTcpReassembleInit(), and UtRunTests().

Here is the caller graph for this function:

uint64_t StreamTcpReassembleMemuseGlobalCounter ( void  )

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

References SC_ATOMIC_GET.

Referenced by RunModeUnixSocketGetDefaultMode(), StreamTcpReassembleDecrMemuse(), StreamTcpReassembleIncrMemuse(), StreamTcpReassembleInit(), and UtRunTests().

Here is the caller graph for this function:

void StreamTcpReassemblePseudoPacketCreate ( TcpStream ,
Packet ,
PacketQueue  
)
void StreamTcpReassembleRegisterTests ( void  )

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

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

References StreamTcpInlineRegisterTests(), StreamTcpListRegisterTests(), StreamTcpUtilRegisterTests(), and UtRegisterTest().

Referenced by StreamTcpRegisterTests().

Here is the call graph for this function:

Here is the caller graph for this function:

int StreamTcpReassembleSetMemcap ( uint64_t  size)

Update memcap value.

Parameters
sizenew memcap value

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

References SC_ATOMIC_GET, SC_ATOMIC_SET, and stream_config.

Referenced by RunModeUnixSocketGetDefaultMode().

Here is the caller graph for this function:

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 1820 of file stream-tcp-reassemble.c.

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

Referenced by AppLayerParserTriggerRawStreamReassembly().

Here is the caller graph for this function:

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

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

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

Referenced by HTPFreeConfig().

Here is the caller graph for this function:

void StreamTcpReturnStreamSegments ( TcpStream stream)

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

Parameters
streamthe stream to cleanup

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

References offset, RB_FOREACH_SAFE, RB_REMOVE, TcpSegment::sbseg, 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:

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 302 of file stream-tcp-reassemble.c.

References PoolThreadReturn().

Referenced by StreamTcpPruneSession(), StreamTcpReassembleInsertSegment(), and StreamTcpReturnStreamSegments().

Here is the call graph for this function:

Here is the caller graph for this function: