@Test public void testAssignFromPoolBothIpAndPort() { int poolPort = 2000; Ip poolIp = Ip.parse("1.1.1.1"); Transformation transformation = always() .apply(assignSourceIp(poolIp, poolIp), assignSourcePort(poolPort, poolPort)) .build(); Transition transition = _toTransition.toTransition(transformation); BDD ipPoolBdd = _pkt.getSrcIp().value(poolIp.asLong()); BDD portPoolBdd = _pkt.getSrcPort().value(poolPort); BDD nonIpPoolBdd = _pkt.getSrcIp().value(poolIp.asLong() + 1); BDD nonPortPoolBdd = _pkt.getSrcPort().value(poolPort + 1); BDD actualOut = transition.transitForward(_one); assertThat(actualOut, equalTo(ipPoolBdd.and(_portTransformationProtocols.imp(portPoolBdd)))); BDD expectedIn = _one; BDD actualIn = transition.transitBackward(ipPoolBdd.and(_portTransformationProtocols.imp(portPoolBdd))); assertThat(actualIn, equalTo(expectedIn)); expectedIn = _zero; actualIn = transition.transitBackward(ipPoolBdd.and(_portTransformationProtocols).and(nonPortPoolBdd)); assertThat(actualIn, equalTo(expectedIn)); expectedIn = _zero; actualIn = transition.transitBackward(nonIpPoolBdd.and(portPoolBdd)); assertThat(actualIn, equalTo(expectedIn)); }
public Transition toTransition(@Nullable Transformation transformation) { return transformation == null ? IDENTITY : _cache.computeIfAbsent(transformation, this::computeTransition); }
TransformationToTransition { public Transition toTransition(@Nullable Transformation transformation) { return transformation == null ? IDENTITY : _cache.computeIfAbsent(transformation, this::computeTransition); } }
TransformationToTransition { public Transition toTransition(@Nullable Transformation transformation) { return transformation == null ? IDENTITY : _cache.computeIfAbsent(transformation, this::computeTransition); } TransformationToTransition(BDDPacket bddPacket, IpAccessListToBdd ipAccessListToBdd); }
TransformationToTransition { public Transition toTransition(@Nullable Transformation transformation) { return transformation == null ? IDENTITY : _cache.computeIfAbsent(transformation, this::computeTransition); } TransformationToTransition(BDDPacket bddPacket, IpAccessListToBdd ipAccessListToBdd); Transition toTransition(@Nullable Transformation transformation); Transition toReturnFlowTransition(@Nullable Transformation transformation); }
TransformationToTransition { public Transition toTransition(@Nullable Transformation transformation) { return transformation == null ? IDENTITY : _cache.computeIfAbsent(transformation, this::computeTransition); } TransformationToTransition(BDDPacket bddPacket, IpAccessListToBdd ipAccessListToBdd); Transition toTransition(@Nullable Transformation transformation); Transition toReturnFlowTransition(@Nullable Transformation transformation);  }