/** * Utility routine to check if the multicast address has link scope. * * @return a boolean indicating if the address has is a multicast address of link-local scope, false if it is not of * link-local scope or it is not a multicast address */ public boolean isMCLinkLocal() { return this.javaNetAddress.isMCLinkLocal(); }
public static boolean isMCLinkLocal(InetAddress addr){ return addr.isMCLinkLocal(); }
@JRubyMethod(name = "ipv6_mc_linklocal?") public IRubyObject ipv6_mc_linklocal_p(ThreadContext context) { return context.runtime.newBoolean(inetAddress.isMCLinkLocal()); }
@JRubyMethod(name = "ipv6_mc_linklocal?") public IRubyObject ipv6_mc_linklocal_p(ThreadContext context) { return context.runtime.newBoolean(inetAddress.isMCLinkLocal()); }
/** * Returns true only iff none of the ip address resolved are associated with the local machine including * its public ip addresses. */ public static boolean isSimpleNonLocalAddress(String hostname) throws UnknownHostException { if (hostname == null || hostname.isEmpty()) { throw new IllegalArgumentException(); } for (InetAddress addr : InetAddress.getAllByName(hostname)) { if (addr.isLoopbackAddress() || addr.isSiteLocalAddress() || addr.isAnyLocalAddress() || addr.isLinkLocalAddress() || addr.isMCGlobal() || addr.isMCLinkLocal() || addr.isMCNodeLocal() || addr.isMCOrgLocal() || addr.isMCSiteLocal() || addr.isMulticastAddress()) { return false; } } return true; }
InetAddress from = packet.getAddress(); if (from != null) { if ((this.getInetAddress().isLinkLocalAddress() || this.getInetAddress().isMCLinkLocal()) && (!from.isLinkLocalAddress())) {