use of org.batfish.datamodel.routing_policy.Result in project batfish by batfish.
the class SetNextHop method execute.
@Override
public Result execute(Environment environment) {
Result result = new Result();
environment.getOutputRoute().setNextHopIp(_expr.getNextHopIp(environment));
return result;
}
use of org.batfish.datamodel.routing_policy.Result in project batfish by batfish.
the class SetOrigin method execute.
@Override
public Result execute(Environment environment) {
BgpRoute.Builder bgpRoute = (BgpRoute.Builder) environment.getOutputRoute();
OriginType originType = _origin.evaluate(environment);
bgpRoute.setOriginType(originType);
if (environment.getWriteToIntermediateBgpAttributes()) {
environment.getIntermediateBgpAttributes().setOriginType(originType);
}
Result result = new Result();
return result;
}
use of org.batfish.datamodel.routing_policy.Result in project batfish by batfish.
the class SetOspfMetricType method execute.
@Override
public Result execute(Environment environment) {
Result result = new Result();
OspfExternalRoute.Builder ospfExternalRoute = (OspfExternalRoute.Builder) environment.getOutputRoute();
ospfExternalRoute.setOspfMetricType(_metricType);
return result;
}
use of org.batfish.datamodel.routing_policy.Result in project batfish by batfish.
the class SetWeight method execute.
@Override
public Result execute(Environment environment) {
Result result = new Result();
int weight = _weight.evaluate(environment);
BgpRoute.Builder bgpRouteBuilder = (BgpRoute.Builder) environment.getOutputRoute();
bgpRouteBuilder.setWeight(weight);
return result;
}
use of org.batfish.datamodel.routing_policy.Result in project batfish by batfish.
the class AddCommunity method execute.
@Override
public Result execute(Environment environment) {
BgpRoute.Builder bgpRoute = (BgpRoute.Builder) environment.getOutputRoute();
SortedSet<Long> communities = _expr.allCommunities(environment);
bgpRoute.getCommunities().addAll(communities);
if (environment.getWriteToIntermediateBgpAttributes()) {
environment.getIntermediateBgpAttributes().getCommunities().addAll(communities);
}
Result result = new Result();
return result;
}
Aggregations