All Downloads are FREE. Search and download functionalities are using the official Maven repository.

[email protected] Maven / Gradle / Ivy

There is a newer version: 0.22.6
Show newest version
module odl-bgp-policy {
    yang-version 1.1;
    namespace "urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy";
    prefix "odl-bgp-policy";

    import yang-ext { prefix ext; revision-date 2013-07-09; }
    import openconfig-bgp-types { prefix oc-bgp-t; }
    import bgp-rib { prefix rib; revision-date 2018-03-29; }
    import openconfig-routing-policy { prefix rpol; }
    import openconfig-bgp-policy { prefix bgppol; }
    import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
    import bgp-types { prefix bgp-t; revision-date 2020-01-20; }

    organization "AT&T Services, Inc.";
    contact "Claudio D. Gasparini ";

    description
        "This module contains odl bgp policy model
        to be used under openconfig policy model definitions.

        Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.

        This program and the accompanying materials are made available
        under the terms of the Eclipse Public License v1.0 which
        accompanies this distribution, and is available at
        http://www.eclipse.org/legal/epl-v10.html";

    revision 2020-01-20 {
        description "Update to use -no-zone-adresses";
    }

    revision "2018-03-29" {
        description "Add support for add-path for all afi/safi.";
    }

    revision "2018-01-09" {
        description
            "ODL BGP policy models";
    }

    grouping match-role-condition-grouping {
        leaf role-set {
            type leafref {
              path "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set/role-set-name";
              require-instance true;
            }
            description "References a defined neighbor roles set";
        }
        uses rpol:match-set-options-restricted-group;
    }

    grouping match-role-set-condition-grouping {
        container match-role-set {
            description
                "Match a list of referenced role-set according to the logic
                defined in the match-set-options leaf";

            container from-role {
                uses match-role-condition-grouping;
            }

            container to-role {
                uses match-role-condition-grouping;
            }
        }
    }

    grouping bgp-neighbor {
        leaf neighbor-set {
          type leafref {
            path "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/rpol:neighbor-set/rpol:neighbor-set-name";
            require-instance true;
          }
          description "References a defined neighbor set";
        }
        uses rpol:match-set-options-restricted-group;
    }

    grouping match-bgp-neighbor-grouping {
        container match-bgp-neighbor-set {
            presence
                "The presence of this container indicates that the routes
                should match the neighbour address of set referenced";

            description
                "Match a referenced neighbor set according to the logic
                defined in the match-set-options-leaf";

            container from-neighbor {
                uses bgp-neighbor;
            }

            container to-neighbor {
                uses bgp-neighbor;
            }
        }
    }

    grouping match-originator-id-set-condition-grouping {
        description
            "Match a list of referenced originator-id-set according to the logic
            defined in the match-set-options leaf";

        container match-originator-id-set-condition {
            leaf originator-id-set {
                type leafref {
                  path "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/originator-id-sets/originator-id-set/originator-id-set-name";
                  require-instance true;
                }
                description "References a defined Originator Id set";
            }
            uses rpol:match-set-options-restricted-group;
        }
    }

    grouping match-cluster-id-set-condition-grouping {
        description
            "Match a list of referenced cluster-id-set according to the logic
            defined in the match-set-options leaf";
        container match-cluster-id-set-condition {
            leaf cluster-id-set {
                type leafref {
                  path "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/cluster-id-sets/cluster-id-set/cluster-id-set-name";
                  require-instance true;
                }
                description "References a defined cluster Id set";
            }
            uses rpol:match-set-options-group;
        }
    }

    grouping role-set {
        description "Data definition for a list of Odl Bgp roles which
            are matched as part of a policy";

        list role-set {
            key role-set-name;
            description "List of the defined role sets";

            leaf role-set-name {
              type string;
              description
                "name / label of the role set -- this is used to
                reference the set in match conditions";
            }

            leaf-list role {
                type rib:peer-role;
                description
                "List of role expressions that are part of the set";
            }
      }
    }

