Search in sources :

Example 1 with Trace

use of org.batfish.datamodel.flow.Trace in project batfish by batfish.

the class BidirectionalTracerouteAnswererTest method testMultipath.

@Test
public void testMultipath() {
    Trace forwardTrace1 = new Trace(ACCEPTED, ImmutableList.of());
    Trace forwardTrace2 = new Trace(DENIED_IN, ImmutableList.of());
    Trace forwardTrace3 = new Trace(DELIVERED_TO_SUBNET, ImmutableList.of());
    TraceAndReverseFlow forwardTarf1 = new TraceAndReverseFlow(forwardTrace1, REVERSE_FLOW, ImmutableSet.of());
    TraceAndReverseFlow forwardTarf2 = new TraceAndReverseFlow(forwardTrace2, null, ImmutableSet.of());
    TraceAndReverseFlow forwardTarf3 = new TraceAndReverseFlow(forwardTrace3, REVERSE_FLOW, ImmutableSet.of());
    Trace reverseTrace1 = new Trace(DENIED_IN, ImmutableList.of());
    Trace reverseTrace2 = new Trace(EXITS_NETWORK, ImmutableList.of());
    TraceAndReverseFlow reverseTarf1 = new TraceAndReverseFlow(reverseTrace1, null, ImmutableSet.of());
    TraceAndReverseFlow reverseTarf2 = new TraceAndReverseFlow(reverseTrace2, FORWARD_FLOW, ImmutableSet.of());
    TracerouteEngine tracerouteEngine = forFlows(ImmutableMap.of(FORWARD_FLOW, ImmutableList.of(forwardTarf1, forwardTarf2, forwardTarf3), REVERSE_FLOW, ImmutableList.of(reverseTarf1, reverseTarf2)));
    List<BidirectionalTrace> bidirectionalTraces = computeBidirectionalTraces(ImmutableSet.of(FORWARD_FLOW), tracerouteEngine, false);
    assertThat(bidirectionalTraces, contains(new BidirectionalTrace(FORWARD_FLOW, forwardTrace1, ImmutableSet.of(), REVERSE_FLOW, reverseTrace1), new BidirectionalTrace(FORWARD_FLOW, forwardTrace1, ImmutableSet.of(), REVERSE_FLOW, reverseTrace2), new BidirectionalTrace(FORWARD_FLOW, forwardTrace2, ImmutableSet.of(), null, null), new BidirectionalTrace(FORWARD_FLOW, forwardTrace3, ImmutableSet.of(), REVERSE_FLOW, reverseTrace1), new BidirectionalTrace(FORWARD_FLOW, forwardTrace3, ImmutableSet.of(), REVERSE_FLOW, reverseTrace2)));
}
Also used : Trace(org.batfish.datamodel.flow.Trace) BidirectionalTrace(org.batfish.datamodel.flow.BidirectionalTrace) TraceAndReverseFlow(org.batfish.datamodel.flow.TraceAndReverseFlow) BidirectionalTrace(org.batfish.datamodel.flow.BidirectionalTrace) TracerouteEngine(org.batfish.common.plugin.TracerouteEngine) Test(org.junit.Test)

Example 2 with Trace

use of org.batfish.datamodel.flow.Trace in project batfish by batfish.

the class BidirectionalTracerouteAnswererTest method testGroupTraces.

@Test
public void testGroupTraces() {
    Trace t1 = new Trace(ACCEPTED, ImmutableList.of());
    Trace t2 = new Trace(EXITS_NETWORK, ImmutableList.of());
    Trace t3 = new Trace(NEIGHBOR_UNREACHABLE, ImmutableList.of());
    Trace t4 = new Trace(DENIED_IN, ImmutableList.of());
    FirewallSessionTraceInfo session1 = new FirewallSessionTraceInfo("session1", Accept.INSTANCE, ImmutableSet.of(), DUMMY_SESSION_FLOW, null);
    FirewallSessionTraceInfo session2 = new FirewallSessionTraceInfo("session2", Accept.INSTANCE, ImmutableSet.of(), DUMMY_SESSION_FLOW, null);
    {
        // All BidirectionalTraces have the same key, so are in the same group.
        BidirectionalTrace bt1 = new BidirectionalTrace(FORWARD_FLOW, t1, ImmutableSet.of(), REVERSE_FLOW, t3);
        BidirectionalTrace bt2 = new BidirectionalTrace(FORWARD_FLOW, t1, ImmutableSet.of(), REVERSE_FLOW, t4);
        BidirectionalTrace bt3 = new BidirectionalTrace(FORWARD_FLOW, t2, ImmutableSet.of(), REVERSE_FLOW, t3);
        BidirectionalTrace bt4 = new BidirectionalTrace(FORWARD_FLOW, t2, ImmutableSet.of(), REVERSE_FLOW, t4);
        List<BidirectionalTrace> bts = ImmutableList.of(bt1, bt2, bt3, bt4);
        assertThat(groupTraces(bts), hasEntry(equalTo(Key.from(bt1)), equalTo(bts)));
    }
    {
        // Traces with different forward flows are in different groups
        BidirectionalTrace bt1 = new BidirectionalTrace(FORWARD_FLOW, t1, ImmutableSet.of(), REVERSE_FLOW, t2);
        BidirectionalTrace bt2 = new BidirectionalTrace(REVERSE_FLOW, t1, ImmutableSet.of(), REVERSE_FLOW, t2);
        assertThat(groupTraces(ImmutableList.of(bt1, bt2)), equalTo(ImmutableMap.of(Key.from(bt1), ImmutableList.of(bt1), Key.from(bt2), ImmutableList.of(bt2))));
    }
    {
        // Traces with different number of sessions are in different groups
        BidirectionalTrace bt1 = new BidirectionalTrace(FORWARD_FLOW, t1, ImmutableSet.of(), REVERSE_FLOW, t2);
        BidirectionalTrace bt2 = new BidirectionalTrace(FORWARD_FLOW, t1, ImmutableSet.of(session1), REVERSE_FLOW, t2);
        assertThat(groupTraces(ImmutableList.of(bt1, bt2)), equalTo(ImmutableMap.of(Key.from(bt1), ImmutableList.of(bt1), Key.from(bt2), ImmutableList.of(bt2))));
    }
    {
        // Traces with different sessions are in different groups
        BidirectionalTrace bt1 = new BidirectionalTrace(FORWARD_FLOW, t1, ImmutableSet.of(session1), REVERSE_FLOW, t2);
        BidirectionalTrace bt2 = new BidirectionalTrace(FORWARD_FLOW, t1, ImmutableSet.of(session2), REVERSE_FLOW, t2);
        assertThat(groupTraces(ImmutableList.of(bt1, bt2)), equalTo(ImmutableMap.of(Key.from(bt1), ImmutableList.of(bt1), Key.from(bt2), ImmutableList.of(bt2))));
    }
    {
        // Traces with different reverse flows are in different groups
        BidirectionalTrace bt1 = new BidirectionalTrace(FORWARD_FLOW, t1, ImmutableSet.of(), REVERSE_FLOW, t2);
        BidirectionalTrace bt2 = new BidirectionalTrace(FORWARD_FLOW, t1, ImmutableSet.of(), FORWARD_FLOW, t2);
        assertThat(groupTraces(ImmutableList.of(bt1, bt2)), equalTo(ImmutableMap.of(Key.from(bt1), ImmutableList.of(bt1), Key.from(bt2), ImmutableList.of(bt2))));
    }
}
Also used : Trace(org.batfish.datamodel.flow.Trace) BidirectionalTrace(org.batfish.datamodel.flow.BidirectionalTrace) BidirectionalTrace(org.batfish.datamodel.flow.BidirectionalTrace) ImmutableList(com.google.common.collect.ImmutableList) List(java.util.List) FirewallSessionTraceInfo(org.batfish.datamodel.flow.FirewallSessionTraceInfo) Test(org.junit.Test)

