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)
217 "ip_proto keyword only when we use alert ip, "
218 "in which case the _ANY flag is set on the sig "
219 "and the if condition should match.");
231 if (eq_set || gt_set || lt_set || not_set) {
233 "ipproto without any operators attached to "
234 "them in the same sig");
241 if (eq_set || gt_set) {
243 "ipproto along with a greater than ipproto in the "
247 if (!lt_set && !not_set) {
249 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
252 }
else if (lt_set && !not_set) {
254 while (temp_sm != NULL) {
258 temp_sm = temp_sm->
next;
260 if (temp_sm != NULL) {
264 "both gt and lt ipprotos, with the lt being "
265 "lower than gt value");
268 for (i = 0; i < (data->
proto / 8); i++) {
272 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
277 }
else if (!lt_set && not_set) {
278 for (i = 0; i < (data->
proto / 8); i++) {
282 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
288 while (temp_sm != NULL) {
293 temp_sm = temp_sm->
next;
295 if (temp_sm != NULL) {
299 "both gt and lt ipprotos, with the lt being "
300 "lower than gt value");
303 for (i = 0; i < (data->
proto / 8); i++) {
307 for (i = (data->
proto / 8) + 1; i < (256 / 8); i++) {
316 if (eq_set || lt_set) {
318 "ipproto along with a less than ipproto in the "
322 if (!gt_set && !not_set) {
323 for (i = 0; i < (data->
proto / 8); i++) {
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++) {
421 sm->
ctx = (
void *)data;
429 DetectIPProtoFree(
de_ctx, data);
467 static int DetectIPProtoTestParse01(
void)
477 static int DetectIPProtoTestParse02(
void)
487 static int DetectIPProtoTestSetup01(
void)
489 const char *value_str =
"14";
499 DetectIPProtoSetup(NULL, sig, value_str);
500 for (i = 0; i < (value / 8); i++) {
504 for (i = (value / 8) + 1; i < (256 / 8); i++) {
514 static int DetectIPProtoTestSetup02(
void)
518 const char *value_str =
"tcp";
519 struct protoent *pent = getprotobyname(value_str);
523 uint8_t value = (uint8_t)pent->p_proto;
531 DetectIPProtoSetup(NULL, sig, value_str);
532 for (i = 0; i < (value / 8); i++) {
539 for (i = (value / 8) + 1; i < (256 / 8); i++) {
555 static int DetectIPProtoTestSetup03(
void)
559 const char *value_str =
"<14";
568 DetectIPProtoSetup(NULL, sig, value_str);
569 for (i = 0; i < (value / 8); i++) {
576 for (i = (value / 8) + 1; i < (256 / 8); i++) {
591 static int DetectIPProtoTestSetup04(
void)
595 const char *value_str =
">14";
604 DetectIPProtoSetup(NULL, sig, value_str);
605 for (i = 0; i < (value / 8); i++) {
612 for (i = (value / 8) + 1; i < (256 / 8); i++) {
627 static int DetectIPProtoTestSetup05(
void)
631 const char *value_str =
"!14";
640 DetectIPProtoSetup(NULL, sig, value_str);
641 for (i = 0; i < (value / 8); i++) {
648 for (i = (value / 8) + 1; i < (256 / 8); i++) {
663 static int DetectIPProtoTestSetup06(
void)
667 const char *value1_str =
"14";
668 const char *value2_str =
"15";
675 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
677 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
690 static int DetectIPProtoTestSetup07(
void)
694 const char *value1_str =
"14";
695 const char *value2_str =
"<15";
702 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
704 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
717 static int DetectIPProtoTestSetup08(
void)
721 const char *value1_str =
"14";
722 const char *value2_str =
">15";
729 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
731 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
744 static int DetectIPProtoTestSetup09(
void)
748 const char *value1_str =
"14";
749 const char *value2_str =
"!15";
756 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
758 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
771 static int DetectIPProtoTestSetup10(
void)
775 const char *value1_str =
">14";
776 const char *value2_str =
"15";
783 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
785 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
798 static int DetectIPProtoTestSetup11(
void)
802 const char *value1_str =
"<14";
803 const char *value2_str =
"15";
810 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
812 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
825 static int DetectIPProtoTestSetup12(
void)
829 const char *value1_str =
"!14";
830 const char *value2_str =
"15";
837 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
839 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
852 static int DetectIPProtoTestSetup13(
void)
856 const char *value1_str =
">14";
857 const char *value2_str =
">15";
864 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
866 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
876 static int DetectIPProtoTestSetup14(
void)
880 const char *value1_str =
"<14";
881 const char *value2_str =
"<15";
888 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
890 if (DetectIPProtoSetup(NULL, sig, value2_str) != -1)
900 static int DetectIPProtoTestSetup15(
void)
904 const char *value1_str =
"<14";
906 const char *value2_str =
">34";
914 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
916 for (i = 0; i < (value1 / 8); i++) {
923 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
927 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
938 static int DetectIPProtoTestSetup16(
void)
942 const char *value1_str =
"<14";
943 const char *value2_str =
">34";
952 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
954 for (i = 0; i < (value2 / 8); i++) {
961 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
965 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
976 static int DetectIPProtoTestSetup17(
void)
980 const char *value1_str =
"<11";
982 const char *value2_str =
">13";
990 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
992 for (i = 0; i < (value1 / 8); i++) {
999 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1003 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1014 static int DetectIPProtoTestSetup18(
void)
1018 const char *value1_str =
"<11";
1019 const char *value2_str =
">13";
1028 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1030 for (i = 0; i < (value2 / 8); i++) {
1037 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
1041 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1052 static int DetectIPProtoTestSetup19(
void)
1056 const char *value1_str =
"<11";
1058 const char *value2_str =
"!13";
1059 const char *value3_str =
">36";
1067 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1069 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1071 for (i = 0; i < (value1 / 8); i++) {
1078 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1082 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1092 static int DetectIPProtoTestSetup20(
void)
1096 const char *value1_str =
"<11";
1098 const char *value3_str =
">36";
1106 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1108 for (i = 0; i < (value1 / 8); i++) {
1115 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1119 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1129 static int DetectIPProtoTestSetup21(
void)
1133 const char *value1_str =
"<11";
1135 const char *value2_str =
"!13";
1136 const char *value3_str =
">36";
1144 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1146 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1148 for (i = 0; i < (value1 / 8); i++) {
1155 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1159 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1169 static int DetectIPProtoTestSetup22(
void)
1173 const char *value1_str =
"<11";
1174 const char *value2_str =
"!13";
1175 const char *value3_str =
">36";
1184 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1186 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1188 for (i = 0; i < (value3 / 8); i++) {
1195 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1199 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1209 static int DetectIPProtoTestSetup23(
void)
1213 const char *value1_str =
"<11";
1214 const char *value3_str =
">36";
1223 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1225 for (i = 0; i < (value3 / 8); i++) {
1232 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1236 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1246 static int DetectIPProtoTestSetup24(
void)
1250 const char *value1_str =
"<11";
1251 const char *value2_str =
"!13";
1252 const char *value3_str =
">36";
1261 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1263 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1265 for (i = 0; i < (value3 / 8); i++) {
1272 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1276 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1286 static int DetectIPProtoTestSetup33(
void)
1290 const char *value1_str =
"<11";
1292 const char *value2_str =
"!34";
1293 const char *value3_str =
">36";
1301 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1303 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1305 for (i = 0; i < (value1 / 8); i++) {
1312 for (i = (value1 / 8) + 1; i < (256 / 8); i++) {
1316 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1326 static int DetectIPProtoTestSetup34(
void)
1330 const char *value1_str =
"<11";
1332 const char *value2_str =
"!34";
1333 const char *value3_str =
">36";
1342 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1344 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1346 for (i = 0; i < (value1 / 8); i++) {
1353 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1357 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1367 static int DetectIPProtoTestSetup36(
void)
1371 const char *value1_str =
"<11";
1372 const char *value2_str =
"!34";
1373 const char *value3_str =
">36";
1382 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1384 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1386 for (i = 0; i < (value3 / 8); i++) {
1393 for (i = (value3 / 8) + 1; i < (256 / 8); i++) {
1397 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1407 static int DetectIPProtoTestSetup43(
void)
1411 const char *value1_str =
"!4";
1413 const char *value2_str =
"<13";
1415 const char *value3_str =
">34";
1423 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1425 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1430 for (i = (value1 / 8) + 1; i < (value2 / 8); i++) {
1437 for (i = (value2 / 8) + 1; i < 256 / 8; i++) {
1441 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1451 static int DetectIPProtoTestSetup44(
void)
1455 const char *value1_str =
"!4";
1456 const char *value2_str =
"<13";
1457 const char *value3_str =
">34";
1466 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1468 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1470 for (i = 0; i < (value3 / 8); i++) {
1477 for (i = (value3 / 8) + 1; i < 256 / 8; i++) {
1481 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1491 static int DetectIPProtoTestSetup45(
void)
1495 const char *value1_str =
"!4";
1497 const char *value2_str =
"<13";
1499 const char *value3_str =
">34";
1507 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1509 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1514 for (i = (value1 / 8) + 1; i < (value2 / 8); i++) {
1521 for (i = (value2 / 8) + 1; i < 256 / 8; i++) {
1525 if (DetectIPProtoSetup(NULL, sig, value3_str) == 0)
1535 static int DetectIPProtoTestSetup56(
void)
1539 const char *value1_str =
"<13";
1541 const char *value2_str =
">34";
1542 const char *value3_str =
"!37";
1550 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1552 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1554 for (i = 0; i < (value1 / 8); i++) {
1561 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1565 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1575 static int DetectIPProtoTestSetup75(
void)
1579 const char *value1_str =
"!8";
1580 const char *value2_str =
">10";
1589 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1591 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1593 for (i = 0; i < (value2 / 8); i++) {
1600 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
1612 static int DetectIPProtoTestSetup76(
void)
1616 const char *value1_str =
"!8";
1617 const char *value2_str =
">10";
1626 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1628 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1630 for (i = 0; i < (value2 / 8); i++) {
1637 for (i = (value2 / 8) + 1; i < (256 / 8); i++) {
1649 static int DetectIPProtoTestSetup129(
void)
1653 const char *value1_str =
"<10";
1655 const char *value2_str =
">10";
1663 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1665 for (i = 0; i < (value1 / 8); i++) {
1672 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1676 if (DetectIPProtoSetup(NULL, sig, value2_str) == 0)
1686 static int DetectIPProtoTestSetup130(
void)
1690 const char *value1_str =
"<10";
1691 const char *value2_str =
">10";
1700 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1702 if (DetectIPProtoSetup(NULL, sig, value1_str) == 0)
1704 for (i = 0; i < (value2 / 8); i++) {
1711 for (i = (value2 / 8) + 1; i < 256 / 8; i++) {
1723 static int DetectIPProtoTestSetup131(
void)
1727 const char *value1_str =
"<10";
1729 const char *value2_str =
"!10";
1737 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1739 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1741 for (i = 0; i < (value1 / 8); i++) {
1748 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1760 static int DetectIPProtoTestSetup132(
void)
1764 const char *value1_str =
"<10";
1766 const char *value2_str =
"!10";
1774 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1776 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1778 for (i = 0; i < (value1 / 8); i++) {
1785 for (i = (value1 / 8) + 1; i < 256 / 8; i++) {
1797 static int DetectIPProtoTestSetup145(
void)
1801 const char *value1_str =
"!4";
1802 const char *value2_str =
">8";
1803 const char *value3_str =
"!10";
1804 const char *value4_str =
"!14";
1805 const char *value5_str =
"!27";
1806 const char *value6_str =
"!29";
1807 const char *value7_str =
"!30";
1808 const char *value8_str =
"!34";
1809 const char *value9_str =
"<36";
1810 const char *value10_str =
"!38";
1820 if (DetectIPProtoSetup(NULL, sig, value5_str) != 0)
1822 if (DetectIPProtoSetup(NULL, sig, value8_str) != 0)
1824 if (DetectIPProtoSetup(NULL, sig, value2_str) != 0)
1826 if (DetectIPProtoSetup(NULL, sig, value10_str) != 0)
1828 if (DetectIPProtoSetup(NULL, sig, value1_str) != 0)
1830 if (DetectIPProtoSetup(NULL, sig, value6_str) != 0)
1832 if (DetectIPProtoSetup(NULL, sig, value9_str) != 0)
1834 if (DetectIPProtoSetup(NULL, sig, value4_str) != 0)
1836 if (DetectIPProtoSetup(NULL, sig, value3_str) != 0)
1838 if (DetectIPProtoSetup(NULL, sig, value7_str) != 0)
1855 for (i = (value10 / 8) + 1; i < 256 / 8; i++) {
1867 static int DetectIPProtoTestSig1(
void)
1870 uint8_t *buf = (uint8_t *)
1871 "GET /one/ HTTP/1.1\r\n"
1872 "Host: one.example.org\r\n"
1874 uint16_t buflen = strlen((
char *)buf);
1879 const char *sigs[4];
1880 sigs[0] =
"alert ip any any -> any any "
1881 "(msg:\"Not tcp\"; ip_proto:!tcp; content:\"GET \"; sid:1;)";
1882 sigs[1] =
"alert ip any any -> any any "
1883 "(msg:\"Less than 7\"; content:\"GET \"; ip_proto:<7; sid:2;)";
1884 sigs[2] =
"alert ip any any -> any any "
1885 "(msg:\"Greater than 5\"; content:\"GET \"; ip_proto:>5; sid:3;)";
1886 sigs[3] =
"alert ip any any -> any any "
1887 "(msg:\"Equals tcp\"; content:\"GET \"; ip_proto:tcp; sid:4;)";
1890 uint32_t sid[4] = {1, 2, 3, 4};
1892 uint32_t
results[4] = {0, 1, 1, 1};
1907 static int DetectIPProtoTestSig2(
void)
1911 uint8_t raw_eth[] = {
1912 0x01, 0x00, 0x5e, 0x00, 0x00, 0x0d, 0x00, 0x26,
1913 0x88, 0x61, 0x3a, 0x80, 0x08, 0x00, 0x45, 0xc0,
1914 0x00, 0x36, 0xe4, 0xcd, 0x00, 0x00, 0x01, 0x67,
1915 0xc7, 0xab, 0xac, 0x1c, 0x7f, 0xfe, 0xe0, 0x00,
1916 0x00, 0x0d, 0x20, 0x00, 0x90, 0x20, 0x00, 0x01,
1917 0x00, 0x02, 0x00, 0x69, 0x00, 0x02, 0x00, 0x04,
1918 0x81, 0xf4, 0x07, 0xd0, 0x00, 0x13, 0x00, 0x04,
1919 0x00, 0x00, 0x00, 0x01, 0x00, 0x14, 0x00, 0x04,
1920 0x4a, 0xea, 0x7a, 0x8e,
1933 memset(&th_v, 0,
sizeof(th_v));
1947 "alert ip any any -> any any (msg:\"Check ipproto usage\"; "
1948 "ip_proto:!103; sid:1;)");
1992 static int DetectIPProtoTestSig3(
void)
1996 uint8_t raw_eth[] = {
1997 0x01, 0x00, 0x5e, 0x00, 0x00, 0x0d, 0x00, 0x26,
1998 0x88, 0x61, 0x3a, 0x80, 0x08, 0x00, 0x45, 0xc0,
1999 0x00, 0x36, 0xe4, 0xcd, 0x00, 0x00, 0x01, 0x67,
2000 0xc7, 0xab, 0xac, 0x1c, 0x7f, 0xfe, 0xe0, 0x00,
2001 0x00, 0x0d, 0x20, 0x00, 0x90, 0x20, 0x00, 0x01,
2002 0x00, 0x02, 0x00, 0x69, 0x00, 0x02, 0x00, 0x04,
2003 0x81, 0xf4, 0x07, 0xd0, 0x00, 0x13, 0x00, 0x04,
2004 0x00, 0x00, 0x00, 0x01, 0x00, 0x14, 0x00, 0x04,
2005 0x4a, 0xea, 0x7a, 0x8e,
2018 memset(&th_v, 0,
sizeof(th_v));
2032 "alert ip any any -> any any (msg:\"Check ipproto usage\"; "
2033 "ip_proto:103; sid:1;)");
2081 static void DetectIPProtoRegisterTests(
void)
2083 UtRegisterTest(
"DetectIPProtoTestParse01", DetectIPProtoTestParse01);
2084 UtRegisterTest(
"DetectIPProtoTestParse02", DetectIPProtoTestParse02);
2085 UtRegisterTest(
"DetectIPProtoTestSetup01", DetectIPProtoTestSetup01);
2086 UtRegisterTest(
"DetectIPProtoTestSetup02", DetectIPProtoTestSetup02);
2087 UtRegisterTest(
"DetectIPProtoTestSetup03", DetectIPProtoTestSetup03);
2088 UtRegisterTest(
"DetectIPProtoTestSetup04", DetectIPProtoTestSetup04);
2089 UtRegisterTest(
"DetectIPProtoTestSetup05", DetectIPProtoTestSetup05);
2090 UtRegisterTest(
"DetectIPProtoTestSetup06", DetectIPProtoTestSetup06);
2091 UtRegisterTest(
"DetectIPProtoTestSetup07", DetectIPProtoTestSetup07);
2092 UtRegisterTest(
"DetectIPProtoTestSetup08", DetectIPProtoTestSetup08);
2093 UtRegisterTest(
"DetectIPProtoTestSetup09", DetectIPProtoTestSetup09);
2094 UtRegisterTest(
"DetectIPProtoTestSetup10", DetectIPProtoTestSetup10);
2095 UtRegisterTest(
"DetectIPProtoTestSetup11", DetectIPProtoTestSetup11);
2096 UtRegisterTest(
"DetectIPProtoTestSetup12", DetectIPProtoTestSetup12);
2097 UtRegisterTest(
"DetectIPProtoTestSetup13", DetectIPProtoTestSetup13);
2098 UtRegisterTest(
"DetectIPProtoTestSetup14", DetectIPProtoTestSetup14);
2099 UtRegisterTest(
"DetectIPProtoTestSetup15", DetectIPProtoTestSetup15);
2100 UtRegisterTest(
"DetectIPProtoTestSetup16", DetectIPProtoTestSetup16);
2101 UtRegisterTest(
"DetectIPProtoTestSetup17", DetectIPProtoTestSetup17);
2102 UtRegisterTest(
"DetectIPProtoTestSetup18", DetectIPProtoTestSetup18);
2103 UtRegisterTest(
"DetectIPProtoTestSetup19", DetectIPProtoTestSetup19);
2104 UtRegisterTest(
"DetectIPProtoTestSetup20", DetectIPProtoTestSetup20);
2105 UtRegisterTest(
"DetectIPProtoTestSetup21", DetectIPProtoTestSetup21);
2106 UtRegisterTest(
"DetectIPProtoTestSetup22", DetectIPProtoTestSetup22);
2107 UtRegisterTest(
"DetectIPProtoTestSetup23", DetectIPProtoTestSetup23);
2108 UtRegisterTest(
"DetectIPProtoTestSetup24", DetectIPProtoTestSetup24);
2109 UtRegisterTest(
"DetectIPProtoTestSetup33", DetectIPProtoTestSetup33);
2110 UtRegisterTest(
"DetectIPProtoTestSetup34", DetectIPProtoTestSetup34);
2111 UtRegisterTest(
"DetectIPProtoTestSetup36", DetectIPProtoTestSetup36);
2112 UtRegisterTest(
"DetectIPProtoTestSetup43", DetectIPProtoTestSetup43);
2113 UtRegisterTest(
"DetectIPProtoTestSetup44", DetectIPProtoTestSetup44);
2114 UtRegisterTest(
"DetectIPProtoTestSetup45", DetectIPProtoTestSetup45);
2115 UtRegisterTest(
"DetectIPProtoTestSetup56", DetectIPProtoTestSetup56);
2116 UtRegisterTest(
"DetectIPProtoTestSetup75", DetectIPProtoTestSetup75);
2117 UtRegisterTest(
"DetectIPProtoTestSetup76", DetectIPProtoTestSetup76);
2118 UtRegisterTest(
"DetectIPProtoTestSetup129", DetectIPProtoTestSetup129);
2119 UtRegisterTest(
"DetectIPProtoTestSetup130", DetectIPProtoTestSetup130);
2120 UtRegisterTest(
"DetectIPProtoTestSetup131", DetectIPProtoTestSetup131);
2121 UtRegisterTest(
"DetectIPProtoTestSetup132", DetectIPProtoTestSetup132);
2122 UtRegisterTest(
"DetectIPProtoTestSetup145", DetectIPProtoTestSetup145);