Codota Logo
CanonicalAcl.getSanitizedAcl
Code IndexAdd Codota to your IDE (free)

How to use
getSanitizedAcl
method
in
org.batfish.datamodel.acl.CanonicalAcl

Best Java code snippets using org.batfish.datamodel.acl.CanonicalAcl.getSanitizedAcl (Showing top 12 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: batfish/batfish

    bddPacket, sourceMgr, aclSpec.acl.getDependencies(), ImmutableMap.of());
IpAccessList ipAcl = aclSpec.acl.getSanitizedAcl();
List<IpAccessListLine> lines = ipAcl.getLines();
origin: batfish/batfish

@Test
public void testUndefinedReference() {
 _aclb
   .setLines(
     ImmutableList.of(
       IpAccessListLine.accepting().setMatchCondition(new PermittedByAcl("???")).build()))
   .build();
 List<AclSpecs> aclSpecs = getAclSpecs(ImmutableSet.of("c1"));
 // The sanitized version of the acl should have one unmatchable line
 assertThat(aclSpecs, hasSize(1));
 CanonicalAcl acl = aclSpecs.get(0).acl;
 assertThat(acl.getSanitizedAcl().getLines(), equalTo(ImmutableList.of(UNMATCHABLE)));
 assertThat(acl.hasUndefinedRef(0), equalTo(true));
}
origin: batfish/batfish

@Test
public void testWithUndefinedSrcInterfaceReference() {
 _aclb
   .setLines(
     ImmutableList.of(
       IpAccessListLine.accepting()
         .setMatchCondition(new MatchSrcInterface(ImmutableList.of("???")))
         .build()))
   .build();
 List<AclSpecs> aclSpecs = getAclSpecs(ImmutableSet.of("c1"));
 // The sanitized version of the acl should have one unmatchable line
 assertThat(aclSpecs, hasSize(1));
 AclSpecs spec = aclSpecs.get(0);
 assertThat(spec.acl.getSanitizedAcl().getLines(), equalTo(ImmutableList.of(UNMATCHABLE)));
}
origin: batfish/batfish

@Test
public void testWithUndefinedIpSpaceReference() {
 _aclb
   .setLines(
     ImmutableList.of(
       IpAccessListLine.accepting()
         .setMatchCondition(
           new MatchHeaderSpace(
             HeaderSpace.builder().setSrcIps(new IpSpaceReference("???")).build()))
         .build()))
   .build();
 List<AclSpecs> aclSpecs = getAclSpecs(ImmutableSet.of("c1"));
 // The sanitized version of the acl should have one unmatchable line
 assertThat(aclSpecs, hasSize(1));
 AclSpecs spec = aclSpecs.get(0);
 assertThat(spec.acl.getSanitizedAcl().getLines(), equalTo(ImmutableList.of(UNMATCHABLE)));
}
origin: batfish/batfish

@Test
public void testWithIpSpaceReference() {
 _aclb
   .setLines(
     ImmutableList.of(
       IpAccessListLine.rejecting()
         .setMatchCondition(
           new MatchHeaderSpace(
             HeaderSpace.builder()
               .setSrcIps(new IpSpaceReference("ipSpace"))
               .build()))
         .build()))
   .build();
 List<AclSpecs> aclSpecs = getAclSpecs(ImmutableSet.of("c1"));
 // The sanitized version of the acl should directly reject 1.2.3.4
 assertThat(aclSpecs, hasSize(1));
 AclSpecs spec = aclSpecs.get(0);
 assertThat(
   spec.acl.getSanitizedAcl().getLines(),
   equalTo(
     ImmutableList.of(
       rejectingHeaderSpace(
         HeaderSpace.builder().setSrcIps(Ip.parse("1.2.3.4").toIpSpace()).build()))));
}
origin: batfish/batfish

@Test
public void testWithUndefinedIpSpaceReferenceChain() {
 // Make sure it correctly interprets a chain of IpSpaceReferences ending with an undefined ref
 _c1.setIpSpaces(
   ImmutableSortedMap.of(
     "ipSpace1",
     new IpSpaceReference("ipSpace2"),
     "ipSpace2",
     new IpSpaceReference("ipSpace3")));
 _aclb
   .setLines(
     ImmutableList.of(
       IpAccessListLine.accepting()
         .setMatchCondition(
           new MatchHeaderSpace(
             HeaderSpace.builder()
               .setSrcIps(new IpSpaceReference("ipSpace1"))
               .build()))
         .build()))
   .build();
 List<AclSpecs> aclSpecs = getAclSpecs(ImmutableSet.of("c1"));
 // The sanitized version of the acl should have one unmatchable line
 assertThat(aclSpecs, hasSize(1));
 AclSpecs spec = aclSpecs.get(0);
 assertThat(spec.acl.getSanitizedAcl().getLines(), equalTo(ImmutableList.of(UNMATCHABLE)));
}
origin: batfish/batfish

