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 with a less than ipproto in the "
321 if (!gt_set && !not_set) {
322 for (i = 0; i < (data->
proto / 8); i++) {
326 (uint8_t)(~(0xff << (data->
proto % 8)));
327 }
else if (gt_set && !not_set) {
329 while (temp_sm != NULL) {
333 temp_sm = temp_sm->
next;
335 if (temp_sm != NULL) {
339 "both gt and lt ipprotos, with the lt being "
340 "lower than gt value");
343 for (i = 0; i < (data->
proto / 8); i++) {
347 for (i = (data->
proto / 8) + 1; i < 256 / 8; i++) {
352 }
else if (!gt_set && not_set) {
353 for (i = 0; i < (data->
proto / 8); i++) {
357 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
363 while (temp_sm != NULL) {
368 temp_sm = temp_sm->
next;
370 if (temp_sm != NULL) {
374 "both gt and lt ipprotos, with the lt being "
375 "lower than gt value");
378 for (i = 0; i < (data->
proto / 8); i++) {
382 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
393 "ipproto along with a not ipproto in the "
397 if (!gt_set && !lt_set && !not_set) {
398 for (i = 0; i < (data->
proto / 8); i++) {
402 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
406 for (i = 0; i < (data->
proto / 8); i++) {
410 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
427 DetectIPProtoFree(
de_ctx, data);
462 static int DetectIPProtoTestParse01(
void)
472 static int DetectIPProtoTestParse02(
void)
482 static int DetectIPProtoTestSetup01(
void)
484 const char *value_str =
"14";
494 DetectIPProtoSetup(NULL, sig, value_str);
495 for (i = 0; i < (value / 8); i++) {
499 for (i = (value / 8) + 1; i < (256 / 8); i++) {
509 static int DetectIPProtoTestSetup02(
void)
513 const char *value_str =
"tcp";
514 struct protoent *pent = getprotobyname(value_str);
518 uint8_t value = (uint8_t)pent->p_proto;
526 DetectIPProtoSetup(NULL, sig, value_str);
527 for (i = 0; i < (value / 8); i++) {
534 for (i = (value / 8) + 1; i < (256 / 8); i++) {
550 static int DetectIPProtoTestSetup03(
void)
554 const char *value_str =
"<14";
563 DetectIPProtoSetup(NULL, sig, value_str);
564 for (i = 0; i < (value / 8); i++) {
571 for (i = (value / 8) + 1; i < (256 / 8); i++) {
586 static int DetectIPProtoTestSetup04(
void)
590 const char *value_str =
">14";
599 DetectIPProtoSetup(NULL, sig, value_str);
600 for (i = 0; i < (value / 8); i++) {
607 for (i = (value / 8) + 1; i < (256 / 8); i++) {
622 static int DetectIPProtoTestSetup05(
void)
626 const char *value_str =
"!14";
635 DetectIPProtoSetup(NULL, sig, value_str);
636 for (i = 0; i < (value / 8); i++) {
643 for (i = (value / 8) + 1; i < (256 / 8); i++) {
658 static int DetectIPProtoTestSetup06(
void)
662 const char *value1_str =
"14";
663 const char *value2_str =
"15";
670 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
672 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
685 static int DetectIPProtoTestSetup07(
void)
689 const char *value1_str =
"14";
690 const char *value2_str =
"<15";
697 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
699 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
712 static int DetectIPProtoTestSetup08(
void)
716 const char *value1_str =
"14";
717 const char *value2_str =
">15";
724 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
726 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
739 static int DetectIPProtoTestSetup09(
void)
743 const char *value1_str =
"14";
744 const char *value2_str =
"!15";
751 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
753 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
766 static int DetectIPProtoTestSetup10(
void)
770 const char *value1_str =
">14";
771 const char *value2_str =
"15";
778 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
780 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
793 static int DetectIPProtoTestSetup11(
void)
797 const char *value1_str =
"<14";
798 const char *value2_str =
"15";
805 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
807 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
820 static int DetectIPProtoTestSetup12(
void)
824 const char *value1_str =
"!14";
825 const char *value2_str =
"15";
832 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
834 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
847 static int DetectIPProtoTestSetup13(
void)
851 const char *value1_str =
">14";
852 const char *value2_str =
">15";
859 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
861 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
871 static int DetectIPProtoTestSetup14(
void)
875 const char *value1_str =
"<14";
876 const char *value2_str =
"<15";
883 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
885 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
895 static int DetectIPProtoTestSetup15(
void)
899 const char *value1_str =
"<14";
901 const char *value2_str =
">34";
909 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
911 for (i = 0; i < (value1 / 8); i++) {
918 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
922 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
932 static int DetectIPProtoTestSetup16(
void)
936 const char *value1_str =
"<14";
937 const char *value2_str =
">34";
946 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
948 for (i = 0; i < (value2 / 8); i++) {
955 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
959 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
969 static int DetectIPProtoTestSetup17(
void)
973 const char *value1_str =
"<11";
975 const char *value2_str =
">13";
983 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
985 for (i = 0; i < (value1 / 8); i++) {
992 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
996 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1006 static int DetectIPProtoTestSetup18(
void)
1010 const char *value1_str =
"<11";
1011 const char *value2_str =
">13";
1020 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1022 for (i = 0; i < (value2 / 8); i++) {
1029 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
1033 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1043 static int DetectIPProtoTestSetup19(
void)
1047 const char *value1_str =
"<11";
1049 const char *value2_str =
"!13";
1050 const char *value3_str =
">36";
1058 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1060 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1062 for (i = 0; i < (value1 / 8); i++) {
1069 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1073 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1083 static int DetectIPProtoTestSetup20(
void)
1087 const char *value1_str =
"<11";
1089 const char *value3_str =
">36";
1097 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1099 for (i = 0; i < (value1 / 8); i++) {
1106 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1110 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1120 static int DetectIPProtoTestSetup21(
void)
1124 const char *value1_str =
"<11";
1126 const char *value2_str =
"!13";
1127 const char *value3_str =
">36";
1135 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1137 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1139 for (i = 0; i < (value1 / 8); i++) {
1146 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1150 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1160 static int DetectIPProtoTestSetup22(
void)
1164 const char *value1_str =
"<11";
1165 const char *value2_str =
"!13";
1166 const char *value3_str =
">36";
1175 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1177 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1179 for (i = 0; i < (value3 / 8); i++) {
1186 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1190 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1200 static int DetectIPProtoTestSetup23(
void)
1204 const char *value1_str =
"<11";
1205 const char *value3_str =
">36";
1214 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1216 for (i = 0; i < (value3 / 8); i++) {
1223 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1227 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1237 static int DetectIPProtoTestSetup24(
void)
1241 const char *value1_str =
"<11";
1242 const char *value2_str =
"!13";
1243 const char *value3_str =
">36";
1252 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1254 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1256 for (i = 0; i < (value3 / 8); i++) {
1263 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1267 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1277 static int DetectIPProtoTestSetup33(
void)
1281 const char *value1_str =
"<11";
1283 const char *value2_str =
"!34";
1284 const char *value3_str =
">36";
1292 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1294 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1296 for (i = 0; i < (value1 / 8); i++) {
1303 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1307 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1317 static int DetectIPProtoTestSetup34(
void)
1321 const char *value1_str =
"<11";
1323 const char *value2_str =
"!34";
1324 const char *value3_str =
">36";
1333 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1335 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1337 for (i = 0; i < (value1 / 8); i++) {
1344 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1348 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1358 static int DetectIPProtoTestSetup36(
void)
1362 const char *value1_str =
"<11";
1363 const char *value2_str =
"!34";
1364 const char *value3_str =
">36";
1373 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1375 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1377 for (i = 0; i < (value3 / 8); i++) {
1384 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1388 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1398 static int DetectIPProtoTestSetup43(
void)
1402 const char *value1_str =
"!4";
1404 const char *value2_str =
"<13";
1406 const char *value3_str =
">34";
1414 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1416 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1421 for (i = (value1 / 8) + 1; i < (value2 / 8); i++) {
1428 for (i = (value2 / 8) + 1; i < 256 / 8; i++) {
1432 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1442 static int DetectIPProtoTestSetup44(
void)
1446 const char *value1_str =
"!4";
1447 const char *value2_str =
"<13";
1448 const char *value3_str =
">34";
1457 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1459 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1461 for (i = 0; i < (value3 / 8); i++) {
1468 for (i = (value3 / 8) + 1; i < 256 / 8; i++) {
1472 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1482 static int DetectIPProtoTestSetup45(
void)
1486 const char *value1_str =
"!4";
1488 const char *value2_str =
"<13";
1490 const char *value3_str =
">34";
1498 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1500 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1505 for (i = (value1 / 8) + 1; i < (value2 / 8); i++) {
1512 for (i = (value2 / 8) + 1; i < 256 / 8; i++) {
1516 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1526 static int DetectIPProtoTestSetup56(
void)
1530 const char *value1_str =
"<13";
1532 const char *value2_str =
">34";
1533 const char *value3_str =
"!37";
1541 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1543 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1545 for (i = 0; i < (value1 / 8); i++) {
1552 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1556 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1566 static int DetectIPProtoTestSetup75(
void)
1570 const char *value1_str =
"!8";
1571 const char *value2_str =
">10";
1580 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1582 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1584 for (i = 0; i < (value2 / 8); i++) {
1591 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
1603 static int DetectIPProtoTestSetup76(
void)
1607 const char *value1_str =
"!8";
1608 const char *value2_str =
">10";
1617 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1619 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1621 for (i = 0; i < (value2 / 8); i++) {
1628 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
1640 static int DetectIPProtoTestSetup129(
void)
1644 const char *value1_str =
"<10";
1646 const char *value2_str =
">10";
1654 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1656 for (i = 0; i < (value1 / 8); i++) {
1663 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1667 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1677 static int DetectIPProtoTestSetup130(
void)
1681 const char *value1_str =
"<10";
1682 const char *value2_str =
">10";
1691 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1693 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1695 for (i = 0; i < (value2 / 8); i++) {
1702 for (i = (value2 / 8) + 1; i < 256 / 8; i++) {
1714 static int DetectIPProtoTestSetup131(
void)
1718 const char *value1_str =
"<10";
1720 const char *value2_str =
"!10";
1728 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1730 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1732 for (i = 0; i < (value1 / 8); i++) {
1739 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1751 static int DetectIPProtoTestSetup132(
void)
1755 const char *value1_str =
"<10";
1757 const char *value2_str =
"!10";
1765 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1767 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1769 for (i = 0; i < (value1 / 8); i++) {
1776 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1788 static int DetectIPProtoTestSetup145(
void)
1792 const char *value1_str =
"!4";
1793 const char *value2_str =
">8";
1794 const char *value3_str =
"!10";
1795 const char *value4_str =
"!14";
1796 const char *value5_str =
"!27";
1797 const char *value6_str =
"!29";
1798 const char *value7_str =
"!30";
1799 const char *value8_str =
"!34";
1800 const char *value9_str =
"<36";
1801 const char *value10_str =
"!38";
1811 if (DetectIPProtoSetup(NULL, sig, value5_str) != 0)
1813 if (DetectIPProtoSetup(NULL, sig, value8_str) != 0)
1815 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1817 if (DetectIPProtoSetup(NULL, sig, value10_str) != 0)
1819 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1821 if (DetectIPProtoSetup(NULL, sig, value6_str) != 0)
1823 if (DetectIPProtoSetup(NULL, sig, value9_str) != 0)
1825 if (DetectIPProtoSetup(NULL, sig, value4_str) != 0)
1827 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1829 if (DetectIPProtoSetup(NULL, sig, value7_str) != 0)
1846 for (i = (value10 / 8) + 1; i < 256 / 8; i++) {
1858 static int DetectIPProtoTestSig1(
void)
1861 uint8_t *buf = (uint8_t *)
1862 "GET /one/ HTTP/1.1\r\n"
1863 "Host: one.example.org\r\n"
1865 uint16_t buflen = strlen((
char *)buf);
1870 const char *sigs[4];
1871 sigs[0] =
"alert ip any any -> any any "
1872 "(msg:\"Not tcp\"; ip_proto:!tcp; content:\"GET \"; sid:1;)";
1873 sigs[1] =
"alert ip any any -> any any "
1874 "(msg:\"Less than 7\"; content:\"GET \"; ip_proto:<7; sid:2;)";
1875 sigs[2] =
"alert ip any any -> any any "
1876 "(msg:\"Greater than 5\"; content:\"GET \"; ip_proto:>5; sid:3;)";
1877 sigs[3] =
"alert ip any any -> any any "
1878 "(msg:\"Equals tcp\"; content:\"GET \"; ip_proto:tcp; sid:4;)";
1881 uint32_t sid[4] = {1, 2, 3, 4};
1883 uint32_t results[4] = {0, 1, 1, 1};
1898 static int DetectIPProtoTestSig2(
void)
1900 uint8_t raw_eth[] = {
1901 0x01, 0x00, 0x5e, 0x00, 0x00, 0x0d, 0x00, 0x26,
1902 0x88, 0x61, 0x3a, 0x80, 0x08, 0x00, 0x45, 0xc0,
1903 0x00, 0x36, 0xe4, 0xcd, 0x00, 0x00, 0x01, 0x67,
1904 0xc7, 0xab, 0xac, 0x1c, 0x7f, 0xfe, 0xe0, 0x00,
1905 0x00, 0x0d, 0x20, 0x00, 0x90, 0x20, 0x00, 0x01,
1906 0x00, 0x02, 0x00, 0x69, 0x00, 0x02, 0x00, 0x04,
1907 0x81, 0xf4, 0x07, 0xd0, 0x00, 0x13, 0x00, 0x04,
1908 0x00, 0x00, 0x00, 0x01, 0x00, 0x14, 0x00, 0x04,
1909 0x4a, 0xea, 0x7a, 0x8e,
1921 memset(&th_v, 0,
sizeof(th_v));
1933 "alert ip any any -> any any (msg:\"Check ipproto usage\"; "
1934 "ip_proto:!103; sid:1;)");
1951 static int DetectIPProtoTestSig3(
void)
1953 uint8_t raw_eth[] = {
1954 0x01, 0x00, 0x5e, 0x00, 0x00, 0x0d, 0x00, 0x26,
1955 0x88, 0x61, 0x3a, 0x80, 0x08, 0x00, 0x45, 0xc0,
1956 0x00, 0x36, 0xe4, 0xcd, 0x00, 0x00, 0x01, 0x67,
1957 0xc7, 0xab, 0xac, 0x1c, 0x7f, 0xfe, 0xe0, 0x00,
1958 0x00, 0x0d, 0x20, 0x00, 0x90, 0x20, 0x00, 0x01,
1959 0x00, 0x02, 0x00, 0x69, 0x00, 0x02, 0x00, 0x04,
1960 0x81, 0xf4, 0x07, 0xd0, 0x00, 0x13, 0x00, 0x04,
1961 0x00, 0x00, 0x00, 0x01, 0x00, 0x14, 0x00, 0x04,
1962 0x4a, 0xea, 0x7a, 0x8e,
1974 memset(&th_v, 0,
sizeof(th_v));
1986 "alert ip any any -> any any (msg:\"Check ipproto usage\"; "
1987 "ip_proto:103; sid:1;)");
2008 static void DetectIPProtoRegisterTests(
void)
2010 UtRegisterTest(
"DetectIPProtoTestParse01", DetectIPProtoTestParse01);
2011 UtRegisterTest(
"DetectIPProtoTestParse02", DetectIPProtoTestParse02);
2012 UtRegisterTest(
"DetectIPProtoTestSetup01", DetectIPProtoTestSetup01);
2013 UtRegisterTest(
"DetectIPProtoTestSetup02", DetectIPProtoTestSetup02);
2014 UtRegisterTest(
"DetectIPProtoTestSetup03", DetectIPProtoTestSetup03);
2015 UtRegisterTest(
"DetectIPProtoTestSetup04", DetectIPProtoTestSetup04);
2016 UtRegisterTest(
"DetectIPProtoTestSetup05", DetectIPProtoTestSetup05);
2017 UtRegisterTest(
"DetectIPProtoTestSetup06", DetectIPProtoTestSetup06);
2018 UtRegisterTest(
"DetectIPProtoTestSetup07", DetectIPProtoTestSetup07);
2019 UtRegisterTest(
"DetectIPProtoTestSetup08", DetectIPProtoTestSetup08);
2020 UtRegisterTest(
"DetectIPProtoTestSetup09", DetectIPProtoTestSetup09);
2021 UtRegisterTest(
"DetectIPProtoTestSetup10", DetectIPProtoTestSetup10);
2022 UtRegisterTest(
"DetectIPProtoTestSetup11", DetectIPProtoTestSetup11);
2023 UtRegisterTest(
"DetectIPProtoTestSetup12", DetectIPProtoTestSetup12);
2024 UtRegisterTest(
"DetectIPProtoTestSetup13", DetectIPProtoTestSetup13);
2025 UtRegisterTest(
"DetectIPProtoTestSetup14", DetectIPProtoTestSetup14);
2026 UtRegisterTest(
"DetectIPProtoTestSetup15", DetectIPProtoTestSetup15);
2027 UtRegisterTest(
"DetectIPProtoTestSetup16", DetectIPProtoTestSetup16);
2028 UtRegisterTest(
"DetectIPProtoTestSetup17", DetectIPProtoTestSetup17);
2029 UtRegisterTest(
"DetectIPProtoTestSetup18", DetectIPProtoTestSetup18);
2030 UtRegisterTest(
"DetectIPProtoTestSetup19", DetectIPProtoTestSetup19);
2031 UtRegisterTest(
"DetectIPProtoTestSetup20", DetectIPProtoTestSetup20);
2032 UtRegisterTest(
"DetectIPProtoTestSetup21", DetectIPProtoTestSetup21);
2033 UtRegisterTest(
"DetectIPProtoTestSetup22", DetectIPProtoTestSetup22);
2034 UtRegisterTest(
"DetectIPProtoTestSetup23", DetectIPProtoTestSetup23);
2035 UtRegisterTest(
"DetectIPProtoTestSetup24", DetectIPProtoTestSetup24);
2036 UtRegisterTest(
"DetectIPProtoTestSetup33", DetectIPProtoTestSetup33);
2037 UtRegisterTest(
"DetectIPProtoTestSetup34", DetectIPProtoTestSetup34);
2038 UtRegisterTest(
"DetectIPProtoTestSetup36", DetectIPProtoTestSetup36);
2039 UtRegisterTest(
"DetectIPProtoTestSetup43", DetectIPProtoTestSetup43);
2040 UtRegisterTest(
"DetectIPProtoTestSetup44", DetectIPProtoTestSetup44);
2041 UtRegisterTest(
"DetectIPProtoTestSetup45", DetectIPProtoTestSetup45);
2042 UtRegisterTest(
"DetectIPProtoTestSetup56", DetectIPProtoTestSetup56);
2043 UtRegisterTest(
"DetectIPProtoTestSetup75", DetectIPProtoTestSetup75);
2044 UtRegisterTest(
"DetectIPProtoTestSetup76", DetectIPProtoTestSetup76);
2045 UtRegisterTest(
"DetectIPProtoTestSetup129", DetectIPProtoTestSetup129);
2046 UtRegisterTest(
"DetectIPProtoTestSetup130", DetectIPProtoTestSetup130);
2047 UtRegisterTest(
"DetectIPProtoTestSetup131", DetectIPProtoTestSetup131);
2048 UtRegisterTest(
"DetectIPProtoTestSetup132", DetectIPProtoTestSetup132);
2049 UtRegisterTest(
"DetectIPProtoTestSetup145", DetectIPProtoTestSetup145);