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

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

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

#define RAWREASSEMBLY_START (   isn)
Value:
TcpReassemblyThreadCtx *ra_ctx = NULL; \
memset(&tv, 0, sizeof(tv)); \
Packet *p = NULL; \
StreamTcpUTSetupStream(&ssn.server, (isn)); \
StreamTcpUTSetupStream(&ssn.client, (isn)); \
ssn.server.last_ack = (isn) + 1; \
ssn.client.last_ack = (isn) + 1; \
\
TcpStream *stream = &ssn.client;
void StreamTcpUTInit(TcpReassemblyThreadCtx **ra_ctx)
TcpStreamCnf stream_config
Definition: stream-tcp.h:106
struct ThreadVars_ ThreadVars
Per thread variable structure.
uint16_t reassembly_toclient_chunk_size
Definition: stream-tcp.h:63
uint16_t reassembly_toserver_chunk_size
Definition: stream-tcp.h:62
void StreamTcpUTInitInline(void)
struct Packet_ Packet
struct TcpStream_ TcpStream
void StreamTcpUTSetupStream(TcpStream *s, uint32_t isn)
struct TcpSession_ TcpSession
void StreamTcpUTSetupSession(TcpSession *ssn)

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

#define RAWREASSEMBLY_STEP (   seq,
  seg,
  seglen,
  buf,
  buflen 
)
Value:
{ \
SCLogNotice("SEQ %u block of %u", (seq), (seglen)); \
p->flowflags = FLOW_PKT_TOSERVER; \
TCPHdr tcphdr; \
memset(&tcphdr, 0, sizeof(tcphdr)); \
p->tcph = &tcphdr; \
p->tcph->th_seq = htonl((seq)); \
p->tcph->th_ack = htonl(10); \
p->payload_len = (seglen); \
FAIL_IF(StreamTcpUTAddPayload(&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)))); \
}\
#define FAIL_IF(expr)
Fail a test if expression evaluates to false.
Definition: util-unittest.h:71
void PacketFree(Packet *p)
Return a malloced packet.
Definition: decode.c:102
uint32_t seq
#define FLOW_PKT_TOSERVER
Definition: flow.h:201
#define SCLogNotice(...)
Macro used to log NOTICE messages.
Definition: util-debug.h:269
#define PKT_STREAM_ADD
Definition: decode.h:1091
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
Definition: util-unittest.h:89
int StreamTcpUTAddPayload(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, TcpSession *ssn, TcpStream *stream, uint32_t seq, uint8_t *payload, uint16_t len)
wrapper for StreamTcpReassembleHandleSegmentHandleData
Packet * PacketGetFromAlloc(void)
Get a malloced packet.
Definition: decode.c:141

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

#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 FAIL_IF(expr)
Fail a test if expression evaluates to false.
Definition: util-unittest.h:71
#define STREAM_RAW_PROGRESS(stream)
uint32_t seq
#define RAWREASSEMBLY_STEP(seq, seg, seglen, buf, buflen)

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