suricata
stream-tcp-inline.c File Reference
Include dependency graph for stream-tcp-inline.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define INLINE_START(isn)
 
#define INLINE_END
 
#define INLINE_STEP(rseq, seg, seglen, buf, buflen, packet, packetlen)
 

Functions

void StreamTcpInlineRegisterTests (void)
 

Macro Definition Documentation

◆ INLINE_END

#define INLINE_END
Value:
StreamTcpUTDeinit(ra_ctx); \
PASS

Definition at line 58 of file stream-tcp-inline.c.

◆ INLINE_START

#define INLINE_START (   isn)
Value:
Packet *p; \
TcpReassemblyThreadCtx *ra_ctx = NULL; \
TcpSession ssn; \
ThreadVars tv; \
memset(&tv, 0, sizeof(tv)); \
StreamTcpUTInit(&ra_ctx); \
StreamTcpUTInitInline(); \
StreamTcpUTSetupStream(&ssn.server, (isn)); \
StreamTcpUTSetupStream(&ssn.client, (isn)); \
\
TcpStream *stream = &ssn.client;

Definition at line 42 of file stream-tcp-inline.c.

◆ INLINE_STEP

#define INLINE_STEP (   rseq,
  seg,
  seglen,
  buf,
  buflen,
  packet,
  packetlen 
)
Value:
p = UTHBuildPacketReal((uint8_t *)(seg), (seglen), IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80); \
FAIL_IF(p == NULL); \
p->tcph->th_seq = htonl(stream->isn + (rseq)); \
p->tcph->th_ack = htonl(31); \
FAIL_IF (StreamTcpReassembleHandleSegmentHandleData(&tv, ra_ctx, &ssn, stream, p) < 0); \
FAIL_IF (memcmp(p->payload, packet, MIN((packetlen),p->payload_len)) != 0); \
UTHFreePacket(p); \
FAIL_IF(!(VALIDATE(stream, (uint8_t *)(buf), (buflen))));

Definition at line 63 of file stream-tcp-inline.c.

Function Documentation

◆ StreamTcpInlineRegisterTests()

void StreamTcpInlineRegisterTests ( void  )

Definition at line 149 of file stream-tcp-inline.c.

References UtRegisterTest().

Here is the call graph for this function:
MIN
#define MIN(x, y)
Definition: suricata-common.h:377
UTHBuildPacketReal
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...
Definition: util-unittest-helper.c:242
StreamTcpUTInit
void StreamTcpUTInit(TcpReassemblyThreadCtx **ra_ctx)
Definition: stream-tcp-util.c:44
Packet_
Definition: decode.h:414
StreamTcpReassembleHandleSegmentHandleData
int StreamTcpReassembleHandleSegmentHandleData(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpSession *ssn, TcpStream *stream, Packet *p)
Insert a packets TCP data into the stream reassembly engine.
Definition: stream-tcp-reassemble.c:600
StreamTcpUTClearSession
void StreamTcpUTClearSession(TcpSession *ssn)
Definition: stream-tcp-util.c:71
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:29
StreamTcpUTSetupSession
void StreamTcpUTSetupSession(TcpSession *ssn)
Definition: stream-tcp-util.c:62