use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.update.message.Nlri in project bgpcep by opendaylight.
the class RouteTargetConstrainNlriHandler method parseNlri.
@Override
public void parseNlri(final ByteBuf nlri, final MpUnreachNlriBuilder builder, final PeerSpecificParserConstraint constraint) throws BGPParsingException {
if (!nlri.isReadable()) {
return;
}
final boolean mPathSupported = MultiPathSupportUtil.isTableTypeSupported(constraint, new BgpTableTypeImpl(builder.getAfi(), builder.getSafi()));
builder.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(new DestinationRouteTargetConstrainWithdrawnCaseBuilder().setDestinationRouteTargetConstrain(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.route.target.constrain.rev180618.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.destination.route.target.constrain.withdrawn._case.DestinationRouteTargetConstrainBuilder().setRouteTargetConstrainDestination(parseNlriDestinations(nlri, mPathSupported)).build()).build()).build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.update.message.Nlri in project bgpcep by opendaylight.
the class MvpnIpv4NlriHandler method parseNlri.
@Override
public void parseNlri(final ByteBuf nlri, final MpReachNlriBuilder builder, final PeerSpecificParserConstraint constraint) throws BGPParsingException {
if (!nlri.isReadable()) {
return;
}
final boolean mPathSupported = MultiPathSupportUtil.isTableTypeSupported(constraint, new BgpTableTypeImpl(builder.getAfi(), builder.getSafi()));
builder.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(Ipv4NlriHandler.parseIpv4ReachNlri(nlri, mPathSupported)).build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.update.message.Nlri 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();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.update.message.Nlri in project bgpcep by opendaylight.
the class Ipv6NlriHandler method parseIpv6UnreachNlri.
static DestinationMvpnIpv6WithdrawnCase parseIpv6UnreachNlri(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 DestinationMvpnIpv6WithdrawnCaseBuilder().setDestinationMvpn(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.ipv6.rev180417.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.destination.mvpn.ipv6.withdrawn._case.DestinationMvpnBuilder().setMvpnDestination(dests).build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.update.message.Nlri in project bgpcep by opendaylight.
the class MvpnIpv6NlriHandler method parseNlri.
@Override
public void parseNlri(final ByteBuf nlri, final MpReachNlriBuilder builder, final PeerSpecificParserConstraint constraint) throws BGPParsingException {
if (!nlri.isReadable()) {
return;
}
final boolean mPathSupported = MultiPathSupportUtil.isTableTypeSupported(constraint, new BgpTableTypeImpl(builder.getAfi(), builder.getSafi()));
builder.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(Ipv6NlriHandler.parseIpv6ReachNlri(nlri, mPathSupported)).build());
}
Aggregations