general: Cleanup bool usage

pull/6086/head
Jeff Lucovsky 6 years ago committed by Victor Julien
parent 6fe8bce3b0
commit 1eeb96696b

@ -51,7 +51,7 @@ try:
try:
from docker import Client
except ImportError:
GOT_DOCKER = FALSE
GOT_DOCKER = False
except ImportError:
GOT_DOCKER = False

@ -3405,7 +3405,7 @@ static int AppLayerProtoDetectTest16(void)
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -3457,7 +3457,7 @@ static int AppLayerProtoDetectTest16(void)
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
UTHFreeFlow(f);
@ -3499,7 +3499,7 @@ static int AppLayerProtoDetectTest17(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -3553,7 +3553,7 @@ static int AppLayerProtoDetectTest17(void)
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
UTHFreeFlow(f);
@ -3595,7 +3595,7 @@ static int AppLayerProtoDetectTest18(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -3648,7 +3648,7 @@ static int AppLayerProtoDetectTest18(void)
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
UTHFreeFlow(f);
@ -3687,7 +3687,7 @@ static int AppLayerProtoDetectTest19(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f->alproto = ALPROTO_FTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -3735,7 +3735,7 @@ static int AppLayerProtoDetectTest19(void)
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
UTHFreeFlow(f);
return result;

@ -2133,7 +2133,7 @@ static int DNP3ParserTestRequestResponse(void)
flow.proto = IPPROTO_TCP;
flow.alproto = ALPROTO_DNP3;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCMutexLock(&flow.m);
FAIL_IF(AppLayerParserParse(NULL, alp_tctx, &flow, ALPROTO_DNP3,
@ -2160,7 +2160,7 @@ static int DNP3ParserTestRequestResponse(void)
FAIL_IF(tx->response_buffer == NULL);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&flow);
PASS;
}
@ -2200,7 +2200,7 @@ static int DNP3ParserTestUnsolicitedResponseConfirm(void)
flow.proto = IPPROTO_TCP;
flow.alproto = ALPROTO_DNP3;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCMutexLock(&flow.m);
FAIL_IF(AppLayerParserParse(NULL, alp_tctx, &flow, ALPROTO_DNP3,
@ -2229,7 +2229,7 @@ static int DNP3ParserTestUnsolicitedResponseConfirm(void)
/* FAIL_IF(tx->iin1 != 0 || tx->iin2 != 0); */
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&flow);
PASS;
}
@ -2266,7 +2266,7 @@ static int DNP3ParserTestFlooded(void)
flow.proto = IPPROTO_TCP;
flow.alproto = ALPROTO_DNP3;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCMutexLock(&flow.m);
FAIL_IF(AppLayerParserParse(NULL, alp_tctx, &flow, ALPROTO_DNP3,
@ -2308,7 +2308,7 @@ static int DNP3ParserTestFlooded(void)
FAIL_IF(DNP3GetAlstateProgress(state->curr, 0));
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&flow);
PASS;
}
@ -2371,7 +2371,7 @@ static int DNP3ParserTestPartialFrame(void)
flow.protoctx = (void *)&ssn;
flow.proto = IPPROTO_TCP;
flow.alproto = ALPROTO_DNP3;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
/* Pass in the first partial frame. */
@ -2441,7 +2441,7 @@ static int DNP3ParserTestPartialFrame(void)
FAIL_IF(tx->response_buffer_len == 0);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&flow);
PASS;
}
@ -2484,7 +2484,7 @@ static int DNP3ParserTestMultiFrame(void)
flow.protoctx = (void *)&ssn;
flow.proto = IPPROTO_TCP;
flow.alproto = ALPROTO_DNP3;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCMutexLock(&flow.m);
r = AppLayerParserParse(NULL, alp_tctx, &flow, ALPROTO_DNP3,
@ -2497,7 +2497,7 @@ static int DNP3ParserTestMultiFrame(void)
FAIL_IF(state->transaction_max != 2);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&flow);
PASS;
}
@ -2647,7 +2647,7 @@ static int DNP3ParserIncorrectUserData(void)
flow.protoctx = (void *)&ssn;
flow.proto = IPPROTO_TCP;
flow.alproto = ALPROTO_DNP3;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &flow, ALPROTO_DNP3,
STREAM_TOCLIENT, packet_bytes, sizeof(packet_bytes));
@ -2655,7 +2655,7 @@ static int DNP3ParserIncorrectUserData(void)
FAIL_IF(r == 0);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&flow);
PASS;
}

@ -617,7 +617,7 @@ static int ALDecodeENIPTest(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_ENIP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_ENIP, STREAM_TOSERVER,
listIdentity, sizeof(listIdentity));
@ -632,7 +632,7 @@ static int ALDecodeENIPTest(void)
FAIL_IF(tx->header.command != 99);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;

