if (iface != null) { map.put(interfaceName, iface); iface.setVrf(vrf);
if (iface.getVrf() == null) { orphanedInterfaces.put(iface.getName(), iface); iface.setVrf(nullVrf); iface.setActive(false); _w.redFlag(
newIface.setVrf(_c.getVrfs().get(iface.getRoutingInstance())); newIface.setAdditionalArpIps(iface.getAdditionalArpIps()); Zone zone = _masterLogicalSystem.getInterfaceZones().get(iface.getName());
/** * Convert a non-unit interface to the VI {@link org.batfish.datamodel.Interface}. * * <p>Note that bulk of the configuration is stored at the logical interface level, see {@link * #toInterface(Interface)} for those conversions. Here we convert aggregation and bandwidth * settings; track VRF membership. */ private org.batfish.datamodel.Interface toInterfaceNonUnit(Interface iface) { String name = iface.getName(); org.batfish.datamodel.Interface newIface = new org.batfish.datamodel.Interface(name, _c); newIface.setDeclaredNames(ImmutableSortedSet.of(name)); newIface.setDescription(iface.getDescription()); // 802.3ad link aggregation if (iface.get8023adInterface() != null) { newIface.setChannelGroup(iface.get8023adInterface()); } // Redundant ethernet if (iface.getRedundantParentInterface() != null) { newIface.setChannelGroup(iface.getRedundantParentInterface()); } newIface.setBandwidth(iface.getBandwidth()); newIface.setVrf(_c.getVrfs().get(iface.getRoutingInstance())); return newIface; }
iface.setInterfaceType(_type); iface.setVrf(_vrf); if (_vrf != null) { _vrf.getInterfaces().put(name, iface);
@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)))); }
newIface.setHsrpVersion(iface.getHsrpVersion()); newIface.setAutoState(iface.getAutoState()); newIface.setVrf(c.getVrfs().get(vrfName)); if (iface.getBandwidth() == null) { newIface.setBandwidth(