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);
155 static inline int StreamTcpCheckFlowDrops(
Packet *p)
178 SCLogDebug(
"ssn %p: switching pkt direction", ssn);
void StreamTcpRegisterTests(void)
uint16_t counter_tcp_synack
void StreamTcpDecrMemuse(uint64_t)
uint16_t counter_tcp_no_flow
SC_ATOMIC_DECLARE(uint64_t, memcap)
TcpStreamCnf stream_config
int StreamTcpPacket(ThreadVars *tv, Packet *p, StreamTcpThread *stt, PacketQueue *pq)
void StreamTcpStreamCleanup(TcpStream *stream)
#define FLOW_PKT_TOSERVER_FIRST
uint16_t counter_tcp_wrong_thread
int(* StreamReassembleRawFunc)(void *data, const uint8_t *input, const uint32_t input_len)
void StreamTcpInitMemuse(void)
void StreamTcpSessionClear(void *ssnptr)
Function to return the stream back to the pool. It returns the segments in the stream to the segment ...
int TcpSessionPacketSsnReuse(const Packet *p, const Flow *f, const void *tcp_ssn)
void StreamTcpSessionPktFree(Packet *)
Function to return the stream segments back to the pool.
uint16_t counter_tcp_ssn_memcap
int EngineModeIsIPS(void)
struct TcpStreamCnf_ TcpStreamCnf
uint16_t counter_tcp_invalid_checksum
TmEcode StreamTcp(ThreadVars *, Packet *, void *, PacketQueue *, PacketQueue *)
int StreamTcpBypassEnabled(void)
void StreamTcpFreeConfig(char)
int StreamNeedsReassembly(const TcpSession *ssn, uint8_t direction)
see what if any work the TCP session still needs
TcpReassemblyThreadCtx * ra_ctx
uint16_t reassembly_toclient_chunk_size
uint8_t max_synack_queued
int StreamReassembleLog(TcpSession *ssn, TcpStream *stream, StreamReassembleRawFunc Callback, void *cb_data, uint64_t progress_in, uint64_t *progress_out, bool eof)
void StreamReassembleRawUpdateProgress(TcpSession *ssn, Packet *p, uint64_t progress)
update stream engine after detection
TmEcode StreamTcpThreadDeinit(ThreadVars *tv, void *data)
int StreamTcpInlineMode(void)
See if stream engine is operating in inline mode.
#define PKT_IS_TOSERVER(p)
#define FLOW_PKT_TOSERVER
void StreamTcpIncrMemuse(uint64_t)
uint16_t counter_tcp_sessions
int StreamReassembleRaw(TcpSession *ssn, const Packet *p, StreamReassembleRawFunc Callback, void *cb_data, uint64_t *progress_out, bool respect_inspect_depth)
uint16_t reassembly_toserver_chunk_size
void TcpSessionSetReassemblyDepth(TcpSession *ssn, uint32_t size)
uint32_t reassembly_depth
int StreamTcpInlineDropInvalid(void)
See if stream engine is dropping invalid packet in inline mode.
uint16_t stream_init_flags
#define FLOW_PKT_TOCLIENT_FIRST
int StreamTcpSegmentForEach(const Packet *p, uint8_t flag, StreamSegmentCallback CallbackFunc, void *data)
Run callback function on each TCP segment.
uint64_t StreamTcpMemuseCounter(void)
int StreamTcpCheckMemcap(uint64_t)
Check if alloc'ing "size" would mean we're over memcap.
void StreamTcpReassembleConfigEnableOverlapCheck(void)
struct StreamTcpThread_ StreamTcpThread
uint16_t counter_tcp_reused_ssn
uint16_t counter_tcp_midstream_pickups
int StreamTcpSetMemcap(uint64_t)
Update memcap value.
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...
void StreamTcpInitConfig(char)
To initialize the stream global configuration data.
uint32_t prealloc_segments
uint64_t StreamTcpReassembleMemuseGlobalCounter(void)
TmEcode StreamTcpThreadInit(ThreadVars *, void *, void **)
void StreamTcpSessionCleanup(TcpSession *ssn)
Session cleanup function. Does not free the ssn.
uint16_t counter_tcp_pseudo
StreamingBufferConfig sbcnf
uint64_t StreamTcpGetMemcap(void)
Return memcap value.
Per thread variable structure.
#define FLOW_PKT_TOCLIENT
void StreamTcpDetectLogFlush(ThreadVars *tv, StreamTcpThread *stt, Flow *f, Packet *p, PacketQueue *pq)
create packets in both directions to flush out logging and detection before switching protocols...
uint32_t prealloc_sessions
uint16_t counter_tcp_pseudo_failed
int(* StreamSegmentCallback)(const Packet *, void *, const uint8_t *, uint32_t)