50 #define PARSE_REGEX "^([!<>]?)\\s*([^\\s]+)$"
56 static void DetectIPProtoRegisterTests(
void);
87 char *args[2] = { NULL, NULL };
94 pcre2_match_data *match = NULL;
98 "%" PRId32
", string %s",
103 for (i = 0; i < (ret - 1); i++) {
104 res = pcre2_substring_get_bynumber(match, i + 1, (PCRE2_UCHAR8 **)&str_ptr, &pcre2_len);
106 SCLogError(
"pcre2_substring_get_bynumber failed");
109 args[i] = (
char *)str_ptr;
120 if (*(args[0]) !=
'\0') {
121 data->
op = *(args[0]);
125 if (!isdigit((
unsigned char)*(args[1]))) {
128 SCLogError(
"Unknown protocol name: \"%s\"", str_ptr);
135 SCLogError(
"Malformed protocol number: %s", str_ptr);
140 for (i = 0; i < (ret - 1); i++){
142 pcre2_substring_free((PCRE2_UCHAR8 *)args[i]);
145 pcre2_match_data_free(match);
150 pcre2_match_data_free(match);
152 for (i = 0; i < (ret - 1) && i < 2; i++){
154 pcre2_substring_free((PCRE2_UCHAR8 *)args[i]);
162 static int DetectIPProtoTypePresentForOP(
Signature *s, uint8_t op)
216 "ip_proto keyword only when we use alert ip, "
217 "in which case the _ANY flag is set on the sig "
218 "and the if condition should match.");
230 if (eq_set || gt_set || lt_set || not_set) {
232 "ipproto without any operators attached to "
233 "them in the same sig");
240 if (eq_set || gt_set) {
242 "ipproto along with a greater than ipproto in the "
246 if (!lt_set && !not_set) {
248 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
251 }
else if (lt_set && !not_set) {
253 while (temp_sm != NULL) {
257 temp_sm = temp_sm->
next;
259 if (temp_sm != NULL) {
263 "both gt and lt ipprotos, with the lt being "
264 "lower than gt value");
267 for (i = 0; i < (data->
proto / 8); i++) {
271 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
276 }
else if (!lt_set && not_set) {
277 for (i = 0; i < (data->
proto / 8); i++) {
281 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
287 while (temp_sm != NULL) {
292 temp_sm = temp_sm->
next;
294 if (temp_sm != NULL) {
298 "both gt and lt ipprotos, with the lt being "
299 "lower than gt value");
302 for (i = 0; i < (data->
proto / 8); i++) {
306 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
315 if (eq_set || lt_set) {
317 "ipproto along with a less than ipproto in the "
321 if (!gt_set && !not_set) {
322 for (i = 0; i < (data->
proto / 8); i++) {
326 }
else if (gt_set && !not_set) {
328 while (temp_sm != NULL) {
332 temp_sm = temp_sm->
next;
334 if (temp_sm != NULL) {
338 "both gt and lt ipprotos, with the lt being "
339 "lower than gt value");
342 for (i = 0; i < (data->
proto / 8); i++) {
346 for (i = (data->
proto / 8) + 1; i < 256 / 8; i++) {
351 }
else if (!gt_set && not_set) {
352 for (i = 0; i < (data->
proto / 8); i++) {
356 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
362 while (temp_sm != NULL) {
367 temp_sm = temp_sm->
next;
369 if (temp_sm != NULL) {
373 "both gt and lt ipprotos, with the lt being "
374 "lower than gt value");
377 for (i = 0; i < (data->
proto / 8); i++) {
381 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
392 "ipproto along with a not ipproto in the "
396 if (!gt_set && !lt_set && !not_set) {
397 for (i = 0; i < (data->
proto / 8); i++) {
401 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
405 for (i = 0; i < (data->
proto / 8); i++) {
409 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
426 DetectIPProtoFree(
de_ctx, data);
461 static int DetectIPProtoTestParse01(
void)
471 static int DetectIPProtoTestParse02(
void)
481 static int DetectIPProtoTestSetup01(
void)
483 const char *value_str =
"14";
493 DetectIPProtoSetup(NULL, sig, value_str);
494 for (i = 0; i < (value / 8); i++) {
498 for (i = (value / 8) + 1; i < (256 / 8); i++) {
508 static int DetectIPProtoTestSetup02(
void)
512 const char *value_str =
"tcp";
513 struct protoent *pent = getprotobyname(value_str);
517 uint8_t value = (uint8_t)pent->p_proto;
525 DetectIPProtoSetup(NULL, sig, value_str);
526 for (i = 0; i < (value / 8); i++) {
533 for (i = (value / 8) + 1; i < (256 / 8); i++) {
549 static int DetectIPProtoTestSetup03(
void)
553 const char *value_str =
"<14";
562 DetectIPProtoSetup(NULL, sig, value_str);
563 for (i = 0; i < (value / 8); i++) {
570 for (i = (value / 8) + 1; i < (256 / 8); i++) {
585 static int DetectIPProtoTestSetup04(
void)
589 const char *value_str =
">14";
598 DetectIPProtoSetup(NULL, sig, value_str);
599 for (i = 0; i < (value / 8); i++) {
606 for (i = (value / 8) + 1; i < (256 / 8); i++) {
621 static int DetectIPProtoTestSetup05(
void)
625 const char *value_str =
"!14";
634 DetectIPProtoSetup(NULL, sig, value_str);
635 for (i = 0; i < (value / 8); i++) {
642 for (i = (value / 8) + 1; i < (256 / 8); i++) {
657 static int DetectIPProtoTestSetup06(
void)
661 const char *value1_str =
"14";
662 const char *value2_str =
"15";
669 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
671 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
684 static int DetectIPProtoTestSetup07(
void)
688 const char *value1_str =
"14";
689 const char *value2_str =
"<15";
696 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
698 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
711 static int DetectIPProtoTestSetup08(
void)
715 const char *value1_str =
"14";
716 const char *value2_str =
">15";
723 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
725 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
738 static int DetectIPProtoTestSetup09(
void)
742 const char *value1_str =
"14";
743 const char *value2_str =
"!15";
750 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
752 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
765 static int DetectIPProtoTestSetup10(
void)
769 const char *value1_str =
">14";
770 const char *value2_str =
"15";
777 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
779 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
792 static int DetectIPProtoTestSetup11(
void)
796 const char *value1_str =
"<14";
797 const char *value2_str =
"15";
804 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
806 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
819 static int DetectIPProtoTestSetup12(
void)
823 const char *value1_str =
"!14";
824 const char *value2_str =
"15";
831 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
833 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
846 static int DetectIPProtoTestSetup13(
void)
850 const char *value1_str =
">14";
851 const char *value2_str =
">15";
858 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
860 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
870 static int DetectIPProtoTestSetup14(
void)
874 const char *value1_str =
"<14";
875 const char *value2_str =
"<15";
882 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
884 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
894 static int DetectIPProtoTestSetup15(
void)
898 const char *value1_str =
"<14";
900 const char *value2_str =
">34";
908 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
910 for (i = 0; i < (value1 / 8); i++) {
917 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
921 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
931 static int DetectIPProtoTestSetup16(
void)
935 const char *value1_str =
"<14";
936 const char *value2_str =
">34";
945 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
947 for (i = 0; i < (value2 / 8); i++) {
954 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
958 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
968 static int DetectIPProtoTestSetup17(
void)
972 const char *value1_str =
"<11";
974 const char *value2_str =
">13";
982 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
984 for (i = 0; i < (value1 / 8); i++) {
991 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
995 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1005 static int DetectIPProtoTestSetup18(
void)
1009 const char *value1_str =
"<11";
1010 const char *value2_str =
">13";
1019 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1021 for (i = 0; i < (value2 / 8); i++) {
1028 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
1032 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1042 static int DetectIPProtoTestSetup19(
void)
1046 const char *value1_str =
"<11";
1048 const char *value2_str =
"!13";
1049 const char *value3_str =
">36";
1057 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1059 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1061 for (i = 0; i < (value1 / 8); i++) {
1068 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1072 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1082 static int DetectIPProtoTestSetup20(
void)
1086 const char *value1_str =
"<11";
1088 const char *value3_str =
">36";
1096 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1098 for (i = 0; i < (value1 / 8); i++) {
1105 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1109 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1119 static int DetectIPProtoTestSetup21(
void)
1123 const char *value1_str =
"<11";
1125 const char *value2_str =
"!13";
1126 const char *value3_str =
">36";
1134 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1136 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1138 for (i = 0; i < (value1 / 8); i++) {
1145 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1149 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1159 static int DetectIPProtoTestSetup22(
void)
1163 const char *value1_str =
"<11";
1164 const char *value2_str =
"!13";
1165 const char *value3_str =
">36";
1174 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1176 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1178 for (i = 0; i < (value3 / 8); i++) {
1185 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1189 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1199 static int DetectIPProtoTestSetup23(
void)
1203 const char *value1_str =
"<11";
1204 const char *value3_str =
">36";
1213 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1215 for (i = 0; i < (value3 / 8); i++) {
1222 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1226 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1236 static int DetectIPProtoTestSetup24(
void)
1240 const char *value1_str =
"<11";
1241 const char *value2_str =
"!13";
1242 const char *value3_str =
">36";
1251 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1253 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1255 for (i = 0; i < (value3 / 8); i++) {
1262 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1266 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1276 static int DetectIPProtoTestSetup33(
void)
1280 const char *value1_str =
"<11";
1282 const char *value2_str =
"!34";
1283 const char *value3_str =
">36";
1291 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1293 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1295 for (i = 0; i < (value1 / 8); i++) {
1302 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1306 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1316 static int DetectIPProtoTestSetup34(
void)
1320 const char *value1_str =
"<11";
1322 const char *value2_str =
"!34";
1323 const char *value3_str =
">36";
1332 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1334 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1336 for (i = 0; i < (value1 / 8); i++) {
1343 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1347 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1357 static int DetectIPProtoTestSetup36(
void)
1361 const char *value1_str =
"<11";
1362 const char *value2_str =
"!34";
1363 const char *value3_str =
">36";
1372 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1374 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1376 for (i = 0; i < (value3 / 8); i++) {
1383 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1387 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1397 static int DetectIPProtoTestSetup43(
void)
1401 const char *value1_str =
"!4";
1403 const char *value2_str =
"<13";
1405 const char *value3_str =
">34";
1413 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1415 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1420 for (i = (value1 / 8) + 1; i < (value2 / 8); i++) {
1427 for (i = (value2 / 8) + 1; i < 256 / 8; i++) {
1431 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1441 static int DetectIPProtoTestSetup44(
void)
1445 const char *value1_str =
"!4";
1446 const char *value2_str =
"<13";
1447 const char *value3_str =
">34";
1456 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1458 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1460 for (i = 0; i < (value3 / 8); i++) {
1467 for (i = (value3 / 8) + 1; i < 256 / 8; i++) {
1471 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1481 static int DetectIPProtoTestSetup45(
void)
1485 const char *value1_str =
"!4";
1487 const char *value2_str =
"<13";
1489 const char *value3_str =
">34";
1497 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1499 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1504 for (i = (value1 / 8) + 1; i < (value2 / 8); i++) {
1511 for (i = (value2 / 8) + 1; i < 256 / 8; i++) {
1515 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1525 static int DetectIPProtoTestSetup56(
void)
1529 const char *value1_str =
"<13";
1531 const char *value2_str =
">34";
1532 const char *value3_str =
"!37";
1540 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1542 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1544 for (i = 0; i < (value1 / 8); i++) {
1551 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1555 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1565 static int DetectIPProtoTestSetup75(
void)
1569 const char *value1_str =
"!8";
1570 const char *value2_str =
">10";
1579 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1581 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1583 for (i = 0; i < (value2 / 8); i++) {
1590 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
1602 static int DetectIPProtoTestSetup76(
void)
1606 const char *value1_str =
"!8";
1607 const char *value2_str =
">10";
1616 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1618 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1620 for (i = 0; i < (value2 / 8); i++) {
1627 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
1639 static int DetectIPProtoTestSetup129(
void)
1643 const char *value1_str =
"<10";
1645 const char *value2_str =
">10";
1653 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1655 for (i = 0; i < (value1 / 8); i++) {
1662 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1666 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1676 static int DetectIPProtoTestSetup130(
void)
1680 const char *value1_str =
"<10";
1681 const char *value2_str =
">10";
1690 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1692 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1694 for (i = 0; i < (value2 / 8); i++) {
1701 for (i = (value2 / 8) + 1; i < 256 / 8; i++) {
1713 static int DetectIPProtoTestSetup131(
void)
1717 const char *value1_str =
"<10";
1719 const char *value2_str =
"!10";
1727 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1729 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1731 for (i = 0; i < (value1 / 8); i++) {
1738 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1750 static int DetectIPProtoTestSetup132(
void)
1754 const char *value1_str =
"<10";
1756 const char *value2_str =
"!10";
1764 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1766 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1768 for (i = 0; i < (value1 / 8); i++) {
1775 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1787 static int DetectIPProtoTestSetup145(
void)
1791 const char *value1_str =
"!4";
1792 const char *value2_str =
">8";
1793 const char *value3_str =
"!10";
1794 const char *value4_str =
"!14";
1795 const char *value5_str =
"!27";
1796 const char *value6_str =
"!29";
1797 const char *value7_str =
"!30";
1798 const char *value8_str =
"!34";
1799 const char *value9_str =
"<36";
1800 const char *value10_str =
"!38";
1810 if (DetectIPProtoSetup(NULL, sig, value5_str) != 0)
1812 if (DetectIPProtoSetup(NULL, sig, value8_str) != 0)
1814 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1816 if (DetectIPProtoSetup(NULL, sig, value10_str) != 0)
1818 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1820 if (DetectIPProtoSetup(NULL, sig, value6_str) != 0)
1822 if (DetectIPProtoSetup(NULL, sig, value9_str) != 0)
1824 if (DetectIPProtoSetup(NULL, sig, value4_str) != 0)
1826 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1828 if (DetectIPProtoSetup(NULL, sig, value7_str) != 0)
1845 for (i = (value10 / 8) + 1; i < 256 / 8; i++) {
1857 static int DetectIPProtoTestSig1(
void)
1860 uint8_t *buf = (uint8_t *)
1861 "GET /one/ HTTP/1.1\r\n"
1862 "Host: one.example.org\r\n"
1864 uint16_t buflen = strlen((
char *)buf);
1869 const char *sigs[4];
1870 sigs[0] =
"alert ip any any -> any any "
1871 "(msg:\"Not tcp\"; ip_proto:!tcp; content:\"GET \"; sid:1;)";
1872 sigs[1] =
"alert ip any any -> any any "
1873 "(msg:\"Less than 7\"; content:\"GET \"; ip_proto:<7; sid:2;)";
1874 sigs[2] =
"alert ip any any -> any any "
1875 "(msg:\"Greater than 5\"; content:\"GET \"; ip_proto:>5; sid:3;)";
1876 sigs[3] =
"alert ip any any -> any any "
1877 "(msg:\"Equals tcp\"; content:\"GET \"; ip_proto:tcp; sid:4;)";
1880 uint32_t sid[4] = {1, 2, 3, 4};
1882 uint32_t results[4] = {0, 1, 1, 1};
1897 static int DetectIPProtoTestSig2(
void)
1901 uint8_t raw_eth[] = {
1902 0x01, 0x00, 0x5e, 0x00, 0x00, 0x0d, 0x00, 0x26,
1903 0x88, 0x61, 0x3a, 0x80, 0x08, 0x00, 0x45, 0xc0,
1904 0x00, 0x36, 0xe4, 0xcd, 0x00, 0x00, 0x01, 0x67,
1905 0xc7, 0xab, 0xac, 0x1c, 0x7f, 0xfe, 0xe0, 0x00,
1906 0x00, 0x0d, 0x20, 0x00, 0x90, 0x20, 0x00, 0x01,
1907 0x00, 0x02, 0x00, 0x69, 0x00, 0x02, 0x00, 0x04,
1908 0x81, 0xf4, 0x07, 0xd0, 0x00, 0x13, 0x00, 0x04,
1909 0x00, 0x00, 0x00, 0x01, 0x00, 0x14, 0x00, 0x04,
1910 0x4a, 0xea, 0x7a, 0x8e,
1923 memset(&th_v, 0,
sizeof(th_v));
1937 "alert ip any any -> any any (msg:\"Check ipproto usage\"; "
1938 "ip_proto:!103; sid:1;)");
1982 static int DetectIPProtoTestSig3(
void)
1984 uint8_t raw_eth[] = {
1985 0x01, 0x00, 0x5e, 0x00, 0x00, 0x0d, 0x00, 0x26,
1986 0x88, 0x61, 0x3a, 0x80, 0x08, 0x00, 0x45, 0xc0,
1987 0x00, 0x36, 0xe4, 0xcd, 0x00, 0x00, 0x01, 0x67,
1988 0xc7, 0xab, 0xac, 0x1c, 0x7f, 0xfe, 0xe0, 0x00,
1989 0x00, 0x0d, 0x20, 0x00, 0x90, 0x20, 0x00, 0x01,
1990 0x00, 0x02, 0x00, 0x69, 0x00, 0x02, 0x00, 0x04,
1991 0x81, 0xf4, 0x07, 0xd0, 0x00, 0x13, 0x00, 0x04,
1992 0x00, 0x00, 0x00, 0x01, 0x00, 0x14, 0x00, 0x04,
1993 0x4a, 0xea, 0x7a, 0x8e,
2005 memset(&th_v, 0,
sizeof(th_v));
2016 "alert ip any any -> any any (msg:\"Check ipproto usage\"; "
2017 "ip_proto:103; sid:1;)");
2037 static void DetectIPProtoRegisterTests(
void)
2039 UtRegisterTest(
"DetectIPProtoTestParse01", DetectIPProtoTestParse01);
2040 UtRegisterTest(
"DetectIPProtoTestParse02", DetectIPProtoTestParse02);
2041 UtRegisterTest(
"DetectIPProtoTestSetup01", DetectIPProtoTestSetup01);
2042 UtRegisterTest(
"DetectIPProtoTestSetup02", DetectIPProtoTestSetup02);
2043 UtRegisterTest(
"DetectIPProtoTestSetup03", DetectIPProtoTestSetup03);
2044 UtRegisterTest(
"DetectIPProtoTestSetup04", DetectIPProtoTestSetup04);
2045 UtRegisterTest(
"DetectIPProtoTestSetup05", DetectIPProtoTestSetup05);
2046 UtRegisterTest(
"DetectIPProtoTestSetup06", DetectIPProtoTestSetup06);
2047 UtRegisterTest(
"DetectIPProtoTestSetup07", DetectIPProtoTestSetup07);
2048 UtRegisterTest(
"DetectIPProtoTestSetup08", DetectIPProtoTestSetup08);
2049 UtRegisterTest(
"DetectIPProtoTestSetup09", DetectIPProtoTestSetup09);
2050 UtRegisterTest(
"DetectIPProtoTestSetup10", DetectIPProtoTestSetup10);
2051 UtRegisterTest(
"DetectIPProtoTestSetup11", DetectIPProtoTestSetup11);
2052 UtRegisterTest(
"DetectIPProtoTestSetup12", DetectIPProtoTestSetup12);
2053 UtRegisterTest(
"DetectIPProtoTestSetup13", DetectIPProtoTestSetup13);
2054 UtRegisterTest(
"DetectIPProtoTestSetup14", DetectIPProtoTestSetup14);
2055 UtRegisterTest(
"DetectIPProtoTestSetup15", DetectIPProtoTestSetup15);
2056 UtRegisterTest(
"DetectIPProtoTestSetup16", DetectIPProtoTestSetup16);
2057 UtRegisterTest(
"DetectIPProtoTestSetup17", DetectIPProtoTestSetup17);
2058 UtRegisterTest(
"DetectIPProtoTestSetup18", DetectIPProtoTestSetup18);
2059 UtRegisterTest(
"DetectIPProtoTestSetup19", DetectIPProtoTestSetup19);
2060 UtRegisterTest(
"DetectIPProtoTestSetup20", DetectIPProtoTestSetup20);
2061 UtRegisterTest(
"DetectIPProtoTestSetup21", DetectIPProtoTestSetup21);
2062 UtRegisterTest(
"DetectIPProtoTestSetup22", DetectIPProtoTestSetup22);
2063 UtRegisterTest(
"DetectIPProtoTestSetup23", DetectIPProtoTestSetup23);
2064 UtRegisterTest(
"DetectIPProtoTestSetup24", DetectIPProtoTestSetup24);
2065 UtRegisterTest(
"DetectIPProtoTestSetup33", DetectIPProtoTestSetup33);
2066 UtRegisterTest(
"DetectIPProtoTestSetup34", DetectIPProtoTestSetup34);
2067 UtRegisterTest(
"DetectIPProtoTestSetup36", DetectIPProtoTestSetup36);
2068 UtRegisterTest(
"DetectIPProtoTestSetup43", DetectIPProtoTestSetup43);
2069 UtRegisterTest(
"DetectIPProtoTestSetup44", DetectIPProtoTestSetup44);
2070 UtRegisterTest(
"DetectIPProtoTestSetup45", DetectIPProtoTestSetup45);
2071 UtRegisterTest(
"DetectIPProtoTestSetup56", DetectIPProtoTestSetup56);
2072 UtRegisterTest(
"DetectIPProtoTestSetup75", DetectIPProtoTestSetup75);
2073 UtRegisterTest(
"DetectIPProtoTestSetup76", DetectIPProtoTestSetup76);
2074 UtRegisterTest(
"DetectIPProtoTestSetup129", DetectIPProtoTestSetup129);
2075 UtRegisterTest(
"DetectIPProtoTestSetup130", DetectIPProtoTestSetup130);
2076 UtRegisterTest(
"DetectIPProtoTestSetup131", DetectIPProtoTestSetup131);
2077 UtRegisterTest(
"DetectIPProtoTestSetup132", DetectIPProtoTestSetup132);
2078 UtRegisterTest(
"DetectIPProtoTestSetup145", DetectIPProtoTestSetup145);