Go to the documentation of this file.
147 memset(buf,
byte,
len);
164 static int StreamTcpUtilTest01(
void)
171 if (ra_ctx == NULL) {
172 printf(
"ra_ctx is NULL: ");
183 static int StreamTcpUtilStreamTest01(
void)
188 memset(&
tv, 0x00,
sizeof(
tv));
201 seg = TCPSEG_RB_NEXT(seg);
205 seg = TCPSEG_RB_NEXT(seg);
214 static int StreamTcpUtilStreamTest02(
void)
219 memset(&
tv, 0x00,
sizeof(
tv));
232 seg = TCPSEG_RB_NEXT(seg);
236 seg = TCPSEG_RB_NEXT(seg);
251 UtRegisterTest(
"StreamTcpUtilStreamTest01", StreamTcpUtilStreamTest01);
252 UtRegisterTest(
"StreamTcpUtilStreamTest02", StreamTcpUtilStreamTest02);
#define TCP_GET_RAW_SEQ(tcph)
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.
int StreamTcpReassembleInsertSegment(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpStream *stream, TcpSegment *seg, Packet *p, uint32_t pkt_seq, uint8_t *pkt_data, uint16_t pkt_datalen)
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 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