netconfcentral logo

ietf-routing.yang



  module ietf-routing {

    yang-version 1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-routing";

    prefix rt;

    import ietf-yang-types {
      prefix yang;
    }
    import iana-afn-safi {
      prefix ianaaf;
    }

    organization
      "IETF NETMOD (NETCONF Data Modeling Language) Working Group";

    contact
      "WG Web: <http://tools.ietf.org/wg/netmod/>
        WG List: <mailto:netmod@ietf.org>

        WG Chair: David Kessens
        <mailto:david.kessens@nsn.com>

        WG Chair: Juergen Schoenwaelder
        <mailto:j.schoenwaelder@jacobs-university.de>

        Editor: Ladislav Lhotka
        <mailto:lhotka@cesnet.cz>
       ";

    description
      "This module contains YANG definitions of essential components
        that may be used for configuring a routing subsystem.

        Copyright (c) 2011 IETF Trust and the persons identified as
        authors of the code. All rights reserved.

        Redistribution and use in source and binary forms, with or
        without modification, is permitted pursuant to, and subject to
        the license terms contained in, the Simplified BSD License set
        forth in Section 4.c of the IETF Trust's Legal Provisions
        Relating to IETF Documents
        (http://trustee.ietf.org/license-info).

        This version of this YANG module is part of RFC XXXX; see the
        RFC itself for full legal notices.
       ";

    revision "2011-09-23" {
      description "Initial revision.";
      reference
        "RFC XXXX: A YANG Data Model for Routing Configuration";

    }


    identity routing-protocol {
      description
        "Base identity from which routing protocol identities are
          derived.";
    }

    identity direct {
      base routing-protocol;
      description
        "Routing pseudo-protocol which provides routes to directly
          connected networks.";
    }

    identity static {
      base routing-protocol;
      description
        "Static routing pseudo-protocol.";
    }

    identity route-filter {
      description
        "Base identity from which all route filters are derived.";
    }

    identity deny-all-route-filter {
      base route-filter;
      description
        "Route filter that blocks all routes.";
    }

    typedef router-ref {
      type leafref {
        path "/rt:routing/rt:router/rt:name";
      }
      description
        "This type is used for leafs that reference a router
          instance.";
    }

    grouping afn-safi {
      description
        "This grouping provides two parameters specifying address
          family and subsequent address family.";
      leaf address-family {
        type ianaaf:address-family;
        default "ipV4";
        description
          "Address family of routes in the routing table.";
      }

      leaf safi {
        type ianaaf:subsequent-address-family;
        default "nlri-unicast";
        description
          "Subsequent address family identifier of routes in the
            routing table.";
      }
    }  // grouping afn-safi

    grouping route-content {
      description
        "Generic parameters of routes.";
      leaf source-protocol {
        type string;
        description
          "The name of the routing protocol instance from which the
            route comes. This routing protocol must be configured
            (automatically or manually) in the device.";
      }

      leaf last-modified {
        type yang:date-and-time;
        description
          "Time stamp of the last modification of the route. If the
            route was never modified, it is the time when the route was
            inserted to the routing table.";
      }
    }  // grouping route-content

    rpc get-route {
      description
        "Query the forwarding information base of a router instance
          whose name is given as the first parameter 'router-name'. The
          second parameter 'destination-address' should be augmented in
          order to support destination addresses of all supported
          address families. The server returns the route which is
          currently used for forwarding datagrams to that destination
          address, or an error message, if no such route exists.";
      input {
        leaf router-name {
          type router-ref;
          mandatory true;
          description
            "First parameter: name of the router instance whose
              forwarding information base is queried.";
        }

        container destination-address {
          description
            "Second parameter: destination address.

              AFN/SAFI-specific modules must augment this container with
              a leaf named 'address'.
             ";
          uses afn-safi;
        }  // container destination-address
      }

      output {
        container route {
          description
            "Contents of the reply specific for each address family
              should be defined through augmenting.";
          uses afn-safi;

          uses route-content;
        }  // container route
      }
    }  // rpc get-route

    container routing {
      description "Routing parameters.";
      list router {
        key "name";
        description
          "Each list entry is a container for configuration and
            operational state data of a single (logical) router.";
        leaf name {
          type string;
          description
            "The unique router name.";
        }

        leaf description {
          type string;
          description
            "Textual description of the router.";
        }

        leaf enabled {
          type boolean;
          default "true";
          description
            "Enable or disable the router. The default value is 'true',
              which means that the router is enabled.";
        }

        container routing-protocols {
          description
            "Container for the list of configured routing protocol
              instances.";
          list routing-protocol {
            key "name";
            description
              "An instance of a routing protocol.";
            leaf name {
              type string;
              description
                "The name of the routing protocol instance.";
            }

            leaf description {
              type string;
              description
                "Textual description of the routing protocol
                  instance.";
            }

            leaf type {
              type identityref {
                base routing-protocol;
              }
              mandatory true;
              description
                "Type of the routing protocol - an identity derived
                  from the 'routing-protocol' base identity.";
            }

            container connected-routing-tables {
              description
                "Container for connected routing tables.";
              list connected-routing-table {
                key "name";
                description
                  "List of routing tables to which the routing protocol
                    instance is connected. No more than one routing
                    table may be configured for each AFN/SAFI pair.

                    Implementation may provide default routing tables
                    for some AFN/SAFI pairs, which are used if the
                    corresponding entry is not configured.
                   ";
                leaf name {
                  type leafref {
                    path "../../../../../routing-tables/routing-table/name";
                  }
                  description
                    "This must be the name of an existing routing
                      table.";
                }

                leaf import-filter {
                  type leafref {
                    path "../../../../../route-filters/route-filter/name";
                  }
                  description
                    "Reference to a route filter that is used for
                      filtering routes passed from this routing protocol
                      instance to the routing table specified by the
                      'name' sibling node. If this leaf is not present,
                      the behavior is protocol-specific, but typically
                      it means that all routes are accepted.";
                }

                leaf export-filter {
                  type leafref {
                    path "../../../../../route-filters/route-filter/name";
                  }
                  description
                    "Reference to a route filter that is used for
                      filtering routes passed from the routing table
                      specified by the 'name' sibling node to this
                      routing protocol instance. If this leaf is not
                      present, the behavior is protocol-specific -
                      typically it means that all routes are accepted,
                      except for the 'direct' and 'static'
                      pseudo-protocols which accept no routes from any
                      routing table.";
                }
              }  // list connected-routing-table
            }  // container connected-routing-tables
          }  // list routing-protocol
        }  // container routing-protocols

        container route-filters {
          description
            "Container for configured route filters.";
          list route-filter {
            key "name";
            description
              "Route filters are used for filtering and/or manipulating
                routes that are passed between a routing protocol and a
                routing table or vice versa, or between two routing
                tables. It is expected that other modules augment this
                list with contents specific for a particular route
                filter type.";
            leaf name {
              type string;
              description
                "The name of the route filter.";
            }

            leaf description {
              type string;
              description
                "Textual description of the route filter.";
            }

            leaf type {
              type identityref {
                base route-filter;
              }
              default
                "deny-all-route-filter";
              description
                "Type of the route-filter - an identity derived from
                  the 'route-filter' base identity. The default value
                  represents an all-blocking filter.";
            }
          }  // list route-filter
        }  // container route-filters

        container routing-tables {
          description
            "Container for configured routing tables.";
          list routing-table {
            key "name";
            description
              "Each entry represents a routing table identified by the
                'name' key. All routes in a routing table must have the
                same AFN and SAFI.";
            leaf name {
              type string;
              description
                "The name of the routing table.";
            }

            uses afn-safi;

            leaf description {
              type string;
              description
                "Textual description of the routing table.";
            }

            container routes {
              config false;
              description
                "Current contents of the routing table (operational
                  state data).";
              list route {
                description
                  "A routing table entry. It is expected that this data
                    node will be augmented with information specific for
                    routes of each address family.";
                uses route-content;
              }  // list route
            }  // container routes

            list recipient-routing-tables {
              key "recipient-name";
              description
                "A list of routing tables that receive routes from this
                  routing table.";
              leaf recipient-name {
                type leafref {
                  path "../../../routing-table/name";
                }
                description
                  "The name of the recipient routing table.";
              }

              leaf filter {
                type leafref {
                  path "../../../../route-filters/route-filter/name";
                }
                description
                  "A route filter which is applied to the routes passed
                    on to the recipient routing table.";
              }
            }  // list recipient-routing-tables
          }  // list routing-table
        }  // container routing-tables
      }  // list router
    }  // container routing
  }  // module ietf-routing