Search in sources :

Example 1 with ArpRequestReceivedBuilder

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();
    }
}
Also used : ArpRequestReceivedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.arputil.rev160406.ArpRequestReceivedBuilder) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress) PhysAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress)

Aggregations

IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)1 PhysAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress)1 ArpRequestReceivedBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.arputil.rev160406.ArpRequestReceivedBuilder)1