use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.evpn._case.DestinationEvpnBuilder in project bgpcep by opendaylight.
the class EvpnNlriParserTest method testMpReach.
@Test
public void testMpReach() throws BGPParsingException {
final MpReachNlriBuilder mpReach = new MpReachNlriBuilder();
mpReach.setAfi(L2vpnAddressFamily.class);
mpReach.setSafi(EvpnSubsequentAddressFamily.class);
this.parser.parseNlri(Unpooled.wrappedBuffer(IncMultEthTagRParserTest.RESULT), mpReach, null);
final MpReachNlriBuilder mpReachExpected = new MpReachNlriBuilder();
mpReachExpected.setAfi(L2vpnAddressFamily.class);
mpReachExpected.setSafi(EvpnSubsequentAddressFamily.class);
final AdvertizedRoutes wd = new AdvertizedRoutesBuilder().setDestinationType(new DestinationEvpnCaseBuilder().setDestinationEvpn(new DestinationEvpnBuilder().setEvpnDestination(this.dest).build()).build()).build();
mpReachExpected.setAdvertizedRoutes(wd);
assertEquals(mpReachExpected.build(), mpReach.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.evpn._case.DestinationEvpnBuilder in project bgpcep by opendaylight.
the class EvpnNlriParser method parseNlri.
@Override
public void parseNlri(final ByteBuf nlri, final MpReachNlriBuilder builder, final PeerSpecificParserConstraint constraint) throws BGPParsingException {
if (!nlri.isReadable()) {
return;
}
final List<EvpnDestination> dst = parseNlri(nlri, constraint, builder.getAfi(), builder.getSafi());
builder.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(new DestinationEvpnCaseBuilder().setDestinationEvpn(new DestinationEvpnBuilder().setEvpnDestination(dst).build()).build()).build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.evpn._case.DestinationEvpnBuilder in project bgpcep by opendaylight.
the class EvpnNlriAttributesParserTest method createReach.
private static MpReachNlri createReach() {
final MpReachNlriBuilder mpReachExpected = new MpReachNlriBuilder();
final AdvertizedRoutes wd = new AdvertizedRoutesBuilder().setDestinationType(new DestinationEvpnCaseBuilder().setDestinationEvpn(new DestinationEvpnBuilder().setEvpnDestination(singletonList(new EvpnDestinationBuilder().setRouteDistinguisher(RD).setEvpnChoice(IncMultEthTagRParserTest.createIncMultiCase()).build())).build()).build()).build();
return mpReachExpected.setAdvertizedRoutes(wd).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.evpn._case.DestinationEvpnBuilder in project bgpcep by opendaylight.
the class EvpnNlriParser method parseNlri.
@Override
public void parseNlri(final ByteBuf nlri, final MpReachNlriBuilder builder) throws BGPParsingException {
if (!nlri.isReadable()) {
return;
}
final List<EvpnDestination> dst = parseNlri(nlri);
builder.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(new DestinationEvpnCaseBuilder().setDestinationEvpn(new DestinationEvpnBuilder().setEvpnDestination(dst).build()).build()).build());
}
Aggregations