<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
+ </from-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
- <match-set-options>INVERT</match-set-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
+ <match-set-options>INVERT</match-set-options>
+ </from-role>
</match-role-set>
<!--https://tools.ietf.org/html/rfc4456#section-8-->
<match-originator-id-set-condition xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-internal"]</role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-internal"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
- </match-role-set>
- <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
+ </from-role>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
- </match-role-set>
- <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
+ </from-role>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
- </match-role-set>
- <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
+ </from-role>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-internal"]</role-set>
- </match-role-set>
- <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="ibgp-rr-client"]</role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-internal"]</role-set>
+ </from-role>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="ibgp-rr-client"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-rr-client"]</role-set>
- </match-role-set>
- <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-rr-client"]</role-set>
+ </from-role>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
- </match-role-set>
- <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-rr-client"]</role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
+ </from-role>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-rr-client"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="ibgp-rr-client"]</role-set>
- </match-role-set>
- <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-rr-client"]</role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="ibgp-rr-client"]</role-set>
+ </from-role>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-rr-client"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutionException;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
import org.apache.commons.lang3.StringUtils;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.PeerRole;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp._default.policy.rev180109.BgpRoleSets;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp._default.policy.rev180109.MatchRoleSetCondition;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp._default.policy.rev180109.MatchSetDirectionOptionsType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp._default.policy.rev180109.match.role.set.condition.grouping.MatchRoleSet;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp._default.policy.rev180109.match.role.set.condition.grouping.match.role.set.FromRole;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp._default.policy.rev180109.match.role.set.condition.grouping.match.role.set.ToRole;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp._default.policy.rev180109.role.set.RoleSet;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp._default.policy.rev180109.role.set.RoleSetKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp._default.policy.rev180109.routing.policy.defined.sets.bgp.defined.sets.RoleSets;
this.dataBroker = requireNonNull(dataBroker);
}
- private boolean matchRoleCondition(final MatchRoleSet roleMatch, @Nonnull final PeerRole role) {
- final List<PeerRole> roles = this.roleSets.getUnchecked(StringUtils
- .substringBetween(roleMatch.getRoleSet(), "=\"", "\""));
- final boolean found = roles.contains(role);
- if (roleMatch.getMatchSetOptions().equals(MatchSetOptionsRestrictedType.ANY)) {
- return found;
- }
- //INVERT Case
- return !found;
- }
-
private List<PeerRole> loadRoleSets(final String key) throws ExecutionException, InterruptedException {
final ReadOnlyTransaction tr = this.dataBroker.newReadOnlyTransaction();
final Optional<RoleSet> result = tr.read(LogicalDatastoreType.CONFIGURATION,
@Override
public boolean matchImportCondition(
final RouteEntryBaseAttributes routeEntryInfo,
- final BGPRouteEntryImportParameters routeEntryImportParameters,
+ final BGPRouteEntryImportParameters importParameters,
final Void attributes,
final MatchRoleSetCondition conditions) {
+ return matchNeighborRoleSetCondition(importParameters.getFromPeerRole(), null,
+ conditions.getMatchRoleSet());
+ }
- final List<MatchRoleSet> neighCond = conditions.getMatchRoleSet();
+ private boolean matchNeighborRoleSetCondition(final PeerRole fromPeerRole, final PeerRole toPeerRole,
+ final MatchRoleSet matchRoleSet) {
- for (final MatchRoleSet roleMatch : neighCond) {
- if (roleMatch.getMatchSetDirectionOptions().equals(MatchSetDirectionOptionsType.TO)) {
- return false;
- } else {
- if (!matchRoleCondition(roleMatch, routeEntryImportParameters.getFromPeerRole())) {
- return false;
- }
- }
+ final FromRole from = matchRoleSet.getFromRole();
+ Boolean match = null;
+ if (from != null) {
+ match = checkMatch(from.getRoleSet(), fromPeerRole, from.getMatchSetOptions());
+ }
+ if (match != null && !match) {
+ return false;
+ }
+
+ final ToRole to = matchRoleSet.getToRole();
+ if (to != null) {
+ match = checkMatch(to.getRoleSet(), toPeerRole, to.getMatchSetOptions());
}
- return true;
+
+ return match;
+ }
+
+ private boolean checkMatch(final String roleSetName, final PeerRole role,
+ final MatchSetOptionsRestrictedType matchSetOptions) {
+ final List<PeerRole> roles = this.roleSets.getUnchecked(StringUtils
+ .substringBetween(roleSetName, "=\"", "\""));
+
+ final boolean found = roles.contains(role);
+ if (MatchSetOptionsRestrictedType.ANY.equals(matchSetOptions)) {
+ return found;
+ }
+ //INVERT
+ return !found;
}
@Override
public boolean matchExportCondition(
final RouteEntryBaseAttributes routeEntryInfo,
- final BGPRouteEntryExportParameters routeEntryExportParameters,
+ final BGPRouteEntryExportParameters exportParameters,
final Void attributes,
final MatchRoleSetCondition conditions) {
- final List<MatchRoleSet> neighCond = conditions.getMatchRoleSet();
-
- for (final MatchRoleSet roleMatch : neighCond) {
- PeerRole role;
- if (roleMatch.getMatchSetDirectionOptions().equals(MatchSetDirectionOptionsType.TO)) {
- role = routeEntryExportParameters.getToPeerRole();
- } else {
- role = routeEntryExportParameters.getFromPeerRole();
- }
- if (!matchRoleCondition(roleMatch, role)) {
- return false;
- }
- }
- return true;
+ return matchNeighborRoleSetCondition(exportParameters.getFromPeerRole(),
+ exportParameters.getToPeerRole(), conditions.getMatchRoleSet());
}
- @Nullable
@Override
- public Void getConditionParameter(@Nonnull final Attributes attributes) {
+ public Void getConditionParameter(final Attributes attributes) {
return null;
}
}
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"
- </role-set>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
+ </from-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"
- </role-set>
- <match-set-options>INVERT</match-set-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
+ <match-set-options>INVERT</match-set-options>
+ </from-role>
</match-role-set>
<!--https://tools.ietf.org/html/rfc4456#section-8-->
<match-originator-id-set-condition
xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
<originator-id-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/originator-id-sets/originator-id-set[originator-set-name="local-originator-id"
+ /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/originator-id-sets/originator-id-set[originator-set-name="local-originator-id"]
</originator-id-set>
<match-set-options>INVERT</match-set-options>
</match-originator-id-set-condition>
<match-cluster-id-set-condition
xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
<cluster-id-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/cluster-id-sets/cluster-id-set[cluster-set-name="local-cluster-id"
+ /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/cluster-id-sets/cluster-id-set[cluster-set-name="local-cluster-id"]
</cluster-id-set>
<match-set-options>INVERT</match-set-options>
</match-cluster-id-set-condition>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-internal"
- </role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-internal"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"
- </role-set>
- </match-role-set>
- <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"
- </role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
+ </from-role>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"
- </role-set>
- </match-role-set>
- <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"
- </role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
+ </from-role>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"
- </role-set>
- </match-role-set>
- <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"
- </role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
+ </from-role>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-internal"
- </role-set>
- </match-role-set>
- <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="ibgp-rr-client"
- </role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-internal"]</role-set>
+ </from-role>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="ibgp-rr-client"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-rr-client"
- </role-set>
- </match-role-set>
- <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"
- </role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-rr-client"]</role-set>
+ </from-role>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ibgp"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"
- </role-set>
- </match-role-set>
- <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-rr-client"
- </role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-ebgp"]</role-set>
+ </from-role>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-rr-client"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="ibgp-rr-client"
- </role-set>
- </match-role-set>
- <match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-rr-client"
- </role-set>
- <match-set-direction-options>TO</match-set-direction-options>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="ibgp-rr-client"]</role-set>
+ </from-role>
+ <to-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="only-rr-client"]</role-set>
+ </to-role>
</match-role-set>
</bgp-conditions>
</conditions>
<actions>
<bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
<set-cluster-id-prepend xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
- <set-originator-id-prepend
- xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
+ <set-originator-id-prepend xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy"/>
</bgp-actions>
</actions>
</statement>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-ext-community-set>
<ext-community-set>
- /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"
+ /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"]
</ext-community-set>
<match-set-options>ANY</match-set-options>
</match-ext-community-set>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-ext-community-set>
<ext-community-set>
- /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"
+ /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"]
</ext-community-set>
<match-set-options>ALL</match-set-options>
</match-ext-community-set>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-ext-community-set>
<ext-community-set>
- /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"
+ /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"]
</ext-community-set>
<match-set-options>INVERT</match-set-options>
</match-ext-community-set>
<conditions>
<match-prefix-set>
<prefix-set>
- /rpol:routing-policy/rpol:defined-sets/rpol:prefix-sets/prefix-set[prefix-set-name="test-prefix-set"
+ /rpol:routing-policy/rpol:defined-sets/rpol:prefix-sets/prefix-set[prefix-set-name="test-prefix-set"]
</prefix-set>
</match-prefix-set>
</conditions>
<conditions>
<match-prefix-set>
<prefix-set>
- /rpol:routing-policy/rpol:defined-sets/rpol:prefix-sets/prefix-set[prefix-set-name="test-prefix-set"
+ /rpol:routing-policy/rpol:defined-sets/rpol:prefix-sets/prefix-set[prefix-set-name="test-prefix-set"]
</prefix-set>
<match-set-options>INVERT</match-set-options>
</match-prefix-set>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-as-path-set>
<as-path-set>
- /rpol:routing-policy/rpol:defined-sets/bgp-pol:bgp-defined-sets/bgp-pol:as-path-sets/bgp-pol:as-path-set/[as-path-set-name="test-as-path-set"
+ /rpol:routing-policy/rpol:defined-sets/bgp-pol:bgp-defined-sets/bgp-pol:as-path-sets/bgp-pol:as-path-set/[as-path-set-name="test-as-path-set"]
</as-path-set>
<match-set-options>ANY</match-set-options>
</match-as-path-set>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-as-path-set>
<as-path-set>
- /rpol:routing-policy/rpol:defined-sets/bgp-pol:bgp-defined-sets/bgp-pol:as-path-sets/bgp-pol:as-path-set/[as-path-set-name="test-as-path-set"
+ /rpol:routing-policy/rpol:defined-sets/bgp-pol:bgp-defined-sets/bgp-pol:as-path-sets/bgp-pol:as-path-set/[as-path-set-name="test-as-path-set"]
</as-path-set>
<match-set-options>ALL</match-set-options>
</match-as-path-set>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-community-set>
<community-set>
- /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"
+ /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"]
</community-set>
<match-set-options>ANY</match-set-options>
</match-community-set>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-community-set>
<community-set>
- /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"
+ /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"]
</community-set>
<match-set-options>ALL</match-set-options>
</match-community-set>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-community-set>
<community-set>
- /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"
+ /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"]
</community-set>
<match-set-options>INVERT</match-set-options>
</match-community-set>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"
- </role-set>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
+ </from-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"
- </role-set>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
+ </from-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"
- </role-set>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
+ </from-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"
- </role-set>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
+ </from-role>
</match-role-set>
</bgp-conditions>
</conditions>
<bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
<set-community>
<community-set-ref>
- /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"
+ /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"]
</community-set-ref>
<options>ADD</options>
</set-community>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"
- </role-set>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
+ </from-role>
</match-role-set>
</bgp-conditions>
</conditions>
<bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
<set-community>
<community-set-ref>
- /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"
+ /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"]
</community-set-ref>
<options>REPLACE</options>
</set-community>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"
- </role-set>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
+ </from-role>
</match-role-set>
</bgp-conditions>
</conditions>
<bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
<set-community>
<community-set-ref>
- /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"
+ /rpol:routing-policy/rpol:defined-sets/rpol:community-sets/community-set[community-set-name="community-set-name-test"]
</community-set-ref>
<options>REMOVE</options>
</set-community>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"
- </role-set>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
+ </from-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"
- </role-set>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
+ </from-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"
- </role-set>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
+ </from-role>
</match-role-set>
</bgp-conditions>
</conditions>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"
- </role-set>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
+ </from-role>
</match-role-set>
</bgp-conditions>
</conditions>
<bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
<set-ext-community>
<ext-community-set-ref>
- /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"
+ /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"]
</ext-community-set-ref>
<options>ADD</options>
</set-ext-community>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"
- </role-set>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"</role-set>
+ </from-role>
</match-role-set>
</bgp-conditions>
</conditions>
<bgp-actions xmlns="http://openconfig.net/yang/bgp-policy">
<set-ext-community>
<ext-community-set-ref>
- /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"
+ /rpol:routing-policy/rpol:defined-sets/rpol:ext-community-sets/ext-community-set[ext-community-set-name="ext-community-set-name-test"]
</ext-community-set-ref>
<options>REPLACE</options>
</set-ext-community>
<conditions>
<bgp-conditions xmlns="http://openconfig.net/yang/bgp-policy">
<match-role-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
- <role-set>
- /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"
- </role-set>
+ <from-role>
+ <role-set>/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set[role-set-name="all"]</role-set>
+ </from-role>
</match-role-set>
</bgp-conditions>
</conditions>
<match-bgp-neighbor-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
<from-neighbor>
<neighbor-set>
- /rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="test-bgp-neighbor-set"
+ /rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="test-bgp-neighbor-set"]
</neighbor-set>
</from-neighbor>
</match-bgp-neighbor-set>
<match-bgp-neighbor-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
<from-neighbor>
<neighbor-set>
- /rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="test-bgp-neighbor-set"
+ /rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="test-bgp-neighbor-set"]
</neighbor-set>
<match-set-options>INVERT</match-set-options>
</from-neighbor>
<match-bgp-neighbor-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
<to-neighbor>
<neighbor-set>
- /rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="test-bgp-neighbor-set"
+ /rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="test-bgp-neighbor-set"]
</neighbor-set>
</to-neighbor>
</match-bgp-neighbor-set>
<match-bgp-neighbor-set xmlns="urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy">
<to-neighbor>
<neighbor-set>
- /rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="test-bgp-neighbor-set"
+ /rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/neighbor-set[neighbor-set-name="test-bgp-neighbor-set"]
</neighbor-set>
<match-set-options>INVERT</match-set-options>
</to-neighbor>