@Test public void testPBRCrossVrfLookupExitsEdge() throws IOException { ImmutableSortedMap<String, Configuration> configs = makePBRNetwork(true); BDDReachabilityAnalysisFactory factory = makeBddReachabilityAnalysisFactory(configs); String hostname = "c1"; String neighborHostname = "c2"; String neighborIface = "i1"; Ip dstIp = Ip.parse("8.8.8.8"); BDDReachabilityAnalysis analysis = factory.bddReachabilityAnalysis( IpSpaceAssignment.builder() .assign( new InterfaceLinkLocation(hostname, INGRESS_IFACE), UniverseIpSpace.INSTANCE) .build(), matchDst(dstIp), ImmutableSet.of(), ImmutableSet.of(), ImmutableSet.of(neighborHostname), ImmutableSet.of(ACCEPTED)); PbrFibLookup pbrFibLookup = new PbrFibLookup(hostname, "vrf1", "vrf2"); PreOutVrf preOutVrf2 = new PreOutVrf(hostname, "vrf2"); NodeDropNoRoute nodeDropNoRoute = new NodeDropNoRoute(hostname); IpSpaceToBDD ipSpaceToBDD = new IpSpaceToBDD(PKT.getDstIp()); BDD routableFromLookupVrf = ipSpaceToBDD.toBDD(Prefix.parse("8.8.8.0/24")); BDD acceptedInIngressVrf = ipSpaceToBDD.toBDD(Ip.parse("1.1.1.0")).or(ipSpaceToBDD.toBDD(Ip.parse("2.2.2.0"))); assertThat( analysis.getForwardEdgeMap(), hasEntry( equalTo(new PreInInterface(hostname, INGRESS_IFACE)), hasKey(equalTo(pbrFibLookup)))); assertThat( analysis.getForwardEdgeMap(), hasEntry( equalTo(pbrFibLookup), hasEntry(equalTo(preOutVrf2), mapsForward(ONE, routableFromLookupVrf)))); assertThat( analysis.getForwardEdgeMap(), hasEntry( equalTo(pbrFibLookup), hasEntry( equalTo(nodeDropNoRoute), mapsForward(ONE, routableFromLookupVrf.nor(acceptedInIngressVrf))))); assertThat( analysis.getForwardEdgeMap(), hasEntry( equalTo(preOutVrf2), hasKey(equalTo(new PreOutEdge(hostname, "i1", neighborHostname, neighborIface))))); }
public BDDReachabilityAnalysis bddReachabilityAnalysis(IpSpaceAssignment srcIpSpaceAssignment) { return bddReachabilityAnalysis(srcIpSpaceAssignment, false); }
BDDReachabilityAnalysisFactory { public BDDReachabilityAnalysis bddReachabilityAnalysis(IpSpaceAssignment srcIpSpaceAssignment) { return bddReachabilityAnalysis(srcIpSpaceAssignment, false); } }
BDDReachabilityAnalysisFactory { public BDDReachabilityAnalysis bddReachabilityAnalysis(IpSpaceAssignment srcIpSpaceAssignment) { return bddReachabilityAnalysis(srcIpSpaceAssignment, false); } BDDReachabilityAnalysisFactory(
      BDDPacket packet,
      Map<String, Configuration> configs,
      ForwardingAnalysis forwardingAnalysis,
      IpsRoutedOutInterfacesFactory ipsRoutedOutInterfacesFactory,
      boolean ignoreFilters,
      boolean initializeSessions); }