Example 3 with Trace

use of org.batfish.datamodel.flow.Trace in project batfish by batfish.

the class BidirectionalTracerouteAnswererTest method testSessions.

/**
 * Make sure we don't mix traces and sessions.
 */
@Test
public void testSessions() {
    Trace sessionForwardTrace = new Trace(ACCEPTED, ImmutableList.of());
    Trace noSessionForwardTrace = new Trace(DELIVERED_TO_SUBNET, ImmutableList.of());
    FirewallSessionTraceInfo session = new FirewallSessionTraceInfo("session", Accept.INSTANCE, ImmutableSet.of(), DUMMY_SESSION_FLOW, null);
    TraceAndReverseFlow sessionForwardTarf = new TraceAndReverseFlow(sessionForwardTrace, REVERSE_FLOW, ImmutableList.of(session));
    TraceAndReverseFlow noSessionForwardTarf = new TraceAndReverseFlow(noSessionForwardTrace, REVERSE_FLOW, ImmutableList.of());
    Trace sessionReverseTrace = new Trace(DENIED_IN, ImmutableList.of());
    Trace noSessionReverseTrace = new Trace(DENIED_OUT, ImmutableList.of());
    TraceAndReverseFlow sessionReverseTarf = new TraceAndReverseFlow(sessionReverseTrace, null, ImmutableList.of());
    TraceAndReverseFlow noSessionReverseTarf = new TraceAndReverseFlow(noSessionReverseTrace, null, ImmutableList.of());
    TracerouteEngine tracerouteEngine = forSessions(ImmutableMap.of(ImmutableSet.of(), ImmutableMap.of(FORWARD_FLOW, ImmutableList.of(sessionForwardTarf, noSessionForwardTarf), REVERSE_FLOW, ImmutableList.of(noSessionReverseTarf)), ImmutableSet.of(session), ImmutableMap.of(REVERSE_FLOW, ImmutableList.of(sessionReverseTarf))));
    List<BidirectionalTrace> bidirectionalTraces = computeBidirectionalTraces(ImmutableSet.of(FORWARD_FLOW), tracerouteEngine, false);
    assertThat(bidirectionalTraces, containsInAnyOrder(new BidirectionalTrace(FORWARD_FLOW, sessionForwardTrace, ImmutableSet.of(session), REVERSE_FLOW, sessionReverseTrace), new BidirectionalTrace(FORWARD_FLOW, noSessionForwardTrace, ImmutableSet.of(), REVERSE_FLOW, noSessionReverseTrace)));
}
Also used : Trace(org.batfish.datamodel.flow.Trace) BidirectionalTrace(org.batfish.datamodel.flow.BidirectionalTrace) TraceAndReverseFlow(org.batfish.datamodel.flow.TraceAndReverseFlow) BidirectionalTrace(org.batfish.datamodel.flow.BidirectionalTrace) TracerouteEngine(org.batfish.common.plugin.TracerouteEngine) FirewallSessionTraceInfo(org.batfish.datamodel.flow.FirewallSessionTraceInfo) Test(org.junit.Test)

Example 4 with Trace

use of org.batfish.datamodel.flow.Trace in project batfish by batfish.

the class F5BigipStructuredGrammarTest method testDnat.

