openconfig-routing-policy

This module describes a YANG model for routing policy configuration. It is a limited subset of all of the policy configuration p...

  • Version: 2023-11-01

    openconfig-routing-policy@2023-11-01


    
      module openconfig-routing-policy {
    
        yang-version 1;
    
        namespace
          "http://openconfig.net/yang/routing-policy";
    
        prefix oc-rpol;
    
        import openconfig-inet-types {
          prefix oc-inet;
        }
        import openconfig-interfaces {
          prefix oc-if;
        }
        import openconfig-policy-types {
          prefix oc-pol-types;
        }
        import openconfig-extensions {
          prefix oc-ext;
        }
    
        organization "OpenConfig working group";
    
        contact
          "OpenConfig working group
    netopenconfig@googlegroups.com";
    
        description
          "This module describes a YANG model for routing policy
    configuration. It is a limited subset of all of the policy
    configuration parameters available in the variety of vendor
    implementations, but supports widely used constructs for managing
    how routes are imported, exported, and modified across different
    routing protocols.  This module is intended to be used in
    conjunction with routing protocol configuration models (e.g.,
    BGP) defined in other modules.
    
    Route policy expression:
    
    Policies are expressed as a set of top-level policy definitions,
    each of which consists of a sequence of policy statements. Policy
    statements consist of simple condition-action tuples. Conditions
    may include mutiple match or comparison operations, and similarly
    actions may be multitude of changes to route attributes or a
    final disposition of accepting or rejecting the route.
    
    Route policy evaluation:
    
    Policy definitions are referenced in routing protocol
    configurations using import and export configuration statements.
    The arguments are members of an ordered list of named policy
    definitions which comprise a policy chain, and optionally, an
    explicit default policy action (i.e., reject or accept).
    
    Evaluation of each policy definition proceeds by evaluating its
    corresponding individual policy statements in order.  When a
    condition statement in a policy statement is satisfied, the
    corresponding action statement is executed.  If the action
    statement has a final disposition configured as policy result, either
    accept-route or reject-route, evaluation of the current policy definition
    stops, and no further policy statements are evaluated. In case there is a
    policy chain, no further policy definitions in the chain are evaluated.
    
    If the action statement has the NEXT_STATEMENT policy result, all the
    defined actions are executed and policy evaluation proceeds to the next
    statement.  The NEXT_STATEMENT is the default policy result action.
    
    If the condition is not satisfied, then evaluation proceeds to
    the next policy statement.  If none of the policy statement
    conditions are satisfied, then evaluation of the current policy
    definition stops, and the next policy definition in the chain is
    evaluated.  When the end of the policy chain is reached, the
    default route disposition action is performed (i.e., reject-route
    unless an an alternate default action is specified for the
    chain).
    
    Policy 'subroutines' (or nested policies) are supported by
    allowing policy statement conditions to reference another policy
    definition which applies conditions and actions from the
    referenced policy before returning to the calling policy
    statement and resuming evaluation.  If the called policy
    results in an accept-route (either explicit or by default), then
    the subroutine returns an effective true value to the calling
    policy.  Similarly, a reject-route action returns false.  If the
    subroutine returns true, the calling policy continues to evaluate
    the remaining conditions (using a modified route if the
    subroutine performed any changes to the route).
    
    If a routing protocol is defined and the related
    apply-policy/default-(import|export)-policy leaf is not set, the
    default value for the default-(import|export)-policy leaf must be
    applied.  See RFC6020 7.6.1 which applies to this model.";
    
        revision "2023-11-01" {
          description
            "Refactor apply policy to separate default policy in it's own common
    set of groupings";
          reference
            "3.4.2";
    
        }
    
        revision "2023-10-24" {
          description
            "Clarify the use of default-(import|export)-policy when no policy
    is applied to a protocol.";
          reference
            "3.4.1";
    
        }
    
        revision "2023-10-11" {
          description
            "Add NEXT_STATEMENT policy-result-type enum value.";
          reference
            "3.4.0";
    
        }
    
        revision "2022-05-24" {
          description
            "Remove module extension oc-ext:regexp-posix by making pattern regexes
    conform to RFC6020/7950.
    
    Types impacted:
    - masklength-range";
          reference
            "3.3.0";
    
        }
    
        revision "2020-08-18" {
          description
            "Fix regex anchors for masklength-range's pattern statement.";
          reference
            "3.2.2";
    
        }
    
        revision "2020-06-30" {
          description
            "Add OpenConfig POSIX pattern extensions.";
          reference
            "3.2.1";
    
        }
    
        revision "2020-04-02" {
          description
            "Add generic set-tag operation back to support local and IGP
    tagged routes.";
          reference
            "3.2.0";
    
        }
    
        revision "2018-11-21" {
          description
            "Add OpenConfig module metadata extensions.";
          reference
            "3.1.1";
    
        }
    
        revision "2018-06-05" {
          description
            "Add PIM, IGMP to INSTALL_PROTOCOL_TYPES identity";
          reference
            "3.1.0";
    
        }
    
        revision "2017-07-14" {
          description
            "Replace policy choice node/type with policy-result
    enumeration;simplified defined set naming;removed generic
    IGP actions; migrate to OpenConfig types; added mode for
    prefix sets";
          reference
            "3.0.0";
    
        }
    
        revision "2016-05-12" {
          description
            "OpenConfig public release";
          reference
            "2.0.1";
    
        }
    
        oc-ext:openconfig-version "3.4.2";
        oc-ext:catalog-organization "openconfig";
        oc-ext:origin "openconfig";
    
        typedef default-policy-type {
          type enumeration {
            enum "ACCEPT_ROUTE" {
              value 0;
              description
                "Default policy to accept the route";
            }
            enum "REJECT_ROUTE" {
              value 1;
              description
                "Default policy to reject the route";
            }
          }
          description
            "Type used to specify route disposition in
    a policy chain";
        }
    
        typedef policy-result-type {
          type enumeration {
            enum "ACCEPT_ROUTE" {
              value 0;
              description
                "Policy accepts the route and evaluation of the
    current policy definition stops.";
            }
            enum "REJECT_ROUTE" {
              value 1;
              description
                "Policy rejects the route and evaluation of the
    current policy definition stops.";
            }
            enum "NEXT_STATEMENT" {
              value 2;
              description
                "Any modifications of the route are preserved and the evaluation of the policy will continue to the
    next statement.";
            }
          }
          default "NEXT_STATEMENT";
          description
            "Type used to specify route disposition in
    a policy chain";
        }
      }  // module openconfig-routing-policy
    

© 2023 YumaWorks, Inc. All rights reserved.