Search in sources :

Example 11 with Result

use of org.batfish.datamodel.routing_policy.Result in project batfish by batfish.

the class BufferedStatement method execute.

@Override
public Result execute(Environment environment) {
    environment.setBuffered(true);
    Result result = _statement.execute(environment);
    return result;
}
Also used : Result(org.batfish.datamodel.routing_policy.Result)

Example 12 with Result

use of org.batfish.datamodel.routing_policy.Result in project batfish by batfish.

the class CallStatement method execute.

@Override
public Result execute(Environment environment) {
    RoutingPolicy policy = environment.getConfiguration().getRoutingPolicies().get(_calledPolicyName);
    Result result;
    if (policy == null) {
        result = new Result();
        environment.setError(true);
        result.setBooleanValue(false);
    } else {
        boolean oldCallStatementContext = environment.getCallStatementContext();
        environment.setCallStatementContext(true);
        result = policy.call(environment);
        result.setReturn(false);
        environment.setCallStatementContext(oldCallStatementContext);
    }
    return result;
}
Also used : RoutingPolicy(org.batfish.datamodel.routing_policy.RoutingPolicy) Result(org.batfish.datamodel.routing_policy.Result)

Example 13 with Result

use of org.batfish.datamodel.routing_policy.Result in project batfish by batfish.

the class SetDefaultPolicy method execute.

@Override
public Result execute(Environment environment) {
    environment.setDefaultPolicy(_defaultPolicy);
    Result result = new Result();
    return result;
}
Also used : Result(org.batfish.datamodel.routing_policy.Result)

Example 14 with Result

use of org.batfish.datamodel.routing_policy.Result in project batfish by batfish.

the class MatchAsPath method evaluate.

@Override
public Result evaluate(Environment environment) {
    boolean match = _expr.matches(environment);
    Result result = new Result();
    result.setBooleanValue(match);
    return result;
}
Also used : Result(org.batfish.datamodel.routing_policy.Result)

Example 15 with Result

use of org.batfish.datamodel.routing_policy.Result in project batfish by batfish.

the class MatchIp6AccessList method evaluate.

@Override
public Result evaluate(Environment environment) {
    Result result = new Result();
    Ip6AccessList list = environment.getConfiguration().getIp6AccessLists().get(_list);
    if (list != null) {
    // TODO
    } else {
        environment.setError(true);
        result.setBooleanValue(false);
        return result;
    }
    throw new UnsupportedOperationException("no implementation for generated method");
}
Also used : Ip6AccessList(org.batfish.datamodel.Ip6AccessList) Result(org.batfish.datamodel.routing_policy.Result)

Aggregations

Result (org.batfish.datamodel.routing_policy.Result)30 BgpRoute (org.batfish.datamodel.BgpRoute)8 BatfishException (org.batfish.common.BatfishException)2 RoutingPolicy (org.batfish.datamodel.routing_policy.RoutingPolicy)2 ImmutableSortedSet (com.google.common.collect.ImmutableSortedSet)1 SortedSet (java.util.SortedSet)1 Ip6AccessList (org.batfish.datamodel.Ip6AccessList)1 IpAccessList (org.batfish.datamodel.IpAccessList)1 IsisLevel (org.batfish.datamodel.IsisLevel)1 IsisRoute (org.batfish.datamodel.IsisRoute)1 OriginType (org.batfish.datamodel.OriginType)1 OspfExternalRoute (org.batfish.datamodel.OspfExternalRoute)1 Prefix (org.batfish.datamodel.Prefix)1 Prefix6 (org.batfish.datamodel.Prefix6)1