52 #define DetectAddressPrint(...)
58 DetectAddressHead *ghn,
const char *s,
int negate, ResolvedVariablesList *var_list,
169 if (newhead->
ip.
family == AF_INET) {
171 }
else if (newhead->
ip.
family == AF_INET6) {
196 if (new->ip.family == AF_INET)
198 else if (new->ip.family == AF_INET6)
229 head = GetHeadPtr(gh,
new);
235 for (cur =
head; cur != NULL; cur = cur->
next) {
251 if (cur->
next == NULL) {
260 if (cur->
prev != NULL)
270 if (SetHeadPtr(gh,
head) < 0)
279 r = DetectAddressCut(
de_ctx, cur,
new, &c);
283 DetectAddressInsert(
de_ctx, gh,
new);
285 DetectAddressInsert(
de_ctx, gh, c);
290 r = DetectAddressCut(
de_ctx, cur,
new, &c);
294 DetectAddressInsert(
de_ctx, gh,
new);
296 DetectAddressInsert(
de_ctx, gh, c);
301 r = DetectAddressCut(
de_ctx, cur,
new, &c);
305 DetectAddressInsert(
de_ctx, gh,
new);
307 DetectAddressInsert(
de_ctx, gh, c);
312 r = DetectAddressCut(
de_ctx, cur,
new,&c);
316 DetectAddressInsert(
de_ctx, gh,
new);
318 DetectAddressInsert(
de_ctx, gh, c);
327 if (SetHeadPtr(gh,
head) < 0) {
355 while (item != NULL && it != NULL) {
365 if (!(item == NULL && it == NULL)) {
409 if ((strchr(
str,
':')) == NULL) {
415 if ((mask = strchr(ip,
'/')) != NULL) {
417 ip[mask - ip] =
'\0';
419 uint32_t ip4addr = 0;
420 uint32_t netmask = 0;
422 if ((strchr (mask,
'.')) == NULL) {
425 for (
size_t u = 0; u < strlen(mask); u++) {
426 if(!isdigit((
unsigned char)mask[u]))
436 r = inet_pton(AF_INET, mask, &in);
446 "netmask \"%s\" is not usable. Only netmasks that are compatible with "
447 "CIDR notation are supported. See ticket #5168.",
453 r = inet_pton(AF_INET, ip, &in);
459 dd->
ip.addr_data32[0] = dd->
ip2.addr_data32[0] = ip4addr & netmask;
460 dd->
ip2.addr_data32[0] |=~ netmask;
461 }
else if ((ip2 = strchr(ip,
'-')) != NULL) {
466 r = inet_pton(AF_INET, ip, &in);
469 dd->
ip.addr_data32[0] = in.s_addr;
471 r = inet_pton(AF_INET, ip2, &in);
474 dd->
ip2.addr_data32[0] = in.s_addr;
481 r = inet_pton(AF_INET, ip, &in);
485 dd->
ip.addr_data32[0] = in.s_addr;
486 dd->
ip2.addr_data32[0] = in.s_addr;
490 struct in6_addr in6, mask6;
491 uint32_t ip6addr[4], netmask[4];
495 if ((mask = strchr(ip,
'/')) != NULL) {
496 ip[mask - ip] =
'\0';
503 r = inet_pton(AF_INET6, ip, &in6);
506 memcpy(&ip6addr, &in6.s6_addr,
sizeof(ip6addr));
509 memcpy(&netmask, &mask6.s6_addr,
sizeof(netmask));
511 dd->
ip2.addr_data32[0] = dd->
ip.addr_data32[0] = ip6addr[0] & netmask[0];
512 dd->
ip2.addr_data32[1] = dd->
ip.addr_data32[1] = ip6addr[1] & netmask[1];
513 dd->
ip2.addr_data32[2] = dd->
ip.addr_data32[2] = ip6addr[2] & netmask[2];
514 dd->
ip2.addr_data32[3] = dd->
ip.addr_data32[3] = ip6addr[3] & netmask[3];
516 dd->
ip2.addr_data32[0] |=~ netmask[0];
517 dd->
ip2.addr_data32[1] |=~ netmask[1];
518 dd->
ip2.addr_data32[2] |=~ netmask[2];
519 dd->
ip2.addr_data32[3] |=~ netmask[3];
520 }
else if ((ip2 = strchr(ip,
'-')) != NULL) {
525 r = inet_pton(AF_INET6, ip, &in6);
528 memcpy(&dd->
ip.
address, &in6.s6_addr,
sizeof(ip6addr));
530 r = inet_pton(AF_INET6, ip2, &in6);
533 memcpy(&dd->
ip2.
address, &in6.s6_addr,
sizeof(ip6addr));
539 r = inet_pton(AF_INET6, ip, &in6);
575 if (DetectAddressParseString(dd,
str) < 0) {
600 while (*s !=
'\0' && isspace(*s))
603 if (strcasecmp(s,
"any") == 0) {
604 SCLogDebug(
"adding 0.0.0.0/0 and ::/0 as we\'re handling \'any\'");
612 if (DetectAddressInsert(NULL, gh, ad) < 0) {
618 ad = DetectAddressParseSingle(
"::/0");
624 if (DetectAddressInsert(NULL, gh, ad) < 0) {
635 SCLogError(
"failed to parse address \"%s\"", s);
643 if (DetectAddressCutNot(ad, &ad2) < 0) {
652 if (DetectAddressInsert(NULL, gh, ad2) < 0) {
661 int r = DetectAddressInsert(NULL, gh, ad);
698 DetectAddressHead *ghn,
const char *s,
int negate, ResolvedVariablesList *var_list,
699 int recur,
char *
address,
size_t address_length)
703 int o_set = 0, n_set = 0, d_set = 0;
705 const char *rule_var_address = NULL;
706 char *temp_rule_var_address = NULL;
710 "limit reached (max 64)");
714 SCLogDebug(
"s %s negate %s", s, negate ?
"true" :
"false");
716 size_t size = strlen(s);
717 for (u = 0, x = 0; u < size && x < address_length; u++) {
718 if (x == (address_length - 1)) {
720 " limit for the supplied address. Invalidating sig. "
721 "Please file a bug report on this.");
727 if (!o_set && s[u] ==
'!') {
730 }
else if (s[u] ==
'[') {
736 }
else if (s[u] ==
']') {
741 if (((negate + n_set) % 2) == 0) {
745 if (DetectAddressParse2(
de_ctx, gh, ghn,
address, (negate + n_set) % 2, var_list, recur) < 0)
758 if (DetectAddressParse2(
de_ctx, &tmp_gh, &tmp_ghn,
address, 0, var_list, recur) < 0) {
768 for (tmp_ad = tmp_gh.
ipv4_head; tmp_ad; tmp_ad = tmp_ad->
next) {
772 for (tmp_ad = tmp_ghn.
ipv4_head; tmp_ad; tmp_ad = tmp_ad->
next) {
776 for (tmp_ad = tmp_gh.
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
780 for (tmp_ad = tmp_ghn.
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
794 for (tmp_ad = tmp_gh.
ipv4_head; tmp_ad; tmp_ad = tmp_ad->
next) {
797 if (tmp_ad2 == NULL) {
803 DetectAddressInsert(NULL, ghn, tmp_ad2);
807 for (tmp_ad = tmp_gh.
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
810 if (tmp_ad2 == NULL) {
816 DetectAddressInsert(NULL, ghn, tmp_ad2);
824 }
else if (depth == 0 && s[u] ==
',') {
827 }
else if (d_set == 1) {
832 if (rule_var_address == NULL)
835 if (strlen(rule_var_address) == 0) {
837 "to nothing. This is likely a misconfiguration. "
838 "Note that a negated address needs to be quoted, "
839 "\"!$HOME_NET\" instead of !$HOME_NET. See issue #295.",
844 SCLogDebug(
"rule_var_address %s", rule_var_address);
845 if ((negate + n_set) % 2) {
847 const size_t str_size = strlen(rule_var_address) + 3 + 1;
848 temp_rule_var_address =
SCMalloc(str_size);
849 if (
unlikely(temp_rule_var_address == NULL))
851 snprintf(temp_rule_var_address, str_size,
"[%s]", rule_var_address);
853 temp_rule_var_address =
SCStrdup(rule_var_address);
854 if (
unlikely(temp_rule_var_address == NULL))
858 if (DetectAddressParse2(
de_ctx, gh, ghn, temp_rule_var_address,
859 (negate + n_set) % 2, var_list, recur) < 0) {
860 if (temp_rule_var_address != rule_var_address)
861 SCFree(temp_rule_var_address);
866 SCFree(temp_rule_var_address);
870 if (!((negate + n_set) % 2)) {
872 if (DetectAddressSetup(gh,
address) < 0)
876 if (DetectAddressSetup(ghn,
address) < 0)
882 }
else if (depth == 0 && s[u] ==
'$') {
884 }
else if (depth == 0 && u == size - 1) {
885 if (x == address_length) {
894 "groups declaration. This is likely a misconfiguration.");
901 if (rule_var_address == NULL)
904 if (strlen(rule_var_address) == 0) {
906 "to nothing. This is likely a misconfiguration. "
907 "Note that a negated address needs to be quoted, "
908 "\"!$HOME_NET\" instead of !$HOME_NET. See issue #295.",
913 SCLogDebug(
"rule_var_address %s", rule_var_address);
914 if ((negate + n_set) % 2) {
916 const size_t str_size = strlen(rule_var_address) + 3 + 1;
917 temp_rule_var_address =
SCMalloc(str_size);
918 if (
unlikely(temp_rule_var_address == NULL))
920 snprintf(temp_rule_var_address, str_size,
"[%s]", rule_var_address);
922 temp_rule_var_address =
SCStrdup(rule_var_address);
923 if (
unlikely(temp_rule_var_address == NULL))
927 if (DetectAddressParse2(
de_ctx, gh, ghn, temp_rule_var_address,
928 (negate + n_set) % 2, var_list, recur) < 0) {
930 if (temp_rule_var_address != rule_var_address)
931 SCFree(temp_rule_var_address);
935 SCFree(temp_rule_var_address);
937 if (!((negate + n_set) % 2)) {
939 if (DetectAddressSetup(gh,
address) < 0) {
945 if (DetectAddressSetup(ghn,
address) < 0) {
956 "properly closed in \"%s\", %d missing closing brackets (]). "
957 "Note: problem might be in a variable.",
960 }
else if (depth < 0) {
962 "properly opened in \"%s\", %d missing opening brackets ([). "
963 "Note: problem might be in a variable.",
982 DetectAddressHead *ghn,
const char *s,
int negate, ResolvedVariablesList *var_list,
986 #define MAX_ADDRESS_LENGTH 8192
988 size_t address_length = strlen(s);
993 " memory for address parsing.");
996 rc = DetectAddressParseInternal(
997 de_ctx, gh, ghn, s, negate, var_list, recur,
address, address_length);
1001 rc = DetectAddressParseInternal(
1048 if (DetectAddressIsCompleteIPSpace(ghn) == 1) {
1050 "Rule address range is NIL. Probably have a !any or "
1051 "an address range that supplies a NULL address range");
1058 r = DetectAddressSetup(gh,
"0.0.0.0/0");
1060 SCLogDebug(
"DetectAddressSetup for 0.0.0.0/0 failed");
1066 r = DetectAddressSetup(gh,
"::/0");
1068 SCLogDebug(
"DetectAddressSetup for ::/0 failed");
1083 r = DetectAddressInsert(NULL, gh, ad);
1099 r = DetectAddressInsert(NULL, gh, ad);
1107 for (tmp_ad = gh->
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
1111 int ipv4_applied = 0;
1112 int ipv6_applied = 0;
1120 for (ag2 = gh->
ipv4_head; ag2 != NULL; ) {
1127 if (ag2->
prev != NULL)
1129 if (ag2->
next != NULL)
1150 for (ag2 = gh->
ipv6_head; ag2 != NULL; ) {
1153 if (ag2->
prev != NULL)
1155 if (ag2->
next != NULL)
1175 for (tmp_ad = gh->
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
1178 for (tmp_ad = ghn->
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
1187 if (ipv4_applied !=
cnt) {
1189 "could be applied: %d != %d",
1198 if (ipv6_applied !=
cnt) {
1200 "could be applied: %d != %d",
1209 "merging addresses and negated addresses");
1221 SCLogDebug(
"Testing address conf vars for any misconfigured values");
1226 if (address_vars_node == NULL) {
1237 gh = DetectAddressHeadInit();
1241 ghn = DetectAddressHeadInit();
1246 if (seq_node->
val == NULL) {
1247 SCLogError(
"Address var \"%s\" probably has a sequence(something "
1248 "in brackets) value set without any quotes. Please "
1249 "quote it using \"..\".",
1254 int r = DetectAddressParse2(
1255 NULL, gh, ghn, seq_node->
val, 0, &var_list, 0);
1260 SCLogError(
"failed to parse address var \"%s\" with value \"%s\". "
1261 "Please check its syntax",
1262 seq_node->
name, seq_node->
val);
1266 if (DetectAddressIsCompleteIPSpace(ghn)) {
1267 SCLogError(
"address var - \"%s\" has the complete IP space negated "
1268 "with its value \"%s\". Rule address range is NIL. "
1269 "Probably have a !any or an address range that supplies "
1270 "a NULL address range",
1271 seq_node->
name, seq_node->
val);
1275 DetectAddressHeadFree(gh);
1276 DetectAddressHeadFree(ghn);
1283 DetectAddressHeadFree(gh);
1285 DetectAddressHeadFree(ghn);
1297 static uint32_t DetectAddressMapHashFunc(
HashListTable *ht,
void *data, uint16_t datalen)
1308 static char DetectAddressMapCompareFunc(
void *data1, uint16_t len1,
void *data2,
1318 static void DetectAddressMapFreeFunc(
void *data)
1322 DetectAddressHeadFree(map->
address);
1331 DetectAddressMapCompareFunc,
1332 DetectAddressMapFreeFunc);
1356 if (map->
string == NULL) {
1402 SCLogDebug(
"DetectAddressParse can not be run with NULL address");
1408 SCLogDebug(
"DetectAddressHeadInit for ghn failed");
1412 int r = DetectAddressParse2(
de_ctx, gh, ghn,
str, 0, NULL, 0);
1414 SCLogDebug(
"DetectAddressParse2 returned %d", r);
1415 DetectAddressHeadFree(ghn);
1427 DetectAddressHeadFree(ghn);
1432 DetectAddressHeadFree(ghn);
1433 return contains_negation ? 1 : 0;
1437 const char *
string,
bool *contains_negation)
1454 DetectAddressHeadFree(
head);
1456 }
else if (r == 1) {
1457 *contains_negation =
true;
1459 *contains_negation =
false;
1463 DetectAddressHeadFree(
head);
1482 DetectAddressCleanupList(gh->
ipv4_head);
1486 DetectAddressCleanupList(gh->
ipv6_head);
1592 uint16_t addrs_cnt,
const Address *a)
1596 if (addrs == NULL || addrs_cnt == 0) {
1600 uint32_t match_addr =
SCNtohl(a->addr_data32[0]);
1601 for (uint16_t idx = 0; idx < addrs_cnt; idx++) {
1602 if (match_addr >= addrs[idx].ip && match_addr <= addrs[idx].ip2) {
1625 uint16_t addrs_cnt,
const Address *a)
1629 if (addrs == NULL || addrs_cnt == 0) {
1633 uint32_t match_addr[4];
1634 match_addr[0] =
SCNtohl(a->addr_data32[0]);
1635 match_addr[1] =
SCNtohl(a->addr_data32[1]);
1636 match_addr[2] =
SCNtohl(a->addr_data32[2]);
1637 match_addr[3] =
SCNtohl(a->addr_data32[3]);
1642 for (uint16_t idx = 0; idx < addrs_cnt; idx++) {
1643 uint16_t result1 = 0, result2 = 0;
1646 if (0 == memcmp(match_addr, addrs[idx].ip,
sizeof(match_addr))) {
1649 if (0 == memcmp(match_addr, addrs[idx].ip2,
sizeof(match_addr))) {
1656 for (
int i = 0; i < 4; i++) {
1657 if (match_addr[i] > addrs[idx].ip[i]) {
1661 if (match_addr[i] < addrs[idx].ip[i]) {
1674 for (
int i = 0; i < 4; i++) {
1675 if (match_addr[i] < addrs[idx].ip2[i]) {
1679 if (match_addr[i] > addrs[idx].ip2[i]) {
1688 if (result1 == 1 && result2 == 1)
1744 SCLogDebug(
"What other address type can we have :-/");
1767 char ip[16], mask[16];
1769 memcpy(&in, &gr->
ip.addr_data32[0],
sizeof(in));
1770 PrintInet(AF_INET, &in, ip,
sizeof(ip));
1771 memcpy(&in, &gr->
ip2.addr_data32[0],
sizeof(in));
1772 PrintInet(AF_INET, &in, mask,
sizeof(mask));
1776 }
else if (gr->
ip.
family == AF_INET6) {
1777 struct in6_addr in6;
1778 char ip[66], mask[66];
1780 memcpy(&in6, &gr->
ip.addr_data32,
sizeof(in6));
1781 PrintInet(AF_INET6, &in6, ip,
sizeof(ip));
1782 memcpy(&in6, &gr->
ip2.addr_data32,
sizeof(in6));
1783 PrintInet(AF_INET6, &in6, mask,
sizeof(mask));
1811 if (a->
family == AF_INET) {
1814 }
else if (a->
family == AF_INET6) {
1819 for ( ; g != NULL; g = g->
next) {
1820 if (DetectAddressMatch(g,a) == 1) {
1832 static bool UTHValidateDetectAddress(
DetectAddress *ad,
const char *one,
const char *two)
1834 char str1[46] =
"", str2[46] =
"";
1841 PrintInet(AF_INET, (
const void *)&ad->
ip.addr_data32[0], str1,
sizeof(str1));
1843 PrintInet(AF_INET, (
const void *)&ad->
ip2.addr_data32[0], str2,
sizeof(str2));
1846 if (strcmp(str1, one) != 0) {
1851 if (strcmp(str2, two) != 0) {
1860 PrintInet(AF_INET6, (
const void *)&ad->
ip.addr_data32[0], str1,
sizeof(str1));
1862 PrintInet(AF_INET6, (
const void *)&ad->
ip2.addr_data32[0], str2,
sizeof(str2));
1865 if (strcmp(str1, one) != 0) {
1870 if (strcmp(str2, two) != 0) {
1889 int expect = nranges;
1899 while (have < expect) {
1901 printf(
"bad head: have %d ranges, expected %d: ", have, expect);
1905 if (!UTHValidateDetectAddress(ad, expectations[have].one, expectations[have].two))
1915 static int AddressTestParse01(
void)
1927 static int AddressTestParse02(
void)
1933 if (dd->
ip2.addr_data32[0] !=
SCNtohl(16909060) ||
1934 dd->
ip.addr_data32[0] !=
SCNtohl(16909060)) {
1938 printf(
"ip %"PRIu32
", ip2 %"PRIu32
"\n", dd->
ip.addr_data32[0], dd->
ip2.addr_data32[0]);
1946 static int AddressTestParse03(
void)
1948 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4/255.255.255.0");
1958 static int AddressTestParse04(
void)
1960 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4/255.255.255.0");
1963 char left[16], right[16];
1964 PrintInet(AF_INET, (
const void *)&dd->
ip.addr_data32[0], left,
sizeof(left));
1965 PrintInet(AF_INET, (
const void *)&dd->
ip2.addr_data32[0], right,
sizeof(right));
1977 static int AddressTestParse04bug5081(
void)
1979 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.64/26");
1982 char left[16], right[16];
1983 PrintInet(AF_INET, (
const void *)&dd->
ip.addr_data32[0], left,
sizeof(left));
1984 PrintInet(AF_INET, (
const void *)&dd->
ip2.addr_data32[0], right,
sizeof(right));
1993 static int AddressTestParse05(
void)
2005 static int AddressTestParse06(
void)
2011 if (dd->
ip2.addr_data32[0] !=
SCNtohl(16909311) ||
2012 dd->
ip.addr_data32[0] !=
SCNtohl(16909056)) {
2023 static int AddressTestParse07(
void)
2035 static int AddressTestParse08(
void)
2041 if (dd->
ip.addr_data32[0] !=
SCNtohl(536870912) || dd->
ip.addr_data32[1] != 0x00000000 ||
2042 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2044 dd->
ip2.addr_data32[0] !=
SCNtohl(1073741823) || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2045 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2057 static int AddressTestParse09(
void)
2059 DetectAddress *dd = DetectAddressParseSingle(
"2001::1/128");
2069 static int AddressTestParse10(
void)
2075 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2076 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2078 dd->
ip2.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip2.addr_data32[1] != 0x00000000 ||
2079 dd->
ip2.addr_data32[2] != 0x00000000 || dd->
ip2.addr_data32[3] != 0x00000000) {
2091 static int AddressTestParse11(
void)
2103 static int AddressTestParse12(
void)
2109 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2110 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2113 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2124 static int AddressTestParse13(
void)
2136 static int AddressTestParse14(
void)
2142 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2143 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2145 dd->
ip2.addr_data32[0] !=
SCNtohl(537001983) || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2146 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2157 static int AddressTestParse15(
void)
2169 static int AddressTestParse16(
void)
2175 if (dd->
ip.addr_data32[0] != 0x00000000 || dd->
ip.addr_data32[1] != 0x00000000 ||
2176 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2178 dd->
ip2.addr_data32[0] != 0xFFFFFFFF || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2179 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2190 static int AddressTestParse17(
void)
2192 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4-1.2.3.6");
2202 static int AddressTestParse18(
void)
2205 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4-1.2.3.6");
2208 if (dd->
ip2.addr_data32[0] !=
SCNtohl(16909062) ||
2209 dd->
ip.addr_data32[0] !=
SCNtohl(16909060)) {
2220 static int AddressTestParse19(
void)
2222 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.6-1.2.3.4");
2232 static int AddressTestParse20(
void)
2234 DetectAddress *dd = DetectAddressParseSingle(
"2001::1-2001::4");
2244 static int AddressTestParse21(
void)
2247 DetectAddress *dd = DetectAddressParseSingle(
"2001::1-2001::4");
2250 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2251 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] !=
SCNtohl(1) ||
2253 dd->
ip2.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip2.addr_data32[1] != 0x00000000 ||
2254 dd->
ip2.addr_data32[2] != 0x00000000 || dd->
ip2.addr_data32[3] !=
SCNtohl(4)) {
2265 static int AddressTestParse22(
void)
2267 DetectAddress *dd = DetectAddressParseSingle(
"2001::4-2001::1");
2277 static int AddressTestParse23(
void)
2283 DetectAddressHeadFree(gh);
2287 static int AddressTestParse24(
void)
2293 DetectAddressHeadFree(gh);
2297 static int AddressTestParse25(
void)
2303 DetectAddressHeadFree(gh);
2308 static int AddressTestParse26(
void)
2314 "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["
2316 "]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]"
2319 DetectAddressHeadFree(gh);
2320 gh = DetectAddressHeadInit();
2324 "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["
2326 "]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]"
2329 DetectAddressHeadFree(gh);
2333 static int AddressTestParse27(
void)
2335 DetectAddress *dd = DetectAddressParseSingle(
"!192.168.0.1");
2345 static int AddressTestParse28(
void)
2352 dd->
ip.addr_data32[0] ==
SCNtohl(16909060)) {
2363 static int AddressTestParse29(
void)
2365 DetectAddress *dd = DetectAddressParseSingle(
"!1.2.3.0/24");
2375 static int AddressTestParse30(
void)
2378 DetectAddress *dd = DetectAddressParseSingle(
"!1.2.3.4/24");
2382 dd->
ip.addr_data32[0] ==
SCNtohl(16909056) &&
2383 dd->
ip2.addr_data32[0] ==
SCNtohl(16909311)) {
2397 static int AddressTestParse31(
void)
2409 static int AddressTestParse32(
void)
2421 static int AddressTestParse33(
void)
2428 dd->
ip.addr_data32[0] ==
SCNtohl(536936448) && dd->
ip.addr_data32[1] == 0x00000000 &&
2429 dd->
ip.addr_data32[2] == 0x00000000 && dd->
ip.addr_data32[3] ==
SCNtohl(1)) {
2440 static int AddressTestParse34(
void)
2452 static int AddressTestParse35(
void)
2459 dd->
ip.addr_data32[0] ==
SCNtohl(536936448) && dd->
ip.addr_data32[1] == 0x00000000 &&
2460 dd->
ip.addr_data32[2] == 0x00000000 && dd->
ip.addr_data32[3] == 0x00000000 &&
2462 dd->
ip2.addr_data32[0] ==
SCNtohl(537001983) && dd->
ip2.addr_data32[1] == 0xFFFFFFFF &&
2463 dd->
ip2.addr_data32[2] == 0xFFFFFFFF && dd->
ip2.addr_data32[3] == 0xFFFFFFFF) {
2474 static int AddressTestParse36(
void)
2480 if (dd->
ip.addr_data32[0] !=
SCNtohl(0xFFFF0000) || dd->
ip.addr_data32[1] != 0x00000000 ||
2481 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2483 dd->
ip2.addr_data32[0] != 0xFFFFFFFF || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2484 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2498 static int AddressTestParse37(
void)
2504 if (dd->
ip.addr_data32[0] != 0x00000000 || dd->
ip.addr_data32[1] != 0x00000000 ||
2505 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2507 dd->
ip2.addr_data32[0] != 0xFFFFFFFF || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2508 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2521 static int AddressTestMatch01(
void)
2528 if (inet_pton(AF_INET,
"1.2.3.4", &in) != 1)
2530 memset(&a, 0,
sizeof(
Address));
2532 a.addr_data32[0] = in.s_addr;
2534 dd = DetectAddressParseSingle(
"1.2.3.4/24");
2536 if (DetectAddressMatch(dd, &a) == 0)
2546 static int AddressTestMatch02(
void)
2553 if (inet_pton(AF_INET,
"1.2.3.127", &in) != 1)
2555 memset(&a, 0,
sizeof(
Address));
2557 a.addr_data32[0] = in.s_addr;
2559 dd = DetectAddressParseSingle(
"1.2.3.4/25");
2561 if (DetectAddressMatch(dd, &a) == 0)
2571 static int AddressTestMatch03(
void)
2578 if (inet_pton(AF_INET,
"1.2.3.128", &in) != 1)
2580 memset(&a, 0,
sizeof(
Address));
2582 a.addr_data32[0] = in.s_addr;
2584 dd = DetectAddressParseSingle(
"1.2.3.4/25");
2586 if (DetectAddressMatch(dd, &a) == 1)
2596 static int AddressTestMatch04(
void)
2603 if (inet_pton(AF_INET,
"1.2.2.255", &in) != 1)
2605 memset(&a, 0,
sizeof(
Address));
2607 a.addr_data32[0] = in.s_addr;
2609 dd = DetectAddressParseSingle(
"1.2.3.4/25");
2611 if (DetectAddressMatch(dd, &a) == 1)
2621 static int AddressTestMatch05(
void)
2628 if (inet_pton(AF_INET,
"1.2.3.4", &in) != 1)
2630 memset(&a, 0,
sizeof(
Address));
2632 a.addr_data32[0] = in.s_addr;
2634 dd = DetectAddressParseSingle(
"1.2.3.4/32");
2636 if (DetectAddressMatch(dd, &a) == 0)
2646 static int AddressTestMatch06(
void)
2653 if (inet_pton(AF_INET,
"1.2.3.4", &in) != 1)
2655 memset(&a, 0,
sizeof(
Address));
2657 a.addr_data32[0] = in.s_addr;
2659 dd = DetectAddressParseSingle(
"0.0.0.0/0.0.0.0");
2661 if (DetectAddressMatch(dd, &a) == 0)
2671 static int AddressTestMatch07(
void)
2675 struct in6_addr in6;
2678 if (inet_pton(AF_INET6,
"2001::1", &in6) != 1)
2680 memset(&a, 0,
sizeof(
Address));
2681 a.family = AF_INET6;
2682 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2684 dd = DetectAddressParseSingle(
"2001::/3");
2686 if (DetectAddressMatch(dd, &a) == 0)
2696 static int AddressTestMatch08(
void)
2700 struct in6_addr in6;
2703 if (inet_pton(AF_INET6,
"1999:ffff:ffff:ffff:ffff:ffff:ffff:ffff", &in6) != 1)
2705 memset(&a, 0,
sizeof(
Address));
2706 a.family = AF_INET6;
2707 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2709 dd = DetectAddressParseSingle(
"2001::/3");
2711 if (DetectAddressMatch(dd, &a) == 1)
2721 static int AddressTestMatch09(
void)
2725 struct in6_addr in6;
2728 if (inet_pton(AF_INET6,
"2001::2", &in6) != 1)
2730 memset(&a, 0,
sizeof(
Address));
2731 a.family = AF_INET6;
2732 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2734 dd = DetectAddressParseSingle(
"2001::1/128");
2736 if (DetectAddressMatch(dd, &a) == 1)
2746 static int AddressTestMatch10(
void)
2750 struct in6_addr in6;
2753 if (inet_pton(AF_INET6,
"2001::2", &in6) != 1)
2755 memset(&a, 0,
sizeof(
Address));
2756 a.family = AF_INET6;
2757 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2759 dd = DetectAddressParseSingle(
"2001::1/126");
2761 if (DetectAddressMatch(dd, &a) == 0)
2771 static int AddressTestMatch11(
void)
2775 struct in6_addr in6;
2778 if (inet_pton(AF_INET6,
"2001::3", &in6) != 1)
2780 memset(&a, 0,
sizeof(
Address));
2781 a.family = AF_INET6;
2782 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2784 dd = DetectAddressParseSingle(
"2001::1/127");
2786 if (DetectAddressMatch(dd, &a) == 1)
2796 static int AddressTestCmp01(
void)
2801 da = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2802 if (da == NULL)
goto error;
2803 db = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2804 if (db == NULL)
goto error;
2819 static int AddressTestCmp02(
void)
2824 da = DetectAddressParseSingle(
"192.168.0.0/255.255.0.0");
2825 if (da == NULL)
goto error;
2826 db = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2827 if (db == NULL)
goto error;
2842 static int AddressTestCmp03(
void)
2847 da = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2848 if (da == NULL)
goto error;
2849 db = DetectAddressParseSingle(
"192.168.0.0/255.255.0.0");
2850 if (db == NULL)
goto error;
2865 static int AddressTestCmp04(
void)
2870 da = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2871 if (da == NULL)
goto error;
2872 db = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2873 if (db == NULL)
goto error;
2888 static int AddressTestCmp05(
void)
2893 da = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2894 if (da == NULL)
goto error;
2895 db = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2896 if (db == NULL)
goto error;
2911 static int AddressTestCmp06(
void)
2916 da = DetectAddressParseSingle(
"192.168.1.0/255.255.0.0");
2917 if (da == NULL)
goto error;
2918 db = DetectAddressParseSingle(
"192.168.0.0/255.255.0.0");
2919 if (db == NULL)
goto error;
2934 static int AddressTestCmpIPv407(
void)
2939 da = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2940 if (da == NULL)
goto error;
2941 db = DetectAddressParseSingle(
"192.168.1.128-192.168.2.128");
2942 if (db == NULL)
goto error;
2957 static int AddressTestCmpIPv408(
void)
2962 da = DetectAddressParseSingle(
"192.168.1.128-192.168.2.128");
2963 if (da == NULL)
goto error;
2964 db = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2965 if (db == NULL)
goto error;
2980 static int AddressTestCmp07(
void)
2985 da = DetectAddressParseSingle(
"2001::/3");
2986 if (da == NULL)
goto error;
2987 db = DetectAddressParseSingle(
"2001::1/3");
2988 if (db == NULL)
goto error;
3003 static int AddressTestCmp08(
void)
3008 da = DetectAddressParseSingle(
"2001::/3");
3009 if (da == NULL)
goto error;
3010 db = DetectAddressParseSingle(
"2001::/8");
3011 if (db == NULL)
goto error;
3026 static int AddressTestCmp09(
void)
3031 da = DetectAddressParseSingle(
"2001::/8");
3032 if (da == NULL)
goto error;
3033 db = DetectAddressParseSingle(
"2001::/3");
3034 if (db == NULL)
goto error;
3049 static int AddressTestCmp10(
void)
3054 da = DetectAddressParseSingle(
"2001:1:2:3:0:0:0:0/64");
3055 if (da == NULL)
goto error;
3056 db = DetectAddressParseSingle(
"2001:1:2:4:0:0:0:0/64");
3057 if (db == NULL)
goto error;
3072 static int AddressTestCmp11(
void)
3077 da = DetectAddressParseSingle(
"2001:1:2:4:0:0:0:0/64");
3078 if (da == NULL)
goto error;
3079 db = DetectAddressParseSingle(
"2001:1:2:3:0:0:0:0/64");
3080 if (db == NULL)
goto error;
3095 static int AddressTestCmp12(
void)
3100 da = DetectAddressParseSingle(
"2001:1:2:3:1:0:0:0/64");
3101 if (da == NULL)
goto error;
3102 db = DetectAddressParseSingle(
"2001:1:2:3:2:0:0:0/64");
3103 if (db == NULL)
goto error;
3118 static int AddressTestAddressGroupSetup01(
void)
3128 DetectAddressHeadFree(gh);
3133 static int AddressTestAddressGroupSetup02(
void)
3143 DetectAddressHeadFree(gh);
3148 static int AddressTestAddressGroupSetup03(
void)
3159 if (r == 0 && gh->
ipv4_head != prev_head &&
3165 DetectAddressHeadFree(gh);
3170 static int AddressTestAddressGroupSetup04(
void)
3181 if (r == 0 && gh->
ipv4_head != prev_head &&
3193 DetectAddressHeadFree(gh);
3198 static int AddressTestAddressGroupSetup05(
void)
3209 if (r == 0 && gh->
ipv4_head == prev_head &&
3221 DetectAddressHeadFree(gh);
3226 static int AddressTestAddressGroupSetup06(
void)
3237 if (r == 0 && gh->
ipv4_head == prev_head &&
3243 DetectAddressHeadFree(gh);
3248 static int AddressTestAddressGroupSetup07(
void)
3264 DetectAddressHeadFree(gh);
3269 static int AddressTestAddressGroupSetup08(
void)
3285 DetectAddressHeadFree(gh);
3290 static int AddressTestAddressGroupSetup09(
void)
3306 DetectAddressHeadFree(gh);
3311 static int AddressTestAddressGroupSetup10(
void)
3327 DetectAddressHeadFree(gh);
3332 static int AddressTestAddressGroupSetup11(
void)
3345 *three = two->
next, *four = three->
next,
3355 if (one->
ip.addr_data32[0] == 0x00000000 && one->
ip2.addr_data32[0] ==
SCNtohl(168430079) &&
3356 two->ip.addr_data32[0] ==
SCNtohl(168430080) && two->ip2.addr_data32[0] ==
SCNtohl(168430089) &&
3357 three->ip.addr_data32[0] ==
SCNtohl(168430090) && three->ip2.addr_data32[0] ==
SCNtohl(168430335) &&
3358 four->ip.addr_data32[0] ==
SCNtohl(168430336) && four->ip2.addr_data32[0] ==
SCNtohl(168430337) &&
3359 five->ip.addr_data32[0] ==
SCNtohl(168430338) && five->ip2.addr_data32[0] == 0xFFFFFFFF) {
3366 DetectAddressHeadFree(gh);
3371 static int AddressTestAddressGroupSetup12 (
void)
3384 *three = two->
next, *four = three->
next,
3394 if (one->
ip.addr_data32[0] == 0x00000000 && one->
ip2.addr_data32[0] ==
SCNtohl(168430079) &&
3395 two->ip.addr_data32[0] ==
SCNtohl(168430080) && two->ip2.addr_data32[0] ==
SCNtohl(168430089) &&
3396 three->ip.addr_data32[0] ==
SCNtohl(168430090) && three->ip2.addr_data32[0] ==
SCNtohl(168430335) &&
3397 four->ip.addr_data32[0] ==
SCNtohl(168430336) && four->ip2.addr_data32[0] ==
SCNtohl(168430337) &&
3398 five->ip.addr_data32[0] ==
SCNtohl(168430338) && five->ip2.addr_data32[0] == 0xFFFFFFFF) {
3405 DetectAddressHeadFree(gh);
3410 static int AddressTestAddressGroupSetup13(
void)
3423 *three = two->
next, *four = three->
next,
3433 if (one->
ip.addr_data32[0] == 0x00000000 && one->
ip2.addr_data32[0] ==
SCNtohl(168430079) &&
3434 two->ip.addr_data32[0] ==
SCNtohl(168430080) && two->ip2.addr_data32[0] ==
SCNtohl(168430089) &&
3435 three->ip.addr_data32[0] ==
SCNtohl(168430090) && three->ip2.addr_data32[0] ==
SCNtohl(168430335) &&
3436 four->ip.addr_data32[0] ==
SCNtohl(168430336) && four->ip2.addr_data32[0] ==
SCNtohl(168430337) &&
3437 five->ip.addr_data32[0] ==
SCNtohl(168430338) && five->ip2.addr_data32[0] == 0xFFFFFFFF) {
3444 DetectAddressHeadFree(gh);
3449 static int AddressTestAddressGroupSetupIPv414(
void)
3470 DetectAddressHeadFree(gh);
3475 static int AddressTestAddressGroupSetupIPv415(
void)
3493 DetectAddressHeadFree(gh);
3497 static int AddressTestAddressGroupSetupIPv416(
void)
3515 DetectAddressHeadFree(gh);
3519 static int AddressTestAddressGroupSetup14(
void)
3529 DetectAddressHeadFree(gh);
3534 static int AddressTestAddressGroupSetup15(
void)
3544 DetectAddressHeadFree(gh);
3549 static int AddressTestAddressGroupSetup16(
void)
3560 if (r == 0 && gh->
ipv6_head != prev_head &&
3566 DetectAddressHeadFree(gh);
3571 static int AddressTestAddressGroupSetup17(
void)
3582 if (r == 0 && gh->
ipv6_head != prev_head &&
3594 DetectAddressHeadFree(gh);
3599 static int AddressTestAddressGroupSetup18(
void)
3610 if (r == 0 && gh->
ipv6_head == prev_head &&
3622 DetectAddressHeadFree(gh);
3627 static int AddressTestAddressGroupSetup19(
void)
3638 if (r == 0 && gh->
ipv6_head == prev_head &&
3644 DetectAddressHeadFree(gh);
3649 static int AddressTestAddressGroupSetup20(
void)
3665 DetectAddressHeadFree(gh);
3670 static int AddressTestAddressGroupSetup21(
void)
3686 DetectAddressHeadFree(gh);
3691 static int AddressTestAddressGroupSetup22(
void)
3707 DetectAddressHeadFree(gh);
3712 static int AddressTestAddressGroupSetup23(
void)
3728 DetectAddressHeadFree(gh);
3733 static int AddressTestAddressGroupSetup24(
void)
3746 *three = two->
next, *four = three->
next,
3748 if (one->
ip.addr_data32[0] == 0x00000000 &&
3749 one->
ip.addr_data32[1] == 0x00000000 &&
3750 one->
ip.addr_data32[2] == 0x00000000 &&
3751 one->
ip.addr_data32[3] == 0x00000000 &&
3752 one->
ip2.addr_data32[0] ==
SCNtohl(536870911) &&
3753 one->
ip2.addr_data32[1] == 0xFFFFFFFF &&
3754 one->
ip2.addr_data32[2] == 0xFFFFFFFF &&
3755 one->
ip2.addr_data32[3] == 0xFFFFFFFF &&
3757 two->
ip.addr_data32[0] ==
SCNtohl(536870912) &&
3758 two->
ip.addr_data32[1] == 0x00000000 &&
3759 two->
ip.addr_data32[2] == 0x00000000 &&
3760 two->
ip.addr_data32[3] == 0x00000000 &&
3761 two->
ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3762 two->
ip2.addr_data32[1] == 0x00000000 &&
3763 two->
ip2.addr_data32[2] == 0x00000000 &&
3766 three->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3767 three->ip.addr_data32[1] == 0x00000000 &&
3768 three->ip.addr_data32[2] == 0x00000000 &&
3769 three->ip.addr_data32[3] ==
SCNtohl(4) &&
3770 three->ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3771 three->ip2.addr_data32[1] == 0x00000000 &&
3772 three->ip2.addr_data32[2] == 0x00000000 &&
3773 three->ip2.addr_data32[3] ==
SCNtohl(6) &&
3775 four->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3776 four->ip.addr_data32[1] == 0x00000000 &&
3777 four->ip.addr_data32[2] == 0x00000000 &&
3778 four->ip.addr_data32[3] ==
SCNtohl(7) &&
3779 four->ip2.addr_data32[0] ==
SCNtohl(1073741823) &&
3780 four->ip2.addr_data32[1] == 0xFFFFFFFF &&
3781 four->ip2.addr_data32[2] == 0xFFFFFFFF &&
3782 four->ip2.addr_data32[3] == 0xFFFFFFFF &&
3784 five->ip.addr_data32[0] ==
SCNtohl(1073741824) &&
3785 five->ip.addr_data32[1] == 0x00000000 &&
3786 five->ip.addr_data32[2] == 0x00000000 &&
3787 five->ip.addr_data32[3] == 0x00000000 &&
3788 five->ip2.addr_data32[0] == 0xFFFFFFFF &&
3789 five->ip2.addr_data32[1] == 0xFFFFFFFF &&
3790 five->ip2.addr_data32[2] == 0xFFFFFFFF &&
3791 five->ip2.addr_data32[3] == 0xFFFFFFFF) {
3798 DetectAddressHeadFree(gh);
3803 static int AddressTestAddressGroupSetup25(
void)
3816 *three = two->
next, *four = three->
next,
3818 if (one->
ip.addr_data32[0] == 0x00000000 &&
3819 one->
ip.addr_data32[1] == 0x00000000 &&
3820 one->
ip.addr_data32[2] == 0x00000000 &&
3821 one->
ip.addr_data32[3] == 0x00000000 &&
3822 one->
ip2.addr_data32[0] ==
SCNtohl(536870911) &&
3823 one->
ip2.addr_data32[1] == 0xFFFFFFFF &&
3824 one->
ip2.addr_data32[2] == 0xFFFFFFFF &&
3825 one->
ip2.addr_data32[3] == 0xFFFFFFFF &&
3827 two->
ip.addr_data32[0] ==
SCNtohl(536870912) &&
3828 two->
ip.addr_data32[1] == 0x00000000 &&
3829 two->
ip.addr_data32[2] == 0x00000000 &&
3830 two->
ip.addr_data32[3] == 0x00000000 &&
3831 two->
ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3832 two->
ip2.addr_data32[1] == 0x00000000 &&
3833 two->
ip2.addr_data32[2] == 0x00000000 &&
3836 three->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3837 three->ip.addr_data32[1] == 0x00000000 &&
3838 three->ip.addr_data32[2] == 0x00000000 &&
3839 three->ip.addr_data32[3] ==
SCNtohl(4) &&
3840 three->ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3841 three->ip2.addr_data32[1] == 0x00000000 &&
3842 three->ip2.addr_data32[2] == 0x00000000 &&
3843 three->ip2.addr_data32[3] ==
SCNtohl(6) &&
3845 four->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3846 four->ip.addr_data32[1] == 0x00000000 &&
3847 four->ip.addr_data32[2] == 0x00000000 &&
3848 four->ip.addr_data32[3] ==
SCNtohl(7) &&
3849 four->ip2.addr_data32[0] ==
SCNtohl(1073741823) &&
3850 four->ip2.addr_data32[1] == 0xFFFFFFFF &&
3851 four->ip2.addr_data32[2] == 0xFFFFFFFF &&
3852 four->ip2.addr_data32[3] == 0xFFFFFFFF &&
3854 five->ip.addr_data32[0] ==
SCNtohl(1073741824) &&
3855 five->ip.addr_data32[1] == 0x00000000 &&
3856 five->ip.addr_data32[2] == 0x00000000 &&
3857 five->ip.addr_data32[3] == 0x00000000 &&
3858 five->ip2.addr_data32[0] == 0xFFFFFFFF &&
3859 five->ip2.addr_data32[1] == 0xFFFFFFFF &&
3860 five->ip2.addr_data32[2] == 0xFFFFFFFF &&
3861 five->ip2.addr_data32[3] == 0xFFFFFFFF) {
3868 DetectAddressHeadFree(gh);
3873 static int AddressTestAddressGroupSetup26(
void)
3886 *three = two->
next, *four = three->
next,
3888 if (one->
ip.addr_data32[0] == 0x00000000 &&
3889 one->
ip.addr_data32[1] == 0x00000000 &&
3890 one->
ip.addr_data32[2] == 0x00000000 &&
3891 one->
ip.addr_data32[3] == 0x00000000 &&
3892 one->
ip2.addr_data32[0] ==
SCNtohl(536870911) &&
3893 one->
ip2.addr_data32[1] == 0xFFFFFFFF &&
3894 one->
ip2.addr_data32[2] == 0xFFFFFFFF &&
3895 one->
ip2.addr_data32[3] == 0xFFFFFFFF &&
3897 two->
ip.addr_data32[0] ==
SCNtohl(536870912) &&
3898 two->
ip.addr_data32[1] == 0x00000000 &&
3899 two->
ip.addr_data32[2] == 0x00000000 &&
3900 two->
ip.addr_data32[3] == 0x00000000 &&
3901 two->
ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3902 two->
ip2.addr_data32[1] == 0x00000000 &&
3903 two->
ip2.addr_data32[2] == 0x00000000 &&
3906 three->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3907 three->ip.addr_data32[1] == 0x00000000 &&
3908 three->ip.addr_data32[2] == 0x00000000 &&
3909 three->ip.addr_data32[3] ==
SCNtohl(4) &&
3910 three->ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3911 three->ip2.addr_data32[1] == 0x00000000 &&
3912 three->ip2.addr_data32[2] == 0x00000000 &&
3913 three->ip2.addr_data32[3] ==
SCNtohl(6) &&
3915 four->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3916 four->ip.addr_data32[1] == 0x00000000 &&
3917 four->ip.addr_data32[2] == 0x00000000 &&
3918 four->ip.addr_data32[3] ==
SCNtohl(7) &&
3919 four->ip2.addr_data32[0] ==
SCNtohl(1073741823) &&
3920 four->ip2.addr_data32[1] == 0xFFFFFFFF &&
3921 four->ip2.addr_data32[2] == 0xFFFFFFFF &&
3922 four->ip2.addr_data32[3] == 0xFFFFFFFF &&
3924 five->ip.addr_data32[0] ==
SCNtohl(1073741824) &&
3925 five->ip.addr_data32[1] == 0x00000000 &&
3926 five->ip.addr_data32[2] == 0x00000000 &&
3927 five->ip.addr_data32[3] == 0x00000000 &&
3928 five->ip2.addr_data32[0] == 0xFFFFFFFF &&
3929 five->ip2.addr_data32[1] == 0xFFFFFFFF &&
3930 five->ip2.addr_data32[2] == 0xFFFFFFFF &&
3931 five->ip2.addr_data32[3] == 0xFFFFFFFF) {
3938 DetectAddressHeadFree(gh);
3943 static int AddressTestAddressGroupSetup27(
void)
3953 DetectAddressHeadFree(gh);
3958 static int AddressTestAddressGroupSetup28(
void)
3968 DetectAddressHeadFree(gh);
3973 static int AddressTestAddressGroupSetup29(
void)
3983 DetectAddressHeadFree(gh);
3988 static int AddressTestAddressGroupSetup30(
void)
3994 int r =
DetectAddressParse(NULL, gh,
"[[1.2.3.4,2.3.4.5],4.3.2.1,[10.10.10.10,11.11.11.11]]");
3998 DetectAddressHeadFree(gh);
4003 static int AddressTestAddressGroupSetup31(
void)
4009 int r =
DetectAddressParse(NULL, gh,
"[[1.2.3.4,[2.3.4.5,3.4.5.6]],4.3.2.1,[10.10.10.10,[11.11.11.11,12.12.12.12]]]");
4013 DetectAddressHeadFree(gh);
4018 static int AddressTestAddressGroupSetup32(
void)
4024 int r =
DetectAddressParse(NULL, gh,
"[[1.2.3.4,[2.3.4.5,[3.4.5.6,4.5.6.7]]],4.3.2.1,[10.10.10.10,[11.11.11.11,[12.12.12.12,13.13.13.13]]]]");
4028 DetectAddressHeadFree(gh);
4033 static int AddressTestAddressGroupSetup33(
void)
4043 DetectAddressHeadFree(gh);
4048 static int AddressTestAddressGroupSetup34(
void)
4058 DetectAddressHeadFree(gh);
4063 static int AddressTestAddressGroupSetup35(
void)
4073 DetectAddressHeadFree(gh);
4078 static int AddressTestAddressGroupSetup36 (
void)
4084 int r =
DetectAddressParse(NULL, gh,
"[1.0.0.0/8,[2.0.0.0/8,[3.0.0.0/8,!1.1.1.1]]]");
4088 DetectAddressHeadFree(gh);
4093 static int AddressTestAddressGroupSetup37(
void)
4103 DetectAddressHeadFree(gh);
4108 static int AddressTestAddressGroupSetup38(
void)
4111 {
"0.0.0.0",
"192.167.255.255" },
4112 {
"192.168.14.0",
"192.168.14.255" },
4113 {
"192.169.0.0",
"255.255.255.255" } };
4120 if (UTHValidateDetectAddressHead(gh, 3, expectations))
4124 DetectAddressHeadFree(gh);
4129 static int AddressTestAddressGroupSetup39(
void)
4132 {
"0.0.0.0",
"192.167.255.255" },
4133 {
"192.168.14.0",
"192.168.14.255" },
4134 {
"192.169.0.0",
"255.255.255.255" } };
4141 if (UTHValidateDetectAddressHead(gh, 3, expectations))
4145 DetectAddressHeadFree(gh);
4150 static int AddressTestAddressGroupSetup40(
void)
4153 {
"0.0.0.0",
"192.167.255.255" },
4154 {
"192.168.14.0",
"192.168.14.255" },
4155 {
"192.169.0.0",
"255.255.255.255" } };
4161 if (UTHValidateDetectAddressHead(gh, 3, expectations))
4165 DetectAddressHeadFree(gh);
4170 static int AddressTestAddressGroupSetup41(
void)
4173 {
"0.0.0.0",
"192.167.255.255" },
4174 {
"192.168.14.0",
"192.168.14.255" },
4175 {
"192.169.0.0",
"255.255.255.255" } };
4181 if (UTHValidateDetectAddressHead(gh, 3, expectations))
4185 DetectAddressHeadFree(gh);
4190 static int AddressTestAddressGroupSetup42(
void)
4193 {
"2000:0000:0000:0000:0000:0000:0000:0000",
"3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" } };
4199 if (UTHValidateDetectAddressHead(gh, 1, expectations))
4203 DetectAddressHeadFree(gh);
4208 static int AddressTestAddressGroupSetup43(
void)
4211 {
"2000:0000:0000:0000:0000:0000:0000:0000",
"2fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" },
4212 {
"3800:0000:0000:0000:0000:0000:0000:0000",
"3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" } };
4218 if (UTHValidateDetectAddressHead(gh, 2, expectations))
4222 DetectAddressHeadFree(gh);
4227 static int AddressTestAddressGroupSetup44(
void)
4230 {
"3ffe:ffff:7654:feda:1245:ba98:0000:0000",
"3ffe:ffff:7654:feda:1245:ba98:ffff:ffff" }};
4236 if (UTHValidateDetectAddressHead(gh, 1, expectations))
4240 DetectAddressHeadFree(gh);
4245 static int AddressTestAddressGroupSetup45(
void)
4255 DetectAddressHeadFree(gh);
4260 static int AddressTestAddressGroupSetup46(
void)
4263 {
"0.0.0.0",
"192.167.255.255" },
4264 {
"192.168.1.0",
"192.168.1.255" },
4265 {
"192.168.3.0",
"192.168.3.255" },
4266 {
"192.169.0.0",
"255.255.255.255" } };
4270 int r =
DetectAddressParse(NULL, gh,
"[![192.168.0.0/16,![192.168.1.0/24,192.168.3.0/24]]]");
4272 if (UTHValidateDetectAddressHead(gh, 4, expectations))
4276 DetectAddressHeadFree(gh);
4282 static int AddressTestAddressGroupSetup47(
void)
4285 {
"0.0.0.0",
"192.167.255.255" },
4286 {
"192.168.1.0",
"192.168.1.255" },
4287 {
"192.168.3.0",
"192.168.3.255" },
4288 {
"192.168.5.0",
"192.168.5.255" },
4289 {
"192.169.0.0",
"255.255.255.255" } };
4293 int r =
DetectAddressParse(NULL, gh,
"[![192.168.0.0/16,![192.168.1.0/24,192.168.3.0/24],!192.168.5.0/24]]");
4295 if (UTHValidateDetectAddressHead(gh, 5, expectations))
4299 DetectAddressHeadFree(gh);
4305 static int AddressTestAddressGroupSetup48(
void)
4308 {
"192.168.0.0",
"192.168.0.255" },
4309 {
"192.168.2.0",
"192.168.2.255" },
4310 {
"192.168.4.0",
"192.168.4.255" },
4311 {
"192.168.6.0",
"192.168.255.255" } };
4315 int r =
DetectAddressParse(NULL, gh,
"[192.168.0.0/16,![192.168.1.0/24,192.168.3.0/24],!192.168.5.0/24]");
4317 if (UTHValidateDetectAddressHead(gh, 4, expectations))
4321 DetectAddressHeadFree(gh);
4326 static int AddressTestCutIPv401(
void)
4329 DetectAddress *a = DetectAddressParseSingle(
"1.2.3.0/255.255.255.0");
4331 DetectAddress *b = DetectAddressParseSingle(
"1.2.2.0-1.2.3.4");
4334 FAIL_IF(DetectAddressCut(NULL, a, b, &c) == -1);
4342 static int AddressTestCutIPv402(
void)
4345 a = DetectAddressParseSingle(
"1.2.3.0/255.255.255.0");
4346 b = DetectAddressParseSingle(
"1.2.2.0-1.2.3.4");
4348 if (DetectAddressCut(NULL, a, b, &c) == -1)
4366 static int AddressTestCutIPv403(
void)
4369 a = DetectAddressParseSingle(
"1.2.3.0/255.255.255.0");
4370 b = DetectAddressParseSingle(
"1.2.2.0-1.2.3.4");
4372 if (DetectAddressCut(NULL, a, b, &c) == -1)
4378 if (a->
ip.addr_data32[0] !=
SCNtohl(16908800) || a->
ip2.addr_data32[0] !=
SCNtohl(16909055))
4380 if (b->
ip.addr_data32[0] !=
SCNtohl(16909056) || b->
ip2.addr_data32[0] !=
SCNtohl(16909060))
4382 if (c->
ip.addr_data32[0] !=
SCNtohl(16909061) || c->
ip2.addr_data32[0] !=
SCNtohl(16909311))
4397 static int AddressTestCutIPv404(
void)
4400 a = DetectAddressParseSingle(
"1.2.3.3-1.2.3.6");
4401 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.5");
4403 if (DetectAddressCut(NULL, a, b, &c) == -1)
4409 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4411 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909061))
4413 if (c->
ip.addr_data32[0] !=
SCNtohl(16909062) || c->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4429 static int AddressTestCutIPv405(
void)
4432 a = DetectAddressParseSingle(
"1.2.3.3-1.2.3.6");
4433 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4435 if (DetectAddressCut(NULL, a, b, &c) == -1)
4441 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4443 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4445 if (c->
ip.addr_data32[0] !=
SCNtohl(16909063) || c->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4460 static int AddressTestCutIPv406(
void)
4463 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4464 b = DetectAddressParseSingle(
"1.2.3.3-1.2.3.6");
4466 if (DetectAddressCut(NULL, a, b, &c) == -1)
4472 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4474 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4476 if (c->
ip.addr_data32[0] !=
SCNtohl(16909063) || c->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4491 static int AddressTestCutIPv407(
void)
4494 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.6");
4495 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4497 if (DetectAddressCut(NULL, a, b, &c) == -1)
4503 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4505 if (b->
ip.addr_data32[0] !=
SCNtohl(16909063) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4520 static int AddressTestCutIPv408(
void)
4523 a = DetectAddressParseSingle(
"1.2.3.3-1.2.3.9");
4524 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4526 if (DetectAddressCut(NULL, a, b, &c) == -1)
4532 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4534 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4549 static int AddressTestCutIPv409(
void)
4552 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4553 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.6");
4555 if (DetectAddressCut(NULL, a, b, &c) == -1)
4561 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4563 if (b->
ip.addr_data32[0] !=
SCNtohl(16909063) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4578 static int AddressTestCutIPv410(
void)
4581 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4582 b = DetectAddressParseSingle(
"1.2.3.3-1.2.3.9");
4584 if (DetectAddressCut(NULL, a, b, &c) == -1)
4590 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4592 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4595 printf(
"ip %u ip2 %u ", (uint32_t)htonl(a->
ip.addr_data32[0]), (uint32_t)htonl(a->
ip2.addr_data32[0]));
4609 static int AddressTestParseInvalidMask01(
void)
4614 dd = DetectAddressParseSingle(
"192.168.2.0/33");
4622 static int AddressTestParseInvalidMask02(
void)
4627 dd = DetectAddressParseSingle(
"192.168.2.0/255.255.257.0");
4635 static int AddressTestParseInvalidMask03(
void)
4640 dd = DetectAddressParseSingle(
"192.168.2.0/blue");
4648 static int AddressConfVarsTest01(
void)
4650 static const char *dummy_conf_string =
4656 " address-groups:\n"
4658 " HOME_NET: \"any\"\n"
4660 " EXTERNAL_NET: \"!any\"\n"
4664 " HTTP_PORTS: \"any\"\n"
4666 " SHELLCODE_PORTS: \"!any\"\n"
4684 static int AddressConfVarsTest02(
void)
4686 static const char *dummy_conf_string =
4692 " address-groups:\n"
4694 " HOME_NET: \"any\"\n"
4696 " EXTERNAL_NET: \"any\"\n"
4700 " HTTP_PORTS: \"any\"\n"
4702 " SHELLCODE_PORTS: \"!any\"\n"
4720 static int AddressConfVarsTest03(
void)
4722 static const char *dummy_conf_string =
4728 " address-groups:\n"
4730 " HOME_NET: \"any\"\n"
4732 " EXTERNAL_NET: \"!$HOME_NET\"\n"
4736 " HTTP_PORTS: \"any\"\n"
4738 " SHELLCODE_PORTS: \"!$HTTP_PORTS\"\n"
4756 static int AddressConfVarsTest04(
void)
4758 static const char *dummy_conf_string =
4764 " address-groups:\n"
4766 " HOME_NET: \"any\"\n"
4768 " EXTERNAL_NET: \"$HOME_NET\"\n"
4772 " HTTP_PORTS: \"any\"\n"
4774 " SHELLCODE_PORTS: \"$HTTP_PORTS\"\n"
4792 static int AddressConfVarsTest05(
void)
4794 static const char *dummy_conf_string =
4800 " address-groups:\n"
4802 " HOME_NET: \"any\"\n"
4804 " EXTERNAL_NET: [192.168.0.1]\n"
4808 " HTTP_PORTS: \"any\"\n"
4810 " SHELLCODE_PORTS: [80]\n"
4831 static int AddressConfVarsTest06(
void)
4834 static const char *dummy_conf_string =
4840 " address-groups:\n"
4843 "\"[2002:0000:3238:DFE1:63:0000:0000:FEFB,2002:0000:3238:DFE1:63:0000:0000:FEFB,"
4844 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4845 "2004:0000:3238:DFE1:63:0000:0000:FEFB,2005:0000:3238:DFE1:63:0000:0000:FEFB,"
4846 "2006:0000:3238:DFE1:63:0000:0000:FEFB,2007:0000:3238:DFE1:63:0000:0000:FEFB,"
4847 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4848 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4849 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4850 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4851 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4852 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4853 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4854 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4855 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4856 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4857 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4858 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4859 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4860 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4861 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4862 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4863 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4864 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4865 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4866 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4867 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4868 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4869 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4870 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4871 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4872 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4873 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4874 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4875 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4876 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4877 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4878 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4879 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4880 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4881 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4882 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4883 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4884 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4885 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4886 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4887 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4888 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4889 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4890 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4891 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4892 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4893 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4894 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4895 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4896 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4897 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4898 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4899 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4900 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4901 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4902 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4903 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4904 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4905 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4906 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4907 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4908 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4909 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4910 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4911 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4912 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4913 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4914 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4915 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4916 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4917 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4918 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4919 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4920 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4921 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4922 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4923 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4924 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4925 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4926 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4927 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4928 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4929 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4930 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4931 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4932 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4933 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4934 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4935 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4936 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4937 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4938 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4939 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4940 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4941 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4942 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4943 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4944 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4945 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4946 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4947 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4948 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4949 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4950 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4951 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4952 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4953 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4954 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4955 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4956 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4957 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4958 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4959 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4960 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4961 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4962 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4963 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4964 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4965 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4966 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4967 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4968 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4969 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4970 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4971 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4972 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4973 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4974 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4975 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4976 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4977 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB]\"\n"
4979 " EXTERNAL_NET: \"any\"\n"
5006 UtRegisterTest(
"AddressTestParse04bug5081", AddressTestParse04bug5081);
5070 AddressTestAddressGroupSetup01);
5072 AddressTestAddressGroupSetup02);
5074 AddressTestAddressGroupSetup03);
5076 AddressTestAddressGroupSetup04);
5078 AddressTestAddressGroupSetup05);
5080 AddressTestAddressGroupSetup06);
5082 AddressTestAddressGroupSetup07);
5084 AddressTestAddressGroupSetup08);
5086 AddressTestAddressGroupSetup09);
5088 AddressTestAddressGroupSetup10);
5090 AddressTestAddressGroupSetup11);
5092 AddressTestAddressGroupSetup12);
5094 AddressTestAddressGroupSetup13);
5096 AddressTestAddressGroupSetupIPv414);
5098 AddressTestAddressGroupSetupIPv415);
5100 AddressTestAddressGroupSetupIPv416);
5103 AddressTestAddressGroupSetup14);
5105 AddressTestAddressGroupSetup15);
5107 AddressTestAddressGroupSetup16);
5109 AddressTestAddressGroupSetup17);
5111 AddressTestAddressGroupSetup18);
5113 AddressTestAddressGroupSetup19);
5115 AddressTestAddressGroupSetup20);
5117 AddressTestAddressGroupSetup21);
5119 AddressTestAddressGroupSetup22);
5121 AddressTestAddressGroupSetup23);
5123 AddressTestAddressGroupSetup24);
5125 AddressTestAddressGroupSetup25);
5127 AddressTestAddressGroupSetup26);
5130 AddressTestAddressGroupSetup27);
5132 AddressTestAddressGroupSetup28);
5134 AddressTestAddressGroupSetup29);
5136 AddressTestAddressGroupSetup30);
5138 AddressTestAddressGroupSetup31);
5140 AddressTestAddressGroupSetup32);
5142 AddressTestAddressGroupSetup33);
5144 AddressTestAddressGroupSetup34);
5146 AddressTestAddressGroupSetup35);
5148 AddressTestAddressGroupSetup36);
5150 AddressTestAddressGroupSetup37);
5152 AddressTestAddressGroupSetup38);
5154 AddressTestAddressGroupSetup39);
5156 AddressTestAddressGroupSetup40);
5158 AddressTestAddressGroupSetup41);
5160 AddressTestAddressGroupSetup42);
5162 AddressTestAddressGroupSetup43);
5164 AddressTestAddressGroupSetup44);
5166 AddressTestAddressGroupSetup45);
5168 AddressTestAddressGroupSetup46);
5170 AddressTestAddressGroupSetup47);
5172 AddressTestAddressGroupSetup48);
5186 AddressTestParseInvalidMask01);
5188 AddressTestParseInvalidMask02);
5190 AddressTestParseInvalidMask03);