BDDReachabilityAnalysisFactory { public BDDReachabilityAnalysis bddReachabilityAnalysis(IpSpaceAssignment srcIpSpaceAssignment) { return bddReachabilityAnalysis(srcIpSpaceAssignment, false); } BDDReachabilityAnalysisFactory(
      BDDPacket packet,
      Map<String, Configuration> configs,
      ForwardingAnalysis forwardingAnalysis,
      IpsRoutedOutInterfacesFactory ipsRoutedOutInterfacesFactory,
      boolean ignoreFilters,
      boolean initializeSessions); BDDReachabilityAnalysis bddReachabilityAnalysis(IpSpaceAssignment srcIpSpaceAssignment); BDDReachabilityAnalysis bddReachabilityAnalysis(
      IpSpaceAssignment srcIpSpaceAssignment, boolean useInterfaceRoots); BDDLoopDetectionAnalysis bddLoopDetectionAnalysis(IpSpaceAssignment srcIpSpaceAssignment); Map<IngressLocation, BDD> getAllBDDs(
      IpSpaceAssignment srcIpSpaceAssignment,
      AclLineMatchExpr initialHeaderSpace,
      Set<String> forbiddenTransitNodes,
      Set<String> requiredTransitNodes,
      Set<String> finalNodes,
      Set<FlowDisposition> actions); @VisibleForTesting BDDReachabilityAnalysis bddReachabilityAnalysis(
      IpSpaceAssignment srcIpSpaceAssignment,
      AclLineMatchExpr initialHeaderSpace,
      Set<String> forbiddenTransitNodes,
      Set<String> requiredTransitNodes,
      Set<String> finalNodes,
      Set<FlowDisposition> actions); @VisibleForTesting BDDReachabilityAnalysis bddReachabilityAnalysis(
      IpSpaceAssignment srcIpSpaceAssignment,
      AclLineMatchExpr initialHeaderSpace,
      Set<String> forbiddenTransitNodes,
      Set<String> requiredTransitNodes,
      Set<String> finalNodes,
      Set<FlowDisposition> actions,
      boolean useInterfaceRoots); Map<String, BDDOutgoingOriginalFlowFilterManager> getBddOutgoingOriginalFlowFilterManagers(); Map<String, BDDSourceManager> getBDDSourceManagers(); @Nullable LastHopOutgoingInterfaceManager getLastHopManager(); }
BDDReachabilityAnalysisFactory { public BDDReachabilityAnalysis bddReachabilityAnalysis(IpSpaceAssignment srcIpSpaceAssignment) { return bddReachabilityAnalysis(srcIpSpaceAssignment, false); } BDDReachabilityAnalysisFactory(
      BDDPacket packet,
      Map<String, Configuration> configs,
      ForwardingAnalysis forwardingAnalysis,
      IpsRoutedOutInterfacesFactory ipsRoutedOutInterfacesFactory,
      boolean ignoreFilters,
      boolean initializeSessions); BDDReachabilityAnalysis bddReachabilityAnalysis(IpSpaceAssignment srcIpSpaceAssignment); BDDReachabilityAnalysis bddReachabilityAnalysis(
      IpSpaceAssignment srcIpSpaceAssignment, boolean useInterfaceRoots); BDDLoopDetectionAnalysis bddLoopDetectionAnalysis(IpSpaceAssignment srcIpSpaceAssignment); Map<IngressLocation, BDD> getAllBDDs(
      IpSpaceAssignment srcIpSpaceAssignment,
      AclLineMatchExpr initialHeaderSpace,
      Set<String> forbiddenTransitNodes,
      Set<String> requiredTransitNodes,
      Set<String> finalNodes,
      Set<FlowDisposition> actions); @VisibleForTesting BDDReachabilityAnalysis bddReachabilityAnalysis(
      IpSpaceAssignment srcIpSpaceAssignment,
      AclLineMatchExpr initialHeaderSpace,
      Set<String> forbiddenTransitNodes,
      Set<String> requiredTransitNodes,
      Set<String> finalNodes,
      Set<FlowDisposition> actions); @VisibleForTesting BDDReachabilityAnalysis bddReachabilityAnalysis(
      IpSpaceAssignment srcIpSpaceAssignment,
      AclLineMatchExpr initialHeaderSpace,
      Set<String> forbiddenTransitNodes,
      Set<String> requiredTransitNodes,
      Set<String> finalNodes,
      Set<FlowDisposition> actions,
      boolean useInterfaceRoots); Map<String, BDDOutgoingOriginalFlowFilterManager> getBddOutgoingOriginalFlowFilterManagers(); Map<String, BDDSourceManager> getBDDSourceManagers(); @Nullable LastHopOutgoingInterfaceManager getLastHopManager();  }