@Test
public void testDnat() throws IOException {
    String snapshotName = "dnat";
    String natHostname = "f5_bigip_structured_dnat";
    String hostname = "host1";
    String hostFilename = hostname + ".json";
    Batfish batfish = BatfishTestUtils.getBatfishFromTestrigText(TestrigText.builder().setConfigurationFiles(SNAPSHOTS_PREFIX + snapshotName, natHostname).setHostsFiles(SNAPSHOTS_PREFIX + snapshotName, hostFilename).build(), _folder);
    NetworkSnapshot snapshot = batfish.getSnapshot();
    batfish.computeDataPlane(snapshot);
    {
        // DNAT modulo ARP
        Flow flow = Flow.builder().setDstIp(Ip.parse("192.0.2.1")).setDstPort(80).setIngressInterface("/Common/SOME_VLAN").setIngressNode(natHostname).setIpProtocol(IpProtocol.TCP).setSrcIp(Ip.parse("8.8.8.8")).setSrcPort(50000).build();
        SortedMap<Flow, List<Trace>> flowTraces = batfish.getTracerouteEngine(snapshot).computeTraces(ImmutableSet.of(flow), false);
        List<Trace> traces = flowTraces.get(flow);
        Optional<TransformationStepDetail> stepDetailOptional = traces.stream().map(Trace::getHops).flatMap(Collection::stream).map(Hop::getSteps).flatMap(Collection::stream).map(Step::getDetail).filter(Predicates.instanceOf(TransformationStepDetail.class)).map(TransformationStepDetail.class::cast).filter(d -> d.getTransformationType() == TransformationType.DEST_NAT).findFirst();
        assertTrue("There is a DNAT transformation step.", stepDetailOptional.isPresent());
        TransformationStepDetail detail = stepDetailOptional.get();
        assertThat(detail.getFlowDiffs(), hasItem(equalTo(FlowDiff.flowDiff(IpField.DESTINATION, Ip.parse("192.0.2.1"), Ip.parse("192.0.2.10")))));
    }
    {
        // DNAT with ARP
        Flow flow = Flow.builder().setDstIp(Ip.parse("192.0.2.1")).setDstPort(80).setIngressNode(hostname).setIpProtocol(IpProtocol.TCP).setSrcIp(Ip.parse("192.0.2.2")).setSrcPort(50000).build();
        SortedMap<Flow, List<Trace>> flowTraces = batfish.getTracerouteEngine(snapshot).computeTraces(ImmutableSet.of(flow), false);
        List<Trace> traces = flowTraces.get(flow);
        Optional<TransformationStepDetail> stepDetailOptional = traces.stream().map(Trace::getHops).flatMap(Collection::stream).map(Hop::getSteps).flatMap(Collection::stream).map(Step::getDetail).filter(Predicates.instanceOf(TransformationStepDetail.class)).map(TransformationStepDetail.class::cast).filter(d -> d.getTransformationType() == TransformationType.DEST_NAT).findFirst();
        assertTrue("There is a DNAT transformation step.", stepDetailOptional.isPresent());
        TransformationStepDetail detail = stepDetailOptional.get();
        assertThat(detail.getFlowDiffs(), hasItem(equalTo(FlowDiff.flowDiff(IpField.DESTINATION, Ip.parse("192.0.2.1"), Ip.parse("192.0.2.10")))));
    }
    {
        // bidirectional traceroute with DNAT
        Flow flow = Flow.builder().setDstIp(Ip.parse("192.0.2.1")).setDstPort(80).setIngressInterface("/Common/SOME_VLAN").setIngressNode(natHostname).setIpProtocol(IpProtocol.TCP).setSrcIp(Ip.parse("8.8.8.8")).setSrcPort(50000).build();
        SortedMap<Flow, List<TraceAndReverseFlow>> flowTraces = batfish.getTracerouteEngine(snapshot).computeTracesAndReverseFlows(ImmutableSet.of(flow), false);
        List<TraceAndReverseFlow> traces = flowTraces.get(flow);
        assertThat(traces, hasSize(1));
        Flow reverseFlow = traces.get(0).getReverseFlow();
        assertThat(reverseFlow, equalTo(Flow.builder().setSrcIp(Ip.parse("192.0.2.10")).setSrcPort(80).setIngressInterface("/Common/SOME_VLAN").setIngressNode(natHostname).setIpProtocol(IpProtocol.TCP).setDstIp(Ip.parse("8.8.8.8")).setDstPort(50000).build()));
        Set<FirewallSessionTraceInfo> sessions = traces.get(0).getNewFirewallSessions();
        SortedMap<Flow, List<TraceAndReverseFlow>> reverseFlowTraces = batfish.getTracerouteEngine(snapshot).computeTracesAndReverseFlows(ImmutableSet.of(reverseFlow), sessions, false);
        Optional<TransformationStepDetail> stepDetailOptional = reverseFlowTraces.get(reverseFlow).stream().map(TraceAndReverseFlow::getTrace).map(Trace::getHops).flatMap(Collection::stream).map(Hop::getSteps).flatMap(Collection::stream).map(Step::getDetail).filter(Predicates.instanceOf(TransformationStepDetail.class)).map(TransformationStepDetail.class::cast).filter(d -> d.getTransformationType() == TransformationType.SOURCE_NAT).findFirst();
        assertTrue("There is a DNAT transformation step.", stepDetailOptional.isPresent());
        TransformationStepDetail detail = stepDetailOptional.get();
        assertThat(detail.getFlowDiffs(), hasItem(equalTo(FlowDiff.flowDiff(IpField.SOURCE, Ip.parse("192.0.2.10"), Ip.parse("192.0.2.1")))));
    }
}
Also used : Trace(org.batfish.datamodel.flow.Trace) ImmutableSet(com.google.common.collect.ImmutableSet) Set(java.util.Set) Optional(java.util.Optional) TransformationStepDetail(org.batfish.datamodel.flow.TransformationStep.TransformationStepDetail) TraceAndReverseFlow(org.batfish.datamodel.flow.TraceAndReverseFlow) SortedMap(java.util.SortedMap) NetworkSnapshot(org.batfish.common.NetworkSnapshot) Collection(java.util.Collection) SilentSyntaxCollection(org.batfish.grammar.silent_syntax.SilentSyntaxCollection) IpAccessList(org.batfish.datamodel.IpAccessList) RouteFilterList(org.batfish.datamodel.RouteFilterList) Route6FilterList(org.batfish.datamodel.Route6FilterList) List(java.util.List) IBatfish(org.batfish.common.plugin.IBatfish) Batfish(org.batfish.main.Batfish) TraceAndReverseFlow(org.batfish.datamodel.flow.TraceAndReverseFlow) Flow(org.batfish.datamodel.Flow) Test(org.junit.Test)

