public Ipv6ServiceUtils() { icmpv6FlowMap = new ConcurrentHashMap<>(); try { UNSPECIFIED_ADDR = Ipv6Address.getDefaultInstance( InetAddress.getByName("0:0:0:0:0:0:0:0").getHostAddress()); ALL_NODES_MCAST_ADDR = Ipv6Address.getDefaultInstance(InetAddress.getByName("FF02::1").getHostAddress()); } catch (UnknownHostException e) { LOG.error("Ipv6ServiceUtils: Failed to instantiate the ipv6 address", e); } }
nsPdu.setHopLimit(BitBufferHelper.getShort(BitBufferHelper.getBits(data, bitOffset, 8))); bitOffset = bitOffset + 8; nsPdu.setSourceIpv6(Ipv6Address.getDefaultInstance( InetAddress.getByAddress(BitBufferHelper.getBits(data, bitOffset, 128)).getHostAddress())); bitOffset = bitOffset + 128; nsPdu.setDestinationIpv6(Ipv6Address.getDefaultInstance( InetAddress.getByAddress(BitBufferHelper.getBits(data, bitOffset, 128)).getHostAddress())); bitOffset = bitOffset + 128; nsPdu.setReserved(Long.valueOf(0)); bitOffset = bitOffset + 32; nsPdu.setTargetIpAddress(Ipv6Address.getDefaultInstance( InetAddress.getByAddress(BitBufferHelper.getBits(data, bitOffset, 128)).getHostAddress())); } catch (BufferException | UnknownHostException e) {
.forValue(BitBufferHelper.getInt(BitBufferHelper.getBits(data, bitOffset + 48, 8)))); builder.setHopLimit(BitBufferHelper.getShort(BitBufferHelper.getBits(data, bitOffset + 56, 8))); builder.setSourceIpv6(Ipv6Address.getDefaultInstance( InetAddress.getByAddress(BitBufferHelper.getBits(data, bitOffset + 64, 128)).getHostAddress())); builder.setDestinationIpv6(Ipv6Address.getDefaultInstance( InetAddress.getByAddress(BitBufferHelper.getBits(data, bitOffset + 192, 128)).getHostAddress())); builder.setPayloadOffset((320 + bitOffset) / NetUtils.NumBitsInAByte);
rsPdu.setHopLimit(BitBufferHelper.getShort(BitBufferHelper.getBits(data, bitOffset, 8))); bitOffset = bitOffset + 8; rsPdu.setSourceIpv6(Ipv6Address.getDefaultInstance( InetAddress.getByAddress(BitBufferHelper.getBits(data, bitOffset, 128)).getHostAddress())); bitOffset = bitOffset + 128; rsPdu.setDestinationIpv6(Ipv6Address.getDefaultInstance( InetAddress.getByAddress(BitBufferHelper.getBits(data, bitOffset, 128)).getHostAddress())); bitOffset = bitOffset + 128;