@ -1447,7 +1447,7 @@ static int FTPParserTest01(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_FTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_FTP,
STREAM_TOSERVER | STREAM_EOF, ftpbuf, ftplen);
@ -1458,7 +1458,7 @@ static int FTPParserTest01(void)
FAIL_IF(ftp_state->command != FTP_COMMAND_PORT);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
@ -1482,7 +1482,7 @@ static int FTPParserTest03(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_FTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_FTP,
STREAM_TOSERVER | STREAM_START, ftpbuf1,
@ -1503,7 +1503,7 @@ static int FTPParserTest03(void)
FAIL_IF(ftp_state->command != FTP_COMMAND_PORT);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
@ -1523,7 +1523,7 @@ static int FTPParserTest06(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_FTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_FTP,
STREAM_TOSERVER | STREAM_START | STREAM_EOF,
@ -1537,7 +1537,7 @@ static int FTPParserTest06(void)
FAIL_IF(ftp_state->command != FTP_COMMAND_UNKNOWN);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
@ -1559,7 +1559,7 @@ static int FTPParserTest07(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_FTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_FTP,
STREAM_TOSERVER | STREAM_START, ftpbuf1,
@ -1576,7 +1576,7 @@ static int FTPParserTest07(void)
FAIL_IF(ftp_state->command != FTP_COMMAND_PORT);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
@ -1597,7 +1597,7 @@ static int FTPParserTest10(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_FTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < ftplen1; u++) {
@ -1618,7 +1618,7 @@ static int FTPParserTest10(void)
FAIL_IF(ftp_state->command != FTP_COMMAND_PORT);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
@ -1640,7 +1640,7 @@ static int FTPParserTest11(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_FTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_FTP,
STREAM_TOSERVER | STREAM_START, ftpbuf1,
@ -1665,7 +1665,7 @@ static int FTPParserTest11(void)
FAIL_IF(ftp_state->command != FTP_COMMAND_RETR);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
@ -1687,7 +1687,7 @@ static int FTPParserTest12(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_FTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_FTP,
STREAM_TOSERVER | STREAM_START, ftpbuf1,
@ -1712,7 +1712,7 @@ static int FTPParserTest12(void)
FAIL_IF(ftp_state->command != FTP_COMMAND_STOR);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
#endif /* UNITTESTS */

@ -384,7 +384,7 @@ static int HTPFileParserTest01(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCLogDebug("\n>>>> processing chunk 1 <<<<\n");
int r = AppLayerParserParse(
@ -406,7 +406,7 @@ static int HTPFileParserTest01(void)
FAIL_IF(memcmp(bstr_util_strdup_to_c(tx->request_method), "POST", 4) != 0);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -448,7 +448,7 @@ static int HTPFileParserTest02(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCLogDebug("\n>>>> processing chunk 1 <<<<\n");
int r = AppLayerParserParse(
@ -482,7 +482,7 @@ static int HTPFileParserTest02(void)
FAIL_IF(http_state->files_ts->tail->state != FILE_STATE_CLOSED);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -529,7 +529,7 @@ static int HTPFileParserTest03(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCLogDebug("\n>>>> processing chunk 1 <<<<\n");
int r = AppLayerParserParse(
@ -577,7 +577,7 @@ static int HTPFileParserTest03(void)
FAIL_IF(FileDataSize(http_state->files_ts->head) != 11);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -624,7 +624,7 @@ static int HTPFileParserTest04(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCLogDebug("\n>>>> processing chunk 1 <<<<\n");
int r = AppLayerParserParse(
@ -671,7 +671,7 @@ static int HTPFileParserTest04(void)
FAIL_IF(http_state->files_ts->tail->state != FILE_STATE_CLOSED);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -709,7 +709,7 @@ static int HTPFileParserTest05(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCLogDebug("\n>>>> processing chunk 1 size %u <<<<\n", httplen1);
int r = AppLayerParserParse(
@ -744,7 +744,7 @@ static int HTPFileParserTest05(void)
FAIL_IF(StreamingBufferCompareRawData(http_state->files_ts->tail->sb,
(uint8_t *)"FILECONTENT", 11) != 1);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -783,7 +783,7 @@ static int HTPFileParserTest06(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCLogDebug("\n>>>> processing chunk 1 size %u <<<<\n", httplen1);
int r = AppLayerParserParse(
@ -819,7 +819,7 @@ static int HTPFileParserTest06(void)
(uint8_t *)"FILECONTENT", 11) != 1);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -847,7 +847,7 @@ static int HTPFileParserTest07(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCLogDebug("\n>>>> processing chunk 1 size %u <<<<\n", httplen1);
int r = AppLayerParserParse(
@ -875,7 +875,7 @@ static int HTPFileParserTest07(void)
(uint8_t *)"FILECONTENT", 11) != 1);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -907,7 +907,7 @@ static int HTPFileParserTest08(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCLogDebug("\n>>>> processing chunk 1 <<<<\n");
int r = AppLayerParserParse(
@ -932,7 +932,7 @@ static int HTPFileParserTest08(void)
FAIL_IF(decoder_events->cnt != 2);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -975,7 +975,7 @@ static int HTPFileParserTest09(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCLogDebug("\n>>>> processing chunk 1 <<<<\n");
int r = AppLayerParserParse(
@ -1010,7 +1010,7 @@ static int HTPFileParserTest09(void)
FAIL_IF(decoder_events->cnt != 1);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -1051,7 +1051,7 @@ static int HTPFileParserTest10(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCLogDebug("\n>>>> processing chunk 1 <<<<\n");
int r = AppLayerParserParse(
@ -1083,7 +1083,7 @@ static int HTPFileParserTest10(void)
FAIL_IF_NOT_NULL(decoder_events);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -1152,7 +1152,7 @@ static int HTPFileParserTest11(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCLogDebug("\n>>>> processing chunk 1 <<<<\n");
int r = AppLayerParserParse(
@ -1196,7 +1196,7 @@ static int HTPFileParserTest11(void)
(uint8_t *)"FILECONTENT", 11) != 1);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}

@ -3216,7 +3216,7 @@ static int HTPParserTest01(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -3247,7 +3247,7 @@ static int HTPParserTest01(void)
FAIL_IF(tx->request_protocol_number != HTP_PROTOCOL_1_0);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -3271,7 +3271,7 @@ static int HTPParserTest01b(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint8_t flags =STREAM_TOSERVER|STREAM_START|STREAM_EOF;
int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, httpbuf1, httplen1);
@ -3291,7 +3291,7 @@ static int HTPParserTest01b(void)
FAIL_IF(tx->request_protocol_number != HTP_PROTOCOL_1_0);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -3315,7 +3315,7 @@ static int HTPParserTest01c(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -3346,7 +3346,7 @@ static int HTPParserTest01c(void)
FAIL_IF(tx->request_protocol_number != HTP_PROTOCOL_1_0);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -3374,7 +3374,7 @@ static int HTPParserTest01a(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -3421,7 +3421,7 @@ static int HTPParserTest01a(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -3446,7 +3446,7 @@ static int HTPParserTest02(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(f);
int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1,
@ -3480,7 +3480,7 @@ static int HTPParserTest02(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -3507,7 +3507,7 @@ static int HTPParserTest03(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -3548,7 +3548,7 @@ static int HTPParserTest03(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -3575,7 +3575,7 @@ static int HTPParserTest04(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(f);
r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1,
@ -3606,7 +3606,7 @@ static int HTPParserTest04(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -3641,7 +3641,7 @@ static int HTPParserTest05(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(
NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1);
@ -3679,7 +3679,7 @@ static int HTPParserTest05(void)
FAIL_IF_NOT(tx->response_status_number == 200);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -3743,7 +3743,7 @@ static int HTPParserTest06(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(
NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1);
@ -3768,7 +3768,7 @@ static int HTPParserTest06(void)
FAIL_IF_NULL(h);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -3795,7 +3795,7 @@ static int HTPParserTest07(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -3856,7 +3856,7 @@ static int HTPParserTest07(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -3901,7 +3901,7 @@ libhtp:\n\
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint8_t flags = 0;
flags = STREAM_TOSERVER|STREAM_START|STREAM_EOF;
@ -3938,7 +3938,7 @@ libhtp:\n\
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
HTPFreeConfig();
ConfDeInit();
ConfRestoreContextBackup();
@ -3986,7 +3986,7 @@ libhtp:\n\
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint8_t flags = 0;
flags = STREAM_TOSERVER|STREAM_START|STREAM_EOF;
@ -4021,7 +4021,7 @@ libhtp:\n\
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
HTPFreeConfig();
ConfDeInit();
ConfRestoreContextBackup();
@ -4052,7 +4052,7 @@ static int HTPParserTest10(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -4116,7 +4116,7 @@ static int HTPParserTest10(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -4143,7 +4143,7 @@ static int HTPParserTest11(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -4200,7 +4200,7 @@ static int HTPParserTest11(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -4227,7 +4227,7 @@ static int HTPParserTest12(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -4287,7 +4287,7 @@ static int HTPParserTest12(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -4314,7 +4314,7 @@ static int HTPParserTest13(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -4380,7 +4380,7 @@ static int HTPParserTest13(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -4727,7 +4727,7 @@ libhtp:\n\
goto end;
}
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -4786,7 +4786,7 @@ end:
ConfRestoreContextBackup();
HtpConfigRestoreBackup();
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -4909,7 +4909,7 @@ libhtp:\n\
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -5026,7 +5026,7 @@ end:
ConfRestoreContextBackup();
HtpConfigRestoreBackup();
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -5077,7 +5077,7 @@ libhtp:\n\
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -5194,7 +5194,7 @@ end:
ConfRestoreContextBackup();
HtpConfigRestoreBackup();
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -5243,7 +5243,7 @@ libhtp:\n\
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -5334,7 +5334,7 @@ end:
ConfRestoreContextBackup();
HtpConfigRestoreBackup();
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -5379,7 +5379,7 @@ libhtp:\n\
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -5443,7 +5443,7 @@ end:
ConfRestoreContextBackup();
HtpConfigRestoreBackup();
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -5488,7 +5488,7 @@ libhtp:\n\
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -5552,7 +5552,7 @@ end:
ConfRestoreContextBackup();
HtpConfigRestoreBackup();
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -5597,7 +5597,7 @@ libhtp:\n\
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -5661,7 +5661,7 @@ end:
ConfRestoreContextBackup();
HtpConfigRestoreBackup();
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -5707,7 +5707,7 @@ libhtp:\n\
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -5771,7 +5771,7 @@ end:
ConfRestoreContextBackup();
HtpConfigRestoreBackup();
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -5814,7 +5814,7 @@ libhtp:\n\
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -5878,7 +5878,7 @@ end:
ConfRestoreContextBackup();
HtpConfigRestoreBackup();
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -5922,7 +5922,7 @@ libhtp:\n\
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < httplen1; u++) {
@ -5986,7 +5986,7 @@ end:
ConfRestoreContextBackup();
HtpConfigRestoreBackup();
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -6083,7 +6083,7 @@ libhtp:\n\
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SCLogDebug("\n>>>> processing chunk 1 <<<<\n");
FLOWLOCK_WRLOCK(f);
@ -6127,7 +6127,7 @@ end:
ConfDeInit();
ConfRestoreContextBackup();
HtpConfigRestoreBackup();
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -6188,7 +6188,7 @@ libhtp:\n\
f->alproto = ALPROTO_HTTP1;
f->proto = IPPROTO_TCP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < len; u++) {
@ -6217,7 +6217,7 @@ libhtp:\n\
FAIL_IF(decoder_events->events[0] != HTTP_DECODER_EVENT_REQUEST_FIELD_TOO_LONG);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
SCFree(httpbuf);
HTPFreeConfig();
@ -6291,7 +6291,7 @@ libhtp:\n\
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t u;
for (u = 0; u < len; u++) {
@ -6341,7 +6341,7 @@ libhtp:\n\
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
if (httpbuf != NULL)
SCFree(httpbuf);
@ -6381,7 +6381,7 @@ static int HTPParserTest16(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint8_t flags = STREAM_TOSERVER|STREAM_START|STREAM_EOF;
@ -6437,7 +6437,7 @@ static int HTPParserTest16(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
return result;
}
@ -6468,7 +6468,7 @@ static int HTPParserTest20(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(
NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1);
@ -6496,7 +6496,7 @@ static int HTPParserTest20(void)
FAIL_IF(tx->response_protocol_number != -1);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -6527,7 +6527,7 @@ static int HTPParserTest21(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(
NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1);
@ -6555,7 +6555,7 @@ static int HTPParserTest21(void)
FAIL_IF(tx->response_protocol_number != -1);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -6585,7 +6585,7 @@ static int HTPParserTest22(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(
NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1);
@ -6609,7 +6609,7 @@ static int HTPParserTest22(void)
FAIL_IF(tx->response_protocol_number != -1);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -6639,7 +6639,7 @@ static int HTPParserTest23(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(
NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1);
@ -6663,7 +6663,7 @@ static int HTPParserTest23(void)
FAIL_IF(tx->response_protocol_number != -2);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -6693,7 +6693,7 @@ static int HTPParserTest24(void)
f->proto = IPPROTO_TCP;
f->alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(
NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1);
@ -6717,7 +6717,7 @@ static int HTPParserTest24(void)
FAIL_IF(tx->response_protocol_number != HTP_PROTOCOL_1_0);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -6728,7 +6728,7 @@ static int HTPParserTest25(void)
AppLayerParserThreadCtx *alp_tctx = AppLayerParserThreadCtxAlloc();
FAIL_IF_NULL(alp_tctx);
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
TcpSession ssn;
memset(&ssn, 0, sizeof(ssn));
@ -6825,7 +6825,7 @@ static int HTPParserTest25(void)
FAIL_IF_NULL(http_state);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
@ -6892,7 +6892,7 @@ libhtp:\n\
p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -6951,7 +6951,7 @@ libhtp:\n\
AppLayerParserThreadCtxFree(alp_tctx);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
HTPFreeConfig();
FLOW_DESTROY(&f);

@ -66,7 +66,7 @@ static int IkeParserTest(void)
f.protomap = FlowGetProtoMapping(f.proto);
f.alproto = ALPROTO_IKE;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
static const unsigned char initiator_sa[] = { 0xe4, 0x7a, 0x59, 0x1f, 0xd0, 0x57, 0x58, 0x7f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x02, 0x00, 0x00, 0x00, 0x00,
@ -176,7 +176,7 @@ static int IkeParserTest(void)
if (alp_tctx != NULL) {
AppLayerParserThreadCtxFree(alp_tctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
}

@ -1143,7 +1143,8 @@ static void ModbusParseResponsePDU(ModbusTransaction *tx,
{
SCEnter();
uint16_t offset = (uint16_t) sizeof(ModbusHeader);
uint8_t count = 0, error = FALSE, function = 0, mei = 0;
uint8_t count = 0, function = 0, mei = 0;
uint8_t error = false;
/* Standard function codes used on MODBUS application layer protocol (1 byte) */
if (ModbusExtractUint8(modbus, &function, input, input_len, &offset))
@ -1152,7 +1153,7 @@ static void ModbusParseResponsePDU(ModbusTransaction *tx,
/* Check if response is error */
if(function & MODBUS_FUNC_ERRORMASK) {
function &= MODBUS_FUNC_MASK;
error = TRUE;
error = true;
}
if (tx->category == MODBUS_CAT_PUBLIC_ASSIGNED) {
@ -1755,7 +1756,7 @@ static int ModbusParserTest01(void) {
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_MODBUS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_MODBUS,
@ -1782,7 +1783,7 @@ static int ModbusParserTest01(void) {
FAIL_IF_NOT(modbus_state->transaction_max == 1);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
}
@ -1803,7 +1804,7 @@ static int ModbusParserTest02(void) {
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_MODBUS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_MODBUS,
@ -1834,7 +1835,7 @@ static int ModbusParserTest02(void) {
FAIL_IF_NOT(modbus_state->transaction_max == 1);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
}
@ -1868,7 +1869,7 @@ static int ModbusParserTest03(void) {
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -1928,7 +1929,7 @@ static int ModbusParserTest03(void) {
DetectEngineCtxFree(de_ctx);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;
@ -1950,7 +1951,7 @@ static int ModbusParserTest04(void) {
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_MODBUS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_MODBUS,
@ -1968,7 +1969,7 @@ static int ModbusParserTest04(void) {
FAIL_IF_NOT(tx->subFunction == 4);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
}
@ -2002,7 +2003,7 @@ static int ModbusParserTest05(void) {
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -2040,7 +2041,7 @@ static int ModbusParserTest05(void) {
DetectEngineCtxFree(de_ctx);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;
@ -2075,7 +2076,7 @@ static int ModbusParserTest06(void) {
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -2113,7 +2114,7 @@ static int ModbusParserTest06(void) {
DetectEngineCtxFree(de_ctx);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;
@ -2148,7 +2149,7 @@ static int ModbusParserTest07(void) {
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -2187,7 +2188,7 @@ static int ModbusParserTest07(void) {
DetectEngineCtxFree(de_ctx);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;
@ -2222,7 +2223,7 @@ static int ModbusParserTest08(void) {
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -2275,7 +2276,7 @@ static int ModbusParserTest08(void) {
DetectEngineCtxFree(de_ctx);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;
@ -2300,7 +2301,7 @@ static int ModbusParserTest09(void) {
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_MODBUS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_MODBUS,
@ -2338,7 +2339,7 @@ static int ModbusParserTest09(void) {
FAIL_IF_NOT(modbus_state->transaction_max ==1);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
}
@ -2368,7 +2369,7 @@ static int ModbusParserTest10(void) {
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_MODBUS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_MODBUS,
@ -2407,7 +2408,7 @@ static int ModbusParserTest10(void) {
SCFree(input);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
}
@ -2441,7 +2442,7 @@ static int ModbusParserTest11(void) {
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -2480,7 +2481,7 @@ static int ModbusParserTest11(void) {
DetectEngineCtxFree(de_ctx);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;
@ -2515,7 +2516,7 @@ static int ModbusParserTest12(void) {
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -2554,7 +2555,7 @@ static int ModbusParserTest12(void) {
DetectEngineCtxFree(de_ctx);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;
@ -2576,7 +2577,7 @@ static int ModbusParserTest13(void) {
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_MODBUS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_MODBUS,
@ -2604,7 +2605,7 @@ static int ModbusParserTest13(void) {
FAIL_IF_NOT(modbus_state->transaction_max == 1);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
}
@ -2625,7 +2626,7 @@ static int ModbusParserTest14(void) {
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_MODBUS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_MODBUS,
@ -2653,7 +2654,7 @@ static int ModbusParserTest14(void) {
FAIL_IF_NOT(modbus_state->transaction_max == 1);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
}
@ -2687,7 +2688,7 @@ static int ModbusParserTest15(void) {
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -2738,7 +2739,7 @@ static int ModbusParserTest15(void) {
DetectEngineCtxFree(de_ctx);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;
@ -2773,7 +2774,7 @@ static int ModbusParserTest16(void) {
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -2826,7 +2827,7 @@ static int ModbusParserTest16(void) {
DetectEngineCtxFree(de_ctx);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;}
@ -2847,7 +2848,7 @@ static int ModbusParserTest17(void) {
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_MODBUS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_MODBUS, STREAM_TOSERVER,
@ -2868,7 +2869,7 @@ static int ModbusParserTest17(void) {
FAIL_IF(((TcpSession *)(f.protoctx))->reassembly_depth != MODBUS_CONFIG_DEFAULT_STREAM_DEPTH);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
}
@ -2892,7 +2893,7 @@ static int ModbusParserTest18(void) {
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_MODBUS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_MODBUS, STREAM_TOSERVER,
@ -2933,7 +2934,7 @@ static int ModbusParserTest18(void) {
FAIL_IF(((TcpSession *)(f.protoctx))->reassembly_depth != MODBUS_CONFIG_DEFAULT_STREAM_DEPTH);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
}
@ -2967,7 +2968,7 @@ static int ModbusParserTest19(void) {
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -3006,7 +3007,7 @@ static int ModbusParserTest19(void) {
DetectEngineCtxFree(de_ctx);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;

@ -1791,7 +1791,7 @@ static int AppLayerParserTest01(void)
f->alproto = ALPROTO_TEST;
f->proto = IPPROTO_TCP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_TEST,
STREAM_TOSERVER | STREAM_EOF, testbuf,
@ -1801,7 +1801,7 @@ static int AppLayerParserTest01(void)
FAIL_IF(!(ssn.flags & STREAMTCP_FLAG_APP_LAYER_DISABLED));
AppLayerParserRestoreParserTable();
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}
@ -1834,7 +1834,7 @@ static int AppLayerParserTest02(void)
f->proto = IPPROTO_UDP;
f->protomap = FlowGetProtoMapping(f->proto);
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_TEST,
STREAM_TOSERVER | STREAM_EOF, testbuf,
@ -1842,7 +1842,7 @@ static int AppLayerParserTest02(void)
FAIL_IF(r != -1);
AppLayerParserRestoreParserTable();
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;
}

@ -74,7 +74,7 @@ static int RFBParserTest(void)
AppLayerParserThreadCtx *alp_tctx = AppLayerParserThreadCtxAlloc();
FAIL_IF_NULL(alp_tctx);
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
TcpSession ssn;
memset(&ssn, 0, sizeof(ssn));
@ -141,7 +141,7 @@ static int RFBParserTest(void)
AppLayerParserTransactionsCleanup(f);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;

@ -337,7 +337,7 @@ static int SMBParserTxCleanupTest(void)
AppLayerParserThreadCtx *alp_tctx = AppLayerParserThreadCtxAlloc();
FAIL_IF_NULL(alp_tctx);
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
TcpSession ssn;
memset(&ssn, 0, sizeof(ssn));
@ -480,7 +480,7 @@ static int SMBParserTxCleanupTest(void)
FAIL_IF_NOT(ret[3] == 9); // min_id
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreeFlow(f);
PASS;

@ -1931,7 +1931,7 @@ static int SMTPParserTest01(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SMTPTestInitConfig();
FLOWLOCK_WRLOCK(&f);
@ -2035,7 +2035,7 @@ static int SMTPParserTest01(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -2286,7 +2286,7 @@ static int SMTPParserTest02(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SMTPTestInitConfig();
FLOWLOCK_WRLOCK(&f);
@ -2819,7 +2819,7 @@ static int SMTPParserTest02(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -2925,7 +2925,7 @@ static int SMTPParserTest03(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SMTPTestInitConfig();
FLOWLOCK_WRLOCK(&f);
@ -3031,7 +3031,7 @@ static int SMTPParserTest03(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -3078,7 +3078,7 @@ static int SMTPParserTest04(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SMTPTestInitConfig();
FLOWLOCK_WRLOCK(&f);
@ -3125,7 +3125,7 @@ static int SMTPParserTest04(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -3227,7 +3227,7 @@ static int SMTPParserTest05(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SMTPTestInitConfig();
FLOWLOCK_WRLOCK(&f);
@ -3373,7 +3373,7 @@ static int SMTPParserTest05(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -3528,7 +3528,7 @@ static int SMTPParserTest06(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SMTPTestInitConfig();
FLOWLOCK_WRLOCK(&f);
@ -3722,7 +3722,7 @@ static int SMTPParserTest06(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -3768,7 +3768,7 @@ static int SMTPParserTest07(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SMTPTestInitConfig();
FLOWLOCK_WRLOCK(&f);
@ -3837,7 +3837,7 @@ static int SMTPParserTest07(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -3883,7 +3883,7 @@ static int SMTPParserTest08(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SMTPTestInitConfig();
FLOWLOCK_WRLOCK(&f);
@ -3952,7 +3952,7 @@ static int SMTPParserTest08(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -3998,7 +3998,7 @@ static int SMTPParserTest09(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SMTPTestInitConfig();
FLOWLOCK_WRLOCK(&f);
@ -4067,7 +4067,7 @@ static int SMTPParserTest09(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -4113,7 +4113,7 @@ static int SMTPParserTest10(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SMTPTestInitConfig();
FLOWLOCK_WRLOCK(&f);
@ -4182,7 +4182,7 @@ static int SMTPParserTest10(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -4222,7 +4222,7 @@ static int SMTPParserTest11(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SMTPTestInitConfig();
FLOWLOCK_WRLOCK(&f);
@ -4272,7 +4272,7 @@ static int SMTPParserTest11(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -4322,7 +4322,7 @@ static int SMTPParserTest12(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SMTPTestInitConfig();
de_ctx = DetectEngineCtxInit();
@ -4396,7 +4396,7 @@ end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
return result;
@ -4465,7 +4465,7 @@ static int SMTPParserTest13(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SMTPTestInitConfig();
de_ctx = DetectEngineCtxInit();
@ -4557,7 +4557,7 @@ end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
return result;
@ -4744,7 +4744,7 @@ static int SMTPParserTest14(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
SMTPTestInitConfig();
FLOWLOCK_WRLOCK(&f);
@ -5083,7 +5083,7 @@ static int SMTPParserTest14(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}

@ -54,7 +54,7 @@
#include "util-memcmp.h"
/* HASSH fingerprints are disabled by default */
#define SSH_CONFIG_DEFAULT_HASSH FALSE
#define SSH_CONFIG_DEFAULT_HASSH false
static int SSHRegisterPatternsForProtocolDetection(void)
{
@ -177,7 +177,7 @@ static int SSHParserTest01(void)
f.protoctx = (void *)&ssn;
f.alproto = ALPROTO_SSH;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_SSH,
STREAM_TOSERVER | STREAM_EOF, sshbuf, sshlen);
@ -205,7 +205,7 @@ static int SSHParserTest01(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -228,7 +228,7 @@ static int SSHParserTest02(void)
f.protoctx = (void *)&ssn;
f.alproto = ALPROTO_SSH;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_SSH,
STREAM_TOSERVER | STREAM_EOF, sshbuf, sshlen);
@ -255,7 +255,7 @@ static int SSHParserTest02(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -278,7 +278,7 @@ static int SSHParserTest03(void)
f.protoctx = (void *)&ssn;
f.alproto = ALPROTO_SSH;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_SSH,
STREAM_TOSERVER | STREAM_EOF, sshbuf, sshlen);
@ -309,7 +309,7 @@ static int SSHParserTest03(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -330,7 +330,7 @@ static int SSHParserTest04(void)
f.protoctx = (void *)&ssn;
f.alproto = ALPROTO_SSH;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_SSH,
STREAM_TOCLIENT | STREAM_EOF, sshbuf, sshlen);
@ -358,7 +358,7 @@ static int SSHParserTest04(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -380,7 +380,7 @@ static int SSHParserTest05(void)
f.protoctx = (void *)&ssn;
f.alproto = ALPROTO_SSH;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_SSH,
STREAM_TOCLIENT | STREAM_EOF, sshbuf, sshlen);
@ -407,7 +407,7 @@ static int SSHParserTest05(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -429,7 +429,7 @@ static int SSHParserTest06(void)
f.protoctx = (void *)&ssn;
f.alproto = ALPROTO_SSH;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_SSH,
STREAM_TOCLIENT | STREAM_EOF, sshbuf, sshlen);
@ -462,7 +462,7 @@ static int SSHParserTest06(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -689,7 +689,7 @@ static int SSHParserTest11(void)
f.protoctx = (void *)&ssn;
f.alproto = ALPROTO_SSH;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_SSH,
STREAM_TOSERVER, sshbuf1, sshlen1);
@ -721,7 +721,7 @@ static int SSHParserTest11(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -746,7 +746,7 @@ static int SSHParserTest12(void)
f.protoctx = (void *)&ssn;
f.alproto = ALPROTO_SSH;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_SSH,
STREAM_TOSERVER, sshbuf1, sshlen1);
@ -784,7 +784,7 @@ static int SSHParserTest12(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -1456,7 +1456,7 @@ static int SSHParserTest23(void)
f.protoctx = (void *)&ssn;
f.alproto = ALPROTO_SSH;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_SSH,
STREAM_TOSERVER | STREAM_EOF, sshbuf, sshlen);
@ -1469,7 +1469,7 @@ static int SSHParserTest23(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -1490,7 +1490,7 @@ static int SSHParserTest24(void)
f.protoctx = (void *)&ssn;
f.alproto = ALPROTO_SSH;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_SSH,
STREAM_TOSERVER | STREAM_EOF, sshbuf, sshlen);
@ -1516,7 +1516,7 @@ static int SSHParserTest24(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -1537,7 +1537,7 @@ static int SSHParserTest25(void)
f.protoctx = (void *)&ssn;
f.alproto = ALPROTO_SSH;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_SSH,
STREAM_TOSERVER | STREAM_EOF, sshbuf, sshlen);
@ -1552,7 +1552,7 @@ static int SSHParserTest25(void)
FAIL_IF (rs_ssh_tx_get_software(tx, &dummy, &dummy_len, STREAM_TOCLIENT) != 0);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
}

@ -3092,7 +3092,7 @@ static int SSLParserTest01(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -3108,7 +3108,7 @@ static int SSLParserTest01(void)
FAIL_IF(ssl_state->client_connp.version != TLS_VERSION_10);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -3132,7 +3132,7 @@ static int SSLParserTest02(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -3154,7 +3154,7 @@ static int SSLParserTest02(void)
FAIL_IF(ssl_state->client_connp.version != TLS_VERSION_10);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -3180,7 +3180,7 @@ static int SSLParserTest03(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -3208,7 +3208,7 @@ static int SSLParserTest03(void)
FAIL_IF(ssl_state->client_connp.version != TLS_VERSION_10);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -3236,7 +3236,7 @@ static int SSLParserTest04(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -3270,7 +3270,7 @@ static int SSLParserTest04(void)
FAIL_IF(ssl_state->client_connp.version != TLS_VERSION_10);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -3295,7 +3295,7 @@ static int SSLParserTest05(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(alp_tctx, &f, ALPROTO_TLS, STREAM_TOSERVER, tlsbuf, tlslen);
if (r != 0) {
@ -3381,7 +3381,7 @@ static int SSLParserTest05(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -3407,7 +3407,7 @@ static int SSLParserTest06(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(alp_tctx, &f, ALPROTO_TLS, STREAM_TOSERVER, tlsbuf, tlslen);
if (r != 0) {
@ -3509,7 +3509,7 @@ static int SSLParserTest06(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -3558,7 +3558,7 @@ static int SSLParserMultimsgTest01(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -3574,7 +3574,7 @@ static int SSLParserMultimsgTest01(void)
FAIL_IF(ssl_state->client_connp.version != TLS_VERSION_10);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -3623,7 +3623,7 @@ static int SSLParserMultimsgTest02(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -3639,7 +3639,7 @@ static int SSLParserMultimsgTest02(void)
FAIL_IF(ssl_state->server_connp.version != 0x0301);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -3673,7 +3673,7 @@ static int SSLParserTest07(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -3689,7 +3689,7 @@ static int SSLParserTest07(void)
FAIL_IF(ssl_state->client_connp.version != SSL_VERSION_3);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -3714,7 +3714,7 @@ static int SSLParserTest08(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(alp_tctx, &f, ALPROTO_TLS, STREAM_TOSERVER, tlsbuf, tlslen);
if (r != 0) {
@ -3799,7 +3799,7 @@ static int SSLParserTest08(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
return result;
}
@ -3841,7 +3841,7 @@ static int SSLParserTest09(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -3863,7 +3863,7 @@ static int SSLParserTest09(void)
FAIL_IF(ssl_state->client_connp.version != SSL_VERSION_3);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -3904,7 +3904,7 @@ static int SSLParserTest10(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -3926,7 +3926,7 @@ static int SSLParserTest10(void)
FAIL_IF(ssl_state->client_connp.version != SSL_VERSION_3);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -3966,7 +3966,7 @@ static int SSLParserTest11(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -3988,7 +3988,7 @@ static int SSLParserTest11(void)
FAIL_IF(ssl_state->client_connp.version != SSL_VERSION_3);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -4033,7 +4033,7 @@ static int SSLParserTest12(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -4061,7 +4061,7 @@ static int SSLParserTest12(void)
FAIL_IF(ssl_state->client_connp.version != SSL_VERSION_3);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -4111,7 +4111,7 @@ static int SSLParserTest13(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -4145,7 +4145,7 @@ static int SSLParserTest13(void)
FAIL_IF(ssl_state->client_connp.version != SSL_VERSION_3);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -4178,7 +4178,7 @@ static int SSLParserTest14(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -4196,7 +4196,7 @@ static int SSLParserTest14(void)
FAIL_IF_NULL(ssl_state);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -4224,7 +4224,7 @@ static int SSLParserTest15(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -4233,7 +4233,7 @@ static int SSLParserTest15(void)
FAIL_IF(r == 0);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -4261,7 +4261,7 @@ static int SSLParserTest16(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -4270,7 +4270,7 @@ static int SSLParserTest16(void)
FAIL_IF(r == 0);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -4298,7 +4298,7 @@ static int SSLParserTest17(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -4307,7 +4307,7 @@ static int SSLParserTest17(void)
FAIL_IF(r == 0);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -4341,7 +4341,7 @@ static int SSLParserTest18(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -4359,7 +4359,7 @@ static int SSLParserTest18(void)
FAIL_IF_NULL(ssl_state);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -4388,7 +4388,7 @@ static int SSLParserTest19(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -4400,7 +4400,7 @@ static int SSLParserTest19(void)
FAIL_IF_NULL(ssl_state);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -4429,7 +4429,7 @@ static int SSLParserTest20(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -4438,7 +4438,7 @@ static int SSLParserTest20(void)
FAIL_IF(r == 0);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -4467,7 +4467,7 @@ static int SSLParserTest21(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -4483,7 +4483,7 @@ static int SSLParserTest21(void)
FAIL_IF(app_state->client_connp.version != SSL_VERSION_2);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -4517,7 +4517,7 @@ static int SSLParserTest22(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -4533,7 +4533,7 @@ static int SSLParserTest22(void)
FAIL_IF(app_state->server_connp.version != SSL_VERSION_2);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -4803,7 +4803,7 @@ static int SSLParserTest23(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -4900,7 +4900,7 @@ static int SSLParserTest23(void)
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -4945,7 +4945,7 @@ static int SSLParserTest24(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -4967,7 +4967,7 @@ static int SSLParserTest24(void)
FAIL_IF(ssl_state->client_connp.version != SSL_VERSION_3);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -5303,7 +5303,7 @@ static int SSLParserTest25(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -5336,7 +5336,7 @@ static int SSLParserTest25(void)
FAIL_IF(r != 0);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;
@ -5448,7 +5448,7 @@ static int SSLParserTest26(void)
f.proto = IPPROTO_TCP;
f.alproto = ALPROTO_TLS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_TLS,
@ -5474,7 +5474,7 @@ static int SSLParserTest26(void)
FAIL_IF((ssl_state->flags & SSL_AL_FLAG_SESSION_RESUMED) == 0);
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
PASS;

@ -1011,96 +1011,96 @@ void AppLayerDeSetupCounters()
#include "stream.h"
#include "util-unittest.h"
#define TEST_START \
Packet *p = SCMalloc(SIZE_OF_PACKET);\
FAIL_IF_NULL(p);\
Flow f;\
ThreadVars tv;\
StreamTcpThread *stt = NULL;\
TCPHdr tcph;\
PacketQueueNoLock pq;\
memset(&pq,0,sizeof(PacketQueueNoLock));\
memset(p, 0, SIZE_OF_PACKET);\
memset (&f, 0, sizeof(Flow));\
memset(&tv, 0, sizeof (ThreadVars));\
memset(&tcph, 0, sizeof (TCPHdr));\
\
FLOW_INITIALIZE(&f);\
f.flags = FLOW_IPV4;\
f.proto = IPPROTO_TCP;\
p->flow = &f;\
p->tcph = &tcph;\
\
StreamTcpInitConfig(TRUE);\
IPPairInitConfig(TRUE); \
StreamTcpThreadInit(&tv, NULL, (void **)&stt);\
\
/* handshake */\
tcph.th_win = htons(5480);\
tcph.th_flags = TH_SYN;\
p->flowflags = FLOW_PKT_TOSERVER;\
p->payload_len = 0;\
p->payload = NULL;\
FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1);\
TcpSession *ssn = (TcpSession *)f.protoctx;\
\
FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server));\
FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client));\
FAIL_IF(f.alproto != ALPROTO_UNKNOWN);\
FAIL_IF(f.alproto_ts != ALPROTO_UNKNOWN);\
FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN);\
FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED);\
FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOSERVER));\
FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOSERVER));\
FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOCLIENT));\
FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOCLIENT));\
FAIL_IF(ssn->data_first_seen_dir != 0);\
\
/* handshake */\
p->tcph->th_ack = htonl(1);\
p->tcph->th_flags = TH_SYN | TH_ACK;\
p->flowflags = FLOW_PKT_TOCLIENT;\
p->payload_len = 0;\
p->payload = NULL;\
FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1);\
FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server));\
FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client));\
FAIL_IF(f.alproto != ALPROTO_UNKNOWN);\
FAIL_IF(f.alproto_ts != ALPROTO_UNKNOWN);\
FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN);\
FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED);\
FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOSERVER));\
FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOSERVER));\
FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOCLIENT));\
FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOCLIENT));\
FAIL_IF(ssn->data_first_seen_dir != 0);\
\
/* handshake */\
p->tcph->th_ack = htonl(1);\
p->tcph->th_seq = htonl(1);\
p->tcph->th_flags = TH_ACK;\
p->flowflags = FLOW_PKT_TOSERVER;\
p->payload_len = 0;\
p->payload = NULL;\
FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1);\
FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server));\
FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client));\
FAIL_IF(f.alproto != ALPROTO_UNKNOWN);\
FAIL_IF(f.alproto_ts != ALPROTO_UNKNOWN);\
FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN);\
FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED);\
FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOSERVER));\
FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOSERVER));\
FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOCLIENT));\
FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOCLIENT));\
#define TEST_START \
Packet *p = SCMalloc(SIZE_OF_PACKET); \
FAIL_IF_NULL(p); \
Flow f; \
ThreadVars tv; \
StreamTcpThread *stt = NULL; \
TCPHdr tcph; \
PacketQueueNoLock pq; \
memset(&pq, 0, sizeof(PacketQueueNoLock)); \
memset(p, 0, SIZE_OF_PACKET); \
memset(&f, 0, sizeof(Flow)); \
memset(&tv, 0, sizeof(ThreadVars)); \
memset(&tcph, 0, sizeof(TCPHdr)); \
\
FLOW_INITIALIZE(&f); \
f.flags = FLOW_IPV4; \
f.proto = IPPROTO_TCP; \
p->flow = &f; \
p->tcph = &tcph; \
\
StreamTcpInitConfig(true); \
IPPairInitConfig(true); \
StreamTcpThreadInit(&tv, NULL, (void **)&stt); \
\
/* handshake */ \
tcph.th_win = htons(5480); \
tcph.th_flags = TH_SYN; \
p->flowflags = FLOW_PKT_TOSERVER; \
p->payload_len = 0; \
p->payload = NULL; \
FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); \
TcpSession *ssn = (TcpSession *)f.protoctx; \
\
FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); \
FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); \
FAIL_IF(f.alproto != ALPROTO_UNKNOWN); \
FAIL_IF(f.alproto_ts != ALPROTO_UNKNOWN); \
FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN); \
FAIL_IF(ssn->flags &STREAMTCP_FLAG_APP_LAYER_DISABLED); \
FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); \
FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); \
FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOCLIENT)); \
FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOCLIENT)); \
FAIL_IF(ssn->data_first_seen_dir != 0); \
\
/* handshake */ \
p->tcph->th_ack = htonl(1); \
p->tcph->th_flags = TH_SYN | TH_ACK; \
p->flowflags = FLOW_PKT_TOCLIENT; \
p->payload_len = 0; \
p->payload = NULL; \
FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); \
FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); \
FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); \
FAIL_IF(f.alproto != ALPROTO_UNKNOWN); \
FAIL_IF(f.alproto_ts != ALPROTO_UNKNOWN); \
FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN); \
FAIL_IF(ssn->flags &STREAMTCP_FLAG_APP_LAYER_DISABLED); \
FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); \
FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); \
FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOCLIENT)); \
FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOCLIENT)); \
FAIL_IF(ssn->data_first_seen_dir != 0); \
\
/* handshake */ \
p->tcph->th_ack = htonl(1); \
p->tcph->th_seq = htonl(1); \
p->tcph->th_flags = TH_ACK; \
p->flowflags = FLOW_PKT_TOSERVER; \
p->payload_len = 0; \
p->payload = NULL; \
FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); \
FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); \
FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); \
FAIL_IF(f.alproto != ALPROTO_UNKNOWN); \
FAIL_IF(f.alproto_ts != ALPROTO_UNKNOWN); \
FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN); \
FAIL_IF(ssn->flags &STREAMTCP_FLAG_APP_LAYER_DISABLED); \
FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); \
FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); \
FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOCLIENT)); \
FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOCLIENT)); \
FAIL_IF(ssn->data_first_seen_dir != 0);
#define TEST_END \
StreamTcpSessionClear(p->flow->protoctx);\
StreamTcpThreadDeinit(&tv, (void *)stt); \
StreamTcpFreeConfig(TRUE);\
PACKET_DESTRUCTOR(p);\
SCFree(p);\
FLOW_DESTROY(&f); \
#define TEST_END \
StreamTcpSessionClear(p->flow->protoctx); \
StreamTcpThreadDeinit(&tv, (void *)stt); \
StreamTcpFreeConfig(true); \
PACKET_DESTRUCTOR(p); \
SCFree(p); \
FLOW_DESTROY(&f); \
StatsThreadCleanup(&tv);
/**

@ -97,7 +97,7 @@ static time_t stats_start_time;
/** refresh interval in seconds */
static uint32_t stats_tts = STATS_MGMTT_TTS;
/** is the stats counter enabled? */
static char stats_enabled = TRUE;
static bool stats_enabled = true;
/**< add decoder events as stats? enabled by default */
bool stats_decoder_events = true;
@ -119,7 +119,7 @@ static uint16_t counters_global_id = 0;
bool StatsEnabled(void)
{
return (stats_enabled == TRUE);
return stats_enabled;
}
static void StatsPublicThreadContextInit(StatsPublicThreadContext *t)
@ -238,7 +238,7 @@ static void StatsInitCtxPreOutput(void)
if (stats != NULL) {
const char *enabled = ConfNodeLookupChildValue(stats, "enabled");
if (enabled != NULL && ConfValIsFalse(enabled)) {
stats_enabled = FALSE;
stats_enabled = false;
SCLogDebug("Stats module has been disabled");
SCReturn;
}
@ -296,7 +296,7 @@ static void StatsInitCtxPostOutput(void)
* stats sync just in case someone runs 'dump-counters' */
if (!ConfUnixSocketIsEnable()) {
SCLogWarning(SC_WARN_NO_STATS_LOGGERS, "stats are enabled but no loggers are active");
stats_enabled = FALSE;
stats_enabled = false;
SCReturn;
}
}

@ -105,7 +105,7 @@ void DecodeIPV6FragHeader(Packet *p, const uint8_t *pkt,
int frag_morefrags = (*(pkt + 2) << 8 | *(pkt + 3)) & 0x0001;
p->ip6eh.fh_offset = frag_offset;
p->ip6eh.fh_more_frags_set = frag_morefrags ? TRUE : FALSE;
p->ip6eh.fh_more_frags_set = frag_morefrags ? true : false;
p->ip6eh.fh_nh = *pkt;
uint32_t fh_id;

@ -235,9 +235,9 @@ typedef struct IPV6ExtHdrs_
} IPV6ExtHdrs;
#define IPV6_EXTHDR_SET_FH(p) (p)->ip6eh.fh_set = TRUE
#define IPV6_EXTHDR_SET_FH(p) (p)->ip6eh.fh_set = true
#define IPV6_EXTHDR_ISSET_FH(p) (p)->ip6eh.fh_set
#define IPV6_EXTHDR_SET_RH(p) (p)->ip6eh.rh_set = TRUE
#define IPV6_EXTHDR_SET_RH(p) (p)->ip6eh.rh_set = true
#define IPV6_EXTHDR_ISSET_RH(p) (p)->ip6eh.rh_set
void DecodeIPV6RegisterTests(void);

@ -132,7 +132,7 @@ static void DecodeTCPOptions(Packet *p, const uint8_t *pkt, uint16_t pktlen)
memcpy(&values, tcp_opts[tcp_opt_cnt].data, sizeof(values));
p->tcpvars.ts_val = SCNtohl(values[0]);
p->tcpvars.ts_ecr = SCNtohl(values[1]);
p->tcpvars.ts_set = TRUE;
p->tcpvars.ts_set = true;
}
}
break;

@ -91,7 +91,7 @@
#define TCP_HAS_WSCALE(p) ((p)->tcpvars.ws.type == TCP_OPT_WS)
#define TCP_HAS_SACK(p) ((p)->tcpvars.sack.type == TCP_OPT_SACK)
#define TCP_HAS_SACKOK(p) ((p)->tcpvars.sackok.type == TCP_OPT_SACKOK)
#define TCP_HAS_TS(p) ((p)->tcpvars.ts_set == TRUE)
#define TCP_HAS_TS(p) ((p)->tcpvars.ts_set)
#define TCP_HAS_MSS(p) ((p)->tcpvars.mss.type == TCP_OPT_MSS)
#define TCP_HAS_TFO(p) ((p)->tcpvars.tfo.type == TCP_OPT_TFO)

@ -164,7 +164,7 @@ void DefragTrackerClearMemory(DefragTracker *dt)
/** \brief initialize the configuration
* \warning Not thread safe */
void DefragInitConfig(char quiet)
void DefragInitConfig(bool quiet)
{
SCLogDebug("initializing defrag engine...");
@ -247,7 +247,7 @@ void DefragInitConfig(char quiet)
}
(void) SC_ATOMIC_ADD(defrag_memuse, (defrag_config.hash_size * sizeof(DefragTrackerHashRow)));
if (quiet == FALSE) {
if (!quiet) {
SCLogConfig("allocated %"PRIu64" bytes of memory for the defrag hash... "
"%" PRIu32 " buckets of size %" PRIuMAX "",
SC_ATOMIC_GET(defrag_memuse), defrag_config.hash_size,
@ -274,14 +274,14 @@ void DefragInitConfig(char quiet)
}
DefragTrackerEnqueue(&defragtracker_spare_q,h);
}
if (quiet == FALSE) {
if (!quiet) {
SCLogConfig("preallocated %" PRIu32 " defrag trackers of size %" PRIuMAX "",
defragtracker_spare_q.len, (uintmax_t)sizeof(DefragTracker));
}
}
}
if (quiet == FALSE) {
if (!quiet) {
SCLogConfig("defrag memory usage: %"PRIu64" bytes, maximum: %"PRIu64,
SC_ATOMIC_GET(defrag_memuse), SC_ATOMIC_GET(defrag_config.memcap));
}

@ -89,7 +89,7 @@ SC_ATOMIC_EXTERN(uint64_t,defrag_memuse);
SC_ATOMIC_EXTERN(unsigned int,defragtracker_counter);
SC_ATOMIC_EXTERN(unsigned int,defragtracker_prune_idx);
void DefragInitConfig(char quiet);
void DefragInitConfig(bool quiet);
void DefragHashShutdown(void);
DefragTracker *DefragLookupTrackerFromHash (Packet *);

@ -1079,7 +1079,7 @@ DefragInit(void)
}
DefragSetDefaultTimeout(defrag_context->timeout);
DefragInitConfig(FALSE);
DefragInitConfig(false);
}
void DefragDestroy(void)

@ -118,16 +118,16 @@ static bool HasConflicts(const DetectAppLayerProtocolData *us,
{
/* mixing negated and non negated is illegal */
if (them->negated ^ us->negated)
return TRUE;
return true;
/* multiple non-negated is illegal */
if (!us->negated)
return TRUE;
return true;
/* duplicate option */
if (us->alproto == them->alproto)
return TRUE;
return true;
/* all good */
return FALSE;
return false;
}
static int DetectAppLayerProtocolSetup(DetectEngineCtx *de_ctx,
@ -192,7 +192,7 @@ PrefilterPacketAppProtoMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const vo
{
const PrefilterPacketHeaderCtx *ctx = pectx;
if (PrefilterPacketHeaderExtraMatch(ctx, p) == FALSE) {
if (!PrefilterPacketHeaderExtraMatch(ctx, p)) {
SCLogDebug("packet %"PRIu64": extra match failed", p->pcap_cnt);
SCReturn;
}
@ -236,8 +236,8 @@ PrefilterPacketAppProtoCompare(PrefilterPacketHeaderValue v, void *smctx)
const DetectAppLayerProtocolData *a = smctx;
if (v.u16[0] == a->alproto &&
v.u8[2] == (uint8_t)a->negated)
return TRUE;
return FALSE;
return true;
return false;
}
static int PrefilterSetupAppProto(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ -252,9 +252,9 @@ static bool PrefilterAppProtoIsPrefilterable(const Signature *s)
{
if (s->flags & SIG_FLAG_PDONLY) {
SCLogDebug("prefilter on PD %u", s->id);
return TRUE;
return true;
}
return FALSE;
return false;
}
void DetectAppLayerProtocolRegister(void)

@ -177,7 +177,7 @@ static int DetectBypassTestSig01(void)
p2->livedev = livedev;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -228,7 +228,7 @@ static int DetectBypassTestSig01(void)
FAIL_IF(callback_var == 0);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p1);
UTHFreePacket(p2);

@ -392,12 +392,12 @@ void DetectContentFree(DetectEngineCtx *de_ctx, void *ptr)
bool DetectContentPMATCHValidateCallback(const Signature *s)
{
if (!(s->flags & SIG_FLAG_DSIZE)) {
return TRUE;
return true;
}
int max_right_edge_i = SigParseGetMaxDsize(s);
if (max_right_edge_i < 0) {
return TRUE;
return true;
}
uint32_t max_right_edge = (uint32_t)max_right_edge_i;
@ -412,16 +412,16 @@ bool DetectContentPMATCHValidateCallback(const Signature *s)
SCLogError(SC_ERR_INVALID_SIGNATURE,
"signature can't match as content length %u is bigger than dsize %u.",
cd->content_len, max_right_edge);
return FALSE;
return false;
}
if (right_edge > max_right_edge) {
SCLogError(SC_ERR_INVALID_SIGNATURE,
"signature can't match as content length %u with offset %u (=%u) is bigger than dsize %u.",
cd->content_len, cd->offset, right_edge, max_right_edge);
return FALSE;
return false;
}
}
return TRUE;
return true;
}
/** \brief apply depth/offset and distance/within to content matches

@ -1021,7 +1021,7 @@ static int DetectCsumICMPV6Test01(void)
memset(&tv, 0, sizeof(tv));
memset(&dtv, 0, sizeof(dtv));
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FlowInitConfig(FLOW_QUIET);
de_ctx = DetectEngineCtxInit();
@ -1045,7 +1045,7 @@ static int DetectCsumICMPV6Test01(void)
DetectEngineThreadCtxDeinit(&tv, det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PACKET_RECYCLE(p);
FlowShutdown();
SCFree(p);

@ -261,7 +261,7 @@ static int DetectDceIfaceTestParse1(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -314,7 +314,7 @@ static int DetectDceIfaceTestParse1(void)
AppLayerParserThreadCtxFree(alp_tctx);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;
@ -468,7 +468,7 @@ static int DetectDceIfaceTestParse13(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -653,7 +653,7 @@ static int DetectDceIfaceTestParse13(void)
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
return result;
}
@ -729,7 +729,7 @@ static int DetectDceIfaceTestParse2(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -819,7 +819,7 @@ static int DetectDceIfaceTestParse2(void)
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
return result;

@ -651,7 +651,7 @@ static int DetectDceOpnumTestParse01(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -732,7 +732,7 @@ static int DetectDceOpnumTestParse01(void)
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
@ -1193,7 +1193,7 @@ static int DetectDceOpnumTestParse02(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -1246,7 +1246,7 @@ static int DetectDceOpnumTestParse02(void)
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
@ -1401,7 +1401,7 @@ static int DetectDceOpnumTestParse10(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -1572,7 +1572,7 @@ static int DetectDceOpnumTestParse10(void)
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
@ -1696,7 +1696,7 @@ static int DetectDceOpnumTestParse11(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -1835,7 +1835,7 @@ static int DetectDceOpnumTestParse11(void)
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
@ -1974,7 +1974,7 @@ static int DetectDceOpnumTestParse12(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -2149,7 +2149,7 @@ end:
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
@ -2261,7 +2261,7 @@ static int DetectDceOpnumTestParse13(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -2404,7 +2404,7 @@ static int DetectDceOpnumTestParse13(void)
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);

@ -679,7 +679,7 @@ static int DetectDceStubDataTestParse02(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -776,7 +776,7 @@ static int DetectDceStubDataTestParse02(void)
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
@ -1236,7 +1236,7 @@ static int DetectDceStubDataTestParse03(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -1271,7 +1271,7 @@ static int DetectDceStubDataTestParse03(void)
AppLayerParserThreadCtxFree(alp_tctx);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
@ -1418,7 +1418,7 @@ static int DetectDceStubDataTestParse04(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -1606,7 +1606,7 @@ static int DetectDceStubDataTestParse04(void)
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
@ -1726,7 +1726,7 @@ static int DetectDceStubDataTestParse05(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -1897,7 +1897,7 @@ static int DetectDceStubDataTestParse05(void)
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);

@ -805,7 +805,7 @@ static int DetectDNP3DataTest01(void)
p->flow = &f;
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -873,7 +873,7 @@ static int DetectDNP3DataTest01(void)
SigGroupCleanup(de_ctx);
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -953,7 +953,7 @@ static int DetectDNP3DataTest02(void)
p->flow = &f;
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOCLIENT | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -1027,7 +1027,7 @@ static int DetectDNP3DataTest02(void)
SigGroupCleanup(de_ctx);
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;

@ -563,7 +563,7 @@ static int DetectDnsQueryTest03(void)
p->flowflags |= FLOW_PKT_TOSERVER|FLOW_PKT_ESTABLISHED;
f.alproto = ALPROTO_DNS;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -608,7 +608,7 @@ static int DetectDnsQueryTest03(void)
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;

@ -324,7 +324,7 @@ PrefilterPacketDsizeMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const void
}
const PrefilterPacketHeaderCtx *ctx = pectx;
if (PrefilterPacketHeaderExtraMatch(ctx, p) == FALSE)
if (!PrefilterPacketHeaderExtraMatch(ctx, p))
return;
const uint16_t dsize = p->payload_len;
@ -351,8 +351,8 @@ PrefilterPacketDsizeCompare(PrefilterPacketHeaderValue v, void *smctx)
if (v.u8[0] == a->mode &&
v.u16[1] == a->dsize &&
v.u16[2] == a->dsize2)
return TRUE;
return FALSE;
return true;
return false;
}
static int PrefilterSetupDsize(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ -369,10 +369,10 @@ static bool PrefilterDsizeIsPrefilterable(const Signature *s)
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {
switch (sm->type) {
case DETECT_DSIZE:
return TRUE;
return true;
}
}
return FALSE;
return false;
}
/** \brief get max dsize "depth"

@ -1378,7 +1378,7 @@ int SigAddressPrepareStage1(DetectEngineCtx *de_ctx)
SigMatch *sm = s->init_data->smlists[i];
while (sm != NULL) {
if (sigmatch_table[sm->type].SupportsPrefilter != NULL) {
if (sigmatch_table[sm->type].SupportsPrefilter(s) == TRUE) {
if (sigmatch_table[sm->type].SupportsPrefilter(s)) {
prefilter_list = MIN(prefilter_list, sm->type);
}
}

@ -115,7 +115,7 @@ static int DcePayloadTest15(void)
f.flags |= FLOW_IPV4;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -168,7 +168,7 @@ end:
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
return result;
@ -232,7 +232,7 @@ static int DcePayloadTest16(void)
f.flags |= FLOW_IPV4;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -285,7 +285,7 @@ end:
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
return result;
@ -349,7 +349,7 @@ static int DcePayloadTest17(void)
f.flags |= FLOW_IPV4;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -402,7 +402,7 @@ end:
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
return result;
@ -466,7 +466,7 @@ static int DcePayloadTest18(void)
f.flags |= FLOW_IPV4;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -519,7 +519,7 @@ end:
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
return result;
@ -583,7 +583,7 @@ static int DcePayloadTest19(void)
f.flags |= FLOW_IPV4;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -636,7 +636,7 @@ end:
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
return result;
@ -700,7 +700,7 @@ static int DcePayloadTest20(void)
f.flags |= FLOW_IPV4;
f.alproto = ALPROTO_DCERPC;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -753,7 +753,7 @@ end:
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
return result;

@ -328,7 +328,7 @@ static int DetectEngineInspectENIPTest01(void)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -358,7 +358,7 @@ static int DetectEngineInspectENIPTest01(void)
DetectEngineThreadCtxDeinit(&tv, det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);

@ -372,7 +372,7 @@ static int DetectEngineInspectModbusTest01(void)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -407,7 +407,7 @@ static int DetectEngineInspectModbusTest01(void)
SigGroupCleanup(de_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -443,7 +443,7 @@ static int DetectEngineInspectModbusTest02(void)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -478,7 +478,7 @@ static int DetectEngineInspectModbusTest02(void)
SigGroupCleanup(de_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -514,7 +514,7 @@ static int DetectEngineInspectModbusTest03(void)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -550,7 +550,7 @@ static int DetectEngineInspectModbusTest03(void)
SigGroupCleanup(de_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -586,7 +586,7 @@ static int DetectEngineInspectModbusTest04(void)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -621,7 +621,7 @@ static int DetectEngineInspectModbusTest04(void)
SigGroupCleanup(de_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -657,7 +657,7 @@ static int DetectEngineInspectModbusTest05(void)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -692,7 +692,7 @@ static int DetectEngineInspectModbusTest05(void)
SigGroupCleanup(de_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -728,7 +728,7 @@ static int DetectEngineInspectModbusTest06(void)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -763,7 +763,7 @@ static int DetectEngineInspectModbusTest06(void)
SigGroupCleanup(de_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -799,7 +799,7 @@ static int DetectEngineInspectModbusTest07(void)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -834,7 +834,7 @@ static int DetectEngineInspectModbusTest07(void)
SigGroupCleanup(de_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -870,7 +870,7 @@ static int DetectEngineInspectModbusTest08(void)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -963,7 +963,7 @@ static int DetectEngineInspectModbusTest08(void)
SigGroupCleanup(de_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -999,7 +999,7 @@ static int DetectEngineInspectModbusTest09(void)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -1095,7 +1095,7 @@ static int DetectEngineInspectModbusTest09(void)
SigGroupCleanup(de_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -1133,7 +1133,7 @@ static int DetectEngineInspectModbusTest10(void)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -1216,7 +1216,7 @@ static int DetectEngineInspectModbusTest10(void)
SigGroupCleanup(de_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -1254,7 +1254,7 @@ static int DetectEngineInspectModbusTest11(void)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -1332,7 +1332,7 @@ static int DetectEngineInspectModbusTest11(void)
SigGroupCleanup(de_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -1368,7 +1368,7 @@ static int DetectEngineInspectModbusTest12(void)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -1427,7 +1427,7 @@ static int DetectEngineInspectModbusTest12(void)
SigGroupCleanup(de_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;

@ -746,7 +746,7 @@ static int DetectPortParseInsertString(const DetectEngineCtx *de_ctx,
{
DetectPort *ad = NULL, *ad_any = NULL;
int r = 0;
char port_any = FALSE;
bool port_any = false;
SCLogDebug("head %p, *head %p, s %s", head, *head, s);
@ -758,7 +758,7 @@ static int DetectPortParseInsertString(const DetectEngineCtx *de_ctx,
}
if (ad->flags & PORT_FLAG_ANY) {
port_any = TRUE;
port_any = true;
}
/** handle the not case, we apply the negation then insert the part(s) */
@ -785,7 +785,7 @@ static int DetectPortParseInsertString(const DetectEngineCtx *de_ctx,
goto error;
/** if any, insert 0.0.0.0/0 and ::/0 as well */
if (r == 1 && port_any == TRUE) {
if (r == 1 && port_any) {
SCLogDebug("inserting 0:65535 as port is \"any\"");
ad_any = PortParse("0:65535");

@ -391,7 +391,7 @@ static int PrefilterSetupPacketHeaderCommon(DetectEngineCtx *de_ctx,
}
}
if (u8hash == FALSE) {
if (!u8hash) {
SetupSingle(de_ctx, hash_table, sgh, sm_type, Compare, Match);
} else {
SetupU8Hash(de_ctx, hash_table, sgh, sm_type, Set, Compare, Match);
@ -411,8 +411,7 @@ int PrefilterSetupPacketHeaderU8Hash(DetectEngineCtx *de_ctx,
void (*Match)(DetectEngineThreadCtx *det_ctx,
Packet *p, const void *pectx))
{
return PrefilterSetupPacketHeaderCommon(de_ctx, sgh, sm_type,
Set, Compare, Match, TRUE);
return PrefilterSetupPacketHeaderCommon(de_ctx, sgh, sm_type, Set, Compare, Match, true);
}
int PrefilterSetupPacketHeader(DetectEngineCtx *de_ctx,
@ -422,6 +421,5 @@ int PrefilterSetupPacketHeader(DetectEngineCtx *de_ctx,
void (*Match)(DetectEngineThreadCtx *det_ctx,
Packet *p, const void *pectx))
{
return PrefilterSetupPacketHeaderCommon(de_ctx, sgh, sm_type,
Set, Compare, Match, FALSE);
return PrefilterSetupPacketHeaderCommon(de_ctx, sgh, sm_type, Set, Compare, Match, false);
}

@ -80,18 +80,18 @@ PrefilterPacketHeaderExtraMatch(const PrefilterPacketHeaderCtx *ctx,
break;
case PREFILTER_EXTRA_MATCH_ALPROTO:
if (p->flow == NULL || !AppProtoEquals(ctx->value, p->flow->alproto))
return FALSE;
return false;
break;
case PREFILTER_EXTRA_MATCH_SRCPORT:
if (p->sp != ctx->value)
return FALSE;
return false;
break;
case PREFILTER_EXTRA_MATCH_DSTPORT:
if (p->dp != ctx->value)
return FALSE;
return false;
break;
}
return TRUE;
return true;
}
static inline bool PrefilterIsPrefilterableById(const Signature *s, enum DetectKeywordId kid)

@ -506,7 +506,7 @@ static int DeStateSigTest01(void)
p->flowflags |= FLOW_PKT_TOSERVER;
p->flowflags |= FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -543,7 +543,7 @@ static int DeStateSigTest01(void)
AppLayerParserThreadCtxFree(alp_tctx);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -591,7 +591,7 @@ static int DeStateSigTest02(void)
p->flowflags |= FLOW_PKT_ESTABLISHED;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -656,7 +656,7 @@ static int DeStateSigTest02(void)
AppLayerParserThreadCtxFree(alp_tctx);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -712,7 +712,7 @@ static int DeStateSigTest03(void)
p->flowflags |= FLOW_PKT_TOSERVER;
p->flowflags |= FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1,
STREAM_TOSERVER | STREAM_START | STREAM_EOF, httpbuf1, httplen1);
@ -738,7 +738,7 @@ static int DeStateSigTest03(void)
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
@ -789,7 +789,7 @@ static int DeStateSigTest04(void)
p->flowflags |= FLOW_PKT_TOSERVER;
p->flowflags |= FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1,
STREAM_TOSERVER | STREAM_START | STREAM_EOF, httpbuf1, httplen1);
@ -812,7 +812,7 @@ static int DeStateSigTest04(void)
UTHFreeFlow(f);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
@ -863,7 +863,7 @@ static int DeStateSigTest05(void)
p->flowflags |= FLOW_PKT_TOSERVER;
p->flowflags |= FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1,
STREAM_TOSERVER | STREAM_START | STREAM_EOF, httpbuf1, httplen1);
@ -886,7 +886,7 @@ static int DeStateSigTest05(void)
UTHFreeFlow(f);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
@ -938,7 +938,7 @@ static int DeStateSigTest06(void)
p->flowflags |= FLOW_PKT_TOSERVER;
p->flowflags |= FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1,
STREAM_TOSERVER | STREAM_START | STREAM_EOF, httpbuf1, httplen1);
@ -960,7 +960,7 @@ static int DeStateSigTest06(void)
UTHFreeFlow(f);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
@ -1013,7 +1013,7 @@ static int DeStateSigTest07(void)
p->flowflags |= FLOW_PKT_TOSERVER;
p->flowflags |= FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
int r = AppLayerParserParse(
NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1);
@ -1041,7 +1041,7 @@ static int DeStateSigTest07(void)
UTHFreeFlow(f);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
@ -1107,7 +1107,7 @@ static int DeStateSigTest08(void)
p->flowflags |= FLOW_PKT_TOSERVER;
p->flowflags |= FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
/* HTTP request with 1st part of the multipart body */
@ -1161,7 +1161,7 @@ static int DeStateSigTest08(void)
UTHFreeFlow(f);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
@ -1227,7 +1227,7 @@ static int DeStateSigTest09(void)
p->flowflags |= FLOW_PKT_TOSERVER;
p->flowflags |= FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
/* HTTP request with 1st part of the multipart body */
@ -1279,7 +1279,7 @@ static int DeStateSigTest09(void)
UTHFreeFlow(f);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
@ -1345,7 +1345,7 @@ static int DeStateSigTest10(void)
p->flowflags |= FLOW_PKT_TOSERVER;
p->flowflags |= FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
/* HTTP request with 1st part of the multipart body */
@ -1397,7 +1397,7 @@ static int DeStateSigTest10(void)
UTHFreeFlow(f);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}

@ -775,12 +775,12 @@ static int DetectTagTestPacket02 (void)
SCLogDebug("packet %d flag %s", i, p[i]->flags & PKT_HAS_TAG ? "true" : "false");
/* see if the PKT_HAS_TAG is set on the packet if needed */
int expect;
bool expect;
if (i == 0 || i == 2 || i == 3 || i == 5 || i == 6)
expect = FALSE;
expect = false;
else
expect = TRUE;
if (((p[i]->flags & PKT_HAS_TAG) ? TRUE : FALSE) != expect)
expect = true;
if (((p[i]->flags & PKT_HAS_TAG) ? true : false) != expect)
goto cleanup;
}
@ -892,12 +892,12 @@ static int DetectTagTestPacket03 (void)
SCLogDebug("packet %d flag %s", i, p[i]->flags & PKT_HAS_TAG ? "true" : "false");
/* see if the PKT_HAS_TAG is set on the packet if needed */
int expect;
bool expect;
if (i == 0 || i == 3 || i == 5 || i == 6)
expect = FALSE;
expect = false;
else
expect = TRUE;
if (((p[i]->flags & PKT_HAS_TAG) ? TRUE : FALSE) != expect)
expect = true;
if (((p[i]->flags & PKT_HAS_TAG) ? true : false) != expect)
goto cleanup;
}
@ -1027,12 +1027,12 @@ static int DetectTagTestPacket04 (void)
SCLogDebug("packet %d flag %s", i, p[i]->flags & PKT_HAS_TAG ? "true" : "false");
/* see if the PKT_HAS_TAG is set on the packet if needed */
int expect;
bool expect;
if (i == 0 || i == 4 || i == 5 || i == 6)
expect = FALSE;
expect = false;
else
expect = TRUE;
if (((p[i]->flags & PKT_HAS_TAG) ? TRUE : FALSE) != expect)
expect = true;
if (((p[i]->flags & PKT_HAS_TAG) ? true : false) != expect)
goto cleanup;
}
@ -1174,12 +1174,12 @@ static int DetectTagTestPacket05 (void)
SCLogDebug("packet %d flag %s", i, p[i]->flags & PKT_HAS_TAG ? "true" : "false");
/* see if the PKT_HAS_TAG is set on the packet if needed */
int expect;
bool expect;
if (i == 0 || i == 5 || i == 6)
expect = FALSE;
expect = false;
else
expect = TRUE;
if (((p[i]->flags & PKT_HAS_TAG) ? TRUE : FALSE) != expect)
expect = true;
if (((p[i]->flags & PKT_HAS_TAG) ? true : false) != expect)
goto cleanup;
}

@ -798,7 +798,7 @@ void DetectBufferTypeSupportsPacket(const char *name)
DetectBufferTypeRegister(name);
DetectBufferType *exists = DetectBufferTypeLookupByName(name);
BUG_ON(!exists);
exists->packet = TRUE;
exists->packet = true;
SCLogDebug("%p %s -- %d supports packet inspection", exists, name, exists->id);
}
@ -808,7 +808,7 @@ void DetectBufferTypeSupportsMpm(const char *name)
DetectBufferTypeRegister(name);
DetectBufferType *exists = DetectBufferTypeLookupByName(name);
BUG_ON(!exists);
exists->mpm = TRUE;
exists->mpm = true;
SCLogDebug("%p %s -- %d supports mpm", exists, name, exists->id);
}
@ -881,7 +881,7 @@ bool DetectBufferTypeSupportsPacketGetById(const DetectEngineCtx *de_ctx, const
{
const DetectBufferType *map = DetectBufferTypeGetById(de_ctx, id);
if (map == NULL)
return FALSE;
return false;
SCLogDebug("map %p id %d packet? %d", map, id, map->packet);
return map->packet;
}
@ -890,7 +890,7 @@ bool DetectBufferTypeSupportsMpmGetById(const DetectEngineCtx *de_ctx, const int
{
const DetectBufferType *map = DetectBufferTypeGetById(de_ctx, id);
if (map == NULL)
return FALSE;
return false;
SCLogDebug("map %p id %d mpm? %d", map, id, map->mpm);
return map->mpm;
}
@ -931,7 +931,7 @@ bool DetectBufferRunValidateCallback(const DetectEngineCtx *de_ctx,
if (map && map->ValidateCallback) {
return map->ValidateCallback(s, sigerror);
}
return TRUE;
return true;
}
int DetectBufferSetActiveList(Signature *s, const int list)

@ -431,7 +431,7 @@ PrefilterPacketFlowMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const void *
{
const PrefilterPacketHeaderCtx *ctx = pectx;
if (PrefilterPacketHeaderExtraMatch(ctx, p) == FALSE)
if (!PrefilterPacketHeaderExtraMatch(ctx, p))
return;
if (FlowMatch(p->flags, p->flowflags, det_ctx->flags, ctx->v1.u8[0], ctx->v1.u8[1]))
@ -455,9 +455,9 @@ PrefilterPacketFlowCompare(PrefilterPacketHeaderValue v, void *smctx)
if (v.u8[0] == fb->flags &&
v.u8[1] == fb->match_cnt)
{
return TRUE;
return true;
}
return FALSE;
return false;
}
static int PrefilterSetupFlow(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ -474,10 +474,10 @@ static bool PrefilterFlowIsPrefilterable(const Signature *s)
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {
switch (sm->type) {
case DETECT_FLOW:
return TRUE;
return true;
}
}
return FALSE;
return false;
}
#ifdef UNITTESTS
@ -1106,4 +1106,4 @@ static void DetectFlowRegisterTests(void)
UtRegisterTest("DetectFlowSigTest01", DetectFlowSigTest01);
}
#endif /* UNITTESTS */
#endif /* UNITTESTS */

@ -355,9 +355,9 @@ PrefilterPacketFragBitsCompare(PrefilterPacketHeaderValue v, void *smctx)
if (v.u8[0] == fb->modifier &&
v.u8[1] == fb->fragbits)
{
return TRUE;
return true;
}
return FALSE;
return false;
}
static int PrefilterSetupFragBits(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ -374,10 +374,10 @@ static bool PrefilterFragBitsIsPrefilterable(const Signature *s)
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {
switch (sm->type) {
case DETECT_FRAGBITS:
return TRUE;
return true;
}
}
return FALSE;
return false;
}
/*

@ -299,9 +299,9 @@ PrefilterPacketFragOffsetCompare(PrefilterPacketHeaderValue v, void *smctx)
if (v.u8[0] == fb->mode &&
v.u16[1] == fb->frag_off)
{
return TRUE;
return true;
}
return FALSE;
return false;
}
static int PrefilterSetupFragOffset(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ -318,10 +318,10 @@ static bool PrefilterFragOffsetIsPrefilterable(const Signature *s)
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {
switch (sm->type) {
case DETECT_FRAGOFFSET:
return TRUE;
return true;
}
}
return FALSE;
return false;
}
#ifdef UNITTESTS
@ -457,4 +457,4 @@ void DetectFragOffsetRegisterTests (void)
UtRegisterTest("DetectFragOffsetParseTest03", DetectFragOffsetParseTest03);
UtRegisterTest("DetectFragOffsetMatchTest01", DetectFragOffsetMatchTest01);
}
#endif /* UNITTESTS */
#endif /* UNITTESTS */

@ -318,7 +318,7 @@ static int DetectFtpbounceTestALMatch02(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_FTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -405,7 +405,7 @@ end:
DetectEngineThreadCtxDeinit(&th_v,(void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
@ -463,7 +463,7 @@ static int DetectFtpbounceTestALMatch03(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_FTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -551,7 +551,7 @@ end:
DetectEngineThreadCtxDeinit(&th_v,(void *)det_ctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
SCFree(p);
return result;

@ -454,7 +454,7 @@ static void HostBitsTestSetup(void)
StorageInit();
HostBitInitCtx();
StorageFinalize();
HostInitConfig(TRUE);
HostInitConfig(true);
}
static void HostBitsTestShutdown(void)
@ -1247,4 +1247,4 @@ void HostBitsRegisterTests(void)
UtRegisterTest("HostBitsTestSig07", HostBitsTestSig07);
UtRegisterTest("HostBitsTestSig08", HostBitsTestSig08);
}
#endif /* UNITTESTS */
#endif /* UNITTESTS */

@ -172,7 +172,7 @@ static bool DetectHttpHostValidateCallback(const Signature *s, const char **sige
"is actually lowercase. So having a "
"nocase is redundant.";
SCLogWarning(SC_WARN_POOR_RULE, "rule %u: %s", s->id, *sigerror);
return FALSE;
return false;
} else {
uint32_t u;
for (u = 0; u < cd->content_len; u++) {
@ -186,13 +186,13 @@ static bool DetectHttpHostValidateCallback(const Signature *s, const char **sige
"is lowercase only, please specify a "
"lowercase pattern.";
SCLogWarning(SC_WARN_POOR_RULE, "rule %u: %s", s->id, *sigerror);
return FALSE;
return false;
}
}
}
}
return TRUE;
return true;
}
/**

@ -164,23 +164,23 @@ static bool DetectHttpMethodValidateCallback(const Signature *s, const char **si
if (cd->content[cd->content_len-1] == 0x20) {
*sigerror = "http_method pattern with trailing space";
SCLogError(SC_ERR_INVALID_SIGNATURE, "%s", *sigerror);
return FALSE;
return false;
} else if (cd->content[0] == 0x20) {
*sigerror = "http_method pattern with leading space";
SCLogError(SC_ERR_INVALID_SIGNATURE, "%s", *sigerror);
return FALSE;
return false;
} else if (cd->content[cd->content_len-1] == 0x09) {
*sigerror = "http_method pattern with trailing tab";
SCLogError(SC_ERR_INVALID_SIGNATURE, "%s", *sigerror);
return FALSE;
return false;
} else if (cd->content[0] == 0x09) {
*sigerror = "http_method pattern with leading tab";
SCLogError(SC_ERR_INVALID_SIGNATURE, "%s", *sigerror);
return FALSE;
return false;
}
}
}
return TRUE;
return true;
}
static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,

@ -160,9 +160,9 @@ static bool DetectHttpRawHeaderValidateCallback(const Signature *s, const char *
"inspecting response headers.";
SCLogError(SC_ERR_INVALID_SIGNATURE, "%s", *sigerror);
SCReturnInt(FALSE);
SCReturnInt(false);
}
return TRUE;
return true;
}
static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,

@ -209,7 +209,7 @@ static int DetectHttpRequestLineTest02(void)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -239,7 +239,7 @@ static int DetectHttpRequestLineTest02(void)
AppLayerParserThreadCtxFree(alp_tctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;
@ -283,7 +283,7 @@ static int DetectHttpRequestLineWrapper(const char *sig, const int expectation)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -313,7 +313,7 @@ static int DetectHttpRequestLineWrapper(const char *sig, const int expectation)
AppLayerParserThreadCtxFree(alp_tctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;

@ -214,7 +214,7 @@ static int DetectHttpResponseLineTest02(void)
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -252,7 +252,7 @@ static int DetectHttpResponseLineTest02(void)
AppLayerParserThreadCtxFree(alp_tctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;

@ -75,7 +75,7 @@ void DetectIcmpIdRegister (void)
static inline bool GetIcmpId(Packet *p, uint16_t *id)
{
if (PKT_IS_PSEUDOPKT(p))
return FALSE;
return false;
uint16_t pid;
if (PKT_IS_ICMPV4(p)) {
@ -96,7 +96,7 @@ static inline bool GetIcmpId(Packet *p, uint16_t *id)
break;
default:
SCLogDebug("Packet has no id field");
return FALSE;
return false;
}
} else if (PKT_IS_ICMPV6(p)) {
switch (ICMPV6_GET_TYPE(p)) {
@ -110,15 +110,15 @@ static inline bool GetIcmpId(Packet *p, uint16_t *id)
break;
default:
SCLogDebug("Packet has no id field");
return FALSE;
return false;
}
} else {
SCLogDebug("Packet not ICMPV4 nor ICMPV6");
return FALSE;
return false;
}
*id = pid;
return TRUE;
return true;
}
/**
@ -137,7 +137,7 @@ static int DetectIcmpIdMatch (DetectEngineThreadCtx *det_ctx, Packet *p,
{
uint16_t pid;
if (GetIcmpId(p, &pid) == FALSE)
if (!GetIcmpId(p, &pid))
return 0;
const DetectIcmpIdData *iid = (const DetectIcmpIdData *)ctx;
@ -274,7 +274,7 @@ PrefilterPacketIcmpIdMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const void
const PrefilterPacketHeaderCtx *ctx = pectx;
uint16_t pid;
if (GetIcmpId(p, &pid) == FALSE)
if (!GetIcmpId(p, &pid))
return;
if (pid == ctx->v1.u16[0])
@ -296,8 +296,8 @@ PrefilterPacketIcmpIdCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectIcmpIdData *a = smctx;
if (v.u16[0] == a->id)
return TRUE;
return FALSE;
return true;
return false;
}
static int PrefilterSetupIcmpId(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ -314,10 +314,10 @@ static bool PrefilterIcmpIdIsPrefilterable(const Signature *s)
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {
switch (sm->type) {
case DETECT_ICMP_ID:
return TRUE;
return true;
}
}
return FALSE;
return false;
}
#ifdef UNITTESTS

@ -77,7 +77,7 @@ static inline bool GetIcmpSeq(Packet *p, uint16_t *seq)
uint16_t seqn;
if (PKT_IS_PSEUDOPKT(p))
return FALSE;
return false;
if (PKT_IS_ICMPV4(p)) {
switch (ICMPV4_GET_TYPE(p)){
@ -97,7 +97,7 @@ static inline bool GetIcmpSeq(Packet *p, uint16_t *seq)
break;
default:
SCLogDebug("Packet has no seq field");
return FALSE;
return false;
}
} else if (PKT_IS_ICMPV6(p)) {
@ -112,15 +112,15 @@ static inline bool GetIcmpSeq(Packet *p, uint16_t *seq)
break;
default:
SCLogDebug("Packet has no seq field");
return FALSE;
return false;
}
} else {
SCLogDebug("Packet not ICMPV4 nor ICMPV6");
return FALSE;
return false;
}
*seq = seqn;
return TRUE;
return true;
}
/**
@ -139,7 +139,7 @@ static int DetectIcmpSeqMatch (DetectEngineThreadCtx *det_ctx, Packet *p,
{
uint16_t seqn;
if (GetIcmpSeq(p, &seqn) == FALSE)
if (!GetIcmpSeq(p, &seqn))
return 0;
const DetectIcmpSeqData *iseq = (const DetectIcmpSeqData *)ctx;
@ -278,7 +278,7 @@ PrefilterPacketIcmpSeqMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const voi
uint16_t seqn;
if (GetIcmpSeq(p, &seqn) == FALSE)
if (!GetIcmpSeq(p, &seqn))
return;
if (seqn == ctx->v1.u16[0])
@ -300,8 +300,8 @@ PrefilterPacketIcmpSeqCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectIcmpSeqData *a = smctx;
if (v.u16[0] == a->seq)
return TRUE;
return FALSE;
return true;
return false;
}
static int PrefilterSetupIcmpSeq(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ -318,10 +318,10 @@ static bool PrefilterIcmpSeqIsPrefilterable(const Signature *s)
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {
switch (sm->type) {
case DETECT_ICMP_SEQ:
return TRUE;
return true;
}
}
return FALSE;
return false;
}
#ifdef UNITTESTS
@ -439,4 +439,4 @@ static void DetectIcmpSeqRegisterTests (void)
UtRegisterTest("DetectIcmpSeqParseTest03", DetectIcmpSeqParseTest03);
UtRegisterTest("DetectIcmpSeqMatchTest01", DetectIcmpSeqMatchTest01);
}
#endif /* UNITTESTS */
#endif /* UNITTESTS */

@ -155,7 +155,7 @@ PrefilterPacketIcmpv6mtuMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const v
/* during setup Suricata will automatically see if there is another
* check that can be added: alproto, sport or dport */
const PrefilterPacketHeaderCtx *ctx = pectx;
if (PrefilterPacketHeaderExtraMatch(ctx, p) == FALSE)
if (!PrefilterPacketHeaderExtraMatch(ctx, p))
return;
/* if we match, add all the sigs that use this prefilter. This means

@ -346,8 +346,8 @@ PrefilterPacketICodeCompare(PrefilterPacketHeaderValue v, void *smctx)
if (v.u8[0] == a->mode &&
v.u8[1] == a->code1 &&
v.u8[2] == a->code2)
return TRUE;
return FALSE;
return true;
return false;
}
static int PrefilterSetupICode(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ -364,10 +364,10 @@ static bool PrefilterICodeIsPrefilterable(const Signature *s)
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {
switch (sm->type) {
case DETECT_ICODE:
return TRUE;
return true;
}
}
return FALSE;
return false;
}
#ifdef UNITTESTS

@ -229,7 +229,7 @@ PrefilterPacketIdMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const void *pe
return;
}
if (PrefilterPacketHeaderExtraMatch(ctx, p) == FALSE)
if (!PrefilterPacketHeaderExtraMatch(ctx, p))
return;
if (IPV4_GET_IPID(p) == ctx->v1.u16[0])
@ -251,8 +251,8 @@ PrefilterPacketIdCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectIdData *a = smctx;
if (v.u16[0] == a->id)
return TRUE;
return FALSE;
return true;
return false;
}
static int PrefilterSetupId(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ -269,10 +269,10 @@ static bool PrefilterIdIsPrefilterable(const Signature *s)
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {
switch (sm->type) {
case DETECT_ID:
return TRUE;
return true;
}
}
return FALSE;
return false;
}
#ifdef UNITTESTS /* UNITTESTS */
@ -404,4 +404,4 @@ void DetectIdRegisterTests(void)
UtRegisterTest("DetectIdTestMatch01", DetectIdTestMatch01);
}
#endif /* UNITTESTS */
#endif /* UNITTESTS */

@ -350,8 +350,8 @@ PrefilterPacketITypeCompare(PrefilterPacketHeaderValue v, void *smctx)
if (v.u8[0] == a->mode &&
v.u8[1] == a->type1 &&
v.u8[2] == a->type2)
return TRUE;
return FALSE;
return true;
return false;
}
static int PrefilterSetupIType(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ -368,10 +368,10 @@ static bool PrefilterITypeIsPrefilterable(const Signature *s)
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {
switch (sm->type) {
case DETECT_ITYPE:
return TRUE;
return true;
}
}
return FALSE;
return false;
}
#ifdef UNITTESTS

@ -215,7 +215,7 @@ static int LuaGetFlowvar(lua_State *luastate)
return ret;
if (lua_isnumber(luastate, 1)) {
ret = GetFlowVarById(luastate, f, &fv, FALSE, NULL);
ret = GetFlowVarById(luastate, f, &fv, false, NULL);
if (ret != 0 || fv == NULL)
return ret;
} else if (lua_isstring(luastate, 1)) {
@ -246,7 +246,7 @@ static int LuaSetFlowvarById(lua_State *luastate)
if (ret != 0)
return ret;
ret = GetFlowVarById(luastate, f, &fv, TRUE, &idx);
ret = GetFlowVarById(luastate, f, &fv, true, &idx);
if (ret != 0)
return ret;
@ -359,7 +359,7 @@ static int LuaGetFlowint(lua_State *luastate)
if (ret != 0)
return ret;
ret = GetFlowIntById(luastate, f, &fv, FALSE, NULL);
ret = GetFlowIntById(luastate, f, &fv, false, NULL);
if (ret != 0)
return ret;
@ -429,7 +429,7 @@ static int LuaIncrFlowint(lua_State *luastate)
if (ret != 0)
return ret;
ret = GetFlowIntById(luastate, f, &fv, TRUE, &idx);
ret = GetFlowIntById(luastate, f, &fv, true, &idx);
if (ret != 0)
return ret;
@ -461,7 +461,7 @@ static int LuaDecrFlowint(lua_State *luastate)
if (ret != 0)
return ret;
ret = GetFlowIntById(luastate, f, &fv, TRUE, &idx);
ret = GetFlowIntById(luastate, f, &fv, true, &idx);
if (ret != 0)
return ret;

@ -1222,7 +1222,7 @@ static int LuaMatchTest01(void)
p2->flowflags |= FLOW_PKT_ESTABLISHED;
p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -1305,7 +1305,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -1383,7 +1383,7 @@ static int LuaMatchTest01a(void)
p2->flowflags |= FLOW_PKT_ESTABLISHED;
p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -1466,7 +1466,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -1543,7 +1543,7 @@ static int LuaMatchTest02(void)
p2->flowflags |= FLOW_PKT_ESTABLISHED;
p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -1599,7 +1599,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -1676,7 +1676,7 @@ static int LuaMatchTest02a(void)
p2->flowflags |= FLOW_PKT_ESTABLISHED;
p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -1732,7 +1732,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -1809,7 +1809,7 @@ static int LuaMatchTest03(void)
p2->flowflags |= FLOW_PKT_ESTABLISHED;
p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -1865,7 +1865,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -1942,7 +1942,7 @@ static int LuaMatchTest03a(void)
p2->flowflags |= FLOW_PKT_ESTABLISHED;
p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -1998,7 +1998,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -2075,7 +2075,7 @@ static int LuaMatchTest04(void)
p2->flowflags |= FLOW_PKT_ESTABLISHED;
p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -2151,7 +2151,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -2230,7 +2230,7 @@ static int LuaMatchTest04a(void)
p2->flowflags |= FLOW_PKT_ESTABLISHED;
p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -2306,7 +2306,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -2378,7 +2378,7 @@ static int LuaMatchTest05(void)
p2->flowflags |= FLOW_PKT_ESTABLISHED;
p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -2454,7 +2454,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -2526,7 +2526,7 @@ static int LuaMatchTest05a(void)
p2->flowflags |= FLOW_PKT_ESTABLISHED;
p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -2602,7 +2602,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -2679,7 +2679,7 @@ static int LuaMatchTest06(void)
p2->flowflags |= FLOW_PKT_ESTABLISHED;
p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -2755,7 +2755,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -2832,7 +2832,7 @@ static int LuaMatchTest06a(void)
p2->flowflags |= FLOW_PKT_ESTABLISHED;
p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -2908,7 +2908,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);

@ -1679,7 +1679,7 @@ static int SigValidate(DetectEngineCtx *de_ctx, Signature *s)
/* run buffer type validation callbacks if any */
if (s->init_data->smlists[DETECT_SM_LIST_PMATCH]) {
if (DetectContentPMATCHValidateCallback(s) == FALSE)
if (!DetectContentPMATCHValidateCallback(s))
SCReturnInt(0);
}
@ -1705,7 +1705,7 @@ static int SigValidate(DetectEngineCtx *de_ctx, Signature *s)
}
}
if (DetectBufferRunValidateCallback(de_ctx, x, s, &de_ctx->sigerror) == FALSE) {
if (!DetectBufferRunValidateCallback(de_ctx, x, s, &de_ctx->sigerror)) {
SCReturnInt(0);
}
}

@ -1681,7 +1681,7 @@ static int DetectPcreTestSig01(void)
memset(&th_v, 0, sizeof(th_v));
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
p = UTHBuildPacket(buf, buflen, IPPROTO_TCP);
FAIL_IF_NULL(p);
@ -1722,7 +1722,7 @@ static int DetectPcreTestSig01(void)
UTHRemoveSessionFromFlow(f);
UTHFreeFlow(f);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
PASS;
}
@ -1880,7 +1880,7 @@ static int DetectPcreModifPTest04(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -1920,7 +1920,7 @@ static int DetectPcreModifPTest04(void)
if (de_ctx != NULL) SigCleanSignatures(de_ctx);
if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;
@ -1992,7 +1992,7 @@ static int DetectPcreModifPTest05(void)
p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -2045,7 +2045,7 @@ static int DetectPcreModifPTest05(void)
if (de_ctx != NULL) SigCleanSignatures(de_ctx);
if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -2140,7 +2140,7 @@ static int DetectPcreTestSig09(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -2179,7 +2179,7 @@ static int DetectPcreTestSig09(void)
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
PASS;
}
@ -2219,7 +2219,7 @@ static int DetectPcreTestSig10(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -2258,7 +2258,7 @@ static int DetectPcreTestSig10(void)
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
PASS;
}
@ -2298,7 +2298,7 @@ static int DetectPcreTestSig11(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -2337,7 +2337,7 @@ static int DetectPcreTestSig11(void)
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
PASS;
}
@ -2377,7 +2377,7 @@ static int DetectPcreTestSig12(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -2416,7 +2416,7 @@ static int DetectPcreTestSig12(void)
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
PASS;
}
@ -2456,7 +2456,7 @@ static int DetectPcreTestSig13(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -2495,7 +2495,7 @@ static int DetectPcreTestSig13(void)
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
PASS;
}
@ -2535,7 +2535,7 @@ static int DetectPcreTestSig14(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -2574,7 +2574,7 @@ static int DetectPcreTestSig14(void)
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
PASS;
}
@ -2614,7 +2614,7 @@ static int DetectPcreTestSig15(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -2654,7 +2654,7 @@ static int DetectPcreTestSig15(void)
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
PASS;
}
@ -2694,7 +2694,7 @@ static int DetectPcreTestSig16(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -2734,7 +2734,7 @@ static int DetectPcreTestSig16(void)
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
UTHFreePackets(&p, 1);
PASS;
}
@ -2778,7 +2778,7 @@ static int DetectPcreTxBodyChunksTest01(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
AppLayerHtpEnableRequestBodyCallback();
@ -2835,7 +2835,7 @@ static int DetectPcreTxBodyChunksTest01(void)
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
FLOWLOCK_UNLOCK(&f);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -2883,7 +2883,7 @@ static int DetectPcreTxBodyChunksTest02(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -3004,7 +3004,7 @@ static int DetectPcreTxBodyChunksTest02(void)
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -3052,7 +3052,7 @@ static int DetectPcreTxBodyChunksTest03(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -3155,7 +3155,7 @@ static int DetectPcreTxBodyChunksTest03(void)
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
PASS;
@ -3207,7 +3207,7 @@ static int DetectPcreFlowvarCapture01(void)
p1->flowflags |= FLOW_PKT_ESTABLISHED;
p1->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -3256,7 +3256,7 @@ static int DetectPcreFlowvarCapture01(void)
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
PASS;
@ -3308,7 +3308,7 @@ static int DetectPcreFlowvarCapture02(void)
p1->flowflags |= FLOW_PKT_ESTABLISHED;
p1->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -3375,7 +3375,7 @@ static int DetectPcreFlowvarCapture02(void)
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
PASS;
@ -3424,7 +3424,7 @@ static int DetectPcreFlowvarCapture03(void)
p1->flowflags |= FLOW_PKT_ESTABLISHED;
p1->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF(de_ctx == NULL);
@ -3473,7 +3473,7 @@ static int DetectPcreFlowvarCapture03(void)
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
PASS;

@ -118,9 +118,7 @@ static int DetectSshHasshServerSetup(DetectEngineCtx *de_ctx, Signature *s, cons
}
static _Bool DetectSshHasshServerHashValidateCallback(const Signature *s,
const char **sigerror)
static bool DetectSshHasshServerHashValidateCallback(const Signature *s, const char **sigerror)
{
const SigMatch *sm = s->init_data->smlists[g_ssh_hassh_buffer_id];
for ( ; sm != NULL; sm = sm->next)
@ -143,7 +141,7 @@ static _Bool DetectSshHasshServerHashValidateCallback(const Signature *s,
"be 32 characters long). This rule will therefore "
"never match.";
SCLogWarning(SC_WARN_POOR_RULE, "rule %u: %s", s->id, *sigerror);
return FALSE;
return false;
}
for (size_t i = 0; i < cd->content_len; ++i)
{
@ -152,12 +150,12 @@ static _Bool DetectSshHasshServerHashValidateCallback(const Signature *s,
*sigerror = "Invalid ssh.hassh.server string (should be string of hexademical characters)."
"This rule will therefore never match.";
SCLogWarning(SC_WARN_POOR_RULE, "rule %u: %s", s->id, *sigerror);
return FALSE;
return false;
}
}
}
return TRUE;
return true;
}
static void DetectSshHasshServerHashSetupCallback(const DetectEngineCtx *de_ctx,

@ -143,7 +143,7 @@ static bool DetectSshHasshHashValidateCallback(const Signature *s,
"be 32 characters long). This rule will therefore "
"never match.";
SCLogWarning(SC_WARN_POOR_RULE, "rule %u: %s", s->id, *sigerror);
return FALSE;
return false;
}
for (size_t i = 0; i < cd->content_len; ++i)
{
@ -152,12 +152,12 @@ static bool DetectSshHasshHashValidateCallback(const Signature *s,
*sigerror = "Invalid ssh.hassh string (should be string of hexademical characters)."
"This rule will therefore never match.";
SCLogWarning(SC_WARN_POOR_RULE, "rule %u: %s", s->id, *sigerror);
return FALSE;
return false;
}
}
}
return TRUE;
return true;
}
static void DetectSshHasshHashSetupCallback(const DetectEngineCtx *de_ctx,

@ -160,7 +160,7 @@ PrefilterPacketAckMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const void *p
{
const PrefilterPacketHeaderCtx *ctx = pectx;
if (PrefilterPacketHeaderExtraMatch(ctx, p) == FALSE)
if (!PrefilterPacketHeaderExtraMatch(ctx, p))
return;
if ((p->proto) == IPPROTO_TCP && !(PKT_IS_PSEUDOPKT(p)) &&
@ -183,8 +183,8 @@ PrefilterPacketAckCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectAckData *a = smctx;
if (v.u32[0] == a->ack)
return TRUE;
return FALSE;
return true;
return false;
}
static int PrefilterSetupTcpAck(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ -201,10 +201,10 @@ static bool PrefilterTcpAckIsPrefilterable(const Signature *s)
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {
switch (sm->type) {
case DETECT_ACK:
return TRUE;
return true;
}
}
return FALSE;
return false;
}
#ifdef UNITTESTS
@ -334,4 +334,4 @@ static void DetectAckRegisterTests(void)
{
UtRegisterTest("DetectAckSigTest01", DetectAckSigTest01);
}
#endif /* UNITTESTS */
#endif /* UNITTESTS */

@ -554,7 +554,7 @@ PrefilterPacketFlagsMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const void
}
const PrefilterPacketHeaderCtx *ctx = pectx;
if (PrefilterPacketHeaderExtraMatch(ctx, p) == FALSE)
if (!PrefilterPacketHeaderExtraMatch(ctx, p))
return;
const uint8_t flags = p->tcph->th_flags;
@ -582,8 +582,8 @@ PrefilterPacketFlagsCompare(PrefilterPacketHeaderValue v, void *smctx)
if (v.u8[0] == a->modifier &&
v.u8[1] == a->flags &&
v.u8[2] == a->ignored_flags)
return TRUE;
return FALSE;
return true;
return false;
}
static int PrefilterSetupTcpFlags(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ -601,10 +601,10 @@ static bool PrefilterTcpFlagsIsPrefilterable(const Signature *s)
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {
switch (sm->type) {
case DETECT_FLAGS:
return TRUE;
return true;
}
}
return FALSE;
return false;
}
/*
@ -1422,4 +1422,4 @@ static void FlagsRegisterTests(void)
UtRegisterTest("FlagsTestParse16", FlagsTestParse16);
UtRegisterTest("FlagsTestParse17", FlagsTestParse17);
}
#endif /* UNITTESTS */
#endif /* UNITTESTS */

@ -155,7 +155,7 @@ PrefilterPacketSeqMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const void *p
{
const PrefilterPacketHeaderCtx *ctx = pectx;
if (PrefilterPacketHeaderExtraMatch(ctx, p) == FALSE)
if (!PrefilterPacketHeaderExtraMatch(ctx, p))
return;
if ((p->proto) == IPPROTO_TCP && !(PKT_IS_PSEUDOPKT(p)) &&
@ -178,8 +178,8 @@ PrefilterPacketSeqCompare(PrefilterPacketHeaderValue v, void *smctx)
{
const DetectSeqData *a = smctx;
if (v.u32[0] == a->seq)
return TRUE;
return FALSE;
return true;
return false;
}
static int PrefilterSetupTcpSeq(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ -196,10 +196,10 @@ static bool PrefilterTcpSeqIsPrefilterable(const Signature *s)
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {
switch (sm->type) {
case DETECT_SEQ:
return TRUE;
return true;
}
}
return FALSE;
return false;
}
@ -299,4 +299,4 @@ static void DetectSeqRegisterTests(void)
UtRegisterTest("DetectSeqSigTest01", DetectSeqSigTest01);
UtRegisterTest("DetectSeqSigTest02", DetectSeqSigTest02);
}
#endif /* UNITTESTS */
#endif /* UNITTESTS */

@ -325,7 +325,7 @@ PrefilterPacketTcpmssMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const void
/* during setup Suricata will automatically see if there is another
* check that can be added: alproto, sport or dport */
const PrefilterPacketHeaderCtx *ctx = pectx;
if (PrefilterPacketHeaderExtraMatch(ctx, p) == FALSE)
if (!PrefilterPacketHeaderExtraMatch(ctx, p))
return;
/* if we match, add all the sigs that use this prefilter. This means

@ -152,7 +152,7 @@ static int DetectTemplateRustBufferTest(void)
p->flow = &f;
p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST;
p->flowflags |= FLOW_PKT_TOSERVER | FLOW_PKT_ESTABLISHED;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -197,7 +197,7 @@ static int DetectTemplateRustBufferTest(void)
SigGroupCleanup(de_ctx);
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);

@ -345,7 +345,7 @@ PrefilterPacketTemplate2Match(DetectEngineThreadCtx *det_ctx, Packet *p, const v
/* during setup Suricata will automatically see if there is another
* check that can be added: alproto, sport or dport */
const PrefilterPacketHeaderCtx *ctx = pectx;
if (PrefilterPacketHeaderExtraMatch(ctx, p) == FALSE)
if (!PrefilterPacketHeaderExtraMatch(ctx, p))
return;
/* if we match, add all the sigs that use this prefilter. This means
@ -373,8 +373,8 @@ PrefilterPacketTemplate2Compare(PrefilterPacketHeaderValue v, void *smctx)
if (v.u8[0] == a->mode &&
v.u8[1] == a->arg1 &&
v.u8[2] == a->arg2)
return TRUE;
return FALSE;
return true;
return false;
}
static int PrefilterSetupTemplate2(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ -391,10 +391,10 @@ static bool PrefilterTemplate2IsPrefilterable(const Signature *s)
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {
switch (sm->type) {
case DETECT_TEMPLATE2:
return TRUE;
return true;
}
}
return FALSE;
return false;
}
#ifdef UNITTESTS

@ -163,25 +163,25 @@ static bool DetectTlsFingerprintValidateCallback(const Signature *s,
*sigerror = "Invalid length of the specified fingerprint. "
"This rule will therefore never match.";
SCLogWarning(SC_WARN_POOR_RULE, "rule %u: %s", s->id, *sigerror);
return FALSE;
return false;
}
bool have_delimiters = FALSE;
bool have_delimiters = false;
uint32_t u;
for (u = 0; u < cd->content_len; u++)
{
if (cd->content[u] == ':') {
have_delimiters = TRUE;
have_delimiters = true;
break;
}
}
if (have_delimiters == FALSE) {
if (!have_delimiters) {
*sigerror = "No colon delimiters ':' detected in content after "
"tls.cert_fingerprint. This rule will therefore "
"never match.";
SCLogWarning(SC_WARN_POOR_RULE, "rule %u: %s", s->id, *sigerror);
return FALSE;
return false;
}
if (cd->flags & DETECT_CONTENT_NOCASE) {
@ -192,7 +192,7 @@ static bool DetectTlsFingerprintValidateCallback(const Signature *s,
}
}
return TRUE;
return true;
}
static void DetectTlsFingerprintSetupCallback(const DetectEngineCtx *de_ctx,
@ -206,13 +206,13 @@ static void DetectTlsFingerprintSetupCallback(const DetectEngineCtx *de_ctx,
DetectContentData *cd = (DetectContentData *)sm->ctx;
bool changed = FALSE;
bool changed = false;
uint32_t u;
for (u = 0; u < cd->content_len; u++)
{
if (isupper(cd->content[u])) {
cd->content[u] = tolower(cd->content[u]);
changed = TRUE;
changed = true;
}
}

@ -167,22 +167,22 @@ static bool DetectTlsSerialValidateCallback(const Signature *s,
/* no need to worry about this if the content is short enough */
if (cd->content_len <= 2)
return TRUE;
return true;
uint32_t u;
for (u = 0; u < cd->content_len; u++)
if (cd->content[u] == ':')
return TRUE;
return true;
*sigerror = "No colon delimiters ':' detected in content after "
"tls.cert_serial. This rule will therefore never "
"match.";
SCLogWarning(SC_WARN_POOR_RULE, "rule %u: %s", s->id, *sigerror);
return FALSE;
return false;
}
return TRUE;
return true;
}
static void DetectTlsSerialSetupCallback(const DetectEngineCtx *de_ctx,
@ -196,13 +196,13 @@ static void DetectTlsSerialSetupCallback(const DetectEngineCtx *de_ctx,
DetectContentData *cd = (DetectContentData *)sm->ctx;
bool changed = FALSE;
bool changed = false;
uint32_t u;
for (u = 0; u < cd->content_len; u++)
{
if (islower(cd->content[u])) {
cd->content[u] = toupper(cd->content[u]);
changed = TRUE;
changed = true;
}
}

@ -179,16 +179,16 @@ static bool DetectTlsJa3HashValidateCallback(const Signature *s,
}
if (cd->content_len == 32)
return TRUE;
return true;
*sigerror = "Invalid length of the specified JA3 hash (should "
"be 32 characters long). This rule will therefore "
"never match.";
SCLogWarning(SC_WARN_POOR_RULE, "rule %u: %s", s->id, *sigerror);
return FALSE;
return false;
}
return TRUE;
return true;
}
static void DetectTlsJa3HashSetupCallback(const DetectEngineCtx *de_ctx,
@ -202,13 +202,13 @@ static void DetectTlsJa3HashSetupCallback(const DetectEngineCtx *de_ctx,
DetectContentData *cd = (DetectContentData *)sm->ctx;
bool changed = FALSE;
bool changed = false;
uint32_t u;
for (u = 0; u < cd->content_len; u++)
{
if (isupper(cd->content[u])) {
cd->content[u] = tolower(cd->content[u]);
changed = TRUE;
changed = true;
}
}

@ -177,16 +177,16 @@ static bool DetectTlsJa3SHashValidateCallback(const Signature *s,
}
if (cd->content_len == 32)
return TRUE;
return true;
*sigerror = "Invalid length of the specified JA3S hash (should "
"be 32 characters long). This rule will therefore "
"never match.";
SCLogError(SC_ERR_INVALID_RULE_ARGUMENT, "rule %u: %s", s->id, *sigerror);
return FALSE;
return false;
}
return TRUE;
return true;
}
static void DetectTlsJa3SHashSetupCallback(const DetectEngineCtx *de_ctx,
@ -200,13 +200,13 @@ static void DetectTlsJa3SHashSetupCallback(const DetectEngineCtx *de_ctx,
DetectContentData *cd = (DetectContentData *)sm->ctx;
bool changed = FALSE;
bool changed = false;
uint32_t u;
for (u = 0; u < cd->content_len; u++)
{
if (isupper(cd->content[u])) {
cd->content[u] = tolower(cd->content[u]);
changed = TRUE;
changed = true;
}
}

@ -325,7 +325,7 @@ PrefilterPacketTtlMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const void *p
}
const PrefilterPacketHeaderCtx *ctx = pectx;
if (PrefilterPacketHeaderExtraMatch(ctx, p) == FALSE)
if (!PrefilterPacketHeaderExtraMatch(ctx, p))
return;
if (TtlMatch(pttl, ctx->v1.u8[0], ctx->v1.u8[1], ctx->v1.u8[2]))
@ -351,8 +351,8 @@ PrefilterPacketTtlCompare(PrefilterPacketHeaderValue v, void *smctx)
if (v.u8[0] == a->mode &&
v.u8[1] == a->ttl1 &&
v.u8[2] == a->ttl2)
return TRUE;
return FALSE;
return true;
return false;
}
static int PrefilterSetupTtl(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
@ -369,10 +369,10 @@ static bool PrefilterTtlIsPrefilterable(const Signature *s)
for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH] ; sm != NULL; sm = sm->next) {
switch (sm->type) {
case DETECT_TTL:
return TRUE;
return true;
}
}
return FALSE;
return false;
}
#ifdef UNITTESTS

@ -222,7 +222,7 @@ static int HTTPUriTest01(void)
f.alproto = ALPROTO_HTTP1;
f.flags |= FLOW_IPV4;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1,
@ -262,7 +262,7 @@ static int HTTPUriTest01(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOWLOCK_UNLOCK(&f);
FLOW_DESTROY(&f);
return result;
@ -291,7 +291,7 @@ static int HTTPUriTest02(void)
f.alproto = ALPROTO_HTTP1;
f.flags |= FLOW_IPV4;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1,
@ -331,7 +331,7 @@ static int HTTPUriTest02(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOWLOCK_UNLOCK(&f);
FLOW_DESTROY(&f);
return result;
@ -360,7 +360,7 @@ static int HTTPUriTest03(void)
f.alproto = ALPROTO_HTTP1;
f.flags |= FLOW_IPV4;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1,
@ -400,7 +400,7 @@ static int HTTPUriTest03(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOWLOCK_UNLOCK(&f);
FLOW_DESTROY(&f);
return result;
@ -430,7 +430,7 @@ static int HTTPUriTest04(void)
f.alproto = ALPROTO_HTTP1;
f.flags |= FLOW_IPV4;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
FLOWLOCK_WRLOCK(&f);
r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1,
@ -470,7 +470,7 @@ static int HTTPUriTest04(void)
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOWLOCK_UNLOCK(&f);
FLOW_DESTROY(&f);
return result;
@ -534,7 +534,7 @@ static int DetectUriSigTest02(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -607,7 +607,7 @@ end:
if (det_ctx != NULL) DetectEngineThreadCtxDeinit(&th_v, det_ctx);
if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
return result;
@ -650,7 +650,7 @@ static int DetectUriSigTest03(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -747,7 +747,7 @@ end:
if (det_ctx != NULL) DetectEngineThreadCtxDeinit(&th_v, det_ctx);
if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
return result;
@ -971,7 +971,7 @@ static int DetectUriSigTest05(void)
AppLayerParserThreadCtx *alp_tctx = AppLayerParserThreadCtxAlloc();
memset(&th_v, 0, sizeof(th_v));
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
p = UTHBuildPacket(httpbuf1, httplen1, IPPROTO_TCP);
FAIL_IF_NULL(p);
@ -1030,7 +1030,7 @@ static int DetectUriSigTest05(void)
UTHRemoveSessionFromFlow(f);
UTHFreeFlow(f);
UTHFreePackets(&p, 1);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
@ -1050,7 +1050,7 @@ static int DetectUriSigTest06(void)
AppLayerParserThreadCtx *alp_tctx = AppLayerParserThreadCtxAlloc();
memset(&th_v, 0, sizeof(th_v));
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
p = UTHBuildPacket(httpbuf1, httplen1, IPPROTO_TCP);
FAIL_IF_NULL(p);
@ -1119,7 +1119,7 @@ static int DetectUriSigTest06(void)
UTHRemoveSessionFromFlow(f);
UTHFreeFlow(f);
UTHFreePackets(&p, 1);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}
@ -1139,7 +1139,7 @@ static int DetectUriSigTest07(void)
AppLayerParserThreadCtx *alp_tctx = AppLayerParserThreadCtxAlloc();
memset(&th_v, 0, sizeof(th_v));
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
p = UTHBuildPacket(httpbuf1, httplen1, IPPROTO_TCP);
FAIL_IF_NULL(p);
@ -1208,7 +1208,7 @@ static int DetectUriSigTest07(void)
UTHRemoveSessionFromFlow(f);
UTHFreeFlow(f);
UTHFreePackets(&p, 1);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
PASS;
}

@ -659,7 +659,7 @@ static int DetectUrilenSigTest01(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -723,7 +723,7 @@ end:
if (de_ctx != NULL) SigCleanSignatures(de_ctx);
if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
return result;

@ -385,8 +385,8 @@ static void XBitsTestSetup(void)
HostBitInitCtx();
IPPairBitInitCtx();
StorageFinalize();
HostInitConfig(TRUE);
IPPairInitConfig(TRUE);
HostInitConfig(true);
IPPairInitConfig(true);
}
static void XBitsTestShutdown(void)
@ -547,4 +547,4 @@ static void XBitsRegisterTests(void)
UtRegisterTest("XBitsTestSig01", XBitsTestSig01);
UtRegisterTest("XBitsTestSig02", XBitsTestSig02);
}
#endif /* UNITTESTS */
#endif /* UNITTESTS */

@ -462,7 +462,7 @@ static inline int FlowCreateCheck(const Packet *p, const bool emerg)
* that is not a TCP SYN packet. */
if (emerg) {
if (PKT_IS_TCP(p)) {
if (p->tcph->th_flags == TH_SYN || stream_config.midstream == FALSE) {
if (p->tcph->th_flags == TH_SYN || !stream_config.midstream) {
;
} else {
return 0;

@ -961,7 +961,7 @@ static TmEcode FlowManager(ThreadVars *th_v, void *thread_data)
FlowTimeoutsReset();
emerg = false;
prev_emerg = FALSE;
prev_emerg = false;
emerg_over_cnt = 0;
hash_pass_iter = 0;
SCLogNotice("Flow emergency mode over, back to normal... unsetting"

@ -513,7 +513,7 @@ void FlowHandlePacket(ThreadVars *tv, FlowLookupStruct *fls, Packet *p)
/** \brief initialize the configuration
* \warning Not thread safe */
void FlowInitConfig(char quiet)
void FlowInitConfig(bool quiet)
{
SCLogDebug("initializing flow engine...");
@ -618,14 +618,14 @@ void FlowInitConfig(char quiet)
}
(void) SC_ATOMIC_ADD(flow_memuse, (flow_config.hash_size * sizeof(FlowBucket)));
if (quiet == FALSE) {
if (!quiet) {
SCLogConfig("allocated %"PRIu64" bytes of memory for the flow hash... "
"%" PRIu32 " buckets of size %" PRIuMAX "",
SC_ATOMIC_GET(flow_memuse), flow_config.hash_size,
(uintmax_t)sizeof(FlowBucket));
}
FlowSparePoolInit();
if (quiet == FALSE) {
if (!quiet) {
SCLogConfig("flow memory usage: %"PRIu64" bytes, maximum: %"PRIu64,
SC_ATOMIC_GET(flow_memuse), SC_ATOMIC_GET(flow_config.memcap));
}

@ -39,8 +39,8 @@ typedef struct FlowStorageId FlowStorageId;
* The actual declaration is in app-layer-parser.c */
typedef struct AppLayerParserState_ AppLayerParserState;
#define FLOW_QUIET TRUE
#define FLOW_VERBOSE FALSE
#define FLOW_QUIET true
#define FLOW_VERBOSE false
#define TOSERVER 0
#define TOCLIENT 1
@ -550,7 +550,7 @@ typedef struct FlowLookupStruct_ // TODO name
* balancing. */
void FlowSetupPacket(Packet *p);
void FlowHandlePacket (ThreadVars *, FlowLookupStruct *, Packet *);
void FlowInitConfig (char);
void FlowInitConfig(bool);
void FlowPrintQueueInfo (void);
void FlowShutdown(void);
void FlowSetIPOnlyFlag(Flow *, int);

@ -206,7 +206,7 @@ static int HostBitTest01 (void)
{
int ret = 0;
HostInitConfig(TRUE);
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
goto end;
@ -227,7 +227,7 @@ static int HostBitTest02 (void)
{
int ret = 0;
HostInitConfig(TRUE);
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
goto end;
@ -246,7 +246,7 @@ static int HostBitTest03 (void)
{
int ret = 0;
HostInitConfig(TRUE);
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
goto end;
@ -279,7 +279,7 @@ static int HostBitTest04 (void)
{
int ret = 0;
HostInitConfig(TRUE);
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
goto end;
@ -303,7 +303,7 @@ static int HostBitTest05 (void)
{
int ret = 0;
HostInitConfig(TRUE);
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
goto end;
@ -327,7 +327,7 @@ static int HostBitTest06 (void)
{
int ret = 0;
HostInitConfig(TRUE);
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
goto end;
@ -351,7 +351,7 @@ static int HostBitTest07 (void)
{
int ret = 0;
HostInitConfig(TRUE);
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
goto end;
@ -375,7 +375,7 @@ static int HostBitTest08 (void)
{
int ret = 0;
HostInitConfig(TRUE);
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
goto end;
@ -408,7 +408,7 @@ static int HostBitTest09 (void)
{
int ret = 0;
HostInitConfig(TRUE);
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
goto end;
@ -441,7 +441,7 @@ static int HostBitTest10 (void)
{
int ret = 0;
HostInitConfig(TRUE);
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
goto end;
@ -474,7 +474,7 @@ static int HostBitTest11 (void)
{
int ret = 0;
HostInitConfig(TRUE);
HostInitConfig(true);
Host *h = HostAlloc();
if (h == NULL)
goto end;

@ -170,7 +170,7 @@ void HostClearMemory(Host *h)
/** \brief initialize the configuration
* \warning Not thread safe */
void HostInitConfig(char quiet)
void HostInitConfig(bool quiet)
{
SCLogDebug("initializing host engine...");
if (HostStorageSize() > 0)
@ -252,7 +252,7 @@ void HostInitConfig(char quiet)
}
(void) SC_ATOMIC_ADD(host_memuse, (host_config.hash_size * sizeof(HostHashRow)));
if (quiet == FALSE) {
if (!quiet) {
SCLogConfig("allocated %"PRIu64" bytes of memory for the host hash... "
"%" PRIu32 " buckets of size %" PRIuMAX "",
SC_ATOMIC_GET(host_memuse), host_config.hash_size,
@ -277,7 +277,7 @@ void HostInitConfig(char quiet)
HostEnqueue(&host_spare_q,h);
}
if (quiet == FALSE) {
if (!quiet) {
SCLogConfig("preallocated %" PRIu32 " hosts of size %" PRIu16 "",
host_spare_q.len, g_host_size);
SCLogConfig("host memory usage: %"PRIu64" bytes, maximum: %"PRIu64,

@ -133,7 +133,7 @@ SC_ATOMIC_EXTERN(uint64_t,host_memuse);
SC_ATOMIC_EXTERN(uint32_t,host_counter);
SC_ATOMIC_EXTERN(uint32_t,host_prune_idx);
void HostInitConfig(char quiet);
void HostInitConfig(bool quiet);
void HostShutdown(void);
void HostCleanup(void);

@ -190,7 +190,7 @@ static int IPPairBitTest01 (void)
{
int ret = 0;
IPPairInitConfig(TRUE);
IPPairInitConfig(true);
IPPair *h = IPPairAlloc();
if (h == NULL)
goto end;
@ -211,7 +211,7 @@ static int IPPairBitTest02 (void)
{
int ret = 0;
IPPairInitConfig(TRUE);
IPPairInitConfig(true);
IPPair *h = IPPairAlloc();
if (h == NULL)
goto end;
@ -230,7 +230,7 @@ static int IPPairBitTest03 (void)
{
int ret = 0;
IPPairInitConfig(TRUE);
IPPairInitConfig(true);
IPPair *h = IPPairAlloc();
if (h == NULL)
goto end;
@ -263,7 +263,7 @@ static int IPPairBitTest04 (void)
{
int ret = 0;
IPPairInitConfig(TRUE);
IPPairInitConfig(true);
IPPair *h = IPPairAlloc();
if (h == NULL)
goto end;
@ -287,7 +287,7 @@ static int IPPairBitTest05 (void)
{
int ret = 0;
IPPairInitConfig(TRUE);
IPPairInitConfig(true);
IPPair *h = IPPairAlloc();
if (h == NULL)
goto end;
@ -311,7 +311,7 @@ static int IPPairBitTest06 (void)
{
int ret = 0;
IPPairInitConfig(TRUE);
IPPairInitConfig(true);
IPPair *h = IPPairAlloc();
if (h == NULL)
goto end;
@ -335,7 +335,7 @@ static int IPPairBitTest07 (void)
{
int ret = 0;
IPPairInitConfig(TRUE);
IPPairInitConfig(true);
IPPair *h = IPPairAlloc();
if (h == NULL)
goto end;
@ -359,7 +359,7 @@ static int IPPairBitTest08 (void)
{
int ret = 0;
IPPairInitConfig(TRUE);
IPPairInitConfig(true);
IPPair *h = IPPairAlloc();
if (h == NULL)
goto end;
@ -392,7 +392,7 @@ static int IPPairBitTest09 (void)
{
int ret = 0;
IPPairInitConfig(TRUE);
IPPairInitConfig(true);
IPPair *h = IPPairAlloc();
if (h == NULL)
goto end;
@ -425,7 +425,7 @@ static int IPPairBitTest10 (void)
{
int ret = 0;
IPPairInitConfig(TRUE);
IPPairInitConfig(true);
IPPair *h = IPPairAlloc();
if (h == NULL)
goto end;
@ -458,7 +458,7 @@ static int IPPairBitTest11 (void)
{
int ret = 0;
IPPairInitConfig(TRUE);
IPPairInitConfig(true);
IPPair *h = IPPairAlloc();
if (h == NULL)
goto end;

@ -165,7 +165,7 @@ void IPPairClearMemory(IPPair *h)
/** \brief initialize the configuration
* \warning Not thread safe */
void IPPairInitConfig(char quiet)
void IPPairInitConfig(bool quiet)
{
SCLogDebug("initializing ippair engine...");
if (IPPairStorageSize() > 0)
@ -247,7 +247,7 @@ void IPPairInitConfig(char quiet)
}
(void) SC_ATOMIC_ADD(ippair_memuse, (ippair_config.hash_size * sizeof(IPPairHashRow)));
if (quiet == FALSE) {
if (!quiet) {
SCLogConfig("allocated %"PRIu64" bytes of memory for the ippair hash... "
"%" PRIu32 " buckets of size %" PRIuMAX "",
SC_ATOMIC_GET(ippair_memuse), ippair_config.hash_size,
@ -272,7 +272,7 @@ void IPPairInitConfig(char quiet)
IPPairEnqueue(&ippair_spare_q,h);
}
if (quiet == FALSE) {
if (!quiet) {
SCLogConfig("preallocated %" PRIu32 " ippairs of size %" PRIu16 "",
ippair_spare_q.len, g_ippair_size);
SCLogConfig("ippair memory usage: %"PRIu64" bytes, maximum: %"PRIu64,

@ -130,7 +130,7 @@ SC_ATOMIC_EXTERN(uint64_t,ippair_memuse);
SC_ATOMIC_EXTERN(uint32_t,ippair_counter);
SC_ATOMIC_EXTERN(uint32_t,ippair_prune_idx);
void IPPairInitConfig(char quiet);
void IPPairInitConfig(bool quiet);
void IPPairShutdown(void);
void IPPairCleanup(void);

@ -201,7 +201,7 @@ void TmModuleDecodeNFQRegister (void)
* \param quiet It tells the mode of operation, if it is TRUE nothing will
* be get printed.
*/
void NFQInitConfig(char quiet)
void NFQInitConfig(bool quiet)
{
intmax_t value = 0;
const char *nfq_mode = NULL;

@ -89,7 +89,7 @@ typedef struct NFQGlobalVars_
char unbind;
} NFQGlobalVars;
void NFQInitConfig(char quiet);
void NFQInitConfig(bool quiet);
int NFQRegisterQueue(const uint16_t number);
int NFQParseAndRegisterQueues(const char *queues);
int NFQGetQueueCount(void);

@ -359,7 +359,7 @@ int StreamTcpAppLayerIsDisabled(Flow *f)
return (ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED);
}
static int StreamTcpReassemblyConfig(char quiet)
static int StreamTcpReassemblyConfig(bool quiet)
{
uint32_t segment_prealloc = 2048;
ConfNode *seg = ConfGetNode("stream.reassembly.segment-prealloc");
@ -396,7 +396,7 @@ static int StreamTcpReassemblyConfig(char quiet)
return 0;
}
int StreamTcpReassembleInit(char quiet)
int StreamTcpReassembleInit(bool quiet)
{
/* init the memcap/use tracker */
StreamTcpReassembleInitMemuse();
@ -412,7 +412,7 @@ int StreamTcpReassembleInit(char quiet)
return 0;
}
void StreamTcpReassembleFree(char quiet)
void StreamTcpReassembleFree(bool quiet)
{
SCMutexLock(&segment_thread_pool_mutex);
if (segment_thread_pool != NULL) {
@ -2835,7 +2835,7 @@ static int StreamTcpReassembleTest40 (void)
ThreadVars tv;
memset(&tv, 0, sizeof (ThreadVars));
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
StreamTcpUTSetupSession(&ssn);
TcpReassemblyThreadCtx *ra_ctx = StreamTcpReassembleInitThreadCtx(&tv);
@ -2955,7 +2955,7 @@ static int StreamTcpReassembleTest40 (void)
StreamTcpUTClearSession(&ssn);
StreamTcpReassembleFreeThreadCtx(ra_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
SCFree(p);
UTHFreeFlow(f);
PASS;
@ -2964,7 +2964,7 @@ static int StreamTcpReassembleTest40 (void)
/** \test Test the memcap incrementing/decrementing and memcap check */
static int StreamTcpReassembleTest44(void)
{
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
uint32_t memuse = SC_ATOMIC_GET(ra_memuse);
StreamTcpReassembleIncrMemuse(500);
FAIL_IF(SC_ATOMIC_GET(ra_memuse) != (memuse+500));
@ -2972,7 +2972,7 @@ static int StreamTcpReassembleTest44(void)
FAIL_IF(SC_ATOMIC_GET(ra_memuse) != memuse);
FAIL_IF(StreamTcpReassembleCheckMemcap(500) != 1);
FAIL_IF(StreamTcpReassembleCheckMemcap((1 + memuse + SC_ATOMIC_GET(stream_config.reassembly_memcap))) != 0);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FAIL_IF(SC_ATOMIC_GET(ra_memuse) != 0);
PASS;
}
@ -3082,7 +3082,7 @@ static int StreamTcpReassembleTest47 (void)
memset(&pq,0,sizeof(PacketQueueNoLock));
memset(&tcph, 0, sizeof (TCPHdr));
memset(&tv, 0, sizeof (ThreadVars));
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
StreamTcpUTSetupSession(&ssn);
TcpReassemblyThreadCtx *ra_ctx = StreamTcpReassembleInitThreadCtx(&tv);
@ -3134,7 +3134,7 @@ static int StreamTcpReassembleTest47 (void)
StreamTcpUTClearSession(&ssn);
StreamTcpReassembleFreeThreadCtx(ra_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
SCFree(p);
UTHFreeFlow(f);
PASS;

@ -83,8 +83,8 @@ typedef struct TcpReassemblyThreadCtx_ {
void StreamTcpReassembleInitMemuse(void);
int StreamTcpReassembleHandleSegment(ThreadVars *, TcpReassemblyThreadCtx *, TcpSession *, TcpStream *, Packet *, PacketQueueNoLock *);
int StreamTcpReassembleInit(char);
void StreamTcpReassembleFree(char);
int StreamTcpReassembleInit(bool);
void StreamTcpReassembleFree(bool);
void StreamTcpReassembleRegisterTests(void);
TcpReassemblyThreadCtx *StreamTcpReassembleInitThreadCtx(ThreadVars *tv);
void StreamTcpReassembleFreeThreadCtx(TcpReassemblyThreadCtx *);

@ -43,15 +43,15 @@
void StreamTcpUTInit(TcpReassemblyThreadCtx **ra_ctx)
{
StreamTcpInitConfig(TRUE);
IPPairInitConfig(TRUE);
StreamTcpInitConfig(true);
IPPairInitConfig(true);
*ra_ctx = StreamTcpReassembleInitThreadCtx(NULL);
}
void StreamTcpUTDeinit(TcpReassemblyThreadCtx *ra_ctx)
{
StreamTcpReassembleFreeThreadCtx(ra_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
stream_config.flags &= ~STREAMTCP_INIT_FLAG_INLINE;
}

@ -96,7 +96,7 @@
static int StreamTcpHandleFin(ThreadVars *tv, StreamTcpThread *, TcpSession *, Packet *, PacketQueueNoLock *);
void StreamTcpReturnStreamSegments (TcpStream *);
void StreamTcpInitConfig(char);
void StreamTcpInitConfig(bool);
int StreamTcpGetFlowState(void *);
void StreamTcpSetOSPolicy(TcpStream*, Packet*);
@ -358,11 +358,11 @@ static int RandomGetWrap(void)
/** \brief To initialize the stream global configuration data
*
* \param quiet It tells the mode of operation, if it is TRUE nothing will
* \param quiet It tells the mode of operation, if it is true nothing will
* be get printed.
*/
void StreamTcpInitConfig(char quiet)
void StreamTcpInitConfig(bool quiet)
{
intmax_t value = 0;
uint16_t rdrange = 10;
@ -667,7 +667,7 @@ void StreamTcpInitConfig(char quiet)
#endif
}
void StreamTcpFreeConfig(char quiet)
void StreamTcpFreeConfig(bool quiet)
{
StreamTcpReassembleFree(quiet);
@ -1745,7 +1745,7 @@ static int StreamTcpPacketStateSynRecv(ThreadVars *tv, Packet *p,
if (!StreamTcpValidateRst(ssn, p))
return -1;
uint8_t reset = TRUE;
bool reset = true;
/* After receiveing the RST in SYN_RECV state and if detection
evasion flags has been set, then the following operating
systems will not closed the connection. As they consider the
@ -1758,7 +1758,7 @@ static int StreamTcpPacketStateSynRecv(ThreadVars *tv, Packet *p,
(ssn->server.os_policy == OS_POLICY_OLD_LINUX) ||
(ssn->server.os_policy == OS_POLICY_SOLARIS))
{
reset = FALSE;
reset = false;
SCLogDebug("Detection evasion has been attempted, so"
" not resetting the connection !!");
}
@ -1767,14 +1767,14 @@ static int StreamTcpPacketStateSynRecv(ThreadVars *tv, Packet *p,
(ssn->client.os_policy == OS_POLICY_OLD_LINUX) ||
(ssn->client.os_policy == OS_POLICY_SOLARIS))
{
reset = FALSE;
reset = false;
SCLogDebug("Detection evasion has been attempted, so"
" not resetting the connection !!");
}
}
}
if (reset == TRUE) {
if (reset) {
StreamTcpCloseSsnWithReset(p, ssn);
if (ssn->flags & STREAMTCP_FLAG_TIMESTAMP) {

@ -30,7 +30,7 @@
#include "stream.h"
#include "stream-tcp-reassemble.h"
#define STREAM_VERBOSE FALSE
#define STREAM_VERBOSE false
/* Flag to indicate that the checksum validation for the stream engine
has been enabled */
#define STREAMTCP_INIT_FLAG_CHECKSUM_VALIDATION BIT_U8(0)
@ -104,8 +104,8 @@ typedef struct StreamTcpThread_ {
} StreamTcpThread;
extern TcpStreamCnf stream_config;
void StreamTcpInitConfig (char);
void StreamTcpFreeConfig(char);
void StreamTcpInitConfig(bool);
void StreamTcpFreeConfig(bool);
void StreamTcpRegisterTests (void);
void StreamTcpSessionPktFree (Packet *);

@ -2504,7 +2504,7 @@ int PostConfLoadedSetup(SCInstance *suri)
#ifdef NFQ
if (suri->run_mode == RUNMODE_NFQ)
NFQInitConfig(FALSE);
NFQInitConfig(false);
#endif
/* Load the Host-OS lookup. */

@ -84,7 +84,7 @@ static int DetectEngineSMTPFiledataTest01(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST|PKT_STREAM_EOF;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -109,7 +109,7 @@ static int DetectEngineSMTPFiledataTest01(void)
AppLayerParserThreadCtxFree(alp_tctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;
@ -170,7 +170,7 @@ static int DetectEngineSMTPFiledataTest03(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_SMTP;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -199,7 +199,7 @@ static int DetectEngineSMTPFiledataTest03(void)
AppLayerParserThreadCtxFree(alp_tctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
PASS;

@ -133,7 +133,7 @@ static int RunTest (struct TestSteps *steps, const char *sig, const char *yaml)
HTPConfigure();
}
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
FAIL_IF_NULL(de_ctx);
@ -184,7 +184,7 @@ static int RunTest (struct TestSteps *steps, const char *sig, const char *yaml)
AppLayerParserThreadCtxFree(alp_tctx);
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
if (yaml) {
@ -1002,7 +1002,7 @@ static int DetectHttpClientBodyTest06(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -1050,7 +1050,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
return result;
@ -1107,7 +1107,7 @@ static int DetectHttpClientBodyTest07(void)
p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -1168,7 +1168,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -1226,7 +1226,7 @@ static int DetectHttpClientBodyTest08(void)
p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -1290,7 +1290,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -1348,7 +1348,7 @@ static int DetectHttpClientBodyTest09(void)
p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -1412,7 +1412,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -1470,7 +1470,7 @@ static int DetectHttpClientBodyTest10(void)
p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -1534,7 +1534,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
@ -1583,7 +1583,7 @@ static int DetectHttpClientBodyTest11(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -1631,7 +1631,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
return result;
@ -1679,7 +1679,7 @@ static int DetectHttpClientBodyTest12(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -1727,7 +1727,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
return result;
@ -1775,7 +1775,7 @@ static int DetectHttpClientBodyTest13(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL)
@ -1823,7 +1823,7 @@ end:
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePackets(&p, 1);
return result;
@ -1872,7 +1872,7 @@ static int DetectHttpClientBodyTest14(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -2020,7 +2020,7 @@ end:
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
return result;
@ -2069,7 +2069,7 @@ static int DetectHttpClientBodyTest15(void)
p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
f.alproto = ALPROTO_HTTP1;
StreamTcpInitConfig(TRUE);
StreamTcpInitConfig(true);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
@ -2251,7 +2251,7 @@ end:
DetectEngineCtxFree(de_ctx);
}
StreamTcpFreeConfig(TRUE);
StreamTcpFreeConfig(true);
FLOW_DESTROY(&f);
UTHFreePacket(p);
return result;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save