    grouping originator-id-set {
        description "Data definition for a list of Originators Ids which
            are matched as part of a policy";

        list originator-id-set {
            key originator-id-set-name;
            description "List of the defined Originators Ids sets";

            leaf originator-id-set-name {
              type string;
              description
                "name / label of the set -- this is used to
                reference the set in match conditions";
            }

            leaf-list originator-id {
                type inet:ipv4-address-no-zone;
                description
                "List of role expressions that are part of the set";
            }

            container local {
                 presence "Local originator Id";
                 description "Validates also Local Originator Id";
            }
      }
    }

    grouping cluster-id-set {
        description "Data definition for a list of Cluster Ids which
            are matched as part of a policy";

        list cluster-id-set {
            key cluster-id-set-name;
            description "List of the defined cluster Ids sets";

            leaf cluster-id-set-name {
              type string;
              description
                "name / label of the set -- this is used to
                reference the set in match conditions";
            }

            leaf-list cluster-id {
                type bgp-t:cluster-identifier;
                description
                "List of role expressions that are part of the set";
            }

            container local {
                 presence "Local cluster Id";
                 description "Validates also cluster Originator Id";
            }
      }
    }

    augment /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets {
        ext:augment-identifier bgp-cluster-id-sets;
        container cluster-id-sets {
            description "Enclosing container for defined cluster-id sets for matching";
            uses cluster-id-set;
        }
    }

    augment /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets {
        ext:augment-identifier bgp-role-sets;
        container role-sets {
            description "Enclosing container for defined role sets for matching";
            uses role-set;
        }
    }

    augment /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets {
        ext:augment-identifier bgp-originator-id-sets;
        container originator-id-sets {
            description "Enclosing container for defined role sets for matching";
            uses originator-id-set;
        }
    }

    augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
        ext:augment-identifier match-afi-safi-not-in-condition;
        leaf-list afi-safi-not-in {
            type identityref {
              base "oc-bgp-t:afi-safi-type";
            }
            description
              "List of address families which the NLRI must not be within";
        }
    }

    augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
        ext:augment-identifier match-bgp-neighbor-condition;
        uses match-bgp-neighbor-grouping;
    }

    augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
        ext:augment-identifier match-role-set-condition;
        uses match-role-set-condition-grouping;
    }

    augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
        ext:augment-identifier match-originator-id-set-condition;
        uses match-originator-id-set-condition-grouping;
    }

    augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
        ext:augment-identifier match-cluster-id-set-condition;
        uses match-cluster-id-set-condition-grouping;
    }

    augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
        ext:augment-identifier vpn-non-member-condition;
        container vpn-non-member {
            presence "Match Route Target Attribute with Route Target memberships of destiny peer. Asserts peers is a non member.";
        }
    }

    augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
        ext:augment-identifier reflect-attributes-actions;
        container reflect-attributes-actions {
            presence "Modify attributes so they are updated as per RFC4456 route reflection";
        }
    }

    augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
        ext:augment-identifier non-transitive-attributes-filter;
        container non-transitive-attributes-filter {
            presence "Filters attributes, removing non transitive attributes";
        }
    }

    augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
        ext:augment-identifier local-as-path-prepend;
        container local-as-path-prepend {
            presence "Prepends local AS Path";
        }
    }

    augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
        ext:augment-identifier set-cluster-id-prepend;
        container set-cluster-id-prepend {

        presence "node is present in the config data to use the Cluster Id prepend action";
        description "action to prepend local Cluster Id to the Cluster Id List";
        }
    }

    augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgppol:bgp-actions {
        ext:augment-identifier set-originator-id-prepend;
        container set-originator-id-prepend {
            presence "node is present in the config data to use the Originator Id prepend action";
            description "action to prepend Originator Id if non Originator Id is present. If no Originator Id"
            + "is defined, local Originator Id is used.";
            leaf originator-id {
                type inet:ipv4-address-no-zone;
                description "Originator Id";
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy