use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.arputil.rev160406.ArpResponseReceivedBuilder in project genius by opendaylight.
the class ArpUtilImpl method fireArpRespRecvdNotification.
private void fireArpRespRecvdNotification(String interfaceName, InetAddress srcInetAddr, byte[] srcMacAddressBytes, int tableId, BigInteger metadata, InetAddress dstInetAddr, byte[] dstMacAddressBytes) throws InterruptedException {
arpRespRecvd.mark();
IpAddress srcIp = new IpAddress(srcInetAddr.getHostAddress().toCharArray());
IpAddress dstIp = new IpAddress(dstInetAddr.getHostAddress().toCharArray());
String srcMacAddress = NWUtil.toStringMacAddress(srcMacAddressBytes);
PhysAddress srcMac = new PhysAddress(srcMacAddress);
String dstMacAddress = NWUtil.toStringMacAddress(dstMacAddressBytes);
PhysAddress dstMac = new PhysAddress(dstMacAddress);
ArpResponseReceivedBuilder builder = new ArpResponseReceivedBuilder();
builder.setInterface(interfaceName);
builder.setSrcIpaddress(srcIp);
builder.setOfTableId((long) tableId);
builder.setSrcMac(srcMac);
builder.setMetadata(metadata);
builder.setDstIpaddress(dstIp);
builder.setDstMac(dstMac);
ListenableFuture<?> offerNotification = notificationPublishService.offerNotification(builder.build());
if (offerNotification != null && offerNotification.equals(NotificationPublishService.REJECTED)) {
arpRespRecvdNotificationRejected.mark();
} else {
arpRespRecvdNotification.mark();
}
}
Aggregations