netconfcentral logo

openconfig-routing-policy@2017-07-14



  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 either accept-route or reject-route actions, policy
    evaluation of the current policy definition stops, and no further
    policy definitions in the chain are evaluated.

    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).";

    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.0.0";

    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";
        }
        enum "REJECT_ROUTE" {
          value 1;
          description
            "Policy rejects the route";
        }
      }
      description
        "Type used to specify route disposition in
      a policy chain";
    }
  }  // module openconfig-routing-policy