52 #define DetectAddressPrint(...)
58 DetectAddressHead *ghn,
const char *s,
int negate, ResolvedVariablesList *var_list,
187 if (newhead->
ip.
family == AF_INET) {
189 }
else if (newhead->
ip.
family == AF_INET6) {
214 if (new->ip.family == AF_INET)
216 else if (new->ip.family == AF_INET6)
247 head = GetHeadPtr(gh,
new);
253 for (cur =
head; cur != NULL; cur = cur->
next) {
269 if (cur->
next == NULL) {
278 if (cur->
prev != NULL)
288 if (SetHeadPtr(gh,
head) < 0)
297 r = DetectAddressCut(
de_ctx, cur,
new, &c);
301 DetectAddressInsert(
de_ctx, gh,
new);
303 DetectAddressInsert(
de_ctx, gh, c);
308 r = DetectAddressCut(
de_ctx, cur,
new, &c);
312 DetectAddressInsert(
de_ctx, gh,
new);
314 DetectAddressInsert(
de_ctx, gh, c);
319 r = DetectAddressCut(
de_ctx, cur,
new, &c);
323 DetectAddressInsert(
de_ctx, gh,
new);
325 DetectAddressInsert(
de_ctx, gh, c);
330 r = DetectAddressCut(
de_ctx, cur,
new,&c);
334 DetectAddressInsert(
de_ctx, gh,
new);
336 DetectAddressInsert(
de_ctx, gh, c);
345 if (SetHeadPtr(gh,
head) < 0) {
373 while (item != NULL && it != NULL) {
383 if (!(item == NULL && it == NULL)) {
427 if ((strchr(
str,
':')) == NULL) {
433 if ((mask = strchr(ip,
'/')) != NULL) {
435 ip[mask - ip] =
'\0';
437 uint32_t ip4addr = 0;
438 uint32_t netmask = 0;
440 if ((strchr (mask,
'.')) == NULL) {
443 for (
size_t u = 0; u < strlen(mask); u++) {
444 if(!isdigit((
unsigned char)mask[u]))
454 r = inet_pton(AF_INET, mask, &in);
464 "netmask \"%s\" is not usable. Only netmasks that are compatible with "
465 "CIDR notation are supported. See #5168.",
471 r = inet_pton(AF_INET, ip, &in);
477 dd->
ip.addr_data32[0] = dd->
ip2.addr_data32[0] = ip4addr & netmask;
478 dd->
ip2.addr_data32[0] |=~ netmask;
479 }
else if ((ip2 = strchr(ip,
'-')) != NULL) {
484 r = inet_pton(AF_INET, ip, &in);
487 dd->
ip.addr_data32[0] = in.s_addr;
489 r = inet_pton(AF_INET, ip2, &in);
492 dd->
ip2.addr_data32[0] = in.s_addr;
499 r = inet_pton(AF_INET, ip, &in);
503 dd->
ip.addr_data32[0] = in.s_addr;
504 dd->
ip2.addr_data32[0] = in.s_addr;
508 struct in6_addr in6, mask6;
509 uint32_t ip6addr[4], netmask[4];
513 if ((mask = strchr(ip,
'/')) != NULL) {
514 ip[mask - ip] =
'\0';
521 r = inet_pton(AF_INET6, ip, &in6);
524 memcpy(&ip6addr, &in6.s6_addr,
sizeof(ip6addr));
527 memcpy(&netmask, &mask6.s6_addr,
sizeof(netmask));
529 dd->
ip2.addr_data32[0] = dd->
ip.addr_data32[0] = ip6addr[0] & netmask[0];
530 dd->
ip2.addr_data32[1] = dd->
ip.addr_data32[1] = ip6addr[1] & netmask[1];
531 dd->
ip2.addr_data32[2] = dd->
ip.addr_data32[2] = ip6addr[2] & netmask[2];
532 dd->
ip2.addr_data32[3] = dd->
ip.addr_data32[3] = ip6addr[3] & netmask[3];
534 dd->
ip2.addr_data32[0] |=~ netmask[0];
535 dd->
ip2.addr_data32[1] |=~ netmask[1];
536 dd->
ip2.addr_data32[2] |=~ netmask[2];
537 dd->
ip2.addr_data32[3] |=~ netmask[3];
538 }
else if ((ip2 = strchr(ip,
'-')) != NULL) {
543 r = inet_pton(AF_INET6, ip, &in6);
546 memcpy(&dd->
ip.
address, &in6.s6_addr,
sizeof(ip6addr));
548 r = inet_pton(AF_INET6, ip2, &in6);
551 memcpy(&dd->
ip2.
address, &in6.s6_addr,
sizeof(ip6addr));
557 r = inet_pton(AF_INET6, ip, &in6);
593 if (DetectAddressParseString(dd,
str) < 0) {
618 while (*s !=
'\0' && isspace(*s))
621 if (strcasecmp(s,
"any") == 0) {
622 SCLogDebug(
"adding 0.0.0.0/0 and ::/0 as we\'re handling \'any\'");
630 if (DetectAddressInsert(NULL, gh, ad) < 0) {
636 ad = DetectAddressParseSingle(
"::/0");
642 if (DetectAddressInsert(NULL, gh, ad) < 0) {
654 "failed to parse address \"%s\"", s);
662 if (DetectAddressCutNot(ad, &ad2) < 0) {
671 if (DetectAddressInsert(NULL, gh, ad2) < 0) {
680 int r = DetectAddressInsert(NULL, gh, ad);
717 DetectAddressHead *ghn,
const char *s,
int negate, ResolvedVariablesList *var_list,
718 int recur,
char *
address,
size_t address_length)
722 int o_set = 0, n_set = 0, d_set = 0;
724 const char *rule_var_address = NULL;
725 char *temp_rule_var_address = NULL;
729 "limit reached (max 64)");
733 SCLogDebug(
"s %s negate %s", s, negate ?
"true" :
"false");
735 size_t size = strlen(s);
736 for (u = 0, x = 0; u < size && x < address_length; u++) {
737 if (x == (address_length - 1)) {
739 "Hit the address buffer"
740 " limit for the supplied address. Invalidating sig. "
741 "Please file a bug report on this.");
747 if (!o_set && s[u] ==
'!') {
750 }
else if (s[u] ==
'[') {
756 }
else if (s[u] ==
']') {
761 if (((negate + n_set) % 2) == 0) {
765 if (DetectAddressParse2(
de_ctx, gh, ghn,
address, (negate + n_set) % 2, var_list, recur) < 0)
778 if (DetectAddressParse2(
de_ctx, &tmp_gh, &tmp_ghn,
address, 0, var_list, recur) < 0) {
788 for (tmp_ad = tmp_gh.
ipv4_head; tmp_ad; tmp_ad = tmp_ad->
next) {
792 for (tmp_ad = tmp_ghn.
ipv4_head; tmp_ad; tmp_ad = tmp_ad->
next) {
796 for (tmp_ad = tmp_gh.
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
800 for (tmp_ad = tmp_ghn.
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
814 for (tmp_ad = tmp_gh.
ipv4_head; tmp_ad; tmp_ad = tmp_ad->
next) {
817 if (tmp_ad2 == NULL) {
823 DetectAddressInsert(NULL, ghn, tmp_ad2);
827 for (tmp_ad = tmp_gh.
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
830 if (tmp_ad2 == NULL) {
836 DetectAddressInsert(NULL, ghn, tmp_ad2);
844 }
else if (depth == 0 && s[u] ==
',') {
847 }
else if (d_set == 1) {
852 if (rule_var_address == NULL)
855 if (strlen(rule_var_address) == 0) {
857 "to nothing. This is likely a misconfiguration. "
858 "Note that a negated address needs to be quoted, "
859 "\"!$HOME_NET\" instead of !$HOME_NET. See issue #295.", s);
863 SCLogDebug(
"rule_var_address %s", rule_var_address);
864 if ((negate + n_set) % 2) {
865 temp_rule_var_address =
SCMalloc(strlen(rule_var_address) + 3);
866 if (
unlikely(temp_rule_var_address == NULL))
868 snprintf(temp_rule_var_address, strlen(rule_var_address) + 3,
869 "[%s]", rule_var_address);
871 temp_rule_var_address =
SCStrdup(rule_var_address);
872 if (
unlikely(temp_rule_var_address == NULL))
876 if (DetectAddressParse2(
de_ctx, gh, ghn, temp_rule_var_address,
877 (negate + n_set) % 2, var_list, recur) < 0) {
878 if (temp_rule_var_address != rule_var_address)
879 SCFree(temp_rule_var_address);
884 SCFree(temp_rule_var_address);
888 if (!((negate + n_set) % 2)) {
890 if (DetectAddressSetup(gh,
address) < 0)
894 if (DetectAddressSetup(ghn,
address) < 0)
900 }
else if (depth == 0 && s[u] ==
'$') {
902 }
else if (depth == 0 && u == size - 1) {
903 if (x == address_length) {
912 "groups declaration. This is likely a misconfiguration.");
919 if (rule_var_address == NULL)
922 if (strlen(rule_var_address) == 0) {
924 "to nothing. This is likely a misconfiguration. "
925 "Note that a negated address needs to be quoted, "
926 "\"!$HOME_NET\" instead of !$HOME_NET. See issue #295.", s);
930 SCLogDebug(
"rule_var_address %s", rule_var_address);
931 if ((negate + n_set) % 2) {
932 temp_rule_var_address =
SCMalloc(strlen(rule_var_address) + 3);
933 if (
unlikely(temp_rule_var_address == NULL))
935 snprintf(temp_rule_var_address, strlen(rule_var_address) + 3,
936 "[%s]", rule_var_address);
938 temp_rule_var_address =
SCStrdup(rule_var_address);
939 if (
unlikely(temp_rule_var_address == NULL))
943 if (DetectAddressParse2(
de_ctx, gh, ghn, temp_rule_var_address,
944 (negate + n_set) % 2, var_list, recur) < 0) {
946 if (temp_rule_var_address != rule_var_address)
947 SCFree(temp_rule_var_address);
951 SCFree(temp_rule_var_address);
953 if (!((negate + n_set) % 2)) {
955 if (DetectAddressSetup(gh,
address) < 0) {
961 if (DetectAddressSetup(ghn,
address) < 0) {
972 "properly closed in \"%s\", %d missing closing brackets (]). "
973 "Note: problem might be in a variable.", s, depth);
975 }
else if (depth < 0) {
977 "properly opened in \"%s\", %d missing opening brackets ([). "
978 "Note: problem might be in a variable.", s, depth*-1);
996 DetectAddressHead *ghn,
const char *s,
int negate, ResolvedVariablesList *var_list,
1000 #define MAX_ADDRESS_LENGTH 8192
1002 size_t address_length = strlen(s);
1007 " memory for address parsing.");
1010 rc = DetectAddressParseInternal(
1011 de_ctx, gh, ghn, s, negate, var_list, recur,
address, address_length);
1015 rc = DetectAddressParseInternal(
1062 if (DetectAddressIsCompleteIPSpace(ghn) == 1) {
1064 "Rule address range is NIL. Probably have a !any or "
1065 "an address range that supplies a NULL address range");
1072 r = DetectAddressSetup(gh,
"0.0.0.0/0");
1074 SCLogDebug(
"DetectAddressSetup for 0.0.0.0/0 failed");
1080 r = DetectAddressSetup(gh,
"::/0");
1082 SCLogDebug(
"DetectAddressSetup for ::/0 failed");
1097 r = DetectAddressInsert(NULL, gh, ad);
1113 r = DetectAddressInsert(NULL, gh, ad);
1121 for (tmp_ad = gh->
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
1125 int ipv4_applied = 0;
1126 int ipv6_applied = 0;
1134 for (ag2 = gh->
ipv4_head; ag2 != NULL; ) {
1141 if (ag2->
prev == NULL)
1146 if (ag2->
next != NULL)
1166 for (ag2 = gh->
ipv6_head; ag2 != NULL; ) {
1169 if (ag2->
prev == NULL)
1174 if (ag2->
next != NULL)
1193 for (tmp_ad = gh->
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
1196 for (tmp_ad = ghn->
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
1205 if (ipv4_applied != cnt) {
1207 "could be applied: %d != %d", cnt, ipv4_applied);
1215 if (ipv6_applied != cnt) {
1217 "could be applied: %d != %d", cnt, ipv6_applied);
1225 "merging addresses and negated addresses");
1237 SCLogDebug(
"Testing address conf vars for any misconfigured values");
1242 if (address_vars_node == NULL) {
1253 gh = DetectAddressHeadInit();
1257 ghn = DetectAddressHeadInit();
1262 if (seq_node->
val == NULL) {
1264 "Address var \"%s\" probably has a sequence(something "
1265 "in brackets) value set without any quotes. Please "
1266 "quote it using \"..\".", seq_node->
name);
1270 int r = DetectAddressParse2(
1271 NULL, gh, ghn, seq_node->
val, 0, &var_list, 0);
1277 "failed to parse address var \"%s\" with value \"%s\". "
1278 "Please check its syntax",
1279 seq_node->
name, seq_node->
val);
1283 if (DetectAddressIsCompleteIPSpace(ghn)) {
1285 "address var - \"%s\" has the complete IP space negated "
1286 "with its value \"%s\". Rule address range is NIL. "
1287 "Probably have a !any or an address range that supplies "
1288 "a NULL address range",
1289 seq_node->
name, seq_node->
val);
1293 DetectAddressHeadFree(gh);
1295 DetectAddressHeadFree(ghn);
1302 DetectAddressHeadFree(gh);
1304 DetectAddressHeadFree(ghn);
1316 static uint32_t DetectAddressMapHashFunc(
HashListTable *ht,
void *data, uint16_t datalen)
1327 static char DetectAddressMapCompareFunc(
void *data1, uint16_t len1,
void *data2,
1338 static void DetectAddressMapFreeFunc(
void *data)
1342 DetectAddressHeadFree(map->
address);
1351 DetectAddressMapCompareFunc,
1352 DetectAddressMapFreeFunc);
1377 if (map->
string == NULL) {
1418 SCLogDebug(
"DetectAddressParse can not be run with NULL address");
1424 SCLogDebug(
"DetectAddressHeadInit for ghn failed");
1428 int r = DetectAddressParse2(
de_ctx, gh, ghn,
str, 0, NULL, 0);
1430 SCLogDebug(
"DetectAddressParse2 returned %d", r);
1431 DetectAddressHeadFree(ghn);
1443 DetectAddressHeadFree(ghn);
1448 DetectAddressHeadFree(ghn);
1449 return contains_negation ? 1 : 0;
1453 const char *
string,
bool *contains_negation)
1458 *contains_negation =
res->contains_negation;
1459 return res->address;
1470 DetectAddressHeadFree(
head);
1472 }
else if (r == 1) {
1473 *contains_negation =
true;
1475 *contains_negation =
false;
1479 *contains_negation);
1495 DetectAddressCleanupList(gh->
ipv4_head);
1499 DetectAddressCleanupList(gh->
ipv6_head);
1607 uint16_t addrs_cnt,
const Address *a)
1611 if (addrs == NULL || addrs_cnt == 0) {
1615 uint32_t match_addr =
SCNtohl(a->addr_data32[0]);
1616 for (uint16_t idx = 0; idx < addrs_cnt; idx++) {
1617 if (match_addr >= addrs[idx].ip && match_addr <= addrs[idx].ip2) {
1640 uint16_t addrs_cnt,
const Address *a)
1644 if (addrs == NULL || addrs_cnt == 0) {
1648 uint32_t match_addr[4];
1649 match_addr[0] =
SCNtohl(a->addr_data32[0]);
1650 match_addr[1] =
SCNtohl(a->addr_data32[1]);
1651 match_addr[2] =
SCNtohl(a->addr_data32[2]);
1652 match_addr[3] =
SCNtohl(a->addr_data32[3]);
1657 for (uint16_t idx = 0; idx < addrs_cnt; idx++) {
1658 uint16_t result1 = 0, result2 = 0;
1661 if (0 == memcmp(match_addr, addrs[idx].ip,
sizeof(match_addr))) {
1664 if (0 == memcmp(match_addr, addrs[idx].ip2,
sizeof(match_addr))) {
1671 for (
int i = 0; i < 4; i++) {
1672 if (match_addr[i] > addrs[idx].ip[i]) {
1676 if (match_addr[i] < addrs[idx].ip[i]) {
1689 for (
int i = 0; i < 4; i++) {
1690 if (match_addr[i] < addrs[idx].ip2[i]) {
1694 if (match_addr[i] > addrs[idx].ip2[i]) {
1703 if (result1 == 1 && result2 == 1)
1759 SCLogDebug(
"What other address type can we have :-/");
1782 char ip[16], mask[16];
1784 memcpy(&in, &gr->
ip.addr_data32[0],
sizeof(in));
1785 PrintInet(AF_INET, &in, ip,
sizeof(ip));
1786 memcpy(&in, &gr->
ip2.addr_data32[0],
sizeof(in));
1787 PrintInet(AF_INET, &in, mask,
sizeof(mask));
1791 }
else if (gr->
ip.
family == AF_INET6) {
1792 struct in6_addr in6;
1793 char ip[66], mask[66];
1795 memcpy(&in6, &gr->
ip.addr_data32,
sizeof(in6));
1796 PrintInet(AF_INET6, &in6, ip,
sizeof(ip));
1797 memcpy(&in6, &gr->
ip2.addr_data32,
sizeof(in6));
1798 PrintInet(AF_INET6, &in6, mask,
sizeof(mask));
1828 if (a->
family == AF_INET) {
1831 }
else if (a->
family == AF_INET6) {
1836 for ( ; g != NULL; g = g->
next) {
1837 if (DetectAddressMatch(g,a) == 1) {
1849 static int UTHValidateDetectAddress(
DetectAddress *ad,
const char *one,
const char *two)
1851 char str1[46] =
"", str2[46] =
"";
1858 PrintInet(AF_INET, (
const void *)&ad->
ip.addr_data32[0], str1,
sizeof(str1));
1860 PrintInet(AF_INET, (
const void *)&ad->
ip2.addr_data32[0], str2,
sizeof(str2));
1863 if (strcmp(str1, one) != 0) {
1868 if (strcmp(str2, two) != 0) {
1877 PrintInet(AF_INET6, (
const void *)&ad->
ip.addr_data32[0], str1,
sizeof(str1));
1879 PrintInet(AF_INET6, (
const void *)&ad->
ip2.addr_data32[0], str2,
sizeof(str2));
1882 if (strcmp(str1, one) != 0) {
1887 if (strcmp(str2, two) != 0) {
1906 int expect = nranges;
1916 while (have < expect) {
1918 printf(
"bad head: have %d ranges, expected %d: ", have, expect);
1922 if (UTHValidateDetectAddress(ad, expectations[have].one, expectations[have].two) ==
FALSE)
1932 static int AddressTestParse01(
void)
1944 static int AddressTestParse02(
void)
1950 if (dd->
ip2.addr_data32[0] !=
SCNtohl(16909060) ||
1951 dd->
ip.addr_data32[0] !=
SCNtohl(16909060)) {
1955 printf(
"ip %"PRIu32
", ip2 %"PRIu32
"\n", dd->
ip.addr_data32[0], dd->
ip2.addr_data32[0]);
1963 static int AddressTestParse03(
void)
1965 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4/255.255.255.0");
1975 static int AddressTestParse04(
void)
1977 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4/255.255.255.0");
1980 char left[16], right[16];
1981 PrintInet(AF_INET, (
const void *)&dd->
ip.addr_data32[0], left,
sizeof(left));
1982 PrintInet(AF_INET, (
const void *)&dd->
ip2.addr_data32[0], right,
sizeof(right));
1994 static int AddressTestParse04bug5081(
void)
1996 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.64/26");
1999 char left[16], right[16];
2000 PrintInet(AF_INET, (
const void *)&dd->
ip.addr_data32[0], left,
sizeof(left));
2001 PrintInet(AF_INET, (
const void *)&dd->
ip2.addr_data32[0], right,
sizeof(right));
2010 static int AddressTestParse05(
void)
2022 static int AddressTestParse06(
void)
2028 if (dd->
ip2.addr_data32[0] !=
SCNtohl(16909311) ||
2029 dd->
ip.addr_data32[0] !=
SCNtohl(16909056)) {
2040 static int AddressTestParse07(
void)
2052 static int AddressTestParse08(
void)
2058 if (dd->
ip.addr_data32[0] !=
SCNtohl(536870912) || dd->
ip.addr_data32[1] != 0x00000000 ||
2059 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2061 dd->
ip2.addr_data32[0] !=
SCNtohl(1073741823) || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2062 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2074 static int AddressTestParse09(
void)
2076 DetectAddress *dd = DetectAddressParseSingle(
"2001::1/128");
2086 static int AddressTestParse10(
void)
2092 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2093 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2095 dd->
ip2.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip2.addr_data32[1] != 0x00000000 ||
2096 dd->
ip2.addr_data32[2] != 0x00000000 || dd->
ip2.addr_data32[3] != 0x00000000) {
2108 static int AddressTestParse11(
void)
2120 static int AddressTestParse12(
void)
2126 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2127 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2130 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2141 static int AddressTestParse13(
void)
2153 static int AddressTestParse14(
void)
2159 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2160 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2162 dd->
ip2.addr_data32[0] !=
SCNtohl(537001983) || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2163 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2174 static int AddressTestParse15(
void)
2186 static int AddressTestParse16(
void)
2192 if (dd->
ip.addr_data32[0] != 0x00000000 || dd->
ip.addr_data32[1] != 0x00000000 ||
2193 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2195 dd->
ip2.addr_data32[0] != 0xFFFFFFFF || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2196 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2207 static int AddressTestParse17(
void)
2209 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4-1.2.3.6");
2219 static int AddressTestParse18(
void)
2222 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4-1.2.3.6");
2225 if (dd->
ip2.addr_data32[0] !=
SCNtohl(16909062) ||
2226 dd->
ip.addr_data32[0] !=
SCNtohl(16909060)) {
2237 static int AddressTestParse19(
void)
2239 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.6-1.2.3.4");
2249 static int AddressTestParse20(
void)
2251 DetectAddress *dd = DetectAddressParseSingle(
"2001::1-2001::4");
2261 static int AddressTestParse21(
void)
2264 DetectAddress *dd = DetectAddressParseSingle(
"2001::1-2001::4");
2267 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2268 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] !=
SCNtohl(1) ||
2270 dd->
ip2.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip2.addr_data32[1] != 0x00000000 ||
2271 dd->
ip2.addr_data32[2] != 0x00000000 || dd->
ip2.addr_data32[3] !=
SCNtohl(4)) {
2282 static int AddressTestParse22(
void)
2284 DetectAddress *dd = DetectAddressParseSingle(
"2001::4-2001::1");
2294 static int AddressTestParse23(
void)
2300 DetectAddressHeadFree(gh);
2304 static int AddressTestParse24(
void)
2310 DetectAddressHeadFree(gh);
2314 static int AddressTestParse25(
void)
2320 DetectAddressHeadFree(gh);
2325 static int AddressTestParse26(
void)
2331 "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["
2333 "]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]"
2336 DetectAddressHeadFree(gh);
2337 gh = DetectAddressHeadInit();
2341 "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["
2343 "]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]"
2346 DetectAddressHeadFree(gh);
2350 static int AddressTestParse27(
void)
2352 DetectAddress *dd = DetectAddressParseSingle(
"!192.168.0.1");
2362 static int AddressTestParse28(
void)
2369 dd->
ip.addr_data32[0] ==
SCNtohl(16909060)) {
2380 static int AddressTestParse29(
void)
2382 DetectAddress *dd = DetectAddressParseSingle(
"!1.2.3.0/24");
2392 static int AddressTestParse30(
void)
2395 DetectAddress *dd = DetectAddressParseSingle(
"!1.2.3.4/24");
2399 dd->
ip.addr_data32[0] ==
SCNtohl(16909056) &&
2400 dd->
ip2.addr_data32[0] ==
SCNtohl(16909311)) {
2414 static int AddressTestParse31(
void)
2426 static int AddressTestParse32(
void)
2438 static int AddressTestParse33(
void)
2445 dd->
ip.addr_data32[0] ==
SCNtohl(536936448) && dd->
ip.addr_data32[1] == 0x00000000 &&
2446 dd->
ip.addr_data32[2] == 0x00000000 && dd->
ip.addr_data32[3] ==
SCNtohl(1)) {
2457 static int AddressTestParse34(
void)
2469 static int AddressTestParse35(
void)
2476 dd->
ip.addr_data32[0] ==
SCNtohl(536936448) && dd->
ip.addr_data32[1] == 0x00000000 &&
2477 dd->
ip.addr_data32[2] == 0x00000000 && dd->
ip.addr_data32[3] == 0x00000000 &&
2479 dd->
ip2.addr_data32[0] ==
SCNtohl(537001983) && dd->
ip2.addr_data32[1] == 0xFFFFFFFF &&
2480 dd->
ip2.addr_data32[2] == 0xFFFFFFFF && dd->
ip2.addr_data32[3] == 0xFFFFFFFF) {
2491 static int AddressTestParse36(
void)
2497 if (dd->
ip.addr_data32[0] !=
SCNtohl(0xFFFF0000) || dd->
ip.addr_data32[1] != 0x00000000 ||
2498 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2500 dd->
ip2.addr_data32[0] != 0xFFFFFFFF || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2501 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2515 static int AddressTestParse37(
void)
2521 if (dd->
ip.addr_data32[0] != 0x00000000 || dd->
ip.addr_data32[1] != 0x00000000 ||
2522 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2524 dd->
ip2.addr_data32[0] != 0xFFFFFFFF || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2525 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2538 static int AddressTestMatch01(
void)
2545 if (inet_pton(AF_INET,
"1.2.3.4", &in) != 1)
2547 memset(&a, 0,
sizeof(
Address));
2549 a.addr_data32[0] = in.s_addr;
2551 dd = DetectAddressParseSingle(
"1.2.3.4/24");
2553 if (DetectAddressMatch(dd, &a) == 0)
2563 static int AddressTestMatch02(
void)
2570 if (inet_pton(AF_INET,
"1.2.3.127", &in) != 1)
2572 memset(&a, 0,
sizeof(
Address));
2574 a.addr_data32[0] = in.s_addr;
2576 dd = DetectAddressParseSingle(
"1.2.3.4/25");
2578 if (DetectAddressMatch(dd, &a) == 0)
2588 static int AddressTestMatch03(
void)
2595 if (inet_pton(AF_INET,
"1.2.3.128", &in) != 1)
2597 memset(&a, 0,
sizeof(
Address));
2599 a.addr_data32[0] = in.s_addr;
2601 dd = DetectAddressParseSingle(
"1.2.3.4/25");
2603 if (DetectAddressMatch(dd, &a) == 1)
2613 static int AddressTestMatch04(
void)
2620 if (inet_pton(AF_INET,
"1.2.2.255", &in) != 1)
2622 memset(&a, 0,
sizeof(
Address));
2624 a.addr_data32[0] = in.s_addr;
2626 dd = DetectAddressParseSingle(
"1.2.3.4/25");
2628 if (DetectAddressMatch(dd, &a) == 1)
2638 static int AddressTestMatch05(
void)
2645 if (inet_pton(AF_INET,
"1.2.3.4", &in) != 1)
2647 memset(&a, 0,
sizeof(
Address));
2649 a.addr_data32[0] = in.s_addr;
2651 dd = DetectAddressParseSingle(
"1.2.3.4/32");
2653 if (DetectAddressMatch(dd, &a) == 0)
2663 static int AddressTestMatch06(
void)
2670 if (inet_pton(AF_INET,
"1.2.3.4", &in) != 1)
2672 memset(&a, 0,
sizeof(
Address));
2674 a.addr_data32[0] = in.s_addr;
2676 dd = DetectAddressParseSingle(
"0.0.0.0/0.0.0.0");
2678 if (DetectAddressMatch(dd, &a) == 0)
2688 static int AddressTestMatch07(
void)
2692 struct in6_addr in6;
2695 if (inet_pton(AF_INET6,
"2001::1", &in6) != 1)
2697 memset(&a, 0,
sizeof(
Address));
2698 a.family = AF_INET6;
2699 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2701 dd = DetectAddressParseSingle(
"2001::/3");
2703 if (DetectAddressMatch(dd, &a) == 0)
2713 static int AddressTestMatch08(
void)
2717 struct in6_addr in6;
2720 if (inet_pton(AF_INET6,
"1999:ffff:ffff:ffff:ffff:ffff:ffff:ffff", &in6) != 1)
2722 memset(&a, 0,
sizeof(
Address));
2723 a.family = AF_INET6;
2724 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2726 dd = DetectAddressParseSingle(
"2001::/3");
2728 if (DetectAddressMatch(dd, &a) == 1)
2738 static int AddressTestMatch09(
void)
2742 struct in6_addr in6;
2745 if (inet_pton(AF_INET6,
"2001::2", &in6) != 1)
2747 memset(&a, 0,
sizeof(
Address));
2748 a.family = AF_INET6;
2749 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2751 dd = DetectAddressParseSingle(
"2001::1/128");
2753 if (DetectAddressMatch(dd, &a) == 1)
2763 static int AddressTestMatch10(
void)
2767 struct in6_addr in6;
2770 if (inet_pton(AF_INET6,
"2001::2", &in6) != 1)
2772 memset(&a, 0,
sizeof(
Address));
2773 a.family = AF_INET6;
2774 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2776 dd = DetectAddressParseSingle(
"2001::1/126");
2778 if (DetectAddressMatch(dd, &a) == 0)
2788 static int AddressTestMatch11(
void)
2792 struct in6_addr in6;
2795 if (inet_pton(AF_INET6,
"2001::3", &in6) != 1)
2797 memset(&a, 0,
sizeof(
Address));
2798 a.family = AF_INET6;
2799 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2801 dd = DetectAddressParseSingle(
"2001::1/127");
2803 if (DetectAddressMatch(dd, &a) == 1)
2813 static int AddressTestCmp01(
void)
2818 da = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2819 if (da == NULL)
goto error;
2820 db = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2821 if (db == NULL)
goto error;
2836 static int AddressTestCmp02(
void)
2841 da = DetectAddressParseSingle(
"192.168.0.0/255.255.0.0");
2842 if (da == NULL)
goto error;
2843 db = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2844 if (db == NULL)
goto error;
2859 static int AddressTestCmp03(
void)
2864 da = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2865 if (da == NULL)
goto error;
2866 db = DetectAddressParseSingle(
"192.168.0.0/255.255.0.0");
2867 if (db == NULL)
goto error;
2882 static int AddressTestCmp04(
void)
2887 da = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2888 if (da == NULL)
goto error;
2889 db = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2890 if (db == NULL)
goto error;
2905 static int AddressTestCmp05(
void)
2910 da = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2911 if (da == NULL)
goto error;
2912 db = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2913 if (db == NULL)
goto error;
2928 static int AddressTestCmp06(
void)
2933 da = DetectAddressParseSingle(
"192.168.1.0/255.255.0.0");
2934 if (da == NULL)
goto error;
2935 db = DetectAddressParseSingle(
"192.168.0.0/255.255.0.0");
2936 if (db == NULL)
goto error;
2951 static int AddressTestCmpIPv407(
void)
2956 da = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2957 if (da == NULL)
goto error;
2958 db = DetectAddressParseSingle(
"192.168.1.128-192.168.2.128");
2959 if (db == NULL)
goto error;
2974 static int AddressTestCmpIPv408(
void)
2979 da = DetectAddressParseSingle(
"192.168.1.128-192.168.2.128");
2980 if (da == NULL)
goto error;
2981 db = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2982 if (db == NULL)
goto error;
2997 static int AddressTestCmp07(
void)
3002 da = DetectAddressParseSingle(
"2001::/3");
3003 if (da == NULL)
goto error;
3004 db = DetectAddressParseSingle(
"2001::1/3");
3005 if (db == NULL)
goto error;
3020 static int AddressTestCmp08(
void)
3025 da = DetectAddressParseSingle(
"2001::/3");
3026 if (da == NULL)
goto error;
3027 db = DetectAddressParseSingle(
"2001::/8");
3028 if (db == NULL)
goto error;
3043 static int AddressTestCmp09(
void)
3048 da = DetectAddressParseSingle(
"2001::/8");
3049 if (da == NULL)
goto error;
3050 db = DetectAddressParseSingle(
"2001::/3");
3051 if (db == NULL)
goto error;
3066 static int AddressTestCmp10(
void)
3071 da = DetectAddressParseSingle(
"2001:1:2:3:0:0:0:0/64");
3072 if (da == NULL)
goto error;
3073 db = DetectAddressParseSingle(
"2001:1:2:4:0:0:0:0/64");
3074 if (db == NULL)
goto error;
3089 static int AddressTestCmp11(
void)
3094 da = DetectAddressParseSingle(
"2001:1:2:4:0:0:0:0/64");
3095 if (da == NULL)
goto error;
3096 db = DetectAddressParseSingle(
"2001:1:2:3:0:0:0:0/64");
3097 if (db == NULL)
goto error;
3112 static int AddressTestCmp12(
void)
3117 da = DetectAddressParseSingle(
"2001:1:2:3:1:0:0:0/64");
3118 if (da == NULL)
goto error;
3119 db = DetectAddressParseSingle(
"2001:1:2:3:2:0:0:0/64");
3120 if (db == NULL)
goto error;
3135 static int AddressTestAddressGroupSetup01(
void)
3145 DetectAddressHeadFree(gh);
3150 static int AddressTestAddressGroupSetup02(
void)
3160 DetectAddressHeadFree(gh);
3165 static int AddressTestAddressGroupSetup03(
void)
3176 if (r == 0 && gh->
ipv4_head != prev_head &&
3182 DetectAddressHeadFree(gh);
3187 static int AddressTestAddressGroupSetup04(
void)
3198 if (r == 0 && gh->
ipv4_head != prev_head &&
3210 DetectAddressHeadFree(gh);
3215 static int AddressTestAddressGroupSetup05(
void)
3226 if (r == 0 && gh->
ipv4_head == prev_head &&
3238 DetectAddressHeadFree(gh);
3243 static int AddressTestAddressGroupSetup06(
void)
3254 if (r == 0 && gh->
ipv4_head == prev_head &&
3260 DetectAddressHeadFree(gh);
3265 static int AddressTestAddressGroupSetup07(
void)
3281 DetectAddressHeadFree(gh);
3286 static int AddressTestAddressGroupSetup08(
void)
3302 DetectAddressHeadFree(gh);
3307 static int AddressTestAddressGroupSetup09(
void)
3323 DetectAddressHeadFree(gh);
3328 static int AddressTestAddressGroupSetup10(
void)
3344 DetectAddressHeadFree(gh);
3349 static int AddressTestAddressGroupSetup11(
void)
3362 *three = two->
next, *four = three->
next,
3372 if (one->
ip.addr_data32[0] == 0x00000000 && one->
ip2.addr_data32[0] ==
SCNtohl(168430079) &&
3373 two->ip.addr_data32[0] ==
SCNtohl(168430080) && two->ip2.addr_data32[0] ==
SCNtohl(168430089) &&
3374 three->ip.addr_data32[0] ==
SCNtohl(168430090) && three->ip2.addr_data32[0] ==
SCNtohl(168430335) &&
3375 four->ip.addr_data32[0] ==
SCNtohl(168430336) && four->ip2.addr_data32[0] ==
SCNtohl(168430337) &&
3376 five->ip.addr_data32[0] ==
SCNtohl(168430338) && five->ip2.addr_data32[0] == 0xFFFFFFFF) {
3383 DetectAddressHeadFree(gh);
3388 static int AddressTestAddressGroupSetup12 (
void)
3401 *three = two->
next, *four = three->
next,
3411 if (one->
ip.addr_data32[0] == 0x00000000 && one->
ip2.addr_data32[0] ==
SCNtohl(168430079) &&
3412 two->ip.addr_data32[0] ==
SCNtohl(168430080) && two->ip2.addr_data32[0] ==
SCNtohl(168430089) &&
3413 three->ip.addr_data32[0] ==
SCNtohl(168430090) && three->ip2.addr_data32[0] ==
SCNtohl(168430335) &&
3414 four->ip.addr_data32[0] ==
SCNtohl(168430336) && four->ip2.addr_data32[0] ==
SCNtohl(168430337) &&
3415 five->ip.addr_data32[0] ==
SCNtohl(168430338) && five->ip2.addr_data32[0] == 0xFFFFFFFF) {
3422 DetectAddressHeadFree(gh);
3427 static int AddressTestAddressGroupSetup13(
void)
3440 *three = two->
next, *four = three->
next,
3450 if (one->
ip.addr_data32[0] == 0x00000000 && one->
ip2.addr_data32[0] ==
SCNtohl(168430079) &&
3451 two->ip.addr_data32[0] ==
SCNtohl(168430080) && two->ip2.addr_data32[0] ==
SCNtohl(168430089) &&
3452 three->ip.addr_data32[0] ==
SCNtohl(168430090) && three->ip2.addr_data32[0] ==
SCNtohl(168430335) &&
3453 four->ip.addr_data32[0] ==
SCNtohl(168430336) && four->ip2.addr_data32[0] ==
SCNtohl(168430337) &&
3454 five->ip.addr_data32[0] ==
SCNtohl(168430338) && five->ip2.addr_data32[0] == 0xFFFFFFFF) {
3461 DetectAddressHeadFree(gh);
3466 static int AddressTestAddressGroupSetupIPv414(
void)
3487 DetectAddressHeadFree(gh);
3492 static int AddressTestAddressGroupSetupIPv415(
void)
3510 DetectAddressHeadFree(gh);
3514 static int AddressTestAddressGroupSetupIPv416(
void)
3532 DetectAddressHeadFree(gh);
3536 static int AddressTestAddressGroupSetup14(
void)
3546 DetectAddressHeadFree(gh);
3551 static int AddressTestAddressGroupSetup15(
void)
3561 DetectAddressHeadFree(gh);
3566 static int AddressTestAddressGroupSetup16(
void)
3577 if (r == 0 && gh->
ipv6_head != prev_head &&
3583 DetectAddressHeadFree(gh);
3588 static int AddressTestAddressGroupSetup17(
void)
3599 if (r == 0 && gh->
ipv6_head != prev_head &&
3611 DetectAddressHeadFree(gh);
3616 static int AddressTestAddressGroupSetup18(
void)
3627 if (r == 0 && gh->
ipv6_head == prev_head &&
3639 DetectAddressHeadFree(gh);
3644 static int AddressTestAddressGroupSetup19(
void)
3655 if (r == 0 && gh->
ipv6_head == prev_head &&
3661 DetectAddressHeadFree(gh);
3666 static int AddressTestAddressGroupSetup20(
void)
3682 DetectAddressHeadFree(gh);
3687 static int AddressTestAddressGroupSetup21(
void)
3703 DetectAddressHeadFree(gh);
3708 static int AddressTestAddressGroupSetup22(
void)
3724 DetectAddressHeadFree(gh);
3729 static int AddressTestAddressGroupSetup23(
void)
3745 DetectAddressHeadFree(gh);
3750 static int AddressTestAddressGroupSetup24(
void)
3763 *three = two->
next, *four = three->
next,
3765 if (one->
ip.addr_data32[0] == 0x00000000 &&
3766 one->
ip.addr_data32[1] == 0x00000000 &&
3767 one->
ip.addr_data32[2] == 0x00000000 &&
3768 one->
ip.addr_data32[3] == 0x00000000 &&
3769 one->
ip2.addr_data32[0] ==
SCNtohl(536870911) &&
3770 one->
ip2.addr_data32[1] == 0xFFFFFFFF &&
3771 one->
ip2.addr_data32[2] == 0xFFFFFFFF &&
3772 one->
ip2.addr_data32[3] == 0xFFFFFFFF &&
3774 two->
ip.addr_data32[0] ==
SCNtohl(536870912) &&
3775 two->
ip.addr_data32[1] == 0x00000000 &&
3776 two->
ip.addr_data32[2] == 0x00000000 &&
3777 two->
ip.addr_data32[3] == 0x00000000 &&
3778 two->
ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3779 two->
ip2.addr_data32[1] == 0x00000000 &&
3780 two->
ip2.addr_data32[2] == 0x00000000 &&
3783 three->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3784 three->ip.addr_data32[1] == 0x00000000 &&
3785 three->ip.addr_data32[2] == 0x00000000 &&
3786 three->ip.addr_data32[3] ==
SCNtohl(4) &&
3787 three->ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3788 three->ip2.addr_data32[1] == 0x00000000 &&
3789 three->ip2.addr_data32[2] == 0x00000000 &&
3790 three->ip2.addr_data32[3] ==
SCNtohl(6) &&
3792 four->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3793 four->ip.addr_data32[1] == 0x00000000 &&
3794 four->ip.addr_data32[2] == 0x00000000 &&
3795 four->ip.addr_data32[3] ==
SCNtohl(7) &&
3796 four->ip2.addr_data32[0] ==
SCNtohl(1073741823) &&
3797 four->ip2.addr_data32[1] == 0xFFFFFFFF &&
3798 four->ip2.addr_data32[2] == 0xFFFFFFFF &&
3799 four->ip2.addr_data32[3] == 0xFFFFFFFF &&
3801 five->ip.addr_data32[0] ==
SCNtohl(1073741824) &&
3802 five->ip.addr_data32[1] == 0x00000000 &&
3803 five->ip.addr_data32[2] == 0x00000000 &&
3804 five->ip.addr_data32[3] == 0x00000000 &&
3805 five->ip2.addr_data32[0] == 0xFFFFFFFF &&
3806 five->ip2.addr_data32[1] == 0xFFFFFFFF &&
3807 five->ip2.addr_data32[2] == 0xFFFFFFFF &&
3808 five->ip2.addr_data32[3] == 0xFFFFFFFF) {
3815 DetectAddressHeadFree(gh);
3820 static int AddressTestAddressGroupSetup25(
void)
3833 *three = two->
next, *four = three->
next,
3835 if (one->
ip.addr_data32[0] == 0x00000000 &&
3836 one->
ip.addr_data32[1] == 0x00000000 &&
3837 one->
ip.addr_data32[2] == 0x00000000 &&
3838 one->
ip.addr_data32[3] == 0x00000000 &&
3839 one->
ip2.addr_data32[0] ==
SCNtohl(536870911) &&
3840 one->
ip2.addr_data32[1] == 0xFFFFFFFF &&
3841 one->
ip2.addr_data32[2] == 0xFFFFFFFF &&
3842 one->
ip2.addr_data32[3] == 0xFFFFFFFF &&
3844 two->
ip.addr_data32[0] ==
SCNtohl(536870912) &&
3845 two->
ip.addr_data32[1] == 0x00000000 &&
3846 two->
ip.addr_data32[2] == 0x00000000 &&
3847 two->
ip.addr_data32[3] == 0x00000000 &&
3848 two->
ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3849 two->
ip2.addr_data32[1] == 0x00000000 &&
3850 two->
ip2.addr_data32[2] == 0x00000000 &&
3853 three->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3854 three->ip.addr_data32[1] == 0x00000000 &&
3855 three->ip.addr_data32[2] == 0x00000000 &&
3856 three->ip.addr_data32[3] ==
SCNtohl(4) &&
3857 three->ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3858 three->ip2.addr_data32[1] == 0x00000000 &&
3859 three->ip2.addr_data32[2] == 0x00000000 &&
3860 three->ip2.addr_data32[3] ==
SCNtohl(6) &&
3862 four->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3863 four->ip.addr_data32[1] == 0x00000000 &&
3864 four->ip.addr_data32[2] == 0x00000000 &&
3865 four->ip.addr_data32[3] ==
SCNtohl(7) &&
3866 four->ip2.addr_data32[0] ==
SCNtohl(1073741823) &&
3867 four->ip2.addr_data32[1] == 0xFFFFFFFF &&
3868 four->ip2.addr_data32[2] == 0xFFFFFFFF &&
3869 four->ip2.addr_data32[3] == 0xFFFFFFFF &&
3871 five->ip.addr_data32[0] ==
SCNtohl(1073741824) &&
3872 five->ip.addr_data32[1] == 0x00000000 &&
3873 five->ip.addr_data32[2] == 0x00000000 &&
3874 five->ip.addr_data32[3] == 0x00000000 &&
3875 five->ip2.addr_data32[0] == 0xFFFFFFFF &&
3876 five->ip2.addr_data32[1] == 0xFFFFFFFF &&
3877 five->ip2.addr_data32[2] == 0xFFFFFFFF &&
3878 five->ip2.addr_data32[3] == 0xFFFFFFFF) {
3885 DetectAddressHeadFree(gh);
3890 static int AddressTestAddressGroupSetup26(
void)
3903 *three = two->
next, *four = three->
next,
3905 if (one->
ip.addr_data32[0] == 0x00000000 &&
3906 one->
ip.addr_data32[1] == 0x00000000 &&
3907 one->
ip.addr_data32[2] == 0x00000000 &&
3908 one->
ip.addr_data32[3] == 0x00000000 &&
3909 one->
ip2.addr_data32[0] ==
SCNtohl(536870911) &&
3910 one->
ip2.addr_data32[1] == 0xFFFFFFFF &&
3911 one->
ip2.addr_data32[2] == 0xFFFFFFFF &&
3912 one->
ip2.addr_data32[3] == 0xFFFFFFFF &&
3914 two->
ip.addr_data32[0] ==
SCNtohl(536870912) &&
3915 two->
ip.addr_data32[1] == 0x00000000 &&
3916 two->
ip.addr_data32[2] == 0x00000000 &&
3917 two->
ip.addr_data32[3] == 0x00000000 &&
3918 two->
ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3919 two->
ip2.addr_data32[1] == 0x00000000 &&
3920 two->
ip2.addr_data32[2] == 0x00000000 &&
3923 three->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3924 three->ip.addr_data32[1] == 0x00000000 &&
3925 three->ip.addr_data32[2] == 0x00000000 &&
3926 three->ip.addr_data32[3] ==
SCNtohl(4) &&
3927 three->ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3928 three->ip2.addr_data32[1] == 0x00000000 &&
3929 three->ip2.addr_data32[2] == 0x00000000 &&
3930 three->ip2.addr_data32[3] ==
SCNtohl(6) &&
3932 four->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3933 four->ip.addr_data32[1] == 0x00000000 &&
3934 four->ip.addr_data32[2] == 0x00000000 &&
3935 four->ip.addr_data32[3] ==
SCNtohl(7) &&
3936 four->ip2.addr_data32[0] ==
SCNtohl(1073741823) &&
3937 four->ip2.addr_data32[1] == 0xFFFFFFFF &&
3938 four->ip2.addr_data32[2] == 0xFFFFFFFF &&
3939 four->ip2.addr_data32[3] == 0xFFFFFFFF &&
3941 five->ip.addr_data32[0] ==
SCNtohl(1073741824) &&
3942 five->ip.addr_data32[1] == 0x00000000 &&
3943 five->ip.addr_data32[2] == 0x00000000 &&
3944 five->ip.addr_data32[3] == 0x00000000 &&
3945 five->ip2.addr_data32[0] == 0xFFFFFFFF &&
3946 five->ip2.addr_data32[1] == 0xFFFFFFFF &&
3947 five->ip2.addr_data32[2] == 0xFFFFFFFF &&
3948 five->ip2.addr_data32[3] == 0xFFFFFFFF) {
3955 DetectAddressHeadFree(gh);
3960 static int AddressTestAddressGroupSetup27(
void)
3970 DetectAddressHeadFree(gh);
3975 static int AddressTestAddressGroupSetup28(
void)
3985 DetectAddressHeadFree(gh);
3990 static int AddressTestAddressGroupSetup29(
void)
4000 DetectAddressHeadFree(gh);
4005 static int AddressTestAddressGroupSetup30(
void)
4011 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]]");
4015 DetectAddressHeadFree(gh);
4020 static int AddressTestAddressGroupSetup31(
void)
4026 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]]]");
4030 DetectAddressHeadFree(gh);
4035 static int AddressTestAddressGroupSetup32(
void)
4041 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]]]]");
4045 DetectAddressHeadFree(gh);
4050 static int AddressTestAddressGroupSetup33(
void)
4060 DetectAddressHeadFree(gh);
4065 static int AddressTestAddressGroupSetup34(
void)
4075 DetectAddressHeadFree(gh);
4080 static int AddressTestAddressGroupSetup35(
void)
4090 DetectAddressHeadFree(gh);
4095 static int AddressTestAddressGroupSetup36 (
void)
4101 int r =
DetectAddressParse(NULL, gh,
"[1.0.0.0/8,[2.0.0.0/8,[3.0.0.0/8,!1.1.1.1]]]");
4105 DetectAddressHeadFree(gh);
4110 static int AddressTestAddressGroupSetup37(
void)
4120 DetectAddressHeadFree(gh);
4125 static int AddressTestAddressGroupSetup38(
void)
4128 {
"0.0.0.0",
"192.167.255.255" },
4129 {
"192.168.14.0",
"192.168.14.255" },
4130 {
"192.169.0.0",
"255.255.255.255" } };
4137 if (UTHValidateDetectAddressHead(gh, 3, expectations) ==
TRUE)
4141 DetectAddressHeadFree(gh);
4146 static int AddressTestAddressGroupSetup39(
void)
4149 {
"0.0.0.0",
"192.167.255.255" },
4150 {
"192.168.14.0",
"192.168.14.255" },
4151 {
"192.169.0.0",
"255.255.255.255" } };
4158 if (UTHValidateDetectAddressHead(gh, 3, expectations) ==
TRUE)
4162 DetectAddressHeadFree(gh);
4167 static int AddressTestAddressGroupSetup40(
void)
4170 {
"0.0.0.0",
"192.167.255.255" },
4171 {
"192.168.14.0",
"192.168.14.255" },
4172 {
"192.169.0.0",
"255.255.255.255" } };
4178 if (UTHValidateDetectAddressHead(gh, 3, expectations) ==
TRUE)
4182 DetectAddressHeadFree(gh);
4187 static int AddressTestAddressGroupSetup41(
void)
4190 {
"0.0.0.0",
"192.167.255.255" },
4191 {
"192.168.14.0",
"192.168.14.255" },
4192 {
"192.169.0.0",
"255.255.255.255" } };
4198 if (UTHValidateDetectAddressHead(gh, 3, expectations) ==
TRUE)
4202 DetectAddressHeadFree(gh);
4207 static int AddressTestAddressGroupSetup42(
void)
4210 {
"2000:0000:0000:0000:0000:0000:0000:0000",
"3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" } };
4216 if (UTHValidateDetectAddressHead(gh, 1, expectations) ==
TRUE)
4220 DetectAddressHeadFree(gh);
4225 static int AddressTestAddressGroupSetup43(
void)
4228 {
"2000:0000:0000:0000:0000:0000:0000:0000",
"2fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" },
4229 {
"3800:0000:0000:0000:0000:0000:0000:0000",
"3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" } };
4235 if (UTHValidateDetectAddressHead(gh, 2, expectations) ==
TRUE)
4239 DetectAddressHeadFree(gh);
4244 static int AddressTestAddressGroupSetup44(
void)
4247 {
"3ffe:ffff:7654:feda:1245:ba98:0000:0000",
"3ffe:ffff:7654:feda:1245:ba98:ffff:ffff" }};
4253 if (UTHValidateDetectAddressHead(gh, 1, expectations) ==
TRUE)
4257 DetectAddressHeadFree(gh);
4262 static int AddressTestAddressGroupSetup45(
void)
4272 DetectAddressHeadFree(gh);
4277 static int AddressTestAddressGroupSetup46(
void)
4280 {
"0.0.0.0",
"192.167.255.255" },
4281 {
"192.168.1.0",
"192.168.1.255" },
4282 {
"192.168.3.0",
"192.168.3.255" },
4283 {
"192.169.0.0",
"255.255.255.255" } };
4287 int r =
DetectAddressParse(NULL, gh,
"[![192.168.0.0/16,![192.168.1.0/24,192.168.3.0/24]]]");
4289 if (UTHValidateDetectAddressHead(gh, 4, expectations) ==
TRUE)
4293 DetectAddressHeadFree(gh);
4299 static int AddressTestAddressGroupSetup47(
void)
4302 {
"0.0.0.0",
"192.167.255.255" },
4303 {
"192.168.1.0",
"192.168.1.255" },
4304 {
"192.168.3.0",
"192.168.3.255" },
4305 {
"192.168.5.0",
"192.168.5.255" },
4306 {
"192.169.0.0",
"255.255.255.255" } };
4310 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]]");
4312 if (UTHValidateDetectAddressHead(gh, 5, expectations) ==
TRUE)
4316 DetectAddressHeadFree(gh);
4322 static int AddressTestAddressGroupSetup48(
void)
4325 {
"192.168.0.0",
"192.168.0.255" },
4326 {
"192.168.2.0",
"192.168.2.255" },
4327 {
"192.168.4.0",
"192.168.4.255" },
4328 {
"192.168.6.0",
"192.168.255.255" } };
4332 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]");
4334 if (UTHValidateDetectAddressHead(gh, 4, expectations) ==
TRUE)
4338 DetectAddressHeadFree(gh);
4343 static int AddressTestCutIPv401(
void)
4346 DetectAddress *a = DetectAddressParseSingle(
"1.2.3.0/255.255.255.0");
4348 DetectAddress *b = DetectAddressParseSingle(
"1.2.2.0-1.2.3.4");
4351 FAIL_IF(DetectAddressCut(NULL, a, b, &c) == -1);
4359 static int AddressTestCutIPv402(
void)
4362 a = DetectAddressParseSingle(
"1.2.3.0/255.255.255.0");
4363 b = DetectAddressParseSingle(
"1.2.2.0-1.2.3.4");
4365 if (DetectAddressCut(NULL, a, b, &c) == -1)
4383 static int AddressTestCutIPv403(
void)
4386 a = DetectAddressParseSingle(
"1.2.3.0/255.255.255.0");
4387 b = DetectAddressParseSingle(
"1.2.2.0-1.2.3.4");
4389 if (DetectAddressCut(NULL, a, b, &c) == -1)
4395 if (a->
ip.addr_data32[0] !=
SCNtohl(16908800) || a->
ip2.addr_data32[0] !=
SCNtohl(16909055))
4397 if (b->
ip.addr_data32[0] !=
SCNtohl(16909056) || b->
ip2.addr_data32[0] !=
SCNtohl(16909060))
4399 if (c->
ip.addr_data32[0] !=
SCNtohl(16909061) || c->
ip2.addr_data32[0] !=
SCNtohl(16909311))
4414 static int AddressTestCutIPv404(
void)
4417 a = DetectAddressParseSingle(
"1.2.3.3-1.2.3.6");
4418 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.5");
4420 if (DetectAddressCut(NULL, a, b, &c) == -1)
4426 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4428 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909061))
4430 if (c->
ip.addr_data32[0] !=
SCNtohl(16909062) || c->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4446 static int AddressTestCutIPv405(
void)
4449 a = DetectAddressParseSingle(
"1.2.3.3-1.2.3.6");
4450 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4452 if (DetectAddressCut(NULL, a, b, &c) == -1)
4458 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4460 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4462 if (c->
ip.addr_data32[0] !=
SCNtohl(16909063) || c->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4477 static int AddressTestCutIPv406(
void)
4480 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4481 b = DetectAddressParseSingle(
"1.2.3.3-1.2.3.6");
4483 if (DetectAddressCut(NULL, a, b, &c) == -1)
4489 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4491 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4493 if (c->
ip.addr_data32[0] !=
SCNtohl(16909063) || c->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4508 static int AddressTestCutIPv407(
void)
4511 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.6");
4512 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4514 if (DetectAddressCut(NULL, a, b, &c) == -1)
4520 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4522 if (b->
ip.addr_data32[0] !=
SCNtohl(16909063) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4537 static int AddressTestCutIPv408(
void)
4540 a = DetectAddressParseSingle(
"1.2.3.3-1.2.3.9");
4541 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4543 if (DetectAddressCut(NULL, a, b, &c) == -1)
4549 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4551 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4566 static int AddressTestCutIPv409(
void)
4569 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4570 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.6");
4572 if (DetectAddressCut(NULL, a, b, &c) == -1)
4578 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4580 if (b->
ip.addr_data32[0] !=
SCNtohl(16909063) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4595 static int AddressTestCutIPv410(
void)
4598 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4599 b = DetectAddressParseSingle(
"1.2.3.3-1.2.3.9");
4601 if (DetectAddressCut(NULL, a, b, &c) == -1)
4607 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4609 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4612 printf(
"ip %u ip2 %u ", (uint32_t)htonl(a->
ip.addr_data32[0]), (uint32_t)htonl(a->
ip2.addr_data32[0]));
4626 static int AddressTestParseInvalidMask01(
void)
4631 dd = DetectAddressParseSingle(
"192.168.2.0/33");
4639 static int AddressTestParseInvalidMask02(
void)
4644 dd = DetectAddressParseSingle(
"192.168.2.0/255.255.257.0");
4652 static int AddressTestParseInvalidMask03(
void)
4657 dd = DetectAddressParseSingle(
"192.168.2.0/blue");
4665 static int AddressConfVarsTest01(
void)
4667 static const char *dummy_conf_string =
4673 " address-groups:\n"
4675 " HOME_NET: \"any\"\n"
4677 " EXTERNAL_NET: \"!any\"\n"
4681 " HTTP_PORTS: \"any\"\n"
4683 " SHELLCODE_PORTS: \"!any\"\n"
4701 static int AddressConfVarsTest02(
void)
4703 static const char *dummy_conf_string =
4709 " address-groups:\n"
4711 " HOME_NET: \"any\"\n"
4713 " EXTERNAL_NET: \"any\"\n"
4717 " HTTP_PORTS: \"any\"\n"
4719 " SHELLCODE_PORTS: \"!any\"\n"
4737 static int AddressConfVarsTest03(
void)
4739 static const char *dummy_conf_string =
4745 " address-groups:\n"
4747 " HOME_NET: \"any\"\n"
4749 " EXTERNAL_NET: \"!$HOME_NET\"\n"
4753 " HTTP_PORTS: \"any\"\n"
4755 " SHELLCODE_PORTS: \"!$HTTP_PORTS\"\n"
4773 static int AddressConfVarsTest04(
void)
4775 static const char *dummy_conf_string =
4781 " address-groups:\n"
4783 " HOME_NET: \"any\"\n"
4785 " EXTERNAL_NET: \"$HOME_NET\"\n"
4789 " HTTP_PORTS: \"any\"\n"
4791 " SHELLCODE_PORTS: \"$HTTP_PORTS\"\n"
4809 static int AddressConfVarsTest05(
void)
4811 static const char *dummy_conf_string =
4817 " address-groups:\n"
4819 " HOME_NET: \"any\"\n"
4821 " EXTERNAL_NET: [192.168.0.1]\n"
4825 " HTTP_PORTS: \"any\"\n"
4827 " SHELLCODE_PORTS: [80]\n"
4848 static int AddressConfVarsTest06(
void)
4851 static const char *dummy_conf_string =
4857 " address-groups:\n"
4860 "\"[2002:0000:3238:DFE1:63:0000:0000:FEFB,2002: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 "2004:0000:3238:DFE1:63:0000:0000:FEFB,2005:0000:3238:DFE1:63:0000:0000:FEFB,"
4863 "2006:0000:3238:DFE1:63:0000:0000:FEFB,2007: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,"
4978 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4979 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4980 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4981 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4982 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4983 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4984 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4985 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4986 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4987 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4988 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4989 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4990 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4991 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4992 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4993 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4994 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB]\"\n"
4996 " EXTERNAL_NET: \"any\"\n"
5023 UtRegisterTest(
"AddressTestParse04bug5081", AddressTestParse04bug5081);
5087 AddressTestAddressGroupSetup01);
5089 AddressTestAddressGroupSetup02);
5091 AddressTestAddressGroupSetup03);
5093 AddressTestAddressGroupSetup04);
5095 AddressTestAddressGroupSetup05);
5097 AddressTestAddressGroupSetup06);
5099 AddressTestAddressGroupSetup07);
5101 AddressTestAddressGroupSetup08);
5103 AddressTestAddressGroupSetup09);
5105 AddressTestAddressGroupSetup10);
5107 AddressTestAddressGroupSetup11);
5109 AddressTestAddressGroupSetup12);
5111 AddressTestAddressGroupSetup13);
5113 AddressTestAddressGroupSetupIPv414);
5115 AddressTestAddressGroupSetupIPv415);
5117 AddressTestAddressGroupSetupIPv416);
5120 AddressTestAddressGroupSetup14);
5122 AddressTestAddressGroupSetup15);
5124 AddressTestAddressGroupSetup16);
5126 AddressTestAddressGroupSetup17);
5128 AddressTestAddressGroupSetup18);
5130 AddressTestAddressGroupSetup19);
5132 AddressTestAddressGroupSetup20);
5134 AddressTestAddressGroupSetup21);
5136 AddressTestAddressGroupSetup22);
5138 AddressTestAddressGroupSetup23);
5140 AddressTestAddressGroupSetup24);
5142 AddressTestAddressGroupSetup25);
5144 AddressTestAddressGroupSetup26);
5147 AddressTestAddressGroupSetup27);
5149 AddressTestAddressGroupSetup28);
5151 AddressTestAddressGroupSetup29);
5153 AddressTestAddressGroupSetup30);
5155 AddressTestAddressGroupSetup31);
5157 AddressTestAddressGroupSetup32);
5159 AddressTestAddressGroupSetup33);
5161 AddressTestAddressGroupSetup34);
5163 AddressTestAddressGroupSetup35);
5165 AddressTestAddressGroupSetup36);
5167 AddressTestAddressGroupSetup37);
5169 AddressTestAddressGroupSetup38);
5171 AddressTestAddressGroupSetup39);
5173 AddressTestAddressGroupSetup40);
5175 AddressTestAddressGroupSetup41);
5177 AddressTestAddressGroupSetup42);
5179 AddressTestAddressGroupSetup43);
5181 AddressTestAddressGroupSetup44);
5183 AddressTestAddressGroupSetup45);
5185 AddressTestAddressGroupSetup46);
5187 AddressTestAddressGroupSetup47);
5189 AddressTestAddressGroupSetup48);
5203 AddressTestParseInvalidMask01);
5205 AddressTestParseInvalidMask02);
5207 AddressTestParseInvalidMask03);