use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.arputil.rev160406.ArpRequestReceivedBuilder in project genius by opendaylight.
the class ArpUtilImpl method fireArpReqRecvdNotification.
private void fireArpReqRecvdNotification(String interfaceName, InetAddress srcInetAddr, byte[] srcMac, InetAddress dstInetAddr, int tableId, BigInteger metadata) throws InterruptedException {
arpReqRecvd.mark();
String macAddress = NWUtil.toStringMacAddress(srcMac);
ArpRequestReceivedBuilder builder = new ArpRequestReceivedBuilder();
builder.setInterface(interfaceName);
builder.setOfTableId((long) tableId);
builder.setSrcIpaddress(new IpAddress(srcInetAddr.getHostAddress().toCharArray()));
builder.setDstIpaddress(new IpAddress(dstInetAddr.getHostAddress().toCharArray()));
builder.setSrcMac(new PhysAddress(macAddress));
builder.setMetadata(metadata);
ListenableFuture<?> offerNotification = notificationPublishService.offerNotification(builder.build());
if (offerNotification != null && offerNotification.equals(NotificationPublishService.REJECTED)) {
arpReqRecvdNotificationRejected.mark();
} else {
arpReqRecvdNotification.mark();
}
}
Aggregations