Go to the documentation of this file.
146 memset(buf,
byte,
len);
162 static int StreamTcpUtilTest01(
void)
169 if (ra_ctx == NULL) {
170 printf(
"ra_ctx is NULL: ");
181 static int StreamTcpUtilStreamTest01(
void)
186 memset(&
tv, 0x00,
sizeof(
tv));
199 seg = TCPSEG_RB_NEXT(seg);
203 seg = TCPSEG_RB_NEXT(seg);
212 static int StreamTcpUtilStreamTest02(
void)
217 memset(&
tv, 0x00,
sizeof(
tv));
230 seg = TCPSEG_RB_NEXT(seg);
234 seg = TCPSEG_RB_NEXT(seg);
249 UtRegisterTest(
"StreamTcpUtilStreamTest01", StreamTcpUtilStreamTest01);
250 UtRegisterTest(
"StreamTcpUtilStreamTest02", StreamTcpUtilStreamTest02);
int StreamTcpUTAddPayload(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpSession *ssn, TcpStream *stream, uint32_t seq, uint8_t *payload, uint16_t len)
wrapper for StreamTcpReassembleHandleSegmentHandleData
void StreamTcpUTDeinit(TcpReassemblyThreadCtx *ra_ctx)
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
TcpSegment * StreamTcpGetSegment(ThreadVars *tv, TcpReassemblyThreadCtx *)
get a segment from the pool
void IPPairInitConfig(bool quiet)
initialize the configuration
void StreamTcpUTClearStream(TcpStream *s)
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
void StreamTcpUtilRegisterTests(void)
void StreamTcpStreamCleanup(TcpStream *stream)
TcpStreamCnf stream_config
Packet * UTHBuildPacketReal(uint8_t *payload, uint16_t payload_len, uint8_t ipproto, const char *src, const char *dst, uint16_t sport, uint16_t dport)
UTHBuildPacketReal is a function that create tcp/udp packets for unittests specifying ip and port sou...
void StreamTcpUTInitInline(void)
TcpReassemblyThreadCtx * StreamTcpReassembleInitThreadCtx(ThreadVars *tv)
void StreamTcpUTInit(TcpReassemblyThreadCtx **ra_ctx)
void StreamTcpInitConfig(bool)
To initialize the stream global configuration data.
#define PASS
Pass the test.
Per thread variable structure.
void StreamTcpUTSetupStream(TcpStream *s, uint32_t isn)
void StreamTcpReassembleFreeThreadCtx(TcpReassemblyThreadCtx *ra_ctx)
#define STREAMING_BUFFER_INITIALIZER
int StreamTcpReassembleHandleSegmentHandleData(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpSession *ssn, TcpStream *stream, Packet *p)
Insert a packets TCP data into the stream reassembly engine.
void StreamTcpUTClearSession(TcpSession *ssn)
#define FAIL_IF(expr)
Fail a test if expression evaluates to true.
void StreamTcpFreeConfig(bool quiet)
#define STREAMTCP_SET_RA_BASE_SEQ(stream, seq)
int StreamTcpReassembleInsertSegment(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpStream *stream, TcpSegment *seg, Packet *p, uint8_t *pkt_data, uint16_t pkt_datalen)
int StreamTcpUTAddSegmentWithPayload(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpStream *stream, uint32_t seq, uint8_t *payload, uint16_t len)
void StreamTcpUTSetupSession(TcpSession *ssn)
void UTHFreePacket(Packet *p)
UTHFreePacket: function to release the allocated data from UTHBuildPacket and the packet itself.
int StreamTcpUTAddSegmentWithByte(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpStream *stream, uint32_t seq, uint8_t byte, uint16_t len)
void StreamTcpSessionCleanup(TcpSession *ssn)
Session cleanup function. Does not free the ssn.
union PacketL4::L4Hdrs hdrs
#define STREAMTCP_INIT_FLAG_INLINE