Go to the documentation of this file.
25 #ifndef SURICATA_STREAM_TCP_REASSEMBLE_H
26 #define SURICATA_STREAM_TCP_REASSEMBLE_H
91 #define OS_POLICY_DEFAULT OS_POLICY_BSD
144 static inline bool STREAM_LASTACK_GT_BASESEQ(
const TcpStream *stream)
void EnableTcpSessionDumping(void)
int StreamTcpReassembleHandleSegment(ThreadVars *, TcpReassemblyThreadCtx *, TcpSession *, TcpStream *, Packet *)
ExceptionPolicyCounters counter_tcp_reas_eps
void StreamTcpReassembleRegisterTests(void)
The Function Register the Unit tests to test the reassembly engine for various OS policies.
int StreamTcpReassembleInsertSegment(ThreadVars *, TcpReassemblyThreadCtx *, TcpStream *, TcpSegment *, Packet *, uint8_t *pkt_data, uint16_t pkt_datalen)
TcpReassemblyThreadCtx * StreamTcpReassembleInitThreadCtx(ThreadVars *tv)
TcpSegment * StreamTcpGetSegment(ThreadVars *, TcpReassemblyThreadCtx *)
get a segment from the pool
void StreamTcpSetDisableRawReassemblyFlag(TcpSession *, char)
Set the No reassembly flag for the given direction in given TCP session.
uint32_t StreamDataAvailableForProtoDetect(TcpStream *stream)
void StreamTcpSegmentReturntoPool(TcpSegment *)
Function to return the segment back to the pool.
uint16_t counter_tcp_stream_depth
int StreamTcpReassembleInit(bool)
uint64_t StreamTcpReassembleMemuseGlobalCounter(void)
uint16_t counter_tcp_reass_overlap
uint64_t StreamTcpReassembleGetMemcap(void)
Return memcap value.
uint16_t counter_tcp_reass_overlap_diff_data
void StreamTcpDisableAppLayer(Flow *f)
int StreamTcpReassembleCheckMemcap(uint64_t size)
Function to Check the reassembly memory usage counter against the allowed max memory usage for TCP se...
int StreamTcpReassembleDepthReached(Packet *p)
check if stream in pkt direction has depth reached
uint16_t counter_tcp_reass_data_normal_fail
void StreamTcpReassembleIncrMemuse(uint64_t size)
Function to Increment the memory usage counter for the TCP reassembly segments.
void StreamTcpReassembleFree(bool)
int StreamTcpReassembleHandleSegmentHandleData(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpSession *ssn, TcpStream *stream, Packet *p)
Insert a packets TCP data into the stream reassembly engine.
#define STREAM_BASE_OFFSET(stream)
Per thread variable structure.
struct TcpReassemblyThreadCtx_ TcpReassemblyThreadCtx
void StreamTcpCreateTestPacket(uint8_t *, uint8_t, uint8_t, uint8_t)
The Function to create the packet with given payload, which is used to test the reassembly of the eng...
void StreamTcpReassembleDecrMemuse(uint64_t size)
Function to Decrease the memory usage counter for the TCP reassembly segments.
void StreamTcpReassembleFreeThreadCtx(TcpReassemblyThreadCtx *)
uint16_t counter_tcp_urgent_oob
int RunmodeIsUnittests(void)
int StreamTcpReassembleAppLayer(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpSession *ssn, TcpStream *stream, Packet *p, enum StreamUpdateDir dir)
Update the stream reassembly upon receiving a packet.
uint16_t counter_tcp_reass_gap
void StreamTcpReassembleTriggerRawReassembly(TcpSession *, int direction)
Trigger RAW stream reassembly.
int segment_thread_pool_id
bool IsTcpSessionDumpingEnabled(void)
void StreamTcpSetSessionNoReassemblyFlag(TcpSession *, char)
disable reassembly
void StreamTcpReturnStreamSegments(TcpStream *)
return all segments in this stream into the pool(s)
int StreamTcpReassembleSetMemcap(uint64_t size)
Update memcap value.
bool StreamReassembleRawHasDataReady(TcpSession *ssn, Packet *p)
does the stream engine have data to inspect?
void StreamTcpReassembleInitMemuse(void)
int StreamTcpAppLayerIsDisabled(Flow *f)
void StreamTcpSetOSPolicy(TcpStream *, Packet *)
Function to set the OS policy for the given stream based on the destination of the received packet.
uint16_t counter_tcp_reass_data_overlap_fail
void * StreamTcpReassembleRealloc(void *optr, size_t orig_size, size_t size)
void StreamTcpPruneSession(Flow *, uint8_t)
Remove idle TcpSegments from TcpSession.
uint16_t counter_tcp_segment_from_pool
void StreamTcpReassemblySetMinInspectDepth(TcpSession *ssn, int direction, uint32_t depth)
uint16_t counter_tcp_segment_memcap
void StreamTcpSetSessionBypassFlag(TcpSession *)
enable bypass
uint16_t counter_tcp_segment_from_cache