Home | History | Annotate | Download | only in net

Lines Matching refs:inetAddress

28 import java.net.InetAddress;
110 return (Inet6Address) InetAddress.getByAddress(LOOPBACK6_BYTES);
114 return (Inet6Address) InetAddress.getByAddress("ip6-localhost", LOOPBACK6_BYTES);
140 assertEquals(expectedString, InetAddress.parseNumericAddress(address).toString());
146 InetAddress.parseNumericAddress("example.com"); // Not numeric.
151 // Strange special cases, for compatibility with InetAddress.getByName.
152 assertTrue(InetAddress.parseNumericAddress(null).isLoopbackAddress());
153 assertTrue(InetAddress.parseNumericAddress("").isLoopbackAddress());
160 InetAddress.parseNumericAddress(invalid);
191 assertTrue(InetAddress.isNumeric(valid));
197 assertFalse(InetAddress.isNumeric("example.com"));
203 assertFalse(invalid, InetAddress.isNumeric(invalid));
208 assertFalse(InetAddress.getByName("127.0.0.1").isLinkLocalAddress());
209 assertFalse(InetAddress.getByName("::ffff:127.0.0.1").isLinkLocalAddress());
210 assertTrue(InetAddress.getByName("169.254.1.2").isLinkLocalAddress());
212 assertFalse(InetAddress.getByName("fec0::").isLinkLocalAddress());
213 assertTrue(InetAddress.getByName("fe80::").isLinkLocalAddress());
218 assertFalse(InetAddress.getByName("239.254.255.255").isMCSiteLocal());
219 assertTrue(InetAddress.getByName("239.255.0.0").isMCSiteLocal());
220 assertTrue(InetAddress.getByName("239.255.255.255").isMCSiteLocal());
221 assertFalse(InetAddress.getByName("240.0.0.0").isMCSiteLocal());
223 assertFalse(InetAddress.getByName("ff06::").isMCSiteLocal());
224 assertTrue(InetAddress.getByName("ff05::").isMCSiteLocal());
225 assertTrue(InetAddress.getByName("ff15::").isMCSiteLocal());
235 InetAddress inetAddress = InetAddress.getByName("www.google.com");
236 new SerializationTester<InetAddress>(inetAddress, s) {
237 @Override protected void verify(InetAddress deserialized) throws Exception {
244 @Override protected boolean equals(InetAddress a, InetAddress b) {
252 InetAddress inetAddress = InetAddress.getByName("www.google.com");
260 assertFalse(inetAddress.isReachable(netIf, 256, 500));
268 InetAddress[] inetAddresses = InetAddress.getAllByName("www.google.com");
269 for (InetAddress ia : inetAddresses) {
275 final InetAddress blackholeAddress = InetAddress.getByName("100::1");
281 assertFalse(InetAddress.getByName("144.32.32.1").isSiteLocalAddress());
282 assertTrue(InetAddress.getByName("10.0.0.1").isSiteLocalAddress());
283 assertTrue(InetAddress.getByName("172.16.0.1").isSiteLocalAddress());
284 assertFalse(InetAddress.getByName("172.32.0.1").isSiteLocalAddress());
285 assertTrue(InetAddress.getByName("192.168.0.1").isSiteLocalAddress());
287 assertFalse(InetAddress.getByName("fc00::").isSiteLocalAddress());
288 assertTrue(InetAddress.getByName("fec0::").isSiteLocalAddress());
300 InetAddress.getByName(invalid);
308 InetAddress.getByName(invalid);
322 InetAddress.getByName(valid);
325 InetAddress.getByName(valid);
329 InetAddress.getByName(tempIPAddress);
334 assertTrue(InetAddress.getLoopbackAddress().isLoopbackAddress());
339 InetAddress addr = InetAddress.getByName("239.191.255.255");
354 assertEquals("::1", InetAddress.getByName("::1").getHostAddress());
359 assertEquals("127.0.0.1", InetAddress.getByName("::ffff:127.0.0.1").getHostAddress());
361 InetAddress aAddr = InetAddress.getByName("224.0.0.0");
366 InetAddress.getByName("1");
421 InetAddress addr1 = InetAddress.getByName("1.0.0.1");
422 InetAddress addr2 = InetAddress.getByName("1.0.0.1");
445 InetAddress ia = InetAddress.getByName(address);
453 InetAddress inetAddress = InetAddress.getByAddress(LOOPBACK6_BYTES);
456 assertEquals("::1", getHostStringWithoutReverseDns(inetAddress));
459 assertEquals("ip6-localhost", inetAddress.getHostName());
462 assertEquals("ip6-localhost", getHostStringWithoutReverseDns(inetAddress));
467 InetAddress inetAddress = InetAddress.getByAddress(LOOPBACK4_BYTES);
468 checkInetAddress(LOOPBACK4_BYTES, "localhost", inetAddress);
469 assertTrue(inetAddress.isLoopbackAddress());
474 InetAddress inetAddress = InetAddress.getByAddress(LOOPBACK6_BYTES);
475 checkInetAddress(LOOPBACK6_BYTES, "ip6-localhost", inetAddress);
476 assertTrue(inetAddress.isLoopbackAddress());
481 InetAddress inetAddress = InetAddress.getByName("127.0.0.1");
482 checkInetAddress(LOOPBACK4_BYTES, "localhost", inetAddress);
483 assertTrue(inetAddress.isLoopbackAddress());
488 InetAddress inetAddress = InetAddress.getByName("::1");
489 checkInetAddress(LOOPBACK6_BYTES, "ip6-localhost", inetAddress);
490 assertTrue(inetAddress.isLoopbackAddress());
495 InetAddress inetAddress = InetAddress.getByName("");
496 checkInetAddress(LOOPBACK6_BYTES, "ip6-localhost", inetAddress);
497 assertTrue(inetAddress.isLoopbackAddress());
502 InetAddress[] inetAddresses = InetAddress.getAllByName("localhost");
504 InetAddress inetAddress = inetAddresses[0];
505 checkInetAddress(LOOPBACK4_BYTES, "localhost", inetAddress);
506 assertTrue(inetAddress.isLoopbackAddress());
511 InetAddress[] inetAddresses = InetAddress.getAllByName("ip6-localhost");
513 InetAddress inetAddress = inetAddresses[0];
514 checkInetAddress(LOOPBACK6_BYTES, "ip6-localhost", inetAddress);
515 assertTrue(inetAddress.isLoopbackAddress());
520 InetAddress inetAddress = InetAddress.getByName("::1");
522 Set<InetAddress> expectedLoopbackAddresses =
524 assertTrue(expectedLoopbackAddresses.contains(inetAddress));
529 InetAddress[] addresses = InetAddress.getAllByName(null);
530 InetAddress[] addresses2 = InetAddress.getAllByName(null);
538 addresses2 = InetAddress.getAllByName(null);
545 InetAddress[] inetAddresses = InetAddress.getAllByName(null);
547 Set<InetAddress> expectedLoopbackAddresses =
561 byte[] expectedAddressBytes, String expectedHostname, InetAddress actual) {
572 private static Set<InetAddress> createSet(InetAddress... members) {
573 return new HashSet<InetAddress>(Arrays.asList(members));
576 private static String getHostStringWithoutReverseDns(InetAddress inetAddress) {
577 // The InetAddress API provides no way of avoiding a DNS lookup, but InetSocketAddress
579 InetSocketAddress inetSocketAddress = new InetSocketAddress(inetAddress, 9999);