.setBandwidth(iface.getBandwidth()) .setMode(eigrpProcess.getMode()) .setDefaultBandwidth( Interface.getDefaultBandwidth(iface.getName(), c.getConfigurationFormat())) .setDefaultDelay( Interface.getDefaultDelay(iface.getName(), c.getConfigurationFormat())) .setDelay(iface.getDelay()) .build();
private EigrpMetric toEigrpMetric( ParserRuleContext ctx, Token ctxBw, Token ctxDelay, Token ctxReliability, Token ctxEffBw, Token ctxMtu) { if (_currentEigrpProcess == null) { return null; } EigrpMetric.Builder builder = EigrpMetric.builder(); double bandwidth = toLong(ctxBw) * 1000.0D; builder.setBandwidth(bandwidth); double delay = toLong(ctxDelay) * 1E7; builder.setDelay(delay); int reliability = toInteger(ctxReliability); if (reliability != 0) { todo(ctx); } int effBw = toInteger(ctxEffBw); if (effBw != 0) { todo(ctx); } int mtu = toInteger(ctxMtu); if (mtu != 0) { todo(ctx); } builder.setMode(_currentEigrpProcess.getMode()); return builder.build(); }
@Test public void testEigrpExternalRouteClone() throws IOException { EigrpExternalRoute route = EigrpExternalRoute.builder() .setNetwork(Prefix.parse("1.1.1.1/32")) .setEigrpMetric( EigrpMetric.builder() .setBandwidth(1000.0) .setDelay(2.0) .setMode(EigrpProcessMode.NAMED) .build()) .setProcessAsn(1L) .setDestinationAsn(2L) .build(); assertThat(BatfishObjectMapper.clone(route, EigrpExternalRoute.class), equalTo(route)); } }
@Test public void testEigrpInternalRouteClone() throws IOException { EigrpInternalRoute route = EigrpInternalRoute.builder() .setNetwork(Prefix.parse("1.1.1.1/32")) .setEigrpMetric( EigrpMetric.builder() .setBandwidth(1000.0) .setDelay(2.0) .setMode(EigrpProcessMode.NAMED) .build()) .setProcessAsn(1L) .build(); assertThat(BatfishObjectMapper.clone(route, EigrpInternalRoute.class), equalTo(route)); }
public static Builder builder() { return new Builder(); }