static DetectParseRegex parse_regex;
-static int DetectThresholdMatch(DetectEngineThreadCtx *, Packet *,
- const Signature *, const SigMatchCtx *);
+static int DetectThresholdMatch(
+ DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *);
static int DetectThresholdSetup(DetectEngineCtx *, Signature *, const char *);
static void DetectThresholdFree(DetectEngineCtx *, void *);
#ifdef UNITTESTS
sigmatch_table[DETECT_THRESHOLD].url = "/rules/thresholding.html#threshold";
sigmatch_table[DETECT_THRESHOLD].Match = DetectThresholdMatch;
sigmatch_table[DETECT_THRESHOLD].Setup = DetectThresholdSetup;
- sigmatch_table[DETECT_THRESHOLD].Free = DetectThresholdFree;
+ sigmatch_table[DETECT_THRESHOLD].Free = DetectThresholdFree;
#ifdef UNITTESTS
sigmatch_table[DETECT_THRESHOLD].RegisterTests = ThresholdRegisterTests;
#endif
DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
}
-static int DetectThresholdMatch(DetectEngineThreadCtx *det_ctx, Packet *p,
- const Signature *s, const SigMatchCtx *ctx)
+static int DetectThresholdMatch(
+ DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
return 1;
}
}
char *saveptr = NULL;
- for (pos = 0, threshold_opt = strtok_r(copy_str,",", &saveptr);
- pos < strlen(copy_str) && threshold_opt != NULL;
- pos++, threshold_opt = strtok_r(NULL,"," , &saveptr))
- {
- if(strstr(threshold_opt,"count"))
+ for (pos = 0, threshold_opt = strtok_r(copy_str, ",", &saveptr);
+ pos < strlen(copy_str) && threshold_opt != NULL;
+ pos++, threshold_opt = strtok_r(NULL, ",", &saveptr)) {
+ if (strstr(threshold_opt, "count"))
count_found++;
- if(strstr(threshold_opt,"second"))
+ if (strstr(threshold_opt, "second"))
second_found++;
- if(strstr(threshold_opt,"type"))
+ if (strstr(threshold_opt, "type"))
type_found++;
- if(strstr(threshold_opt,"track"))
+ if (strstr(threshold_opt, "track"))
track_found++;
}
SCFree(copy_str);
copy_str = NULL;
- if(count_found != 1 || second_found != 1 || type_found != 1 || track_found != 1)
+ if (count_found != 1 || second_found != 1 || type_found != 1 || track_found != 1)
goto error;
ret = DetectParsePcreExec(&parse_regex, &match, rawstr, 0, 0);
args[i] = (char *)str_ptr;
- if (strncasecmp(args[i],"limit",strlen("limit")) == 0)
+ if (strncasecmp(args[i], "limit", strlen("limit")) == 0)
de->type = TYPE_LIMIT;
- if (strncasecmp(args[i],"both",strlen("both")) == 0)
+ if (strncasecmp(args[i], "both", strlen("both")) == 0)
de->type = TYPE_BOTH;
- if (strncasecmp(args[i],"threshold",strlen("threshold")) == 0)
+ if (strncasecmp(args[i], "threshold", strlen("threshold")) == 0)
de->type = TYPE_THRESHOLD;
- if (strncasecmp(args[i],"by_dst",strlen("by_dst")) == 0)
+ if (strncasecmp(args[i], "by_dst", strlen("by_dst")) == 0)
de->track = TRACK_DST;
- if (strncasecmp(args[i],"by_src",strlen("by_src")) == 0)
+ if (strncasecmp(args[i], "by_src", strlen("by_src")) == 0)
de->track = TRACK_SRC;
- if (strncasecmp(args[i],"by_both",strlen("by_both")) == 0)
+ if (strncasecmp(args[i], "by_both", strlen("by_both")) == 0)
de->track = TRACK_BOTH;
- if (strncasecmp(args[i],"by_rule",strlen("by_rule")) == 0)
+ if (strncasecmp(args[i], "by_rule", strlen("by_rule")) == 0)
de->track = TRACK_RULE;
if (strncasecmp(args[i], "by_flow", strlen("by_flow")) == 0)
de->track = TRACK_FLOW;
- if (strncasecmp(args[i],"count",strlen("count")) == 0)
- count_pos = i+1;
- if (strncasecmp(args[i],"seconds",strlen("seconds")) == 0)
- second_pos = i+1;
+ if (strncasecmp(args[i], "count", strlen("count")) == 0)
+ count_pos = i + 1;
+ if (strncasecmp(args[i], "seconds", strlen("seconds")) == 0)
+ second_pos = i + 1;
}
if (args[count_pos] == NULL || args[second_pos] == NULL) {
goto error;
}
- if (StringParseUint32(&de->count, 10, strlen(args[count_pos]),
- args[count_pos]) <= 0) {
+ if (StringParseUint32(&de->count, 10, strlen(args[count_pos]), args[count_pos]) <= 0) {
goto error;
}
- if (StringParseUint32(&de->seconds, 10, strlen(args[second_pos]),
- args[second_pos]) <= 0) {
+ if (StringParseUint32(&de->seconds, 10, strlen(args[second_pos]), args[second_pos]) <= 0) {
goto error;
}
- for (i = 0; i < (ret - 1); i++){
+ for (i = 0; i < (ret - 1); i++) {
if (args[i] != NULL)
pcre2_substring_free((PCRE2_UCHAR8 *)args[i]);
}
if (match) {
pcre2_match_data_free(match);
}
- for (i = 0; i < (ret - 1); i++){
+ for (i = 0; i < (ret - 1); i++) {
if (args[i] != NULL)
pcre2_substring_free((PCRE2_UCHAR8 *)args[i]);
}
{
DetectThresholdData *de = NULL;
de = DetectThresholdParse("type limit,track by_dst,count 10,seconds 60");
- if (de && (de->type == TYPE_LIMIT) && (de->track == TRACK_DST) && (de->count == 10) && (de->seconds == 60)) {
+ if (de && (de->type == TYPE_LIMIT) && (de->track == TRACK_DST) && (de->count == 10) &&
+ (de->seconds == 60)) {
DetectThresholdFree(NULL, de);
return 1;
}
{
DetectThresholdData *de = NULL;
de = DetectThresholdParse("type any,track by_dst,count 10,seconds 60");
- if (de && (de->type == TYPE_LIMIT) && (de->track == TRACK_DST) && (de->count == 10) && (de->seconds == 60)) {
+ if (de && (de->type == TYPE_LIMIT) && (de->track == TRACK_DST) && (de->count == 10) &&
+ (de->seconds == 60)) {
DetectThresholdFree(NULL, de);
return 0;
}
{
DetectThresholdData *de = NULL;
de = DetectThresholdParse("track by_dst, type limit, seconds 60, count 10");
- if (de && (de->type == TYPE_LIMIT) && (de->track == TRACK_DST) && (de->count == 10) && (de->seconds == 60)) {
+ if (de && (de->type == TYPE_LIMIT) && (de->track == TRACK_DST) && (de->count == 10) &&
+ (de->seconds == 60)) {
DetectThresholdFree(NULL, de);
return 1;
}
return 0;
}
-
/**
* \test ThresholdTestParse04 is a test for an invalid threshold options in any order
*
{
DetectThresholdData *de = NULL;
de = DetectThresholdParse("count 10, track by_dst, seconds 60, type both, count 10");
- if (de && (de->type == TYPE_BOTH) && (de->track == TRACK_DST) && (de->count == 10) && (de->seconds == 60)) {
+ if (de && (de->type == TYPE_BOTH) && (de->track == TRACK_DST) && (de->count == 10) &&
+ (de->seconds == 60)) {
DetectThresholdFree(NULL, de);
return 0;
}
{
DetectThresholdData *de = NULL;
de = DetectThresholdParse("count 10, track by_dst, seconds 60, type both");
- if (de && (de->type == TYPE_BOTH) && (de->track == TRACK_DST) && (de->count == 10) && (de->seconds == 60)) {
+ if (de && (de->type == TYPE_BOTH) && (de->track == TRACK_DST) && (de->count == 10) &&
+ (de->seconds == 60)) {
DetectThresholdFree(NULL, de);
return 1;
}
memset(&th_v, 0, sizeof(th_v));
- p = UTHBuildPacketReal((uint8_t *)"A",1,IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
+ p = UTHBuildPacketReal((uint8_t *)"A", 1, IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
de_ctx->flags |= DE_QUIET;
- s = de_ctx->sig_list = SigInit(de_ctx,"alert tcp any any -> any 80 (msg:\"Threshold limit\"; content:\"A\"; threshold: type limit, track by_dst, count 5, seconds 60; sid:1;)");
+ s = de_ctx->sig_list =
+ SigInit(de_ctx, "alert tcp any any -> any 80 (msg:\"Threshold limit\"; content:\"A\"; "
+ "threshold: type limit, track by_dst, count 5, seconds 60; sid:1;)");
if (s == NULL) {
goto end;
}
SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
alerts = PacketAlertCheck(p, 1);
if (alerts != 1) {
- printf("alerts %"PRIi32", expected 1: ", alerts);
+ printf("alerts %" PRIi32 ", expected 1: ", alerts);
}
SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
alerts += PacketAlertCheck(p, 1);
if (alerts != 2) {
- printf("alerts %"PRIi32", expected 2: ", alerts);
+ printf("alerts %" PRIi32 ", expected 2: ", alerts);
}
SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
alerts += PacketAlertCheck(p, 1);
if (alerts != 3) {
- printf("alerts %"PRIi32", expected 3: ", alerts);
+ printf("alerts %" PRIi32 ", expected 3: ", alerts);
}
SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
alerts += PacketAlertCheck(p, 1);
if (alerts != 4) {
- printf("alerts %"PRIi32", expected 4: ", alerts);
+ printf("alerts %" PRIi32 ", expected 4: ", alerts);
}
SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
alerts += PacketAlertCheck(p, 1);
if (alerts != 5) {
- printf("alerts %"PRIi32", expected 5: ", alerts);
+ printf("alerts %" PRIi32 ", expected 5: ", alerts);
}
SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
alerts += PacketAlertCheck(p, 1);
if (alerts != 5) {
- printf("alerts %"PRIi32", expected 5: ", alerts);
+ printf("alerts %" PRIi32 ", expected 5: ", alerts);
}
SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
alerts += PacketAlertCheck(p, 1);
if (alerts != 5) {
- printf("alerts %"PRIi32", expected 5: ", alerts);
+ printf("alerts %" PRIi32 ", expected 5: ", alerts);
}
SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
alerts += PacketAlertCheck(p, 1);
if (alerts != 5) {
- printf("alerts %"PRIi32", expected 5: ", alerts);
+ printf("alerts %" PRIi32 ", expected 5: ", alerts);
}
- if(alerts == 5)
+ if (alerts == 5)
result = 1;
else
- printf("alerts %"PRIi32", expected 5: ", alerts);
+ printf("alerts %" PRIi32 ", expected 5: ", alerts);
SigGroupCleanup(de_ctx);
SigCleanSignatures(de_ctx);
memset(&th_v, 0, sizeof(th_v));
- p = UTHBuildPacketReal((uint8_t *)"A",1,IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
+ p = UTHBuildPacketReal((uint8_t *)"A", 1, IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
de_ctx->flags |= DE_QUIET;
- s = de_ctx->sig_list = SigInit(de_ctx,"alert tcp any any -> any 80 (msg:\"Threshold\"; threshold: type threshold, track by_dst, count 5, seconds 60; sid:1;)");
+ s = de_ctx->sig_list =
+ SigInit(de_ctx, "alert tcp any any -> any 80 (msg:\"Threshold\"; threshold: type "
+ "threshold, track by_dst, count 5, seconds 60; sid:1;)");
if (s == NULL) {
goto end;
}
memset(&th_v, 0, sizeof(th_v));
- p = UTHBuildPacketReal((uint8_t *)"A",1,IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
+ p = UTHBuildPacketReal((uint8_t *)"A", 1, IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
de_ctx->flags |= DE_QUIET;
- s = de_ctx->sig_list = SigInit(de_ctx,"alert tcp any any -> any 80 (msg:\"Threshold both\"; threshold: type both, track by_dst, count 2, seconds 60; sid:10;)");
+ s = de_ctx->sig_list =
+ SigInit(de_ctx, "alert tcp any any -> any 80 (msg:\"Threshold both\"; threshold: type "
+ "both, track by_dst, count 2, seconds 60; sid:10;)");
if (s == NULL) {
goto end;
}
ThresholdInit();
memset(&th_v, 0, sizeof(th_v));
- p = UTHBuildPacketReal((uint8_t *)"A",1,IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
+ p = UTHBuildPacketReal((uint8_t *)"A", 1, IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
de_ctx->flags |= DE_QUIET;
- s = de_ctx->sig_list = SigInit(de_ctx,"alert tcp any any -> any 80 (msg:\"Threshold limit sid 1\"; threshold: type limit, track by_dst, count 5, seconds 60; sid:1;)");
+ s = de_ctx->sig_list =
+ SigInit(de_ctx, "alert tcp any any -> any 80 (msg:\"Threshold limit sid 1\"; "
+ "threshold: type limit, track by_dst, count 5, seconds 60; sid:1;)");
if (s == NULL) {
goto end;
}
- s = s->next = SigInit(de_ctx,"alert tcp any any -> any 80 (msg:\"Threshold limit sid 1000\"; threshold: type limit, track by_dst, count 5, seconds 60; sid:1000;)");
+ s = s->next =
+ SigInit(de_ctx, "alert tcp any any -> any 80 (msg:\"Threshold limit sid 1000\"; "
+ "threshold: type limit, track by_dst, count 5, seconds 60; sid:1000;)");
if (s == NULL) {
goto end;
}
alerts += PacketAlertCheck(p, 1);
alerts += PacketAlertCheck(p, 1000);
- if(alerts == 10)
+ if (alerts == 10)
result = 1;
else {
printf("alerts %d != 10: ", alerts);
ThresholdInit();
memset(&th_v, 0, sizeof(th_v));
- p = UTHBuildPacketReal((uint8_t *)"A",1,IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
+ p = UTHBuildPacketReal((uint8_t *)"A", 1, IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
de_ctx->flags |= DE_QUIET;
- s = de_ctx->sig_list = SigInit(de_ctx,"alert tcp any any -> any 80 (msg:\"Threshold limit sid 1\"; threshold: type limit, track by_dst, count 5, seconds 60; sid:1;)");
+ s = de_ctx->sig_list =
+ SigInit(de_ctx, "alert tcp any any -> any 80 (msg:\"Threshold limit sid 1\"; "
+ "threshold: type limit, track by_dst, count 5, seconds 60; sid:1;)");
if (s == NULL) {
goto end;
}
- s = s->next = SigInit(de_ctx,"alert tcp any any -> any 80 (msg:\"Threshold limit sid 1000\"; threshold: type limit, track by_dst, count 5, seconds 60; sid:1000;)");
+ s = s->next =
+ SigInit(de_ctx, "alert tcp any any -> any 80 (msg:\"Threshold limit sid 1000\"; "
+ "threshold: type limit, track by_dst, count 5, seconds 60; sid:1000;)");
if (s == NULL) {
goto end;
}
alerts += PacketAlertCheck(p, 1);
alerts += PacketAlertCheck(p, 1000);
ticks_end = UtilCpuGetTicks();
- printf("test run %"PRIu64"\n", (ticks_end - ticks_start));
+ printf("test run %" PRIu64 "\n", (ticks_end - ticks_start));
- if(alerts == 10)
+ if (alerts == 10)
result = 1;
else
goto cleanup;
memset(&th_v, 0, sizeof(th_v));
- p = UTHBuildPacketReal((uint8_t *)"A",1,IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
+ p = UTHBuildPacketReal((uint8_t *)"A", 1, IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
de_ctx->flags |= DE_QUIET;
- s = de_ctx->sig_list = SigInit(de_ctx,"drop tcp any any -> any 80 (threshold: type limit, track by_src, count 1, seconds 300; sid:10;)");
+ s = de_ctx->sig_list = SigInit(de_ctx, "drop tcp any any -> any 80 (threshold: type limit, "
+ "track by_src, count 1, seconds 300; sid:10;)");
if (s == NULL) {
goto end;
}
memset(&th_v, 0, sizeof(th_v));
- p = UTHBuildPacketReal((uint8_t *)"A",1,IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
+ p = UTHBuildPacketReal((uint8_t *)"A", 1, IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
de_ctx->flags |= DE_QUIET;
- s = de_ctx->sig_list = SigInit(de_ctx,"drop tcp any any -> any 80 (threshold: type limit, track by_src, count 2, seconds 300; sid:10;)");
+ s = de_ctx->sig_list = SigInit(de_ctx, "drop tcp any any -> any 80 (threshold: type limit, "
+ "track by_src, count 2, seconds 300; sid:10;)");
if (s == NULL) {
goto end;
}
memset(&th_v, 0, sizeof(th_v));
- p = UTHBuildPacketReal((uint8_t *)"A",1,IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
+ p = UTHBuildPacketReal((uint8_t *)"A", 1, IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
de_ctx->flags |= DE_QUIET;
- s = de_ctx->sig_list = SigInit(de_ctx,"drop tcp any any -> any 80 (threshold: type threshold, track by_src, count 3, seconds 100; sid:10;)");
+ s = de_ctx->sig_list = SigInit(de_ctx, "drop tcp any any -> any 80 (threshold: type threshold, "
+ "track by_src, count 3, seconds 100; sid:10;)");
if (s == NULL) {
goto end;
}
memset(&th_v, 0, sizeof(th_v));
- p = UTHBuildPacketReal((uint8_t *)"A",1,IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
+ p = UTHBuildPacketReal((uint8_t *)"A", 1, IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
de_ctx->flags |= DE_QUIET;
- s = de_ctx->sig_list = SigInit(de_ctx,"drop tcp any any -> any 80 (threshold: type threshold, track by_src, count 5, seconds 300; sid:10;)");
+ s = de_ctx->sig_list = SigInit(de_ctx, "drop tcp any any -> any 80 (threshold: type threshold, "
+ "track by_src, count 5, seconds 300; sid:10;)");
if (s == NULL) {
goto end;
}
memset(&th_v, 0, sizeof(th_v));
- p = UTHBuildPacketReal((uint8_t *)"A",1,IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
+ p = UTHBuildPacketReal((uint8_t *)"A", 1, IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
de_ctx->flags |= DE_QUIET;
- s = de_ctx->sig_list = SigInit(de_ctx,"drop tcp any any -> any 80 (threshold: type both, track by_src, count 3, seconds 300; sid:10;)");
+ s = de_ctx->sig_list = SigInit(de_ctx, "drop tcp any any -> any 80 (threshold: type both, "
+ "track by_src, count 3, seconds 300; sid:10;)");
if (s == NULL) {
goto end;
}
memset(&th_v, 0, sizeof(th_v));
- p = UTHBuildPacketReal((uint8_t *)"A",1,IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
+ p = UTHBuildPacketReal((uint8_t *)"A", 1, IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
if (de_ctx == NULL) {
de_ctx->flags |= DE_QUIET;
- s = de_ctx->sig_list = SigInit(de_ctx,"drop tcp any any -> any 80 (threshold: type both, track by_src, count 5, seconds 300; sid:10;)");
+ s = de_ctx->sig_list = SigInit(de_ctx, "drop tcp any any -> any 80 (threshold: type both, "
+ "track by_src, count 5, seconds 300; sid:10;)");
if (s == NULL) {
goto end;
}
}
cleanup:
- DetectEngineThreadCtxDeinit(&th_v, (void*)det_ctx);
+ DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
DetectEngineCtxFree(de_ctx);
end:
UTHFreePackets(&p, 1);
ThresholdInit();
memset(&th_v, 0, sizeof(th_v));
- p = UTHBuildPacketReal((uint8_t *)"A",1,IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
+ p = UTHBuildPacketReal((uint8_t *)"A", 1, IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
FAIL_IF_NULL(p);
DetectEngineCtx *de_ctx = DetectEngineCtxInit();
de_ctx->flags |= DE_QUIET;
- s = de_ctx->sig_list = SigInit(de_ctx,"alert tcp any any -> any 80 (msg:\"Threshold limit sid 1\"; threshold: type limit, track by_rule, count 2, seconds 60; sid:1;)");
+ s = de_ctx->sig_list =
+ SigInit(de_ctx, "alert tcp any any -> any 80 (msg:\"Threshold limit sid 1\"; "
+ "threshold: type limit, track by_rule, count 2, seconds 60; sid:1;)");
FAIL_IF_NULL(s);
SigGroupBuild(de_ctx);
ThresholdInit();
memset(&th_v, 0, sizeof(th_v));
- p1 = UTHBuildPacketReal((uint8_t *)"A",1,IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
- p2 = UTHBuildPacketReal((uint8_t *)"A",1,IPPROTO_TCP, "1.1.1.1", "3.3.3.3", 1024, 80);
+ p1 = UTHBuildPacketReal((uint8_t *)"A", 1, IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80);
+ p2 = UTHBuildPacketReal((uint8_t *)"A", 1, IPPROTO_TCP, "1.1.1.1", "3.3.3.3", 1024, 80);
FAIL_IF_NULL(p1);
FAIL_IF_NULL(p2);
de_ctx->flags |= DE_QUIET;
- s = de_ctx->sig_list = SigInit(de_ctx,"alert tcp any any -> any 80 (msg:\"Threshold limit sid 1\"; threshold: type limit, track by_both, count 2, seconds 60; sid:1;)");
+ s = de_ctx->sig_list =
+ SigInit(de_ctx, "alert tcp any any -> any 80 (msg:\"Threshold limit sid 1\"; "
+ "threshold: type limit, track by_both, count 2, seconds 60; sid:1;)");
FAIL_IF_NULL(s);
SigGroupBuild(de_ctx);
UtRegisterTest("DetectThresholdTestSig3", DetectThresholdTestSig3);
UtRegisterTest("DetectThresholdTestSig4", DetectThresholdTestSig4);
UtRegisterTest("DetectThresholdTestSig5", DetectThresholdTestSig5);
- UtRegisterTest("DetectThresholdTestSig6Ticks",
- DetectThresholdTestSig6Ticks);
+ UtRegisterTest("DetectThresholdTestSig6Ticks", DetectThresholdTestSig6Ticks);
UtRegisterTest("DetectThresholdTestSig7", DetectThresholdTestSig7);
UtRegisterTest("DetectThresholdTestSig8", DetectThresholdTestSig8);
UtRegisterTest("DetectThresholdTestSig9", DetectThresholdTestSig9);