Java InetAddress Check isIPv6UniqueSiteLocal(InetAddress address)

Here you can find the source of isIPv6UniqueSiteLocal(InetAddress address)

Description

is I Pv Unique Site Local

License

Open Source License

Declaration

private static boolean isIPv6UniqueSiteLocal(InetAddress address) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.net.InetAddress;

public class Main {
    private static boolean isIPv6UniqueSiteLocal(InetAddress address) {
        // ref: https://en.wikipedia.org/wiki/Unique_local_address

        // currently undefined but could be used in the near future fc00::/8
        return (address.getAddress()[0] & 0xFF) == 0xFC
                // in use for unique site-local fd00::/8
                || (address.getAddress()[0] & 0xFF) == 0xFD;
    }//  www  .j a  v  a 2 s.c  o  m
}

Related

  1. isInRage(InetAddress check, InetAddress bcast, int netmask)
  2. isIpAddressInRange(InetAddress ipStart, InetAddress ipEnd, InetAddress ipToCheck)
  3. isIPLocal(final InetAddress adr)
  4. isIPv6(final InetAddress ip)
  5. isIPv6(InetAddress addr)
  6. isLikelyBroadcast(InetAddress address)
  7. isLinkLocalIPv4Address(InetAddress add)
  8. isLinkLocalNetwork(InetAddress addr)
  9. isLocal(InetAddress a)