Example usage for com.google.common.net InetAddresses hasEmbeddedIPv4ClientAddress

List of usage examples for com.google.common.net InetAddresses hasEmbeddedIPv4ClientAddress

Introduction

In this page you can find the example usage for com.google.common.net InetAddresses hasEmbeddedIPv4ClientAddress.

Prototype

public static boolean hasEmbeddedIPv4ClientAddress(Inet6Address ip) 

Source Link

Document

Examines the Inet6Address to determine if it is an IPv6 address of one of the specified address types that contain an embedded IPv4 address.

Usage

From source file:org.calrissian.mango.net.MoreInetAddresses.java

/**
 * Examines the Inet6Address to determine if it is an IPv6 address of one
 * of the specified address types that contain an embedded IPv4 address.
 *
 * <p>NOTE: This simply extends the {@code InetAddresses.hasEmbeddedIPv4ClientAddress} functionality
 * to support "IPv4 mapped" addresses.// w  w w .ja v  a2 s  . c o m
 *
 * @param ip {@link Inet6Address} to be examined for embedded IPv4 client address
 * @return {@code true} if there is an embedded IPv4 client address
 */
public static boolean hasEmbeddedIPv4ClientAddress(Inet6Address ip) {
    return isMappedIPv4Address(ip) || InetAddresses.hasEmbeddedIPv4ClientAddress(ip);
}