Search in sources :

Example 1 with LispAddress

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddress in project lispflowmapping by opendaylight.

the class AfiListSerializer method getLcafLength.

@Override
protected short getLcafLength(LispAddress lispAddress) {
    short totalSize = 0;
    AfiList afiList = (((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.AfiList) lispAddress.getAddress()).getAfiList());
    for (SimpleAddress address : afiList.getAddressList()) {
        totalSize += SimpleAddressSerializer.getInstance().getAddressSize(address);
    }
    return totalSize;
}
Also used : AfiList(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.afi.list.AfiList) SimpleAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress)

Example 2 with LispAddress

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddress in project lispflowmapping by opendaylight.

the class ApplicationDataSerializer method serializeData.

@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
    ApplicationData appData = ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ApplicationData) lispAddress.getAddress()).getApplicationData();
    buffer.put(ByteUtil.partialIntToByteArray(NumberUtil.asInt(appData.getIpTos()), Length.TOC));
    buffer.put((byte) NumberUtil.asShort(appData.getProtocol()));
    if (appData.getLocalPortLow() != null) {
        buffer.putShort(NumberUtil.asShort(appData.getLocalPortLow().getValue().shortValue()));
    } else {
        buffer.putShort((short) 0);
    }
    if (appData.getLocalPortHigh() != null) {
        buffer.putShort(NumberUtil.asShort(appData.getLocalPortHigh().getValue().shortValue()));
    } else {
        buffer.putShort((short) 0);
    }
    if (appData.getRemotePortLow() != null) {
        buffer.putShort(NumberUtil.asShort(appData.getRemotePortLow().getValue().shortValue()));
    } else {
        buffer.putShort((short) 0);
    }
    if (appData.getRemotePortHigh() != null) {
        buffer.putShort(NumberUtil.asShort(appData.getRemotePortHigh().getValue().shortValue()));
    } else {
        buffer.putShort((short) 0);
    }
    SimpleAddressSerializer.getInstance().serialize(buffer, appData.getAddress());
}
Also used : ApplicationData(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.application.data.ApplicationData)

Example 3 with LispAddress

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddress in project lispflowmapping by opendaylight.

the class DistinguishedNameSerializer method serializeData.

@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
    DistinguishedName distinguishedNameAddress = (DistinguishedName) lispAddress.getAddress();
    buffer.put(distinguishedNameAddress.getDistinguishedName().getValue().getBytes());
    buffer.put((byte) 0);
}
Also used : DistinguishedName(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.DistinguishedName)

Example 4 with LispAddress

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddress in project lispflowmapping by opendaylight.

the class Ipv4BinarySerializer method serializeData.

@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
    Ipv4Binary address = (Ipv4Binary) lispAddress.getAddress();
    buffer.put(address.getIpv4Binary().getValue());
}
Also used : Ipv4Binary(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv4Binary)

Example 5 with LispAddress

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddress in project lispflowmapping by opendaylight.

the class Ipv4PrefixBinarySerializer method serializeData.

@Override
protected void serializeData(ByteBuffer buffer, LispAddress lispAddress) {
    Ipv4PrefixBinary prefix = (Ipv4PrefixBinary) lispAddress.getAddress();
    buffer.put(prefix.getIpv4AddressBinary().getValue());
}
Also used : Ipv4PrefixBinary(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.binary.address.types.rev160504.augmented.lisp.address.address.Ipv4PrefixBinary)

Aggregations

SimpleAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress)3 ExplicitLocatorPath (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ExplicitLocatorPath)2 KeyValueAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.KeyValueAddress)2 Hop (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.explicit.locator.path.explicit.locator.path.Hop)2 Inet4Address (java.net.Inet4Address)1 Inet6Address (java.net.Inet6Address)1 Test (org.junit.Test)1 LispAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddress)1 Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address)1 DistinguishedName (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.DistinguishedName)1 InstanceId (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.InstanceId)1 Ipv4Prefix (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv4Prefix)1 Ipv6 (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6)1 Ipv6Prefix (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Prefix)1 Mac (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Mac)1 NoAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.NoAddress)1 ServicePath (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.ServicePath)1 SourceDestKey (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.SourceDestKey)1 AfiList (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.afi.list.AfiList)1 ApplicationData (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.application.data.ApplicationData)1