@Test public void testDeniedByNamedAclIpSpaceLine() { IpSpace aclIpSpace = AclIpSpace.permitting(Ip.parse("255.255.255.255").toIpSpace()) .thenPermitting(Ip.parse("255.255.255.254").toIpSpace()) .build(); assertThat(aclIpSpace, instanceOf(AclIpSpace.class)); IpAccessList acl = IpAccessList.builder() .setName(ACL_NAME) .setLines( ImmutableList.of( ExprAclLine.acceptingHeaderSpace( HeaderSpace.builder() .setDstIps(new IpSpaceReference(ACL_IP_SPACE_NAME)) .build()))) .build(); Map<String, IpAccessList> availableAcls = ImmutableMap.of(ACL_NAME, acl); Map<String, IpSpace> namedIpSpaces = ImmutableMap.of(ACL_IP_SPACE_NAME, aclIpSpace); Map<String, IpSpaceMetadata> namedIpSpaceMetadata = ImmutableMap.of(ACL_IP_SPACE_NAME, new IpSpaceMetadata(ACL_IP_SPACE_NAME, TEST_ACL)); List<TraceTree> root = AclTracer.trace( acl, FLOW, SRC_INTERFACE, availableAcls, namedIpSpaces, namedIpSpaceMetadata); assertThat(root, empty()); }
public static List<TraceTree> trace( @Nonnull IpAccessList ipAccessList, @Nonnull Flow flow, @Nullable String srcInterface, @Nonnull Map<String, IpAccessList> availableAcls, @Nonnull Map<String, IpSpace> namedIpSpaces, @Nonnull Map<String, IpSpaceMetadata> namedIpSpaceMetadata) { AclTracer tracer = new AclTracer(flow, srcInterface, availableAcls, namedIpSpaces, namedIpSpaceMetadata); tracer._tracer.newSubTrace(); tracer.trace(ipAccessList); tracer._tracer.endSubTrace(); return tracer.getTrace(); }
AclTracer extends AclLineEvaluator { public static List<TraceTree> trace( @Nonnull IpAccessList ipAccessList, @Nonnull Flow flow, @Nullable String srcInterface, @Nonnull Map<String, IpAccessList> availableAcls, @Nonnull Map<String, IpSpace> namedIpSpaces, @Nonnull Map<String, IpSpaceMetadata> namedIpSpaceMetadata) { AclTracer tracer = new AclTracer(flow, srcInterface, availableAcls, namedIpSpaces, namedIpSpaceMetadata); tracer._tracer.newSubTrace(); tracer.trace(ipAccessList); tracer._tracer.endSubTrace(); return tracer.getTrace(); } }
AclTracer extends AclLineEvaluator { public static List<TraceTree> trace( @Nonnull IpAccessList ipAccessList, @Nonnull Flow flow, @Nullable String srcInterface, @Nonnull Map<String, IpAccessList> availableAcls, @Nonnull Map<String, IpSpace> namedIpSpaces, @Nonnull Map<String, IpSpaceMetadata> namedIpSpaceMetadata) { AclTracer tracer = new AclTracer(flow, srcInterface, availableAcls, namedIpSpaces, namedIpSpaceMetadata); tracer._tracer.newSubTrace(); tracer.trace(ipAccessList); tracer._tracer.endSubTrace(); return tracer.getTrace(); } AclTracer(
      @Nonnull Flow flow,
      @Nullable String srcInterface,
      @Nonnull Map<String, IpAccessList> availableAcls,
      @Nonnull Map<String, IpSpace> namedIpSpaces,
      @Nonnull Map<String, IpSpaceMetadata> namedIpSpaceMetadata); }
