50 #define PARSE_REGEX "^([!<>]?)\\s*([^\\s]+)$"
56 static void DetectIPProtoRegisterTests(
void);
87 char *args[2] = { NULL, NULL };
97 "%" PRId32
", string %s",
102 for (i = 0; i < (ret - 1); i++) {
103 res = pcre2_substring_get_bynumber(
104 parse_regex.
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]);
148 for (i = 0; i < (ret - 1) && i < 2; i++){
150 pcre2_substring_free((PCRE2_UCHAR8 *)args[i]);
158 static int DetectIPProtoTypePresentForOP(
Signature *s, uint8_t op)
213 "ip_proto keyword only when we use alert ip, "
214 "in which case the _ANY flag is set on the sig "
215 "and the if condition should match.");
227 if (eq_set || gt_set || lt_set || not_set) {
229 "ipproto without any operators attached to "
230 "them in the same sig");
237 if (eq_set || gt_set) {
239 "ipproto along with a greater than ipproto in the "
243 if (!lt_set && !not_set) {
245 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
248 }
else if (lt_set && !not_set) {
250 while (temp_sm != NULL) {
254 temp_sm = temp_sm->
next;
256 if (temp_sm != NULL) {
260 "both gt and lt ipprotos, with the lt being "
261 "lower than gt value");
264 for (i = 0; i < (data->
proto / 8); i++) {
268 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
273 }
else if (!lt_set && not_set) {
274 for (i = 0; i < (data->
proto / 8); i++) {
278 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
284 while (temp_sm != NULL) {
289 temp_sm = temp_sm->
next;
291 if (temp_sm != NULL) {
295 "both gt and lt ipprotos, with the lt being "
296 "lower than gt value");
299 for (i = 0; i < (data->
proto / 8); i++) {
303 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
312 if (eq_set || lt_set) {
314 "ipproto along with a less than ipproto in the "
318 if (!gt_set && !not_set) {
319 for (i = 0; i < (data->
proto / 8); i++) {
323 }
else if (gt_set && !not_set) {
325 while (temp_sm != NULL) {
329 temp_sm = temp_sm->
next;
331 if (temp_sm != NULL) {
335 "both gt and lt ipprotos, with the lt being "
336 "lower than gt value");
339 for (i = 0; i < (data->
proto / 8); i++) {
343 for (i = (data->
proto / 8) + 1; i < 256 / 8; i++) {
348 }
else if (!gt_set && not_set) {
349 for (i = 0; i < (data->
proto / 8); i++) {
353 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
359 while (temp_sm != NULL) {
364 temp_sm = temp_sm->
next;
366 if (temp_sm != NULL) {
370 "both gt and lt ipprotos, with the lt being "
371 "lower than gt value");
374 for (i = 0; i < (data->
proto / 8); i++) {
378 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
389 "ipproto along with a not ipproto in the "
393 if (!gt_set && !lt_set && !not_set) {
394 for (i = 0; i < (data->
proto / 8); i++) {
398 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
402 for (i = 0; i < (data->
proto / 8); i++) {
406 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
417 sm->
ctx = (
void *)data;
425 DetectIPProtoFree(
de_ctx, data);
463 static int DetectIPProtoTestParse01(
void)
473 static int DetectIPProtoTestParse02(
void)
483 static int DetectIPProtoTestSetup01(
void)
485 const char *value_str =
"14";
495 DetectIPProtoSetup(NULL, sig, value_str);
496 for (i = 0; i < (value / 8); i++) {
500 for (i = (value / 8) + 1; i < (256 / 8); i++) {
510 static int DetectIPProtoTestSetup02(
void)
514 const char *value_str =
"tcp";
515 struct protoent *pent = getprotobyname(value_str);
519 uint8_t value = (uint8_t)pent->p_proto;
527 DetectIPProtoSetup(NULL, sig, value_str);
528 for (i = 0; i < (value / 8); i++) {
535 for (i = (value / 8) + 1; i < (256 / 8); i++) {
551 static int DetectIPProtoTestSetup03(
void)
555 const char *value_str =
"<14";
564 DetectIPProtoSetup(NULL, sig, value_str);
565 for (i = 0; i < (value / 8); i++) {
572 for (i = (value / 8) + 1; i < (256 / 8); i++) {
587 static int DetectIPProtoTestSetup04(
void)
591 const char *value_str =
">14";
600 DetectIPProtoSetup(NULL, sig, value_str);
601 for (i = 0; i < (value / 8); i++) {
608 for (i = (value / 8) + 1; i < (256 / 8); i++) {
623 static int DetectIPProtoTestSetup05(
void)
627 const char *value_str =
"!14";
636 DetectIPProtoSetup(NULL, sig, value_str);
637 for (i = 0; i < (value / 8); i++) {
644 for (i = (value / 8) + 1; i < (256 / 8); i++) {
659 static int DetectIPProtoTestSetup06(
void)
663 const char *value1_str =
"14";
664 const char *value2_str =
"15";
671 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
673 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
686 static int DetectIPProtoTestSetup07(
void)
690 const char *value1_str =
"14";
691 const char *value2_str =
"<15";
698 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
700 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
713 static int DetectIPProtoTestSetup08(
void)
717 const char *value1_str =
"14";
718 const char *value2_str =
">15";
725 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
727 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
740 static int DetectIPProtoTestSetup09(
void)
744 const char *value1_str =
"14";
745 const char *value2_str =
"!15";
752 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
754 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
767 static int DetectIPProtoTestSetup10(
void)
771 const char *value1_str =
">14";
772 const char *value2_str =
"15";
779 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
781 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
794 static int DetectIPProtoTestSetup11(
void)
798 const char *value1_str =
"<14";
799 const char *value2_str =
"15";
806 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
808 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
821 static int DetectIPProtoTestSetup12(
void)
825 const char *value1_str =
"!14";
826 const char *value2_str =
"15";
833 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
835 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
848 static int DetectIPProtoTestSetup13(
void)
852 const char *value1_str =
">14";
853 const char *value2_str =
">15";
860 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
862 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
872 static int DetectIPProtoTestSetup14(
void)
876 const char *value1_str =
"<14";
877 const char *value2_str =
"<15";
884 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
886 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
896 static int DetectIPProtoTestSetup15(
void)
900 const char *value1_str =
"<14";
902 const char *value2_str =
">34";
910 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
912 for (i = 0; i < (value1 / 8); i++) {
919 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
923 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
934 static int DetectIPProtoTestSetup16(
void)
938 const char *value1_str =
"<14";
939 const char *value2_str =
">34";
948 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
950 for (i = 0; i < (value2 / 8); i++) {
957 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
961 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
972 static int DetectIPProtoTestSetup17(
void)
976 const char *value1_str =
"<11";
978 const char *value2_str =
">13";
986 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
988 for (i = 0; i < (value1 / 8); i++) {
995 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
999 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1010 static int DetectIPProtoTestSetup18(
void)
1014 const char *value1_str =
"<11";
1015 const char *value2_str =
">13";
1024 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1026 for (i = 0; i < (value2 / 8); i++) {
1033 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
1037 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1048 static int DetectIPProtoTestSetup19(
void)
1052 const char *value1_str =
"<11";
1054 const char *value2_str =
"!13";
1055 const char *value3_str =
">36";
1063 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1065 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1067 for (i = 0; i < (value1 / 8); i++) {
1074 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1078 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1088 static int DetectIPProtoTestSetup20(
void)
1092 const char *value1_str =
"<11";
1094 const char *value3_str =
">36";
1102 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1104 for (i = 0; i < (value1 / 8); i++) {
1111 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1115 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1125 static int DetectIPProtoTestSetup21(
void)
1129 const char *value1_str =
"<11";
1131 const char *value2_str =
"!13";
1132 const char *value3_str =
">36";
1140 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1142 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1144 for (i = 0; i < (value1 / 8); i++) {
1151 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1155 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1165 static int DetectIPProtoTestSetup22(
void)
1169 const char *value1_str =
"<11";
1170 const char *value2_str =
"!13";
1171 const char *value3_str =
">36";
1180 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1182 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1184 for (i = 0; i < (value3 / 8); i++) {
1191 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1195 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1205 static int DetectIPProtoTestSetup23(
void)
1209 const char *value1_str =
"<11";
1210 const char *value3_str =
">36";
1219 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1221 for (i = 0; i < (value3 / 8); i++) {
1228 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1232 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1242 static int DetectIPProtoTestSetup24(
void)
1246 const char *value1_str =
"<11";
1247 const char *value2_str =
"!13";
1248 const char *value3_str =
">36";
1257 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1259 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1261 for (i = 0; i < (value3 / 8); i++) {
1268 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1272 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1282 static int DetectIPProtoTestSetup33(
void)
1286 const char *value1_str =
"<11";
1288 const char *value2_str =
"!34";
1289 const char *value3_str =
">36";
1297 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1299 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1301 for (i = 0; i < (value1 / 8); i++) {
1308 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1312 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1322 static int DetectIPProtoTestSetup34(
void)
1326 const char *value1_str =
"<11";
1328 const char *value2_str =
"!34";
1329 const char *value3_str =
">36";
1338 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1340 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1342 for (i = 0; i < (value1 / 8); i++) {
1349 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1353 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1363 static int DetectIPProtoTestSetup36(
void)
1367 const char *value1_str =
"<11";
1368 const char *value2_str =
"!34";
1369 const char *value3_str =
">36";
1378 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1380 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1382 for (i = 0; i < (value3 / 8); i++) {
1389 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1393 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1403 static int DetectIPProtoTestSetup43(
void)
1407 const char *value1_str =
"!4";
1409 const char *value2_str =
"<13";
1411 const char *value3_str =
">34";
1419 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1421 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1426 for (i = (value1 / 8) + 1; i < (value2 / 8); i++) {
1433 for (i = (value2 / 8) + 1; i < 256 / 8; i++) {
1437 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1447 static int DetectIPProtoTestSetup44(
void)
1451 const char *value1_str =
"!4";
1452 const char *value2_str =
"<13";
1453 const char *value3_str =
">34";
1462 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1464 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1466 for (i = 0; i < (value3 / 8); i++) {
1473 for (i = (value3 / 8) + 1; i < 256 / 8; i++) {
1477 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1487 static int DetectIPProtoTestSetup45(
void)
1491 const char *value1_str =
"!4";
1493 const char *value2_str =
"<13";
1495 const char *value3_str =
">34";
1503 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1505 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1510 for (i = (value1 / 8) + 1; i < (value2 / 8); i++) {
1517 for (i = (value2 / 8) + 1; i < 256 / 8; i++) {
1521 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1531 static int DetectIPProtoTestSetup56(
void)
1535 const char *value1_str =
"<13";
1537 const char *value2_str =
">34";
1538 const char *value3_str =
"!37";
1546 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1548 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1550 for (i = 0; i < (value1 / 8); i++) {
1557 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1561 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1571 static int DetectIPProtoTestSetup75(
void)
1575 const char *value1_str =
"!8";
1576 const char *value2_str =
">10";
1585 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1587 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1589 for (i = 0; i < (value2 / 8); i++) {
1596 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
1608 static int DetectIPProtoTestSetup76(
void)
1612 const char *value1_str =
"!8";
1613 const char *value2_str =
">10";
1622 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1624 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1626 for (i = 0; i < (value2 / 8); i++) {
1633 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
1645 static int DetectIPProtoTestSetup129(
void)
1649 const char *value1_str =
"<10";
1651 const char *value2_str =
">10";
1659 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1661 for (i = 0; i < (value1 / 8); i++) {
1668 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1672 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1682 static int DetectIPProtoTestSetup130(
void)
1686 const char *value1_str =
"<10";
1687 const char *value2_str =
">10";
1696 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1698 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1700 for (i = 0; i < (value2 / 8); i++) {
1707 for (i = (value2 / 8) + 1; i < 256 / 8; i++) {
1719 static int DetectIPProtoTestSetup131(
void)
1723 const char *value1_str =
"<10";
1725 const char *value2_str =
"!10";
1733 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1735 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1737 for (i = 0; i < (value1 / 8); i++) {
1744 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1756 static int DetectIPProtoTestSetup132(
void)
1760 const char *value1_str =
"<10";
1762 const char *value2_str =
"!10";
1770 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1772 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1774 for (i = 0; i < (value1 / 8); i++) {
1781 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1793 static int DetectIPProtoTestSetup145(
void)
1797 const char *value1_str =
"!4";
1798 const char *value2_str =
">8";
1799 const char *value3_str =
"!10";
1800 const char *value4_str =
"!14";
1801 const char *value5_str =
"!27";
1802 const char *value6_str =
"!29";
1803 const char *value7_str =
"!30";
1804 const char *value8_str =
"!34";
1805 const char *value9_str =
"<36";
1806 const char *value10_str =
"!38";
1816 if (DetectIPProtoSetup(NULL, sig, value5_str) != 0)
1818 if (DetectIPProtoSetup(NULL, sig, value8_str) != 0)
1820 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1822 if (DetectIPProtoSetup(NULL, sig, value10_str) != 0)
1824 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1826 if (DetectIPProtoSetup(NULL, sig, value6_str) != 0)
1828 if (DetectIPProtoSetup(NULL, sig, value9_str) != 0)
1830 if (DetectIPProtoSetup(NULL, sig, value4_str) != 0)
1832 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1834 if (DetectIPProtoSetup(NULL, sig, value7_str) != 0)
1851 for (i = (value10 / 8) + 1; i < 256 / 8; i++) {
1863 static int DetectIPProtoTestSig1(
void)
1866 uint8_t *buf = (uint8_t *)
1867 "GET /one/ HTTP/1.1\r\n"
1868 "Host: one.example.org\r\n"
1870 uint16_t buflen = strlen((
char *)buf);
1875 const char *sigs[4];
1876 sigs[0] =
"alert ip any any -> any any "
1877 "(msg:\"Not tcp\"; ip_proto:!tcp; content:\"GET \"; sid:1;)";
1878 sigs[1] =
"alert ip any any -> any any "
1879 "(msg:\"Less than 7\"; content:\"GET \"; ip_proto:<7; sid:2;)";
1880 sigs[2] =
"alert ip any any -> any any "
1881 "(msg:\"Greater than 5\"; content:\"GET \"; ip_proto:>5; sid:3;)";
1882 sigs[3] =
"alert ip any any -> any any "
1883 "(msg:\"Equals tcp\"; content:\"GET \"; ip_proto:tcp; sid:4;)";
1886 uint32_t sid[4] = {1, 2, 3, 4};
1888 uint32_t
results[4] = {0, 1, 1, 1};
1903 static int DetectIPProtoTestSig2(
void)
1907 uint8_t raw_eth[] = {
1908 0x01, 0x00, 0x5e, 0x00, 0x00, 0x0d, 0x00, 0x26,
1909 0x88, 0x61, 0x3a, 0x80, 0x08, 0x00, 0x45, 0xc0,
1910 0x00, 0x36, 0xe4, 0xcd, 0x00, 0x00, 0x01, 0x67,
1911 0xc7, 0xab, 0xac, 0x1c, 0x7f, 0xfe, 0xe0, 0x00,
1912 0x00, 0x0d, 0x20, 0x00, 0x90, 0x20, 0x00, 0x01,
1913 0x00, 0x02, 0x00, 0x69, 0x00, 0x02, 0x00, 0x04,
1914 0x81, 0xf4, 0x07, 0xd0, 0x00, 0x13, 0x00, 0x04,
1915 0x00, 0x00, 0x00, 0x01, 0x00, 0x14, 0x00, 0x04,
1916 0x4a, 0xea, 0x7a, 0x8e,
1929 memset(&th_v, 0,
sizeof(th_v));
1943 "alert ip any any -> any any (msg:\"Check ipproto usage\"; "
1944 "ip_proto:!103; sid:1;)");
1988 static int DetectIPProtoTestSig3(
void)
1992 uint8_t raw_eth[] = {
1993 0x01, 0x00, 0x5e, 0x00, 0x00, 0x0d, 0x00, 0x26,
1994 0x88, 0x61, 0x3a, 0x80, 0x08, 0x00, 0x45, 0xc0,
1995 0x00, 0x36, 0xe4, 0xcd, 0x00, 0x00, 0x01, 0x67,
1996 0xc7, 0xab, 0xac, 0x1c, 0x7f, 0xfe, 0xe0, 0x00,
1997 0x00, 0x0d, 0x20, 0x00, 0x90, 0x20, 0x00, 0x01,
1998 0x00, 0x02, 0x00, 0x69, 0x00, 0x02, 0x00, 0x04,
1999 0x81, 0xf4, 0x07, 0xd0, 0x00, 0x13, 0x00, 0x04,
2000 0x00, 0x00, 0x00, 0x01, 0x00, 0x14, 0x00, 0x04,
2001 0x4a, 0xea, 0x7a, 0x8e,
2014 memset(&th_v, 0,
sizeof(th_v));
2028 "alert ip any any -> any any (msg:\"Check ipproto usage\"; "
2029 "ip_proto:103; sid:1;)");
2077 static void DetectIPProtoRegisterTests(
void)
2079 UtRegisterTest(
"DetectIPProtoTestParse01", DetectIPProtoTestParse01);
2080 UtRegisterTest(
"DetectIPProtoTestParse02", DetectIPProtoTestParse02);
2081 UtRegisterTest(
"DetectIPProtoTestSetup01", DetectIPProtoTestSetup01);
2082 UtRegisterTest(
"DetectIPProtoTestSetup02", DetectIPProtoTestSetup02);
2083 UtRegisterTest(
"DetectIPProtoTestSetup03", DetectIPProtoTestSetup03);
2084 UtRegisterTest(
"DetectIPProtoTestSetup04", DetectIPProtoTestSetup04);
2085 UtRegisterTest(
"DetectIPProtoTestSetup05", DetectIPProtoTestSetup05);
2086 UtRegisterTest(
"DetectIPProtoTestSetup06", DetectIPProtoTestSetup06);
2087 UtRegisterTest(
"DetectIPProtoTestSetup07", DetectIPProtoTestSetup07);
2088 UtRegisterTest(
"DetectIPProtoTestSetup08", DetectIPProtoTestSetup08);
2089 UtRegisterTest(
"DetectIPProtoTestSetup09", DetectIPProtoTestSetup09);
2090 UtRegisterTest(
"DetectIPProtoTestSetup10", DetectIPProtoTestSetup10);
2091 UtRegisterTest(
"DetectIPProtoTestSetup11", DetectIPProtoTestSetup11);
2092 UtRegisterTest(
"DetectIPProtoTestSetup12", DetectIPProtoTestSetup12);
2093 UtRegisterTest(
"DetectIPProtoTestSetup13", DetectIPProtoTestSetup13);
2094 UtRegisterTest(
"DetectIPProtoTestSetup14", DetectIPProtoTestSetup14);
2095 UtRegisterTest(
"DetectIPProtoTestSetup15", DetectIPProtoTestSetup15);
2096 UtRegisterTest(
"DetectIPProtoTestSetup16", DetectIPProtoTestSetup16);
2097 UtRegisterTest(
"DetectIPProtoTestSetup17", DetectIPProtoTestSetup17);
2098 UtRegisterTest(
"DetectIPProtoTestSetup18", DetectIPProtoTestSetup18);
2099 UtRegisterTest(
"DetectIPProtoTestSetup19", DetectIPProtoTestSetup19);
2100 UtRegisterTest(
"DetectIPProtoTestSetup20", DetectIPProtoTestSetup20);
2101 UtRegisterTest(
"DetectIPProtoTestSetup21", DetectIPProtoTestSetup21);
2102 UtRegisterTest(
"DetectIPProtoTestSetup22", DetectIPProtoTestSetup22);
2103 UtRegisterTest(
"DetectIPProtoTestSetup23", DetectIPProtoTestSetup23);
2104 UtRegisterTest(
"DetectIPProtoTestSetup24", DetectIPProtoTestSetup24);
2105 UtRegisterTest(
"DetectIPProtoTestSetup33", DetectIPProtoTestSetup33);
2106 UtRegisterTest(
"DetectIPProtoTestSetup34", DetectIPProtoTestSetup34);
2107 UtRegisterTest(
"DetectIPProtoTestSetup36", DetectIPProtoTestSetup36);
2108 UtRegisterTest(
"DetectIPProtoTestSetup43", DetectIPProtoTestSetup43);
2109 UtRegisterTest(
"DetectIPProtoTestSetup44", DetectIPProtoTestSetup44);
2110 UtRegisterTest(
"DetectIPProtoTestSetup45", DetectIPProtoTestSetup45);
2111 UtRegisterTest(
"DetectIPProtoTestSetup56", DetectIPProtoTestSetup56);
2112 UtRegisterTest(
"DetectIPProtoTestSetup75", DetectIPProtoTestSetup75);
2113 UtRegisterTest(
"DetectIPProtoTestSetup76", DetectIPProtoTestSetup76);
2114 UtRegisterTest(
"DetectIPProtoTestSetup129", DetectIPProtoTestSetup129);
2115 UtRegisterTest(
"DetectIPProtoTestSetup130", DetectIPProtoTestSetup130);
2116 UtRegisterTest(
"DetectIPProtoTestSetup131", DetectIPProtoTestSetup131);
2117 UtRegisterTest(
"DetectIPProtoTestSetup132", DetectIPProtoTestSetup132);
2118 UtRegisterTest(
"DetectIPProtoTestSetup145", DetectIPProtoTestSetup145);