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 ticket #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) {
653 SCLogError(
"failed to parse address \"%s\"", s);
661 if (DetectAddressCutNot(ad, &ad2) < 0) {
670 if (DetectAddressInsert(NULL, gh, ad2) < 0) {
679 int r = DetectAddressInsert(NULL, gh, ad);
716 DetectAddressHead *ghn,
const char *s,
int negate, ResolvedVariablesList *var_list,
717 int recur,
char *
address,
size_t address_length)
721 int o_set = 0, n_set = 0, d_set = 0;
723 const char *rule_var_address = NULL;
724 char *temp_rule_var_address = NULL;
728 "limit reached (max 64)");
732 SCLogDebug(
"s %s negate %s", s, negate ?
"true" :
"false");
734 size_t size = strlen(s);
735 for (u = 0, x = 0; u < size && x < address_length; u++) {
736 if (x == (address_length - 1)) {
738 " limit for the supplied address. Invalidating sig. "
739 "Please file a bug report on this.");
745 if (!o_set && s[u] ==
'!') {
748 }
else if (s[u] ==
'[') {
754 }
else if (s[u] ==
']') {
759 if (((negate + n_set) % 2) == 0) {
763 if (DetectAddressParse2(
de_ctx, gh, ghn,
address, (negate + n_set) % 2, var_list, recur) < 0)
776 if (DetectAddressParse2(
de_ctx, &tmp_gh, &tmp_ghn,
address, 0, var_list, recur) < 0) {
786 for (tmp_ad = tmp_gh.
ipv4_head; tmp_ad; tmp_ad = tmp_ad->
next) {
790 for (tmp_ad = tmp_ghn.
ipv4_head; tmp_ad; tmp_ad = tmp_ad->
next) {
794 for (tmp_ad = tmp_gh.
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
798 for (tmp_ad = tmp_ghn.
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
812 for (tmp_ad = tmp_gh.
ipv4_head; tmp_ad; tmp_ad = tmp_ad->
next) {
815 if (tmp_ad2 == NULL) {
821 DetectAddressInsert(NULL, ghn, tmp_ad2);
825 for (tmp_ad = tmp_gh.
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
828 if (tmp_ad2 == NULL) {
834 DetectAddressInsert(NULL, ghn, tmp_ad2);
842 }
else if (depth == 0 && s[u] ==
',') {
845 }
else if (d_set == 1) {
850 if (rule_var_address == NULL)
853 if (strlen(rule_var_address) == 0) {
855 "to nothing. This is likely a misconfiguration. "
856 "Note that a negated address needs to be quoted, "
857 "\"!$HOME_NET\" instead of !$HOME_NET. See issue #295.",
862 SCLogDebug(
"rule_var_address %s", rule_var_address);
863 if ((negate + n_set) % 2) {
864 temp_rule_var_address =
SCMalloc(strlen(rule_var_address) + 3);
865 if (
unlikely(temp_rule_var_address == NULL))
867 snprintf(temp_rule_var_address, strlen(rule_var_address) + 3,
868 "[%s]", rule_var_address);
870 temp_rule_var_address =
SCStrdup(rule_var_address);
871 if (
unlikely(temp_rule_var_address == NULL))
875 if (DetectAddressParse2(
de_ctx, gh, ghn, temp_rule_var_address,
876 (negate + n_set) % 2, var_list, recur) < 0) {
877 if (temp_rule_var_address != rule_var_address)
878 SCFree(temp_rule_var_address);
883 SCFree(temp_rule_var_address);
887 if (!((negate + n_set) % 2)) {
889 if (DetectAddressSetup(gh,
address) < 0)
893 if (DetectAddressSetup(ghn,
address) < 0)
899 }
else if (depth == 0 && s[u] ==
'$') {
901 }
else if (depth == 0 && u == size - 1) {
902 if (x == address_length) {
911 "groups declaration. This is likely a misconfiguration.");
918 if (rule_var_address == NULL)
921 if (strlen(rule_var_address) == 0) {
923 "to nothing. This is likely a misconfiguration. "
924 "Note that a negated address needs to be quoted, "
925 "\"!$HOME_NET\" instead of !$HOME_NET. See issue #295.",
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.",
976 }
else if (depth < 0) {
978 "properly opened in \"%s\", %d missing opening brackets ([). "
979 "Note: problem might be in a variable.",
998 DetectAddressHead *ghn,
const char *s,
int negate, ResolvedVariablesList *var_list,
1002 #define MAX_ADDRESS_LENGTH 8192
1004 size_t address_length = strlen(s);
1009 " memory for address parsing.");
1012 rc = DetectAddressParseInternal(
1013 de_ctx, gh, ghn, s, negate, var_list, recur,
address, address_length);
1017 rc = DetectAddressParseInternal(
1064 if (DetectAddressIsCompleteIPSpace(ghn) == 1) {
1066 "Rule address range is NIL. Probably have a !any or "
1067 "an address range that supplies a NULL address range");
1074 r = DetectAddressSetup(gh,
"0.0.0.0/0");
1076 SCLogDebug(
"DetectAddressSetup for 0.0.0.0/0 failed");
1082 r = DetectAddressSetup(gh,
"::/0");
1084 SCLogDebug(
"DetectAddressSetup for ::/0 failed");
1099 r = DetectAddressInsert(NULL, gh, ad);
1115 r = DetectAddressInsert(NULL, gh, ad);
1123 for (tmp_ad = gh->
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
1127 int ipv4_applied = 0;
1128 int ipv6_applied = 0;
1136 for (ag2 = gh->
ipv4_head; ag2 != NULL; ) {
1143 if (ag2->
prev != NULL)
1145 if (ag2->
next != NULL)
1166 for (ag2 = gh->
ipv6_head; ag2 != NULL; ) {
1169 if (ag2->
prev != NULL)
1171 if (ag2->
next != NULL)
1191 for (tmp_ad = gh->
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
1194 for (tmp_ad = ghn->
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
1203 if (ipv4_applied != cnt) {
1205 "could be applied: %d != %d",
1214 if (ipv6_applied != cnt) {
1216 "could be applied: %d != %d",
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) {
1263 SCLogError(
"Address var \"%s\" probably has a sequence(something "
1264 "in brackets) value set without any quotes. Please "
1265 "quote it using \"..\".",
1270 int r = DetectAddressParse2(
1271 NULL, gh, ghn, seq_node->
val, 0, &var_list, 0);
1276 SCLogError(
"failed to parse address var \"%s\" with value \"%s\". "
1277 "Please check its syntax",
1278 seq_node->
name, seq_node->
val);
1282 if (DetectAddressIsCompleteIPSpace(ghn)) {
1283 SCLogError(
"address var - \"%s\" has the complete IP space negated "
1284 "with its value \"%s\". Rule address range is NIL. "
1285 "Probably have a !any or an address range that supplies "
1286 "a NULL address range",
1287 seq_node->
name, seq_node->
val);
1291 DetectAddressHeadFree(gh);
1293 DetectAddressHeadFree(ghn);
1300 DetectAddressHeadFree(gh);
1302 DetectAddressHeadFree(ghn);
1314 static uint32_t DetectAddressMapHashFunc(
HashListTable *ht,
void *data, uint16_t datalen)
1325 static char DetectAddressMapCompareFunc(
void *data1, uint16_t len1,
void *data2,
1335 static void DetectAddressMapFreeFunc(
void *data)
1339 DetectAddressHeadFree(map->
address);
1348 DetectAddressMapCompareFunc,
1349 DetectAddressMapFreeFunc);
1374 if (map->
string == NULL) {
1415 SCLogDebug(
"DetectAddressParse can not be run with NULL address");
1421 SCLogDebug(
"DetectAddressHeadInit for ghn failed");
1425 int r = DetectAddressParse2(
de_ctx, gh, ghn,
str, 0, NULL, 0);
1427 SCLogDebug(
"DetectAddressParse2 returned %d", r);
1428 DetectAddressHeadFree(ghn);
1440 DetectAddressHeadFree(ghn);
1445 DetectAddressHeadFree(ghn);
1446 return contains_negation ? 1 : 0;
1450 const char *
string,
bool *contains_negation)
1467 DetectAddressHeadFree(
head);
1469 }
else if (r == 1) {
1470 *contains_negation =
true;
1472 *contains_negation =
false;
1476 *contains_negation);
1492 DetectAddressCleanupList(gh->
ipv4_head);
1496 DetectAddressCleanupList(gh->
ipv6_head);
1604 uint16_t addrs_cnt,
const Address *a)
1608 if (addrs == NULL || addrs_cnt == 0) {
1612 uint32_t match_addr =
SCNtohl(a->addr_data32[0]);
1613 for (uint16_t idx = 0; idx < addrs_cnt; idx++) {
1614 if (match_addr >= addrs[idx].ip && match_addr <= addrs[idx].ip2) {
1637 uint16_t addrs_cnt,
const Address *a)
1641 if (addrs == NULL || addrs_cnt == 0) {
1645 uint32_t match_addr[4];
1646 match_addr[0] =
SCNtohl(a->addr_data32[0]);
1647 match_addr[1] =
SCNtohl(a->addr_data32[1]);
1648 match_addr[2] =
SCNtohl(a->addr_data32[2]);
1649 match_addr[3] =
SCNtohl(a->addr_data32[3]);
1654 for (uint16_t idx = 0; idx < addrs_cnt; idx++) {
1655 uint16_t result1 = 0, result2 = 0;
1658 if (0 == memcmp(match_addr, addrs[idx].ip,
sizeof(match_addr))) {
1661 if (0 == memcmp(match_addr, addrs[idx].ip2,
sizeof(match_addr))) {
1668 for (
int i = 0; i < 4; i++) {
1669 if (match_addr[i] > addrs[idx].ip[i]) {
1673 if (match_addr[i] < addrs[idx].ip[i]) {
1686 for (
int i = 0; i < 4; i++) {
1687 if (match_addr[i] < addrs[idx].ip2[i]) {
1691 if (match_addr[i] > addrs[idx].ip2[i]) {
1700 if (result1 == 1 && result2 == 1)
1756 SCLogDebug(
"What other address type can we have :-/");
1779 char ip[16], mask[16];
1781 memcpy(&in, &gr->
ip.addr_data32[0],
sizeof(in));
1782 PrintInet(AF_INET, &in, ip,
sizeof(ip));
1783 memcpy(&in, &gr->
ip2.addr_data32[0],
sizeof(in));
1784 PrintInet(AF_INET, &in, mask,
sizeof(mask));
1788 }
else if (gr->
ip.
family == AF_INET6) {
1789 struct in6_addr in6;
1790 char ip[66], mask[66];
1792 memcpy(&in6, &gr->
ip.addr_data32,
sizeof(in6));
1793 PrintInet(AF_INET6, &in6, ip,
sizeof(ip));
1794 memcpy(&in6, &gr->
ip2.addr_data32,
sizeof(in6));
1795 PrintInet(AF_INET6, &in6, mask,
sizeof(mask));
1825 if (a->
family == AF_INET) {
1828 }
else if (a->
family == AF_INET6) {
1833 for ( ; g != NULL; g = g->
next) {
1834 if (DetectAddressMatch(g,a) == 1) {
1846 static int UTHValidateDetectAddress(
DetectAddress *ad,
const char *one,
const char *two)
1848 char str1[46] =
"", str2[46] =
"";
1855 PrintInet(AF_INET, (
const void *)&ad->
ip.addr_data32[0], str1,
sizeof(str1));
1857 PrintInet(AF_INET, (
const void *)&ad->
ip2.addr_data32[0], str2,
sizeof(str2));
1860 if (strcmp(str1, one) != 0) {
1865 if (strcmp(str2, two) != 0) {
1874 PrintInet(AF_INET6, (
const void *)&ad->
ip.addr_data32[0], str1,
sizeof(str1));
1876 PrintInet(AF_INET6, (
const void *)&ad->
ip2.addr_data32[0], str2,
sizeof(str2));
1879 if (strcmp(str1, one) != 0) {
1884 if (strcmp(str2, two) != 0) {
1903 int expect = nranges;
1913 while (have < expect) {
1915 printf(
"bad head: have %d ranges, expected %d: ", have, expect);
1919 if (UTHValidateDetectAddress(ad, expectations[have].one, expectations[have].two) ==
FALSE)
1929 static int AddressTestParse01(
void)
1941 static int AddressTestParse02(
void)
1947 if (dd->
ip2.addr_data32[0] !=
SCNtohl(16909060) ||
1948 dd->
ip.addr_data32[0] !=
SCNtohl(16909060)) {
1952 printf(
"ip %"PRIu32
", ip2 %"PRIu32
"\n", dd->
ip.addr_data32[0], dd->
ip2.addr_data32[0]);
1960 static int AddressTestParse03(
void)
1962 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4/255.255.255.0");
1972 static int AddressTestParse04(
void)
1974 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4/255.255.255.0");
1977 char left[16], right[16];
1978 PrintInet(AF_INET, (
const void *)&dd->
ip.addr_data32[0], left,
sizeof(left));
1979 PrintInet(AF_INET, (
const void *)&dd->
ip2.addr_data32[0], right,
sizeof(right));
1991 static int AddressTestParse04bug5081(
void)
1993 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.64/26");
1996 char left[16], right[16];
1997 PrintInet(AF_INET, (
const void *)&dd->
ip.addr_data32[0], left,
sizeof(left));
1998 PrintInet(AF_INET, (
const void *)&dd->
ip2.addr_data32[0], right,
sizeof(right));
2007 static int AddressTestParse05(
void)
2019 static int AddressTestParse06(
void)
2025 if (dd->
ip2.addr_data32[0] !=
SCNtohl(16909311) ||
2026 dd->
ip.addr_data32[0] !=
SCNtohl(16909056)) {
2037 static int AddressTestParse07(
void)
2049 static int AddressTestParse08(
void)
2055 if (dd->
ip.addr_data32[0] !=
SCNtohl(536870912) || dd->
ip.addr_data32[1] != 0x00000000 ||
2056 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2058 dd->
ip2.addr_data32[0] !=
SCNtohl(1073741823) || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2059 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2071 static int AddressTestParse09(
void)
2073 DetectAddress *dd = DetectAddressParseSingle(
"2001::1/128");
2083 static int AddressTestParse10(
void)
2089 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2090 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2092 dd->
ip2.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip2.addr_data32[1] != 0x00000000 ||
2093 dd->
ip2.addr_data32[2] != 0x00000000 || dd->
ip2.addr_data32[3] != 0x00000000) {
2105 static int AddressTestParse11(
void)
2117 static int AddressTestParse12(
void)
2123 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2124 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2127 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2138 static int AddressTestParse13(
void)
2150 static int AddressTestParse14(
void)
2156 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2157 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2159 dd->
ip2.addr_data32[0] !=
SCNtohl(537001983) || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2160 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2171 static int AddressTestParse15(
void)
2183 static int AddressTestParse16(
void)
2189 if (dd->
ip.addr_data32[0] != 0x00000000 || dd->
ip.addr_data32[1] != 0x00000000 ||
2190 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2192 dd->
ip2.addr_data32[0] != 0xFFFFFFFF || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2193 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2204 static int AddressTestParse17(
void)
2206 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4-1.2.3.6");
2216 static int AddressTestParse18(
void)
2219 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4-1.2.3.6");
2222 if (dd->
ip2.addr_data32[0] !=
SCNtohl(16909062) ||
2223 dd->
ip.addr_data32[0] !=
SCNtohl(16909060)) {
2234 static int AddressTestParse19(
void)
2236 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.6-1.2.3.4");
2246 static int AddressTestParse20(
void)
2248 DetectAddress *dd = DetectAddressParseSingle(
"2001::1-2001::4");
2258 static int AddressTestParse21(
void)
2261 DetectAddress *dd = DetectAddressParseSingle(
"2001::1-2001::4");
2264 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2265 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] !=
SCNtohl(1) ||
2267 dd->
ip2.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip2.addr_data32[1] != 0x00000000 ||
2268 dd->
ip2.addr_data32[2] != 0x00000000 || dd->
ip2.addr_data32[3] !=
SCNtohl(4)) {
2279 static int AddressTestParse22(
void)
2281 DetectAddress *dd = DetectAddressParseSingle(
"2001::4-2001::1");
2291 static int AddressTestParse23(
void)
2297 DetectAddressHeadFree(gh);
2301 static int AddressTestParse24(
void)
2307 DetectAddressHeadFree(gh);
2311 static int AddressTestParse25(
void)
2317 DetectAddressHeadFree(gh);
2322 static int AddressTestParse26(
void)
2328 "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["
2330 "]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]"
2333 DetectAddressHeadFree(gh);
2334 gh = DetectAddressHeadInit();
2338 "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["
2340 "]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]"
2343 DetectAddressHeadFree(gh);
2347 static int AddressTestParse27(
void)
2349 DetectAddress *dd = DetectAddressParseSingle(
"!192.168.0.1");
2359 static int AddressTestParse28(
void)
2366 dd->
ip.addr_data32[0] ==
SCNtohl(16909060)) {
2377 static int AddressTestParse29(
void)
2379 DetectAddress *dd = DetectAddressParseSingle(
"!1.2.3.0/24");
2389 static int AddressTestParse30(
void)
2392 DetectAddress *dd = DetectAddressParseSingle(
"!1.2.3.4/24");
2396 dd->
ip.addr_data32[0] ==
SCNtohl(16909056) &&
2397 dd->
ip2.addr_data32[0] ==
SCNtohl(16909311)) {
2411 static int AddressTestParse31(
void)
2423 static int AddressTestParse32(
void)
2435 static int AddressTestParse33(
void)
2442 dd->
ip.addr_data32[0] ==
SCNtohl(536936448) && dd->
ip.addr_data32[1] == 0x00000000 &&
2443 dd->
ip.addr_data32[2] == 0x00000000 && dd->
ip.addr_data32[3] ==
SCNtohl(1)) {
2454 static int AddressTestParse34(
void)
2466 static int AddressTestParse35(
void)
2473 dd->
ip.addr_data32[0] ==
SCNtohl(536936448) && dd->
ip.addr_data32[1] == 0x00000000 &&
2474 dd->
ip.addr_data32[2] == 0x00000000 && dd->
ip.addr_data32[3] == 0x00000000 &&
2476 dd->
ip2.addr_data32[0] ==
SCNtohl(537001983) && dd->
ip2.addr_data32[1] == 0xFFFFFFFF &&
2477 dd->
ip2.addr_data32[2] == 0xFFFFFFFF && dd->
ip2.addr_data32[3] == 0xFFFFFFFF) {
2488 static int AddressTestParse36(
void)
2494 if (dd->
ip.addr_data32[0] !=
SCNtohl(0xFFFF0000) || dd->
ip.addr_data32[1] != 0x00000000 ||
2495 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2497 dd->
ip2.addr_data32[0] != 0xFFFFFFFF || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2498 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2512 static int AddressTestParse37(
void)
2518 if (dd->
ip.addr_data32[0] != 0x00000000 || dd->
ip.addr_data32[1] != 0x00000000 ||
2519 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2521 dd->
ip2.addr_data32[0] != 0xFFFFFFFF || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2522 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2535 static int AddressTestMatch01(
void)
2542 if (inet_pton(AF_INET,
"1.2.3.4", &in) != 1)
2544 memset(&a, 0,
sizeof(
Address));
2546 a.addr_data32[0] = in.s_addr;
2548 dd = DetectAddressParseSingle(
"1.2.3.4/24");
2550 if (DetectAddressMatch(dd, &a) == 0)
2560 static int AddressTestMatch02(
void)
2567 if (inet_pton(AF_INET,
"1.2.3.127", &in) != 1)
2569 memset(&a, 0,
sizeof(
Address));
2571 a.addr_data32[0] = in.s_addr;
2573 dd = DetectAddressParseSingle(
"1.2.3.4/25");
2575 if (DetectAddressMatch(dd, &a) == 0)
2585 static int AddressTestMatch03(
void)
2592 if (inet_pton(AF_INET,
"1.2.3.128", &in) != 1)
2594 memset(&a, 0,
sizeof(
Address));
2596 a.addr_data32[0] = in.s_addr;
2598 dd = DetectAddressParseSingle(
"1.2.3.4/25");
2600 if (DetectAddressMatch(dd, &a) == 1)
2610 static int AddressTestMatch04(
void)
2617 if (inet_pton(AF_INET,
"1.2.2.255", &in) != 1)
2619 memset(&a, 0,
sizeof(
Address));
2621 a.addr_data32[0] = in.s_addr;
2623 dd = DetectAddressParseSingle(
"1.2.3.4/25");
2625 if (DetectAddressMatch(dd, &a) == 1)
2635 static int AddressTestMatch05(
void)
2642 if (inet_pton(AF_INET,
"1.2.3.4", &in) != 1)
2644 memset(&a, 0,
sizeof(
Address));
2646 a.addr_data32[0] = in.s_addr;
2648 dd = DetectAddressParseSingle(
"1.2.3.4/32");
2650 if (DetectAddressMatch(dd, &a) == 0)
2660 static int AddressTestMatch06(
void)
2667 if (inet_pton(AF_INET,
"1.2.3.4", &in) != 1)
2669 memset(&a, 0,
sizeof(
Address));
2671 a.addr_data32[0] = in.s_addr;
2673 dd = DetectAddressParseSingle(
"0.0.0.0/0.0.0.0");
2675 if (DetectAddressMatch(dd, &a) == 0)
2685 static int AddressTestMatch07(
void)
2689 struct in6_addr in6;
2692 if (inet_pton(AF_INET6,
"2001::1", &in6) != 1)
2694 memset(&a, 0,
sizeof(
Address));
2695 a.family = AF_INET6;
2696 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2698 dd = DetectAddressParseSingle(
"2001::/3");
2700 if (DetectAddressMatch(dd, &a) == 0)
2710 static int AddressTestMatch08(
void)
2714 struct in6_addr in6;
2717 if (inet_pton(AF_INET6,
"1999:ffff:ffff:ffff:ffff:ffff:ffff:ffff", &in6) != 1)
2719 memset(&a, 0,
sizeof(
Address));
2720 a.family = AF_INET6;
2721 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2723 dd = DetectAddressParseSingle(
"2001::/3");
2725 if (DetectAddressMatch(dd, &a) == 1)
2735 static int AddressTestMatch09(
void)
2739 struct in6_addr in6;
2742 if (inet_pton(AF_INET6,
"2001::2", &in6) != 1)
2744 memset(&a, 0,
sizeof(
Address));
2745 a.family = AF_INET6;
2746 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2748 dd = DetectAddressParseSingle(
"2001::1/128");
2750 if (DetectAddressMatch(dd, &a) == 1)
2760 static int AddressTestMatch10(
void)
2764 struct in6_addr in6;
2767 if (inet_pton(AF_INET6,
"2001::2", &in6) != 1)
2769 memset(&a, 0,
sizeof(
Address));
2770 a.family = AF_INET6;
2771 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2773 dd = DetectAddressParseSingle(
"2001::1/126");
2775 if (DetectAddressMatch(dd, &a) == 0)
2785 static int AddressTestMatch11(
void)
2789 struct in6_addr in6;
2792 if (inet_pton(AF_INET6,
"2001::3", &in6) != 1)
2794 memset(&a, 0,
sizeof(
Address));
2795 a.family = AF_INET6;
2796 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2798 dd = DetectAddressParseSingle(
"2001::1/127");
2800 if (DetectAddressMatch(dd, &a) == 1)
2810 static int AddressTestCmp01(
void)
2815 da = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2816 if (da == NULL)
goto error;
2817 db = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2818 if (db == NULL)
goto error;
2833 static int AddressTestCmp02(
void)
2838 da = DetectAddressParseSingle(
"192.168.0.0/255.255.0.0");
2839 if (da == NULL)
goto error;
2840 db = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2841 if (db == NULL)
goto error;
2856 static int AddressTestCmp03(
void)
2861 da = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2862 if (da == NULL)
goto error;
2863 db = DetectAddressParseSingle(
"192.168.0.0/255.255.0.0");
2864 if (db == NULL)
goto error;
2879 static int AddressTestCmp04(
void)
2884 da = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2885 if (da == NULL)
goto error;
2886 db = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2887 if (db == NULL)
goto error;
2902 static int AddressTestCmp05(
void)
2907 da = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2908 if (da == NULL)
goto error;
2909 db = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2910 if (db == NULL)
goto error;
2925 static int AddressTestCmp06(
void)
2930 da = DetectAddressParseSingle(
"192.168.1.0/255.255.0.0");
2931 if (da == NULL)
goto error;
2932 db = DetectAddressParseSingle(
"192.168.0.0/255.255.0.0");
2933 if (db == NULL)
goto error;
2948 static int AddressTestCmpIPv407(
void)
2953 da = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2954 if (da == NULL)
goto error;
2955 db = DetectAddressParseSingle(
"192.168.1.128-192.168.2.128");
2956 if (db == NULL)
goto error;
2971 static int AddressTestCmpIPv408(
void)
2976 da = DetectAddressParseSingle(
"192.168.1.128-192.168.2.128");
2977 if (da == NULL)
goto error;
2978 db = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2979 if (db == NULL)
goto error;
2994 static int AddressTestCmp07(
void)
2999 da = DetectAddressParseSingle(
"2001::/3");
3000 if (da == NULL)
goto error;
3001 db = DetectAddressParseSingle(
"2001::1/3");
3002 if (db == NULL)
goto error;
3017 static int AddressTestCmp08(
void)
3022 da = DetectAddressParseSingle(
"2001::/3");
3023 if (da == NULL)
goto error;
3024 db = DetectAddressParseSingle(
"2001::/8");
3025 if (db == NULL)
goto error;
3040 static int AddressTestCmp09(
void)
3045 da = DetectAddressParseSingle(
"2001::/8");
3046 if (da == NULL)
goto error;
3047 db = DetectAddressParseSingle(
"2001::/3");
3048 if (db == NULL)
goto error;
3063 static int AddressTestCmp10(
void)
3068 da = DetectAddressParseSingle(
"2001:1:2:3:0:0:0:0/64");
3069 if (da == NULL)
goto error;
3070 db = DetectAddressParseSingle(
"2001:1:2:4:0:0:0:0/64");
3071 if (db == NULL)
goto error;
3086 static int AddressTestCmp11(
void)
3091 da = DetectAddressParseSingle(
"2001:1:2:4:0:0:0:0/64");
3092 if (da == NULL)
goto error;
3093 db = DetectAddressParseSingle(
"2001:1:2:3:0:0:0:0/64");
3094 if (db == NULL)
goto error;
3109 static int AddressTestCmp12(
void)
3114 da = DetectAddressParseSingle(
"2001:1:2:3:1:0:0:0/64");
3115 if (da == NULL)
goto error;
3116 db = DetectAddressParseSingle(
"2001:1:2:3:2:0:0:0/64");
3117 if (db == NULL)
goto error;
3132 static int AddressTestAddressGroupSetup01(
void)
3142 DetectAddressHeadFree(gh);
3147 static int AddressTestAddressGroupSetup02(
void)
3157 DetectAddressHeadFree(gh);
3162 static int AddressTestAddressGroupSetup03(
void)
3173 if (r == 0 && gh->
ipv4_head != prev_head &&
3179 DetectAddressHeadFree(gh);
3184 static int AddressTestAddressGroupSetup04(
void)
3195 if (r == 0 && gh->
ipv4_head != prev_head &&
3207 DetectAddressHeadFree(gh);
3212 static int AddressTestAddressGroupSetup05(
void)
3223 if (r == 0 && gh->
ipv4_head == prev_head &&
3235 DetectAddressHeadFree(gh);
3240 static int AddressTestAddressGroupSetup06(
void)
3251 if (r == 0 && gh->
ipv4_head == prev_head &&
3257 DetectAddressHeadFree(gh);
3262 static int AddressTestAddressGroupSetup07(
void)
3278 DetectAddressHeadFree(gh);
3283 static int AddressTestAddressGroupSetup08(
void)
3299 DetectAddressHeadFree(gh);
3304 static int AddressTestAddressGroupSetup09(
void)
3320 DetectAddressHeadFree(gh);
3325 static int AddressTestAddressGroupSetup10(
void)
3341 DetectAddressHeadFree(gh);
3346 static int AddressTestAddressGroupSetup11(
void)
3359 *three = two->
next, *four = three->
next,
3369 if (one->
ip.addr_data32[0] == 0x00000000 && one->
ip2.addr_data32[0] ==
SCNtohl(168430079) &&
3370 two->ip.addr_data32[0] ==
SCNtohl(168430080) && two->ip2.addr_data32[0] ==
SCNtohl(168430089) &&
3371 three->ip.addr_data32[0] ==
SCNtohl(168430090) && three->ip2.addr_data32[0] ==
SCNtohl(168430335) &&
3372 four->ip.addr_data32[0] ==
SCNtohl(168430336) && four->ip2.addr_data32[0] ==
SCNtohl(168430337) &&
3373 five->ip.addr_data32[0] ==
SCNtohl(168430338) && five->ip2.addr_data32[0] == 0xFFFFFFFF) {
3380 DetectAddressHeadFree(gh);
3385 static int AddressTestAddressGroupSetup12 (
void)
3398 *three = two->
next, *four = three->
next,
3408 if (one->
ip.addr_data32[0] == 0x00000000 && one->
ip2.addr_data32[0] ==
SCNtohl(168430079) &&
3409 two->ip.addr_data32[0] ==
SCNtohl(168430080) && two->ip2.addr_data32[0] ==
SCNtohl(168430089) &&
3410 three->ip.addr_data32[0] ==
SCNtohl(168430090) && three->ip2.addr_data32[0] ==
SCNtohl(168430335) &&
3411 four->ip.addr_data32[0] ==
SCNtohl(168430336) && four->ip2.addr_data32[0] ==
SCNtohl(168430337) &&
3412 five->ip.addr_data32[0] ==
SCNtohl(168430338) && five->ip2.addr_data32[0] == 0xFFFFFFFF) {
3419 DetectAddressHeadFree(gh);
3424 static int AddressTestAddressGroupSetup13(
void)
3437 *three = two->
next, *four = three->
next,
3447 if (one->
ip.addr_data32[0] == 0x00000000 && one->
ip2.addr_data32[0] ==
SCNtohl(168430079) &&
3448 two->ip.addr_data32[0] ==
SCNtohl(168430080) && two->ip2.addr_data32[0] ==
SCNtohl(168430089) &&
3449 three->ip.addr_data32[0] ==
SCNtohl(168430090) && three->ip2.addr_data32[0] ==
SCNtohl(168430335) &&
3450 four->ip.addr_data32[0] ==
SCNtohl(168430336) && four->ip2.addr_data32[0] ==
SCNtohl(168430337) &&
3451 five->ip.addr_data32[0] ==
SCNtohl(168430338) && five->ip2.addr_data32[0] == 0xFFFFFFFF) {
3458 DetectAddressHeadFree(gh);
3463 static int AddressTestAddressGroupSetupIPv414(
void)
3484 DetectAddressHeadFree(gh);
3489 static int AddressTestAddressGroupSetupIPv415(
void)
3507 DetectAddressHeadFree(gh);
3511 static int AddressTestAddressGroupSetupIPv416(
void)
3529 DetectAddressHeadFree(gh);
3533 static int AddressTestAddressGroupSetup14(
void)
3543 DetectAddressHeadFree(gh);
3548 static int AddressTestAddressGroupSetup15(
void)
3558 DetectAddressHeadFree(gh);
3563 static int AddressTestAddressGroupSetup16(
void)
3574 if (r == 0 && gh->
ipv6_head != prev_head &&
3580 DetectAddressHeadFree(gh);
3585 static int AddressTestAddressGroupSetup17(
void)
3596 if (r == 0 && gh->
ipv6_head != prev_head &&
3608 DetectAddressHeadFree(gh);
3613 static int AddressTestAddressGroupSetup18(
void)
3624 if (r == 0 && gh->
ipv6_head == prev_head &&
3636 DetectAddressHeadFree(gh);
3641 static int AddressTestAddressGroupSetup19(
void)
3652 if (r == 0 && gh->
ipv6_head == prev_head &&
3658 DetectAddressHeadFree(gh);
3663 static int AddressTestAddressGroupSetup20(
void)
3679 DetectAddressHeadFree(gh);
3684 static int AddressTestAddressGroupSetup21(
void)
3700 DetectAddressHeadFree(gh);
3705 static int AddressTestAddressGroupSetup22(
void)
3721 DetectAddressHeadFree(gh);
3726 static int AddressTestAddressGroupSetup23(
void)
3742 DetectAddressHeadFree(gh);
3747 static int AddressTestAddressGroupSetup24(
void)
3760 *three = two->
next, *four = three->
next,
3762 if (one->
ip.addr_data32[0] == 0x00000000 &&
3763 one->
ip.addr_data32[1] == 0x00000000 &&
3764 one->
ip.addr_data32[2] == 0x00000000 &&
3765 one->
ip.addr_data32[3] == 0x00000000 &&
3766 one->
ip2.addr_data32[0] ==
SCNtohl(536870911) &&
3767 one->
ip2.addr_data32[1] == 0xFFFFFFFF &&
3768 one->
ip2.addr_data32[2] == 0xFFFFFFFF &&
3769 one->
ip2.addr_data32[3] == 0xFFFFFFFF &&
3771 two->
ip.addr_data32[0] ==
SCNtohl(536870912) &&
3772 two->
ip.addr_data32[1] == 0x00000000 &&
3773 two->
ip.addr_data32[2] == 0x00000000 &&
3774 two->
ip.addr_data32[3] == 0x00000000 &&
3775 two->
ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3776 two->
ip2.addr_data32[1] == 0x00000000 &&
3777 two->
ip2.addr_data32[2] == 0x00000000 &&
3780 three->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3781 three->ip.addr_data32[1] == 0x00000000 &&
3782 three->ip.addr_data32[2] == 0x00000000 &&
3783 three->ip.addr_data32[3] ==
SCNtohl(4) &&
3784 three->ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3785 three->ip2.addr_data32[1] == 0x00000000 &&
3786 three->ip2.addr_data32[2] == 0x00000000 &&
3787 three->ip2.addr_data32[3] ==
SCNtohl(6) &&
3789 four->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3790 four->ip.addr_data32[1] == 0x00000000 &&
3791 four->ip.addr_data32[2] == 0x00000000 &&
3792 four->ip.addr_data32[3] ==
SCNtohl(7) &&
3793 four->ip2.addr_data32[0] ==
SCNtohl(1073741823) &&
3794 four->ip2.addr_data32[1] == 0xFFFFFFFF &&
3795 four->ip2.addr_data32[2] == 0xFFFFFFFF &&
3796 four->ip2.addr_data32[3] == 0xFFFFFFFF &&
3798 five->ip.addr_data32[0] ==
SCNtohl(1073741824) &&
3799 five->ip.addr_data32[1] == 0x00000000 &&
3800 five->ip.addr_data32[2] == 0x00000000 &&
3801 five->ip.addr_data32[3] == 0x00000000 &&
3802 five->ip2.addr_data32[0] == 0xFFFFFFFF &&
3803 five->ip2.addr_data32[1] == 0xFFFFFFFF &&
3804 five->ip2.addr_data32[2] == 0xFFFFFFFF &&
3805 five->ip2.addr_data32[3] == 0xFFFFFFFF) {
3812 DetectAddressHeadFree(gh);
3817 static int AddressTestAddressGroupSetup25(
void)
3830 *three = two->
next, *four = three->
next,
3832 if (one->
ip.addr_data32[0] == 0x00000000 &&
3833 one->
ip.addr_data32[1] == 0x00000000 &&
3834 one->
ip.addr_data32[2] == 0x00000000 &&
3835 one->
ip.addr_data32[3] == 0x00000000 &&
3836 one->
ip2.addr_data32[0] ==
SCNtohl(536870911) &&
3837 one->
ip2.addr_data32[1] == 0xFFFFFFFF &&
3838 one->
ip2.addr_data32[2] == 0xFFFFFFFF &&
3839 one->
ip2.addr_data32[3] == 0xFFFFFFFF &&
3841 two->
ip.addr_data32[0] ==
SCNtohl(536870912) &&
3842 two->
ip.addr_data32[1] == 0x00000000 &&
3843 two->
ip.addr_data32[2] == 0x00000000 &&
3844 two->
ip.addr_data32[3] == 0x00000000 &&
3845 two->
ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3846 two->
ip2.addr_data32[1] == 0x00000000 &&
3847 two->
ip2.addr_data32[2] == 0x00000000 &&
3850 three->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3851 three->ip.addr_data32[1] == 0x00000000 &&
3852 three->ip.addr_data32[2] == 0x00000000 &&
3853 three->ip.addr_data32[3] ==
SCNtohl(4) &&
3854 three->ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3855 three->ip2.addr_data32[1] == 0x00000000 &&
3856 three->ip2.addr_data32[2] == 0x00000000 &&
3857 three->ip2.addr_data32[3] ==
SCNtohl(6) &&
3859 four->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3860 four->ip.addr_data32[1] == 0x00000000 &&
3861 four->ip.addr_data32[2] == 0x00000000 &&
3862 four->ip.addr_data32[3] ==
SCNtohl(7) &&
3863 four->ip2.addr_data32[0] ==
SCNtohl(1073741823) &&
3864 four->ip2.addr_data32[1] == 0xFFFFFFFF &&
3865 four->ip2.addr_data32[2] == 0xFFFFFFFF &&
3866 four->ip2.addr_data32[3] == 0xFFFFFFFF &&
3868 five->ip.addr_data32[0] ==
SCNtohl(1073741824) &&
3869 five->ip.addr_data32[1] == 0x00000000 &&
3870 five->ip.addr_data32[2] == 0x00000000 &&
3871 five->ip.addr_data32[3] == 0x00000000 &&
3872 five->ip2.addr_data32[0] == 0xFFFFFFFF &&
3873 five->ip2.addr_data32[1] == 0xFFFFFFFF &&
3874 five->ip2.addr_data32[2] == 0xFFFFFFFF &&
3875 five->ip2.addr_data32[3] == 0xFFFFFFFF) {
3882 DetectAddressHeadFree(gh);
3887 static int AddressTestAddressGroupSetup26(
void)
3900 *three = two->
next, *four = three->
next,
3902 if (one->
ip.addr_data32[0] == 0x00000000 &&
3903 one->
ip.addr_data32[1] == 0x00000000 &&
3904 one->
ip.addr_data32[2] == 0x00000000 &&
3905 one->
ip.addr_data32[3] == 0x00000000 &&
3906 one->
ip2.addr_data32[0] ==
SCNtohl(536870911) &&
3907 one->
ip2.addr_data32[1] == 0xFFFFFFFF &&
3908 one->
ip2.addr_data32[2] == 0xFFFFFFFF &&
3909 one->
ip2.addr_data32[3] == 0xFFFFFFFF &&
3911 two->
ip.addr_data32[0] ==
SCNtohl(536870912) &&
3912 two->
ip.addr_data32[1] == 0x00000000 &&
3913 two->
ip.addr_data32[2] == 0x00000000 &&
3914 two->
ip.addr_data32[3] == 0x00000000 &&
3915 two->
ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3916 two->
ip2.addr_data32[1] == 0x00000000 &&
3917 two->
ip2.addr_data32[2] == 0x00000000 &&
3920 three->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3921 three->ip.addr_data32[1] == 0x00000000 &&
3922 three->ip.addr_data32[2] == 0x00000000 &&
3923 three->ip.addr_data32[3] ==
SCNtohl(4) &&
3924 three->ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3925 three->ip2.addr_data32[1] == 0x00000000 &&
3926 three->ip2.addr_data32[2] == 0x00000000 &&
3927 three->ip2.addr_data32[3] ==
SCNtohl(6) &&
3929 four->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3930 four->ip.addr_data32[1] == 0x00000000 &&
3931 four->ip.addr_data32[2] == 0x00000000 &&
3932 four->ip.addr_data32[3] ==
SCNtohl(7) &&
3933 four->ip2.addr_data32[0] ==
SCNtohl(1073741823) &&
3934 four->ip2.addr_data32[1] == 0xFFFFFFFF &&
3935 four->ip2.addr_data32[2] == 0xFFFFFFFF &&
3936 four->ip2.addr_data32[3] == 0xFFFFFFFF &&
3938 five->ip.addr_data32[0] ==
SCNtohl(1073741824) &&
3939 five->ip.addr_data32[1] == 0x00000000 &&
3940 five->ip.addr_data32[2] == 0x00000000 &&
3941 five->ip.addr_data32[3] == 0x00000000 &&
3942 five->ip2.addr_data32[0] == 0xFFFFFFFF &&
3943 five->ip2.addr_data32[1] == 0xFFFFFFFF &&
3944 five->ip2.addr_data32[2] == 0xFFFFFFFF &&
3945 five->ip2.addr_data32[3] == 0xFFFFFFFF) {
3952 DetectAddressHeadFree(gh);
3957 static int AddressTestAddressGroupSetup27(
void)
3967 DetectAddressHeadFree(gh);
3972 static int AddressTestAddressGroupSetup28(
void)
3982 DetectAddressHeadFree(gh);
3987 static int AddressTestAddressGroupSetup29(
void)
3997 DetectAddressHeadFree(gh);
4002 static int AddressTestAddressGroupSetup30(
void)
4008 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]]");
4012 DetectAddressHeadFree(gh);
4017 static int AddressTestAddressGroupSetup31(
void)
4023 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]]]");
4027 DetectAddressHeadFree(gh);
4032 static int AddressTestAddressGroupSetup32(
void)
4038 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]]]]");
4042 DetectAddressHeadFree(gh);
4047 static int AddressTestAddressGroupSetup33(
void)
4057 DetectAddressHeadFree(gh);
4062 static int AddressTestAddressGroupSetup34(
void)
4072 DetectAddressHeadFree(gh);
4077 static int AddressTestAddressGroupSetup35(
void)
4087 DetectAddressHeadFree(gh);
4092 static int AddressTestAddressGroupSetup36 (
void)
4098 int r =
DetectAddressParse(NULL, gh,
"[1.0.0.0/8,[2.0.0.0/8,[3.0.0.0/8,!1.1.1.1]]]");
4102 DetectAddressHeadFree(gh);
4107 static int AddressTestAddressGroupSetup37(
void)
4117 DetectAddressHeadFree(gh);
4122 static int AddressTestAddressGroupSetup38(
void)
4125 {
"0.0.0.0",
"192.167.255.255" },
4126 {
"192.168.14.0",
"192.168.14.255" },
4127 {
"192.169.0.0",
"255.255.255.255" } };
4134 if (UTHValidateDetectAddressHead(gh, 3, expectations) ==
TRUE)
4138 DetectAddressHeadFree(gh);
4143 static int AddressTestAddressGroupSetup39(
void)
4146 {
"0.0.0.0",
"192.167.255.255" },
4147 {
"192.168.14.0",
"192.168.14.255" },
4148 {
"192.169.0.0",
"255.255.255.255" } };
4155 if (UTHValidateDetectAddressHead(gh, 3, expectations) ==
TRUE)
4159 DetectAddressHeadFree(gh);
4164 static int AddressTestAddressGroupSetup40(
void)
4167 {
"0.0.0.0",
"192.167.255.255" },
4168 {
"192.168.14.0",
"192.168.14.255" },
4169 {
"192.169.0.0",
"255.255.255.255" } };
4175 if (UTHValidateDetectAddressHead(gh, 3, expectations) ==
TRUE)
4179 DetectAddressHeadFree(gh);
4184 static int AddressTestAddressGroupSetup41(
void)
4187 {
"0.0.0.0",
"192.167.255.255" },
4188 {
"192.168.14.0",
"192.168.14.255" },
4189 {
"192.169.0.0",
"255.255.255.255" } };
4195 if (UTHValidateDetectAddressHead(gh, 3, expectations) ==
TRUE)
4199 DetectAddressHeadFree(gh);
4204 static int AddressTestAddressGroupSetup42(
void)
4207 {
"2000:0000:0000:0000:0000:0000:0000:0000",
"3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" } };
4213 if (UTHValidateDetectAddressHead(gh, 1, expectations) ==
TRUE)
4217 DetectAddressHeadFree(gh);
4222 static int AddressTestAddressGroupSetup43(
void)
4225 {
"2000:0000:0000:0000:0000:0000:0000:0000",
"2fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" },
4226 {
"3800:0000:0000:0000:0000:0000:0000:0000",
"3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" } };
4232 if (UTHValidateDetectAddressHead(gh, 2, expectations) ==
TRUE)
4236 DetectAddressHeadFree(gh);
4241 static int AddressTestAddressGroupSetup44(
void)
4244 {
"3ffe:ffff:7654:feda:1245:ba98:0000:0000",
"3ffe:ffff:7654:feda:1245:ba98:ffff:ffff" }};
4250 if (UTHValidateDetectAddressHead(gh, 1, expectations) ==
TRUE)
4254 DetectAddressHeadFree(gh);
4259 static int AddressTestAddressGroupSetup45(
void)
4269 DetectAddressHeadFree(gh);
4274 static int AddressTestAddressGroupSetup46(
void)
4277 {
"0.0.0.0",
"192.167.255.255" },
4278 {
"192.168.1.0",
"192.168.1.255" },
4279 {
"192.168.3.0",
"192.168.3.255" },
4280 {
"192.169.0.0",
"255.255.255.255" } };
4284 int r =
DetectAddressParse(NULL, gh,
"[![192.168.0.0/16,![192.168.1.0/24,192.168.3.0/24]]]");
4286 if (UTHValidateDetectAddressHead(gh, 4, expectations) ==
TRUE)
4290 DetectAddressHeadFree(gh);
4296 static int AddressTestAddressGroupSetup47(
void)
4299 {
"0.0.0.0",
"192.167.255.255" },
4300 {
"192.168.1.0",
"192.168.1.255" },
4301 {
"192.168.3.0",
"192.168.3.255" },
4302 {
"192.168.5.0",
"192.168.5.255" },
4303 {
"192.169.0.0",
"255.255.255.255" } };
4307 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]]");
4309 if (UTHValidateDetectAddressHead(gh, 5, expectations) ==
TRUE)
4313 DetectAddressHeadFree(gh);
4319 static int AddressTestAddressGroupSetup48(
void)
4322 {
"192.168.0.0",
"192.168.0.255" },
4323 {
"192.168.2.0",
"192.168.2.255" },
4324 {
"192.168.4.0",
"192.168.4.255" },
4325 {
"192.168.6.0",
"192.168.255.255" } };
4329 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]");
4331 if (UTHValidateDetectAddressHead(gh, 4, expectations) ==
TRUE)
4335 DetectAddressHeadFree(gh);
4340 static int AddressTestCutIPv401(
void)
4343 DetectAddress *a = DetectAddressParseSingle(
"1.2.3.0/255.255.255.0");
4345 DetectAddress *b = DetectAddressParseSingle(
"1.2.2.0-1.2.3.4");
4348 FAIL_IF(DetectAddressCut(NULL, a, b, &c) == -1);
4356 static int AddressTestCutIPv402(
void)
4359 a = DetectAddressParseSingle(
"1.2.3.0/255.255.255.0");
4360 b = DetectAddressParseSingle(
"1.2.2.0-1.2.3.4");
4362 if (DetectAddressCut(NULL, a, b, &c) == -1)
4380 static int AddressTestCutIPv403(
void)
4383 a = DetectAddressParseSingle(
"1.2.3.0/255.255.255.0");
4384 b = DetectAddressParseSingle(
"1.2.2.0-1.2.3.4");
4386 if (DetectAddressCut(NULL, a, b, &c) == -1)
4392 if (a->
ip.addr_data32[0] !=
SCNtohl(16908800) || a->
ip2.addr_data32[0] !=
SCNtohl(16909055))
4394 if (b->
ip.addr_data32[0] !=
SCNtohl(16909056) || b->
ip2.addr_data32[0] !=
SCNtohl(16909060))
4396 if (c->
ip.addr_data32[0] !=
SCNtohl(16909061) || c->
ip2.addr_data32[0] !=
SCNtohl(16909311))
4411 static int AddressTestCutIPv404(
void)
4414 a = DetectAddressParseSingle(
"1.2.3.3-1.2.3.6");
4415 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.5");
4417 if (DetectAddressCut(NULL, a, b, &c) == -1)
4423 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4425 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909061))
4427 if (c->
ip.addr_data32[0] !=
SCNtohl(16909062) || c->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4443 static int AddressTestCutIPv405(
void)
4446 a = DetectAddressParseSingle(
"1.2.3.3-1.2.3.6");
4447 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4449 if (DetectAddressCut(NULL, a, b, &c) == -1)
4455 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4457 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4459 if (c->
ip.addr_data32[0] !=
SCNtohl(16909063) || c->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4474 static int AddressTestCutIPv406(
void)
4477 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4478 b = DetectAddressParseSingle(
"1.2.3.3-1.2.3.6");
4480 if (DetectAddressCut(NULL, a, b, &c) == -1)
4486 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4488 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4490 if (c->
ip.addr_data32[0] !=
SCNtohl(16909063) || c->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4505 static int AddressTestCutIPv407(
void)
4508 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.6");
4509 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4511 if (DetectAddressCut(NULL, a, b, &c) == -1)
4517 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4519 if (b->
ip.addr_data32[0] !=
SCNtohl(16909063) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4534 static int AddressTestCutIPv408(
void)
4537 a = DetectAddressParseSingle(
"1.2.3.3-1.2.3.9");
4538 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4540 if (DetectAddressCut(NULL, a, b, &c) == -1)
4546 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4548 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4563 static int AddressTestCutIPv409(
void)
4566 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4567 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.6");
4569 if (DetectAddressCut(NULL, a, b, &c) == -1)
4575 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4577 if (b->
ip.addr_data32[0] !=
SCNtohl(16909063) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4592 static int AddressTestCutIPv410(
void)
4595 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4596 b = DetectAddressParseSingle(
"1.2.3.3-1.2.3.9");
4598 if (DetectAddressCut(NULL, a, b, &c) == -1)
4604 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4606 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4609 printf(
"ip %u ip2 %u ", (uint32_t)htonl(a->
ip.addr_data32[0]), (uint32_t)htonl(a->
ip2.addr_data32[0]));
4623 static int AddressTestParseInvalidMask01(
void)
4628 dd = DetectAddressParseSingle(
"192.168.2.0/33");
4636 static int AddressTestParseInvalidMask02(
void)
4641 dd = DetectAddressParseSingle(
"192.168.2.0/255.255.257.0");
4649 static int AddressTestParseInvalidMask03(
void)
4654 dd = DetectAddressParseSingle(
"192.168.2.0/blue");
4662 static int AddressConfVarsTest01(
void)
4664 static const char *dummy_conf_string =
4670 " address-groups:\n"
4672 " HOME_NET: \"any\"\n"
4674 " EXTERNAL_NET: \"!any\"\n"
4678 " HTTP_PORTS: \"any\"\n"
4680 " SHELLCODE_PORTS: \"!any\"\n"
4698 static int AddressConfVarsTest02(
void)
4700 static const char *dummy_conf_string =
4706 " address-groups:\n"
4708 " HOME_NET: \"any\"\n"
4710 " EXTERNAL_NET: \"any\"\n"
4714 " HTTP_PORTS: \"any\"\n"
4716 " SHELLCODE_PORTS: \"!any\"\n"
4734 static int AddressConfVarsTest03(
void)
4736 static const char *dummy_conf_string =
4742 " address-groups:\n"
4744 " HOME_NET: \"any\"\n"
4746 " EXTERNAL_NET: \"!$HOME_NET\"\n"
4750 " HTTP_PORTS: \"any\"\n"
4752 " SHELLCODE_PORTS: \"!$HTTP_PORTS\"\n"
4770 static int AddressConfVarsTest04(
void)
4772 static const char *dummy_conf_string =
4778 " address-groups:\n"
4780 " HOME_NET: \"any\"\n"
4782 " EXTERNAL_NET: \"$HOME_NET\"\n"
4786 " HTTP_PORTS: \"any\"\n"
4788 " SHELLCODE_PORTS: \"$HTTP_PORTS\"\n"
4806 static int AddressConfVarsTest05(
void)
4808 static const char *dummy_conf_string =
4814 " address-groups:\n"
4816 " HOME_NET: \"any\"\n"
4818 " EXTERNAL_NET: [192.168.0.1]\n"
4822 " HTTP_PORTS: \"any\"\n"
4824 " SHELLCODE_PORTS: [80]\n"
4845 static int AddressConfVarsTest06(
void)
4848 static const char *dummy_conf_string =
4854 " address-groups:\n"
4857 "\"[2002:0000:3238:DFE1:63:0000:0000:FEFB,2002: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 "2004:0000:3238:DFE1:63:0000:0000:FEFB,2005:0000:3238:DFE1:63:0000:0000:FEFB,"
4860 "2006:0000:3238:DFE1:63:0000:0000:FEFB,2007: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,"
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]\"\n"
4993 " EXTERNAL_NET: \"any\"\n"
5020 UtRegisterTest(
"AddressTestParse04bug5081", AddressTestParse04bug5081);
5084 AddressTestAddressGroupSetup01);
5086 AddressTestAddressGroupSetup02);
5088 AddressTestAddressGroupSetup03);
5090 AddressTestAddressGroupSetup04);
5092 AddressTestAddressGroupSetup05);
5094 AddressTestAddressGroupSetup06);
5096 AddressTestAddressGroupSetup07);
5098 AddressTestAddressGroupSetup08);
5100 AddressTestAddressGroupSetup09);
5102 AddressTestAddressGroupSetup10);
5104 AddressTestAddressGroupSetup11);
5106 AddressTestAddressGroupSetup12);
5108 AddressTestAddressGroupSetup13);
5110 AddressTestAddressGroupSetupIPv414);
5112 AddressTestAddressGroupSetupIPv415);
5114 AddressTestAddressGroupSetupIPv416);
5117 AddressTestAddressGroupSetup14);
5119 AddressTestAddressGroupSetup15);
5121 AddressTestAddressGroupSetup16);
5123 AddressTestAddressGroupSetup17);
5125 AddressTestAddressGroupSetup18);
5127 AddressTestAddressGroupSetup19);
5129 AddressTestAddressGroupSetup20);
5131 AddressTestAddressGroupSetup21);
5133 AddressTestAddressGroupSetup22);
5135 AddressTestAddressGroupSetup23);
5137 AddressTestAddressGroupSetup24);
5139 AddressTestAddressGroupSetup25);
5141 AddressTestAddressGroupSetup26);
5144 AddressTestAddressGroupSetup27);
5146 AddressTestAddressGroupSetup28);
5148 AddressTestAddressGroupSetup29);
5150 AddressTestAddressGroupSetup30);
5152 AddressTestAddressGroupSetup31);
5154 AddressTestAddressGroupSetup32);
5156 AddressTestAddressGroupSetup33);
5158 AddressTestAddressGroupSetup34);
5160 AddressTestAddressGroupSetup35);
5162 AddressTestAddressGroupSetup36);
5164 AddressTestAddressGroupSetup37);
5166 AddressTestAddressGroupSetup38);
5168 AddressTestAddressGroupSetup39);
5170 AddressTestAddressGroupSetup40);
5172 AddressTestAddressGroupSetup41);
5174 AddressTestAddressGroupSetup42);
5176 AddressTestAddressGroupSetup43);
5178 AddressTestAddressGroupSetup44);
5180 AddressTestAddressGroupSetup45);
5182 AddressTestAddressGroupSetup46);
5184 AddressTestAddressGroupSetup47);
5186 AddressTestAddressGroupSetup48);
5200 AddressTestParseInvalidMask01);
5202 AddressTestParseInvalidMask02);
5204 AddressTestParseInvalidMask03);