Example 5 with Trace

use of org.batfish.datamodel.flow.Trace in project batfish by batfish.

the class F5BigipStructuredGrammarTest method testSnatBidirectionalTraceroute.

@Test
public void testSnatBidirectionalTraceroute() throws IOException {
    String hostname = "f5_bigip_structured_snat";
    parseConfig(hostname);
    Batfish batfish = getBatfishForConfigurationNames(hostname);
    NetworkSnapshot snapshot = batfish.getSnapshot();
    batfish.computeDataPlane(snapshot);
    // SNAT via snat /Common/snat1
    Flow flow = Flow.builder().setDstIp(Ip.parse("192.0.2.1")).setDstPort(80).setIngressInterface("/Common/vlan1").setIngressNode(hostname).setIpProtocol(IpProtocol.TCP).setSrcIp(Ip.parse("8.8.8.8")).setSrcPort(50000).build();
    SortedMap<Flow, List<TraceAndReverseFlow>> flowTraces = batfish.getTracerouteEngine(snapshot).computeTracesAndReverseFlows(ImmutableSet.of(flow), false);
    List<TraceAndReverseFlow> traces = flowTraces.get(flow);
    assertThat(traces, hasSize(1));
    Flow reverseFlow = traces.get(0).getReverseFlow();
    assertThat(reverseFlow, equalTo(Flow.builder().setSrcIp(Ip.parse("192.0.2.1")).setSrcPort(80).setIngressInterface("/Common/vlan1").setIngressNode(hostname).setIpProtocol(IpProtocol.TCP).setDstIp(Ip.parse("10.200.1.2")).setDstPort(1024).build()));
    Set<FirewallSessionTraceInfo> sessions = traces.get(0).getNewFirewallSessions();
    SortedMap<Flow, List<TraceAndReverseFlow>> reverseFlowTraces = batfish.getTracerouteEngine(snapshot).computeTracesAndReverseFlows(ImmutableSet.of(reverseFlow), sessions, false);
    Optional<TransformationStepDetail> stepDetailOptional = reverseFlowTraces.get(reverseFlow).stream().map(TraceAndReverseFlow::getTrace).map(Trace::getHops).flatMap(Collection::stream).map(Hop::getSteps).flatMap(Collection::stream).map(Step::getDetail).filter(Predicates.instanceOf(TransformationStepDetail.class)).map(TransformationStepDetail.class::cast).filter(d -> d.getTransformationType() == TransformationType.DEST_NAT).findFirst();
    assertTrue("There is a DNAT transformation step.", stepDetailOptional.isPresent());
    TransformationStepDetail detail = stepDetailOptional.get();
    assertThat(detail.getFlowDiffs(), contains(FlowDiff.flowDiff(IpField.DESTINATION, Ip.parse("10.200.1.2"), Ip.parse("8.8.8.8")), FlowDiff.flowDiff(PortField.DESTINATION, 1024, 50000)));
}
Also used : IpField(org.batfish.datamodel.transformation.IpField) BgpNeighborMatchers.hasRemoteAs(org.batfish.datamodel.matchers.BgpNeighborMatchers.hasRemoteAs) BuiltinMonitor(org.batfish.representation.f5_bigip.BuiltinMonitor) PROFILE_CLIENT_SSL(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_CLIENT_SSL) BgpRouteMatchers.hasCommunities(org.batfish.datamodel.matchers.BgpRouteMatchers.hasCommunities) PROFILE_SOCKS(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_SOCKS) PHYSICAL(org.batfish.datamodel.InterfaceType.PHYSICAL) PROFILE_FTP(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_FTP) Map(java.util.Map) TransformationStepDetail(org.batfish.datamodel.flow.TransformationStep.TransformationStepDetail) Route6FilterListMatchers(org.batfish.datamodel.matchers.Route6FilterListMatchers) POOL(org.batfish.representation.f5_bigip.F5BigipStructureType.POOL) IpAccessListMatchers(org.batfish.datamodel.matchers.IpAccessListMatchers) ROUTE(org.batfish.representation.f5_bigip.F5BigipStructureType.ROUTE) Dependency(org.batfish.datamodel.Interface.Dependency) Matchers.notNullValue(org.hamcrest.Matchers.notNullValue) SwitchportMode(org.batfish.datamodel.SwitchportMode) FlowDiff(org.batfish.datamodel.FlowDiff) FlowDiffMatchers.isIpRewrite(org.batfish.datamodel.matchers.FlowDiffMatchers.isIpRewrite) Route(org.batfish.representation.f5_bigip.Route) TraceAndReverseFlow(org.batfish.datamodel.flow.TraceAndReverseFlow) BuiltinPersistence(org.batfish.representation.f5_bigip.BuiltinPersistence) NODE(org.batfish.representation.f5_bigip.F5BigipStructureType.NODE) Stream(java.util.stream.Stream) Assert.assertFalse(org.junit.Assert.assertFalse) PROFILE_HTML(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_HTML) MapMatchers.hasKeys(org.batfish.datamodel.matchers.MapMatchers.hasKeys) NetworkSnapshot(org.batfish.common.NetworkSnapshot) BgpProcessMatchers.hasMultipathEquivalentAsPathMatchMode(org.batfish.datamodel.matchers.BgpProcessMatchers.hasMultipathEquivalentAsPathMatchMode) BatfishTestUtils.configureBatfishTestSettings(org.batfish.main.BatfishTestUtils.configureBatfishTestSettings) InitInfoAnswerElement(org.batfish.datamodel.answers.InitInfoAnswerElement) InterfaceMatchers.hasInactiveReason(org.batfish.datamodel.matchers.InterfaceMatchers.hasInactiveReason) SerializationUtils(org.apache.commons.lang3.SerializationUtils) PROFILE_DHCPV4(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_DHCPV4) PROFILE_FASTHTTP(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_FASTHTTP) PROFILE_TRAFFIC_ACCELERATION(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_TRAFFIC_ACCELERATION) PROFILE_DHCPV6(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_DHCPV6) ParseStatus(org.batfish.datamodel.answers.ParseStatus) VIRTUAL(org.batfish.representation.f5_bigip.F5BigipStructureType.VIRTUAL) PROFILE_GTP(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_GTP) IpSpaceMatchers.containsIp(org.batfish.datamodel.matchers.IpSpaceMatchers.containsIp) MONITOR_HTTP(org.batfish.representation.f5_bigip.F5BigipStructureType.MONITOR_HTTP) Matchers.hasSize(org.hamcrest.Matchers.hasSize) PROFILE_DNS(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_DNS) Before(org.junit.Before) PROFILE_HTTP_PROXY_CONNECT(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_HTTP_PROXY_CONNECT) Matchers.greaterThanOrEqualTo(org.hamcrest.Matchers.greaterThanOrEqualTo) Assert.assertTrue(org.junit.Assert.assertTrue) IOException(java.io.IOException) InterfaceType(org.batfish.datamodel.InterfaceType) Test(org.junit.Test) F5BigipFamily(org.batfish.datamodel.vendor_family.f5_bigip.F5BigipFamily) PROFILE_HTTP2(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_HTTP2) IpAccessListToBdd(org.batfish.common.bdd.IpAccessListToBdd) FirewallSessionTraceInfo(org.batfish.datamodel.flow.FirewallSessionTraceInfo) PROFILE_ANALYTICS(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_ANALYTICS) Assert.assertNull(org.junit.Assert.assertNull) ConfigurationMatchers.hasInterfaces(org.batfish.datamodel.matchers.ConfigurationMatchers.hasInterfaces) TrafficGroup(org.batfish.representation.f5_bigip.TrafficGroup) PERSISTENCE_SOURCE_ADDR(org.batfish.representation.f5_bigip.F5BigipStructureType.PERSISTENCE_SOURCE_ADDR) InterfaceMatchers.hasAddress(org.batfish.datamodel.matchers.InterfaceMatchers.hasAddress) Resources.readResource(org.batfish.common.util.Resources.readResource) PROFILE_PCP(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_PCP) PROFILE_SIP(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_SIP) Matchers.hasKey(org.hamcrest.Matchers.hasKey) Trace(org.batfish.datamodel.flow.Trace) PROFILE_DIAMETER(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_DIAMETER) Assert.assertThat(org.junit.Assert.assertThat) InactiveReason(org.batfish.datamodel.InactiveReason) TransformationType(org.batfish.datamodel.flow.TransformationStep.TransformationType) ConvertConfigurationAnswerElement(org.batfish.datamodel.answers.ConvertConfigurationAnswerElement) TransformationEvaluator.eval(org.batfish.datamodel.transformation.TransformationEvaluator.eval) Prefix6(org.batfish.datamodel.Prefix6) PROFILE_WEB_SECURITY(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_WEB_SECURITY) InterfaceMatchers.hasAllowedVlans(org.batfish.datamodel.matchers.InterfaceMatchers.hasAllowedVlans) NamedPort(org.batfish.datamodel.NamedPort) BuiltinProfile(org.batfish.representation.f5_bigip.BuiltinProfile) PROFILE_REQUEST_LOG(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_REQUEST_LOG) Builtin(org.batfish.representation.f5_bigip.Builtin) RouteFilterListMatchers.permits(org.batfish.datamodel.matchers.RouteFilterListMatchers.permits) MONITOR(org.batfish.representation.f5_bigip.F5BigipStructureType.MONITOR) TransformationResult(org.batfish.datamodel.transformation.TransformationEvaluator.TransformationResult) ImmutableSet(com.google.common.collect.ImmutableSet) Matchers.lessThanOrEqualTo(org.hamcrest.Matchers.lessThanOrEqualTo) Collection(java.util.Collection) PERSISTENCE_COOKIE(org.batfish.representation.f5_bigip.F5BigipStructureType.PERSISTENCE_COOKIE) IpSpace(org.batfish.datamodel.IpSpace) OriginType(org.batfish.datamodel.OriginType) Settings(org.batfish.config.Settings) KernelRouteMatchers.isKernelRouteThat(org.batfish.datamodel.matchers.KernelRouteMatchers.isKernelRouteThat) PROFILE_MAP_T(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_MAP_T) Matchers.containsInAnyOrder(org.hamcrest.Matchers.containsInAnyOrder) ConnectedRoute(org.batfish.datamodel.ConnectedRoute) RoutingPolicy(org.batfish.datamodel.routing_policy.RoutingPolicy) DeviceGroupDevice(org.batfish.representation.f5_bigip.DeviceGroupDevice) Matchers.equalTo(org.hamcrest.Matchers.equalTo) IpAccessListMatchers.accepts(org.batfish.datamodel.matchers.IpAccessListMatchers.accepts) PROFILE_RTSP(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_RTSP) Ip(org.batfish.datamodel.Ip) IntStream(java.util.stream.IntStream) DUMMY_SNAPSHOT_1(org.batfish.main.BatfishTestUtils.DUMMY_SNAPSHOT_1) PERSISTENCE(org.batfish.representation.f5_bigip.F5BigipStructureType.PERSISTENCE) IpAccessList(org.batfish.datamodel.IpAccessList) SNAT(org.batfish.representation.f5_bigip.F5BigipStructureType.SNAT) Function(java.util.function.Function) MONITOR_TCP(org.batfish.representation.f5_bigip.F5BigipStructureType.MONITOR_TCP) BDDSourceManager(org.batfish.common.bdd.BDDSourceManager) IpAccessListToBddImpl(org.batfish.common.bdd.IpAccessListToBddImpl) Configuration(org.batfish.datamodel.Configuration) BgpNeighborMatchers.hasLocalAs(org.batfish.datamodel.matchers.BgpNeighborMatchers.hasLocalAs) PROFILE_RESPONSE_ADAPT(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_RESPONSE_ADAPT) Nonnull(javax.annotation.Nonnull) BDDPacket(org.batfish.common.bdd.BDDPacket) FlowDiffMatchers.isPortRewrite(org.batfish.datamodel.matchers.FlowDiffMatchers.isPortRewrite) Matchers.empty(org.hamcrest.Matchers.empty) HaGroup(org.batfish.representation.f5_bigip.HaGroup) VrfMatchers.hasStaticRoutes(org.batfish.datamodel.matchers.VrfMatchers.hasStaticRoutes) UTF_8(java.nio.charset.StandardCharsets.UTF_8) INTERFACE(org.batfish.representation.f5_bigip.F5BigipStructureType.INTERFACE) VLAN_MEMBER_INTERFACE(org.batfish.representation.f5_bigip.F5BigipStructureType.VLAN_MEMBER_INTERFACE) PROFILE_TFTP(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_TFTP) Ignore(org.junit.Ignore) PROFILE_WEBSOCKET(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_WEBSOCKET) InterfaceMatchers.hasNativeVlan(org.batfish.datamodel.matchers.InterfaceMatchers.hasNativeVlan) MONITOR_GATEWAY_ICMP(org.batfish.representation.f5_bigip.F5BigipStructureType.MONITOR_GATEWAY_ICMP) Prefix(org.batfish.datamodel.Prefix) Arrays(java.util.Arrays) Hop(org.batfish.datamodel.flow.Hop) InterfaceMatchers.hasBandwidth(org.batfish.datamodel.matchers.InterfaceMatchers.hasBandwidth) Matchers.not(org.hamcrest.Matchers.not) ROUTE_MAP(org.batfish.representation.f5_bigip.F5BigipStructureType.ROUTE_MAP) RouteFilterList(org.batfish.datamodel.RouteFilterList) InterfaceMatchers.hasSwitchPortMode(org.batfish.datamodel.matchers.InterfaceMatchers.hasSwitchPortMode) PROFILE(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE) Flow(org.batfish.datamodel.Flow) PROFILE_STATISTICS(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_STATISTICS) IpAccessListMatchers.rejects(org.batfish.datamodel.matchers.IpAccessListMatchers.rejects) Matchers.nullValue(org.hamcrest.Matchers.nullValue) PROFILE_HTTP(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_HTTP) Bgpv4Route(org.batfish.datamodel.Bgpv4Route) PROFILE_PPTP(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_PPTP) MacAddress(org.batfish.datamodel.MacAddress) DataPlane(org.batfish.datamodel.DataPlane) PROFILE_SPLITSESSIONCLIENT(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_SPLITSESSIONCLIENT) ConcreteUnicastAddressIp(org.batfish.representation.f5_bigip.ConcreteUnicastAddressIp) Set(java.util.Set) PROFILE_CLIENT_LDAP(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_CLIENT_LDAP) InterfaceMatchers.hasInterfaceType(org.batfish.datamodel.matchers.InterfaceMatchers.hasInterfaceType) PROFILE_IPOTHER(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_IPOTHER) IBatfish(org.batfish.common.plugin.IBatfish) Matchers.instanceOf(org.hamcrest.Matchers.instanceOf) TRUNK(org.batfish.representation.f5_bigip.F5BigipStructureType.TRUNK) Step(org.batfish.datamodel.flow.Step) PROFILE_NETFLOW(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_NETFLOW) PROFILE_RADIUS(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_RADIUS) Matchers.contains(org.hamcrest.Matchers.contains) Route6FilterList(org.batfish.datamodel.Route6FilterList) ParserRuleContext(org.antlr.v4.runtime.ParserRuleContext) UnicastAddress(org.batfish.representation.f5_bigip.UnicastAddress) IcmpType(org.batfish.datamodel.IcmpType) RULE(org.batfish.representation.f5_bigip.F5BigipStructureType.RULE) PROFILE_FIX(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_FIX) Matchers.aMapWithSize(org.hamcrest.Matchers.aMapWithSize) PROFILE_SCTP(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_SCTP) PortField(org.batfish.datamodel.transformation.PortField) DATA_GROUP_INTERNAL(org.batfish.representation.f5_bigip.F5BigipStructureType.DATA_GROUP_INTERNAL) Virtual(org.batfish.representation.f5_bigip.Virtual) DataModelMatchers.hasUndefinedReference(org.batfish.datamodel.matchers.DataModelMatchers.hasUndefinedReference) PROFILE_REQUEST_ADAPT(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_REQUEST_ADAPT) VrfMatchers.hasKernelRoutes(org.batfish.datamodel.matchers.VrfMatchers.hasKernelRoutes) PROFILE_XML(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_XML) SELF(org.batfish.representation.f5_bigip.F5BigipStructureType.SELF) AbstractRouteDecoratorMatchers.hasAdministrativeCost(org.batfish.datamodel.matchers.AbstractRouteDecoratorMatchers.hasAdministrativeCost) SilentSyntaxCollection(org.batfish.grammar.silent_syntax.SilentSyntaxCollection) BgpProcessMatchers.hasRouterId(org.batfish.datamodel.matchers.BgpProcessMatchers.hasRouterId) InterfaceMatchers.isActive(org.batfish.datamodel.matchers.InterfaceMatchers.isActive) PROFILE_SERVER_LDAP(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_SERVER_LDAP) VLAN(org.batfish.representation.f5_bigip.F5BigipStructureType.VLAN) PROFILE_ICAP(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_ICAP) Predicates(com.google.common.base.Predicates) HaGroupPool(org.batfish.representation.f5_bigip.HaGroupPool) VIRTUAL_ADDRESS(org.batfish.representation.f5_bigip.F5BigipStructureType.VIRTUAL_ADDRESS) RouteFilterListMatchers.rejects(org.batfish.datamodel.matchers.RouteFilterListMatchers.rejects) TestrigText(org.batfish.main.TestrigText) EXACT_PATH(org.batfish.datamodel.MultipathEquivalentAsPathMatchMode.EXACT_PATH) StaticRoute(org.batfish.datamodel.StaticRoute) PROFILE_CERTIFICATE_AUTHORITY(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_CERTIFICATE_AUTHORITY) StandardCommunity(org.batfish.datamodel.bgp.community.StandardCommunity) PROFILE_HTTP_COMPRESSION(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_HTTP_COMPRESSION) PROFILE_WEB_ACCELERATION(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_WEB_ACCELERATION) KernelRoute(org.batfish.datamodel.KernelRoute) Direction(org.batfish.datamodel.routing_policy.Environment.Direction) InterfaceMatchers.hasVlan(org.batfish.datamodel.matchers.InterfaceMatchers.hasVlan) VirtualAddress(org.batfish.representation.f5_bigip.VirtualAddress) Result(org.batfish.datamodel.routing_policy.Result) Matchers.hasItem(org.hamcrest.Matchers.hasItem) ConfigurationMatchers.hasInterface(org.batfish.datamodel.matchers.ConfigurationMatchers.hasInterface) MONITOR_LDAP(org.batfish.representation.f5_bigip.F5BigipStructureType.MONITOR_LDAP) VrfMatchers.hasBgpProcess(org.batfish.datamodel.matchers.VrfMatchers.hasBgpProcess) PROFILE_QOE(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_QOE) ManagementIp(org.batfish.representation.f5_bigip.ManagementIp) Environment(org.batfish.datamodel.routing_policy.Environment) AbstractRouteDecoratorMatchers.hasMetric(org.batfish.datamodel.matchers.AbstractRouteDecoratorMatchers.hasMetric) IpProtocol(org.batfish.datamodel.IpProtocol) HaGroupTrunk(org.batfish.representation.f5_bigip.HaGroupTrunk) BGP_NEIGHBOR(org.batfish.representation.f5_bigip.F5BigipStructureType.BGP_NEIGHBOR) PREFIX_LIST(org.batfish.representation.f5_bigip.F5BigipStructureType.PREFIX_LIST) PROFILE_OCSP_STAPLING_PARAMS(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_OCSP_STAPLING_PARAMS) IntegerSpace(org.batfish.datamodel.IntegerSpace) PROFILE_TCP(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_TCP) AGGREGATED(org.batfish.datamodel.InterfaceType.AGGREGATED) MONITOR_DNS(org.batfish.representation.f5_bigip.F5BigipStructureType.MONITOR_DNS) InterfaceMatchers.hasDependencies(org.batfish.datamodel.matchers.InterfaceMatchers.hasDependencies) F5BigipStructureType(org.batfish.representation.f5_bigip.F5BigipStructureType) PROFILE_ONE_CONNECT(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_ONE_CONNECT) DeviceGroupType(org.batfish.datamodel.vendor_family.f5_bigip.DeviceGroupType) PROFILE_ILX(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_ILX) PROFILE_MQTT(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_MQTT) BgpNeighborMatchers.hasDescription(org.batfish.datamodel.matchers.BgpNeighborMatchers.hasDescription) PROFILE_SMTPS(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_SMTPS) ImmutableMap(com.google.common.collect.ImmutableMap) PROFILE_REWRITE(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_REWRITE) PROFILE_IPSECALG(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_IPSECALG) BGP_PROCESS(org.batfish.representation.f5_bigip.F5BigipStructureType.BGP_PROCESS) PROFILE_SPLITSESSIONSERVER(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_SPLITSESSIONSERVER) Device(org.batfish.representation.f5_bigip.Device) DataModelMatchers.hasRoute6FilterLists(org.batfish.datamodel.matchers.DataModelMatchers.hasRoute6FilterLists) List(java.util.List) AbstractRouteDecoratorMatchers.hasPrefix(org.batfish.datamodel.matchers.AbstractRouteDecoratorMatchers.hasPrefix) DataModelMatchers.hasNumReferrers(org.batfish.datamodel.matchers.DataModelMatchers.hasNumReferrers) PROFILE_UDP(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_UDP) Warnings(org.batfish.common.Warnings) AGGREGATE(org.batfish.datamodel.Interface.DependencyType.AGGREGATE) InterfaceMatchers.hasSpeed(org.batfish.datamodel.matchers.InterfaceMatchers.hasSpeed) PERSISTENCE_SSL(org.batfish.representation.f5_bigip.F5BigipStructureType.PERSISTENCE_SSL) Optional(java.util.Optional) PROFILE_CLASSIFICATION(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_CLASSIFICATION) F5BigipConfiguration(org.batfish.representation.f5_bigip.F5BigipConfiguration) SortedMap(java.util.SortedMap) MONITOR_HTTPS(org.batfish.representation.f5_bigip.F5BigipStructureType.MONITOR_HTTPS) PROFILE_TCP_ANALYTICS(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_TCP_ANALYTICS) BatfishLogger(org.batfish.common.BatfishLogger) BatfishTestUtils(org.batfish.main.BatfishTestUtils) SNATPOOL(org.batfish.representation.f5_bigip.F5BigipStructureType.SNATPOOL) FilterResult(org.batfish.datamodel.FilterResult) RoutingProtocol(org.batfish.datamodel.RoutingProtocol) Transformation(org.batfish.datamodel.transformation.Transformation) SNAT_TRANSLATION(org.batfish.representation.f5_bigip.F5BigipStructureType.SNAT_TRANSLATION) DeviceGroup(org.batfish.representation.f5_bigip.DeviceGroup) PROFILE_STREAM(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_STREAM) AbstractRoute(org.batfish.datamodel.AbstractRoute) DataModelMatchers.hasRouteFilterLists(org.batfish.datamodel.matchers.DataModelMatchers.hasRouteFilterLists) Batfish(org.batfish.main.Batfish) ExpectedException(org.junit.rules.ExpectedException) InterfaceMatchers.isSwitchport(org.batfish.datamodel.matchers.InterfaceMatchers.isSwitchport) Warning(org.batfish.common.Warning) BgpNeighborMatchers.hasLocalIp(org.batfish.datamodel.matchers.BgpNeighborMatchers.hasLocalIp) Iterator(java.util.Iterator) ConfigurationMatchers.hasDefaultVrf(org.batfish.datamodel.matchers.ConfigurationMatchers.hasDefaultVrf) Matchers.both(org.hamcrest.Matchers.both) AbstractRouteDecoratorMatchers.hasNextHopIp(org.batfish.datamodel.matchers.AbstractRouteDecoratorMatchers.hasNextHopIp) PROFILE_FASTL4(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_FASTL4) BgpProcessMatchers.hasActiveNeighbor(org.batfish.datamodel.matchers.BgpProcessMatchers.hasActiveNeighbor) BgpRouteMatchers.isBgpv4RouteThat(org.batfish.datamodel.matchers.BgpRouteMatchers.isBgpv4RouteThat) Rule(org.junit.Rule) PROFILE_SERVER_SSL(org.batfish.representation.f5_bigip.F5BigipStructureType.PROFILE_SERVER_SSL) TemporaryFolder(org.junit.rules.TemporaryFolder) Hop(org.batfish.datamodel.flow.Hop) NetworkSnapshot(org.batfish.common.NetworkSnapshot) Step(org.batfish.datamodel.flow.Step) FirewallSessionTraceInfo(org.batfish.datamodel.flow.FirewallSessionTraceInfo) TraceAndReverseFlow(org.batfish.datamodel.flow.TraceAndReverseFlow) Flow(org.batfish.datamodel.Flow) Trace(org.batfish.datamodel.flow.Trace) TransformationStepDetail(org.batfish.datamodel.flow.TransformationStep.TransformationStepDetail) TraceAndReverseFlow(org.batfish.datamodel.flow.TraceAndReverseFlow) IpAccessList(org.batfish.datamodel.IpAccessList) RouteFilterList(org.batfish.datamodel.RouteFilterList) Route6FilterList(org.batfish.datamodel.Route6FilterList) List(java.util.List) IBatfish(org.batfish.common.plugin.IBatfish) Batfish(org.batfish.main.Batfish) Test(org.junit.Test)

