@Test public void testAssignFromPool() { Ip poolStart = Ip.parse("1.1.1.5"); Ip poolEnd = Ip.parse("1.1.1.13"); Transformation transformation = always().apply(assignSourceIp(poolStart, poolEnd)).build(); Transition transition = _toTransition.toTransition(transformation); BDD poolBdd = _pkt.getSrcIp().geq(poolStart.asLong()).and(_pkt.getSrcIp().leq(poolEnd.asLong())); BDD poolIpBdd = _pkt.getSrcIp().value(poolStart.asLong() + 2); BDD nonPoolIpBdd = _pkt.getSrcIp().value(poolEnd.asLong() + 2); BDD expectedOut = poolBdd; BDD actualOut = transition.transitForward(_one); assertThat(actualOut, equalTo(expectedOut)); expectedOut = poolBdd; actualOut = transition.transitForward(poolIpBdd); assertThat(actualOut, equalTo(expectedOut)); BDD expectedIn = _one; BDD actualIn = transition.transitBackward(poolIpBdd); assertThat(actualIn, equalTo(expectedIn)); expectedIn = _zero; actualIn = transition.transitBackward(nonPoolIpBdd); 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);  }