use of org.batfish.datamodel.routing_policy.expr.IntExpr in project batfish by batfish.
the class CiscoControlPlaneExtractor method toRoutePolicyStatement.
private RoutePolicyStatement toRoutePolicyStatement(Prepend_as_path_rp_stanzaContext ctx) {
AsExpr expr = toAsExpr(ctx.as);
IntExpr number = null;
if (ctx.number != null) {
number = toIntExpr(ctx.number);
}
return new RoutePolicyPrependAsPath(expr, number);
}
use of org.batfish.datamodel.routing_policy.expr.IntExpr in project batfish by batfish.
the class CiscoControlPlaneExtractor method toSubRangeExpr.
private SubRangeExpr toSubRangeExpr(Rp_subrangeContext ctx) {
IntExpr first = toCommonIntExpr(ctx.first);
IntExpr last = first;
if (ctx.last != null) {
last = toCommonIntExpr(ctx.first);
}
return new SubRangeExpr(first, last);
}
use of org.batfish.datamodel.routing_policy.expr.IntExpr in project batfish by batfish.
the class CiscoControlPlaneExtractor method exitSet_local_preference_rm_stanza.
@Override
public void exitSet_local_preference_rm_stanza(Set_local_preference_rm_stanzaContext ctx) {
IntExpr localPreference = toLocalPreferenceIntExpr(ctx.pref);
RouteMapSetLocalPreferenceLine line = new RouteMapSetLocalPreferenceLine(localPreference);
_currentRouteMapClause.addSetLine(line);
}
use of org.batfish.datamodel.routing_policy.expr.IntExpr in project batfish by batfish.
the class CiscoControlPlaneExtractor method toRoutePolicyBoolean.
private RoutePolicyBoolean toRoutePolicyBoolean(Boolean_med_rp_stanzaContext ctx) {
IntComparator cmp = toIntComparator(ctx.int_comp());
IntExpr rhs = toCommonIntExpr(ctx.rhs);
return new RoutePolicyBooleanMed(cmp, rhs);
}
use of org.batfish.datamodel.routing_policy.expr.IntExpr 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");
}
Aggregations