@Test public void testNoLastHopOutgoingInterface() { BDD inBdd = _fwSrcMgr .getSourceInterfaceBDD(FWI1) .and(_lastHopMgr.getNoLastHopOutgoingInterfaceBdd(FW, FWI1)); Prefix routePrefix = Prefix.parse("1.0.0.0/8"); BDD fwdRouteBdd = dstBdd(routePrefix); BDD outBdd = inBdd.and(fwdRouteBdd); BDD sessionFlows = srcBdd(routePrefix); Map<StateExpr, BDD> forwardReachableSets = ImmutableMap.of( new OriginateVrf(FW, Configuration.DEFAULT_VRF_NAME), inBdd, new PreOutEdgePostNat(FW, FWI3, BORDER, BORDER_IFACE), outBdd); Map<String, List<BDDFirewallSessionTraceInfo>> sessions = computeInitializedSessions(forwardReachableSets, TRIVIAL_REVERSE_TRANSFORMATION_RANGES); assertThat(sessions.keySet(), contains(FW)); List<BDDFirewallSessionTraceInfo> fwSessions = sessions.get(FW); assertThat(fwSessions, hasSize(1)); BDDFirewallSessionTraceInfo fwSession = fwSessions.get(0); assertThat(fwSession, hasHostname(FW)); assertThat(fwSession, hasIncomingInterfaces(contains(FWI3))); assertThat(fwSession, hasAction(new ForwardOutInterface(FWI1, null))); assertThat(fwSession, hasSessionFlows(sessionFlows)); assertThat(fwSession, hasTransformation(_fwI3ToI1ReverseTransformation)); }
private Map<String, List<BDDFirewallSessionTraceInfo>> computeInitializedSessions() { return _configs.values().stream() .flatMap( config -> { List<BDDFirewallSessionTraceInfo> sessions = computeInitializedSessions(config); return sessions.isEmpty() ? Stream.of() : Stream.of(Maps.immutableEntry(config.getHostname(), sessions)); }) .collect(ImmutableMap.toImmutableMap(Entry::getKey, Entry::getValue)); }
BDDReachabilityAnalysisSessionFactory { private Map<String, List<BDDFirewallSessionTraceInfo>> computeInitializedSessions() { return _configs.values().stream() .flatMap( config -> { List<BDDFirewallSessionTraceInfo> sessions = computeInitializedSessions(config); return sessions.isEmpty() ? Stream.of() : Stream.of(Maps.immutableEntry(config.getHostname(), sessions)); }) .collect(ImmutableMap.toImmutableMap(Entry::getKey, Entry::getValue)); } }
BDDReachabilityAnalysisSessionFactory { private Map<String, List<BDDFirewallSessionTraceInfo>> computeInitializedSessions() { return _configs.values().stream() .flatMap( config -> { List<BDDFirewallSessionTraceInfo> sessions = computeInitializedSessions(config); return sessions.isEmpty() ? Stream.of() : Stream.of(Maps.immutableEntry(config.getHostname(), sessions)); }) .collect(ImmutableMap.toImmutableMap(Entry::getKey, Entry::getValue)); } BDDReachabilityAnalysisSessionFactory(
      BDDPacket bddPacket,
      Map<String, Configuration> configs,
      Map<String, BDDSourceManager> srcManagers,
      LastHopOutgoingInterfaceManager lastHopManager,
      Map<StateExpr, BDD> forwardReachableBdds,
      BDDReverseFlowTransformationFactory transformationFactory,
      BDDReverseTransformationRanges reverseTransformationRanges); }
BDDReachabilityAnalysisSessionFactory { private Map<String, List<BDDFirewallSessionTraceInfo>> computeInitializedSessions() { return _configs.values().stream() .flatMap( config -> { List<BDDFirewallSessionTraceInfo> sessions = computeInitializedSessions(config); return sessions.isEmpty() ? Stream.of() : Stream.of(Maps.immutableEntry(config.getHostname(), sessions)); }) .collect(ImmutableMap.toImmutableMap(Entry::getKey, Entry::getValue)); } BDDReachabilityAnalysisSessionFactory(
      BDDPacket bddPacket,
      Map<String, Configuration> configs,
      Map<String, BDDSourceManager> srcManagers,
      LastHopOutgoingInterfaceManager lastHopManager,
      Map<StateExpr, BDD> forwardReachableBdds,
      BDDReverseFlowTransformationFactory transformationFactory,
      BDDReverseTransformationRanges reverseTransformationRanges);  }
BDDReachabilityAnalysisSessionFactory { private Map<String, List<BDDFirewallSessionTraceInfo>> computeInitializedSessions() { return _configs.values().stream() .flatMap( config -> { List<BDDFirewallSessionTraceInfo> sessions = computeInitializedSessions(config); return sessions.isEmpty() ? Stream.of() : Stream.of(Maps.immutableEntry(config.getHostname(), sessions)); }) .collect(ImmutableMap.toImmutableMap(Entry::getKey, Entry::getValue)); } BDDReachabilityAnalysisSessionFactory(
      BDDPacket bddPacket,
      Map<String, Configuration> configs,
      Map<String, BDDSourceManager> srcManagers,
      LastHopOutgoingInterfaceManager lastHopManager,
      Map<StateExpr, BDD> forwardReachableBdds,
      BDDReverseFlowTransformationFactory transformationFactory,
      BDDReverseTransformationRanges reverseTransformationRanges);   }