use of org.batfish.datamodel.routing_policy.expr.MultipliedAs in project batfish by batfish.
the class TransferBDD method prependLength.
/*
* Compute how many times to prepend to a path from the AST
*/
private int prependLength(AsPathListExpr expr) {
if (expr instanceof MultipliedAs) {
MultipliedAs x = (MultipliedAs) expr;
IntExpr e = x.getNumber();
LiteralInt i = (LiteralInt) e;
return i.getValue();
}
if (expr instanceof LiteralAsList) {
LiteralAsList x = (LiteralAsList) expr;
return x.getList().size();
}
throw new BatfishException("Error[prependLength]: unreachable");
}
use of org.batfish.datamodel.routing_policy.expr.MultipliedAs in project batfish by batfish.
the class TransferSSA method prependLength.
/*
* Compute how many times to prepend to a path from the AST
*/
private int prependLength(AsPathListExpr expr) {
if (expr instanceof MultipliedAs) {
MultipliedAs x = (MultipliedAs) expr;
IntExpr e = x.getNumber();
LiteralInt i = (LiteralInt) e;
return i.getValue();
}
if (expr instanceof LiteralAsList) {
LiteralAsList x = (LiteralAsList) expr;
return x.getList().size();
}
throw new BatfishException("Error[prependLength]: unreachable");
}
Aggregations