use of org.batfish.datamodel.SubRange in project batfish by batfish.
the class Route4FilterLineUpTo method applyTo.
@Override
public void applyTo(RouteFilterList rfl) {
int prefixLength = _prefix.getPrefixLength();
org.batfish.datamodel.RouteFilterLine line = new org.batfish.datamodel.RouteFilterLine(LineAction.ACCEPT, _prefix, new SubRange(prefixLength, _maxPrefixLength));
rfl.addLine(line);
}
use of org.batfish.datamodel.SubRange in project batfish by batfish.
the class Route6FilterLineExact method applyTo.
@Override
public void applyTo(Route6FilterList rfl) {
int prefixLength = _prefix6.getPrefixLength();
org.batfish.datamodel.Route6FilterLine line = new org.batfish.datamodel.Route6FilterLine(LineAction.ACCEPT, _prefix6, new SubRange(prefixLength, prefixLength));
rfl.addLine(line);
}
use of org.batfish.datamodel.SubRange in project batfish by batfish.
the class Route6FilterLineOrLonger method applyTo.
@Override
public void applyTo(Route6FilterList rfl) {
int prefixLength = _prefix6.getPrefixLength();
org.batfish.datamodel.Route6FilterLine line = new org.batfish.datamodel.Route6FilterLine(LineAction.ACCEPT, _prefix6, new SubRange(prefixLength, Prefix6.MAX_PREFIX_LENGTH));
rfl.addLine(line);
}
use of org.batfish.datamodel.SubRange in project batfish by batfish.
the class Route6FilterLineThrough method applyTo.
@Override
public void applyTo(Route6FilterList rfl) {
int low = _prefix6.getPrefixLength();
int high = _throughPrefix6.getPrefixLength();
for (int i = low; i <= high; i++) {
Ip6 currentNetworkAddress = _throughPrefix6.getAddress().getNetworkAddress(i);
Prefix6 currentPrefix6 = new Prefix6(currentNetworkAddress, i);
org.batfish.datamodel.Route6FilterLine line = new org.batfish.datamodel.Route6FilterLine(LineAction.ACCEPT, currentPrefix6, new SubRange(i, i));
rfl.addLine(line);
}
}
use of org.batfish.datamodel.SubRange in project batfish by batfish.
the class BoolExprTransformerTest method testVisitRangeMatchExpr.
@Test
public void testVisitRangeMatchExpr() {
BooleanExpr expr = RangeMatchExpr.fromSubRanges(BasicHeaderField.DSCP, BasicHeaderField.DSCP.getSize(), ImmutableSet.of(new SubRange(1, 3), new SubRange(5, 7)));
assertThat(toBoolExpr(expr, _input, _nodContext), instanceOf(BoolExpr.class));
}
Aggregations