@Test public void testComputeDeliveredToSubnetNoInterfaceHostIps() { String c1 = "c1"; String vrf1 = "vrf1"; String i1 = "i1"; Ip ip = Ip.parse("10.0.0.1"); Map<String, Map<String, Map<String, IpSpace>>> arpFalseDestIp = ImmutableMap.of(c1, ImmutableMap.of(vrf1, ImmutableMap.of(i1, ip.toIpSpace()))); Map<String, Map<String, IpSpace>> interfaceHostSubnetIps = ImmutableMap.of(c1, ImmutableMap.of(i1, EmptyIpSpace.INSTANCE)); IpSpace ownedIps = EmptyIpSpace.INSTANCE; Map<String, Map<String, Map<String, IpSpace>>> result = computeDeliveredToSubnet(arpFalseDestIp, interfaceHostSubnetIps, ownedIps); assertThat( result, hasEntry(equalTo(c1), hasEntry(equalTo(vrf1), hasEntry(equalTo(i1), not(containsIp(ip)))))); }
@VisibleForTesting static Map<String, Map<String, Map<String, IpSpace>>> computeDeliveredToSubnet( Map<String, Map<String, Map<String, IpSpace>>> arpFalseDestIp, Map<String, Map<String, IpSpace>> interfaceExternalArpIps, IpSpace ownedIps) { Span span = GlobalTracer.get().buildSpan("ForwardingAnalysisImpl.computeDeliveredToSubnet").start(); try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) { assert scope != null; return toImmutableMap( arpFalseDestIp, Entry::getKey, nodeEntry -> toImmutableMap( nodeEntry.getValue(), Entry::getKey, vrfEntry -> toImmutableMap( vrfEntry.getValue(), Entry::getKey, ifaceEntry -> AclIpSpace.difference( AclIpSpace.intersection( ifaceEntry.getValue(), interfaceExternalArpIps .get(nodeEntry.getKey()) .get(ifaceEntry.getKey())), ownedIps)))); } finally { span.finish(); } }
ForwardingAnalysisImpl implements ForwardingAnalysis, Serializable { @VisibleForTesting static Map<String, Map<String, Map<String, IpSpace>>> computeDeliveredToSubnet( Map<String, Map<String, Map<String, IpSpace>>> arpFalseDestIp, Map<String, Map<String, IpSpace>> interfaceExternalArpIps, IpSpace ownedIps) { Span span = GlobalTracer.get().buildSpan("ForwardingAnalysisImpl.computeDeliveredToSubnet").start(); try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) { assert scope != null; return toImmutableMap( arpFalseDestIp, Entry::getKey, nodeEntry -> toImmutableMap( nodeEntry.getValue(), Entry::getKey, vrfEntry -> toImmutableMap( vrfEntry.getValue(), Entry::getKey, ifaceEntry -> AclIpSpace.difference( AclIpSpace.intersection( ifaceEntry.getValue(), interfaceExternalArpIps .get(nodeEntry.getKey()) .get(ifaceEntry.getKey())), ownedIps)))); } finally { span.finish(); } } }
ForwardingAnalysisImpl implements ForwardingAnalysis, Serializable { @VisibleForTesting static Map<String, Map<String, Map<String, IpSpace>>> computeDeliveredToSubnet( Map<String, Map<String, Map<String, IpSpace>>> arpFalseDestIp, Map<String, Map<String, IpSpace>> interfaceExternalArpIps, IpSpace ownedIps) { Span span = GlobalTracer.get().buildSpan("ForwardingAnalysisImpl.computeDeliveredToSubnet").start(); try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) { assert scope != null; return toImmutableMap( arpFalseDestIp, Entry::getKey, nodeEntry -> toImmutableMap( nodeEntry.getValue(), Entry::getKey, vrfEntry -> toImmutableMap( vrfEntry.getValue(), Entry::getKey, ifaceEntry -> AclIpSpace.difference( AclIpSpace.intersection( ifaceEntry.getValue(), interfaceExternalArpIps .get(nodeEntry.getKey()) .get(ifaceEntry.getKey())), ownedIps)))); } finally { span.finish(); } } ForwardingAnalysisImpl(
      Map<String, Configuration> configurations,
      Map<String, Map<String, Fib>> fibs,
      Topology topology,
      Map<Location, LocationInfo> locationInfo); }
