use of org.batfish.datamodel.routing_policy.expr.MatchPrefixSet in project batfish by batfish.
the class OspfTest method getExportPolicyStatements.
private static List<Statement> getExportPolicyStatements(InterfaceAddress address) {
long externalOspfMetric = 20L;
If exportIfMatchL2Prefix = new If();
exportIfMatchL2Prefix.setGuard(new MatchPrefixSet(new DestinationNetwork(), new ExplicitPrefixSet(new PrefixSpace(ImmutableSet.of(PrefixRange.fromPrefix(address.getPrefix()))))));
exportIfMatchL2Prefix.setTrueStatements(ImmutableList.of(new SetOspfMetricType(OspfMetricType.E1), new SetMetric(new LiteralLong(externalOspfMetric)), Statements.ExitAccept.toStaticStatement()));
exportIfMatchL2Prefix.setFalseStatements(ImmutableList.of(Statements.ExitReject.toStaticStatement()));
return ImmutableList.of(exportIfMatchL2Prefix);
}
Aggregations