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_ADD_PAYLOAD(rseq, seg, seglen, packet, packetlen)
 
#define INLINE_STEP(rseq, seg, seglen, buf, buflen, packet, packetlen)
 

Functions

int UTHCheckGapAtPosition (TcpStream *stream, int pos, uint64_t offset, uint32_t len)
 
int UTHCheckDataAtPosition (TcpStream *stream, int pos, uint64_t offset, const char *data, uint32_t len)
 
void StreamTcpInlineRegisterTests (void)
 

Macro Definition Documentation

◆ INLINE_ADD_PAYLOAD

#define INLINE_ADD_PAYLOAD (   rseq,
  seg,
  seglen,
  packet,
  packetlen 
)
Value:
(uint8_t *)(seg), (seglen), IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80); \
FAIL_IF(p == NULL); \
p->l4.hdrs.tcph->th_seq = htonl(stream->isn + (rseq)); \
p->l4.hdrs.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);

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

◆ 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:
INLINE_ADD_PAYLOAD((rseq), (seg), (seglen), (packet), (packetlen)); \
FAIL_IF(!(VALIDATE(stream, (uint8_t *)(buf), (buflen))));

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

Function Documentation

◆ StreamTcpInlineRegisterTests()

void StreamTcpInlineRegisterTests ( void  )

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

References UtRegisterTest().

Here is the call graph for this function:

◆ UTHCheckDataAtPosition()

int UTHCheckDataAtPosition ( TcpStream stream,
int  pos,
uint64_t  offset,
const char *  data,
uint32_t  len 
)

◆ UTHCheckGapAtPosition()

int UTHCheckGapAtPosition ( TcpStream stream,
int  pos,
uint64_t  offset,
uint32_t  len 
)
MIN
#define MIN(x, y)
Definition: suricata-common.h:391
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:260
StreamTcpUTInit
void StreamTcpUTInit(TcpReassemblyThreadCtx **ra_ctx)
Definition: stream-tcp-util.c:44
INLINE_ADD_PAYLOAD
#define INLINE_ADD_PAYLOAD(rseq, seg, seglen, packet, packetlen)
Definition: stream-tcp-inline.c:62
Packet_
Definition: decode.h:473
VALIDATE
#define VALIDATE(e)
StreamTcpUTClearSession
void StreamTcpUTClearSession(TcpSession *ssn)
Definition: stream-tcp-util.c:71
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:736
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:32
StreamTcpUTSetupSession
void StreamTcpUTSetupSession(TcpSession *ssn)
Definition: stream-tcp-util.c:62