@Test public void testGetAcceptStatements() { BgpNeighbor bgpNeighbor = new BgpIpNeighbor("10.0.0.1"); BgpVrf bgpVrf = new BgpVrf("bgpVrf"); { SetNextHop setNextHop = getSetNextHop(bgpNeighbor, bgpVrf); assertNull(setNextHop); } { bgpNeighbor.setRemoteAs(10000L); bgpVrf.setAutonomousSystem(20000L); SetNextHop setNextHop = getSetNextHop(bgpNeighbor, bgpVrf); assertNull(setNextHop); } { bgpNeighbor.setRemoteAs(10000L); bgpVrf.setAutonomousSystem(10000L); SetNextHop setNextHop = getSetNextHop(bgpNeighbor, bgpVrf); assertNull(setNextHop); } { bgpNeighbor.setRemoteAs(10000L); bgpVrf.setAutonomousSystem(10000L); bgpVrf.setIpv4Unicast(new BgpIpv4UnicastAddressFamily()); SetNextHop setNextHop = getSetNextHop(bgpNeighbor, bgpVrf); assertNull(setNextHop); } { bgpNeighbor.setRemoteAs(10000L); bgpVrf.setAutonomousSystem(10000L); bgpNeighbor.setIpv4UnicastAddressFamily(new BgpNeighborIpv4UnicastAddressFamily()); assertNull(getSetNextHop(bgpNeighbor, bgpVrf)); } { bgpNeighbor.setRemoteAs(10000L); bgpVrf.setAutonomousSystem(10000L); BgpNeighborIpv4UnicastAddressFamily ipv4af = new BgpNeighborIpv4UnicastAddressFamily(); bgpNeighbor.setIpv4UnicastAddressFamily(ipv4af); ipv4af.setNextHopSelf(true); assertNull(getSetNextHop(bgpNeighbor, bgpVrf)); } }
private static List<Statement> getAcceptStatements(BgpNeighbor neighbor, BgpVrf bgpVrf) { ImmutableList.Builder<Statement> acceptStatements = ImmutableList.builder(); SetNextHop setNextHop = getSetNextHop(neighbor, bgpVrf); SetMetric setMaxMedMetric = getSetMaxMedMetric(bgpVrf); if (setNextHop != null) { acceptStatements.add(setNextHop); } if (setMaxMedMetric != null) { acceptStatements.add(setMaxMedMetric); } acceptStatements.add(Statements.ExitAccept.toStaticStatement()); return acceptStatements.build(); }
CumulusConversions { private static List<Statement> getAcceptStatements(BgpNeighbor neighbor, BgpVrf bgpVrf) { ImmutableList.Builder<Statement> acceptStatements = ImmutableList.builder(); SetNextHop setNextHop = getSetNextHop(neighbor, bgpVrf); SetMetric setMaxMedMetric = getSetMaxMedMetric(bgpVrf); if (setNextHop != null) { acceptStatements.add(setNextHop); } if (setMaxMedMetric != null) { acceptStatements.add(setMaxMedMetric); } acceptStatements.add(Statements.ExitAccept.toStaticStatement()); return acceptStatements.build(); } }
CumulusConversions { private static List<Statement> getAcceptStatements(BgpNeighbor neighbor, BgpVrf bgpVrf) { ImmutableList.Builder<Statement> acceptStatements = ImmutableList.builder(); SetNextHop setNextHop = getSetNextHop(neighbor, bgpVrf); SetMetric setMaxMedMetric = getSetMaxMedMetric(bgpVrf); if (setNextHop != null) { acceptStatements.add(setNextHop); } if (setMaxMedMetric != null) { acceptStatements.add(setMaxMedMetric); } acceptStatements.add(Statements.ExitAccept.toStaticStatement()); return acceptStatements.build(); }  }
CumulusConversions { private static List<Statement> getAcceptStatements(BgpNeighbor neighbor, BgpVrf bgpVrf) { ImmutableList.Builder<Statement> acceptStatements = ImmutableList.builder(); SetNextHop setNextHop = getSetNextHop(neighbor, bgpVrf); SetMetric setMaxMedMetric = getSetMaxMedMetric(bgpVrf); if (setNextHop != null) { acceptStatements.add(setNextHop); } if (setMaxMedMetric != null) { acceptStatements.add(setMaxMedMetric); } acceptStatements.add(Statements.ExitAccept.toStaticStatement()); return acceptStatements.build(); }  static @Nonnull String computeBgpCommonExportPolicyName(String vrfName); @VisibleForTesting static @Nonnull String computeBgpPeerExportPolicyName(
      String vrfName, String peerInterface); static @Nonnull String computeBgpPeerImportPolicyName(String vrf, String peer); static String computeBgpGenerationPolicyName(boolean ipv4, String vrfName, String prefix); static String computeMatchSuppressedSummaryOnlyPolicyName(String vrfName); static String computeOspfExportPolicyName(String vrfName); }
CumulusConversions { private static List<Statement> getAcceptStatements(BgpNeighbor neighbor, BgpVrf bgpVrf) { ImmutableList.Builder<Statement> acceptStatements = ImmutableList.builder(); SetNextHop setNextHop = getSetNextHop(neighbor, bgpVrf); SetMetric setMaxMedMetric = getSetMaxMedMetric(bgpVrf); if (setNextHop != null) { acceptStatements.add(setNextHop); } if (setMaxMedMetric != null) { acceptStatements.add(setMaxMedMetric); } acceptStatements.add(Statements.ExitAccept.toStaticStatement()); return acceptStatements.build(); }  static @Nonnull String computeBgpCommonExportPolicyName(String vrfName); @VisibleForTesting static @Nonnull String computeBgpPeerExportPolicyName(
      String vrfName, String peerInterface); static @Nonnull String computeBgpPeerImportPolicyName(String vrf, String peer); static String computeBgpGenerationPolicyName(boolean ipv4, String vrfName, String prefix); static String computeMatchSuppressedSummaryOnlyPolicyName(String vrfName); static String computeOspfExportPolicyName(String vrfName); static final int DEFAULT_STATIC_ROUTE_ADMINISTRATIVE_DISTANCE; static final int DEFAULT_STATIC_ROUTE_METRIC; static final Ip CLAG_LINK_LOCAL_IP; static final long DEFAULT_MAX_MED; static final double SPEED_CONVERSION_FACTOR; static final double DEFAULT_LOOPBACK_BANDWIDTH; static final double DEFAULT_PORT_BANDWIDTH; }