Codota Logo
AclIpSpaceLine.permit
Code IndexAdd Codota to your IDE (free)

How to use
permit
method
in
org.batfish.datamodel.AclIpSpaceLine

Best Java code snippets using org.batfish.datamodel.AclIpSpaceLine.permit (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: batfish/batfish

@Test
public void testComputeArpTrueEdge() {
 IpSpace nextHopIpSpace = new MockIpSpace(1);
 IpSpace dstIpSpace = new MockIpSpace(2);
 Edge e1 = Edge.of("c1", "i1", "c2", "i2");
 _arpTrueEdgeDestIp = ImmutableMap.of(e1, dstIpSpace);
 _arpTrueEdgeNextHopIp = ImmutableMap.of(e1, nextHopIpSpace);
 ForwardingAnalysisImpl forwardingAnalysisImpl = initForwardingAnalysisImpl();
 Map<Edge, IpSpace> result = forwardingAnalysisImpl.computeArpTrueEdge();
 assertThat(
   result,
   hasEntry(
     equalTo(e1),
     isAclIpSpaceThat(
       hasLines(
         containsInAnyOrder(
           AclIpSpaceLine.permit(nextHopIpSpace),
           AclIpSpaceLine.permit(dstIpSpace))))));
}
origin: batfish/batfish

@Test
public void testComputeRouteMatchConditions() {
 Set<AbstractRoute> routes =
   ImmutableSet.of(new ConnectedRoute(P1, INTERFACE1), new ConnectedRoute(P2, INTERFACE2));
 MockRib rib =
   MockRib.builder().setMatchingIps(ImmutableMap.of(P1, IPSPACE1, P2, IPSPACE2)).build();
 /* Resulting IP space should permit matching IPs */
 assertThat(
   ForwardingAnalysisImpl.computeRouteMatchConditions(routes, rib.getMatchingIps()),
   isAclIpSpaceThat(
     hasLines(
       containsInAnyOrder(
         AclIpSpaceLine.permit(IPSPACE1), AclIpSpaceLine.permit(IPSPACE2)))));
}
origin: batfish/batfish

@Test
public void testVisitAclIpSpace() {
 IpSpace lineIpSpace = UniverseIpSpace.INSTANCE;
 String lineIpSpaceName = "lineIpSpace";
 IpSpaceMetadata lineIpSpaceMetadata = new IpSpaceMetadata("line_space_name", "line_space_type");
 IpSpace ipSpace = AclIpSpace.of(AclIpSpaceLine.permit(lineIpSpace));
 IpSpaceDescriber describerWithMetadata =
   new IpSpaceDescriber(
     new AclTracer(
       _flow,
       null,
       ImmutableMap.of(),
       ImmutableMap.of(TEST_NAME, ipSpace),
       ImmutableMap.of(TEST_NAME, TEST_METADATA)));
 IpSpaceDescriber describerWithLineMetadata =
   new IpSpaceDescriber(
     new AclTracer(
       _flow,
       null,
       ImmutableMap.of(),
       ImmutableMap.of(lineIpSpaceName, lineIpSpace),
       ImmutableMap.of(lineIpSpaceName, lineIpSpaceMetadata)));
 assertThat(ipSpace.accept(_describerNoNamesNorMetadata), equalTo("[0: universe]"));
 assertThat(
   ipSpace.accept(describerWithLineMetadata),
   equalTo("[0: 'line_space_type' named 'line_space_name']"));
 assertThat(ipSpace.accept(describerWithMetadata), equalTo(TEST_METADATA_DESCRIPTION));
}
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

@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)));
}
org.batfish.datamodelAclIpSpaceLinepermit

Popular methods of AclIpSpaceLine

  • getAction
  • getIpSpace
  • <init>
  • builder
  • getSrcText
  • toBuilder

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
  • getApplicationContext (Context)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JCheckBox (javax.swing)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
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