@Test public void testFibLookupSessionEdges_inboundSession() { BDD sessionHeaders = PKT.getDstIp().value(10L); BDDFirewallSessionTraceInfo sessionInfo = new BDDFirewallSessionTraceInfo( FW, new OriginatingSessionScope(FW_VRF), FibLookup.INSTANCE, sessionHeaders, IDENTITY); BDD originating = _fwSrcMgr.getOriginatingFromDeviceBDD(); Matcher<Transition> expectedTransition = allOf(mapsForward(ONE, sessionHeaders.and(originating)), mapsBackward(ONE, sessionHeaders)); assertThat( fibLookupSessionEdges(sessionInfo), containsInAnyOrder( edge( new OriginateInterface(FW, FW_I1), new PostInVrfSession(FW, FW_VRF), expectedTransition), edge( new OriginateVrf(FW, FW_VRF), new PostInVrfSession(FW, FW_VRF), expectedTransition))); }
@Nonnull @VisibleForTesting Stream<Edge> fibLookupSessionEdges(BDDFirewallSessionTraceInfo sessionInfo) { return sessionInfo .getAction() .accept( new SessionActionVisitor<Stream<Edge>>() { @Override public Stream<Edge> visitAcceptVrf(Accept acceptVrf) { return Stream.of(); } @Override public Stream<Edge> visitFibLookup(FibLookup fibLookup) { return computeFibLookupSessionEdges(sessionInfo); } @Override public Stream<Edge> visitForwardOutInterface( ForwardOutInterface forwardOutInterface) { return Stream.of(); } }); }
SessionInstrumentation { @Nonnull @VisibleForTesting Stream<Edge> fibLookupSessionEdges(BDDFirewallSessionTraceInfo sessionInfo) { return sessionInfo .getAction() .accept( new SessionActionVisitor<Stream<Edge>>() { @Override public Stream<Edge> visitAcceptVrf(Accept acceptVrf) { return Stream.of(); } @Override public Stream<Edge> visitFibLookup(FibLookup fibLookup) { return computeFibLookupSessionEdges(sessionInfo); } @Override public Stream<Edge> visitForwardOutInterface( ForwardOutInterface forwardOutInterface) { return Stream.of(); } }); } }
SessionInstrumentation { @Nonnull @VisibleForTesting Stream<Edge> fibLookupSessionEdges(BDDFirewallSessionTraceInfo sessionInfo) { return sessionInfo .getAction() .accept( new SessionActionVisitor<Stream<Edge>>() { @Override public Stream<Edge> visitAcceptVrf(Accept acceptVrf) { return Stream.of(); } @Override public Stream<Edge> visitFibLookup(FibLookup fibLookup) { return computeFibLookupSessionEdges(sessionInfo); } @Override public Stream<Edge> visitForwardOutInterface( ForwardOutInterface forwardOutInterface) { return Stream.of(); } }); } @VisibleForTesting  SessionInstrumentation(
      BDDPacket bddPacket,
      Map<String, Configuration> configs,
      Map<String, BDDSourceManager> srcMgrs,
      LastHopOutgoingInterfaceManager lastHopMgr,
      Map<String, BDDOutgoingOriginalFlowFilterManager> outgoingOriginalFlowFilterMgrs,
      @Nullable Map<String, Map<String, Supplier<BDD>>> filterBdds); }
SessionInstrumentation { @Nonnull @VisibleForTesting Stream<Edge> fibLookupSessionEdges(BDDFirewallSessionTraceInfo sessionInfo) { return sessionInfo .getAction() .accept( new SessionActionVisitor<Stream<Edge>>() { @Override public Stream<Edge> visitAcceptVrf(Accept acceptVrf) { return Stream.of(); } @Override public Stream<Edge> visitFibLookup(FibLookup fibLookup) { return computeFibLookupSessionEdges(sessionInfo); } @Override public Stream<Edge> visitForwardOutInterface( ForwardOutInterface forwardOutInterface) { return Stream.of(); } }); } @VisibleForTesting  SessionInstrumentation(
      BDDPacket bddPacket,
      Map<String, Configuration> configs,
      Map<String, BDDSourceManager> srcMgrs,
      LastHopOutgoingInterfaceManager lastHopMgr,
      Map<String, BDDOutgoingOriginalFlowFilterManager> outgoingOriginalFlowFilterMgrs,
      @Nullable Map<String, Map<String, Supplier<BDD>>> filterBdds); static Stream<Edge> sessionInstrumentation(
      BDDPacket bddPacket,
      Map<String, Configuration> configs,
      Map<String, BDDSourceManager> srcMgrs,
      LastHopOutgoingInterfaceManager lastHopMgr,
      Map<String, BDDOutgoingOriginalFlowFilterManager> outgoingOriginalFlowFilterMgrs,
      Map<String, Map<String, Supplier<BDD>>> filterBdds,
      Stream<Edge> originalEdges,
      Map<String, List<BDDFirewallSessionTraceInfo>> initializedSessions,
      BDDFibGenerator bddFibGenerator); }
SessionInstrumentation { @Nonnull @VisibleForTesting Stream<Edge> fibLookupSessionEdges(BDDFirewallSessionTraceInfo sessionInfo) { return sessionInfo .getAction() .accept( new SessionActionVisitor<Stream<Edge>>() { @Override public Stream<Edge> visitAcceptVrf(Accept acceptVrf) { return Stream.of(); } @Override public Stream<Edge> visitFibLookup(FibLookup fibLookup) { return computeFibLookupSessionEdges(sessionInfo); } @Override public Stream<Edge> visitForwardOutInterface( ForwardOutInterface forwardOutInterface) { return Stream.of(); } }); } @VisibleForTesting  SessionInstrumentation(
      BDDPacket bddPacket,
      Map<String, Configuration> configs,
      Map<String, BDDSourceManager> srcMgrs,
      LastHopOutgoingInterfaceManager lastHopMgr,
      Map<String, BDDOutgoingOriginalFlowFilterManager> outgoingOriginalFlowFilterMgrs,
      @Nullable Map<String, Map<String, Supplier<BDD>>> filterBdds); static Stream<Edge> sessionInstrumentation(
      BDDPacket bddPacket,
      Map<String, Configuration> configs,
      Map<String, BDDSourceManager> srcMgrs,
      LastHopOutgoingInterfaceManager lastHopMgr,
      Map<String, BDDOutgoingOriginalFlowFilterManager> outgoingOriginalFlowFilterMgrs,
      Map<String, Map<String, Supplier<BDD>>> filterBdds,
      Stream<Edge> originalEdges,
      Map<String, List<BDDFirewallSessionTraceInfo>> initializedSessions,
      BDDFibGenerator bddFibGenerator);  }