18 #include "../suricata-common.h"
19 #include "../stream-tcp-private.h"
20 #include "../stream-tcp.h"
21 #include "../stream-tcp-reassemble.h"
22 #include "../stream-tcp-inline.h"
23 #include "../stream-tcp-list.h"
24 #include "../stream-tcp-util.h"
25 #include "../util-streaming-buffer.h"
26 #include "../util-print.h"
27 #include "../util-unittest.h"
32 if (memcmp(stream->
sb.
region.
buf, data, data_len) != 0) {
40 #define OVERLAP_START(isn, policy) \
41 TcpReassemblyThreadCtx *ra_ctx = NULL; \
44 memset(&tv, 0, sizeof(tv)); \
46 StreamTcpUTInit(&ra_ctx); \
48 StreamTcpUTSetupSession(&ssn); \
49 StreamTcpUTSetupStream(&ssn.server, (isn)); \
50 StreamTcpUTSetupStream(&ssn.client, (isn)); \
52 TcpStream *stream = &ssn.client; \
53 stream->os_policy = (policy);
56 StreamTcpUTClearSession(&ssn); \
57 StreamTcpUTDeinit(ra_ctx); \
60 #define OVERLAP_STEP(rseq, seg, seglen, buf, buflen) \
61 StreamTcpUTAddPayload(&tv, ra_ctx, &ssn, stream, stream->isn + (rseq), (uint8_t *)(seg), (seglen)); \
62 FAIL_IF(!(VALIDATE(stream, (uint8_t *)(buf), (buflen))));
64 static int OverlapBSD(uint32_t isn)
73 OVERLAP_STEP(17,
"FFF", 3,
"\0AAA\0BBCCC\0D\0\0EEFFF", 19);
74 OVERLAP_STEP(20,
"GG", 2,
"\0AAA\0BBCCC\0D\0\0EEFFFGG", 21);
75 OVERLAP_STEP(22,
"HH", 2,
"\0AAA\0BBCCC\0D\0\0EEFFFGGHH", 23);
76 OVERLAP_STEP(24,
"I", 1,
"\0AAA\0BBCCC\0D\0\0EEFFFGGHHI", 24);
78 OVERLAP_STEP(3,
"JJJJ", 4,
"\0AAAJJBCCC\0D\0\0EEFFFGGHHI", 24);
80 OVERLAP_STEP(8,
"KKK", 3,
"\0AAAJJBCCC\0D\0\0EEFFFGGHHI", 24);
82 OVERLAP_STEP(11,
"LLL", 3,
"\0AAAJJBCCCLLL\0EEFFFGGHHI", 24);
84 OVERLAP_STEP(14,
"MMM", 3,
"\0AAAJJBCCCLLLMMMFFFGGHHI", 24);
86 OVERLAP_STEP(18,
"N", 1,
"\0AAAJJBCCCLLLMMMFFFGGHHI", 24);
88 OVERLAP_STEP(21,
"O", 1,
"\0AAAJJBCCCLLLMMMFFFGGHHI", 24);
90 OVERLAP_STEP(22,
"P", 1,
"\0AAAJJBCCCLLLMMMFFFGGHHI", 24);
92 OVERLAP_STEP(24,
"QQ", 2,
"\0AAAJJBCCCLLLMMMFFFGGHHIQ", 25);
93 OVERLAP_STEP(1,
"0", 1,
"0AAAJJBCCCLLLMMMFFFGGHHIQ", 25);
98 static int OverlapBSDBefore(uint32_t isn)
104 OVERLAP_STEP(12,
"EE", 2,
"\0\0B\0\0\0\0\0D\0\0EE", 13);
113 static int OverlapBSDSame(uint32_t isn)
118 OVERLAP_STEP(15,
"HH", 2,
"CCC\0\0\0\0\0\0\0\0\0\0\0HH", 16);
119 OVERLAP_STEP(17,
"II", 2,
"CCC\0\0\0\0\0\0\0\0\0\0\0HHII", 18);
121 OVERLAP_STEP(1,
"KKK", 3,
"CCC\0\0\0\0\0\0\0\0\0\0\0HHII", 18);
123 OVERLAP_STEP(1,
"LLLL", 4,
"CCCL\0\0\0\0\0\0\0\0\0\0HHII", 18);
124 OVERLAP_STEP(15,
"P", 1,
"CCCL\0\0\0\0\0\0\0\0\0\0HHII", 18);
125 OVERLAP_STEP(15,
"QQ", 2,
"CCCL\0\0\0\0\0\0\0\0\0\0HHII", 18);
130 static int OverlapBSDAfter(uint32_t isn)
135 OVERLAP_STEP(16,
"FFF", 3,
"AA\0\0\0\0\0\0\0\0\0\0\0\0\0FFF", 18);
136 OVERLAP_STEP(19,
"GG", 2,
"AA\0\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
137 OVERLAP_STEP(2,
"JJ", 2,
"AAJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
138 OVERLAP_STEP(20,
"O", 1,
"AAJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
139 OVERLAP_STEP(17,
"N", 1,
"AAJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
144 static int OverlapVISTA(uint32_t isn)
153 OVERLAP_STEP(17,
"FFF", 3,
"\0AAA\0BBCCC\0D\0\0EEFFF", 19);
154 OVERLAP_STEP(20,
"GG", 2,
"\0AAA\0BBCCC\0D\0\0EEFFFGG", 21);
155 OVERLAP_STEP(22,
"HH", 2,
"\0AAA\0BBCCC\0D\0\0EEFFFGGHH", 23);
156 OVERLAP_STEP(24,
"I", 1,
"\0AAA\0BBCCC\0D\0\0EEFFFGGHHI", 24);
158 OVERLAP_STEP(3,
"JJJJ", 4,
"\0AAAJBBCCC\0D\0\0EEFFFGGHHI", 24);
160 OVERLAP_STEP(8,
"KKK", 3,
"\0AAAJBBCCC\0D\0\0EEFFFGGHHI", 24);
162 OVERLAP_STEP(11,
"LLL", 3,
"\0AAAJBBCCCLDL\0EEFFFGGHHI", 24);
164 OVERLAP_STEP(14,
"MMM", 3,
"\0AAAJBBCCCLDLMEEFFFGGHHI", 24);
166 OVERLAP_STEP(18,
"N", 1,
"\0AAAJBBCCCLDLMEEFFFGGHHI", 24);
168 OVERLAP_STEP(21,
"O", 1,
"\0AAAJBBCCCLDLMEEFFFGGHHI", 24);
170 OVERLAP_STEP(22,
"P", 1,
"\0AAAJBBCCCLDLMEEFFFGGHHI", 24);
172 OVERLAP_STEP(24,
"QQ", 2,
"\0AAAJBBCCCLDLMEEFFFGGHHIQ", 25);
173 OVERLAP_STEP(1,
"0", 1,
"0AAAJBBCCCLDLMEEFFFGGHHIQ", 25);
178 static int OverlapVISTABefore(uint32_t isn)
184 OVERLAP_STEP(12,
"EE", 2,
"\0\0B\0\0\0\0\0D\0\0EE", 13);
193 static int OverlapVISTASame(uint32_t isn)
198 OVERLAP_STEP(15,
"HH", 2,
"CCC\0\0\0\0\0\0\0\0\0\0\0HH", 16);
199 OVERLAP_STEP(17,
"II", 2,
"CCC\0\0\0\0\0\0\0\0\0\0\0HHII", 18);
200 OVERLAP_STEP(1,
"KKK", 3,
"CCC\0\0\0\0\0\0\0\0\0\0\0HHII", 18);
201 OVERLAP_STEP(1,
"LLLL", 4,
"CCCL\0\0\0\0\0\0\0\0\0\0HHII", 18);
202 OVERLAP_STEP(15,
"P", 1,
"CCCL\0\0\0\0\0\0\0\0\0\0HHII", 18);
203 OVERLAP_STEP(15,
"QQ", 2,
"CCCL\0\0\0\0\0\0\0\0\0\0HHII", 18);
208 static int OverlapVISTAAfter(uint32_t isn)
213 OVERLAP_STEP(16,
"FFF", 3,
"AA\0\0\0\0\0\0\0\0\0\0\0\0\0FFF", 18);
214 OVERLAP_STEP(19,
"GG", 2,
"AA\0\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
215 OVERLAP_STEP(2,
"JJ", 2,
"AAJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
216 OVERLAP_STEP(20,
"O", 1,
"AAJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
217 OVERLAP_STEP(17,
"N", 1,
"AAJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
222 static int OverlapLINUX(uint32_t isn)
231 OVERLAP_STEP(17,
"FFF", 3,
"\0AAA\0BBCCC\0D\0\0EEFFF", 19);
232 OVERLAP_STEP(20,
"GG", 2,
"\0AAA\0BBCCC\0D\0\0EEFFFGG", 21);
233 OVERLAP_STEP(22,
"HH", 2,
"\0AAA\0BBCCC\0D\0\0EEFFFGGHH", 23);
234 OVERLAP_STEP(24,
"I", 1,
"\0AAA\0BBCCC\0D\0\0EEFFFGGHHI", 24);
236 OVERLAP_STEP(3,
"JJJJ", 4,
"\0AAAJJBCCC\0D\0\0EEFFFGGHHI", 24);
238 OVERLAP_STEP(8,
"KKK", 3,
"\0AAAJJBCCC\0D\0\0EEFFFGGHHI", 24);
240 OVERLAP_STEP(11,
"LLL", 3,
"\0AAAJJBCCCLLL\0EEFFFGGHHI", 24);
242 OVERLAP_STEP(14,
"MMM", 3,
"\0AAAJJBCCCLLLMMMFFFGGHHI", 24);
244 OVERLAP_STEP(18,
"N", 1,
"\0AAAJJBCCCLLLMMMFFFGGHHI", 24);
246 OVERLAP_STEP(21,
"O", 1,
"\0AAAJJBCCCLLLMMMFFFGGHHI", 24);
248 OVERLAP_STEP(22,
"P", 1,
"\0AAAJJBCCCLLLMMMFFFGGHHI", 24);
250 OVERLAP_STEP(24,
"QQ", 2,
"\0AAAJJBCCCLLLMMMFFFGGHHQQ", 25);
251 OVERLAP_STEP(1,
"0", 1,
"0AAAJJBCCCLLLMMMFFFGGHHQQ", 25);
256 static int OverlapLINUXBefore(uint32_t isn)
262 OVERLAP_STEP(12,
"EE", 2,
"\0\0B\0\0\0\0\0D\0\0EE", 13);
271 static int OverlapLINUXSame(uint32_t isn)
276 OVERLAP_STEP(15,
"HH", 2,
"CCC\0\0\0\0\0\0\0\0\0\0\0HH", 16);
277 OVERLAP_STEP(17,
"II", 2,
"CCC\0\0\0\0\0\0\0\0\0\0\0HHII", 18);
278 OVERLAP_STEP(1,
"KKK", 3,
"CCC\0\0\0\0\0\0\0\0\0\0\0HHII", 18);
279 OVERLAP_STEP(1,
"LLLL", 4,
"LLLL\0\0\0\0\0\0\0\0\0\0HHII", 18);
280 OVERLAP_STEP(15,
"P", 1,
"LLLL\0\0\0\0\0\0\0\0\0\0HHII", 18);
281 OVERLAP_STEP(15,
"QQ", 2,
"LLLL\0\0\0\0\0\0\0\0\0\0HHII", 18);
286 static int OverlapLINUXAfter(uint32_t isn)
291 OVERLAP_STEP(16,
"FFF", 3,
"AA\0\0\0\0\0\0\0\0\0\0\0\0\0FFF", 18);
292 OVERLAP_STEP(19,
"GG", 2,
"AA\0\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
293 OVERLAP_STEP(2,
"JJ", 2,
"AAJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
294 OVERLAP_STEP(20,
"O", 1,
"AAJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
295 OVERLAP_STEP(17,
"N", 1,
"AAJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
300 static int OverlapLINUXOLD(uint32_t isn)
309 OVERLAP_STEP(17,
"FFF", 3,
"\0AAA\0BBCCC\0D\0\0EEFFF", 19);
310 OVERLAP_STEP(20,
"GG", 2,
"\0AAA\0BBCCC\0D\0\0EEFFFGG", 21);
311 OVERLAP_STEP(22,
"HH", 2,
"\0AAA\0BBCCC\0D\0\0EEFFFGGHH", 23);
312 OVERLAP_STEP(24,
"I", 1,
"\0AAA\0BBCCC\0D\0\0EEFFFGGHHI", 24);
314 OVERLAP_STEP(3,
"JJJJ", 4,
"\0AAAJJBCCC\0D\0\0EEFFFGGHHI", 24);
316 OVERLAP_STEP(8,
"KKK", 3,
"\0AAAJJBKKK\0D\0\0EEFFFGGHHI", 24);
318 OVERLAP_STEP(11,
"LLL", 3,
"\0AAAJJBKKKLLL\0EEFFFGGHHI", 24);
320 OVERLAP_STEP(14,
"MMM", 3,
"\0AAAJJBKKKLLLMMMFFFGGHHI", 24);
322 OVERLAP_STEP(18,
"N", 1,
"\0AAAJJBKKKLLLMMMFFFGGHHI", 24);
324 OVERLAP_STEP(21,
"O", 1,
"\0AAAJJBKKKLLLMMMFFFGGHHI", 24);
326 OVERLAP_STEP(22,
"P", 1,
"\0AAAJJBKKKLLLMMMFFFGGHHI", 24);
328 OVERLAP_STEP(24,
"QQ", 2,
"\0AAAJJBKKKLLLMMMFFFGGHHQQ", 25);
329 OVERLAP_STEP(1,
"0", 1,
"0AAAJJBKKKLLLMMMFFFGGHHQQ", 25);
334 static int OverlapLINUXOLDBefore(uint32_t isn)
340 OVERLAP_STEP(12,
"EE", 2,
"\0\0B\0\0\0\0\0D\0\0EE", 13);
349 static int OverlapLINUXOLDSame(uint32_t isn)
354 OVERLAP_STEP(15,
"HH", 2,
"CCC\0\0\0\0\0\0\0\0\0\0\0HH", 16);
355 OVERLAP_STEP(17,
"II", 2,
"CCC\0\0\0\0\0\0\0\0\0\0\0HHII", 18);
356 OVERLAP_STEP(1,
"KKK", 3,
"KKK\0\0\0\0\0\0\0\0\0\0\0HHII", 18);
357 OVERLAP_STEP(1,
"LLLL", 4,
"LLLL\0\0\0\0\0\0\0\0\0\0HHII", 18);
358 OVERLAP_STEP(15,
"P", 1,
"LLLL\0\0\0\0\0\0\0\0\0\0HHII", 18);
359 OVERLAP_STEP(15,
"QQ", 2,
"LLLL\0\0\0\0\0\0\0\0\0\0QQII", 18);
364 static int OverlapLINUXOLDAfter(uint32_t isn)
369 OVERLAP_STEP(16,
"FFF", 3,
"AA\0\0\0\0\0\0\0\0\0\0\0\0\0FFF", 18);
370 OVERLAP_STEP(19,
"GG", 2,
"AA\0\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
371 OVERLAP_STEP(2,
"JJ", 2,
"AAJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
372 OVERLAP_STEP(20,
"O", 1,
"AAJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
373 OVERLAP_STEP(17,
"N", 1,
"AAJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
378 static int OverlapSOLARIS(uint32_t isn)
387 OVERLAP_STEP(17,
"FFF", 3,
"\0AAA\0BBCCC\0D\0\0EEFFF", 19);
388 OVERLAP_STEP(20,
"GG", 2,
"\0AAA\0BBCCC\0D\0\0EEFFFGG", 21);
389 OVERLAP_STEP(22,
"HH", 2,
"\0AAA\0BBCCC\0D\0\0EEFFFGGHH", 23);
390 OVERLAP_STEP(24,
"I", 1,
"\0AAA\0BBCCC\0D\0\0EEFFFGGHHI", 24);
391 OVERLAP_STEP(3,
"JJJJ", 4,
"\0AJJJBBCCC\0D\0\0EEFFFGGHHI", 24);
393 OVERLAP_STEP(8,
"KKK", 3,
"\0AJJJBBKKK\0D\0\0EEFFFGGHHI", 24);
395 OVERLAP_STEP(11,
"LLL", 3,
"\0AJJJBBKKKLLL\0EEFFFGGHHI", 24);
397 OVERLAP_STEP(14,
"MMM", 3,
"\0AJJJBBKKKLLLMMMFFFGGHHI", 24);
399 OVERLAP_STEP(18,
"N", 1,
"\0AJJJBBKKKLLLMMMFFFGGHHI", 24);
401 OVERLAP_STEP(21,
"O", 1,
"\0AJJJBBKKKLLLMMMFFFGGHHI", 24);
403 OVERLAP_STEP(22,
"P", 1,
"\0AJJJBBKKKLLLMMMFFFGGHHI", 24);
405 OVERLAP_STEP(24,
"QQ", 2,
"\0AJJJBBKKKLLLMMMFFFGGHHQQ", 25);
406 OVERLAP_STEP(1,
"0", 1,
"0AJJJBBKKKLLLMMMFFFGGHHQQ", 25);
411 static int OverlapSOLARISBefore(uint32_t isn)
417 OVERLAP_STEP(12,
"EE", 2,
"\0\0B\0\0\0\0\0D\0\0EE", 13);
426 static int OverlapSOLARISSame(uint32_t isn)
431 OVERLAP_STEP(15,
"HH", 2,
"CCC\0\0\0\0\0\0\0\0\0\0\0HH", 16);
432 OVERLAP_STEP(17,
"II", 2,
"CCC\0\0\0\0\0\0\0\0\0\0\0HHII", 18);
433 OVERLAP_STEP(1,
"KKK", 3,
"KKK\0\0\0\0\0\0\0\0\0\0\0HHII", 18);
434 OVERLAP_STEP(1,
"LLLL", 4,
"LLLL\0\0\0\0\0\0\0\0\0\0HHII", 18);
435 OVERLAP_STEP(15,
"P", 1,
"LLLL\0\0\0\0\0\0\0\0\0\0HHII", 18);
436 OVERLAP_STEP(15,
"QQ", 2,
"LLLL\0\0\0\0\0\0\0\0\0\0QQII", 18);
441 static int OverlapSOLARISAfter(uint32_t isn)
446 OVERLAP_STEP(16,
"FFF", 3,
"AA\0\0\0\0\0\0\0\0\0\0\0\0\0FFF", 18);
447 OVERLAP_STEP(19,
"GG", 2,
"AA\0\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
448 OVERLAP_STEP(2,
"JJ", 2,
"AJJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
449 OVERLAP_STEP(20,
"O", 1,
"AJJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
450 OVERLAP_STEP(17,
"N", 1,
"AJJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
455 static int OverlapLAST(uint32_t isn)
464 OVERLAP_STEP(17,
"FFF", 3,
"\0AAA\0BBCCC\0D\0\0EEFFF", 19);
465 OVERLAP_STEP(20,
"GG", 2,
"\0AAA\0BBCCC\0D\0\0EEFFFGG", 21);
466 OVERLAP_STEP(22,
"HH", 2,
"\0AAA\0BBCCC\0D\0\0EEFFFGGHH", 23);
467 OVERLAP_STEP(24,
"I", 1,
"\0AAA\0BBCCC\0D\0\0EEFFFGGHHI", 24);
468 OVERLAP_STEP(3,
"JJJJ", 4,
"\0AJJJJBCCC\0D\0\0EEFFFGGHHI", 24);
469 OVERLAP_STEP(8,
"KKK", 3,
"\0AJJJJBKKK\0D\0\0EEFFFGGHHI", 24);
470 OVERLAP_STEP(11,
"LLL", 3,
"\0AJJJJBKKKLLL\0EEFFFGGHHI", 24);
471 OVERLAP_STEP(14,
"MMM", 3,
"\0AJJJJBKKKLLLMMMFFFGGHHI", 24);
472 OVERLAP_STEP(18,
"N", 1,
"\0AJJJJBKKKLLLMMMFNFGGHHI", 24);
473 OVERLAP_STEP(21,
"O", 1,
"\0AJJJJBKKKLLLMMMFNFGOHHI", 24);
474 OVERLAP_STEP(22,
"P", 1,
"\0AJJJJBKKKLLLMMMFNFGOPHI", 24);
475 OVERLAP_STEP(24,
"QQ", 2,
"\0AJJJJBKKKLLLMMMFNFGOPHQQ", 25);
476 OVERLAP_STEP(1,
"0", 1,
"0AJJJJBKKKLLLMMMFNFGOPHQQ", 25);
481 static int OverlapLASTBefore(uint32_t isn)
487 OVERLAP_STEP(12,
"EE", 2,
"\0\0B\0\0\0\0\0D\0\0EE", 13);
496 static int OverlapLASTSame(uint32_t isn)
501 OVERLAP_STEP(15,
"HH", 2,
"CCC\0\0\0\0\0\0\0\0\0\0\0HH", 16);
502 OVERLAP_STEP(17,
"II", 2,
"CCC\0\0\0\0\0\0\0\0\0\0\0HHII", 18);
503 OVERLAP_STEP(1,
"KKK", 3,
"KKK\0\0\0\0\0\0\0\0\0\0\0HHII", 18);
504 OVERLAP_STEP(1,
"LLLL", 4,
"LLLL\0\0\0\0\0\0\0\0\0\0HHII", 18);
505 OVERLAP_STEP(15,
"P", 1,
"LLLL\0\0\0\0\0\0\0\0\0\0PHII", 18);
506 OVERLAP_STEP(15,
"QQ", 2,
"LLLL\0\0\0\0\0\0\0\0\0\0QQII", 18);
511 static int OverlapLASTAfter(uint32_t isn)
516 OVERLAP_STEP(16,
"FFF", 3,
"AA\0\0\0\0\0\0\0\0\0\0\0\0\0FFF", 18);
517 OVERLAP_STEP(19,
"GG", 2,
"AA\0\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
518 OVERLAP_STEP(2,
"JJ", 2,
"AJJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGG", 20);
519 OVERLAP_STEP(20,
"O", 1,
"AJJ\0\0\0\0\0\0\0\0\0\0\0\0FFFGO", 20);
520 OVERLAP_STEP(17,
"N", 1,
"AJJ\0\0\0\0\0\0\0\0\0\0\0\0FNFGO", 20);
527 static int StreamTcpReassembleTest01(
void)
539 OverlapBSD(UINT_MAX);
540 OverlapBSDBefore(UINT_MAX);
541 OverlapBSDSame(UINT_MAX);
542 OverlapBSDAfter(UINT_MAX);
544 OverlapBSD(UINT_MAX - 10);
545 OverlapBSDBefore(UINT_MAX - 10);
546 OverlapBSDSame(UINT_MAX - 10);
547 OverlapBSDAfter(UINT_MAX - 10);
554 static int StreamTcpReassembleTest02(
void)
557 OverlapVISTABefore(0);
559 OverlapVISTAAfter(0);
562 OverlapVISTABefore(1);
564 OverlapVISTAAfter(1);
566 OverlapVISTA(UINT_MAX);
567 OverlapVISTABefore(UINT_MAX);
568 OverlapVISTASame(UINT_MAX);
569 OverlapVISTAAfter(UINT_MAX);
571 OverlapVISTA(UINT_MAX - 10);
572 OverlapVISTABefore(UINT_MAX - 10);
573 OverlapVISTASame(UINT_MAX - 10);
574 OverlapVISTAAfter(UINT_MAX - 10);
581 static int StreamTcpReassembleTest03(
void)
584 OverlapLINUXBefore(0);
586 OverlapLINUXAfter(0);
589 OverlapLINUXBefore(1);
591 OverlapLINUXAfter(1);
593 OverlapLINUX(UINT_MAX);
594 OverlapLINUXBefore(UINT_MAX);
595 OverlapLINUXSame(UINT_MAX);
596 OverlapLINUXAfter(UINT_MAX);
598 OverlapLINUX(UINT_MAX - 10);
599 OverlapLINUXBefore(UINT_MAX - 10);
600 OverlapLINUXSame(UINT_MAX - 10);
601 OverlapLINUXAfter(UINT_MAX - 10);
607 static int StreamTcpReassembleTest04(
void)
610 OverlapLINUXOLDBefore(0);
611 OverlapLINUXOLDSame(0);
612 OverlapLINUXOLDAfter(0);
615 OverlapLINUXOLDBefore(1);
616 OverlapLINUXOLDSame(1);
617 OverlapLINUXOLDAfter(1);
619 OverlapLINUXOLD(UINT_MAX);
620 OverlapLINUXOLDBefore(UINT_MAX);
621 OverlapLINUXOLDSame(UINT_MAX);
622 OverlapLINUXOLDAfter(UINT_MAX);
624 OverlapLINUXOLD(UINT_MAX - 10);
625 OverlapLINUXOLDBefore(UINT_MAX - 10);
626 OverlapLINUXOLDSame(UINT_MAX - 10);
627 OverlapLINUXOLDAfter(UINT_MAX - 10);
633 static int StreamTcpReassembleTest05(
void)
636 OverlapSOLARISBefore(0);
637 OverlapSOLARISSame(0);
638 OverlapSOLARISAfter(0);
641 OverlapSOLARISBefore(1);
642 OverlapSOLARISSame(1);
643 OverlapSOLARISAfter(1);
645 OverlapSOLARIS(UINT_MAX);
646 OverlapSOLARISBefore(UINT_MAX);
647 OverlapSOLARISSame(UINT_MAX);
648 OverlapSOLARISAfter(UINT_MAX);
650 OverlapSOLARIS(UINT_MAX - 10);
651 OverlapSOLARISBefore(UINT_MAX - 10);
652 OverlapSOLARISSame(UINT_MAX - 10);
653 OverlapSOLARISAfter(UINT_MAX - 10);
659 static int StreamTcpReassembleTest06(
void)
662 OverlapLASTBefore(0);
667 OverlapLASTBefore(1);
671 OverlapLAST(UINT_MAX);
672 OverlapLASTBefore(UINT_MAX);
673 OverlapLASTSame(UINT_MAX);
674 OverlapLASTAfter(UINT_MAX);
676 OverlapLAST(UINT_MAX - 10);
677 OverlapLASTBefore(UINT_MAX - 10);
678 OverlapLASTSame(UINT_MAX - 10);
679 OverlapLASTAfter(UINT_MAX - 10);
683 static int StreamTcpReassembleTest30 (
void)
691 static int StreamTcpReassembleTest31 (
void)
699 static int StreamTcpReassembleTest32(
void)
702 OVERLAP_STEP(11,
"AAAAAAAAAA", 10,
"\0\0\0\0\0\0\0\0\0\0AAAAAAAAAA", 20);
703 OVERLAP_STEP(21,
"BBBBBBBBBB", 10,
"\0\0\0\0\0\0\0\0\0\0AAAAAAAAAABBBBBBBBBB", 30);
704 OVERLAP_STEP(41,
"CCCCCCCCCC", 10,
"\0\0\0\0\0\0\0\0\0\0AAAAAAAAAABBBBBBBBBB\0\0\0\0\0\0\0\0\0\0CCCCCCCCCC", 50);
705 OVERLAP_STEP(6,
"aaaaaaaaaaaaaaaaaaaa", 20,
"\0\0\0\0\0aaaaaaaaaaaaaaaaaaaaBBBBB\0\0\0\0\0\0\0\0\0\0CCCCCCCCCC", 50);
706 OVERLAP_STEP(1,
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 50,
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 50);
713 StreamTcpReassembleTest01);
715 StreamTcpReassembleTest02);
717 StreamTcpReassembleTest03);
719 StreamTcpReassembleTest04);
721 StreamTcpReassembleTest05);
723 StreamTcpReassembleTest06);
726 StreamTcpReassembleTest30);
728 StreamTcpReassembleTest31);
730 StreamTcpReassembleTest32);