From 737122663c3a8ef08d33ba1be42ba901ece20d9d Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Thu, 20 Oct 2011 03:22:24 +0530 Subject: [PATCH] IPProto now doesn't accept sigs, which has both < and >, with < value being less than > value. Update affected unittests to reflect the change --- src/detect-ipproto.c | 4030 +++++++++++++++++++++++++++++++----------- 1 file changed, 2980 insertions(+), 1050 deletions(-) diff --git a/src/detect-ipproto.c b/src/detect-ipproto.c index ae57cf8f8a..6f023ed3e0 100644 --- a/src/detect-ipproto.c +++ b/src/detect-ipproto.c @@ -192,6 +192,10 @@ static int DetectIPProtoTypePresentForOP(Signature *s, uint8_t op) return 0; } +/* Updated by AS. Please do not remove this unused code. + * Need it as we redo this code once we solve ipproto + * multiple uses */ +#if 0 static int DetectIPProtoQSortCompare(const void *a, const void *b) { const uint8_t *one = a; @@ -199,6 +203,7 @@ static int DetectIPProtoQSortCompare(const void *a, const void *b) return ((int)*one - *two); } +#endif /** * \internal @@ -265,10 +270,18 @@ static int DetectIPProtoSetup(DetectEngineCtx *de_ctx, Signature *s, char *optst } DetectIPProtoData *data_temp = temp_sm->ctx; if (data_temp->proto <= data->proto) { + SCLogError(SC_ERR_INVALID_SIGNATURE, "We can't use a have " + "both gt and lt ipprotos, with the lt being " + "lower than gt value"); + goto error; + /* Updated by AS. Please do not remove this unused code. Need it + * as we redo this code once we solve ipproto multiple uses */ +#if 0 s->proto.proto[data->proto / 8] |= 0xfe << (data->proto % 8); for (i = (data->proto / 8) + 1; i < (256 / 8); i++) { s->proto.proto[i] = 0xff; } +#endif } else { for (i = 0; i < (data->proto / 8); i++) { s->proto.proto[i] = 0; @@ -298,6 +311,14 @@ static int DetectIPProtoSetup(DetectEngineCtx *de_ctx, Signature *s, char *optst } data_temp = temp_sm->ctx; if (data_temp->proto <= data->proto) { + /* Updated by AS. Please do not remove this unused code. + * Need it as we redo this code once we solve ipproto + * multiple uses */ + SCLogError(SC_ERR_INVALID_SIGNATURE, "We can't use a have " + "both gt and lt ipprotos, with the lt being " + "lower than gt value"); + goto error; +#if 0 s->proto.proto[data->proto / 8] |= 0xfe << (data->proto % 8); for (i = (data->proto / 8) + 1; i < (256 / 8); i++) { s->proto.proto[i] = 0xff; @@ -329,6 +350,7 @@ static int DetectIPProtoSetup(DetectEngineCtx *de_ctx, Signature *s, char *optst } j++; } +#endif } else { for (i = 0; i < (data->proto / 8); i++) { s->proto.proto[i] = 0; @@ -363,10 +385,19 @@ static int DetectIPProtoSetup(DetectEngineCtx *de_ctx, Signature *s, char *optst } DetectIPProtoData *data_temp = temp_sm->ctx; if (data_temp->proto >= data->proto) { + /* Updated by AS. Please do not remove this unused code. + * Need it as we redo this code once we solve ipproto + * multiple uses */ + SCLogError(SC_ERR_INVALID_SIGNATURE, "We can't use a have " + "both gt and lt ipprotos, with the lt being " + "lower than gt value"); + goto error; +#if 0 for (i = 0; i < (data->proto / 8); i++) { s->proto.proto[i] = 0xff; } s->proto.proto[data->proto / 8] |= ~(0xff << (data->proto % 8));; +#endif } else { for (i = 0; i < (data->proto / 8); i++) { s->proto.proto[i] &= 0xff; @@ -396,6 +427,14 @@ static int DetectIPProtoSetup(DetectEngineCtx *de_ctx, Signature *s, char *optst } data_temp = temp_sm->ctx; if (data_temp->proto >= data->proto) { + /* Updated by AS. Please do not remove this unused code. + * Need it as we redo this code once we solve ipproto + * multiple uses */ + SCLogError(SC_ERR_INVALID_SIGNATURE, "We can't use a have " + "both gt and lt ipprotos, with the lt being " + "lower than gt value"); + goto error; +#if 0 for (i = 0; i < (data->proto / 8); i++) { s->proto.proto[i] = 0xff; } @@ -427,6 +466,7 @@ static int DetectIPProtoSetup(DetectEngineCtx *de_ctx, Signature *s, char *optst } j++; } +#endif } else { for (i = 0; i < (data->proto / 8); i++) { s->proto.proto[i] &= 0xFF; @@ -943,7 +983,6 @@ static int DetectIPProtoTestSetup15(void) char *value1_str = "<14"; int value1 = 14; char *value2_str = ">34"; - int value2 = 34; int i; if ((sig = SigAlloc()) == NULL) @@ -951,8 +990,6 @@ static int DetectIPProtoTestSetup15(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; @@ -960,27 +997,20 @@ static int DetectIPProtoTestSetup15(void) if (sig->proto.proto[value1 / 8] != 0x3F) { goto end; } - for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + for (i = (value1 / 8) + 1; i < (256 / 8); i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value2 / 8] != 0xF8) { + if (DetectIPProtoSetup(NULL, sig, value2_str) == 0) goto end; - } - for (i = (value2 / 8) + 1; i < (256 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup16(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<14"; @@ -992,10 +1022,10 @@ static int DetectIPProtoTestSetup16(void) if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; @@ -1020,55 +1050,50 @@ static int DetectIPProtoTestSetup16(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup17(void) +static int DetectIPProtoTestSetup16(void) { int result = 0; Signature *sig; - char *value1_str = "<11"; - int value1 = 11; - char *value2_str = ">13"; - int value2 = 13; + char *value1_str = "<14"; + char *value2_str = ">34"; + int value2 = 34; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0xC7) { - goto end; - } - if (sig->proto.proto[value2 / 8] != 0xC7) { + if (sig->proto.proto[value2 / 8] != 0xF8) { goto end; } for (i = (value2 / 8) + 1; i < (256 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup18(void) -{ +#if 0 int result = 0; Signature *sig; - char *value1_str = "<11"; - int value1 = 11; - char *value2_str = ">13"; - int value2 = 13; + char *value1_str = "<14"; + int value1 = 14; + char *value2_str = ">34"; + int value2 = 34; int i; if ((sig = SigAlloc()) == NULL) @@ -1082,10 +1107,14 @@ static int DetectIPProtoTestSetup18(void) if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value1 / 8] != 0xC7) { + if (sig->proto.proto[value1 / 8] != 0x3F) { goto end; } - if (sig->proto.proto[value2 / 8] != 0xC7) { + for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value2 / 8] != 0xF8) { goto end; } for (i = (value2 / 8) + 1; i < (256 / 8); i++) { @@ -1098,17 +1127,16 @@ static int DetectIPProtoTestSetup18(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup19(void) +static int DetectIPProtoTestSetup17(void) { int result = 0; Signature *sig; char *value1_str = "<11"; int value1 = 11; - char *value2_str = "!13"; - char *value3_str = ">36"; - int value3 = 36; + char *value2_str = ">13"; int i; if ((sig = SigAlloc()) == NULL) @@ -1116,10 +1144,6 @@ static int DetectIPProtoTestSetup19(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; @@ -1127,34 +1151,26 @@ static int DetectIPProtoTestSetup19(void) if (sig->proto.proto[value1 / 8] != 0x07) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + for (i = (value1 / 8) + 1; i < (256 / 8); i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xE0) { + if (DetectIPProtoSetup(NULL, sig, value2_str) == 0) goto end; - } - for (i = (value3 / 8) + 1; i < (256 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup20(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<11"; int value1 = 11; - char *value2_str = "!13"; - char *value3_str = ">36"; - int value3 = 36; + char *value2_str = ">13"; + int value2 = 13; int i; if ((sig = SigAlloc()) == NULL) @@ -1162,25 +1178,19 @@ static int DetectIPProtoTestSetup20(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value1 / 8] != 0x07) { + if (sig->proto.proto[value1 / 8] != 0xC7) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) - goto end; - } - if (sig->proto.proto[value3 / 8] != 0xE0) { + if (sig->proto.proto[value2 / 8] != 0xC7) { goto end; } - for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + for (i = (value2 / 8) + 1; i < (256 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } @@ -1190,17 +1200,16 @@ static int DetectIPProtoTestSetup20(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup21(void) +static int DetectIPProtoTestSetup18(void) { int result = 0; Signature *sig; char *value1_str = "<11"; - int value1 = 11; - char *value2_str = "!13"; - char *value3_str = ">36"; - int value3 = 36; + char *value2_str = ">13"; + int value2 = 13; int i; if ((sig = SigAlloc()) == NULL) @@ -1208,45 +1217,33 @@ static int DetectIPProtoTestSetup21(void) if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } - if (sig->proto.proto[value1 / 8] != 0x07) { - goto end; - } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + for (i = 0; i < (value2 / 8); i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xE0) { + if (sig->proto.proto[value2 / 8] != 0xC0) { goto end; } - for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + for (i = (value2 / 8) + 1; i < (256 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup22(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<11"; int value1 = 11; - char *value2_str = "!13"; - char *value3_str = ">36"; - int value3 = 36; + char *value2_str = ">13"; + int value2 = 13; int i; if ((sig = SigAlloc()) == NULL) @@ -1254,25 +1251,19 @@ static int DetectIPProtoTestSetup22(void) if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value1 / 8] != 0x07) { + if (sig->proto.proto[value1 / 8] != 0xC7) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) - goto end; - } - if (sig->proto.proto[value3 / 8] != 0xE0) { + if (sig->proto.proto[value2 / 8] != 0xC7) { goto end; } - for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + for (i = (value2 / 8) + 1; i < (256 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } @@ -1282,9 +1273,10 @@ static int DetectIPProtoTestSetup22(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup23(void) +static int DetectIPProtoTestSetup19(void) { int result = 0; Signature *sig; @@ -1292,14 +1284,11 @@ static int DetectIPProtoTestSetup23(void) int value1 = 11; char *value2_str = "!13"; char *value3_str = ">36"; - int value3 = 36; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) @@ -1311,27 +1300,20 @@ static int DetectIPProtoTestSetup23(void) if (sig->proto.proto[value1 / 8] != 0x07) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + for (i = (value1 / 8) + 1; i < (256 / 8); i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xE0) { + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) goto end; - } - for (i = (value3 / 8) + 1; i < (256 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup24(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<11"; @@ -1344,11 +1326,11 @@ static int DetectIPProtoTestSetup24(void) if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) @@ -1374,17 +1356,16 @@ static int DetectIPProtoTestSetup24(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup25(void) +static int DetectIPProtoTestSetup20(void) { int result = 0; Signature *sig; char *value1_str = "<11"; int value1 = 11; - char *value2_str = "!18"; char *value3_str = ">36"; - int value3 = 36; int i; if ((sig = SigAlloc()) == NULL) @@ -1392,10 +1373,6 @@ static int DetectIPProtoTestSetup25(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; @@ -1403,32 +1380,25 @@ static int DetectIPProtoTestSetup25(void) if (sig->proto.proto[value1 / 8] != 0x07) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + for (i = (value1 / 8) + 1; i < (256 / 8); i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xE0) { + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) goto end; - } - for (i = (value3 / 8) + 1; i < (256 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup26(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<11"; int value1 = 11; - char *value2_str = "!18"; + char *value2_str = "!13"; char *value3_str = ">36"; int value3 = 36; int i; @@ -1466,17 +1436,17 @@ static int DetectIPProtoTestSetup26(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup27(void) +static int DetectIPProtoTestSetup21(void) { int result = 0; Signature *sig; char *value1_str = "<11"; int value1 = 11; - char *value2_str = "!18"; + char *value2_str = "!13"; char *value3_str = ">36"; - int value3 = 36; int i; if ((sig = SigAlloc()) == NULL) @@ -1486,8 +1456,6 @@ static int DetectIPProtoTestSetup27(void) goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; @@ -1495,32 +1463,25 @@ static int DetectIPProtoTestSetup27(void) if (sig->proto.proto[value1 / 8] != 0x07) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + for (i = (value1 / 8) + 1; i < (256 / 8); i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xE0) { + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) goto end; - } - for (i = (value3 / 8) + 1; i < (256 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup28(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<11"; int value1 = 11; - char *value2_str = "!18"; + char *value2_str = "!13"; char *value3_str = ">36"; int value3 = 36; int i; @@ -1530,10 +1491,10 @@ static int DetectIPProtoTestSetup28(void) if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; @@ -1558,15 +1519,15 @@ static int DetectIPProtoTestSetup28(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup29(void) +static int DetectIPProtoTestSetup22(void) { int result = 0; Signature *sig; char *value1_str = "<11"; - int value1 = 11; - char *value2_str = "!18"; + char *value2_str = "!13"; char *value3_str = ">36"; int value3 = 36; int i; @@ -1574,20 +1535,11 @@ static int DetectIPProtoTestSetup29(void) if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } - if (sig->proto.proto[value1 / 8] != 0x07) { + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + for (i = 0; i < (value3 / 8); i++) { if (sig->proto.proto[i] != 0) goto end; } @@ -1598,21 +1550,21 @@ static int DetectIPProtoTestSetup29(void) if (sig->proto.proto[i] != 0xFF) goto end; } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup30(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<11"; int value1 = 11; - char *value2_str = "!18"; + char *value2_str = "!13"; char *value3_str = ">36"; int value3 = 36; int i; @@ -1620,10 +1572,10 @@ static int DetectIPProtoTestSetup30(void) if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { @@ -1650,15 +1602,14 @@ static int DetectIPProtoTestSetup30(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup31(void) +static int DetectIPProtoTestSetup23(void) { int result = 0; Signature *sig; char *value1_str = "<11"; - int value1 = 11; - char *value2_str = "!34"; char *value3_str = ">36"; int value3 = 36; int i; @@ -1666,20 +1617,9 @@ static int DetectIPProtoTestSetup31(void) if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } - if (sig->proto.proto[value1 / 8] != 0x07) { - goto end; - } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + for (i = 0; i < (value3 / 8); i++) { if (sig->proto.proto[i] != 0) goto end; } @@ -1690,21 +1630,21 @@ static int DetectIPProtoTestSetup31(void) if (sig->proto.proto[i] != 0xFF) goto end; } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup32(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<11"; int value1 = 11; - char *value2_str = "!34"; + char *value2_str = "!13"; char *value3_str = ">36"; int value3 = 36; int i; @@ -1712,10 +1652,10 @@ static int DetectIPProtoTestSetup32(void) if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { @@ -1742,15 +1682,15 @@ static int DetectIPProtoTestSetup32(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup33(void) +static int DetectIPProtoTestSetup24(void) { int result = 0; Signature *sig; char *value1_str = "<11"; - int value1 = 11; - char *value2_str = "!34"; + char *value2_str = "!13"; char *value3_str = ">36"; int value3 = 36; int i; @@ -1758,20 +1698,11 @@ static int DetectIPProtoTestSetup33(void) if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } - if (sig->proto.proto[value1 / 8] != 0x07) { + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + for (i = 0; i < (value3 / 8); i++) { if (sig->proto.proto[i] != 0) goto end; } @@ -1782,21 +1713,21 @@ static int DetectIPProtoTestSetup33(void) if (sig->proto.proto[i] != 0xFF) goto end; } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup34(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<11"; int value1 = 11; - char *value2_str = "!34"; + char *value2_str = "!13"; char *value3_str = ">36"; int value3 = 36; int i; @@ -1804,10 +1735,10 @@ static int DetectIPProtoTestSetup34(void) if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { @@ -1834,24 +1765,22 @@ static int DetectIPProtoTestSetup34(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup35(void) +static int DetectIPProtoTestSetup25(void) { int result = 0; Signature *sig; char *value1_str = "<11"; int value1 = 11; - char *value2_str = "!34"; + char *value2_str = "!18"; char *value3_str = ">36"; - int value3 = 36; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) @@ -1863,32 +1792,25 @@ static int DetectIPProtoTestSetup35(void) if (sig->proto.proto[value1 / 8] != 0x07) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + for (i = (value1 / 8) + 1; i < (256 / 8); i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xE0) { + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) goto end; - } - for (i = (value3 / 8) + 1; i < (256 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup36(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<11"; int value1 = 11; - char *value2_str = "!34"; + char *value2_str = "!18"; char *value3_str = ">36"; int value3 = 36; int i; @@ -1896,11 +1818,11 @@ static int DetectIPProtoTestSetup36(void) if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) @@ -1926,17 +1848,16 @@ static int DetectIPProtoTestSetup36(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup37(void) +static int DetectIPProtoTestSetup26(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; - int value1 = 10; - char *value2_str = "!12"; - char *value3_str = ">14"; - int value3 = 14; + char *value1_str = "<11"; + int value1 = 11; + char *value3_str = ">36"; int i; if ((sig = SigAlloc()) == NULL) @@ -1944,38 +1865,33 @@ static int DetectIPProtoTestSetup37(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value1 / 8] != 0x83) { + if (sig->proto.proto[value1 / 8] != 0x07) { goto end; } - for (i = (value3 / 8) + 1; i < (256 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = (value1 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0) goto end; } + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) + goto end; result = 1; end: SigFree(sig); return result; -} - -static int DetectIPProtoTestSetup38(void) -{ +#if 0 int result = 0; Signature *sig; - char *value1_str = "<10"; - int value1 = 10; - char *value2_str = "!12"; - char *value3_str = ">14"; - int value3 = 14; + char *value1_str = "<11"; + int value1 = 11; + char *value2_str = "!18"; + char *value3_str = ">36"; + int value3 = 36; int i; if ((sig = SigAlloc()) == NULL) @@ -1991,7 +1907,14 @@ static int DetectIPProtoTestSetup38(void) if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value1 / 8] != 0x83) { + if (sig->proto.proto[value1 / 8] != 0x07) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xE0) { goto end; } for (i = (value3 / 8) + 1; i < (256 / 8); i++) { @@ -2004,17 +1927,17 @@ static int DetectIPProtoTestSetup38(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup39(void) +static int DetectIPProtoTestSetup27(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; - int value1 = 10; - char *value2_str = "!12"; - char *value3_str = ">14"; - int value3 = 14; + char *value1_str = "<11"; + int value1 = 11; + char *value2_str = "!18"; + char *value3_str = ">36"; int i; if ((sig = SigAlloc()) == NULL) @@ -2024,36 +1947,33 @@ static int DetectIPProtoTestSetup39(void) goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value1 / 8] != 0x83) { + if (sig->proto.proto[value1 / 8] != 0x07) { goto end; } - for (i = (value3 / 8) + 1; i < (256 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = (value1 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0) goto end; } + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) + goto end; result = 1; end: SigFree(sig); return result; -} - -static int DetectIPProtoTestSetup40(void) -{ +#if 0 int result = 0; Signature *sig; - char *value1_str = "<10"; - int value1 = 10; - char *value2_str = "!12"; - char *value3_str = ">14"; - int value3 = 14; + char *value1_str = "<11"; + int value1 = 11; + char *value2_str = "!18"; + char *value3_str = ">36"; + int value3 = 36; int i; if ((sig = SigAlloc()) == NULL) @@ -2061,15 +1981,22 @@ static int DetectIPProtoTestSetup40(void) if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value1 / 8] != 0x83) { + if (sig->proto.proto[value1 / 8] != 0x07) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xE0) { goto end; } for (i = (value3 / 8) + 1; i < (256 / 8); i++) { @@ -2082,72 +2009,77 @@ static int DetectIPProtoTestSetup40(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup41(void) +static int DetectIPProtoTestSetup28(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; - int value1 = 10; - char *value2_str = "!12"; - char *value3_str = ">14"; - int value3 = 14; + char *value1_str = "<11"; + char *value2_str = "!18"; + char *value3_str = ">36"; + int value3 = 36; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x83) { + if (sig->proto.proto[value3 / 8] != 0xE0) { goto end; } for (i = (value3 / 8) + 1; i < (256 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup42(void) -{ +#if 0 int result = 0; Signature *sig; - char *value1_str = "<10"; - int value1 = 10; - char *value2_str = "!12"; - char *value3_str = ">14"; - int value3 = 14; + char *value1_str = "<11"; + int value1 = 11; + char *value2_str = "!18"; + char *value3_str = ">36"; + int value3 = 36; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value1 / 8] != 0x83) { + if (sig->proto.proto[value1 / 8] != 0x07) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xE0) { goto end; } for (i = (value3 / 8) + 1; i < (256 / 8); i++) { @@ -2160,97 +2092,77 @@ static int DetectIPProtoTestSetup42(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup43(void) +static int DetectIPProtoTestSetup29(void) { int result = 0; Signature *sig; - char *value1_str = "!4"; - int value1 = 4; - char *value2_str = "<13"; - int value2 = 13; - char *value3_str = ">34"; - int value3 = 34; + char *value1_str = "<11"; + char *value3_str = ">36"; + int value3 = 36; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - if (sig->proto.proto[value1 / 8] != 0xEF) { - goto end; - } - for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } - if (sig->proto.proto[value2 / 8] != 0x1F) { - goto end; - } - for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + for (i = 0; i < (value3 / 8); i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xF8) { + if (sig->proto.proto[value3 / 8] != 0xE0) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup44(void) -{ +#if 0 int result = 0; Signature *sig; - char *value1_str = "!4"; - int value1 = 4; - char *value2_str = "<13"; - int value2 = 13; - char *value3_str = ">34"; - int value3 = 34; + char *value1_str = "<11"; + int value1 = 11; + char *value2_str = "!18"; + char *value3_str = ">36"; + int value3 = 36; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (sig->proto.proto[value1 / 8] != 0xEF) { + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - } - for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0x1F) { + if (sig->proto.proto[value1 / 8] != 0x07) { goto end; } - for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xF8) { + if (sig->proto.proto[value3 / 8] != 0xE0) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } @@ -2260,37 +2172,1941 @@ static int DetectIPProtoTestSetup44(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup45(void) +static int DetectIPProtoTestSetup30(void) { int result = 0; Signature *sig; - char *value1_str = "!4"; - int value1 = 4; - char *value2_str = "<13"; - int value2 = 13; - char *value3_str = ">34"; - int value3 = 34; + char *value1_str = "<11"; + char *value2_str = "!18"; + char *value3_str = ">36"; + int value3 = 36; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xE0) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "<11"; + int value1 = 11; + char *value2_str = "!18"; + char *value3_str = ">36"; + int value3 = 36; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x07) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xE0) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup31(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "<11"; + int value1 = 11; + char *value2_str = "!34"; + char *value3_str = ">36"; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x07) { + goto end; + } + for (i = (value1 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "<11"; + int value1 = 11; + char *value2_str = "!34"; + char *value3_str = ">36"; + int value3 = 36; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x07) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xE0) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup32(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "<11"; + int value1 = 11; + char *value3_str = ">36"; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x07) { + goto end; + } + for (i = (value1 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "<11"; + int value1 = 11; + char *value2_str = "!34"; + char *value3_str = ">36"; + int value3 = 36; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x07) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xE0) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup33(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "<11"; + int value1 = 11; + char *value2_str = "!34"; + char *value3_str = ">36"; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x07) { + goto end; + } + for (i = (value1 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "<11"; + int value1 = 11; + char *value2_str = "!34"; + char *value3_str = ">36"; + int value3 = 36; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x07) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xE0) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup34(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "<11"; + int value1 = 11; + char *value2_str = "!34"; + char *value3_str = ">36"; + int value3 = 36; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xE0) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "<11"; + int value1 = 11; + char *value2_str = "!34"; + char *value3_str = ">36"; + int value3 = 36; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup35(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "<11"; + char *value3_str = ">36"; + int value3 = 36; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xE0) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "<11"; + int value1 = 11; + char *value2_str = "!34"; + char *value3_str = ">36"; + int value3 = 36; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x07) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xE0) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup36(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "<11"; + char *value2_str = "!34"; + char *value3_str = ">36"; + int value3 = 36; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xE0) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "<11"; + int value1 = 11; + char *value2_str = "!34"; + char *value3_str = ">36"; + int value3 = 36; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x07) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xE0) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup37(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "<10"; + int value1 = 10; + char *value2_str = "!12"; + char *value3_str = ">14"; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x03) { + goto end; + } + for (i = (value1 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0x0) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "<10"; + int value1 = 10; + char *value2_str = "!12"; + char *value3_str = ">14"; + int value3 = 14; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x83) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup38(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "<10"; + int value1 = 10; + char *value3_str = ">14"; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x03) { + goto end; + } + for (i = (value1 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "<10"; + int value1 = 10; + char *value2_str = "!12"; + char *value3_str = ">14"; + int value3 = 14; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x83) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup39(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "<10"; + int value1 = 10; + char *value2_str = "!12"; + char *value3_str = ">14"; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x03) { + goto end; + } + for (i = (value1 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "<10"; + int value1 = 10; + char *value2_str = "!12"; + char *value3_str = ">14"; + int value3 = 14; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x83) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup40(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "<10"; + int value1 = 10; + char *value2_str = "!12"; + char *value3_str = ">14"; + int value3 = 14; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x80) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "<10"; + int value1 = 10; + char *value2_str = "!12"; + char *value3_str = ">14"; + int value3 = 14; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x83) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup41(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "<10"; + int value1 = 10; + char *value3_str = ">14"; + int value3 = 14; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x80) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "<10"; + int value1 = 10; + char *value2_str = "!12"; + char *value3_str = ">14"; + int value3 = 14; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x83) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup42(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "<10"; + int value1 = 10; + char *value2_str = "!12"; + char *value3_str = ">14"; + int value3 = 14; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x80) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "<10"; + int value1 = 10; + char *value2_str = "!12"; + char *value3_str = ">14"; + int value3 = 14; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x83) { + goto end; + } + for (i = (value3 / 8) + 1; i < (256 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup43(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "!4"; + int value1 = 4; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (sig->proto.proto[value1 / 8] != 0xEF) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value2 / 8] != 0x1F) { + goto end; + } + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "!4"; + int value1 = 4; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (sig->proto.proto[value1 / 8] != 0xEF) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value2 / 8] != 0x1F) { + goto end; + } + for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup44(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "!4"; + char *value2_str = "<13"; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value2_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "!4"; + int value1 = 4; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (sig->proto.proto[value1 / 8] != 0xEF) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value2 / 8] != 0x1F) { + goto end; + } + for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup45(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "!4"; + int value1 = 4; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (sig->proto.proto[value1 / 8] != 0xEF) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value2 / 8] != 0x1F) { + goto end; + } + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "!4"; + int value1 = 4; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (sig->proto.proto[value1 / 8] != 0xEF) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value2 / 8] != 0x1F) { + goto end; + } + for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup46(void) +{ + int result = 0; + Signature *sig; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value2 / 8] != 0x1F) { + goto end; + } + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "!4"; + int value1 = 4; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (sig->proto.proto[value1 / 8] != 0xEF) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value2 / 8] != 0x1F) { + goto end; + } + for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup47(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "!4"; + char *value2_str = "<13"; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + for (i = 0; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value2_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "!4"; + int value1 = 4; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (sig->proto.proto[value1 / 8] != 0xEF) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value2 / 8] != 0x1F) { + goto end; + } + for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup48(void) +{ + int result = 0; + Signature *sig; + char *value2_str = "<13"; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value2_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "!4"; + int value1 = 4; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (sig->proto.proto[value1 / 8] != 0xEF) { + goto end; + } + for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value2 / 8] != 0x1F) { + goto end; + } + for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup49(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "!11"; + int value1 = 11; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x17) { + goto end; + } + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "!11"; + int value1 = 11; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x17) { + goto end; + } + for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup50(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "!11"; + char *value2_str = "<13"; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < value3 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value2_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "!11"; + int value1 = 11; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x17) { + goto end; + } + for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup51(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "!11"; + int value1 = 11; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x17) { + goto end; + } + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "!11"; + int value1 = 11; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x17) { + goto end; + } + for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup52(void) +{ + int result = 0; + Signature *sig; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value2 / 8] != 0x1F) { + goto end; + } + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value3_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "!11"; + int value1 = 11; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x17) { + goto end; + } + for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup53(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "!11"; + char *value2_str = "<13"; + char *value3_str = ">34"; + int value3 = 34; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; + for (i = 0; i < value3 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value2_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "!11"; + int value1 = 11; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - if (sig->proto.proto[value1 / 8] != 0xEF) { + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - } - for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0x1F) { + if (sig->proto.proto[value1 / 8] != 0x17) { goto end; } for (i = (value2 / 8) + 1; i < value3 / 8; i++) { @@ -2310,16 +4126,14 @@ static int DetectIPProtoTestSetup45(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup46(void) +static int DetectIPProtoTestSetup54(void) { int result = 0; Signature *sig; - char *value1_str = "!4"; - int value1 = 4; char *value2_str = "<13"; - int value2 = 13; char *value3_str = ">34"; int value3 = 34; int i; @@ -2327,20 +4141,53 @@ static int DetectIPProtoTestSetup46(void) if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xF8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value2_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "!11"; + int value1 = 11; + char *value2_str = "<13"; + int value2 = 13; + char *value3_str = ">34"; + int value3 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - if (sig->proto.proto[value1 / 8] != 0xEF) { + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - } - for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0x1F) { + if (sig->proto.proto[value1 / 8] != 0x17) { goto end; } for (i = (value2 / 8) + 1; i < value3 / 8; i++) { @@ -2360,44 +4207,159 @@ static int DetectIPProtoTestSetup46(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup47(void) +static int DetectIPProtoTestSetup55(void) { int result = 0; Signature *sig; - char *value1_str = "!4"; - int value1 = 4; - char *value2_str = "<13"; - int value2 = 13; - char *value3_str = ">34"; - int value3 = 34; + char *value1_str = "<13"; + int value1 = 13; + char *value2_str = ">34"; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x1F) { + goto end; + } + for (i = (value1 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value2_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "<13"; + int value1 = 13; + char *value2_str = ">34"; + int value2 = 34; + char *value3_str = "!37"; + int value3 = 37; + int i; + + if ((sig = SigAlloc()) == NULL) goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - if (sig->proto.proto[value1 / 8] != 0xEF) { + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x1F) { goto end; } - for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + for (i = (value1 / 8) + 1; i < value2 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value2 / 8] != 0xD8) { + goto end; + } + for (i = (value3 / 8) + 1; i < 256 / 8; i++) { if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0x1F) { + + result = 1; + + end: + SigFree(sig); + return result; +#endif +} + +static int DetectIPProtoTestSetup56(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "<13"; + int value1 = 13; + char *value2_str = ">34"; + char *value3_str = "!37"; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x1F) { goto end; } - for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + for (i = (value1 / 8) + 1; i < 256 / 8; i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xF8) { + if (DetectIPProtoSetup(NULL, sig, value2_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; + +#if 0 + int result = 0; + Signature *sig; + char *value1_str = "<13"; + int value1 = 13; + char *value2_str = ">34"; + int value2 = 34; + char *value3_str = "!37"; + int value3 = 37; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < (value1 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (sig->proto.proto[value1 / 8] != 0x1F) { + goto end; + } + for (i = (value1 / 8) + 1; i < value2 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value2 / 8] != 0xD8) { goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { @@ -2410,44 +4372,75 @@ static int DetectIPProtoTestSetup47(void) end: SigFree(sig); return result; -} +#endif +} + +static int DetectIPProtoTestSetup57(void) +{ + int result = 0; + Signature *sig; + char *value1_str = "<13"; + char *value2_str = ">34"; + int value2 = 34; + int i; + + if ((sig = SigAlloc()) == NULL) + goto end; + + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; + for (i = 0; i < value2 / 8; i++) { + if (sig->proto.proto[i] != 0) + goto end; + } + if (sig->proto.proto[value2 / 8] != 0xF8) { + goto end; + } + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0xFF) + goto end; + } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; + + result = 1; + + end: + SigFree(sig); + return result; -static int DetectIPProtoTestSetup48(void) -{ +#if 0 int result = 0; Signature *sig; - char *value1_str = "!4"; - int value1 = 4; - char *value2_str = "<13"; - int value2 = 13; - char *value3_str = ">34"; - int value3 = 34; + char *value1_str = "<13"; + int value1 = 13; + char *value2_str = ">34"; + int value2 = 34; + char *value3_str = "!37"; + int value3 = 37; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (sig->proto.proto[value1 / 8] != 0xEF) { + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - } - for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0x1F) { + if (sig->proto.proto[value1 / 8] != 0x1F) { goto end; } - for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + for (i = (value1 / 8) + 1; i < value2 / 8; i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xF8) { + if (sig->proto.proto[value2 / 8] != 0xD8) { goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { @@ -2460,88 +4453,78 @@ static int DetectIPProtoTestSetup48(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup49(void) +static int DetectIPProtoTestSetup58(void) { int result = 0; Signature *sig; - char *value1_str = "!11"; - int value1 = 11; - char *value2_str = "<13"; - int value2 = 13; - char *value3_str = ">34"; - int value3 = 34; + char *value1_str = "<13"; + char *value2_str = ">34"; + int value2 = 34; + char *value3_str = "!37"; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } - if (sig->proto.proto[value1 / 8] != 0x17) { - goto end; - } - for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + for (i = 0; i < value2 / 8; i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xF8) { + if (sig->proto.proto[value2 / 8] != 0xD8) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { if (sig->proto.proto[i] != 0xFF) goto end; } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup50(void) -{ +#if 0 int result = 0; Signature *sig; - char *value1_str = "!11"; - int value1 = 11; - char *value2_str = "<13"; - int value2 = 13; - char *value3_str = ">34"; - int value3 = 34; + char *value1_str = "<13"; + int value1 = 13; + char *value2_str = ">34"; + int value2 = 34; + char *value3_str = "!37"; + int value3 = 37; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value1 / 8] != 0x17) { + if (sig->proto.proto[value1 / 8] != 0x1F) { goto end; } - for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + for (i = (value1 / 8) + 1; i < value2 / 8; i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xF8) { + if (sig->proto.proto[value2 / 8] != 0xD8) { goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { @@ -2554,88 +4537,78 @@ static int DetectIPProtoTestSetup50(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup51(void) +static int DetectIPProtoTestSetup59(void) { int result = 0; Signature *sig; - char *value1_str = "!11"; - int value1 = 11; - char *value2_str = "<13"; - int value2 = 13; - char *value3_str = ">34"; - int value3 = 34; + char *value1_str = "<13"; + int value1 = 13; + char *value2_str = ">34"; + char *value3_str = "!37"; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value1 / 8] != 0x17) { + if (sig->proto.proto[value1 / 8] != 0x1F) { goto end; } - for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + for (i = (value1 / 8) + 1; i < 256 / 8; i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xF8) { + if (DetectIPProtoSetup(NULL, sig, value2_str) == 0) goto end; - } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup52(void) -{ +#if 0 int result = 0; Signature *sig; - char *value1_str = "!11"; - int value1 = 11; - char *value2_str = "<13"; - int value2 = 13; - char *value3_str = ">34"; - int value3 = 34; + char *value1_str = "<13"; + int value1 = 13; + char *value2_str = ">34"; + int value2 = 34; + char *value3_str = "!37"; + int value3 = 37; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value1 / 8] != 0x17) { + if (sig->proto.proto[value1 / 8] != 0x1F) { goto end; } - for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + for (i = (value1 / 8) + 1; i < value2 / 8; i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xF8) { + if (sig->proto.proto[value2 / 8] != 0xD8) { goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { @@ -2648,18 +4621,17 @@ static int DetectIPProtoTestSetup52(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup53(void) +static int DetectIPProtoTestSetup60(void) { int result = 0; Signature *sig; - char *value1_str = "!11"; - int value1 = 11; - char *value2_str = "<13"; - int value2 = 13; - char *value3_str = ">34"; - int value3 = 34; + char *value1_str = "<13"; + char *value2_str = ">34"; + int value2 = 34; + char *value3_str = "!37"; int i; if ((sig = SigAlloc()) == NULL) @@ -2667,46 +4639,37 @@ static int DetectIPProtoTestSetup53(void) if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } - if (sig->proto.proto[value1 / 8] != 0x17) { - goto end; - } - for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + for (i = 0; i < value2 / 8; i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xF8) { + if (sig->proto.proto[value2 / 8] != 0xD8) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { if (sig->proto.proto[i] != 0xFF) goto end; } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup54(void) -{ +#if 0 int result = 0; Signature *sig; - char *value1_str = "!11"; - int value1 = 11; - char *value2_str = "<13"; - int value2 = 13; - char *value3_str = ">34"; - int value3 = 34; + char *value1_str = "<13"; + int value1 = 13; + char *value2_str = ">34"; + int value2 = 34; + char *value3_str = "!37"; + int value3 = 37; int i; if ((sig = SigAlloc()) == NULL) @@ -2722,14 +4685,14 @@ static int DetectIPProtoTestSetup54(void) if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value1 / 8] != 0x17) { + if (sig->proto.proto[value1 / 8] != 0x1F) { goto end; } - for (i = (value2 / 8) + 1; i < value3 / 8; i++) { + for (i = (value1 / 8) + 1; i < value2 / 8; i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value3 / 8] != 0xF8) { + if (sig->proto.proto[value2 / 8] != 0xD8) { goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { @@ -2742,18 +4705,16 @@ static int DetectIPProtoTestSetup54(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup55(void) +static int DetectIPProtoTestSetup61(void) { int result = 0; Signature *sig; char *value1_str = "<13"; int value1 = 13; char *value2_str = ">34"; - int value2 = 34; - char *value3_str = "!37"; - int value3 = 37; int i; if ((sig = SigAlloc()) == NULL) @@ -2761,10 +4722,6 @@ static int DetectIPProtoTestSetup55(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; @@ -2772,35 +4729,28 @@ static int DetectIPProtoTestSetup55(void) if (sig->proto.proto[value1 / 8] != 0x1F) { goto end; } - for (i = (value1 / 8) + 1; i < value2 / 8; i++) { + for (i = (value1 / 8) + 1; i < 256 / 8; i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value2 / 8] != 0xD8) { + if (DetectIPProtoSetup(NULL, sig, value2_str) == 0) goto end; - } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup56(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<13"; int value1 = 13; char *value2_str = ">34"; int value2 = 34; - char *value3_str = "!37"; - int value3 = 37; + char *value3_str = "!44"; + int value3 = 44; int i; if ((sig = SigAlloc()) == NULL) @@ -2808,10 +4758,10 @@ static int DetectIPProtoTestSetup56(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; @@ -2823,7 +4773,10 @@ static int DetectIPProtoTestSetup56(void) if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value2 / 8] != 0xD8) { + if (sig->proto.proto[value2 / 8] != 0xF8) { + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xEF) { goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { @@ -2836,25 +4789,22 @@ static int DetectIPProtoTestSetup56(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup57(void) +static int DetectIPProtoTestSetup62(void) { int result = 0; Signature *sig; char *value1_str = "<13"; int value1 = 13; char *value2_str = ">34"; - int value2 = 34; - char *value3_str = "!37"; - int value3 = 37; + char *value3_str = "!44"; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) @@ -2866,45 +4816,38 @@ static int DetectIPProtoTestSetup57(void) if (sig->proto.proto[value1 / 8] != 0x1F) { goto end; } - for (i = (value1 / 8) + 1; i < value2 / 8; i++) { + for (i = (value1 / 8) + 1; i < 256 / 8; i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value2 / 8] != 0xD8) { + if (DetectIPProtoSetup(NULL, sig, value2_str) == 0) goto end; - } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup58(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<13"; int value1 = 13; char *value2_str = ">34"; int value2 = 34; - char *value3_str = "!37"; - int value3 = 37; + char *value3_str = "!44"; + int value3 = 44; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) @@ -2917,7 +4860,10 @@ static int DetectIPProtoTestSetup58(void) if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value2 / 8] != 0xD8) { + if (sig->proto.proto[value2 / 8] != 0xF8) { + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xEF) { goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { @@ -2930,76 +4876,63 @@ static int DetectIPProtoTestSetup58(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup59(void) +static int DetectIPProtoTestSetup63(void) { int result = 0; Signature *sig; char *value1_str = "<13"; - int value1 = 13; char *value2_str = ">34"; int value2 = 34; - char *value3_str = "!37"; - int value3 = 37; int i; if ((sig = SigAlloc()) == NULL) goto end; - - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } - if (sig->proto.proto[value1 / 8] != 0x1F) { - goto end; - } - for (i = (value1 / 8) + 1; i < value2 / 8; i++) { + for (i = 0; i < value2 / 8; i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value2 / 8] != 0xD8) { + if (sig->proto.proto[value2 / 8] != 0xF8) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { if (sig->proto.proto[i] != 0xFF) goto end; } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup60(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<13"; int value1 = 13; char *value2_str = ">34"; int value2 = 34; - char *value3_str = "!37"; - int value3 = 37; + char *value3_str = "!44"; + int value3 = 44; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; @@ -3011,7 +4944,10 @@ static int DetectIPProtoTestSetup60(void) if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value2 / 8] != 0xD8) { + if (sig->proto.proto[value2 / 8] != 0xF8) { + goto end; + } + if (sig->proto.proto[value3 / 8] != 0xEF) { goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { @@ -3024,14 +4960,14 @@ static int DetectIPProtoTestSetup60(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup61(void) +static int DetectIPProtoTestSetup64(void) { int result = 0; Signature *sig; char *value1_str = "<13"; - int value1 = 13; char *value2_str = ">34"; int value2 = 34; char *value3_str = "!44"; @@ -3041,20 +4977,11 @@ static int DetectIPProtoTestSetup61(void) if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } - if (sig->proto.proto[value1 / 8] != 0x1F) { - goto end; - } - for (i = (value1 / 8) + 1; i < value2 / 8; i++) { + for (i = 0; i < value2 / 8; i++) { if (sig->proto.proto[i] != 0) goto end; } @@ -3068,16 +4995,16 @@ static int DetectIPProtoTestSetup61(void) if (sig->proto.proto[i] != 0xFF) goto end; } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup62(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<13"; @@ -3091,11 +5018,11 @@ static int DetectIPProtoTestSetup62(void) if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) @@ -3124,29 +5051,26 @@ static int DetectIPProtoTestSetup62(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup63(void) +static int DetectIPProtoTestSetup65(void) { int result = 0; Signature *sig; char *value1_str = "<13"; int value1 = 13; char *value2_str = ">34"; - int value2 = 34; char *value3_str = "!44"; - int value3 = 44; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; @@ -3154,30 +5078,20 @@ static int DetectIPProtoTestSetup63(void) if (sig->proto.proto[value1 / 8] != 0x1F) { goto end; } - for (i = (value1 / 8) + 1; i < value2 / 8; i++) { + for (i = (value1 / 8) + 1; i < 256 / 8; i++) { if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value2 / 8] != 0xF8) { - goto end; - } - if (sig->proto.proto[value3 / 8] != 0xEF) { + if (DetectIPProtoSetup(NULL, sig, value2_str) == 0) goto end; - } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup64(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<13"; @@ -3191,12 +5105,12 @@ static int DetectIPProtoTestSetup64(void) if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; @@ -3224,14 +5138,14 @@ static int DetectIPProtoTestSetup64(void) end: SigFree(sig); return result; +#endif } -static int DetectIPProtoTestSetup65(void) +static int DetectIPProtoTestSetup66(void) { int result = 0; Signature *sig; char *value1_str = "<13"; - int value1 = 13; char *value2_str = ">34"; int value2 = 34; char *value3_str = "!44"; @@ -3243,18 +5157,9 @@ static int DetectIPProtoTestSetup65(void) if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) - goto end; - } - if (sig->proto.proto[value1 / 8] != 0x1F) { - goto end; - } - for (i = (value1 / 8) + 1; i < value2 / 8; i++) { + for (i = 0; i < value2 / 8; i++) { if (sig->proto.proto[i] != 0) goto end; } @@ -3268,16 +5173,16 @@ static int DetectIPProtoTestSetup65(void) if (sig->proto.proto[i] != 0xFF) goto end; } + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; result = 1; end: SigFree(sig); return result; -} -static int DetectIPProtoTestSetup66(void) -{ +#if 0 int result = 0; Signature *sig; char *value1_str = "<13"; @@ -3324,6 +5229,7 @@ static int DetectIPProtoTestSetup66(void) end: SigFree(sig); return result; +#endif } static int DetectIPProtoTestSetup67(void) @@ -4073,10 +5979,9 @@ static int DetectIPProtoTestSetup87(void) int result = 0; Signature *sig; char *value1_str = "!4"; - int value1 = 4; - char *value2_str = "<10"; + char *value2_str = ">10"; int value2 = 10; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4089,18 +5994,22 @@ static int DetectIPProtoTestSetup87(void) goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - if (sig->proto.proto[value1 / 8] != 0xEF) { - goto end; + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; } - if (sig->proto.proto[value2 / 8] != 0x03) { + if (sig->proto.proto[value2 / 8] != 0xF8) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } + if (sig->proto.proto[value3 / 8] != 0x07) { + goto end; + } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0x0) goto end; } @@ -4116,10 +6025,9 @@ static int DetectIPProtoTestSetup88(void) int result = 0; Signature *sig; char *value1_str = "!4"; - int value1 = 4; - char *value2_str = "<10"; + char *value2_str = ">10"; int value2 = 10; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4132,18 +6040,22 @@ static int DetectIPProtoTestSetup88(void) goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - if (sig->proto.proto[value1 / 8] != 0xEF) { - goto end; + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; } - if (sig->proto.proto[value2 / 8] != 0x03) { + if (sig->proto.proto[value2 / 8] != 0xF8) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } + if (sig->proto.proto[value3 / 8] != 0x07) { + goto end; + } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0x0) goto end; } @@ -4159,10 +6071,9 @@ static int DetectIPProtoTestSetup89(void) int result = 0; Signature *sig; char *value1_str = "!4"; - int value1 = 4; - char *value2_str = "<10"; + char *value2_str = ">10"; int value2 = 10; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4175,18 +6086,22 @@ static int DetectIPProtoTestSetup89(void) goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - if (sig->proto.proto[value1 / 8] != 0xEF) { - goto end; + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; } - if (sig->proto.proto[value2 / 8] != 0x03) { + if (sig->proto.proto[value2 / 8] != 0xF8) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } + if (sig->proto.proto[value3 / 8] != 0x07) { + goto end; + } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0x0) goto end; } @@ -4202,10 +6117,9 @@ static int DetectIPProtoTestSetup90(void) int result = 0; Signature *sig; char *value1_str = "!4"; - int value1 = 4; - char *value2_str = "<10"; + char *value2_str = ">10"; int value2 = 10; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4218,18 +6132,22 @@ static int DetectIPProtoTestSetup90(void) goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (sig->proto.proto[value1 / 8] != 0xEF) { - goto end; + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; } - if (sig->proto.proto[value2 / 8] != 0x03) { + if (sig->proto.proto[value2 / 8] != 0xF8) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } + if (sig->proto.proto[value3 / 8] != 0x07) { + goto end; + } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0x0) goto end; } @@ -4245,10 +6163,9 @@ static int DetectIPProtoTestSetup91(void) int result = 0; Signature *sig; char *value1_str = "!4"; - int value1 = 4; - char *value2_str = "<10"; + char *value2_str = ">10"; int value2 = 10; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4261,18 +6178,22 @@ static int DetectIPProtoTestSetup91(void) goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - if (sig->proto.proto[value1 / 8] != 0xEF) { - goto end; + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; } - if (sig->proto.proto[value2 / 8] != 0x03) { + if (sig->proto.proto[value2 / 8] != 0xF8) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } + if (sig->proto.proto[value3 / 8] != 0x07) { + goto end; + } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0x0) goto end; } @@ -4288,10 +6209,9 @@ static int DetectIPProtoTestSetup92(void) int result = 0; Signature *sig; char *value1_str = "!4"; - int value1 = 4; - char *value2_str = "<10"; + char *value2_str = ">10"; int value2 = 10; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4304,18 +6224,22 @@ static int DetectIPProtoTestSetup92(void) goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (sig->proto.proto[value1 / 8] != 0xEF) { - goto end; + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0) + goto end; } - if (sig->proto.proto[value2 / 8] != 0x03) { + if (sig->proto.proto[value2 / 8] != 0xF8) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } + if (sig->proto.proto[value3 / 8] != 0x07) { + goto end; + } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0x0) goto end; } @@ -4331,10 +6255,9 @@ static int DetectIPProtoTestSetup93(void) int result = 0; Signature *sig; char *value1_str = "!9"; - int value1 = 9; - char *value2_str = "<12"; + char *value2_str = ">12"; int value2 = 12; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4347,19 +6270,19 @@ static int DetectIPProtoTestSetup93(void) goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x0D) { + if (sig->proto.proto[value2 / 8] != 0xE0) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -4375,10 +6298,9 @@ static int DetectIPProtoTestSetup94(void) int result = 0; Signature *sig; char *value1_str = "!9"; - int value1 = 9; - char *value2_str = "<12"; + char *value2_str = ">12"; int value2 = 12; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4391,19 +6313,19 @@ static int DetectIPProtoTestSetup94(void) goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x0D) { + if (sig->proto.proto[value2 / 8] != 0xE0) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -4419,10 +6341,9 @@ static int DetectIPProtoTestSetup95(void) int result = 0; Signature *sig; char *value1_str = "!9"; - int value1 = 9; - char *value2_str = "<12"; + char *value2_str = ">12"; int value2 = 12; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4435,19 +6356,19 @@ static int DetectIPProtoTestSetup95(void) goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x0D) { + if (sig->proto.proto[value2 / 8] != 0xE0) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -4463,10 +6384,9 @@ static int DetectIPProtoTestSetup96(void) int result = 0; Signature *sig; char *value1_str = "!9"; - int value1 = 9; - char *value2_str = "<12"; + char *value2_str = ">12"; int value2 = 12; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4479,19 +6399,19 @@ static int DetectIPProtoTestSetup96(void) goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x0D) { + if (sig->proto.proto[value2 / 8] != 0xE0) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -4507,10 +6427,9 @@ static int DetectIPProtoTestSetup97(void) int result = 0; Signature *sig; char *value1_str = "!9"; - int value1 = 9; - char *value2_str = "<12"; + char *value2_str = ">12"; int value2 = 12; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4523,19 +6442,19 @@ static int DetectIPProtoTestSetup97(void) goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x0D) { + if (sig->proto.proto[value2 / 8] != 0xE0) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -4551,10 +6470,9 @@ static int DetectIPProtoTestSetup98(void) int result = 0; Signature *sig; char *value1_str = "!9"; - int value1 = 9; - char *value2_str = "<12"; + char *value2_str = ">12"; int value2 = 12; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4567,19 +6485,19 @@ static int DetectIPProtoTestSetup98(void) goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x0D) { + if (sig->proto.proto[value2 / 8] != 0xE0) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -4594,11 +6512,11 @@ static int DetectIPProtoTestSetup99(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!13"; int value2 = 13; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4612,18 +6530,18 @@ static int DetectIPProtoTestSetup99(void) if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xD8) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -4638,11 +6556,11 @@ static int DetectIPProtoTestSetup100(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!13"; int value2 = 13; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4656,18 +6574,18 @@ static int DetectIPProtoTestSetup100(void) if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xD8) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -4682,11 +6600,11 @@ static int DetectIPProtoTestSetup101(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!13"; int value2 = 13; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4700,18 +6618,18 @@ static int DetectIPProtoTestSetup101(void) if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xD8) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -4726,11 +6644,11 @@ static int DetectIPProtoTestSetup102(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!13"; int value2 = 13; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4744,18 +6662,18 @@ static int DetectIPProtoTestSetup102(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xD8) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -4770,11 +6688,11 @@ static int DetectIPProtoTestSetup103(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!13"; int value2 = 13; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4788,18 +6706,18 @@ static int DetectIPProtoTestSetup103(void) if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xD8) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -4814,11 +6732,11 @@ static int DetectIPProtoTestSetup104(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!13"; int value2 = 13; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4832,18 +6750,18 @@ static int DetectIPProtoTestSetup104(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xD8) { goto end; } for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -4858,10 +6776,11 @@ static int DetectIPProtoTestSetup105(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!18"; - char *value3_str = ">35"; + int value2 = 18; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4875,18 +6794,21 @@ static int DetectIPProtoTestSetup105(void) if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[value2 / 8] != 0xFB) { + goto end; + } + for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -4901,10 +6823,11 @@ static int DetectIPProtoTestSetup106(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!18"; - char *value3_str = ">35"; + int value2 = 18; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4918,18 +6841,21 @@ static int DetectIPProtoTestSetup106(void) if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[value2 / 8] != 0xFB) { + goto end; + } + for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -4944,10 +6870,11 @@ static int DetectIPProtoTestSetup107(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!18"; - char *value3_str = ">35"; + int value2 = 18; + char *value3_str = "<35"; int value3 = 35; int i; @@ -4961,18 +6888,21 @@ static int DetectIPProtoTestSetup107(void) if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[value2 / 8] != 0xFB) { + goto end; + } + for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -4987,10 +6917,11 @@ static int DetectIPProtoTestSetup108(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!18"; - char *value3_str = ">35"; + int value2 = 18; + char *value3_str = "<35"; int value3 = 35; int i; @@ -5004,18 +6935,21 @@ static int DetectIPProtoTestSetup108(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[value2 / 8] != 0xFB) { + goto end; + } + for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -5030,10 +6964,11 @@ static int DetectIPProtoTestSetup109(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!18"; - char *value3_str = ">35"; + int value2 = 18; + char *value3_str = "<35"; int value3 = 35; int i; @@ -5047,18 +6982,21 @@ static int DetectIPProtoTestSetup109(void) if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[value2 / 8] != 0xFB) { + goto end; + } + for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -5073,10 +7011,11 @@ static int DetectIPProtoTestSetup110(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!18"; - char *value3_str = ">35"; + int value2 = 18; + char *value3_str = "<35"; int value3 = 35; int i; @@ -5090,18 +7029,21 @@ static int DetectIPProtoTestSetup110(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[value2 / 8] != 0xFB) { + goto end; + } + for (i = (value2 / 8) + 1; i < (value3 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) goto end; } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -5116,10 +7058,10 @@ static int DetectIPProtoTestSetup111(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!33"; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -5133,18 +7075,21 @@ static int DetectIPProtoTestSetup111(void) if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } + if (sig->proto.proto[value3 / 8] != 0x05) { + goto end; + } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -5159,10 +7104,10 @@ static int DetectIPProtoTestSetup112(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!33"; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -5176,18 +7121,21 @@ static int DetectIPProtoTestSetup112(void) if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } + if (sig->proto.proto[value3 / 8] != 0x05) { + goto end; + } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -5202,10 +7150,10 @@ static int DetectIPProtoTestSetup113(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!33"; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -5219,18 +7167,21 @@ static int DetectIPProtoTestSetup113(void) if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } + if (sig->proto.proto[value3 / 8] != 0x05) { + goto end; + } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -5245,10 +7196,10 @@ static int DetectIPProtoTestSetup114(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!33"; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -5262,18 +7213,21 @@ static int DetectIPProtoTestSetup114(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } + if (sig->proto.proto[value3 / 8] != 0x05) { + goto end; + } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -5288,10 +7242,10 @@ static int DetectIPProtoTestSetup115(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!33"; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -5305,18 +7259,21 @@ static int DetectIPProtoTestSetup115(void) if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } + if (sig->proto.proto[value3 / 8] != 0x05) { + goto end; + } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -5331,10 +7288,10 @@ static int DetectIPProtoTestSetup116(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; char *value2_str = "!33"; - char *value3_str = ">35"; + char *value3_str = "<35"; int value3 = 35; int i; @@ -5348,18 +7305,21 @@ static int DetectIPProtoTestSetup116(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } + if (sig->proto.proto[value3 / 8] != 0x05) { + goto end; + } for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -5374,12 +7334,11 @@ static int DetectIPProtoTestSetup117(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; - char *value2_str = ">34"; + char *value2_str = "<34"; int value2 = 34; char *value3_str = "!38"; - int value3 = 38; int i; if ((sig = SigAlloc()) == NULL) @@ -5392,21 +7351,21 @@ static int DetectIPProtoTestSetup117(void) if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0xB8) { + if (sig->proto.proto[value2 / 8] != 0x03) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0x0) goto end; } @@ -5421,12 +7380,11 @@ static int DetectIPProtoTestSetup118(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; - char *value2_str = ">34"; + char *value2_str = "<34"; int value2 = 34; char *value3_str = "!38"; - int value3 = 38; int i; if ((sig = SigAlloc()) == NULL) @@ -5439,21 +7397,21 @@ static int DetectIPProtoTestSetup118(void) if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0xB8) { + if (sig->proto.proto[value2 / 8] != 0x03) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0x0) goto end; } @@ -5468,12 +7426,11 @@ static int DetectIPProtoTestSetup119(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; - char *value2_str = ">34"; + char *value2_str = "<34"; int value2 = 34; char *value3_str = "!38"; - int value3 = 38; int i; if ((sig = SigAlloc()) == NULL) @@ -5486,21 +7443,21 @@ static int DetectIPProtoTestSetup119(void) if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0xB8) { + if (sig->proto.proto[value2 / 8] != 0x03) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0x0) goto end; } @@ -5515,39 +7472,38 @@ static int DetectIPProtoTestSetup120(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; - char *value2_str = ">34"; + char *value2_str = "<34"; int value2 = 34; char *value3_str = "!38"; - int value3 = 38; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0xB8) { + if (sig->proto.proto[value2 / 8] != 0x03) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0x0) goto end; } @@ -5562,12 +7518,11 @@ static int DetectIPProtoTestSetup121(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; - char *value2_str = ">34"; + char *value2_str = "<34"; int value2 = 34; char *value3_str = "!38"; - int value3 = 38; int i; if ((sig = SigAlloc()) == NULL) @@ -5580,21 +7535,21 @@ static int DetectIPProtoTestSetup121(void) if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0xB8) { + if (sig->proto.proto[value2 / 8] != 0x03) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0x0) goto end; } @@ -5609,12 +7564,11 @@ static int DetectIPProtoTestSetup122(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; - char *value2_str = ">34"; + char *value2_str = "<34"; int value2 = 34; char *value3_str = "!38"; - int value3 = 38; int i; if ((sig = SigAlloc()) == NULL) @@ -5627,21 +7581,21 @@ static int DetectIPProtoTestSetup122(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } - for (i = (value1 / 8) + 1; i < (value3 / 8); i++) { - if (sig->proto.proto[i] != 0) + for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0xB8) { + if (sig->proto.proto[value2 / 8] != 0x03) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0x0) goto end; } @@ -5656,12 +7610,11 @@ static int DetectIPProtoTestSetup123(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; - char *value2_str = ">34"; + char *value2_str = "<34"; int value2 = 34; char *value3_str = "!45"; - int value3 = 45; int i; if ((sig = SigAlloc()) == NULL) @@ -5674,24 +7627,21 @@ static int DetectIPProtoTestSetup123(void) if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0xF8) { - goto end; - } - if (sig->proto.proto[value3 / 8] != 0xDF) { + if (sig->proto.proto[value2 / 8] != 0x03) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0x0) goto end; } @@ -5706,12 +7656,11 @@ static int DetectIPProtoTestSetup124(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; - char *value2_str = ">34"; + char *value2_str = "<34"; int value2 = 34; char *value3_str = "!45"; - int value3 = 45; int i; if ((sig = SigAlloc()) == NULL) @@ -5719,29 +7668,26 @@ static int DetectIPProtoTestSetup124(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; + if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) + goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0xF8) { - goto end; - } - if (sig->proto.proto[value3 / 8] != 0xDF) { + if (sig->proto.proto[value2 / 8] != 0x03) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0x0) goto end; } @@ -5756,42 +7702,38 @@ static int DetectIPProtoTestSetup125(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; - char *value2_str = ">34"; + char *value2_str = "<34"; int value2 = 34; char *value3_str = "!45"; - int value3 = 45; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0xF8) { - goto end; - } - if (sig->proto.proto[value3 / 8] != 0xDF) { + if (sig->proto.proto[value2 / 8] != 0x03) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0x0) goto end; } @@ -5806,42 +7748,38 @@ static int DetectIPProtoTestSetup126(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; - char *value2_str = ">34"; + char *value2_str = "<34"; int value2 = 34; char *value3_str = "!45"; - int value3 = 45; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0xF8) { - goto end; - } - if (sig->proto.proto[value3 / 8] != 0xDF) { + if (sig->proto.proto[value2 / 8] != 0x03) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0x0) goto end; } @@ -5856,42 +7794,38 @@ static int DetectIPProtoTestSetup127(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; - char *value2_str = ">34"; + char *value2_str = "<34"; int value2 = 34; char *value3_str = "!45"; - int value3 = 45; int i; if ((sig = SigAlloc()) == NULL) goto end; + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) - goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0xF8) { - goto end; - } - if (sig->proto.proto[value3 / 8] != 0xDF) { + if (sig->proto.proto[value2 / 8] != 0x03) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0x0) goto end; } @@ -5906,42 +7840,38 @@ static int DetectIPProtoTestSetup128(void) { int result = 0; Signature *sig; - char *value1_str = "<10"; + char *value1_str = ">10"; int value1 = 10; - char *value2_str = ">34"; + char *value2_str = "<34"; int value2 = 34; char *value3_str = "!45"; - int value3 = 45; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) + if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0x03) { + if (sig->proto.proto[value1 / 8] != 0xF8) { goto end; } for (i = (value1 / 8) + 1; i < (value2 / 8); i++) { - if (sig->proto.proto[i] != 0) + if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value2 / 8] != 0xF8) { - goto end; - } - if (sig->proto.proto[value3 / 8] != 0xDF) { + if (sig->proto.proto[value2 / 8] != 0x03) { goto end; } - for (i = (value3 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { + if (sig->proto.proto[i] != 0x0) goto end; } @@ -5966,19 +7896,19 @@ static int DetectIPProtoTestSetup129(void) if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) - goto end; for (i = 0; i < (value1 / 8); i++) { if (sig->proto.proto[i] != 0xFF) goto end; } - if (sig->proto.proto[value1 / 8] != 0xFB) { + if (sig->proto.proto[value1 / 8] != 0x03) { goto end; } for (i = (value1 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } + if (DetectIPProtoSetup(NULL, sig, value2_str) == 0) + goto end; result = 1; @@ -5992,25 +7922,25 @@ static int DetectIPProtoTestSetup130(void) int result = 0; Signature *sig; char *value1_str = "<10"; - int value1 = 10; char *value2_str = ">10"; + int value2 = 10; int i; if ((sig = SigAlloc()) == NULL) goto end; - if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value2_str) != 0) goto end; - for (i = 0; i < (value1 / 8); i++) { - if (sig->proto.proto[i] != 0xFF) + if (DetectIPProtoSetup(NULL, sig, value1_str) == 0) + goto end; + for (i = 0; i < (value2 / 8); i++) { + if (sig->proto.proto[i] != 0) goto end; } - if (sig->proto.proto[value1 / 8] != 0xFB) { + if (sig->proto.proto[value2 / 8] != 0xF8) { goto end; } - for (i = (value1 / 8) + 1; i < 256 / 8; i++) { + for (i = (value2 / 8) + 1; i < 256 / 8; i++) { if (sig->proto.proto[i] != 0xFF) goto end; } @@ -6168,12 +8098,12 @@ static int DetectIPProtoTestSetup135(void) int result = 0; Signature *sig; char *value1_str = "!4"; - char *value2_str = "!8"; + char *value2_str = ">8"; char *value3_str = "!27"; char *value4_str = "!29"; - char *value5_str = "<30"; - char *value6_str = ">34"; - char *value7_str = "!36"; + char *value5_str = "!30"; + char *value6_str = "!34"; + char *value7_str = "<36"; char *value8_str = "!38"; int value8 = 38; @@ -6198,7 +8128,7 @@ static int DetectIPProtoTestSetup135(void) goto end; if (DetectIPProtoSetup(NULL, sig, value8_str) != 0) goto end; - if (sig->proto.proto[0] != 0xEF) { + if (sig->proto.proto[0] != 0) { goto end; } if (sig->proto.proto[1] != 0xFE) { @@ -6207,14 +8137,14 @@ static int DetectIPProtoTestSetup135(void) if (sig->proto.proto[2] != 0xFF) { goto end; } - if (sig->proto.proto[3] != 0x17) { + if (sig->proto.proto[3] != 0x97) { goto end; } - if (sig->proto.proto[4] != 0xA8) { + if (sig->proto.proto[4] != 0x0B) { goto end; } for (i = (value8 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -6230,12 +8160,12 @@ static int DetectIPProtoTestSetup136(void) int result = 0; Signature *sig; char *value1_str = "!4"; - char *value2_str = "!8"; + char *value2_str = ">8"; char *value3_str = "!27"; char *value4_str = "!29"; - char *value5_str = "<30"; - char *value6_str = ">34"; - char *value7_str = "!36"; + char *value5_str = "!30"; + char *value6_str = "!34"; + char *value7_str = "<36"; char *value8_str = "!38"; int value8 = 38; @@ -6260,7 +8190,7 @@ static int DetectIPProtoTestSetup136(void) goto end; if (DetectIPProtoSetup(NULL, sig, value1_str) != 0) goto end; - if (sig->proto.proto[0] != 0xEF) { + if (sig->proto.proto[0] != 0) { goto end; } if (sig->proto.proto[1] != 0xFE) { @@ -6269,14 +8199,14 @@ static int DetectIPProtoTestSetup136(void) if (sig->proto.proto[2] != 0xFF) { goto end; } - if (sig->proto.proto[3] != 0x17) { + if (sig->proto.proto[3] != 0x97) { goto end; } - if (sig->proto.proto[4] != 0xA8) { + if (sig->proto.proto[4] != 0x0B) { goto end; } for (i = (value8 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -6292,12 +8222,12 @@ static int DetectIPProtoTestSetup137(void) int result = 0; Signature *sig; char *value1_str = "!4"; - char *value2_str = "!8"; + char *value2_str = ">8"; char *value3_str = "!27"; char *value4_str = "!29"; - char *value5_str = "<30"; - char *value6_str = ">34"; - char *value7_str = "!36"; + char *value5_str = "!30"; + char *value6_str = "!34"; + char *value7_str = "<36"; char *value8_str = "!38"; int value8 = 38; @@ -6322,7 +8252,7 @@ static int DetectIPProtoTestSetup137(void) goto end; if (DetectIPProtoSetup(NULL, sig, value6_str) != 0) goto end; - if (sig->proto.proto[0] != 0xEF) { + if (sig->proto.proto[0] != 0) { goto end; } if (sig->proto.proto[1] != 0xFE) { @@ -6331,14 +8261,14 @@ static int DetectIPProtoTestSetup137(void) if (sig->proto.proto[2] != 0xFF) { goto end; } - if (sig->proto.proto[3] != 0x17) { + if (sig->proto.proto[3] != 0x97) { goto end; } - if (sig->proto.proto[4] != 0xA8) { + if (sig->proto.proto[4] != 0x0B) { goto end; } for (i = (value8 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -6354,12 +8284,12 @@ static int DetectIPProtoTestSetup138(void) int result = 0; Signature *sig; char *value1_str = "!4"; - char *value2_str = "!8"; + char *value2_str = ">8"; char *value3_str = "!27"; char *value4_str = "!29"; - char *value5_str = "<30"; - char *value6_str = ">34"; - char *value7_str = "!36"; + char *value5_str = "!30"; + char *value6_str = "!34"; + char *value7_str = "<36"; char *value8_str = "!38"; int value8 = 38; @@ -6384,7 +8314,7 @@ static int DetectIPProtoTestSetup138(void) goto end; if (DetectIPProtoSetup(NULL, sig, value5_str) != 0) goto end; - if (sig->proto.proto[0] != 0xEF) { + if (sig->proto.proto[0] != 0) { goto end; } if (sig->proto.proto[1] != 0xFE) { @@ -6393,14 +8323,14 @@ static int DetectIPProtoTestSetup138(void) if (sig->proto.proto[2] != 0xFF) { goto end; } - if (sig->proto.proto[3] != 0x17) { + if (sig->proto.proto[3] != 0x97) { goto end; } - if (sig->proto.proto[4] != 0xA8) { + if (sig->proto.proto[4] != 0x0B) { goto end; } for (i = (value8 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -6416,12 +8346,12 @@ static int DetectIPProtoTestSetup139(void) int result = 0; Signature *sig; char *value1_str = "!4"; - char *value2_str = "!8"; + char *value2_str = ">8"; char *value3_str = "!27"; char *value4_str = "!29"; - char *value5_str = "<30"; - char *value6_str = ">34"; - char *value7_str = "!36"; + char *value5_str = "!30"; + char *value6_str = "!34"; + char *value7_str = "<36"; char *value8_str = "!38"; int value8 = 38; @@ -6446,7 +8376,7 @@ static int DetectIPProtoTestSetup139(void) goto end; if (DetectIPProtoSetup(NULL, sig, value4_str) != 0) goto end; - if (sig->proto.proto[0] != 0xEF) { + if (sig->proto.proto[0] != 0) { goto end; } if (sig->proto.proto[1] != 0xFE) { @@ -6455,14 +8385,14 @@ static int DetectIPProtoTestSetup139(void) if (sig->proto.proto[2] != 0xFF) { goto end; } - if (sig->proto.proto[3] != 0x17) { + if (sig->proto.proto[3] != 0x97) { goto end; } - if (sig->proto.proto[4] != 0xA8) { + if (sig->proto.proto[4] != 0x0B) { goto end; } for (i = (value8 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -6478,12 +8408,12 @@ static int DetectIPProtoTestSetup140(void) int result = 0; Signature *sig; char *value1_str = "!4"; - char *value2_str = "!8"; + char *value2_str = ">8"; char *value3_str = "!27"; char *value4_str = "!29"; - char *value5_str = "<30"; - char *value6_str = ">34"; - char *value7_str = "!36"; + char *value5_str = "!30"; + char *value6_str = "!34"; + char *value7_str = "<36"; char *value8_str = "!38"; int value8 = 38; @@ -6508,7 +8438,7 @@ static int DetectIPProtoTestSetup140(void) goto end; if (DetectIPProtoSetup(NULL, sig, value5_str) != 0) goto end; - if (sig->proto.proto[0] != 0xEF) { + if (sig->proto.proto[0] != 0) { goto end; } if (sig->proto.proto[1] != 0xFE) { @@ -6517,14 +8447,14 @@ static int DetectIPProtoTestSetup140(void) if (sig->proto.proto[2] != 0xFF) { goto end; } - if (sig->proto.proto[3] != 0x17) { + if (sig->proto.proto[3] != 0x97) { goto end; } - if (sig->proto.proto[4] != 0xA8) { + if (sig->proto.proto[4] != 0x0B) { goto end; } for (i = (value8 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -6540,12 +8470,12 @@ static int DetectIPProtoTestSetup141(void) int result = 0; Signature *sig; char *value1_str = "!4"; - char *value2_str = "!8"; + char *value2_str = ">8"; char *value3_str = "!27"; char *value4_str = "!29"; - char *value5_str = "<30"; - char *value6_str = ">34"; - char *value7_str = "!36"; + char *value5_str = "!30"; + char *value6_str = "!34"; + char *value7_str = "<36"; char *value8_str = "!38"; int value8 = 38; @@ -6566,11 +8496,11 @@ static int DetectIPProtoTestSetup141(void) goto end; if (DetectIPProtoSetup(NULL, sig, value3_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value4_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value5_str) != 0) goto end; - if (sig->proto.proto[0] != 0xEF) { + if (DetectIPProtoSetup(NULL, sig, value4_str) != 0) + goto end; + if (sig->proto.proto[0] != 0) { goto end; } if (sig->proto.proto[1] != 0xFE) { @@ -6579,14 +8509,14 @@ static int DetectIPProtoTestSetup141(void) if (sig->proto.proto[2] != 0xFF) { goto end; } - if (sig->proto.proto[3] != 0x17) { + if (sig->proto.proto[3] != 0x97) { goto end; } - if (sig->proto.proto[4] != 0xA8) { + if (sig->proto.proto[4] != 0x0B) { goto end; } for (i = (value8 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; } @@ -6602,12 +8532,12 @@ static int DetectIPProtoTestSetup142(void) int result = 0; Signature *sig; char *value1_str = "!4"; - char *value2_str = "!8"; + char *value2_str = ">8"; char *value3_str = "!27"; char *value4_str = "!29"; - char *value5_str = "<30"; - char *value6_str = ">34"; - char *value7_str = "!36"; + char *value5_str = "!30"; + char *value6_str = "!34"; + char *value7_str = "<36"; char *value8_str = "!38"; int value8 = 38; @@ -6628,11 +8558,11 @@ static int DetectIPProtoTestSetup142(void) goto end; if (DetectIPProtoSetup(NULL, sig, value5_str) != 0) goto end; - if (DetectIPProtoSetup(NULL, sig, value6_str) != 0) - goto end; if (DetectIPProtoSetup(NULL, sig, value7_str) != 0) goto end; - if (sig->proto.proto[0] != 0xEF) { + if (DetectIPProtoSetup(NULL, sig, value6_str) != 0) + goto end; + if (sig->proto.proto[0] != 0) { goto end; } if (sig->proto.proto[1] != 0xFE) { @@ -6641,14 +8571,14 @@ static int DetectIPProtoTestSetup142(void) if (sig->proto.proto[2] != 0xFF) { goto end; } - if (sig->proto.proto[3] != 0x17) { + if (sig->proto.proto[3] != 0x97) { goto end; } - if (sig->proto.proto[4] != 0xA8) { + if (sig->proto.proto[4] != 0x0B) { goto end; } for (i = (value8 / 8) + 1; i < 256 / 8; i++) { - if (sig->proto.proto[i] != 0xFF) + if (sig->proto.proto[i] != 0) goto end; }