MCPcopy Create free account
hub / github.com/antlr/codebuff / isIsatapAddress

Method isIsatapAddress

output/java_guava/1.4.18/InetAddresses.java:717–733  ·  view source on GitHub ↗

Evaluates whether the argument is an ISATAP address. From RFC 5214: "ISATAP interface identifiers are constructed in Modified EUI-64 format [...] by concatenating the 24-bit IANA OUI (00-00-5E), the 8-bit hexadecimal value 0xFE, and a 32-bit IPv4 address in network byte order [...]" For more

(Inet6Address ip)

Source from the content-addressed store, hash-verified

715
716
717 public static boolean isIsatapAddress(Inet6Address ip) {
718
719 // If it's a Teredo address with the right port (41217, or 0xa101)
720 // which would be encoded as 0x5efe then it can't be an ISATAP address.
721 if (isTeredoAddress(ip)) {
722 return false;
723 }
724 byte[] bytes = ip.getAddress();
725 if ((bytes[8] | (byte) 0x03) != (byte) 0x03) {
726
727 // Verify that high byte of the 64 bit identifier is zero, modulo
728 // the U/L and G bits, with which we are not concerned.
729 return false;
730 }
731 return (bytes[9] == (byte) 0x00) && (bytes[10] == (byte) 0x5e)
732 && (bytes[11] == (byte) 0xfe);
733 }
734
735 /**
736 * Returns the IPv4 address embedded in an ISATAP address.

Callers 1

getIsatapIPv4AddressMethod · 0.95

Calls 1

isTeredoAddressMethod · 0.95

Tested by

no test coverage detected