ForwardingAnalysisImpl implements ForwardingAnalysis, Serializable { @VisibleForTesting static Map<String, Map<String, Map<String, IpSpace>>> computeDeliveredToSubnet( Map<String, Map<String, Map<String, IpSpace>>> arpFalseDestIp, Map<String, Map<String, IpSpace>> interfaceExternalArpIps, IpSpace ownedIps) { Span span = GlobalTracer.get().buildSpan("ForwardingAnalysisImpl.computeDeliveredToSubnet").start(); try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) { assert scope != null; return toImmutableMap( arpFalseDestIp, Entry::getKey, nodeEntry -> toImmutableMap( nodeEntry.getValue(), Entry::getKey, vrfEntry -> toImmutableMap( vrfEntry.getValue(), Entry::getKey, ifaceEntry -> AclIpSpace.difference( AclIpSpace.intersection( ifaceEntry.getValue(), interfaceExternalArpIps .get(nodeEntry.getKey()) .get(ifaceEntry.getKey())), ownedIps)))); } finally { span.finish(); } } ForwardingAnalysisImpl(
      Map<String, Configuration> configurations,
      Map<String, Map<String, Fib>> fibs,
      Topology topology,
      Map<Location, LocationInfo> locationInfo); @Nonnull @Override Map<String, Map<String, Map<String, IpSpace>>> getAcceptsIps(); @Override Map<String, Map<String, IpSpace>> getArpReplies(); @Override Map<String, Map<String, Map<Edge, IpSpace>>> getArpTrueEdge(); @Override Map<String, Map<String, Map<String, IpSpace>>> getNextVrfIps(); @Override Map<String, Map<String, IpSpace>> getNullRoutedIps(); @Override Map<String, Map<String, IpSpace>> getRoutableIps(); @Override Map<String, Map<String, Map<String, IpSpace>>> getDeliveredToSubnet(); @Override Map<String, Map<String, Map<String, IpSpace>>> getExitsNetwork(); @Override Map<String, Map<String, Map<String, IpSpace>>> getNeighborUnreachable(); @Override Map<String, Map<String, Map<String, IpSpace>>> getInsufficientInfo(); }
ForwardingAnalysisImpl implements ForwardingAnalysis, Serializable { @VisibleForTesting static Map<String, Map<String, Map<String, IpSpace>>> computeDeliveredToSubnet( Map<String, Map<String, Map<String, IpSpace>>> arpFalseDestIp, Map<String, Map<String, IpSpace>> interfaceExternalArpIps, IpSpace ownedIps) { Span span = GlobalTracer.get().buildSpan("ForwardingAnalysisImpl.computeDeliveredToSubnet").start(); try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) { assert scope != null; return toImmutableMap( arpFalseDestIp, Entry::getKey, nodeEntry -> toImmutableMap( nodeEntry.getValue(), Entry::getKey, vrfEntry -> toImmutableMap( vrfEntry.getValue(), Entry::getKey, ifaceEntry -> AclIpSpace.difference( AclIpSpace.intersection( ifaceEntry.getValue(), interfaceExternalArpIps .get(nodeEntry.getKey()) .get(ifaceEntry.getKey())), ownedIps)))); } finally { span.finish(); } } ForwardingAnalysisImpl(
      Map<String, Configuration> configurations,
      Map<String, Map<String, Fib>> fibs,
      Topology topology,
      Map<Location, LocationInfo> locationInfo); @Nonnull @Override Map<String, Map<String, Map<String, IpSpace>>> getAcceptsIps(); @Override Map<String, Map<String, IpSpace>> getArpReplies(); @Override Map<String, Map<String, Map<Edge, IpSpace>>> getArpTrueEdge(); @Override Map<String, Map<String, Map<String, IpSpace>>> getNextVrfIps(); @Override Map<String, Map<String, IpSpace>> getNullRoutedIps(); @Override Map<String, Map<String, IpSpace>> getRoutableIps(); @Override Map<String, Map<String, Map<String, IpSpace>>> getDeliveredToSubnet(); @Override Map<String, Map<String, Map<String, IpSpace>>> getExitsNetwork(); @Override Map<String, Map<String, Map<String, IpSpace>>> getNeighborUnreachable(); @Override Map<String, Map<String, Map<String, IpSpace>>> getInsufficientInfo();  }