Search in sources :

Example 1 with IpAdjacency

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev171025.sr.subobject.nai.IpAdjacency in project bgpcep by opendaylight.

the class AbstractSrSubobjectParser method serializeNai.

private static void serializeNai(final Nai nai, final SidType sidType, final ByteBuf buffer) {
    switch(sidType) {
        case Ipv4NodeId:
            writeIpv4Address(((IpNodeId) nai).getIpAddress().getIpv4Address(), buffer);
            break;
        case Ipv6NodeId:
            writeIpv6Address(((IpNodeId) nai).getIpAddress().getIpv6Address(), buffer);
            break;
        case Ipv4Adjacency:
            writeIpv4Address(((IpAdjacency) nai).getLocalIpAddress().getIpv4Address(), buffer);
            writeIpv4Address(((IpAdjacency) nai).getRemoteIpAddress().getIpv4Address(), buffer);
            break;
        case Ipv6Adjacency:
            writeIpv6Address(((IpAdjacency) nai).getLocalIpAddress().getIpv6Address(), buffer);
            writeIpv6Address(((IpAdjacency) nai).getRemoteIpAddress().getIpv6Address(), buffer);
            break;
        case Unnumbered:
            final UnnumberedAdjacency unnumbered = (UnnumberedAdjacency) nai;
            ByteBufWriteUtil.writeUnsignedInt(unnumbered.getLocalNodeId(), buffer);
            ByteBufWriteUtil.writeUnsignedInt(unnumbered.getLocalInterfaceId(), buffer);
            ByteBufWriteUtil.writeUnsignedInt(unnumbered.getRemoteNodeId(), buffer);
            ByteBufWriteUtil.writeUnsignedInt(unnumbered.getRemoteInterfaceId(), buffer);
            break;
        default:
            break;
    }
}
Also used : IpNodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev171025.sr.subobject.nai.IpNodeId) UnnumberedAdjacency(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev171025.sr.subobject.nai.UnnumberedAdjacency) IpAdjacency(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev171025.sr.subobject.nai.IpAdjacency)

Aggregations

IpAdjacency (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev171025.sr.subobject.nai.IpAdjacency)1 IpNodeId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev171025.sr.subobject.nai.IpNodeId)1 UnnumberedAdjacency (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev171025.sr.subobject.nai.UnnumberedAdjacency)1