52 #define DetectAddressPrint(...)
58 DetectAddressHead *ghn,
const char *s,
int negate, ResolvedVariablesList *var_list,
169 if (newhead->
ip.
family == AF_INET) {
171 }
else if (newhead->
ip.
family == AF_INET6) {
196 if (new->ip.family == AF_INET)
198 else if (new->ip.family == AF_INET6)
229 head = GetHeadPtr(gh,
new);
235 for (cur =
head; cur != NULL; cur = cur->
next) {
251 if (cur->
next == NULL) {
260 if (cur->
prev != NULL)
270 if (SetHeadPtr(gh,
head) < 0)
279 r = DetectAddressCut(
de_ctx, cur,
new, &c);
283 DetectAddressInsert(
de_ctx, gh,
new);
285 DetectAddressInsert(
de_ctx, gh, c);
290 r = DetectAddressCut(
de_ctx, cur,
new, &c);
294 DetectAddressInsert(
de_ctx, gh,
new);
296 DetectAddressInsert(
de_ctx, gh, c);
301 r = DetectAddressCut(
de_ctx, cur,
new, &c);
305 DetectAddressInsert(
de_ctx, gh,
new);
307 DetectAddressInsert(
de_ctx, gh, c);
312 r = DetectAddressCut(
de_ctx, cur,
new,&c);
316 DetectAddressInsert(
de_ctx, gh,
new);
318 DetectAddressInsert(
de_ctx, gh, c);
327 if (SetHeadPtr(gh,
head) < 0) {
355 while (item != NULL && it != NULL) {
365 if (!(item == NULL && it == NULL)) {
409 if ((strchr(
str,
':')) == NULL) {
415 if ((mask = strchr(ip,
'/')) != NULL) {
417 ip[mask - ip] =
'\0';
419 uint32_t ip4addr = 0;
420 uint32_t netmask = 0;
422 if ((strchr (mask,
'.')) == NULL) {
425 for (
size_t u = 0; u < strlen(mask); u++) {
426 if(!isdigit((
unsigned char)mask[u]))
436 r = inet_pton(AF_INET, mask, &in);
446 "netmask \"%s\" is not usable. Only netmasks that are compatible with "
447 "CIDR notation are supported. See ticket #5168.",
453 r = inet_pton(AF_INET, ip, &in);
459 dd->
ip.addr_data32[0] = dd->
ip2.addr_data32[0] = ip4addr & netmask;
460 dd->
ip2.addr_data32[0] |=~ netmask;
461 }
else if ((ip2 = strchr(ip,
'-')) != NULL) {
466 r = inet_pton(AF_INET, ip, &in);
469 dd->
ip.addr_data32[0] = in.s_addr;
471 r = inet_pton(AF_INET, ip2, &in);
474 dd->
ip2.addr_data32[0] = in.s_addr;
481 r = inet_pton(AF_INET, ip, &in);
485 dd->
ip.addr_data32[0] = in.s_addr;
486 dd->
ip2.addr_data32[0] = in.s_addr;
490 struct in6_addr in6, mask6;
491 uint32_t ip6addr[4], netmask[4];
495 if ((mask = strchr(ip,
'/')) != NULL) {
496 ip[mask - ip] =
'\0';
503 r = inet_pton(AF_INET6, ip, &in6);
506 memcpy(&ip6addr, &in6.s6_addr,
sizeof(ip6addr));
509 memcpy(&netmask, &mask6.s6_addr,
sizeof(netmask));
511 dd->
ip2.addr_data32[0] = dd->
ip.addr_data32[0] = ip6addr[0] & netmask[0];
512 dd->
ip2.addr_data32[1] = dd->
ip.addr_data32[1] = ip6addr[1] & netmask[1];
513 dd->
ip2.addr_data32[2] = dd->
ip.addr_data32[2] = ip6addr[2] & netmask[2];
514 dd->
ip2.addr_data32[3] = dd->
ip.addr_data32[3] = ip6addr[3] & netmask[3];
516 dd->
ip2.addr_data32[0] |=~ netmask[0];
517 dd->
ip2.addr_data32[1] |=~ netmask[1];
518 dd->
ip2.addr_data32[2] |=~ netmask[2];
519 dd->
ip2.addr_data32[3] |=~ netmask[3];
520 }
else if ((ip2 = strchr(ip,
'-')) != NULL) {
525 r = inet_pton(AF_INET6, ip, &in6);
528 memcpy(&dd->
ip.
address, &in6.s6_addr,
sizeof(ip6addr));
530 r = inet_pton(AF_INET6, ip2, &in6);
533 memcpy(&dd->
ip2.
address, &in6.s6_addr,
sizeof(ip6addr));
539 r = inet_pton(AF_INET6, ip, &in6);
575 if (DetectAddressParseString(dd,
str) < 0) {
600 while (*s !=
'\0' && isspace(*s))
603 if (strcasecmp(s,
"any") == 0) {
604 SCLogDebug(
"adding 0.0.0.0/0 and ::/0 as we\'re handling \'any\'");
612 if (DetectAddressInsert(NULL, gh, ad) < 0) {
618 ad = DetectAddressParseSingle(
"::/0");
624 if (DetectAddressInsert(NULL, gh, ad) < 0) {
635 SCLogError(
"failed to parse address \"%s\"", s);
643 if (DetectAddressCutNot(ad, &ad2) < 0) {
652 if (DetectAddressInsert(NULL, gh, ad2) < 0) {
661 int r = DetectAddressInsert(NULL, gh, ad);
698 DetectAddressHead *ghn,
const char *s,
int negate, ResolvedVariablesList *var_list,
699 int recur,
char *
address,
size_t address_length)
703 int o_set = 0, n_set = 0, d_set = 0;
705 const char *rule_var_address = NULL;
706 char *temp_rule_var_address = NULL;
710 "limit reached (max 64)");
714 SCLogDebug(
"s %s negate %s", s, negate ?
"true" :
"false");
716 size_t size = strlen(s);
717 for (u = 0, x = 0; u < size && x < address_length; u++) {
718 if (x == (address_length - 1)) {
720 " limit for the supplied address. Invalidating sig. "
721 "Please file a bug report on this.");
727 if (!o_set && s[u] ==
'!') {
730 }
else if (s[u] ==
'[') {
736 }
else if (s[u] ==
']') {
741 if (((negate + n_set) % 2) == 0) {
745 if (DetectAddressParse2(
de_ctx, gh, ghn,
address, (negate + n_set) % 2, var_list, recur) < 0)
758 if (DetectAddressParse2(
de_ctx, &tmp_gh, &tmp_ghn,
address, 0, var_list, recur) < 0) {
768 for (tmp_ad = tmp_gh.
ipv4_head; tmp_ad; tmp_ad = tmp_ad->
next) {
772 for (tmp_ad = tmp_ghn.
ipv4_head; tmp_ad; tmp_ad = tmp_ad->
next) {
776 for (tmp_ad = tmp_gh.
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
780 for (tmp_ad = tmp_ghn.
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
794 for (tmp_ad = tmp_gh.
ipv4_head; tmp_ad; tmp_ad = tmp_ad->
next) {
797 if (tmp_ad2 == NULL) {
803 DetectAddressInsert(NULL, ghn, tmp_ad2);
807 for (tmp_ad = tmp_gh.
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
810 if (tmp_ad2 == NULL) {
816 DetectAddressInsert(NULL, ghn, tmp_ad2);
824 }
else if (depth == 0 && s[u] ==
',') {
827 }
else if (d_set == 1) {
832 if (rule_var_address == NULL)
835 if (strlen(rule_var_address) == 0) {
837 "to nothing. This is likely a misconfiguration. "
838 "Note that a negated address needs to be quoted, "
839 "\"!$HOME_NET\" instead of !$HOME_NET. See issue #295.",
844 SCLogDebug(
"rule_var_address %s", rule_var_address);
845 if ((negate + n_set) % 2) {
846 temp_rule_var_address =
SCMalloc(strlen(rule_var_address) + 3);
847 if (
unlikely(temp_rule_var_address == NULL))
849 snprintf(temp_rule_var_address, strlen(rule_var_address) + 3,
850 "[%s]", rule_var_address);
852 temp_rule_var_address =
SCStrdup(rule_var_address);
853 if (
unlikely(temp_rule_var_address == NULL))
857 if (DetectAddressParse2(
de_ctx, gh, ghn, temp_rule_var_address,
858 (negate + n_set) % 2, var_list, recur) < 0) {
859 if (temp_rule_var_address != rule_var_address)
860 SCFree(temp_rule_var_address);
865 SCFree(temp_rule_var_address);
869 if (!((negate + n_set) % 2)) {
871 if (DetectAddressSetup(gh,
address) < 0)
875 if (DetectAddressSetup(ghn,
address) < 0)
881 }
else if (depth == 0 && s[u] ==
'$') {
883 }
else if (depth == 0 && u == size - 1) {
884 if (x == address_length) {
893 "groups declaration. This is likely a misconfiguration.");
900 if (rule_var_address == NULL)
903 if (strlen(rule_var_address) == 0) {
905 "to nothing. This is likely a misconfiguration. "
906 "Note that a negated address needs to be quoted, "
907 "\"!$HOME_NET\" instead of !$HOME_NET. See issue #295.",
912 SCLogDebug(
"rule_var_address %s", rule_var_address);
913 if ((negate + n_set) % 2) {
914 temp_rule_var_address =
SCMalloc(strlen(rule_var_address) + 3);
915 if (
unlikely(temp_rule_var_address == NULL))
917 snprintf(temp_rule_var_address, strlen(rule_var_address) + 3,
918 "[%s]", rule_var_address);
920 temp_rule_var_address =
SCStrdup(rule_var_address);
921 if (
unlikely(temp_rule_var_address == NULL))
925 if (DetectAddressParse2(
de_ctx, gh, ghn, temp_rule_var_address,
926 (negate + n_set) % 2, var_list, recur) < 0) {
928 if (temp_rule_var_address != rule_var_address)
929 SCFree(temp_rule_var_address);
933 SCFree(temp_rule_var_address);
935 if (!((negate + n_set) % 2)) {
937 if (DetectAddressSetup(gh,
address) < 0) {
943 if (DetectAddressSetup(ghn,
address) < 0) {
954 "properly closed in \"%s\", %d missing closing brackets (]). "
955 "Note: problem might be in a variable.",
958 }
else if (depth < 0) {
960 "properly opened in \"%s\", %d missing opening brackets ([). "
961 "Note: problem might be in a variable.",
980 DetectAddressHead *ghn,
const char *s,
int negate, ResolvedVariablesList *var_list,
984 #define MAX_ADDRESS_LENGTH 8192
986 size_t address_length = strlen(s);
991 " memory for address parsing.");
994 rc = DetectAddressParseInternal(
995 de_ctx, gh, ghn, s, negate, var_list, recur,
address, address_length);
999 rc = DetectAddressParseInternal(
1046 if (DetectAddressIsCompleteIPSpace(ghn) == 1) {
1048 "Rule address range is NIL. Probably have a !any or "
1049 "an address range that supplies a NULL address range");
1056 r = DetectAddressSetup(gh,
"0.0.0.0/0");
1058 SCLogDebug(
"DetectAddressSetup for 0.0.0.0/0 failed");
1064 r = DetectAddressSetup(gh,
"::/0");
1066 SCLogDebug(
"DetectAddressSetup for ::/0 failed");
1081 r = DetectAddressInsert(NULL, gh, ad);
1097 r = DetectAddressInsert(NULL, gh, ad);
1105 for (tmp_ad = gh->
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
1109 int ipv4_applied = 0;
1110 int ipv6_applied = 0;
1118 for (ag2 = gh->
ipv4_head; ag2 != NULL; ) {
1125 if (ag2->
prev != NULL)
1127 if (ag2->
next != NULL)
1148 for (ag2 = gh->
ipv6_head; ag2 != NULL; ) {
1151 if (ag2->
prev != NULL)
1153 if (ag2->
next != NULL)
1173 for (tmp_ad = gh->
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
1176 for (tmp_ad = ghn->
ipv6_head; tmp_ad; tmp_ad = tmp_ad->
next) {
1185 if (ipv4_applied !=
cnt) {
1187 "could be applied: %d != %d",
1196 if (ipv6_applied !=
cnt) {
1198 "could be applied: %d != %d",
1207 "merging addresses and negated addresses");
1219 SCLogDebug(
"Testing address conf vars for any misconfigured values");
1224 if (address_vars_node == NULL) {
1235 gh = DetectAddressHeadInit();
1239 ghn = DetectAddressHeadInit();
1244 if (seq_node->
val == NULL) {
1245 SCLogError(
"Address var \"%s\" probably has a sequence(something "
1246 "in brackets) value set without any quotes. Please "
1247 "quote it using \"..\".",
1252 int r = DetectAddressParse2(
1253 NULL, gh, ghn, seq_node->
val, 0, &var_list, 0);
1258 SCLogError(
"failed to parse address var \"%s\" with value \"%s\". "
1259 "Please check its syntax",
1260 seq_node->
name, seq_node->
val);
1264 if (DetectAddressIsCompleteIPSpace(ghn)) {
1265 SCLogError(
"address var - \"%s\" has the complete IP space negated "
1266 "with its value \"%s\". Rule address range is NIL. "
1267 "Probably have a !any or an address range that supplies "
1268 "a NULL address range",
1269 seq_node->
name, seq_node->
val);
1273 DetectAddressHeadFree(gh);
1274 DetectAddressHeadFree(ghn);
1281 DetectAddressHeadFree(gh);
1283 DetectAddressHeadFree(ghn);
1295 static uint32_t DetectAddressMapHashFunc(
HashListTable *ht,
void *data, uint16_t datalen)
1306 static char DetectAddressMapCompareFunc(
void *data1, uint16_t len1,
void *data2,
1316 static void DetectAddressMapFreeFunc(
void *data)
1320 DetectAddressHeadFree(map->
address);
1329 DetectAddressMapCompareFunc,
1330 DetectAddressMapFreeFunc);
1354 if (map->
string == NULL) {
1400 SCLogDebug(
"DetectAddressParse can not be run with NULL address");
1406 SCLogDebug(
"DetectAddressHeadInit for ghn failed");
1410 int r = DetectAddressParse2(
de_ctx, gh, ghn,
str, 0, NULL, 0);
1412 SCLogDebug(
"DetectAddressParse2 returned %d", r);
1413 DetectAddressHeadFree(ghn);
1425 DetectAddressHeadFree(ghn);
1430 DetectAddressHeadFree(ghn);
1431 return contains_negation ? 1 : 0;
1435 const char *
string,
bool *contains_negation)
1452 DetectAddressHeadFree(
head);
1454 }
else if (r == 1) {
1455 *contains_negation =
true;
1457 *contains_negation =
false;
1461 DetectAddressHeadFree(
head);
1480 DetectAddressCleanupList(gh->
ipv4_head);
1484 DetectAddressCleanupList(gh->
ipv6_head);
1590 uint16_t addrs_cnt,
const Address *a)
1594 if (addrs == NULL || addrs_cnt == 0) {
1598 uint32_t match_addr =
SCNtohl(a->addr_data32[0]);
1599 for (uint16_t idx = 0; idx < addrs_cnt; idx++) {
1600 if (match_addr >= addrs[idx].ip && match_addr <= addrs[idx].ip2) {
1623 uint16_t addrs_cnt,
const Address *a)
1627 if (addrs == NULL || addrs_cnt == 0) {
1631 uint32_t match_addr[4];
1632 match_addr[0] =
SCNtohl(a->addr_data32[0]);
1633 match_addr[1] =
SCNtohl(a->addr_data32[1]);
1634 match_addr[2] =
SCNtohl(a->addr_data32[2]);
1635 match_addr[3] =
SCNtohl(a->addr_data32[3]);
1640 for (uint16_t idx = 0; idx < addrs_cnt; idx++) {
1641 uint16_t result1 = 0, result2 = 0;
1644 if (0 == memcmp(match_addr, addrs[idx].ip,
sizeof(match_addr))) {
1647 if (0 == memcmp(match_addr, addrs[idx].ip2,
sizeof(match_addr))) {
1654 for (
int i = 0; i < 4; i++) {
1655 if (match_addr[i] > addrs[idx].ip[i]) {
1659 if (match_addr[i] < addrs[idx].ip[i]) {
1672 for (
int i = 0; i < 4; i++) {
1673 if (match_addr[i] < addrs[idx].ip2[i]) {
1677 if (match_addr[i] > addrs[idx].ip2[i]) {
1686 if (result1 == 1 && result2 == 1)
1742 SCLogDebug(
"What other address type can we have :-/");
1765 char ip[16], mask[16];
1767 memcpy(&in, &gr->
ip.addr_data32[0],
sizeof(in));
1768 PrintInet(AF_INET, &in, ip,
sizeof(ip));
1769 memcpy(&in, &gr->
ip2.addr_data32[0],
sizeof(in));
1770 PrintInet(AF_INET, &in, mask,
sizeof(mask));
1774 }
else if (gr->
ip.
family == AF_INET6) {
1775 struct in6_addr in6;
1776 char ip[66], mask[66];
1778 memcpy(&in6, &gr->
ip.addr_data32,
sizeof(in6));
1779 PrintInet(AF_INET6, &in6, ip,
sizeof(ip));
1780 memcpy(&in6, &gr->
ip2.addr_data32,
sizeof(in6));
1781 PrintInet(AF_INET6, &in6, mask,
sizeof(mask));
1809 if (a->
family == AF_INET) {
1812 }
else if (a->
family == AF_INET6) {
1817 for ( ; g != NULL; g = g->
next) {
1818 if (DetectAddressMatch(g,a) == 1) {
1830 static bool UTHValidateDetectAddress(
DetectAddress *ad,
const char *one,
const char *two)
1832 char str1[46] =
"", str2[46] =
"";
1839 PrintInet(AF_INET, (
const void *)&ad->
ip.addr_data32[0], str1,
sizeof(str1));
1841 PrintInet(AF_INET, (
const void *)&ad->
ip2.addr_data32[0], str2,
sizeof(str2));
1844 if (strcmp(str1, one) != 0) {
1849 if (strcmp(str2, two) != 0) {
1858 PrintInet(AF_INET6, (
const void *)&ad->
ip.addr_data32[0], str1,
sizeof(str1));
1860 PrintInet(AF_INET6, (
const void *)&ad->
ip2.addr_data32[0], str2,
sizeof(str2));
1863 if (strcmp(str1, one) != 0) {
1868 if (strcmp(str2, two) != 0) {
1887 int expect = nranges;
1897 while (have < expect) {
1899 printf(
"bad head: have %d ranges, expected %d: ", have, expect);
1903 if (!UTHValidateDetectAddress(ad, expectations[have].one, expectations[have].two))
1913 static int AddressTestParse01(
void)
1925 static int AddressTestParse02(
void)
1931 if (dd->
ip2.addr_data32[0] !=
SCNtohl(16909060) ||
1932 dd->
ip.addr_data32[0] !=
SCNtohl(16909060)) {
1936 printf(
"ip %"PRIu32
", ip2 %"PRIu32
"\n", dd->
ip.addr_data32[0], dd->
ip2.addr_data32[0]);
1944 static int AddressTestParse03(
void)
1946 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4/255.255.255.0");
1956 static int AddressTestParse04(
void)
1958 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4/255.255.255.0");
1961 char left[16], right[16];
1962 PrintInet(AF_INET, (
const void *)&dd->
ip.addr_data32[0], left,
sizeof(left));
1963 PrintInet(AF_INET, (
const void *)&dd->
ip2.addr_data32[0], right,
sizeof(right));
1975 static int AddressTestParse04bug5081(
void)
1977 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.64/26");
1980 char left[16], right[16];
1981 PrintInet(AF_INET, (
const void *)&dd->
ip.addr_data32[0], left,
sizeof(left));
1982 PrintInet(AF_INET, (
const void *)&dd->
ip2.addr_data32[0], right,
sizeof(right));
1991 static int AddressTestParse05(
void)
2003 static int AddressTestParse06(
void)
2009 if (dd->
ip2.addr_data32[0] !=
SCNtohl(16909311) ||
2010 dd->
ip.addr_data32[0] !=
SCNtohl(16909056)) {
2021 static int AddressTestParse07(
void)
2033 static int AddressTestParse08(
void)
2039 if (dd->
ip.addr_data32[0] !=
SCNtohl(536870912) || dd->
ip.addr_data32[1] != 0x00000000 ||
2040 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2042 dd->
ip2.addr_data32[0] !=
SCNtohl(1073741823) || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2043 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2055 static int AddressTestParse09(
void)
2057 DetectAddress *dd = DetectAddressParseSingle(
"2001::1/128");
2067 static int AddressTestParse10(
void)
2073 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2074 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2076 dd->
ip2.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip2.addr_data32[1] != 0x00000000 ||
2077 dd->
ip2.addr_data32[2] != 0x00000000 || dd->
ip2.addr_data32[3] != 0x00000000) {
2089 static int AddressTestParse11(
void)
2101 static int AddressTestParse12(
void)
2107 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2108 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2111 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2122 static int AddressTestParse13(
void)
2134 static int AddressTestParse14(
void)
2140 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2141 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2143 dd->
ip2.addr_data32[0] !=
SCNtohl(537001983) || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2144 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2155 static int AddressTestParse15(
void)
2167 static int AddressTestParse16(
void)
2173 if (dd->
ip.addr_data32[0] != 0x00000000 || dd->
ip.addr_data32[1] != 0x00000000 ||
2174 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2176 dd->
ip2.addr_data32[0] != 0xFFFFFFFF || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2177 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2188 static int AddressTestParse17(
void)
2190 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4-1.2.3.6");
2200 static int AddressTestParse18(
void)
2203 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.4-1.2.3.6");
2206 if (dd->
ip2.addr_data32[0] !=
SCNtohl(16909062) ||
2207 dd->
ip.addr_data32[0] !=
SCNtohl(16909060)) {
2218 static int AddressTestParse19(
void)
2220 DetectAddress *dd = DetectAddressParseSingle(
"1.2.3.6-1.2.3.4");
2230 static int AddressTestParse20(
void)
2232 DetectAddress *dd = DetectAddressParseSingle(
"2001::1-2001::4");
2242 static int AddressTestParse21(
void)
2245 DetectAddress *dd = DetectAddressParseSingle(
"2001::1-2001::4");
2248 if (dd->
ip.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip.addr_data32[1] != 0x00000000 ||
2249 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] !=
SCNtohl(1) ||
2251 dd->
ip2.addr_data32[0] !=
SCNtohl(536936448) || dd->
ip2.addr_data32[1] != 0x00000000 ||
2252 dd->
ip2.addr_data32[2] != 0x00000000 || dd->
ip2.addr_data32[3] !=
SCNtohl(4)) {
2263 static int AddressTestParse22(
void)
2265 DetectAddress *dd = DetectAddressParseSingle(
"2001::4-2001::1");
2275 static int AddressTestParse23(
void)
2281 DetectAddressHeadFree(gh);
2285 static int AddressTestParse24(
void)
2291 DetectAddressHeadFree(gh);
2295 static int AddressTestParse25(
void)
2301 DetectAddressHeadFree(gh);
2306 static int AddressTestParse26(
void)
2312 "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["
2314 "]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]"
2317 DetectAddressHeadFree(gh);
2318 gh = DetectAddressHeadInit();
2322 "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["
2324 "]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]"
2327 DetectAddressHeadFree(gh);
2331 static int AddressTestParse27(
void)
2333 DetectAddress *dd = DetectAddressParseSingle(
"!192.168.0.1");
2343 static int AddressTestParse28(
void)
2350 dd->
ip.addr_data32[0] ==
SCNtohl(16909060)) {
2361 static int AddressTestParse29(
void)
2363 DetectAddress *dd = DetectAddressParseSingle(
"!1.2.3.0/24");
2373 static int AddressTestParse30(
void)
2376 DetectAddress *dd = DetectAddressParseSingle(
"!1.2.3.4/24");
2380 dd->
ip.addr_data32[0] ==
SCNtohl(16909056) &&
2381 dd->
ip2.addr_data32[0] ==
SCNtohl(16909311)) {
2395 static int AddressTestParse31(
void)
2407 static int AddressTestParse32(
void)
2419 static int AddressTestParse33(
void)
2426 dd->
ip.addr_data32[0] ==
SCNtohl(536936448) && dd->
ip.addr_data32[1] == 0x00000000 &&
2427 dd->
ip.addr_data32[2] == 0x00000000 && dd->
ip.addr_data32[3] ==
SCNtohl(1)) {
2438 static int AddressTestParse34(
void)
2450 static int AddressTestParse35(
void)
2457 dd->
ip.addr_data32[0] ==
SCNtohl(536936448) && dd->
ip.addr_data32[1] == 0x00000000 &&
2458 dd->
ip.addr_data32[2] == 0x00000000 && dd->
ip.addr_data32[3] == 0x00000000 &&
2460 dd->
ip2.addr_data32[0] ==
SCNtohl(537001983) && dd->
ip2.addr_data32[1] == 0xFFFFFFFF &&
2461 dd->
ip2.addr_data32[2] == 0xFFFFFFFF && dd->
ip2.addr_data32[3] == 0xFFFFFFFF) {
2472 static int AddressTestParse36(
void)
2478 if (dd->
ip.addr_data32[0] !=
SCNtohl(0xFFFF0000) || dd->
ip.addr_data32[1] != 0x00000000 ||
2479 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2481 dd->
ip2.addr_data32[0] != 0xFFFFFFFF || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2482 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2496 static int AddressTestParse37(
void)
2502 if (dd->
ip.addr_data32[0] != 0x00000000 || dd->
ip.addr_data32[1] != 0x00000000 ||
2503 dd->
ip.addr_data32[2] != 0x00000000 || dd->
ip.addr_data32[3] != 0x00000000 ||
2505 dd->
ip2.addr_data32[0] != 0xFFFFFFFF || dd->
ip2.addr_data32[1] != 0xFFFFFFFF ||
2506 dd->
ip2.addr_data32[2] != 0xFFFFFFFF || dd->
ip2.addr_data32[3] != 0xFFFFFFFF) {
2519 static int AddressTestMatch01(
void)
2526 if (inet_pton(AF_INET,
"1.2.3.4", &in) != 1)
2528 memset(&a, 0,
sizeof(
Address));
2530 a.addr_data32[0] = in.s_addr;
2532 dd = DetectAddressParseSingle(
"1.2.3.4/24");
2534 if (DetectAddressMatch(dd, &a) == 0)
2544 static int AddressTestMatch02(
void)
2551 if (inet_pton(AF_INET,
"1.2.3.127", &in) != 1)
2553 memset(&a, 0,
sizeof(
Address));
2555 a.addr_data32[0] = in.s_addr;
2557 dd = DetectAddressParseSingle(
"1.2.3.4/25");
2559 if (DetectAddressMatch(dd, &a) == 0)
2569 static int AddressTestMatch03(
void)
2576 if (inet_pton(AF_INET,
"1.2.3.128", &in) != 1)
2578 memset(&a, 0,
sizeof(
Address));
2580 a.addr_data32[0] = in.s_addr;
2582 dd = DetectAddressParseSingle(
"1.2.3.4/25");
2584 if (DetectAddressMatch(dd, &a) == 1)
2594 static int AddressTestMatch04(
void)
2601 if (inet_pton(AF_INET,
"1.2.2.255", &in) != 1)
2603 memset(&a, 0,
sizeof(
Address));
2605 a.addr_data32[0] = in.s_addr;
2607 dd = DetectAddressParseSingle(
"1.2.3.4/25");
2609 if (DetectAddressMatch(dd, &a) == 1)
2619 static int AddressTestMatch05(
void)
2626 if (inet_pton(AF_INET,
"1.2.3.4", &in) != 1)
2628 memset(&a, 0,
sizeof(
Address));
2630 a.addr_data32[0] = in.s_addr;
2632 dd = DetectAddressParseSingle(
"1.2.3.4/32");
2634 if (DetectAddressMatch(dd, &a) == 0)
2644 static int AddressTestMatch06(
void)
2651 if (inet_pton(AF_INET,
"1.2.3.4", &in) != 1)
2653 memset(&a, 0,
sizeof(
Address));
2655 a.addr_data32[0] = in.s_addr;
2657 dd = DetectAddressParseSingle(
"0.0.0.0/0.0.0.0");
2659 if (DetectAddressMatch(dd, &a) == 0)
2669 static int AddressTestMatch07(
void)
2673 struct in6_addr in6;
2676 if (inet_pton(AF_INET6,
"2001::1", &in6) != 1)
2678 memset(&a, 0,
sizeof(
Address));
2679 a.family = AF_INET6;
2680 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2682 dd = DetectAddressParseSingle(
"2001::/3");
2684 if (DetectAddressMatch(dd, &a) == 0)
2694 static int AddressTestMatch08(
void)
2698 struct in6_addr in6;
2701 if (inet_pton(AF_INET6,
"1999:ffff:ffff:ffff:ffff:ffff:ffff:ffff", &in6) != 1)
2703 memset(&a, 0,
sizeof(
Address));
2704 a.family = AF_INET6;
2705 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2707 dd = DetectAddressParseSingle(
"2001::/3");
2709 if (DetectAddressMatch(dd, &a) == 1)
2719 static int AddressTestMatch09(
void)
2723 struct in6_addr in6;
2726 if (inet_pton(AF_INET6,
"2001::2", &in6) != 1)
2728 memset(&a, 0,
sizeof(
Address));
2729 a.family = AF_INET6;
2730 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2732 dd = DetectAddressParseSingle(
"2001::1/128");
2734 if (DetectAddressMatch(dd, &a) == 1)
2744 static int AddressTestMatch10(
void)
2748 struct in6_addr in6;
2751 if (inet_pton(AF_INET6,
"2001::2", &in6) != 1)
2753 memset(&a, 0,
sizeof(
Address));
2754 a.family = AF_INET6;
2755 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2757 dd = DetectAddressParseSingle(
"2001::1/126");
2759 if (DetectAddressMatch(dd, &a) == 0)
2769 static int AddressTestMatch11(
void)
2773 struct in6_addr in6;
2776 if (inet_pton(AF_INET6,
"2001::3", &in6) != 1)
2778 memset(&a, 0,
sizeof(
Address));
2779 a.family = AF_INET6;
2780 memcpy(&a.addr_data32, &in6.s6_addr,
sizeof(in6.s6_addr));
2782 dd = DetectAddressParseSingle(
"2001::1/127");
2784 if (DetectAddressMatch(dd, &a) == 1)
2794 static int AddressTestCmp01(
void)
2799 da = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2800 if (da == NULL)
goto error;
2801 db = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2802 if (db == NULL)
goto error;
2817 static int AddressTestCmp02(
void)
2822 da = DetectAddressParseSingle(
"192.168.0.0/255.255.0.0");
2823 if (da == NULL)
goto error;
2824 db = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2825 if (db == NULL)
goto error;
2840 static int AddressTestCmp03(
void)
2845 da = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2846 if (da == NULL)
goto error;
2847 db = DetectAddressParseSingle(
"192.168.0.0/255.255.0.0");
2848 if (db == NULL)
goto error;
2863 static int AddressTestCmp04(
void)
2868 da = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2869 if (da == NULL)
goto error;
2870 db = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2871 if (db == NULL)
goto error;
2886 static int AddressTestCmp05(
void)
2891 da = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2892 if (da == NULL)
goto error;
2893 db = DetectAddressParseSingle(
"192.168.0.0/255.255.255.0");
2894 if (db == NULL)
goto error;
2909 static int AddressTestCmp06(
void)
2914 da = DetectAddressParseSingle(
"192.168.1.0/255.255.0.0");
2915 if (da == NULL)
goto error;
2916 db = DetectAddressParseSingle(
"192.168.0.0/255.255.0.0");
2917 if (db == NULL)
goto error;
2932 static int AddressTestCmpIPv407(
void)
2937 da = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2938 if (da == NULL)
goto error;
2939 db = DetectAddressParseSingle(
"192.168.1.128-192.168.2.128");
2940 if (db == NULL)
goto error;
2955 static int AddressTestCmpIPv408(
void)
2960 da = DetectAddressParseSingle(
"192.168.1.128-192.168.2.128");
2961 if (da == NULL)
goto error;
2962 db = DetectAddressParseSingle(
"192.168.1.0/255.255.255.0");
2963 if (db == NULL)
goto error;
2978 static int AddressTestCmp07(
void)
2983 da = DetectAddressParseSingle(
"2001::/3");
2984 if (da == NULL)
goto error;
2985 db = DetectAddressParseSingle(
"2001::1/3");
2986 if (db == NULL)
goto error;
3001 static int AddressTestCmp08(
void)
3006 da = DetectAddressParseSingle(
"2001::/3");
3007 if (da == NULL)
goto error;
3008 db = DetectAddressParseSingle(
"2001::/8");
3009 if (db == NULL)
goto error;
3024 static int AddressTestCmp09(
void)
3029 da = DetectAddressParseSingle(
"2001::/8");
3030 if (da == NULL)
goto error;
3031 db = DetectAddressParseSingle(
"2001::/3");
3032 if (db == NULL)
goto error;
3047 static int AddressTestCmp10(
void)
3052 da = DetectAddressParseSingle(
"2001:1:2:3:0:0:0:0/64");
3053 if (da == NULL)
goto error;
3054 db = DetectAddressParseSingle(
"2001:1:2:4:0:0:0:0/64");
3055 if (db == NULL)
goto error;
3070 static int AddressTestCmp11(
void)
3075 da = DetectAddressParseSingle(
"2001:1:2:4:0:0:0:0/64");
3076 if (da == NULL)
goto error;
3077 db = DetectAddressParseSingle(
"2001:1:2:3:0:0:0:0/64");
3078 if (db == NULL)
goto error;
3093 static int AddressTestCmp12(
void)
3098 da = DetectAddressParseSingle(
"2001:1:2:3:1:0:0:0/64");
3099 if (da == NULL)
goto error;
3100 db = DetectAddressParseSingle(
"2001:1:2:3:2:0:0:0/64");
3101 if (db == NULL)
goto error;
3116 static int AddressTestAddressGroupSetup01(
void)
3126 DetectAddressHeadFree(gh);
3131 static int AddressTestAddressGroupSetup02(
void)
3141 DetectAddressHeadFree(gh);
3146 static int AddressTestAddressGroupSetup03(
void)
3157 if (r == 0 && gh->
ipv4_head != prev_head &&
3163 DetectAddressHeadFree(gh);
3168 static int AddressTestAddressGroupSetup04(
void)
3179 if (r == 0 && gh->
ipv4_head != prev_head &&
3191 DetectAddressHeadFree(gh);
3196 static int AddressTestAddressGroupSetup05(
void)
3207 if (r == 0 && gh->
ipv4_head == prev_head &&
3219 DetectAddressHeadFree(gh);
3224 static int AddressTestAddressGroupSetup06(
void)
3235 if (r == 0 && gh->
ipv4_head == prev_head &&
3241 DetectAddressHeadFree(gh);
3246 static int AddressTestAddressGroupSetup07(
void)
3262 DetectAddressHeadFree(gh);
3267 static int AddressTestAddressGroupSetup08(
void)
3283 DetectAddressHeadFree(gh);
3288 static int AddressTestAddressGroupSetup09(
void)
3304 DetectAddressHeadFree(gh);
3309 static int AddressTestAddressGroupSetup10(
void)
3325 DetectAddressHeadFree(gh);
3330 static int AddressTestAddressGroupSetup11(
void)
3343 *three = two->
next, *four = three->
next,
3353 if (one->
ip.addr_data32[0] == 0x00000000 && one->
ip2.addr_data32[0] ==
SCNtohl(168430079) &&
3354 two->ip.addr_data32[0] ==
SCNtohl(168430080) && two->ip2.addr_data32[0] ==
SCNtohl(168430089) &&
3355 three->ip.addr_data32[0] ==
SCNtohl(168430090) && three->ip2.addr_data32[0] ==
SCNtohl(168430335) &&
3356 four->ip.addr_data32[0] ==
SCNtohl(168430336) && four->ip2.addr_data32[0] ==
SCNtohl(168430337) &&
3357 five->ip.addr_data32[0] ==
SCNtohl(168430338) && five->ip2.addr_data32[0] == 0xFFFFFFFF) {
3364 DetectAddressHeadFree(gh);
3369 static int AddressTestAddressGroupSetup12 (
void)
3382 *three = two->
next, *four = three->
next,
3392 if (one->
ip.addr_data32[0] == 0x00000000 && one->
ip2.addr_data32[0] ==
SCNtohl(168430079) &&
3393 two->ip.addr_data32[0] ==
SCNtohl(168430080) && two->ip2.addr_data32[0] ==
SCNtohl(168430089) &&
3394 three->ip.addr_data32[0] ==
SCNtohl(168430090) && three->ip2.addr_data32[0] ==
SCNtohl(168430335) &&
3395 four->ip.addr_data32[0] ==
SCNtohl(168430336) && four->ip2.addr_data32[0] ==
SCNtohl(168430337) &&
3396 five->ip.addr_data32[0] ==
SCNtohl(168430338) && five->ip2.addr_data32[0] == 0xFFFFFFFF) {
3403 DetectAddressHeadFree(gh);
3408 static int AddressTestAddressGroupSetup13(
void)
3421 *three = two->
next, *four = three->
next,
3431 if (one->
ip.addr_data32[0] == 0x00000000 && one->
ip2.addr_data32[0] ==
SCNtohl(168430079) &&
3432 two->ip.addr_data32[0] ==
SCNtohl(168430080) && two->ip2.addr_data32[0] ==
SCNtohl(168430089) &&
3433 three->ip.addr_data32[0] ==
SCNtohl(168430090) && three->ip2.addr_data32[0] ==
SCNtohl(168430335) &&
3434 four->ip.addr_data32[0] ==
SCNtohl(168430336) && four->ip2.addr_data32[0] ==
SCNtohl(168430337) &&
3435 five->ip.addr_data32[0] ==
SCNtohl(168430338) && five->ip2.addr_data32[0] == 0xFFFFFFFF) {
3442 DetectAddressHeadFree(gh);
3447 static int AddressTestAddressGroupSetupIPv414(
void)
3468 DetectAddressHeadFree(gh);
3473 static int AddressTestAddressGroupSetupIPv415(
void)
3491 DetectAddressHeadFree(gh);
3495 static int AddressTestAddressGroupSetupIPv416(
void)
3513 DetectAddressHeadFree(gh);
3517 static int AddressTestAddressGroupSetup14(
void)
3527 DetectAddressHeadFree(gh);
3532 static int AddressTestAddressGroupSetup15(
void)
3542 DetectAddressHeadFree(gh);
3547 static int AddressTestAddressGroupSetup16(
void)
3558 if (r == 0 && gh->
ipv6_head != prev_head &&
3564 DetectAddressHeadFree(gh);
3569 static int AddressTestAddressGroupSetup17(
void)
3580 if (r == 0 && gh->
ipv6_head != prev_head &&
3592 DetectAddressHeadFree(gh);
3597 static int AddressTestAddressGroupSetup18(
void)
3608 if (r == 0 && gh->
ipv6_head == prev_head &&
3620 DetectAddressHeadFree(gh);
3625 static int AddressTestAddressGroupSetup19(
void)
3636 if (r == 0 && gh->
ipv6_head == prev_head &&
3642 DetectAddressHeadFree(gh);
3647 static int AddressTestAddressGroupSetup20(
void)
3663 DetectAddressHeadFree(gh);
3668 static int AddressTestAddressGroupSetup21(
void)
3684 DetectAddressHeadFree(gh);
3689 static int AddressTestAddressGroupSetup22(
void)
3705 DetectAddressHeadFree(gh);
3710 static int AddressTestAddressGroupSetup23(
void)
3726 DetectAddressHeadFree(gh);
3731 static int AddressTestAddressGroupSetup24(
void)
3744 *three = two->
next, *four = three->
next,
3746 if (one->
ip.addr_data32[0] == 0x00000000 &&
3747 one->
ip.addr_data32[1] == 0x00000000 &&
3748 one->
ip.addr_data32[2] == 0x00000000 &&
3749 one->
ip.addr_data32[3] == 0x00000000 &&
3750 one->
ip2.addr_data32[0] ==
SCNtohl(536870911) &&
3751 one->
ip2.addr_data32[1] == 0xFFFFFFFF &&
3752 one->
ip2.addr_data32[2] == 0xFFFFFFFF &&
3753 one->
ip2.addr_data32[3] == 0xFFFFFFFF &&
3755 two->
ip.addr_data32[0] ==
SCNtohl(536870912) &&
3756 two->
ip.addr_data32[1] == 0x00000000 &&
3757 two->
ip.addr_data32[2] == 0x00000000 &&
3758 two->
ip.addr_data32[3] == 0x00000000 &&
3759 two->
ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3760 two->
ip2.addr_data32[1] == 0x00000000 &&
3761 two->
ip2.addr_data32[2] == 0x00000000 &&
3764 three->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3765 three->ip.addr_data32[1] == 0x00000000 &&
3766 three->ip.addr_data32[2] == 0x00000000 &&
3767 three->ip.addr_data32[3] ==
SCNtohl(4) &&
3768 three->ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3769 three->ip2.addr_data32[1] == 0x00000000 &&
3770 three->ip2.addr_data32[2] == 0x00000000 &&
3771 three->ip2.addr_data32[3] ==
SCNtohl(6) &&
3773 four->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3774 four->ip.addr_data32[1] == 0x00000000 &&
3775 four->ip.addr_data32[2] == 0x00000000 &&
3776 four->ip.addr_data32[3] ==
SCNtohl(7) &&
3777 four->ip2.addr_data32[0] ==
SCNtohl(1073741823) &&
3778 four->ip2.addr_data32[1] == 0xFFFFFFFF &&
3779 four->ip2.addr_data32[2] == 0xFFFFFFFF &&
3780 four->ip2.addr_data32[3] == 0xFFFFFFFF &&
3782 five->ip.addr_data32[0] ==
SCNtohl(1073741824) &&
3783 five->ip.addr_data32[1] == 0x00000000 &&
3784 five->ip.addr_data32[2] == 0x00000000 &&
3785 five->ip.addr_data32[3] == 0x00000000 &&
3786 five->ip2.addr_data32[0] == 0xFFFFFFFF &&
3787 five->ip2.addr_data32[1] == 0xFFFFFFFF &&
3788 five->ip2.addr_data32[2] == 0xFFFFFFFF &&
3789 five->ip2.addr_data32[3] == 0xFFFFFFFF) {
3796 DetectAddressHeadFree(gh);
3801 static int AddressTestAddressGroupSetup25(
void)
3814 *three = two->
next, *four = three->
next,
3816 if (one->
ip.addr_data32[0] == 0x00000000 &&
3817 one->
ip.addr_data32[1] == 0x00000000 &&
3818 one->
ip.addr_data32[2] == 0x00000000 &&
3819 one->
ip.addr_data32[3] == 0x00000000 &&
3820 one->
ip2.addr_data32[0] ==
SCNtohl(536870911) &&
3821 one->
ip2.addr_data32[1] == 0xFFFFFFFF &&
3822 one->
ip2.addr_data32[2] == 0xFFFFFFFF &&
3823 one->
ip2.addr_data32[3] == 0xFFFFFFFF &&
3825 two->
ip.addr_data32[0] ==
SCNtohl(536870912) &&
3826 two->
ip.addr_data32[1] == 0x00000000 &&
3827 two->
ip.addr_data32[2] == 0x00000000 &&
3828 two->
ip.addr_data32[3] == 0x00000000 &&
3829 two->
ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3830 two->
ip2.addr_data32[1] == 0x00000000 &&
3831 two->
ip2.addr_data32[2] == 0x00000000 &&
3834 three->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3835 three->ip.addr_data32[1] == 0x00000000 &&
3836 three->ip.addr_data32[2] == 0x00000000 &&
3837 three->ip.addr_data32[3] ==
SCNtohl(4) &&
3838 three->ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3839 three->ip2.addr_data32[1] == 0x00000000 &&
3840 three->ip2.addr_data32[2] == 0x00000000 &&
3841 three->ip2.addr_data32[3] ==
SCNtohl(6) &&
3843 four->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3844 four->ip.addr_data32[1] == 0x00000000 &&
3845 four->ip.addr_data32[2] == 0x00000000 &&
3846 four->ip.addr_data32[3] ==
SCNtohl(7) &&
3847 four->ip2.addr_data32[0] ==
SCNtohl(1073741823) &&
3848 four->ip2.addr_data32[1] == 0xFFFFFFFF &&
3849 four->ip2.addr_data32[2] == 0xFFFFFFFF &&
3850 four->ip2.addr_data32[3] == 0xFFFFFFFF &&
3852 five->ip.addr_data32[0] ==
SCNtohl(1073741824) &&
3853 five->ip.addr_data32[1] == 0x00000000 &&
3854 five->ip.addr_data32[2] == 0x00000000 &&
3855 five->ip.addr_data32[3] == 0x00000000 &&
3856 five->ip2.addr_data32[0] == 0xFFFFFFFF &&
3857 five->ip2.addr_data32[1] == 0xFFFFFFFF &&
3858 five->ip2.addr_data32[2] == 0xFFFFFFFF &&
3859 five->ip2.addr_data32[3] == 0xFFFFFFFF) {
3866 DetectAddressHeadFree(gh);
3871 static int AddressTestAddressGroupSetup26(
void)
3884 *three = two->
next, *four = three->
next,
3886 if (one->
ip.addr_data32[0] == 0x00000000 &&
3887 one->
ip.addr_data32[1] == 0x00000000 &&
3888 one->
ip.addr_data32[2] == 0x00000000 &&
3889 one->
ip.addr_data32[3] == 0x00000000 &&
3890 one->
ip2.addr_data32[0] ==
SCNtohl(536870911) &&
3891 one->
ip2.addr_data32[1] == 0xFFFFFFFF &&
3892 one->
ip2.addr_data32[2] == 0xFFFFFFFF &&
3893 one->
ip2.addr_data32[3] == 0xFFFFFFFF &&
3895 two->
ip.addr_data32[0] ==
SCNtohl(536870912) &&
3896 two->
ip.addr_data32[1] == 0x00000000 &&
3897 two->
ip.addr_data32[2] == 0x00000000 &&
3898 two->
ip.addr_data32[3] == 0x00000000 &&
3899 two->
ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3900 two->
ip2.addr_data32[1] == 0x00000000 &&
3901 two->
ip2.addr_data32[2] == 0x00000000 &&
3904 three->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3905 three->ip.addr_data32[1] == 0x00000000 &&
3906 three->ip.addr_data32[2] == 0x00000000 &&
3907 three->ip.addr_data32[3] ==
SCNtohl(4) &&
3908 three->ip2.addr_data32[0] ==
SCNtohl(536936448) &&
3909 three->ip2.addr_data32[1] == 0x00000000 &&
3910 three->ip2.addr_data32[2] == 0x00000000 &&
3911 three->ip2.addr_data32[3] ==
SCNtohl(6) &&
3913 four->ip.addr_data32[0] ==
SCNtohl(536936448) &&
3914 four->ip.addr_data32[1] == 0x00000000 &&
3915 four->ip.addr_data32[2] == 0x00000000 &&
3916 four->ip.addr_data32[3] ==
SCNtohl(7) &&
3917 four->ip2.addr_data32[0] ==
SCNtohl(1073741823) &&
3918 four->ip2.addr_data32[1] == 0xFFFFFFFF &&
3919 four->ip2.addr_data32[2] == 0xFFFFFFFF &&
3920 four->ip2.addr_data32[3] == 0xFFFFFFFF &&
3922 five->ip.addr_data32[0] ==
SCNtohl(1073741824) &&
3923 five->ip.addr_data32[1] == 0x00000000 &&
3924 five->ip.addr_data32[2] == 0x00000000 &&
3925 five->ip.addr_data32[3] == 0x00000000 &&
3926 five->ip2.addr_data32[0] == 0xFFFFFFFF &&
3927 five->ip2.addr_data32[1] == 0xFFFFFFFF &&
3928 five->ip2.addr_data32[2] == 0xFFFFFFFF &&
3929 five->ip2.addr_data32[3] == 0xFFFFFFFF) {
3936 DetectAddressHeadFree(gh);
3941 static int AddressTestAddressGroupSetup27(
void)
3951 DetectAddressHeadFree(gh);
3956 static int AddressTestAddressGroupSetup28(
void)
3966 DetectAddressHeadFree(gh);
3971 static int AddressTestAddressGroupSetup29(
void)
3981 DetectAddressHeadFree(gh);
3986 static int AddressTestAddressGroupSetup30(
void)
3992 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]]");
3996 DetectAddressHeadFree(gh);
4001 static int AddressTestAddressGroupSetup31(
void)
4007 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]]]");
4011 DetectAddressHeadFree(gh);
4016 static int AddressTestAddressGroupSetup32(
void)
4022 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]]]]");
4026 DetectAddressHeadFree(gh);
4031 static int AddressTestAddressGroupSetup33(
void)
4041 DetectAddressHeadFree(gh);
4046 static int AddressTestAddressGroupSetup34(
void)
4056 DetectAddressHeadFree(gh);
4061 static int AddressTestAddressGroupSetup35(
void)
4071 DetectAddressHeadFree(gh);
4076 static int AddressTestAddressGroupSetup36 (
void)
4082 int r =
DetectAddressParse(NULL, gh,
"[1.0.0.0/8,[2.0.0.0/8,[3.0.0.0/8,!1.1.1.1]]]");
4086 DetectAddressHeadFree(gh);
4091 static int AddressTestAddressGroupSetup37(
void)
4101 DetectAddressHeadFree(gh);
4106 static int AddressTestAddressGroupSetup38(
void)
4109 {
"0.0.0.0",
"192.167.255.255" },
4110 {
"192.168.14.0",
"192.168.14.255" },
4111 {
"192.169.0.0",
"255.255.255.255" } };
4118 if (UTHValidateDetectAddressHead(gh, 3, expectations))
4122 DetectAddressHeadFree(gh);
4127 static int AddressTestAddressGroupSetup39(
void)
4130 {
"0.0.0.0",
"192.167.255.255" },
4131 {
"192.168.14.0",
"192.168.14.255" },
4132 {
"192.169.0.0",
"255.255.255.255" } };
4139 if (UTHValidateDetectAddressHead(gh, 3, expectations))
4143 DetectAddressHeadFree(gh);
4148 static int AddressTestAddressGroupSetup40(
void)
4151 {
"0.0.0.0",
"192.167.255.255" },
4152 {
"192.168.14.0",
"192.168.14.255" },
4153 {
"192.169.0.0",
"255.255.255.255" } };
4159 if (UTHValidateDetectAddressHead(gh, 3, expectations))
4163 DetectAddressHeadFree(gh);
4168 static int AddressTestAddressGroupSetup41(
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))
4183 DetectAddressHeadFree(gh);
4188 static int AddressTestAddressGroupSetup42(
void)
4191 {
"2000:0000:0000:0000:0000:0000:0000:0000",
"3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" } };
4197 if (UTHValidateDetectAddressHead(gh, 1, expectations))
4201 DetectAddressHeadFree(gh);
4206 static int AddressTestAddressGroupSetup43(
void)
4209 {
"2000:0000:0000:0000:0000:0000:0000:0000",
"2fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" },
4210 {
"3800:0000:0000:0000:0000:0000:0000:0000",
"3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" } };
4216 if (UTHValidateDetectAddressHead(gh, 2, expectations))
4220 DetectAddressHeadFree(gh);
4225 static int AddressTestAddressGroupSetup44(
void)
4228 {
"3ffe:ffff:7654:feda:1245:ba98:0000:0000",
"3ffe:ffff:7654:feda:1245:ba98:ffff:ffff" }};
4234 if (UTHValidateDetectAddressHead(gh, 1, expectations))
4238 DetectAddressHeadFree(gh);
4243 static int AddressTestAddressGroupSetup45(
void)
4253 DetectAddressHeadFree(gh);
4258 static int AddressTestAddressGroupSetup46(
void)
4261 {
"0.0.0.0",
"192.167.255.255" },
4262 {
"192.168.1.0",
"192.168.1.255" },
4263 {
"192.168.3.0",
"192.168.3.255" },
4264 {
"192.169.0.0",
"255.255.255.255" } };
4268 int r =
DetectAddressParse(NULL, gh,
"[![192.168.0.0/16,![192.168.1.0/24,192.168.3.0/24]]]");
4270 if (UTHValidateDetectAddressHead(gh, 4, expectations))
4274 DetectAddressHeadFree(gh);
4280 static int AddressTestAddressGroupSetup47(
void)
4283 {
"0.0.0.0",
"192.167.255.255" },
4284 {
"192.168.1.0",
"192.168.1.255" },
4285 {
"192.168.3.0",
"192.168.3.255" },
4286 {
"192.168.5.0",
"192.168.5.255" },
4287 {
"192.169.0.0",
"255.255.255.255" } };
4291 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]]");
4293 if (UTHValidateDetectAddressHead(gh, 5, expectations))
4297 DetectAddressHeadFree(gh);
4303 static int AddressTestAddressGroupSetup48(
void)
4306 {
"192.168.0.0",
"192.168.0.255" },
4307 {
"192.168.2.0",
"192.168.2.255" },
4308 {
"192.168.4.0",
"192.168.4.255" },
4309 {
"192.168.6.0",
"192.168.255.255" } };
4313 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]");
4315 if (UTHValidateDetectAddressHead(gh, 4, expectations))
4319 DetectAddressHeadFree(gh);
4324 static int AddressTestCutIPv401(
void)
4327 DetectAddress *a = DetectAddressParseSingle(
"1.2.3.0/255.255.255.0");
4329 DetectAddress *b = DetectAddressParseSingle(
"1.2.2.0-1.2.3.4");
4332 FAIL_IF(DetectAddressCut(NULL, a, b, &c) == -1);
4340 static int AddressTestCutIPv402(
void)
4343 a = DetectAddressParseSingle(
"1.2.3.0/255.255.255.0");
4344 b = DetectAddressParseSingle(
"1.2.2.0-1.2.3.4");
4346 if (DetectAddressCut(NULL, a, b, &c) == -1)
4364 static int AddressTestCutIPv403(
void)
4367 a = DetectAddressParseSingle(
"1.2.3.0/255.255.255.0");
4368 b = DetectAddressParseSingle(
"1.2.2.0-1.2.3.4");
4370 if (DetectAddressCut(NULL, a, b, &c) == -1)
4376 if (a->
ip.addr_data32[0] !=
SCNtohl(16908800) || a->
ip2.addr_data32[0] !=
SCNtohl(16909055))
4378 if (b->
ip.addr_data32[0] !=
SCNtohl(16909056) || b->
ip2.addr_data32[0] !=
SCNtohl(16909060))
4380 if (c->
ip.addr_data32[0] !=
SCNtohl(16909061) || c->
ip2.addr_data32[0] !=
SCNtohl(16909311))
4395 static int AddressTestCutIPv404(
void)
4398 a = DetectAddressParseSingle(
"1.2.3.3-1.2.3.6");
4399 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.5");
4401 if (DetectAddressCut(NULL, a, b, &c) == -1)
4407 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4409 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909061))
4411 if (c->
ip.addr_data32[0] !=
SCNtohl(16909062) || c->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4427 static int AddressTestCutIPv405(
void)
4430 a = DetectAddressParseSingle(
"1.2.3.3-1.2.3.6");
4431 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4433 if (DetectAddressCut(NULL, a, b, &c) == -1)
4439 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4441 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4443 if (c->
ip.addr_data32[0] !=
SCNtohl(16909063) || c->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4458 static int AddressTestCutIPv406(
void)
4461 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4462 b = DetectAddressParseSingle(
"1.2.3.3-1.2.3.6");
4464 if (DetectAddressCut(NULL, a, b, &c) == -1)
4470 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4472 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4474 if (c->
ip.addr_data32[0] !=
SCNtohl(16909063) || c->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4489 static int AddressTestCutIPv407(
void)
4492 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.6");
4493 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4495 if (DetectAddressCut(NULL, a, b, &c) == -1)
4501 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4503 if (b->
ip.addr_data32[0] !=
SCNtohl(16909063) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4518 static int AddressTestCutIPv408(
void)
4521 a = DetectAddressParseSingle(
"1.2.3.3-1.2.3.9");
4522 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4524 if (DetectAddressCut(NULL, a, b, &c) == -1)
4530 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4532 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4547 static int AddressTestCutIPv409(
void)
4550 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4551 b = DetectAddressParseSingle(
"1.2.3.0-1.2.3.6");
4553 if (DetectAddressCut(NULL, a, b, &c) == -1)
4559 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909062))
4561 if (b->
ip.addr_data32[0] !=
SCNtohl(16909063) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4576 static int AddressTestCutIPv410(
void)
4579 a = DetectAddressParseSingle(
"1.2.3.0-1.2.3.9");
4580 b = DetectAddressParseSingle(
"1.2.3.3-1.2.3.9");
4582 if (DetectAddressCut(NULL, a, b, &c) == -1)
4588 if (a->
ip.addr_data32[0] !=
SCNtohl(16909056) || a->
ip2.addr_data32[0] !=
SCNtohl(16909058))
4590 if (b->
ip.addr_data32[0] !=
SCNtohl(16909059) || b->
ip2.addr_data32[0] !=
SCNtohl(16909065))
4593 printf(
"ip %u ip2 %u ", (uint32_t)htonl(a->
ip.addr_data32[0]), (uint32_t)htonl(a->
ip2.addr_data32[0]));
4607 static int AddressTestParseInvalidMask01(
void)
4612 dd = DetectAddressParseSingle(
"192.168.2.0/33");
4620 static int AddressTestParseInvalidMask02(
void)
4625 dd = DetectAddressParseSingle(
"192.168.2.0/255.255.257.0");
4633 static int AddressTestParseInvalidMask03(
void)
4638 dd = DetectAddressParseSingle(
"192.168.2.0/blue");
4646 static int AddressConfVarsTest01(
void)
4648 static const char *dummy_conf_string =
4654 " address-groups:\n"
4656 " HOME_NET: \"any\"\n"
4658 " EXTERNAL_NET: \"!any\"\n"
4662 " HTTP_PORTS: \"any\"\n"
4664 " SHELLCODE_PORTS: \"!any\"\n"
4682 static int AddressConfVarsTest02(
void)
4684 static const char *dummy_conf_string =
4690 " address-groups:\n"
4692 " HOME_NET: \"any\"\n"
4694 " EXTERNAL_NET: \"any\"\n"
4698 " HTTP_PORTS: \"any\"\n"
4700 " SHELLCODE_PORTS: \"!any\"\n"
4718 static int AddressConfVarsTest03(
void)
4720 static const char *dummy_conf_string =
4726 " address-groups:\n"
4728 " HOME_NET: \"any\"\n"
4730 " EXTERNAL_NET: \"!$HOME_NET\"\n"
4734 " HTTP_PORTS: \"any\"\n"
4736 " SHELLCODE_PORTS: \"!$HTTP_PORTS\"\n"
4754 static int AddressConfVarsTest04(
void)
4756 static const char *dummy_conf_string =
4762 " address-groups:\n"
4764 " HOME_NET: \"any\"\n"
4766 " EXTERNAL_NET: \"$HOME_NET\"\n"
4770 " HTTP_PORTS: \"any\"\n"
4772 " SHELLCODE_PORTS: \"$HTTP_PORTS\"\n"
4790 static int AddressConfVarsTest05(
void)
4792 static const char *dummy_conf_string =
4798 " address-groups:\n"
4800 " HOME_NET: \"any\"\n"
4802 " EXTERNAL_NET: [192.168.0.1]\n"
4806 " HTTP_PORTS: \"any\"\n"
4808 " SHELLCODE_PORTS: [80]\n"
4829 static int AddressConfVarsTest06(
void)
4832 static const char *dummy_conf_string =
4838 " address-groups:\n"
4841 "\"[2002:0000:3238:DFE1:63:0000:0000:FEFB,2002:0000:3238:DFE1:63:0000:0000:FEFB,"
4842 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4843 "2004:0000:3238:DFE1:63:0000:0000:FEFB,2005:0000:3238:DFE1:63:0000:0000:FEFB,"
4844 "2006:0000:3238:DFE1:63:0000:0000:FEFB,2007:0000:3238:DFE1:63:0000:0000:FEFB,"
4845 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4846 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4847 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4848 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4849 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4850 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4851 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4852 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4853 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4854 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4855 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4856 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4857 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4858 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4859 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4860 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4861 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4862 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4863 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4864 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4865 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4866 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4867 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4868 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4869 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4870 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4871 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4872 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4873 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4874 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4875 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4876 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4877 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4878 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4879 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4880 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4881 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4882 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4883 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4884 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4885 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4886 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4887 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4888 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4889 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4890 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4891 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4892 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4893 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4894 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4895 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4896 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4897 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4898 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4899 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4900 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4901 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4902 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4903 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4904 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4905 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4906 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4907 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4908 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4909 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4910 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4911 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4912 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4913 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4914 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4915 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4916 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4917 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4918 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4919 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4920 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4921 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4922 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4923 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4924 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4925 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4926 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4927 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4928 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4929 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4930 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4931 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4932 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4933 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4934 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4935 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4936 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4937 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4938 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4939 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4940 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4941 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4942 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4943 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4944 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4945 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4946 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4947 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4948 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4949 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4950 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4951 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4952 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4953 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4954 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4955 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4956 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4957 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4958 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4959 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4960 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4961 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4962 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4963 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4964 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4965 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4966 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4967 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4968 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4969 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4970 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4971 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4972 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4973 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4974 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB,"
4975 "2002:0000:3238:DFE1:63:0000:0000:FEFB,2003:0000:3238:DFE1:63:0000:0000:FEFB]\"\n"
4977 " EXTERNAL_NET: \"any\"\n"
5004 UtRegisterTest(
"AddressTestParse04bug5081", AddressTestParse04bug5081);
5068 AddressTestAddressGroupSetup01);
5070 AddressTestAddressGroupSetup02);
5072 AddressTestAddressGroupSetup03);
5074 AddressTestAddressGroupSetup04);
5076 AddressTestAddressGroupSetup05);
5078 AddressTestAddressGroupSetup06);
5080 AddressTestAddressGroupSetup07);
5082 AddressTestAddressGroupSetup08);
5084 AddressTestAddressGroupSetup09);
5086 AddressTestAddressGroupSetup10);
5088 AddressTestAddressGroupSetup11);
5090 AddressTestAddressGroupSetup12);
5092 AddressTestAddressGroupSetup13);
5094 AddressTestAddressGroupSetupIPv414);
5096 AddressTestAddressGroupSetupIPv415);
5098 AddressTestAddressGroupSetupIPv416);
5101 AddressTestAddressGroupSetup14);
5103 AddressTestAddressGroupSetup15);
5105 AddressTestAddressGroupSetup16);
5107 AddressTestAddressGroupSetup17);
5109 AddressTestAddressGroupSetup18);
5111 AddressTestAddressGroupSetup19);
5113 AddressTestAddressGroupSetup20);
5115 AddressTestAddressGroupSetup21);
5117 AddressTestAddressGroupSetup22);
5119 AddressTestAddressGroupSetup23);
5121 AddressTestAddressGroupSetup24);
5123 AddressTestAddressGroupSetup25);
5125 AddressTestAddressGroupSetup26);
5128 AddressTestAddressGroupSetup27);
5130 AddressTestAddressGroupSetup28);
5132 AddressTestAddressGroupSetup29);
5134 AddressTestAddressGroupSetup30);
5136 AddressTestAddressGroupSetup31);
5138 AddressTestAddressGroupSetup32);
5140 AddressTestAddressGroupSetup33);
5142 AddressTestAddressGroupSetup34);
5144 AddressTestAddressGroupSetup35);
5146 AddressTestAddressGroupSetup36);
5148 AddressTestAddressGroupSetup37);
5150 AddressTestAddressGroupSetup38);
5152 AddressTestAddressGroupSetup39);
5154 AddressTestAddressGroupSetup40);
5156 AddressTestAddressGroupSetup41);
5158 AddressTestAddressGroupSetup42);
5160 AddressTestAddressGroupSetup43);
5162 AddressTestAddressGroupSetup44);
5164 AddressTestAddressGroupSetup45);
5166 AddressTestAddressGroupSetup46);
5168 AddressTestAddressGroupSetup47);
5170 AddressTestAddressGroupSetup48);
5184 AddressTestParseInvalidMask01);
5186 AddressTestParseInvalidMask02);
5188 AddressTestParseInvalidMask03);