@Test public void testInactiveInterface() throws IOException { Ip ip = Ip.parse("1.2.3.4"); BDD ipBDD = new IpSpaceToBDD(PKT.getDstIp()).toBDD(ip); NetworkFactory nf = new NetworkFactory(); Configuration config = nf.configurationBuilder().setConfigurationFormat(ConfigurationFormat.CISCO_IOS).build(); Vrf vrf = nf.vrfBuilder().setOwner(config).build(); Interface iface = nf.interfaceBuilder() .setOwner(config) .setVrf(vrf) .setAddress(ConcreteInterfaceAddress.create(ip, 32)) .setActive(true) .build(); ImmutableSortedMap<String, Configuration> configs = ImmutableSortedMap.of(config.getHostname(), config); { BDDReachabilityAnalysisFactory factory = makeBddReachabilityAnalysisFactory(configs); Map<String, Map<String, Map<String, BDD>>> expectedAcceptBdds = ImmutableMap.of( config.getHostname(), ImmutableMap.of(vrf.getName(), ImmutableMap.of(iface.getName(), ipBDD))); assertThat(factory.getIfaceAcceptBDDs(), equalTo(expectedAcceptBdds)); } { iface.setActive(false); BDDReachabilityAnalysisFactory factory = makeBddReachabilityAnalysisFactory(configs); Map<String, Map<String, Map<String, BDD>>> expectedAcceptBdds = ImmutableMap.of( config.getHostname(), ImmutableMap.of( vrf.getName(), ImmutableMap.of(iface.getName(), PKT.getFactory().zero()))); assertThat(factory.getIfaceAcceptBDDs(), equalTo(expectedAcceptBdds)); } { iface.blacklist(); BDDReachabilityAnalysisFactory factory = makeBddReachabilityAnalysisFactory(configs); Map<String, Map<String, Map<String, BDD>>> expectedAcceptBdds = ImmutableMap.of( config.getHostname(), ImmutableMap.of( vrf.getName(), ImmutableMap.of(iface.getName(), PKT.getFactory().zero()))); assertThat(factory.getIfaceAcceptBDDs(), equalTo(expectedAcceptBdds)); } }
Map<String, Map<String, Map<String, BDD>>> getIfaceAcceptBDDs() { return _ifaceAcceptBDDs; }
BDDReachabilityAnalysisFactory { Map<String, Map<String, Map<String, BDD>>> getIfaceAcceptBDDs() { return _ifaceAcceptBDDs; } }
BDDReachabilityAnalysisFactory { Map<String, Map<String, Map<String, BDD>>> getIfaceAcceptBDDs() { return _ifaceAcceptBDDs; } BDDReachabilityAnalysisFactory(
      BDDPacket packet,
      Map<String, Configuration> configs,
      ForwardingAnalysis forwardingAnalysis,
      IpsRoutedOutInterfacesFactory ipsRoutedOutInterfacesFactory,
      boolean ignoreFilters,
      boolean initializeSessions); }
BDDReachabilityAnalysisFactory { Map<String, Map<String, Map<String, BDD>>> getIfaceAcceptBDDs() { return _ifaceAcceptBDDs; } 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 { Map<String, Map<String, Map<String, BDD>>> getIfaceAcceptBDDs() { return _ifaceAcceptBDDs; } 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();  }