AclTracer extends AclLineEvaluator { public static List<TraceTree> trace( @Nonnull IpAccessList ipAccessList, @Nonnull Flow flow, @Nullable String srcInterface, @Nonnull Map<String, IpAccessList> availableAcls, @Nonnull Map<String, IpSpace> namedIpSpaces, @Nonnull Map<String, IpSpaceMetadata> namedIpSpaceMetadata) { AclTracer tracer = new AclTracer(flow, srcInterface, availableAcls, namedIpSpaces, namedIpSpaceMetadata); tracer._tracer.newSubTrace(); tracer.trace(ipAccessList); tracer._tracer.endSubTrace(); return tracer.getTrace(); } AclTracer(
      @Nonnull Flow flow,
      @Nullable String srcInterface,
      @Nonnull Map<String, IpAccessList> availableAcls,
      @Nonnull Map<String, IpSpace> namedIpSpaces,
      @Nonnull Map<String, IpSpaceMetadata> namedIpSpaceMetadata); static List<TraceTree> trace(
      @Nonnull IpAccessList ipAccessList,
      @Nonnull Flow flow,
      @Nullable String srcInterface,
      @Nonnull Map<String, IpAccessList> availableAcls,
      @Nonnull Map<String, IpSpace> namedIpSpaces,
      @Nonnull Map<String, IpSpaceMetadata> namedIpSpaceMetadata); Flow getFlow(); @Nonnull List<TraceTree> getTrace(); boolean trace(@Nonnull IpSpace ipSpace, @Nonnull Ip ip, @Nonnull String ipDescription); @Override LineAction visitAclAclLine(AclAclLine aclAclLine); @Override LineAction visitExprAclLine(ExprAclLine exprAclLine); @Override Boolean visitMatchHeaderSpace(MatchHeaderSpace matchHeaderSpace); @Override Boolean visitTrueExpr(TrueExpr trueExpr); @Override Boolean visitFalseExpr(FalseExpr falseExpr); @Override Boolean visitPermittedByAcl(PermittedByAcl permittedByAcl); @Override Boolean visitDeniedByAcl(DeniedByAcl deniedByAcl); @Override Boolean visitAndMatchExpr(AndMatchExpr andMatchExpr); @Override Boolean visitOrMatchExpr(OrMatchExpr orMatchExpr); @Override Boolean visitNotMatchExpr(NotMatchExpr notMatchExpr); @Override Boolean visitMatchSrcInterface(MatchSrcInterface matchSrcInterface); }
AclTracer extends AclLineEvaluator { public static List<TraceTree> trace( @Nonnull IpAccessList ipAccessList, @Nonnull Flow flow, @Nullable String srcInterface, @Nonnull Map<String, IpAccessList> availableAcls, @Nonnull Map<String, IpSpace> namedIpSpaces, @Nonnull Map<String, IpSpaceMetadata> namedIpSpaceMetadata) { AclTracer tracer = new AclTracer(flow, srcInterface, availableAcls, namedIpSpaces, namedIpSpaceMetadata); tracer._tracer.newSubTrace(); tracer.trace(ipAccessList); tracer._tracer.endSubTrace(); return tracer.getTrace(); } AclTracer(
      @Nonnull Flow flow,
      @Nullable String srcInterface,
      @Nonnull Map<String, IpAccessList> availableAcls,
      @Nonnull Map<String, IpSpace> namedIpSpaces,
      @Nonnull Map<String, IpSpaceMetadata> namedIpSpaceMetadata); static List<TraceTree> trace(
      @Nonnull IpAccessList ipAccessList,
      @Nonnull Flow flow,
      @Nullable String srcInterface,
      @Nonnull Map<String, IpAccessList> availableAcls,
      @Nonnull Map<String, IpSpace> namedIpSpaces,
      @Nonnull Map<String, IpSpaceMetadata> namedIpSpaceMetadata); Flow getFlow(); @Nonnull List<TraceTree> getTrace(); boolean trace(@Nonnull IpSpace ipSpace, @Nonnull Ip ip, @Nonnull String ipDescription); @Override LineAction visitAclAclLine(AclAclLine aclAclLine); @Override LineAction visitExprAclLine(ExprAclLine exprAclLine); @Override Boolean visitMatchHeaderSpace(MatchHeaderSpace matchHeaderSpace); @Override Boolean visitTrueExpr(TrueExpr trueExpr); @Override Boolean visitFalseExpr(FalseExpr falseExpr); @Override Boolean visitPermittedByAcl(PermittedByAcl permittedByAcl); @Override Boolean visitDeniedByAcl(DeniedByAcl deniedByAcl); @Override Boolean visitAndMatchExpr(AndMatchExpr andMatchExpr); @Override Boolean visitOrMatchExpr(OrMatchExpr orMatchExpr); @Override Boolean visitNotMatchExpr(NotMatchExpr notMatchExpr); @Override Boolean visitMatchSrcInterface(MatchSrcInterface matchSrcInterface);  }