module ietf-routing {
namespace "urn:ietf:params:xml:ns:yang:ietf-routing";
prefix "rt";
import ietf-yang-types {
prefix "yang";
}
import ietf-inet-types {
prefix "inet";
}
import ietf-interfaces {
prefix "if";
}
import iana-afn-safi {
prefix "ianaaf";
}
organization
"IETF NETMOD (NETCONF Data Modeling Language) Working Group";
contact
"WG Web:
WG List:
WG Chair: David Kessens
WG Chair: Juergen Schoenwaelder
Editor: Ladislav Lhotka
";
description
"This YANG module defines essential components that may be used
for configuring a routing subsystem.
Copyright (c) 2012 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 2012-11-15 {
description
"Initial revision.";
reference
"RFC XXXX: A YANG Data Model for Routing Management";
}
/* Identities */
identity router-type {
description
"Base identity from which router type identities are derived.
It is primarily intended for discriminating among different
types of logical routers or router virtualization.
";
}
identity standard-router {
base router-type;
description
"This identity represents a standard router.";
}
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.";
}
identity allow-all-route-filter {
base route-filter;
description
"Route filter that permits all routes.";
}
/* Type Definitions */
typedef router-ref {
type leafref {
path "/rt:routing/rt:router/rt:name";
}
description
"This type is used for leafs that reference a router
instance.";
}
typedef routing-table-ref {
type leafref {
path "/rt:routing/rt:routing-tables/rt:routing-table/rt:name";
}
description
"This type is used for leafs that reference a routing table.";
}
typedef route-filter-ref {
type leafref {
path "/rt:routing/rt:route-filters/rt:route-filter/rt:name";
}
description
"This type is used for leafs that reference a route filter.";
}
/* Groupings */
grouping afn-safi {
leaf address-family {
type ianaaf:address-family;
mandatory "true";
description
"Address family.";
}
leaf safi {
type ianaaf:subsequent-address-family;
mandatory "true";
description
"Subsequent address family.";
}
description
"This grouping provides two parameters specifying address
family and subsequent address family.";
}
grouping route-content {
description
"Generic parameters of routes.";
leaf outgoing-interface {
type if:interface-ref;
description
"Outgoing interface.";
}
}
/* RPC Methods */
rpc active-route {
description
"Return the active route (or multiple routes, in the case of
multi-path routing) to a destination address.
Parameters
1. 'router-name',
2. 'destination-address'.
If the router instance with 'router-name' doesn't exist, then
this operation SHALL fail with error-tag 'data-missing' and
error-app-tag 'router-not-found'.
If no active route for 'destination-address' exists, no output
is returned - the server SHALL send an containing
a single element .
";
input {
leaf router-name {
type router-ref;
mandatory "true";
description
"Name of the router instance whose forwarding information
base is being queried.";
}
container destination-address {
uses afn-safi;
description
"Network layer destination address.
Address family specific modules MUST augment this
container with a leaf named 'address'.
";
}
}
output {
list route {
uses afn-safi;
uses route-content;
description
"List of active routes.
Route contents specific for each address family is
expected be defined through augmenting.
";
}
}
}
rpc route-count {
description
"Return the current number of routes in a routing table.
Parameters:
1. 'routing-table-name'.
If the routing table with the name specified in
'routing-table-name' doesn't exist, then this operation SHALL
fail with error-tag 'data-missing' and error-app-tag
'routing-table-not-found'.
";
input {
leaf routing-table {
type routing-table-ref;
mandatory "true";
description
"Name of the routing table.";
}
}
output {
leaf number-of-routes {
type uint32;
mandatory "true";
description
"Number of routes in the routing table.";
}
}
}
/* Data Nodes */
container routing {
description
"Routing parameters.";
list router {
key "name";
description
"Each list entry is a container for configuration and state
data of a single (logical) router instance.
";
leaf name {
type string;
description
"An arbitrary name of the router instance.";
}
leaf type {
type identityref {
base router-type;
}
default "rt:standard-router";
description
"This leaf specifies the router type.
It is primarily intended as a means for discriminating
among different types of logical routers, route
virtualization, master-slave arrangements etc., while
keeping all such router instances in the same flat list.
";
}
leaf enabled {
type boolean;
default "true";
description
"Enable/disable the router instance.
If this parameter is false, the parent router instance is
disabled, despite any other configuration that might be
present.
";
}
leaf router-id {
type inet:ipv4-address;
description
"Global router ID in the form of an IPv4 address.
An implementation MAY select a value if this parameter is
not configured.
Routing protocols MAY override this global parameter
inside their configuration.
";
}
leaf description {
type string;
description
"Textual description of the router.";
}
container main-routing-tables {
description
"Main routing tables used by the router instance.";
list main-routing-table {
must "address-family=/routing/routing-tables/"
+ "routing-table[name=current()/name]/"
+ "address-family and safi=/routing/routing-tables/"
+ "routing-table[name=current()/name]/safi" {
error-message "Address family mismatch.";
description
"The entry's address family MUST match that of the
referenced routing table.";
}
key "address-family safi";
description
"Each list entry specifies the main routing table for one
address family.
The main routing table is operationally connected to all
routing protocols for which a connected routing table
has not been explicitly configured.
The 'direct' pseudo-protocol is always connected to the
main routing table.
Address families that don't have their entry in this
list MUST NOT be used in the rest of the router instance
configuration.
";
uses afn-safi;
leaf name {
type routing-table-ref;
description
"Name of an existing routing table to be used as the
main routing table for the given router instance and
address family.";
}
}
}
container interfaces {
description
"Router interface parameters.";
list interface {
key "name";
description
"List of network layer interfaces assigned to the router
instance.";
leaf name {
type if:interface-ref;
description
"A reference to the name of a configured network layer
interface.";
}
}
}
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
"An arbitrary name of the routing protocol instance.";
}
leaf description {
type string;
description
"Textual description of the routing protocol
instance.";
}
leaf enabled {
type boolean;
default "true";
description
"Enable/disable the routing protocol instance.
If this parameter is false, the parent routing
protocol instance is disabled, despite any other
configuration that might be present.
";
}
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 {
must "not(/routing/routing-tables/"
+ "routing-table[name=current()/"
+ "preceding-sibling::connected-routing-table/"
+ "name]/address-family=/routing/routing-tables/"
+ "routing-table[name=current()/name]/"
+ "address-family and /routing/routing-tables/"
+ "routing-table[name=current()/"
+ "preceding-sibling::connected-routing-table/"
+ "name]/safi=/routing/routing-tables/"
+ "routing-table[name=current()/name]/safi)" {
error-message "Duplicate address family for "
+ "connected routing tables.";
description
"For each AFN/SAFI pair there MUST NOT be more than
one connected routing table.";
}
key "name";
description
"List of routing tables to which the routing protocol
instance is connected (at most one routing table per
address family).
If no connected routing table is configured for an
address family, the routing protocol MUST be
operationally connected to the main routing table
for that address family.
";
leaf name {
must "../../../type != 'rt:direct' or "
+ "../../../../../main-routing-tables/ "
+ "main-routing-table/name=." {
error-message "The 'direct' protocol can be "
+ "connected only to a main routing "
+ "table.";
description
"For the 'direct' pseudo-protocol, the connected
routing table must always be a main routing
table.";
}
type routing-table-ref;
description
"Name of an existing routing table.";
}
leaf import-filter {
type route-filter-ref;
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 route-filter-ref;
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.
The 'direct' and 'static' pseudo-protocols accept
no routes from any routing table.
";
}
}
}
container static-routes {
when "../type='rt:static'" {
description
"This container is only valid for the 'static'
routing protocol.";
}
description
"Configuration of 'static' pseudo-protocol.
Address family specific modules augment this node with
their lists of routes.
";
}
}
}
}
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 belong to
the same address family.";
leaf name {
type string;
description
"An arbitrary 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 (state data).";
list route {
description
"A routing table entry. This data node MUST be
augmented with information specific for routes of each
address family.";
uses route-content;
leaf source-protocol {
type string;
mandatory "true";
description
'Routing protocol instance from which the route
originated.
It must be either "direct" or the name of a
configured routing protocol instance.
';
}
leaf last-updated {
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 into the routing table.";
}
}
}
container recipient-routing-tables {
description
"Container for recipient routing tables.";
list recipient-routing-table {
must "name != ../../name" {
error-message "Source and recipient routing tables "
+ "are identical.";
description
"A routing table MUST NOT appear among its recipient
routing tables.";
}
must "/routing/routing-tables/"
+ "routing-table[name=current()/name]/"
+ "address-family=../../address-family and /routing/"
+ "routing-tables/routing-table[name=current()/name]/"
+ "safi=../../safi" {
error-message "Address family mismatch.";
description
"Address family of the recipient routing table MUST
match the source table.";
}
key "name";
description
"List of routing tables that receive routes from this
routing table.";
leaf name {
type routing-table-ref;
description
"The name of the recipient routing table.";
}
leaf filter {
type route-filter-ref;
description
"A route filter which is applied to the routes passed
to the recipient routing table.";
}
}
}
}
}
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
"An arbitrary name of the route filter.";
}
leaf description {
type string;
description
"Textual description of the route filter.";
}
leaf type {
type identityref {
base route-filter;
}
mandatory "true";
description
"Type of the route-filter - an identity derived from the
'route-filter' base identity.";
}
}
}
}
}