Search in sources :

Example 1 with GotMapReplyBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapReplyBuilder in project lispflowmapping by opendaylight.

the class LispSouthboundHandler method handleMapReply.

@SuppressWarnings("checkstyle:IllegalCatch")
private void handleMapReply(ByteBuffer inBuffer, InetAddress sourceAddress, int port) {
    try {
        MapReply mapReply = MapReplySerializer.getInstance().deserialize(inBuffer);
        GotMapReplyBuilder gotMapReplyBuilder = new GotMapReplyBuilder();
        gotMapReplyBuilder.setMapReply(LispNotificationHelper.convertMapReply(mapReply));
        TransportAddressBuilder transportAddressBuilder = new TransportAddressBuilder();
        transportAddressBuilder.setIpAddress(LispNotificationHelper.getIpAddressBinaryFromInetAddress(sourceAddress));
        transportAddressBuilder.setPort(new PortNumber(port));
        gotMapReplyBuilder.setTransportAddress(transportAddressBuilder.build());
        lispSbPlugin.sendNotificationIfPossible(gotMapReplyBuilder.build());
    } catch (RuntimeException re) {
        throw new LispMalformedPacketException("Couldn't deserialize Map-Reply (len=" + inBuffer.capacity() + ")", re);
    } catch (InterruptedException e) {
        LOG.warn("Notification publication interrupted!");
    }
}
Also used : MapReply(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply) LispMalformedPacketException(org.opendaylight.lispflowmapping.southbound.lisp.exception.LispMalformedPacketException) GotMapReplyBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapReplyBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber) TransportAddressBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.transport.address.TransportAddressBuilder)

Aggregations

LispMalformedPacketException (org.opendaylight.lispflowmapping.southbound.lisp.exception.LispMalformedPacketException)1 PortNumber (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber)1 GotMapReplyBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.GotMapReplyBuilder)1 MapReply (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.MapReply)1 TransportAddressBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.transport.address.TransportAddressBuilder)1