@Test public void testComputeLocationInfo_inactive() { NetworkFactory nf = new NetworkFactory(); Configuration config = nf.configurationBuilder() .setConfigurationFormat(ConfigurationFormat.CISCO_IOS) .setHostname("a") .build(); Vrf vrf = nf.vrfBuilder().setOwner(config).build(); Interface.Builder ib = nf.interfaceBuilder().setOwner(config).setActive(true).setVrf(vrf); Interface i3 = ib.setName("i3").setActive(false).build(); InterfaceLocation iface3 = interfaceLocation(i3); InterfaceLinkLocation link3 = interfaceLinkLocation(i3); Ip ip1 = Ip.parse("1.1.1.1"); Ip ip2 = Ip.parse("1.1.1.2"); IpSpace ips12 = checkNotNull(AclIpSpace.union(ip1.toIpSpace(), ip2.toIpSpace())); { LocationInfo info = new LocationInfo(true, ips12, ips12); config.setLocationInfo(ImmutableMap.of(iface3, info, link3, info)); } Map<Location, LocationInfo> locationInfo = computeLocationInfo( ip1.toIpSpace(), ImmutableMap.of(), ImmutableMap.of(config.getHostname(), config)); { LocationInfo info = locationInfo.get(iface3); assertFalse(info.isSource()); } { LocationInfo info = locationInfo.get(link3); assertFalse(info.isSource()); } }
public static Map<Location, LocationInfo> computeLocationInfo( Map<String, Configuration> configs) { return computeLocationInfo(new IpOwners(configs), configs); }
LocationInfoUtils { public static Map<Location, LocationInfo> computeLocationInfo( Map<String, Configuration> configs) { return computeLocationInfo(new IpOwners(configs), configs); } }
LocationInfoUtils { public static Map<Location, LocationInfo> computeLocationInfo( Map<String, Configuration> configs) { return computeLocationInfo(new IpOwners(configs), configs); } private  LocationInfoUtils(); }
LocationInfoUtils { public static Map<Location, LocationInfo> computeLocationInfo( Map<String, Configuration> configs) { return computeLocationInfo(new IpOwners(configs), configs); } private  LocationInfoUtils(); @Nonnull static IpSpace connectedHostSubnetHostIps(Interface iface); @Nonnull static IpSpace connectedSubnetHostIps(Interface iface); static Map<Location, LocationInfo> computeLocationInfo(
      Map<String, Configuration> configs); static Map<Location, LocationInfo> computeLocationInfo(
      IpOwners ipOwners, Map<String, Configuration> configs); static IpSpace configuredIps(Interface iface); }
LocationInfoUtils { public static Map<Location, LocationInfo> computeLocationInfo( Map<String, Configuration> configs) { return computeLocationInfo(new IpOwners(configs), configs); } private  LocationInfoUtils(); @Nonnull static IpSpace connectedHostSubnetHostIps(Interface iface); @Nonnull static IpSpace connectedSubnetHostIps(Interface iface); static Map<Location, LocationInfo> computeLocationInfo(
      Map<String, Configuration> configs); static Map<Location, LocationInfo> computeLocationInfo(
      IpOwners ipOwners, Map<String, Configuration> configs); static IpSpace configuredIps(Interface iface);  }