Aggregations

Trace (org.batfish.datamodel.flow.Trace)65 Test (org.junit.Test)54 Flow (org.batfish.datamodel.Flow)46 TraceAndReverseFlow (org.batfish.datamodel.flow.TraceAndReverseFlow)35 Configuration (org.batfish.datamodel.Configuration)34 Batfish (org.batfish.main.Batfish)32 List (java.util.List)28 NetworkSnapshot (org.batfish.common.NetworkSnapshot)26 IBatfish (org.batfish.common.plugin.IBatfish)24 NetworkFactory (org.batfish.datamodel.NetworkFactory)24 Vrf (org.batfish.datamodel.Vrf)24 Interface (org.batfish.datamodel.Interface)22 ImmutableList (com.google.common.collect.ImmutableList)21 IpAccessList (org.batfish.datamodel.IpAccessList)20 Hop (org.batfish.datamodel.flow.Hop)19 TraceAndReverseFlowMatchers.hasTrace (org.batfish.datamodel.matchers.TraceAndReverseFlowMatchers.hasTrace)19 FlowTracer.matchSessionReturnFlow (org.batfish.dataplane.traceroute.FlowTracer.matchSessionReturnFlow)19 ForwardOutInterface (org.batfish.datamodel.flow.ForwardOutInterface)17 Ip (org.batfish.datamodel.Ip)16 TraceAndReverseFlowMatchers.hasReverseFlow (org.batfish.datamodel.matchers.TraceAndReverseFlowMatchers.hasReverseFlow)15