Lines Matching full:ipaddress
49 void TestAddress(IPAddress::Family family,
54 IPAddress good_addr(family);
57 EXPECT_EQ(IPAddress::GetAddressLength(family), good_addr.GetLength());
67 IPAddress good_addr_from_bytes(family, good_bytes);
70 IPAddress good_addr_from_string(good_string);
73 IPAddress bad_addr(family);
79 IPAddress bad_addr_from_bytes(family, bad_bytes);
83 IPAddress bad_addr_from_string(bad_string);
84 EXPECT_EQ(IPAddress::kFamilyUnknown, bad_addr_from_string.family());
93 if (family == IPAddress::kFamilyIPv6) {
102 IPAddress from_short_sockaddr(addr, addr_size - 1);
104 IPAddress from_sockaddr(addr, addr_size);
123 EXPECT_EQ(4, IPAddress::GetAddressLength(IPAddress::kFamilyIPv4));
124 EXPECT_EQ(16, IPAddress::GetAddressLength(IPAddress::kFamilyIPv6));
126 EXPECT_EQ(0, IPAddress::GetPrefixLengthFromMask(IPAddress::kFamilyIPv4,
128 EXPECT_EQ(20, IPAddress::GetPrefixLengthFromMask(IPAddress::kFamilyIPv4,
130 EXPECT_EQ(32, IPAddress::GetPrefixLengthFromMask(IPAddress::kFamilyIPv4,
132 EXPECT_EQ(32, IPAddress::GetPrefixLengthFromMask(IPAddress::kFamilyIPv4,
134 EXPECT_EQ(32, IPAddress::GetPrefixLengthFromMask(IPAddress::kFamilyIPv4,
137 IPAddress addr4(IPAddress::kFamilyIPv4);
141 EXPECT_EQ(IPAddress::kFamilyIPv4, addr4.family());
147 IPAddress addr6(IPAddress::kFamilyIPv6);
151 EXPECT_EQ(addr6.family(), IPAddress::kFamilyIPv6);
160 TestAddress(IPAddress::kFamilyIPv4,
167 TestAddress(IPAddress::kFamilyIPv6,
173 IPAddress address(IPAddress::kFamilyIPv4);
195 IPAddress address0(IPAddress::kFamilyIPv4);
197 IPAddress address1(IPAddress::kFamilyIPv4);
199 IPAddress address2(IPAddress::kFamilyIPv4);
209 PrefixMapping() : family(IPAddress::kFamilyUnknown), prefix(0) {}
210 PrefixMapping(IPAddress::Family family_in,
216 IPAddress::Family family;
225 IPAddress address = IPAddress::GetAddressMaskFromPrefix(GetParam().family,
227 IPAddress expected_address(GetParam().family);
237 PrefixMapping(IPAddress::kFamilyIPv4, 0, "0.0.0.0"),
238 PrefixMapping(IPAddress::kFamilyIPv4, 1, "128.0.0.0"),
239 PrefixMapping(IPAddress::kFamilyIPv4, 4, "240.0.0.0"),
240 PrefixMapping(IPAddress::kFamilyIPv4, 7, "254.0.0.0"),
241 PrefixMapping(IPAddress::kFamilyIPv4, 10, "255.192.0.0"),
242 PrefixMapping(IPAddress::kFamilyIPv4, 13, "255.248.0.0"),
243 PrefixMapping(IPAddress::kFamilyIPv4, 16, "255.255.0.0"),
244 PrefixMapping(IPAddress::kFamilyIPv4, 19, "255.255.224.0"),
245 PrefixMapping(IPAddress::kFamilyIPv4, 22, "255.255.252.0"),
246 PrefixMapping(IPAddress::kFamilyIPv4, 25, "255.255.255.128"),
247 PrefixMapping(IPAddress::kFamilyIPv4, 28, "255.255.255.240"),
248 PrefixMapping(IPAddress::kFamilyIPv4, 31, "255.255.255.254"),
249 PrefixMapping(IPAddress::kFamilyIPv4, 32, "255.255.255.255"),
250 PrefixMapping(IPAddress::kFamilyIPv4, 33, "255.255.255.255"),
251 PrefixMapping(IPAddress::kFamilyIPv4, 34, "255.255.255.255"),
252 PrefixMapping(IPAddress::kFamilyIPv6, 0, "0::"),
253 PrefixMapping(IPAddress::kFamilyIPv6, 1, "8000::"),
254 PrefixMapping(IPAddress::kFamilyIPv6, 17, "ffff:8000::"),
255 PrefixMapping(IPAddress::kFamilyIPv6, 34, "ffff:ffff:c000::"),
256 PrefixMapping(IPAddress::kFamilyIPv6, 51, "ffff:ffff:ffff:e000::"),
257 PrefixMapping(IPAddress::kFamilyIPv6, 68,
259 PrefixMapping(IPAddress::kFamilyIPv6, 85,
261 PrefixMapping(IPAddress::kFamilyIPv6, 102,
263 PrefixMapping(IPAddress::kFamilyIPv6, 119,
265 PrefixMapping(IPAddress::kFamilyIPv6, 128,
267 PrefixMapping(IPAddress::kFamilyIPv6, 136,
271 BitOperationMapping() : family(IPAddress::kFamilyUnknown) {}
272 BitOperationMapping(IPAddress::Family family_in,
282 IPAddress::Family family;
293 IPAddress address_a(GetParam().family);
295 IPAddress address_b(GetParam().family);
297 IPAddress expected_anded(GetParam().family);
301 IPAddress expected_orred(GetParam().family);
311 BitOperationMapping(IPAddress::kFamilyIPv4,
314 BitOperationMapping(IPAddress::kFamilyIPv4,
317 BitOperationMapping(IPAddress::kFamilyIPv4,
320 BitOperationMapping(IPAddress::kFamilyIPv4,
323 BitOperationMapping(IPAddress::kFamilyIPv4,
326 BitOperationMapping(IPAddress::kFamilyIPv4,
331 NetworkPartMapping() : family(IPAddress::kFamilyUnknown) {}
332 NetworkPartMapping(IPAddress::Family family_in,
342 IPAddress::Family family;
353 IPAddress address(GetParam().family);
355 IPAddress expected_network(GetParam().family);
360 IPAddress expected_broadcast(GetParam().family);
370 NetworkPartMapping(IPAddress::kFamilyIPv4,
372 NetworkPartMapping(IPAddress::kFamilyIPv4,
375 NetworkPartMapping(IPAddress::kFamilyIPv4,
378 NetworkPartMapping(IPAddress::kFamilyIPv4,
381 NetworkPartMapping(IPAddress::kFamilyIPv4,
383 NetworkPartMapping(IPAddress::kFamilyIPv4,
385 IPAddress::kFamilyIPv4,
387 NetworkPartMapping(IPAddress::kFamilyIPv4,
389 NetworkPartMapping(IPAddress::kFamilyIPv4,
391 NetworkPartMapping(IPAddress::kFamilyIPv4,
395 MinPrefixLengthMapping() : family(IPAddress::kFamilyUnknown) {}
396 MinPrefixLengthMapping(IPAddress::Family family_in,
402 IPAddress::Family family;
411 IPAddress address(GetParam().family);
420 MinPrefixLengthMapping(IPAddress::kFamilyIPv6, "fe80::", 128),
421 MinPrefixLengthMapping(IPAddress::kFamilyIPv4, "255.255.255.255", 32),
422 MinPrefixLengthMapping(IPAddress::kFamilyIPv4, "224.0.0.0", 32),
423 MinPrefixLengthMapping(IPAddress::kFamilyIPv4, "192.168.0.0", 24),
424 MinPrefixLengthMapping(IPAddress::kFamilyIPv4, "172.16.0.0", 16),
425 MinPrefixLengthMapping(IPAddress::kFamilyIPv4, "10.10.10.10", 8)));
428 CanReachAddressMapping() : family(IPAddress::kFamilyUnknown) {}
429 CanReachAddressMapping(IPAddress::Family family_in,
437 IPAddress::Family family;
447 IPAddress address_a(GetParam().family);
449 IPAddress address_b(GetParam().family);
458 CanReachAddressMapping(IPAddress::kFamilyIPv6,
460 CanReachAddressMapping(IPAddress::kFamilyIPv6,
462 CanReachAddressMapping(IPAddress::kFamilyIPv6,
464 CanReachAddressMapping(IPAddress::kFamilyIPv4,
466 CanReachAddressMapping(IPAddress::kFamilyIPv4,
468 CanReachAddressMapping(IPAddress::kFamilyIPv4,
470 CanReachAddressMapping(IPAddress::kFamilyIPv4,