Go to the documentation of this file.
25 #ifndef __STREAM_TCP_H__
26 #define __STREAM_TCP_H__
33 #define STREAM_VERBOSE FALSE
36 #define STREAMTCP_INIT_FLAG_CHECKSUM_VALIDATION BIT_U8(0)
37 #define STREAMTCP_INIT_FLAG_DROP_INVALID BIT_U8(1)
38 #define STREAMTCP_INIT_FLAG_BYPASS BIT_U8(2)
39 #define STREAMTCP_INIT_FLAG_INLINE BIT_U8(3)
134 uint64_t progress_in,
135 uint64_t *progress_out,
bool eof);
138 uint64_t *progress_out,
bool respect_inspect_depth);
157 static inline int StreamTcpCheckFlowDrops(
Packet *p)
199 const uint32_t progress);
uint16_t counter_tcp_midstream_pickups
SC_ATOMIC_DECLARE(uint64_t, memcap)
int StreamTcpPacket(ThreadVars *tv, Packet *p, StreamTcpThread *stt, PacketQueueNoLock *pq)
struct TcpStreamCnf_ TcpStreamCnf
int StreamTcpSegmentForEach(const Packet *p, uint8_t flag, StreamSegmentCallback CallbackFunc, void *data)
Run callback function on each TCP segment.
void StreamTcpDecrMemuse(uint64_t)
int StreamTcpCheckMemcap(uint64_t)
Check if alloc'ing "size" would mean we're over memcap.
void StreamTcpReassembleConfigEnableOverlapCheck(void)
uint16_t counter_tcp_reused_ssn
uint32_t reassembly_depth
uint16_t counter_tcp_sessions
Packet * StreamTcpPseudoSetup(Packet *, uint8_t *, uint32_t)
Function to fetch a packet from the packet allocation queue for creation of the pseudo packet from th...
int StreamReassembleRaw(TcpSession *ssn, const Packet *p, StreamReassembleRawFunc Callback, void *cb_data, uint64_t *progress_out, bool respect_inspect_depth)
StreamingBufferConfig sbcnf
uint64_t StreamTcpMemuseCounter(void)
uint64_t StreamTcpGetMemcap(void)
Return memcap value.
void StreamTcpSessionPktFree(Packet *)
Function to return the stream segments back to the pool.
void StreamTcpInitConfig(char)
To initialize the stream global configuration data.
void StreamTcpSessionClear(void *ssnptr)
Function to return the stream back to the pool. It returns the segments in the stream to the segment ...
simple fifo queue for packets
int StreamTcpInlineDropInvalid(void)
See if stream engine is dropping invalid packet in inline mode.
void StreamReassembleRawUpdateProgress(TcpSession *ssn, Packet *p, uint64_t progress)
update stream engine after detection
uint16_t counter_tcp_ssn_memcap
uint16_t counter_tcp_synack
int StreamTcpBypassEnabled(void)
void StreamTcpIncrMemuse(uint64_t)
TmEcode StreamTcpThreadInit(ThreadVars *, void *, void **)
uint16_t counter_tcp_wrong_thread
@ STREAM_HAS_UNPROCESSED_SEGMENTS_NEED_ONLY_DETECTION
uint16_t counter_tcp_invalid_checksum
Per thread variable structure.
int(* StreamSegmentCallback)(const Packet *, void *, const uint8_t *, uint32_t)
void StreamTcpUpdateAppLayerProgress(TcpSession *ssn, char direction, const uint32_t progress)
update reassembly progress
void StreamTcpStreamCleanup(TcpStream *stream)
void StreamTcpDetectLogFlush(ThreadVars *tv, StreamTcpThread *stt, Flow *f, Packet *p, PacketQueueNoLock *pq)
create packets in both directions to flush out logging and detection before switching protocols....
uint8_t max_synack_queued
uint64_t StreamTcpReassembleMemuseGlobalCounter(void)
void StreamTcpRegisterTests(void)
void TcpSessionSetReassemblyDepth(TcpSession *ssn, uint32_t size)
void StreamTcpSessionCleanup(TcpSession *ssn)
Session cleanup function. Does not free the ssn.
int TcpSessionPacketSsnReuse(const Packet *p, const Flow *f, const void *tcp_ssn)
TmEcode StreamTcp(ThreadVars *, Packet *, void *, PacketQueueNoLock *)
uint16_t counter_tcp_pseudo_failed
const char * StreamTcpSsnStateAsString(const TcpSession *ssn)
const char * StreamTcpStateAsString(const enum TcpState)
int StreamReassembleLog(TcpSession *ssn, TcpStream *stream, StreamReassembleRawFunc Callback, void *cb_data, uint64_t progress_in, uint64_t *progress_out, bool eof)
uint32_t prealloc_sessions
TcpStreamCnf stream_config
SC_ATOMIC_DECLARE(uint64_t, reassembly_memcap)
int StreamTcpInlineMode(void)
See if stream engine is operating in inline mode.
int StreamNeedsReassembly(const TcpSession *ssn, uint8_t direction)
see what if any work the TCP session still needs
TmEcode StreamTcpThreadDeinit(ThreadVars *tv, void *data)
uint16_t reassembly_toclient_chunk_size
void StreamTcpInitMemuse(void)
struct StreamTcpThread_ StreamTcpThread
uint16_t counter_tcp_no_flow
int StreamTcpSetMemcap(uint64_t)
Update memcap value.
void StreamTcpFreeConfig(char)
uint16_t counter_tcp_pseudo
TcpReassemblyThreadCtx * ra_ctx
uint16_t stream_init_flags
uint32_t prealloc_segments
int EngineModeIsIPS(void)
PacketQueueNoLock pseudo_queue
@ STREAM_HAS_UNPROCESSED_SEGMENTS_NONE
int(* StreamReassembleRawFunc)(void *data, const uint8_t *input, const uint32_t input_len)
uint16_t reassembly_toserver_chunk_size