@Test
public void testWithAclIpSpaceWithCircularRef() {
 // Named IP spaces includes AclIpSpace "aclIpSpace".
 // "aclIpSpace" contains an IpSpaceReference to itself. Rip
 _c1.setIpSpaces(
   ImmutableSortedMap.of(
     "aclIpSpace",
     AclIpSpace.of(AclIpSpaceLine.permit(new IpSpaceReference("aclIpSpace")))));
 _aclb
   .setLines(
     ImmutableList.of(
       IpAccessListLine.accepting()
         .setMatchCondition(
           new MatchHeaderSpace(
             HeaderSpace.builder()
               .setSrcIps(new IpSpaceReference("aclIpSpace"))
               .build()))
         .build()))
   .build();
 List<AclSpecs> aclSpecs = getAclSpecs(ImmutableSet.of("c1"));
 // The sanitized version of the acl should have one unmatchable line
 assertThat(aclSpecs, hasSize(1));
 AclSpecs spec = aclSpecs.get(0);
 assertThat(spec.acl.getSanitizedAcl().getLines(), equalTo(ImmutableList.of(UNMATCHABLE)));
}
origin: batfish/batfish

@Test
public void testWithCircularIpSpaceReferenceChain() {
 // Make sure it identifies an undefined reference for a circular chain of IpSpaceReferences
 _c1.setIpSpaces(
   ImmutableSortedMap.of(
     "ipSpace1",
     new IpSpaceReference("ipSpace2"),
     "ipSpace2",
     new IpSpaceReference("ipSpace3"),
     "ipSpace3",
     new IpSpaceReference("ipSpace1")));
 _aclb
   .setLines(
     ImmutableList.of(
       IpAccessListLine.accepting()
         .setMatchCondition(
           new MatchHeaderSpace(
             HeaderSpace.builder()
               .setSrcIps(new IpSpaceReference("ipSpace1"))
               .build()))
         .build()))
   .build();
 List<AclSpecs> aclSpecs = getAclSpecs(ImmutableSet.of("c1"));
 // The sanitized version of the acl should have one unmatchable line
 assertThat(aclSpecs, hasSize(1));
 AclSpecs spec = aclSpecs.get(0);
 assertThat(spec.acl.getSanitizedAcl().getLines(), equalTo(ImmutableList.of(UNMATCHABLE)));
}
origin: batfish/batfish

   spec.acl.getSanitizedAcl().getLines(),
   equalTo(
     ImmutableList.of(
} else {
 assertThat(spec.acl.getSanitizedAcl().getLines(), equalTo(ImmutableList.of(UNMATCHABLE)));
 assertThat(spec.acl.inCycle(0), equalTo(true));
origin: batfish/batfish

@Test
public void testWithAclIpSpaceWithGoodRefs() {
 // ACL contains an AclIpSpace that references the same valid named IpSpace twice
 _aclb
   .setLines(
     ImmutableList.of(
       acceptingHeaderSpace(
         HeaderSpace.builder()
           .setSrcIps(
             AclIpSpace.of(
               AclIpSpaceLine.permit(new IpSpaceReference("ipSpace")),
               AclIpSpaceLine.permit(new IpSpaceReference("ipSpace"))))
           .build())))
   .build();
 List<AclSpecs> aclSpecs = getAclSpecs(ImmutableSet.of("c1"));
 // The sanitized version of the acl should have correctly dereferenced "ipSpace"
 assertThat(aclSpecs, hasSize(1));
 AclSpecs spec = aclSpecs.get(0);
 assertThat(
   spec.acl.getSanitizedAcl().getLines(),
   equalTo(
     ImmutableList.of(
       acceptingHeaderSpace(
         HeaderSpace.builder()
           .setSrcIps(
             AclIpSpace.of(
               AclIpSpaceLine.permit(Ip.parse("1.2.3.4").toIpSpace()),
               AclIpSpaceLine.permit(Ip.parse("1.2.3.4").toIpSpace())))
           .build()))));
}
origin: batfish/batfish

AclSpecs spec = aclSpecs.get(0);
assertThat(
  spec.acl.getSanitizedAcl().getLines(),
  equalTo(
    ImmutableList.of(
origin: batfish/batfish

    .map(spec -> spec.acl.getSanitizedAcl().getLines().get(0).getMatchCondition())
    .collect(Collectors.toSet());
assertThat(
org.batfish.datamodel.aclCanonicalAclgetSanitizedAcl

Popular methods of CanonicalAcl

  • <init>
  • getDependencies
  • getInterfaces
  • hasUndefinedRef
  • inCycle
  • equals
  • getAclName
  • getOriginalAcl
  • hashCode

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • requestLocationUpdates (LocationManager)
  • findViewById (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • Collectors (java.util.stream)
  • JFileChooser (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now