@Override public void writeTo(ByteBuf byteBuf, LispIpv6Address address) throws LispWriterException { byte[] ipByte = address.getAddress().getIp6Address().toOctets(); byteBuf.writeBytes(ipByte); } }
/** * Gets the {@link Ip6Prefix} view of the IP prefix. * * @return the {@link Ip6Prefix} view of the IP prefix if it is IPv6, * otherwise null */ public Ip6Prefix getIp6Prefix() { if (!isIp6()) { return null; } // Return this object itself if it is already instance of Ip6Prefix if (this instanceof Ip6Prefix) { return (Ip6Prefix) this; } return Ip6Prefix.valueOf(address.getIp6Address(), prefixLength); }
/** * Check if this IP address is a link-local address. * * @return true if this address is a link-local address */ public boolean isLinkLocal() { return isIp4() ? Ip4Prefix.IPV4_LINK_LOCAL_PREFIX.contains(this.getIp4Address()) : Ip6Prefix.IPV6_LINK_LOCAL_PREFIX.contains(this.getIp6Address()); }
/** * Check if this IP address is a multicast address. * * @return true if this address is a multicast address */ public boolean isMulticast() { return isIp4() ? Ip4Prefix.IPV4_MULTICAST_PREFIX.contains(this.getIp4Address()) : Ip6Prefix.IPV6_MULTICAST_PREFIX.contains(this.getIp6Address()); }
case IPV6_SRC: ip = (L3ModificationInstruction.ModIPInstruction) i; ip6 = ip.ip().getIp6Address(); oxm = factory.oxms().ipv6Src(IPv6Address.of(ip6.toOctets())); break; case IPV6_DST: ip = (L3ModificationInstruction.ModIPInstruction) i; ip6 = ip.ip().getIp6Address(); oxm = factory.oxms().ipv6Dst(IPv6Address.of(ip6.toOctets())); break;
case IPV6_SRC: ip = (ModIPInstruction) i; ip6 = ip.ip().getIp6Address(); oxm = factory().oxms().ipv6Src(IPv6Address.of(ip6.toOctets())); break; case IPV6_DST: ip = (ModIPInstruction) i; ip6 = ip.ip().getIp6Address(); oxm = factory().oxms().ipv6Dst(IPv6Address.of(ip6.toOctets())); break;