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)
1148 if (ag2->
next != NULL)
1168 for (ag2 = gh->
ipv6_head; ag2 != NULL; ) {
1171 if (ag2->
prev == NULL)
1176 if (ag2->
next != NULL)
1195 for (tmp_ad = gh->
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
1198 for (tmp_ad = ghn->
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
1207 if (ipv4_applied != cnt) {
1209 "could be applied: %d != %d",
1218 if (ipv6_applied != cnt) {
1220 "could be applied: %d != %d",
1229 "merging addresses and negated addresses");
1241 SCLogDebug(
"Testing address conf vars for any misconfigured values");
1246 if (address_vars_node == NULL) {
1257 gh = DetectAddressHeadInit();
1261 ghn = DetectAddressHeadInit();
1266 if (seq_node->
val == NULL) {
1267 SCLogError(
"Address var \"%s\" probably has a sequence(something "
1268 "in brackets) value set without any quotes. Please "
1269 "quote it using \"..\".",
1274 int r = DetectAddressParse2(
1275 NULL, gh, ghn, seq_node->
val, 0, &var_list, 0);
1280 SCLogError(
"failed to parse address var \"%s\" with value \"%s\". "
1281 "Please check its syntax",
1282 seq_node->
name, seq_node->
val);
1286 if (DetectAddressIsCompleteIPSpace(ghn)) {
1287 SCLogError(
"address var - \"%s\" has the complete IP space negated "
1288 "with its value \"%s\". Rule address range is NIL. "
1289 "Probably have a !any or an address range that supplies "
1290 "a NULL address range",
1291 seq_node->
name, seq_node->
val);
1295 DetectAddressHeadFree(gh);
1297 DetectAddressHeadFree(ghn);
1304 DetectAddressHeadFree(gh);
1306 DetectAddressHeadFree(ghn);
1318 static uint32_t DetectAddressMapHashFunc(
HashListTable *ht,
void *data, uint16_t datalen)
1329 static char DetectAddressMapCompareFunc(
void *data1, uint16_t len1,
void *data2,
1339 static void DetectAddressMapFreeFunc(
void *data)
1343 DetectAddressHeadFree(map->
address);
1352 DetectAddressMapCompareFunc,
1353 DetectAddressMapFreeFunc);
1378 if (map->
string == NULL) {
1419 SCLogDebug(
"DetectAddressParse can not be run with NULL address");
1425 SCLogDebug(
"DetectAddressHeadInit for ghn failed");
1429 int r = DetectAddressParse2(
de_ctx, gh, ghn,
str, 0, NULL, 0);
1431 SCLogDebug(
"DetectAddressParse2 returned %d", r);
1432 DetectAddressHeadFree(ghn);
1444 DetectAddressHeadFree(ghn);
1449 DetectAddressHeadFree(ghn);
1450 return contains_negation ? 1 : 0;
1454 const char *
string,
bool *contains_negation)
1471 DetectAddressHeadFree(
head);
1473 }
else if (r == 1) {
1474 *contains_negation =
true;
1476 *contains_negation =
false;
1480 *contains_negation);
1496 DetectAddressCleanupList(gh->
ipv4_head);
1500 DetectAddressCleanupList(gh->
ipv6_head);
1608 uint16_t addrs_cnt,
const Address *a)
1612 if (addrs == NULL || addrs_cnt == 0) {
1616 uint32_t match_addr =
SCNtohl(a->addr_data32[0]);
1617 for (uint16_t idx = 0; idx < addrs_cnt; idx++) {
1618 if (match_addr >= addrs[idx].ip && match_addr <= addrs[idx].ip2) {
1641 uint16_t addrs_cnt,
const Address *a)
1645 if (addrs == NULL || addrs_cnt == 0) {
1649 uint32_t match_addr[4];
1650 match_addr[0] =
SCNtohl(a->addr_data32[0]);
1651 match_addr[1] =
SCNtohl(a->addr_data32[1]);
1652 match_addr[2] =
SCNtohl(a->addr_data32[2]);
1653 match_addr[3] =
SCNtohl(a->addr_data32[3]);
1658 for (uint16_t idx = 0; idx < addrs_cnt; idx++) {
1659 uint16_t result1 = 0, result2 = 0;
1662 if (0 == memcmp(match_addr, addrs[idx].ip,
sizeof(match_addr))) {
1665 if (0 == memcmp(match_addr, addrs[idx].ip2,
sizeof(match_addr))) {
1672 for (
int i = 0; i < 4; i++) {
1673 if (match_addr[i] > addrs[idx].ip[i]) {
1677 if (match_addr[i] < addrs[idx].ip[i]) {
1690 for (
int i = 0; i < 4; i++) {
1691 if (match_addr[i] < addrs[idx].ip2[i]) {
1695 if (match_addr[i] > addrs[idx].ip2[i]) {
1704 if (result1 == 1 && result2 == 1)
1760 SCLogDebug(
"What other address type can we have :-/");
1783 char ip[16], mask[16];
1785 memcpy(&in, &gr->
ip.addr_data32[0],
sizeof(in));
1786 PrintInet(AF_INET, &in, ip,
sizeof(ip));
1787 memcpy(&in, &gr->
ip2.addr_data32[0],
sizeof(in));
1788 PrintInet(AF_INET, &in, mask,
sizeof(mask));
1792 }
else if (gr->
ip.
family == AF_INET6) {
1793 struct in6_addr in6;
1794 char ip[66], mask[66];
1796 memcpy(&in6, &gr->
ip.addr_data32,
sizeof(in6));
1797 PrintInet(AF_INET6, &in6, ip,
sizeof(ip));
1798 memcpy(&in6, &gr->
ip2.addr_data32,
sizeof(in6));
1799 PrintInet(AF_INET6, &in6, mask,
sizeof(mask));
1829 if (a->
family == AF_INET) {
1832 }
else if (a->
family == AF_INET6) {
1837 for ( ; g != NULL; g = g->
next) {
1838 if (DetectAddressMatch(g,a) == 1) {
1850 static int UTHValidateDetectAddress(
DetectAddress *ad,
const char *one,
const char *two)
1852 char str1[46] =
"", str2[46] =
"";
1859 PrintInet(AF_INET, (
const void *)&ad->
ip.addr_data32[0], str1,
sizeof(str1));
1861 PrintInet(AF_INET, (
const void *)&ad->
ip2.addr_data32[0], str2,
sizeof(str2));
1864 if (strcmp(str1, one) != 0) {
1869 if (strcmp(str2, two) != 0) {
1878 PrintInet(AF_INET6, (
const void *)&ad->
ip.addr_data32[0], str1,
sizeof(str1));
1880 PrintInet(AF_INET6, (
const void *)&ad->
ip2.addr_data32[0], str2,
sizeof(str2));
1883 if (strcmp(str1, one) != 0) {
1888 if (strcmp(str2, two) != 0) {
1907 int expect = nranges;
1917 while (have < expect) {
1919 printf(
"bad head: have %d ranges, expected %d: ", have, expect);
1923 if (UTHValidateDetectAddress(ad, expectations[have].one, expectations[have].two) ==
FALSE)
1933 static int AddressTestParse01(
void)
1945 static int AddressTestParse02(
void)
1951 if (dd->
ip2.addr_data32[0] !=
SCNtohl(16909060) ||
1952 dd->
ip.addr_data32[0] !=
SCNtohl(16909060)) {
1956 printf(
"ip %"PRIu32
", ip2 %"PRIu32
"\n", dd->
ip.addr_data32[0], dd->
ip2.addr_data32[0]);
1964 static int AddressTestParse03(
void)
1966 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4/255.255.255.0");
1976 static int AddressTestParse04(
void)
1978 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4/255.255.255.0");
1981 char left[16], right[16];
1982 PrintInet(AF_INET, (
const void *)&dd->
ip.addr_data32[0], left,
sizeof(left));
1983 PrintInet(AF_INET, (
const void *)&dd->
ip2.addr_data32[0], right,
sizeof(right));
1995 static int AddressTestParse04bug5081(
void)
1997 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.64/26");
2000 char left[16], right[16];
2001 PrintInet(AF_INET, (
const void *)&dd->
ip.addr_data32[0], left,
sizeof(left));
2002 PrintInet(AF_INET, (
const void *)&dd->
ip2.addr_data32[0], right,
sizeof(right));
2011 static int AddressTestParse05(
void)
2023 static int AddressTestParse06(
void)
2029 if (dd->
ip2.addr_data32[0] !=
SCNtohl(16909311) ||
2030 dd->
ip.addr_data32[0] !=
SCNtohl(16909056)) {
2041 static int AddressTestParse07(
void)
2053 static int AddressTestParse08(
void)
2059 if (dd->
ip.addr_data32[0] !=
SCNtohl(536870912) || dd->
ip.addr_data32[1] != 0x00000000 ||
2060 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2062 dd->
ip2.addr_data32[0] !=
SCNtohl(1073741823) || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2063 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2075 static int AddressTestParse09(
void)
2077 DetectAddress *dd = DetectAddressParseSingle(
"2001::1/128");
2087 static int AddressTestParse10(
void)
2093 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2094 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2096 dd->
ip2.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip2.addr_data32[1] != 0x00000000 ||
2097 dd->
ip2.addr_data32[2] != 0x00000000 || dd->
ip2.addr_data32[3] != 0x00000000) {
2109 static int AddressTestParse11(
void)
2121 static int AddressTestParse12(
void)
2127 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2128 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2131 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2142 static int AddressTestParse13(
void)
2154 static int AddressTestParse14(
void)
2160 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2161 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2163 dd->
ip2.addr_data32[0] !=
SCNtohl(537001983) || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2164 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2175 static int AddressTestParse15(
void)
2187 static int AddressTestParse16(
void)
2193 if (dd->
ip.addr_data32[0] != 0x00000000 || dd->
ip.addr_data32[1] != 0x00000000 ||
2194 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2196 dd->
ip2.addr_data32[0] != 0xFFFFFFFF || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2197 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2208 static int AddressTestParse17(
void)
2210 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4-1.2.3.6");
2220 static int AddressTestParse18(
void)
2223 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4-1.2.3.6");
2226 if (dd->
ip2.addr_data32[0] !=
SCNtohl(16909062) ||
2227 dd->
ip.addr_data32[0] !=
SCNtohl(16909060)) {
2238 static int AddressTestParse19(
void)
2240 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.6-1.2.3.4");
2250 static int AddressTestParse20(
void)
2252 DetectAddress *dd = DetectAddressParseSingle(
"2001::1-2001::4");
2262 static int AddressTestParse21(
void)
2265 DetectAddress *dd = DetectAddressParseSingle(
"2001::1-2001::4");
2268 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2269 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] !=
SCNtohl(1) ||
2271 dd->
ip2.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip2.addr_data32[1] != 0x00000000 ||
2272 dd->
ip2.addr_data32[2] != 0x00000000 || dd->
ip2.addr_data32[3] !=
SCNtohl(4)) {
2283 static int AddressTestParse22(
void)
2285 DetectAddress *dd = DetectAddressParseSingle(
"2001::4-2001::1");
2295 static int AddressTestParse23(
void)
2301 DetectAddressHeadFree(gh);
2305 static int AddressTestParse24(
void)
2311 DetectAddressHeadFree(gh);
2315 static int AddressTestParse25(
void)
2321 DetectAddressHeadFree(gh);
2326 static int AddressTestParse26(
void)
2332 "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["
2334 "]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]"
2337 DetectAddressHeadFree(gh);
2338 gh = DetectAddressHeadInit();
2342 "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["
2344 "]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]"
2347 DetectAddressHeadFree(gh);
2351 static int AddressTestParse27(
void)
2353 DetectAddress *dd = DetectAddressParseSingle(
"!192.168.0.1");
2363 static int AddressTestParse28(
void)
2370 dd->
ip.addr_data32[0] ==
SCNtohl(16909060)) {
2381 static int AddressTestParse29(
void)
2383 DetectAddress *dd = DetectAddressParseSingle(
"!1.2.3.0/24");
2393 static int AddressTestParse30(
void)
2396 DetectAddress *dd = DetectAddressParseSingle(
"!1.2.3.4/24");
2400 dd->
ip.addr_data32[0] ==
SCNtohl(16909056) &&
2401 dd->
ip2.addr_data32[0] ==
SCNtohl(16909311)) {
2415 static int AddressTestParse31(
void)
2427 static int AddressTestParse32(
void)
2439 static int AddressTestParse33(
void)
2446 dd->
ip.addr_data32[0] ==
SCNtohl(536936448) && dd->
ip.addr_data32[1] == 0x00000000 &&
2447 dd->
ip.addr_data32[2] == 0x00000000 && dd->
ip.addr_data32[3] ==
SCNtohl(1)) {
2458 static int AddressTestParse34(
void)
2470 static int AddressTestParse35(
void)
2477 dd->
ip.addr_data32[0] ==
SCNtohl(536936448) && dd->
ip.addr_data32[1] == 0x00000000 &&
2478 dd->
ip.addr_data32[2] == 0x00000000 && dd->
ip.addr_data32[3] == 0x00000000 &&
2480 dd->
ip2.addr_data32[0] ==
SCNtohl(537001983) && dd->
ip2.addr_data32[1] == 0xFFFFFFFF &&
2481 dd->
ip2.addr_data32[2] == 0xFFFFFFFF && dd->
ip2.addr_data32[3] == 0xFFFFFFFF) {
2492 static int AddressTestParse36(
void)
2498 if (dd->
ip.addr_data32[0] !=
SCNtohl(0xFFFF0000) || dd->
ip.addr_data32[1] != 0x00000000 ||
2499 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2501 dd->
ip2.addr_data32[0] != 0xFFFFFFFF || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2502 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2516 static int AddressTestParse37(
void)
2522 if (dd->
ip.addr_data32[0] != 0x00000000 || dd->
ip.addr_data32[1] != 0x00000000 ||
2523 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2525 dd->
ip2.addr_data32[0] != 0xFFFFFFFF || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2526 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2539 static int AddressTestMatch01(
void)
2546 if (inet_pton(AF_INET,
"1.2.3.4", &in) != 1)
2548 memset(&a, 0,
sizeof(
Address));
2550 a.addr_data32[0] = in.s_addr;
2552 dd = DetectAddressParseSingle(
"1.2.3.4/24");
2554 if (DetectAddressMatch(dd, &a) == 0)
2564 static int AddressTestMatch02(
void)
2571 if (inet_pton(AF_INET,
"1.2.3.127", &in) != 1)
2573 memset(&a, 0,
sizeof(
Address));
2575 a.addr_data32[0] = in.s_addr;
2577 dd = DetectAddressParseSingle(
"1.2.3.4/25");
2579 if (DetectAddressMatch(dd, &a) == 0)
2589 static int AddressTestMatch03(
void)
2596 if (inet_pton(AF_INET,
"1.2.3.128", &in) != 1)
2598 memset(&a, 0,
sizeof(
Address));
2600 a.addr_data32[0] = in.s_addr;
2602 dd = DetectAddressParseSingle(
"1.2.3.4/25");
2604 if (DetectAddressMatch(dd, &a) == 1)
2614 static int AddressTestMatch04(
void)
2621 if (inet_pton(AF_INET,
"1.2.2.255", &in) != 1)
2623 memset(&a, 0,
sizeof(
Address));
2625 a.addr_data32[0] = in.s_addr;
2627 dd = DetectAddressParseSingle(
"1.2.3.4/25");
2629 if (DetectAddressMatch(dd, &a) == 1)
2639 static int AddressTestMatch05(
void)
2646 if (inet_pton(AF_INET,
"1.2.3.4", &in) != 1)
2648 memset(&a, 0,
sizeof(
Address));
2650 a.addr_data32[0] = in.s_addr;
2652 dd = DetectAddressParseSingle(
"1.2.3.4/32");
2654 if (DetectAddressMatch(dd, &a) == 0)
2664 static int AddressTestMatch06(
void)
2671 if (inet_pton(AF_INET,
"1.2.3.4", &in) != 1)
2673 memset(&a, 0,
sizeof(
Address));
2675 a.addr_data32[0] = in.s_addr;
2677 dd = DetectAddressParseSingle(
"0.0.0.0/0.0.0.0");
2679 if (DetectAddressMatch(dd, &a) == 0)
2689 static int AddressTestMatch07(
void)
2693 struct in6_addr in6;
2696 if (inet_pton(AF_INET6,
"2001::1", &in6) != 1)
2698 memset(&a, 0,
sizeof(
Address));
2699 a.family = AF_INET6;
2700 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2702 dd = DetectAddressParseSingle(
"2001::/3");
2704 if (DetectAddressMatch(dd, &a) == 0)
2714 static int AddressTestMatch08(
void)
2718 struct in6_addr in6;
2721 if (inet_pton(AF_INET6,
"1999:ffff:ffff:ffff:ffff:ffff:ffff:ffff", &in6) != 1)
2723 memset(&a, 0,
sizeof(
Address));
2724 a.family = AF_INET6;
2725 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2727 dd = DetectAddressParseSingle(
"2001::/3");
2729 if (DetectAddressMatch(dd, &a) == 1)
2739 static int AddressTestMatch09(
void)
2743 struct in6_addr in6;
2746 if (inet_pton(AF_INET6,
"2001::2", &in6) != 1)
2748 memset(&a, 0,
sizeof(
Address));
2749 a.family = AF_INET6;
2750 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2752 dd = DetectAddressParseSingle(
"2001::1/128");
2754 if (DetectAddressMatch(dd, &a) == 1)
2764 static int AddressTestMatch10(
void)
2768 struct in6_addr in6;
2771 if (inet_pton(AF_INET6,
"2001::2", &in6) != 1)
2773 memset(&a, 0,
sizeof(
Address));
2774 a.family = AF_INET6;
2775 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2777 dd = DetectAddressParseSingle(
"2001::1/126");
2779 if (DetectAddressMatch(dd, &a) == 0)
2789 static int AddressTestMatch11(
void)
2793 struct in6_addr in6;
2796 if (inet_pton(AF_INET6,
"2001::3", &in6) != 1)
2798 memset(&a, 0,
sizeof(
Address));
2799 a.family = AF_INET6;
2800 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2802 dd = DetectAddressParseSingle(
"2001::1/127");
2804 if (DetectAddressMatch(dd, &a) == 1)
2814 static int AddressTestCmp01(
void)
2819 da = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2820 if (da == NULL)
goto error;
2821 db = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2822 if (db == NULL)
goto error;
2837 static int AddressTestCmp02(
void)
2842 da = DetectAddressParseSingle(
"192.168.0.0/255.255.0.0");
2843 if (da == NULL)
goto error;
2844 db = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2845 if (db == NULL)
goto error;
2860 static int AddressTestCmp03(
void)
2865 da = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2866 if (da == NULL)
goto error;
2867 db = DetectAddressParseSingle(
"192.168.0.0/255.255.0.0");
2868 if (db == NULL)
goto error;
2883 static int AddressTestCmp04(
void)
2888 da = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2889 if (da == NULL)
goto error;
2890 db = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2891 if (db == NULL)
goto error;
2906 static int AddressTestCmp05(
void)
2911 da = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2912 if (da == NULL)
goto error;
2913 db = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2914 if (db == NULL)
goto error;
2929 static int AddressTestCmp06(
void)
2934 da = DetectAddressParseSingle(
"192.168.1.0/255.255.0.0");
2935 if (da == NULL)
goto error;
2936 db = DetectAddressParseSingle(
"192.168.0.0/255.255.0.0");
2937 if (db == NULL)
goto error;
2952 static int AddressTestCmpIPv407(
void)
2957 da = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2958 if (da == NULL)
goto error;
2959 db = DetectAddressParseSingle(
"192.168.1.128-192.168.2.128");
2960 if (db == NULL)
goto error;
2975 static int AddressTestCmpIPv408(
void)
2980 da = DetectAddressParseSingle(
"192.168.1.128-192.168.2.128");
2981 if (da == NULL)
goto error;
2982 db = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2983 if (db == NULL)
goto error;
2998 static int AddressTestCmp07(
void)
3003 da = DetectAddressParseSingle(
"2001::/3");
3004 if (da == NULL)
goto error;
3005 db = DetectAddressParseSingle(
"2001::1/3");
3006 if (db == NULL)
goto error;
3021 static int AddressTestCmp08(
void)
3026 da = DetectAddressParseSingle(
"2001::/3");
3027 if (da == NULL)
goto error;
3028 db = DetectAddressParseSingle(
"2001::/8");
3029 if (db == NULL)
goto error;
3044 static int AddressTestCmp09(
void)
3049 da = DetectAddressParseSingle(
"2001::/8");
3050 if (da == NULL)
goto error;
3051 db = DetectAddressParseSingle(
"2001::/3");
3052 if (db == NULL)
goto error;
3067 static int AddressTestCmp10(
void)
3072 da = DetectAddressParseSingle(
"2001:1:2:3:0:0:0:0/64");
3073 if (da == NULL)
goto error;
3074 db = DetectAddressParseSingle(
"2001:1:2:4:0:0:0:0/64");
3075 if (db == NULL)
goto error;
3090 static int AddressTestCmp11(
void)
3095 da = DetectAddressParseSingle(
"2001:1:2:4:0:0:0:0/64");
3096 if (da == NULL)
goto error;
3097 db = DetectAddressParseSingle(
"2001:1:2:3:0:0:0:0/64");
3098 if (db == NULL)
goto error;
3113 static int AddressTestCmp12(
void)
3118 da = DetectAddressParseSingle(
"2001:1:2:3:1:0:0:0/64");
3119 if (da == NULL)
goto error;
3120 db = DetectAddressParseSingle(
"2001:1:2:3:2:0:0:0/64");
3121 if (db == NULL)
goto error;
3136 static int AddressTestAddressGroupSetup01(
void)
3146 DetectAddressHeadFree(gh);
3151 static int AddressTestAddressGroupSetup02(
void)
3161 DetectAddressHeadFree(gh);
3166 static int AddressTestAddressGroupSetup03(
void)
3177 if (r == 0 && gh->
ipv4_head != prev_head &&
3183 DetectAddressHeadFree(gh);
3188 static int AddressTestAddressGroupSetup04(
void)
3199 if (r == 0 && gh->
ipv4_head != prev_head &&
3211 DetectAddressHeadFree(gh);
3216 static int AddressTestAddressGroupSetup05(
void)
3227 if (r == 0 && gh->
ipv4_head == prev_head &&
3239 DetectAddressHeadFree(gh);
3244 static int AddressTestAddressGroupSetup06(
void)
3255 if (r == 0 && gh->
ipv4_head == prev_head &&
3261 DetectAddressHeadFree(gh);
3266 static int AddressTestAddressGroupSetup07(
void)
3282 DetectAddressHeadFree(gh);
3287 static int AddressTestAddressGroupSetup08(
void)
3303 DetectAddressHeadFree(gh);
3308 static int AddressTestAddressGroupSetup09(
void)
3324 DetectAddressHeadFree(gh);
3329 static int AddressTestAddressGroupSetup10(
void)
3345 DetectAddressHeadFree(gh);
3350 static int AddressTestAddressGroupSetup11(
void)
3363 *three = two->
next, *four = three->
next,
3373 if (one->
ip.addr_data32[0] == 0x00000000 && one->
ip2.addr_data32[0] ==
SCNtohl(168430079) &&
3374 two->ip.addr_data32[0] ==
SCNtohl(168430080) && two->ip2.addr_data32[0] ==
SCNtohl(168430089) &&
3375 three->ip.addr_data32[0] ==
SCNtohl(168430090) && three->ip2.addr_data32[0] ==
SCNtohl(168430335) &&
3376 four->ip.addr_data32[0] ==
SCNtohl(168430336) && four->ip2.addr_data32[0] ==
SCNtohl(168430337) &&
3377 five->ip.addr_data32[0] ==
SCNtohl(168430338) && five->ip2.addr_data32[0] == 0xFFFFFFFF) {
3384 DetectAddressHeadFree(gh);
3389 static int AddressTestAddressGroupSetup12 (
void)
3402 *three = two->
next, *four = three->
next,
3412 if (one->
ip.addr_data32[0] == 0x00000000 && one->
ip2.addr_data32[0] ==
SCNtohl(168430079) &&
3413 two->ip.addr_data32[0] ==
SCNtohl(168430080) && two->ip2.addr_data32[0] ==
SCNtohl(168430089) &&
3414 three->ip.addr_data32[0] ==
SCNtohl(168430090) && three->ip2.addr_data32[0] ==
SCNtohl(168430335) &&
3415 four->ip.addr_data32[0] ==
SCNtohl(168430336) && four->ip2.addr_data32[0] ==
SCNtohl(168430337) &&
3416 five->ip.addr_data32[0] ==
SCNtohl(168430338) && five->ip2.addr_data32[0] == 0xFFFFFFFF) {
3423 DetectAddressHeadFree(gh);
3428 static int AddressTestAddressGroupSetup13(
void)
3441 *three = two->
next, *four = three->
next,
3451 if (one->
ip.addr_data32[0] == 0x00000000 && one->
ip2.addr_data32[0] ==
SCNtohl(168430079) &&
3452 two->ip.addr_data32[0] ==
SCNtohl(168430080) && two->ip2.addr_data32[0] ==
SCNtohl(168430089) &&
3453 three->ip.addr_data32[0] ==
SCNtohl(168430090) && three->ip2.addr_data32[0] ==
SCNtohl(168430335) &&
3454 four->ip.addr_data32[0] ==
SCNtohl(168430336) && four->ip2.addr_data32[0] ==
SCNtohl(168430337) &&
3455 five->ip.addr_data32[0] ==
SCNtohl(168430338) && five->ip2.addr_data32[0] == 0xFFFFFFFF) {
3462 DetectAddressHeadFree(gh);
3467 static int AddressTestAddressGroupSetupIPv414(
void)
3488 DetectAddressHeadFree(gh);
3493 static int AddressTestAddressGroupSetupIPv415(
void)
3511 DetectAddressHeadFree(gh);
3515 static int AddressTestAddressGroupSetupIPv416(
void)
3533 DetectAddressHeadFree(gh);
3537 static int AddressTestAddressGroupSetup14(
void)
3547 DetectAddressHeadFree(gh);
3552 static int AddressTestAddressGroupSetup15(
void)
3562 DetectAddressHeadFree(gh);
3567 static int AddressTestAddressGroupSetup16(
void)
3578 if (r == 0 && gh->
ipv6_head != prev_head &&
3584 DetectAddressHeadFree(gh);
3589 static int AddressTestAddressGroupSetup17(
void)
3600 if (r == 0 && gh->
ipv6_head != prev_head &&
3612 DetectAddressHeadFree(gh);
3617 static int AddressTestAddressGroupSetup18(
void)
3628 if (r == 0 && gh->
ipv6_head == prev_head &&
3640 DetectAddressHeadFree(gh);
3645 static int AddressTestAddressGroupSetup19(
void)
3656 if (r == 0 && gh->
ipv6_head == prev_head &&
3662 DetectAddressHeadFree(gh);
3667 static int AddressTestAddressGroupSetup20(
void)
3683 DetectAddressHeadFree(gh);
3688 static int AddressTestAddressGroupSetup21(
void)
3704 DetectAddressHeadFree(gh);
3709 static int AddressTestAddressGroupSetup22(
void)
3725 DetectAddressHeadFree(gh);
3730 static int AddressTestAddressGroupSetup23(
void)
3746 DetectAddressHeadFree(gh);
3751 static int AddressTestAddressGroupSetup24(
void)
3764 *three = two->
next, *four = three->
next,
3766 if (one->
ip.addr_data32[0] == 0x00000000 &&
3767 one->
ip.addr_data32[1] == 0x00000000 &&
3768 one->
ip.addr_data32[2] == 0x00000000 &&
3769 one->
ip.addr_data32[3] == 0x00000000 &&
3770 one->
ip2.addr_data32[0] ==
SCNtohl(536870911) &&
3771 one->
ip2.addr_data32[1] == 0xFFFFFFFF &&
3772 one->
ip2.addr_data32[2] == 0xFFFFFFFF &&
3773 one->
ip2.addr_data32[3] == 0xFFFFFFFF &&
3775 two->
ip.addr_data32[0] ==
SCNtohl(536870912) &&
3776 two->
ip.addr_data32[1] == 0x00000000 &&
3777 two->
ip.addr_data32[2] == 0x00000000 &&
3778 two->
ip.addr_data32[3] == 0x00000000 &&
3779 two->
ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3780 two->
ip2.addr_data32[1] == 0x00000000 &&
3781 two->
ip2.addr_data32[2] == 0x00000000 &&
3784 three->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3785 three->ip.addr_data32[1] == 0x00000000 &&
3786 three->ip.addr_data32[2] == 0x00000000 &&
3787 three->ip.addr_data32[3] ==
SCNtohl(4) &&
3788 three->ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3789 three->ip2.addr_data32[1] == 0x00000000 &&
3790 three->ip2.addr_data32[2] == 0x00000000 &&
3791 three->ip2.addr_data32[3] ==
SCNtohl(6) &&
3793 four->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3794 four->ip.addr_data32[1] == 0x00000000 &&
3795 four->ip.addr_data32[2] == 0x00000000 &&
3796 four->ip.addr_data32[3] ==
SCNtohl(7) &&
3797 four->ip2.addr_data32[0] ==
SCNtohl(1073741823) &&
3798 four->ip2.addr_data32[1] == 0xFFFFFFFF &&
3799 four->ip2.addr_data32[2] == 0xFFFFFFFF &&
3800 four->ip2.addr_data32[3] == 0xFFFFFFFF &&
3802 five->ip.addr_data32[0] ==
SCNtohl(1073741824) &&
3803 five->ip.addr_data32[1] == 0x00000000 &&
3804 five->ip.addr_data32[2] == 0x00000000 &&
3805 five->ip.addr_data32[3] == 0x00000000 &&
3806 five->ip2.addr_data32[0] == 0xFFFFFFFF &&
3807 five->ip2.addr_data32[1] == 0xFFFFFFFF &&
3808 five->ip2.addr_data32[2] == 0xFFFFFFFF &&
3809 five->ip2.addr_data32[3] == 0xFFFFFFFF) {
3816 DetectAddressHeadFree(gh);
3821 static int AddressTestAddressGroupSetup25(
void)
3834 *three = two->
next, *four = three->
next,
3836 if (one->
ip.addr_data32[0] == 0x00000000 &&
3837 one->
ip.addr_data32[1] == 0x00000000 &&
3838 one->
ip.addr_data32[2] == 0x00000000 &&
3839 one->
ip.addr_data32[3] == 0x00000000 &&
3840 one->
ip2.addr_data32[0] ==
SCNtohl(536870911) &&
3841 one->
ip2.addr_data32[1] == 0xFFFFFFFF &&
3842 one->
ip2.addr_data32[2] == 0xFFFFFFFF &&
3843 one->
ip2.addr_data32[3] == 0xFFFFFFFF &&
3845 two->
ip.addr_data32[0] ==
SCNtohl(536870912) &&
3846 two->
ip.addr_data32[1] == 0x00000000 &&
3847 two->
ip.addr_data32[2] == 0x00000000 &&
3848 two->
ip.addr_data32[3] == 0x00000000 &&
3849 two->
ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3850 two->
ip2.addr_data32[1] == 0x00000000 &&
3851 two->
ip2.addr_data32[2] == 0x00000000 &&
3854 three->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3855 three->ip.addr_data32[1] == 0x00000000 &&
3856 three->ip.addr_data32[2] == 0x00000000 &&
3857 three->ip.addr_data32[3] ==
SCNtohl(4) &&
3858 three->ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3859 three->ip2.addr_data32[1] == 0x00000000 &&
3860 three->ip2.addr_data32[2] == 0x00000000 &&
3861 three->ip2.addr_data32[3] ==
SCNtohl(6) &&
3863 four->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3864 four->ip.addr_data32[1] == 0x00000000 &&
3865 four->ip.addr_data32[2] == 0x00000000 &&
3866 four->ip.addr_data32[3] ==
SCNtohl(7) &&
3867 four->ip2.addr_data32[0] ==
SCNtohl(1073741823) &&
3868 four->ip2.addr_data32[1] == 0xFFFFFFFF &&
3869 four->ip2.addr_data32[2] == 0xFFFFFFFF &&
3870 four->ip2.addr_data32[3] == 0xFFFFFFFF &&
3872 five->ip.addr_data32[0] ==
SCNtohl(1073741824) &&
3873 five->ip.addr_data32[1] == 0x00000000 &&
3874 five->ip.addr_data32[2] == 0x00000000 &&
3875 five->ip.addr_data32[3] == 0x00000000 &&
3876 five->ip2.addr_data32[0] == 0xFFFFFFFF &&
3877 five->ip2.addr_data32[1] == 0xFFFFFFFF &&
3878 five->ip2.addr_data32[2] == 0xFFFFFFFF &&
3879 five->ip2.addr_data32[3] == 0xFFFFFFFF) {
3886 DetectAddressHeadFree(gh);
3891 static int AddressTestAddressGroupSetup26(
void)
3904 *three = two->
next, *four = three->
next,
3906 if (one->
ip.addr_data32[0] == 0x00000000 &&
3907 one->
ip.addr_data32[1] == 0x00000000 &&
3908 one->
ip.addr_data32[2] == 0x00000000 &&
3909 one->
ip.addr_data32[3] == 0x00000000 &&
3910 one->
ip2.addr_data32[0] ==
SCNtohl(536870911) &&
3911 one->
ip2.addr_data32[1] == 0xFFFFFFFF &&
3912 one->
ip2.addr_data32[2] == 0xFFFFFFFF &&
3913 one->
ip2.addr_data32[3] == 0xFFFFFFFF &&
3915 two->
ip.addr_data32[0] ==
SCNtohl(536870912) &&
3916 two->
ip.addr_data32[1] == 0x00000000 &&
3917 two->
ip.addr_data32[2] == 0x00000000 &&
3918 two->
ip.addr_data32[3] == 0x00000000 &&
3919 two->
ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3920 two->
ip2.addr_data32[1] == 0x00000000 &&
3921 two->
ip2.addr_data32[2] == 0x00000000 &&
3924 three->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3925 three->ip.addr_data32[1] == 0x00000000 &&
3926 three->ip.addr_data32[2] == 0x00000000 &&
3927 three->ip.addr_data32[3] ==
SCNtohl(4) &&
3928 three->ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3929 three->ip2.addr_data32[1] == 0x00000000 &&
3930 three->ip2.addr_data32[2] == 0x00000000 &&
3931 three->ip2.addr_data32[3] ==
SCNtohl(6) &&
3933 four->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3934 four->ip.addr_data32[1] == 0x00000000 &&
3935 four->ip.addr_data32[2] == 0x00000000 &&
3936 four->ip.addr_data32[3] ==
SCNtohl(7) &&
3937 four->ip2.addr_data32[0] ==
SCNtohl(1073741823) &&
3938 four->ip2.addr_data32[1] == 0xFFFFFFFF &&
3939 four->ip2.addr_data32[2] == 0xFFFFFFFF &&
3940 four->ip2.addr_data32[3] == 0xFFFFFFFF &&
3942 five->ip.addr_data32[0] ==
SCNtohl(1073741824) &&
3943 five->ip.addr_data32[1] == 0x00000000 &&
3944 five->ip.addr_data32[2] == 0x00000000 &&
3945 five->ip.addr_data32[3] == 0x00000000 &&
3946 five->ip2.addr_data32[0] == 0xFFFFFFFF &&
3947 five->ip2.addr_data32[1] == 0xFFFFFFFF &&
3948 five->ip2.addr_data32[2] == 0xFFFFFFFF &&
3949 five->ip2.addr_data32[3] == 0xFFFFFFFF) {
3956 DetectAddressHeadFree(gh);
3961 static int AddressTestAddressGroupSetup27(
void)
3971 DetectAddressHeadFree(gh);
3976 static int AddressTestAddressGroupSetup28(
void)
3986 DetectAddressHeadFree(gh);
3991 static int AddressTestAddressGroupSetup29(
void)
4001 DetectAddressHeadFree(gh);
4006 static int AddressTestAddressGroupSetup30(
void)
4012 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]]");
4016 DetectAddressHeadFree(gh);
4021 static int AddressTestAddressGroupSetup31(
void)
4027 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]]]");
4031 DetectAddressHeadFree(gh);
4036 static int AddressTestAddressGroupSetup32(
void)
4042 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]]]]");
4046 DetectAddressHeadFree(gh);
4051 static int AddressTestAddressGroupSetup33(
void)
4061 DetectAddressHeadFree(gh);
4066 static int AddressTestAddressGroupSetup34(
void)
4076 DetectAddressHeadFree(gh);
4081 static int AddressTestAddressGroupSetup35(
void)
4091 DetectAddressHeadFree(gh);
4096 static int AddressTestAddressGroupSetup36 (
void)
4102 int r =
DetectAddressParse(NULL, gh,
"[1.0.0.0/8,[2.0.0.0/8,[3.0.0.0/8,!1.1.1.1]]]");
4106 DetectAddressHeadFree(gh);
4111 static int AddressTestAddressGroupSetup37(
void)
4121 DetectAddressHeadFree(gh);
4126 static int AddressTestAddressGroupSetup38(
void)
4129 {
"0.0.0.0",
"192.167.255.255" },
4130 {
"192.168.14.0",
"192.168.14.255" },
4131 {
"192.169.0.0",
"255.255.255.255" } };
4138 if (UTHValidateDetectAddressHead(gh, 3, expectations) ==
TRUE)
4142 DetectAddressHeadFree(gh);
4147 static int AddressTestAddressGroupSetup39(
void)
4150 {
"0.0.0.0",
"192.167.255.255" },
4151 {
"192.168.14.0",
"192.168.14.255" },
4152 {
"192.169.0.0",
"255.255.255.255" } };
4159 if (UTHValidateDetectAddressHead(gh, 3, expectations) ==
TRUE)
4163 DetectAddressHeadFree(gh);
4168 static int AddressTestAddressGroupSetup40(
void)
4171 {
"0.0.0.0",
"192.167.255.255" },
4172 {
"192.168.14.0",
"192.168.14.255" },
4173 {
"192.169.0.0",
"255.255.255.255" } };
4179 if (UTHValidateDetectAddressHead(gh, 3, expectations) ==
TRUE)
4183 DetectAddressHeadFree(gh);
4188 static int AddressTestAddressGroupSetup41(
void)
4191 {
"0.0.0.0",
"192.167.255.255" },
4192 {
"192.168.14.0",
"192.168.14.255" },
4193 {
"192.169.0.0",
"255.255.255.255" } };
4199 if (UTHValidateDetectAddressHead(gh, 3, expectations) ==
TRUE)
4203 DetectAddressHeadFree(gh);
4208 static int AddressTestAddressGroupSetup42(
void)
4211 {
"2000:0000:0000:0000:0000:0000:0000:0000",
"3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" } };
4217 if (UTHValidateDetectAddressHead(gh, 1, expectations) ==
TRUE)
4221 DetectAddressHeadFree(gh);
4226 static int AddressTestAddressGroupSetup43(
void)
4229 {
"2000:0000:0000:0000:0000:0000:0000:0000",
"2fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" },
4230 {
"3800:0000:0000:0000:0000:0000:0000:0000",
"3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" } };
4236 if (UTHValidateDetectAddressHead(gh, 2, expectations) ==
TRUE)
4240 DetectAddressHeadFree(gh);
4245 static int AddressTestAddressGroupSetup44(
void)
4248 {
"3ffe:ffff:7654:feda:1245:ba98:0000:0000",
"3ffe:ffff:7654:feda:1245:ba98:ffff:ffff" }};
4254 if (UTHValidateDetectAddressHead(gh, 1, expectations) ==
TRUE)
4258 DetectAddressHeadFree(gh);
4263 static int AddressTestAddressGroupSetup45(
void)
4273 DetectAddressHeadFree(gh);
4278 static int AddressTestAddressGroupSetup46(
void)
4281 {
"0.0.0.0",
"192.167.255.255" },
4282 {
"192.168.1.0",
"192.168.1.255" },
4283 {
"192.168.3.0",
"192.168.3.255" },
4284 {
"192.169.0.0",
"255.255.255.255" } };
4288 int r =
DetectAddressParse(NULL, gh,
"[![192.168.0.0/16,![192.168.1.0/24,192.168.3.0/24]]]");
4290 if (UTHValidateDetectAddressHead(gh, 4, expectations) ==
TRUE)
4294 DetectAddressHeadFree(gh);
4300 static int AddressTestAddressGroupSetup47(
void)
4303 {
"0.0.0.0",
"192.167.255.255" },
4304 {
"192.168.1.0",
"192.168.1.255" },
4305 {
"192.168.3.0",
"192.168.3.255" },
4306 {
"192.168.5.0",
"192.168.5.255" },
4307 {
"192.169.0.0",
"255.255.255.255" } };
4311 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]]");
4313 if (UTHValidateDetectAddressHead(gh, 5, expectations) ==
TRUE)
4317 DetectAddressHeadFree(gh);
4323 static int AddressTestAddressGroupSetup48(
void)
4326 {
"192.168.0.0",
"192.168.0.255" },
4327 {
"192.168.2.0",
"192.168.2.255" },
4328 {
"192.168.4.0",
"192.168.4.255" },
4329 {
"192.168.6.0",
"192.168.255.255" } };
4333 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]");
4335 if (UTHValidateDetectAddressHead(gh, 4, expectations) ==
TRUE)
4339 DetectAddressHeadFree(gh);
4344 static int AddressTestCutIPv401(
void)
4347 DetectAddress *a = DetectAddressParseSingle(
"1.2.3.0/255.255.255.0");
4349 DetectAddress *b = DetectAddressParseSingle(
"1.2.2.0-1.2.3.4");
4352 FAIL_IF(DetectAddressCut(NULL, a, b, &c) == -1);
4360 static int AddressTestCutIPv402(
void)
4363 a = DetectAddressParseSingle(
"1.2.3.0/255.255.255.0");
4364 b = DetectAddressParseSingle(
"1.2.2.0-1.2.3.4");
4366 if (DetectAddressCut(NULL, a, b, &c) == -1)
4384 static int AddressTestCutIPv403(
void)
4387 a = DetectAddressParseSingle(
"1.2.3.0/255.255.255.0");
4388 b = DetectAddressParseSingle(
"1.2.2.0-1.2.3.4");
4390 if (DetectAddressCut(NULL, a, b, &c) == -1)
4396 if (a->
ip.addr_data32[0] !=
SCNtohl(16908800) || a->
ip2.addr_data32[0] !=
SCNtohl(16909055))
4398 if (b->
ip.addr_data32[0] !=
SCNtohl(16909056) || b->
ip2.addr_data32[0] !=
SCNtohl(16909060))
4400 if (c->
ip.addr_data32[0] !=
SCNtohl(16909061) || c->
ip2.addr_data32[0] !=
SCNtohl(16909311))
4415 static int AddressTestCutIPv404(
void)
4418 a = DetectAddressParseSingle(
"1.2.3.3-1.2.3.6");
4419 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.5");
4421 if (DetectAddressCut(NULL, a, b, &c) == -1)
4427 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4429 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909061))
4431 if (c->
ip.addr_data32[0] !=
SCNtohl(16909062) || c->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4447 static int AddressTestCutIPv405(
void)
4450 a = DetectAddressParseSingle(
"1.2.3.3-1.2.3.6");
4451 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4453 if (DetectAddressCut(NULL, a, b, &c) == -1)
4459 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4461 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4463 if (c->
ip.addr_data32[0] !=
SCNtohl(16909063) || c->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4478 static int AddressTestCutIPv406(
void)
4481 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4482 b = DetectAddressParseSingle(
"1.2.3.3-1.2.3.6");
4484 if (DetectAddressCut(NULL, a, b, &c) == -1)
4490 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4492 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4494 if (c->
ip.addr_data32[0] !=
SCNtohl(16909063) || c->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4509 static int AddressTestCutIPv407(
void)
4512 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.6");
4513 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4515 if (DetectAddressCut(NULL, a, b, &c) == -1)
4521 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4523 if (b->
ip.addr_data32[0] !=
SCNtohl(16909063) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4538 static int AddressTestCutIPv408(
void)
4541 a = DetectAddressParseSingle(
"1.2.3.3-1.2.3.9");
4542 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4544 if (DetectAddressCut(NULL, a, b, &c) == -1)
4550 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4552 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4567 static int AddressTestCutIPv409(
void)
4570 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4571 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.6");
4573 if (DetectAddressCut(NULL, a, b, &c) == -1)
4579 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4581 if (b->
ip.addr_data32[0] !=
SCNtohl(16909063) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4596 static int AddressTestCutIPv410(
void)
4599 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4600 b = DetectAddressParseSingle(
"1.2.3.3-1.2.3.9");
4602 if (DetectAddressCut(NULL, a, b, &c) == -1)
4608 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4610 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4613 printf(
"ip %u ip2 %u ", (uint32_t)htonl(a->
ip.addr_data32[0]), (uint32_t)htonl(a->
ip2.addr_data32[0]));
4627 static int AddressTestParseInvalidMask01(
void)
4632 dd = DetectAddressParseSingle(
"192.168.2.0/33");
4640 static int AddressTestParseInvalidMask02(
void)
4645 dd = DetectAddressParseSingle(
"192.168.2.0/255.255.257.0");
4653 static int AddressTestParseInvalidMask03(
void)
4658 dd = DetectAddressParseSingle(
"192.168.2.0/blue");
4666 static int AddressConfVarsTest01(
void)
4668 static const char *dummy_conf_string =
4674 " address-groups:\n"
4676 " HOME_NET: \"any\"\n"
4678 " EXTERNAL_NET: \"!any\"\n"
4682 " HTTP_PORTS: \"any\"\n"
4684 " SHELLCODE_PORTS: \"!any\"\n"
4702 static int AddressConfVarsTest02(
void)
4704 static const char *dummy_conf_string =
4710 " address-groups:\n"
4712 " HOME_NET: \"any\"\n"
4714 " EXTERNAL_NET: \"any\"\n"
4718 " HTTP_PORTS: \"any\"\n"
4720 " SHELLCODE_PORTS: \"!any\"\n"
4738 static int AddressConfVarsTest03(
void)
4740 static const char *dummy_conf_string =
4746 " address-groups:\n"
4748 " HOME_NET: \"any\"\n"
4750 " EXTERNAL_NET: \"!$HOME_NET\"\n"
4754 " HTTP_PORTS: \"any\"\n"
4756 " SHELLCODE_PORTS: \"!$HTTP_PORTS\"\n"
4774 static int AddressConfVarsTest04(
void)
4776 static const char *dummy_conf_string =
4782 " address-groups:\n"
4784 " HOME_NET: \"any\"\n"
4786 " EXTERNAL_NET: \"$HOME_NET\"\n"
4790 " HTTP_PORTS: \"any\"\n"
4792 " SHELLCODE_PORTS: \"$HTTP_PORTS\"\n"
4810 static int AddressConfVarsTest05(
void)
4812 static const char *dummy_conf_string =
4818 " address-groups:\n"
4820 " HOME_NET: \"any\"\n"
4822 " EXTERNAL_NET: [192.168.0.1]\n"
4826 " HTTP_PORTS: \"any\"\n"
4828 " SHELLCODE_PORTS: [80]\n"
4849 static int AddressConfVarsTest06(
void)
4852 static const char *dummy_conf_string =
4858 " address-groups:\n"
4861 "\"[2002:0000:3238:DFE1:63:0000:0000:FEFB,2002: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 "2004:0000:3238:DFE1:63:0000:0000:FEFB,2005:0000:3238:DFE1:63:0000:0000:FEFB,"
4864 "2006:0000:3238:DFE1:63:0000:0000:FEFB,2007: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,"
4995 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB]\"\n"
4997 " EXTERNAL_NET: \"any\"\n"
5024 UtRegisterTest(
"AddressTestParse04bug5081", AddressTestParse04bug5081);
5088 AddressTestAddressGroupSetup01);
5090 AddressTestAddressGroupSetup02);
5092 AddressTestAddressGroupSetup03);
5094 AddressTestAddressGroupSetup04);
5096 AddressTestAddressGroupSetup05);
5098 AddressTestAddressGroupSetup06);
5100 AddressTestAddressGroupSetup07);
5102 AddressTestAddressGroupSetup08);
5104 AddressTestAddressGroupSetup09);
5106 AddressTestAddressGroupSetup10);
5108 AddressTestAddressGroupSetup11);
5110 AddressTestAddressGroupSetup12);
5112 AddressTestAddressGroupSetup13);
5114 AddressTestAddressGroupSetupIPv414);
5116 AddressTestAddressGroupSetupIPv415);
5118 AddressTestAddressGroupSetupIPv416);
5121 AddressTestAddressGroupSetup14);
5123 AddressTestAddressGroupSetup15);
5125 AddressTestAddressGroupSetup16);
5127 AddressTestAddressGroupSetup17);
5129 AddressTestAddressGroupSetup18);
5131 AddressTestAddressGroupSetup19);
5133 AddressTestAddressGroupSetup20);
5135 AddressTestAddressGroupSetup21);
5137 AddressTestAddressGroupSetup22);
5139 AddressTestAddressGroupSetup23);
5141 AddressTestAddressGroupSetup24);
5143 AddressTestAddressGroupSetup25);
5145 AddressTestAddressGroupSetup26);
5148 AddressTestAddressGroupSetup27);
5150 AddressTestAddressGroupSetup28);
5152 AddressTestAddressGroupSetup29);
5154 AddressTestAddressGroupSetup30);
5156 AddressTestAddressGroupSetup31);
5158 AddressTestAddressGroupSetup32);
5160 AddressTestAddressGroupSetup33);
5162 AddressTestAddressGroupSetup34);
5164 AddressTestAddressGroupSetup35);
5166 AddressTestAddressGroupSetup36);
5168 AddressTestAddressGroupSetup37);
5170 AddressTestAddressGroupSetup38);
5172 AddressTestAddressGroupSetup39);
5174 AddressTestAddressGroupSetup40);
5176 AddressTestAddressGroupSetup41);
5178 AddressTestAddressGroupSetup42);
5180 AddressTestAddressGroupSetup43);
5182 AddressTestAddressGroupSetup44);
5184 AddressTestAddressGroupSetup45);
5186 AddressTestAddressGroupSetup46);
5188 AddressTestAddressGroupSetup47);
5190 AddressTestAddressGroupSetup48);
5204 AddressTestParseInvalidMask01);
5206 AddressTestParseInvalidMask02);
5208 AddressTestParseInvalidMask03);