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