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

Go to the source code of this file.

Data Structures

struct  TestReassembleRawCallbackData
 

Macros

#define RAWREASSEMBLY_START(isn)
 
#define RAWREASSEMBLY_END
 
#define RAWREASSEMBLY_STEP(seq, seg, seglen, buf, buflen)
 
#define RAWREASSEMBLY_STEP_WITH_PROGRESS(seq, seg, seglen, buf, buflen, lastack, progress)
 

Macro Definition Documentation

◆ RAWREASSEMBLY_END

#define RAWREASSEMBLY_END
Value:
StreamTcpUTDeinit(ra_ctx); \
#define PASS
Pass the test.
void StreamTcpUTClearSession(TcpSession *ssn)

Definition at line 86 of file stream-tcp-reassemble.c.

◆ RAWREASSEMBLY_START

#define RAWREASSEMBLY_START (   isn)
Value:
TcpReassemblyThreadCtx *ra_ctx = NULL; \
TcpSession ssn; \
memset(&tv, 0, sizeof(tv)); \
Packet *p = NULL; \
\
\
StreamTcpUTInit(&ra_ctx); \
StreamTcpUTInitInline(); \
StreamTcpUTSetupSession(&ssn); \
StreamTcpUTSetupStream(&ssn.server, (isn)); \
StreamTcpUTSetupStream(&ssn.client, (isn)); \
ssn.server.last_ack = (isn) + 1; \
ssn.client.last_ack = (isn) + 1; \
\
TcpStream *stream = &ssn.client;
TcpStreamCnf stream_config
Definition stream-tcp.c:219
ThreadVars * tv
uint16_t reassembly_toserver_chunk_size
Definition stream-tcp.h:77
uint16_t reassembly_toclient_chunk_size
Definition stream-tcp.h:78
Per thread variable structure.
Definition threadvars.h:58

Definition at line 66 of file stream-tcp-reassemble.c.

◆ RAWREASSEMBLY_STEP

#define RAWREASSEMBLY_STEP (   seq,
  seg,
  seglen,
  buf,
  buflen 
)
Value:
FAIL_IF_NULL(p); \
{ \
SCLogNotice("SEQ %u block of %u", (seq), (seglen)); \
p->flowflags = FLOW_PKT_TOSERVER; \
TCPHdr tcphdr; \
memset(&tcphdr, 0, sizeof(tcphdr)); \
UTHSetTCPHdr(p, &tcphdr); \
tcphdr.th_seq = htonl((seq)); \
tcphdr.th_ack = htonl(10); \
p->payload_len = (seglen); \
\
&tv, ra_ctx, &ssn, stream, (seq), (uint8_t *)(seg), (seglen)) != 0); \
p->flags |= PKT_STREAM_ADD; \
FAIL_IF(!(TestReassembleRawValidate(&ssn, p, (uint8_t *)(buf), (buflen)))); \
} \
PacketFree(p);
#define PKT_STREAM_ADD
Definition decode.h:1260
#define FLOW_PKT_TOSERVER
Definition flow.h:233
Packet * PacketGetFromAlloc(void)
Get a malloced packet.
Definition decode.c:258
uint32_t seq
int StreamTcpUTAddPayload(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpSession *ssn, TcpStream *stream, uint32_t seq, uint8_t *payload, uint16_t len)
wrapper for StreamTcpReassembleHandleSegmentHandleData
uint32_t th_seq
Definition decode-tcp.h:152
uint32_t th_ack
Definition decode-tcp.h:153

Definition at line 91 of file stream-tcp-reassemble.c.

◆ RAWREASSEMBLY_STEP_WITH_PROGRESS

#define RAWREASSEMBLY_STEP_WITH_PROGRESS (   seq,
  seg,
  seglen,
  buf,
  buflen,
  lastack,
  progress 
)
Value:
stream->last_ack = (lastack); \
RAWREASSEMBLY_STEP((seq),(seg),(seglen),(buf),(buflen)); \
FAIL_IF(STREAM_RAW_PROGRESS(stream) != (progress));
#define STREAM_RAW_PROGRESS(stream)

Definition at line 111 of file stream-tcp-reassemble.c.