From: Victor Julien Date: Tue, 9 Dec 2014 13:26:35 +0000 (+0100) Subject: stream: update inline tests X-Git-Tag: suricata-2.1beta4~230 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=29d2483efb47108efb26728483e94ea502ac7f8c;p=thirdparty%2Fsuricata.git stream: update inline tests Make sure inline tests set the stream_inline flag. --- diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index 7d2db29b99..0ab3ce9602 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -7715,6 +7715,7 @@ static int StreamTcpReassembleInlineTest01(void) memset(&tv, 0x00, sizeof(tv)); StreamTcpUTInit(&ra_ctx); + StreamTcpUTInitInline(); StreamTcpUTSetupSession(&ssn); StreamTcpUTSetupStream(&ssn.client, 1); FLOW_INITIALIZE(&f); @@ -7793,6 +7794,7 @@ static int StreamTcpReassembleInlineTest02(void) memset(&tv, 0x00, sizeof(tv)); StreamTcpUTInit(&ra_ctx); + StreamTcpUTInitInline(); StreamTcpUTSetupSession(&ssn); StreamTcpUTSetupStream(&ssn.client, 1); FLOW_INITIALIZE(&f); @@ -7904,6 +7906,7 @@ static int StreamTcpReassembleInlineTest03(void) memset(&tv, 0x00, sizeof(tv)); StreamTcpUTInit(&ra_ctx); + StreamTcpUTInitInline(); StreamTcpUTSetupSession(&ssn); StreamTcpUTSetupStream(&ssn.client, 1); FLOW_INITIALIZE(&f); @@ -8020,6 +8023,7 @@ static int StreamTcpReassembleInlineTest04(void) memset(&tv, 0x00, sizeof(tv)); StreamTcpUTInit(&ra_ctx); + StreamTcpUTInitInline(); StreamTcpUTSetupSession(&ssn); StreamTcpUTSetupStream(&ssn.client, 1); FLOW_INITIALIZE(&f); @@ -8133,6 +8137,7 @@ static int StreamTcpReassembleInlineTest05(void) memset(&tv, 0x00, sizeof(tv)); StreamTcpUTInit(&ra_ctx); + StreamTcpUTInitInline(); StreamTcpUTSetupSession(&ssn); StreamTcpUTSetupStream(&ssn.client, 1); FLOW_INITIALIZE(&f); @@ -8227,6 +8232,7 @@ static int StreamTcpReassembleInlineTest06(void) memset(&tv, 0x00, sizeof(tv)); StreamTcpUTInit(&ra_ctx); + StreamTcpUTInitInline(); StreamTcpUTSetupSession(&ssn); StreamTcpUTSetupStream(&ssn.client, 1); FLOW_INITIALIZE(&f); @@ -8356,6 +8362,7 @@ static int StreamTcpReassembleInlineTest07(void) memset(&tv, 0x00, sizeof(tv)); StreamTcpUTInit(&ra_ctx); + StreamTcpUTInitInline(); StreamTcpUTSetupSession(&ssn); StreamTcpUTSetupStream(&ssn.client, 1); FLOW_INITIALIZE(&f); @@ -8491,6 +8498,7 @@ static int StreamTcpReassembleInlineTest08(void) memset(&tv, 0x00, sizeof(tv)); StreamTcpUTInit(&ra_ctx); + StreamTcpUTInitInline(); StreamTcpUTSetupSession(&ssn); StreamTcpUTSetupStream(&ssn.client, 1); FLOW_INITIALIZE(&f); @@ -8624,6 +8632,7 @@ static int StreamTcpReassembleInlineTest09(void) memset(&tv, 0x00, sizeof(tv)); StreamTcpUTInit(&ra_ctx); + StreamTcpUTInitInline(); StreamTcpUTSetupSession(&ssn); StreamTcpUTSetupStream(&ssn.client, 1); FLOW_INITIALIZE(&f); @@ -8771,6 +8780,7 @@ static int StreamTcpReassembleInlineTest10(void) memset(&tv, 0x00, sizeof(tv)); StreamTcpUTInit(&ra_ctx); + StreamTcpUTInitInline(); StreamTcpUTSetupSession(&ssn); StreamTcpUTSetupStream(&ssn.server, 1); diff --git a/src/stream-tcp-util.c b/src/stream-tcp-util.c index 83cccf4ae2..405684fd94 100644 --- a/src/stream-tcp-util.c +++ b/src/stream-tcp-util.c @@ -40,6 +40,8 @@ /* unittest helper functions */ +extern int stream_inline; + void StreamTcpUTInit(TcpReassemblyThreadCtx **ra_ctx) { StreamTcpInitConfig(TRUE); @@ -50,6 +52,11 @@ void StreamTcpUTDeinit(TcpReassemblyThreadCtx *ra_ctx) { StreamTcpReassembleFreeThreadCtx(ra_ctx); StreamTcpFreeConfig(TRUE); + stream_inline = 0; +} + +void StreamTcpUTInitInline(void) { + stream_inline = 1; } void StreamTcpUTSetupSession(TcpSession *ssn) diff --git a/src/stream-tcp-util.h b/src/stream-tcp-util.h index 32dec5c79d..72f2b4fcb9 100644 --- a/src/stream-tcp-util.h +++ b/src/stream-tcp-util.h @@ -29,6 +29,8 @@ void StreamTcpUTInit(TcpReassemblyThreadCtx **); void StreamTcpUTDeinit(TcpReassemblyThreadCtx *); +void StreamTcpUTInitInline(void); + void StreamTcpUTSetupSession(TcpSession *); void StreamTcpUTClearSession(TcpSession *);