Search in sources :

Example 1 with DestinationMvpnIpv6AdvertizedCaseBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.ipv6.rev180417.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationMvpnIpv6AdvertizedCaseBuilder in project bgpcep by opendaylight.

the class Ipv6NlriHandler method parseIpv6ReachNlri.

static DestinationMvpnIpv6AdvertizedCase parseIpv6ReachNlri(final ByteBuf nlri, final boolean addPathSupported) {
    final List<MvpnDestination> dests = new ArrayList<>();
    while (nlri.isReadable()) {
        final MvpnDestinationBuilder builder = new MvpnDestinationBuilder();
        if (addPathSupported) {
            builder.setPathId(PathIdUtil.readPathId(nlri));
        }
        final NlriType type = NlriType.forValue(nlri.readUnsignedByte());
        final int length = nlri.readUnsignedByte();
        final ByteBuf nlriBuf = nlri.readSlice(length);
        builder.setMvpnChoice(SimpleMvpnNlriRegistry.getInstance().parseMvpn(type, nlriBuf));
        dests.add(builder.build());
    }
    return new DestinationMvpnIpv6AdvertizedCaseBuilder().setDestinationMvpn(new DestinationMvpnBuilder().setMvpnDestination(dests).build()).build();
}
Also used : MvpnDestinationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.ipv6.rev180417.mvpn.destination.MvpnDestinationBuilder) MvpnDestination(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.ipv6.rev180417.mvpn.destination.MvpnDestination) DestinationMvpnIpv6AdvertizedCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.ipv6.rev180417.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationMvpnIpv6AdvertizedCaseBuilder) ArrayList(java.util.ArrayList) NlriType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev200120.NlriType) ByteBuf(io.netty.buffer.ByteBuf) DestinationMvpnBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.ipv6.rev180417.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.mvpn.ipv6.advertized._case.DestinationMvpnBuilder)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 ArrayList (java.util.ArrayList)1 MvpnDestination (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.ipv6.rev180417.mvpn.destination.MvpnDestination)1 MvpnDestinationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.ipv6.rev180417.mvpn.destination.MvpnDestinationBuilder)1 DestinationMvpnIpv6AdvertizedCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.ipv6.rev180417.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationMvpnIpv6AdvertizedCaseBuilder)1 DestinationMvpnBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.ipv6.rev180417.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.mvpn.ipv6.advertized._case.DestinationMvpnBuilder)1 NlriType (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev200120.NlriType)1