module ietf-routing { namespace "urn:ietf:params:xml:ns:yang:ietf-routing"; prefix "rt"; import ietf-yang-types { prefix "yang"; } 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 module contains YANG definitions of 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-02-20 { description "Initial revision."; reference "RFC XXXX: A YANG Data Model for Routing Configuration"; } /* Identities */ 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."; } /* 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."; } /* Groupings */ grouping afn-safi { 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."; } description "This grouping provides two parameters specifying address family and subsequent address family."; } grouping route-content { description "Generic parameters of routes. A module for an address family should define a specific version of this grouping containing 'uses rt:route-content'. "; leaf outgoing-interface { type if:interface-ref; description "Outgoing interface."; } } /* RPC Methods */ 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 { uses afn-safi; description "Second parameter: destination address. AFN/SAFI-specific modules must augment this container with a leaf named 'address'. "; } } output { container route { uses afn-safi; description "Contents of the reply specific for each address family should be defined through augmenting."; } } } /* Data Nodes */ container routing { description "Routing parameters."; list router { key "name"; unique "interfaces/interface/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 interfaces { description "Router interface parameters."; list interface { key "name"; description "List of logical interfaces assigned to the router instance. Any logical interface can only be assigned to one router instance."; leaf name { type if:interface-ref; description "A reference to the name of a configured logical 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 "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 routing-table { must "not(../../../../routing-tables/" + "routing-table[current()/" + "preceding-sibling::routing-table/name]/" + "address-family=../../../../routing-tables/" + "routing-table[current()/name]/" + "address-family and ../../../../routing-tables/" + "routing-table[current()/" + "preceding-sibling::routing-table/name]/safi=../" + "../../../routing-tables/routing-table[current()/" + "name]/safi)" { error-message "Each routing protocol may have no more than one connected routing table for each AFN and SAFI."; description "For each AFN/SAFI pair there may be at most one connected routing table."; } key "name"; description "List of routing tables to which the routing protocol instance is connected. 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 "Reference to 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."; } } } container static-routes { must "../type='static'" { error-message "Static routes may be configured only for 'static' routing protocol."; description "This container is only valid for the 'static' routing protocol."; } description "Configuration of 'static' pseudo-protocol."; } } } 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."; } } } 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. This data node must augmented with information specific for routes of each address family."; leaf source-protocol { type leafref { path "../../../../../routing-protocols/" + "routing-protocol/name"; } 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."; } } } 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."; } } } } } } }