gpt4 book ai didi

org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.update.attributes.mp.unreach.nlri.WithdrawnRoutesBuilder类的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 10:01:05 28 4
gpt4 key购买 nike

本文整理了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.update.attributes.mp.unreach.nlri.WithdrawnRoutesBuilder类的一些代码示例,展示了WithdrawnRoutesBuilder类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WithdrawnRoutesBuilder类的具体详情如下:
包路径:org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.update.attributes.mp.unreach.nlri.WithdrawnRoutesBuilder
类名称:WithdrawnRoutesBuilder

WithdrawnRoutesBuilder介绍

暂无

代码示例

代码示例来源:origin: org.opendaylight.bgpcep/bgp-inet

@Override
public void parseNlri(@Nonnull final ByteBuf nlri, @Nonnull final MpUnreachNlriBuilder builder, @Nullable final PeerSpecificParserConstraint constraint) throws BGPParsingException {
  builder.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationIpv6CaseBuilder().setDestinationIpv6(
      prefixes(nlri, constraint, builder.getAfi(), builder.getSafi())).build()).build());
}

代码示例来源:origin: org.opendaylight.bgpcep/bgp-inet

@Override
public void parseNlri(final ByteBuf nlri, final MpUnreachNlriBuilder builder, final PeerSpecificParserConstraint constraint) {
  builder.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationIpv4CaseBuilder().setDestinationIpv4(
      prefixes(nlri, constraint, builder.getAfi(), builder.getSafi())).build()).build());
}

代码示例来源:origin: org.opendaylight.bgpcep/bgp-linkstate

@Override
public void parseNlri(final ByteBuf nlri, final MpUnreachNlriBuilder builder) throws BGPParsingException {
  if (!nlri.isReadable()) {
    return;
  }
  final List<CLinkstateDestination> dst = parseNlri(nlri);
  builder.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
    new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationLinkstateCaseBuilder().setDestinationLinkstate(
      new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.destination.linkstate._case.DestinationLinkstateBuilder().setCLinkstateDestination(
        dst).build()).build()).build());
}

代码示例来源:origin: org.opendaylight.bgpcep/bgp-flowspec

@Override
  public final void parseNlri(@Nonnull final ByteBuf nlri, @Nonnull final MpUnreachNlriBuilder builder, @Nullable final PeerSpecificParserConstraint constraint)
    throws BGPParsingException {
    if (!nlri.isReadable()) {
      return;
    }
    final PathId pathId = readPathId(nlri, builder.getAfi(), builder.getSafi(), constraint);
    verifyNlriLength(nlri);
    final Object[] nlriFields = parseNlri(nlri);
    builder.setWithdrawnRoutes(
      new WithdrawnRoutesBuilder()
        .setDestinationType(
          createWithdrawnDestinationType(nlriFields, pathId)
        ).build()
    );
  }
}

代码示例来源:origin: org.opendaylight.bgpcep/bgp-evpn

@Override
public void parseNlri(final ByteBuf nlri, final MpUnreachNlriBuilder builder) throws BGPParsingException {
  if (!nlri.isReadable()) {
    return;
  }
  final List<EvpnDestination> dst = parseNlri(nlri);
  builder.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
    new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev160321.update.attributes.mp.unreach.nlri.withdrawn.
      routes.destination.type.DestinationEvpnCaseBuilder().setDestinationEvpn(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.
      yang.bgp.evpn.rev160321.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.destination.evpn._case.DestinationEvpnBuilder()
      .setEvpnDestination(dst).build()).build()).build());
}

代码示例来源:origin: org.opendaylight.bgpcep/bgp-rib-spi

/**
 * Build MpUnReachNlri object from DOM representation.
 *
 * @param routes Collection of MapEntryNode DOM representation of routes
 * @return MpUnreachNlri
 */
private MpUnreachNlri buildUnreach(final Collection<MapEntryNode> routes) {
  final MpUnreachNlriBuilder mb = new MpUnreachNlriBuilder();
  mb.setAfi(this.getAfi());
  mb.setSafi(this.getSafi());
  mb.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(buildWithdrawnDestination(routes)).build());
  return mb.build();
}

代码示例来源:origin: org.opendaylight.bgpcep/bgp-bmp-impl

/**
 * Create MPUnreach for the prefixes to be handled in the same way as linkstate routes
 *
 * @param message Update message containing withdrawn routes
 * @return MpUnreachNlri with prefixes from the withdrawn routes field
 */
private MpUnreachNlri prefixesToMpUnreach(final UpdateMessage message) {
  final List<Ipv4Prefixes> prefixes = new ArrayList<>();
  for (final Ipv4Prefix p : message.getWithdrawnRoutes().getWithdrawnRoutes()) {
    prefixes.add(new Ipv4PrefixesBuilder().setPrefix(p).build());
  }
  return new MpUnreachNlriBuilder().setAfi(Ipv4AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class).setWithdrawnRoutes(
    new WithdrawnRoutesBuilder().setDestinationType(
      new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationIpv4CaseBuilder().setDestinationIpv4(
        new DestinationIpv4Builder().setIpv4Prefixes(prefixes).build()).build()).build()).build();
}

代码示例来源:origin: org.opendaylight.bgpcep/bgp-rib-impl

/**
 * Create MPUnreach for the prefixes to be handled in the same way as linkstate routes
 *
 * @param message Update message containing withdrawn routes
 * @param isAnyNlriAnnounced
 * @return MpUnreachNlri with prefixes from the withdrawn routes field
 */
private static MpUnreachNlri prefixesToMpUnreach(final Update message, final boolean isAnyNlriAnnounced) {
  final List<Ipv4Prefixes> prefixes = new ArrayList<>();
  for (final Ipv4Prefix p : message.getWithdrawnRoutes().getWithdrawnRoutes()) {
    boolean nlriAnounced = false;
    if(isAnyNlriAnnounced) {
      nlriAnounced = message.getNlri().getNlri().contains(p);
    }
    if(!nlriAnounced) {
      prefixes.add(new Ipv4PrefixesBuilder().setPrefix(p).build());
    }
  }
  return new MpUnreachNlriBuilder().setAfi(Ipv4AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class).setWithdrawnRoutes(
      new WithdrawnRoutesBuilder().setDestinationType(
          new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev150305.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationIpv4CaseBuilder().setDestinationIpv4(
              new DestinationIpv4Builder().setIpv4Prefixes(prefixes).build()).build()).build()).build();
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com