use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.route.target.constrain.rev180618.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationRouteTargetConstrainAdvertizedCase in project bgpcep by opendaylight.
the class RouteTargetConstrainNlriHandler method serializeAttribute.
@Override
public void serializeAttribute(final Attributes pathAttributes, final ByteBuf byteAggregator) {
final AttributesReach pathAttributes1 = pathAttributes.augmentation(AttributesReach.class);
final AttributesUnreach pathAttributes2 = pathAttributes.augmentation(AttributesUnreach.class);
if (pathAttributes1 != null) {
final AdvertizedRoutes routes = pathAttributes1.getMpReachNlri().getAdvertizedRoutes();
if (routes != null && routes.getDestinationType() instanceof DestinationRouteTargetConstrainAdvertizedCase) {
final DestinationRouteTargetConstrainAdvertizedCase reach = (DestinationRouteTargetConstrainAdvertizedCase) routes.getDestinationType();
byteAggregator.writeBytes(serializeNlriDestinations(reach.getDestinationRouteTargetConstrain().getRouteTargetConstrainDestination()));
}
} else if (pathAttributes2 != null) {
final WithdrawnRoutes withdrawnRoutes = pathAttributes2.getMpUnreachNlri().getWithdrawnRoutes();
if (withdrawnRoutes != null && withdrawnRoutes.getDestinationType() instanceof DestinationRouteTargetConstrainWithdrawnCase) {
final DestinationRouteTargetConstrainWithdrawnCase reach = (DestinationRouteTargetConstrainWithdrawnCase) withdrawnRoutes.getDestinationType();
byteAggregator.writeBytes(serializeNlriDestinations(reach.getDestinationRouteTargetConstrain().getRouteTargetConstrainDestination()));
}
}
}
Aggregations