/** Return an OSPF builder. Pre-defines required fields (e.g., reference bandwidth) */ public OspfProcess.Builder ospfProcessBuilder() { return OspfProcess.builder(this).setReferenceBandwidth(1e8); }
private OspfProcess createOspfProcess(RoutingInstance routingInstance) { OspfProcess newProc = OspfProcess.builder() .setReferenceBandwidth(routingInstance.getOspfReferenceBandwidth()) .build();
private org.batfish.datamodel.ospf.OspfProcess toOspfProcess( OspfProcess proc, String vrfName, Configuration c, CiscoConfiguration oldConfig) { org.batfish.datamodel.ospf.OspfProcess newProcess = org.batfish.datamodel.ospf.OspfProcess.builder() .setReferenceBandwidth(proc.getReferenceBandwidth()) .build();
if (ospf != null) { OspfProcess abstractOspf = OspfProcess.builder().setReferenceBandwidth(ospf.getReferenceBandwidth()).build(); abstractOspf.setAreas(ospf.getAreas()); abstractOspf.setExportPolicy(ospf.getExportPolicy());
@Test public void testGetOspfEdges() { OspfProcess ospf1 = OspfProcess.builder().setReferenceBandwidth(1e8).build(); OspfProcess ospf2 = OspfProcess.builder().setReferenceBandwidth(1e8).build(); NetworkFactory nf = new NetworkFactory(); OspfArea.builder(nf).setNumber(1L).setOspfProcess(ospf1).addInterface("int1").build(); OspfArea.builder(nf).setNumber(1L).setOspfProcess(ospf2).addInterface("int2").build(); Vrf vrf1 = new Vrf("vrf1"); vrf1.setOspfProcess(ospf1); Vrf vrf2 = new Vrf("vrf2"); vrf2.setOspfProcess(ospf2); _host1.setVrfs(ImmutableSortedMap.of("vrf1", vrf1)); _host2.setVrfs(ImmutableSortedMap.of("vrf2", vrf2)); _host1.getAllInterfaces().get("int1").setVrf(vrf1); _host2.getAllInterfaces().get("int2").setVrf(vrf2); Multiset<Row> rows = getOspfEdges(_configurations, _includeNodes, _includeRemoteNodes, _topology); assertThat( rows, contains( allOf( hasColumn( COL_INTERFACE, equalTo(new NodeInterfacePair("host1", "int1")), Schema.INTERFACE), hasColumn( COL_REMOTE_INTERFACE, equalTo(new NodeInterfacePair("host2", "int2")), Schema.INTERFACE)))); }
@Test public void getProperties() { OspfProcess ospf1 = OspfProcess.builder().setReferenceBandwidth(1e8).build(); ospf1.setExportPolicy("my-policy"); ospf1.setReferenceBandwidth(42.0);