module ietf-mpls-ldp {
namespace "urn:ietf:params:xml:ns:yang:ietf-mpls-ldp";
prefix ldp;
import ietf-inet-types {
prefix "inet";
}
import ietf-yang-types {
prefix "yang";
}
import ietf-interfaces {
prefix "if";
}
import ietf-ip {
prefix "ip";
}
import ietf-routing {
prefix "rt";
}
import ietf-mpls {
prefix "mpls";
}
organization
"IETF MPLS Working Group";
contact
"WG Web:
WG List:
WG Chair: Loa Andersson
WG Chair: Ross Callon
WG Chair: George Swallow
Editor: Kamran Raza
Editor: Rajiv Asati
Editor: Xufeng Liu
Editor: Santosh Esale
Editor: Xia Chen
Editor: Himanshu Shah
";
description
"This YANG module defines the essential components for the
management of Multi-Protocol Label Switching (MPLS) Label
Distribution Protocol (LDP). It is also the base model to
be augmented for Multipoint LDP (mLDP).";
revision 2016-11-01 {
description
"Initial revision.";
reference
"RFC XXXX: YANG Data Model for MPLS LDP.";
}
/*
* Features
*/
feature admin-down-config {
description
"This feature indicates that the system allows to configure
administrative down on a VRF instance and a peer.";
}
feature all-af-policy-config {
description
"This feature indicates that the system allows to configure
policies that are applied to all address families.";
}
feature capability-end-of-lib {
description
"This feature indicates that the system allows to configure
LDP end-of-lib capability.";
}
feature capability-typed-wildcard-fec {
description
"This feature indicates that the system allows to configure
LDP typed-wildcard-fec capability.";
}
feature capability-upstream-label-assignment {
description
"This feature indicates that the system allows to configure
LDP upstream label assignment capability.";
}
feature forwarding-nexthop-config {
description
"This feature indicates that the system allows to configure
forwarding nexthop on interfaces.";
}
feature global-session-authentication {
description
"This feature indicates that the system allows to configure
authentication at global level.";
}
feature graceful-restart-helper-mode {
description
"This feature indicates that the system supports graceful
restart helper mode.";
}
feature per-interface-timer-config {
description
"This feature indicates that the system allows to configure
interface hello timers at the per-interface level.";
}
feature per-peer-graceful-restart-config {
description
"This feature indicates that the system allows to configure
graceful restart at the per-peer level.";
}
feature per-peer-session-attributes-config {
description
"This feature indicates that the system allows to configure
session attributes at the per-peer level.";
}
feature policy-extended-discovery-config {
description
"This feature indicates that the system allows to configure
policies to control the acceptance of extended neighbor
discovery hello messages.";
}
feature policy-label-assignment-config {
description
"This feature indicates that the system allows to configure
policies to assign labels according to certain prefixes.";
}
feature policy-ordered-label-config {
description
"This feature indicates that the system allows to configure
ordered label policies.";
}
feature session-downstream-on-demand-config {
description
"This feature indicates that the system allows to configure
session downstream-on-demand";
}
/*
* Typedefs
*/
typedef ldp-address-family {
type identityref {
base rt:address-family;
}
description
"LDP address family type.";
}
typedef duration32-inf {
type union {
type uint32;
type enumeration {
enum "infinite" {
description "The duration is infinite.";
}
}
}
units seconds;
description
"Duration represented as 32 bit seconds with infinite.";
}
typedef advertised-received {
type enumeration {
enum advertised {
description "Advertised information.";
}
enum received {
description "Received information.";
}
}
description
"Received or advertised.";
}
typedef downstream-upstream {
type enumeration {
enum downstream {
description "Downstream information.";
}
enum upstream {
description "Upstream information.";
}
}
description
"Received or advertised.";
}
typedef label-adv-mode {
type enumeration {
enum downstream-unsolicited {
description "Downstream Unsolicited.";
}
enum downstream-on-demand {
description "Downstream on Demand.";
}
}
description
"Label Advertisement Mode.";
}
typedef mpls-interface-ref {
type leafref {
path "/rt:routing/mpls:mpls/mpls:interface/mpls:name";
}
description
"This type is used by data models that need to reference
mpls interfaces.";
}
typedef neighbor-list-ref {
type string;
description
"A type for a reference to a neighbor list.";
}
typedef peer-list-ref {
type string;
description
"A type for a reference to a peer list.";
}
typedef prefix-list-ref {
type string;
description
"A type for a reference to a prefix list.";
}
typedef oper-status-event-type {
type enumeration {
enum up {
value 1;
description
"Operational status changed to up.";
}
enum down {
value 2;
description
"Operational status changed to down.";
}
}
description "Operational status event type for notifications.";
}
/*
* Identities
*/
identity adjacency-flag-base {
description "Base type for adjacency flags.";
}
identity adjacency-flag-active {
base "adjacency-flag-base";
description
"This adjacency is configured and actively created.";
}
identity adjacency-flag-passive {
base "adjacency-flag-base";
description
"This adjacency is not configured and passively accepted.";
}
/*
* Groupings
*/
grouping adjacency-state-attributes {
description
"Adjacency state attributes.";
leaf-list flag {
type identityref {
base "adjacency-flag-base";
}
description "Adjacency flags.";
}
container hello-holdtime {
description "Hello holdtime state.";
leaf adjacent {
type uint16;
units seconds;
description "Peer holdtime.";
}
leaf negotiated {
type uint16;
units seconds;
description "Negotiated holdtime.";
}
leaf remaining {
type uint16;
units seconds;
description "Remaining holdtime.";
}
}
leaf next-hello {
type uint16;
units seconds;
description "Time to send the next hello message.";
}
container statistics {
description
"Statistics objects.";
leaf discontinuity-time {
type yang:date-and-time;
mandatory true;
description
"The time on the most recent occasion at which any one or
more of this interface's counters suffered a
discontinuity. If no such discontinuities have occurred
since the last re-initialization of the local management
subsystem, then this node contains the time the local
management subsystem re-initialized itself.";
}
leaf hello-received {
type yang:counter64;
description
"The number of hello messages received.";
}
leaf hello-dropped {
type yang:counter64;
description
"The number of hello messages received.";
}
} // statistics
} // adjacency-state-attributes
grouping basic-discovery-timers {
description
"Basic discovery timer attributes.";
leaf hello-holdtime {
type uint16 {
range 15..3600;
}
units seconds;
description
"The time interval for which a LDP link Hello adjacency
is maintained in the absence of link Hello messages from
the LDP neighbor";
}
leaf hello-interval {
type uint16 {
range 5..1200;
}
units seconds;
description
"The interval between consecutive LDP link Hello messages
used in basic LDP discovery";
}
} // basic-discovery-timers
grouping binding-address-state-attributes {
description
"Address binding attributes";
leaf advertisement-type {
type advertised-received;
description
"Received or advertised.";
}
leaf peer {
type leafref {
path "../../../../../../../peers/peer/lsr-id";
}
must "../advertisement-type = 'received'" {
description
"Applicable for received address.";
}
description
"LDP peer from which this address is received.";
} // peer
} // binding-address-state-attributes
grouping binding-label-state-attributes {
description
"Label binding attributes";
list peer {
key "peer advertisement-type";
description
"List of advertised and received peers.";
leaf peer {
type leafref {
path "../../../../../../../../peers/peer/lsr-id";
}
description
"LDP peer from which this binding is received,
or to which this binding is advertised.";
}
leaf advertisement-type {
type advertised-received;
description
"Received or advertised.";
}
leaf label {
type mpls:mpls-label;
description
"Advertised (outbound) or received (inbound)
label.";
}
leaf used-in-forwarding {
type boolean;
description
"'true' if the lable is used in forwarding.";
}
} // peer
} // binding-label-state-attributes
grouping extended-discovery-policy-attributes {
description
"LDP policy to control the acceptance of extended neighbor
discovery hello messages.";
container hello-accept {
if-feature policy-extended-discovery-config;
description
"Extended discovery acceptance policies.";
leaf enable {
type boolean;
description
"'true' to accept; 'false' to deny.";
}
leaf neighbor-list {
type neighbor-list-ref;
description
"The name of a peer ACL.";
}
} // hello-accept
} // extended-discovery-policy-attributes
grouping extended-discovery-timers {
description
"Extended discovery timer attributes.";
leaf hello-holdtime {
type uint16 {
range 15..3600;
}
units seconds;
description
"The time interval for which LDP targeted Hello adjacency
is maintained in the absence of targeted Hello messages
from an LDP neighbor.";
}
leaf hello-interval {
type uint16 {
range 5..3600;
}
units seconds;
description
"The interval between consecutive LDP targeted Hello
messages used in extended LDP discovery.";
}
} // extended-discovery-timers
grouping global-attributes {
description "Configuration attributes at global level.";
uses instance-attributes;
} // global-attributes
grouping graceful-restart-attributes {
description
"Graceful restart configuration attributes.";
container graceful-restart {
description
"Attributes for graceful restart.";
leaf enable {
type boolean;
description
"Enable or disable graceful restart.";
}
leaf helper-enable {
if-feature graceful-restart-helper-mode;
type boolean;
description
"Enable or disable graceful restart helper mode.";
}
leaf reconnect-time {
type uint16 {
range 10..1800;
}
units seconds;
description
"Specifies the time interval that the remote LDP peer
must wait for the local LDP peer to reconnect after the
remote peer detects the LDP communication failure.";
}
leaf recovery-time {
type uint16 {
range 30..3600;
}
units seconds;
description
"Specifies the time interval, in seconds, that the remote
LDP peer preserves its MPLS forwarding state after
receiving the Initialization message from the restarted
local LDP peer.";
}
leaf forwarding-holdtime {
type uint16 {
range 30..3600;
}
units seconds;
description
"Specifies the time interval, in seconds, before the
termination of the recovery phase.";
}
} // graceful-restart
} // graceful-restart-attributes
grouping graceful-restart-attributes-per-peer {
description
"Per peer graceful restart configuration attributes.";
container graceful-restart {
description
"Attributes for graceful restart.";
leaf enable {
type boolean;
description
"Enable or disable graceful restart.";
}
leaf reconnect-time {
type uint16 {
range 10..1800;
}
units seconds;
description
"Specifies the time interval that the remote LDP peer
must wait for the local LDP peer to reconnect after the
remote peer detects the LDP communication failure.";
}
leaf recovery-time {
type uint16 {
range 30..3600;
}
units seconds;
description
"Specifies the time interval, in seconds, that the remote
LDP peer preserves its MPLS forwarding state after
receiving the Initialization message from the restarted
local LDP peer.";
}
} // graceful-restart
} // graceful-restart-attributes-per-peer
grouping instance-attributes {
description "Configuration attributes at instance level.";
container capability {
description "Configure capability.";
container end-of-lib {
if-feature capability-end-of-lib;
description
"Configure end-of-lib capability.";
leaf enable {
type boolean;
description
"Enable end-of-lib capability.";
}
}
container typed-wildcard-fec {
if-feature capability-typed-wildcard-fec;
description
"Configure typed-wildcard-fec capability.";
leaf enable {
type boolean;
description
"Enable typed-wildcard-fec capability.";
}
}
container upstream-label-assignment {
if-feature capability-upstream-label-assignment;
description
"Configure upstream label assignment capability.";
leaf enable {
type boolean;
description
"Enable upstream label assignment.";
}
}
} // capability
uses graceful-restart-attributes;
leaf igp-synchronization-delay {
type uint16 {
range 3..60;
}
units seconds;
description
"Sets the interval that the LDP waits before notifying the
Interior Gateway Protocol (IGP) that label exchange is
completed so that IGP can start advertising the normal
metric for the link.";
}
leaf lsr-id {
type yang:dotted-quad;
description "Router ID.";
}
} // instance-attributes
grouping ldp-adjacency-ref {
description
"An absolute reference to an LDP adjacency.";
choice hello-adjacency-type {
description
"Interface or targeted adjacency.";
case targeted {
container targeted {
description "Targeted adjacency.";
leaf target-address {
type inet:ip-address;
description
"The target address.";
}
} // targeted
}
case link {
container link {
description "Link adjacency.";
leaf next-hop-interface {
type mpls-interface-ref;
description
"Interface connecting to next-hop.";
}
leaf next-hop-address {
type inet:ip-address;
must "../next-hop-interface" {
description
"Applicable when interface is specified.";
}
description
"IP address of next-hop.";
}
} // link
}
}
} // ldp-adjacency-ref
grouping ldp-fec-event {
description
"A LDP FEC event.";
leaf prefix {
type inet:ip-prefix;
description
"FEC.";
}
} // ldp-fec-event
grouping ldp-peer-ref {
description
"An absolute reference to an LDP peer.";
leaf peer-ref {
type leafref {
path "/rt:routing/rt:control-plane-protocols/mpls-ldp/"
+ "peers/peer/lsr-id";
}
description
"Reference to an LDP peer.";
}
} // ldp-peer-ref
grouping peer-af-policy-container {
description
"LDP policy attribute container under peer address-family.";
container label-policy {
description
"Label policy attributes.";
container advertise {
description
"Label advertising policies.";
leaf prefix-list {
type prefix-list-ref;
description
"Applies the prefix list to outgoing label
advertisements.";
}
}
container accept {
description
"Label advertisement acceptance policies.";
leaf prefix-list {
type prefix-list-ref;
description
"Applies the prefix list to incoming label
advertisements.";
}
} // accept
} // label-policy
} // peer-af-policy-container
grouping peer-attributes {
description "Peer configuration attributes.";
leaf session-ka-holdtime {
type uint16 {
range 45..3600;
}
units seconds;
description
"The time interval after which an inactive LDP session
terminates and the corresponding TCP session closes.
Inactivity is defined as not receiving LDP packets from the
peer.";
}
leaf session-ka-interval {
type uint16 {
range 15..1200;
}
units seconds;
description
"The interval between successive transmissions of keepalive
packets. Keepalive packets are only sent in the absence of
other LDP packets transmitted over the LDP session.";
}
} // peer-attributes
grouping peer-authentication {
description
"Peer authentication attributes.";
leaf session-authentication-md5-password {
type string {
length "1..80";
}
description
"Assigns an encrypted MD5 password to an LDP
peer";
} // md5-password
} // peer-authentication
grouping peer-state-derived {
description "Peer derived state attributes.";
container label-advertisement-mode {
description "Label advertisement mode state.";
leaf local {
type label-adv-mode;
description
"Local Label Advertisement Mode.";
}
leaf peer {
type label-adv-mode;
description
"Peer Label Advertisement Mode.";
}
leaf negotiated {
type label-adv-mode;
description
"Negotiated Label Advertisement Mode.";
}
}
leaf next-keep-alive {
type uint16;
units seconds;
description "Time to send the next KeepAlive message.";
}
leaf peer-ldp-id {
type yang:dotted-quad;
description "Peer LDP ID.";
}
container received-peer-state {
description "Peer features.";
uses graceful-restart-attributes-per-peer;
container capability {
description "Configure capability.";
container end-of-lib {
description
"Configure end-of-lib capability.";
leaf enable {
type boolean;
description
"Enable end-of-lib capability.";
}
}
container typed-wildcard-fec {
description
"Configure typed-wildcard-fec capability.";
leaf enable {
type boolean;
description
"Enable typed-wildcard-fec capability.";
}
}
container upstream-label-assignment {
description
"Configure upstream label assignment capability.";
leaf enable {
type boolean;
description
"Enable upstream label assignment.";
}
}
} // capability
} // received-peer-state
container session-holdtime {
description "Session holdtime state.";
leaf peer {
type uint16;
units seconds;
description "Peer holdtime.";
}
leaf negotiated {
type uint16;
units seconds;
description "Negotiated holdtime.";
}
leaf remaining {
type uint16;
units seconds;
description "Remaining holdtime.";
}
} // session-holdtime
leaf session-state {
type enumeration {
enum non-existent {
description "NON EXISTENT state. Transport disconnected.";
}
enum initialized {
description "INITIALIZED state.";
}
enum openrec {
description "OPENREC state.";
}
enum opensent {
description "OPENSENT state.";
}
enum operational {
description "OPERATIONAL state.";
}
}
description
"Representing the operational status.";
}
container tcp-connection {
description "TCP connection state.";
leaf local-address {
type inet:ip-address;
description "Local address.";
}
leaf local-port {
type inet:port-number;
description "Local port.";
}
leaf remote-address {
type inet:ip-address;
description "Remote address.";
}
leaf remote-port {
type inet:port-number;
description "Remote port.";
}
} // tcp-connection
leaf up-time {
type string;
description "Up time. The interval format in ISO 8601.";
}
container statistics {
description
"Statistics objects.";
leaf discontinuity-time {
type yang:date-and-time;
mandatory true;
description
"The time on the most recent occasion at which any one or
more of this interface's counters suffered a
discontinuity. If no such discontinuities have occurred
since the last re-initialization of the local management
subsystem, then this node contains the time the local
management subsystem re-initialized itself.";
}
container received {
description "Inbound statistics.";
uses statistics-peer-received-sent;
}
container sent {
description "Outbound statistics.";
uses statistics-peer-received-sent;
}
leaf total-addresses {
type uint32;
description
"The number of learned addresses.";
}
leaf total-labels {
type uint32;
description
"The number of learned labels.";
}
leaf total-fec-label-bindings {
type uint32;
description
"The number of learned label-address bindings.";
}
} // statistics
} // peer-state-derived
grouping policy-container {
description
"LDP policy attributes.";
container label-policy {
description
"Label policy attributes.";
container assign {
if-feature policy-label-assignment-config;
description
"Label assignment policies";
container independent-mode {
description
"Independent label policy attributes.";
leaf prefix-list {
type prefix-list-ref;
description
"Assign labels according to certain prefixes.";
}
} // independent-mode
container ordered-mode {
if-feature policy-ordered-label-config;
description
"Ordered label policy attributes.";
leaf egress-prefix-list {
type prefix-list-ref;
description
"Assign labels according to certain prefixes for
egress LSR.";
}
} // ordered-mode
} // assign
container advertise {
description
"Label advertising policies.";
container egress-explicit-null {
description
"Enables an egress router to advertise an
explicit null label (value 0) in place of an
implicit null label (value 3) to the
penultimate hop router.";
leaf enable {
type boolean;
description
"'true' to enable explicit null.";
}
}
leaf prefix-list {
type prefix-list-ref;
description
"Applies the prefix list to outgoing label
advertisements.";
}
} // advertise
container accept {
description
"Label advertisement acceptance policies.";
leaf prefix-list {
type prefix-list-ref;
description
"Applies the prefix list to incoming label
advertisements.";
}
} // accept
} // label-policy
} // policy-container
grouping statistics-peer-received-sent {
description
"Inbound and outbound statistic counters.";
leaf total-octets {
type yang:counter64;
description
"The total number of octets sent or received.";
}
leaf total-messages {
type yang:counter64;
description
"The number of messages sent or received.";
}
leaf address {
type yang:counter64;
description
"The number of address messages sent or received.";
}
leaf address-withdraw {
type yang:counter64;
description
"The number of address-withdraw messages sent or received.";
}
leaf initialization {
type yang:counter64;
description
"The number of initialization messages sent or received.";
}
leaf keepalive {
type yang:counter64;
description
"The number of keepalive messages sent or received.";
}
leaf label-abort-request {
type yang:counter64;
description
"The number of label-abort-request messages sent or
received.";
}
leaf label-mapping {
type yang:counter64;
description
"The number of label-mapping messages sent or received.";
}
leaf label-release {
type yang:counter64;
description
"The number of label-release messages sent or received.";
}
leaf label-request {
type yang:counter64;
description
"The number of label-request messages sent or received.";
}
leaf label-withdraw {
type yang:counter64;
description
"The number of label-withdraw messages sent or received.";
}
leaf notification {
type yang:counter64;
description
"The number of messages sent or received.";
}
} // statistics-peer-received-sent
/*
* Configuration data nodes
*/
augment "/rt:routing/rt:control-plane-protocols" {
description "LDP augmentation.";
container mpls-ldp {
presence "Container for LDP protocol.";
description
"Container for LDP protocol.";
container global {
description
"Global attributes for LDP.";
container config {
description
"Configuration data.";
uses global-attributes;
}
container state {
config false;
description
"Operational state data.";
uses global-attributes;
}
list address-family {
key "afi";
description
"Per-vrf per-af params.";
leaf afi {
type ldp-address-family;
description
"Address family type value.";
}
container config {
description
"Configuration data.";
leaf enable {
type boolean;
description
"'true' to enable the address family.";
}
uses policy-container;
container ipv4 {
when "../../afi = 'ipv4'" {
description
"Only for IPv4.";
}
description
"IPv4 address family.";
leaf transport-address {
type inet:ipv4-address;
description
"The transport address advertised in LDP Hello
messages.";
}
} // ipv4
container ipv6 {
when "../../afi = 'ipv6'" {
description
"Only for IPv6.";
}
description
"IPv6 address family.";
leaf transport-address {
type inet:ipv6-address;
description
"The transport address advertised in LDP Hello
messages.";
}
} // ipv6
}
container state {
config false;
description
"Operational state data.";
leaf enable {
type boolean;
description
"'true' to enable the address family.";
}
uses policy-container;
container ipv4 {
when "../../afi = 'ipv4'" {
description
"Only for IPv4.";
}
description
"IPv4 address family.";
leaf transport-address {
type inet:ipv4-address;
description
"The transport address advertised in LDP Hello
messages.";
}
container bindings {
description
"LDP address and label binding information.";
list address {
key "address";
description
"List of address bindings.";
leaf address {
type inet:ipv4-address;
description
"Binding address.";
}
uses binding-address-state-attributes;
} // binding-address
list fec-label {
key "fec";
description
"List of label bindings.";
leaf fec {
type inet:ipv4-prefix;
description
"Prefix FEC.";
}
uses binding-label-state-attributes;
} // fec-label
} // binding
} // ipv4
container ipv6 {
when "../../afi = 'ipv6'" {
description
"Only for IPv6.";
}
description
"IPv6 address family.";
leaf transport-address {
type inet:ipv6-address;
description
"The transport address advertised in LDP Hello
messages.";
}
container binding {
description
"LDP address and label binding information.";
list address {
key "address";
description
"List of address bindings.";
leaf address {
type inet:ipv6-address;
description
"Binding address.";
}
uses binding-address-state-attributes;
} // binding-address
list fec-label {
key "fec";
description
"List of label bindings.";
leaf fec {
type inet:ipv6-prefix;
description
"Prefix FEC.";
}
uses binding-label-state-attributes;
} // fec-label
} // binding
} // ipv6
} // state
} // address-family
container discovery {
description
"Neibgbor discovery configuration.";
container interfaces {
description
"A list of interfaces for basic descovery.";
container config {
description
"Configuration data.";
uses basic-discovery-timers;
}
container state {
config false;
description
"Operational state data.";
uses basic-discovery-timers;
}
list interface {
key "interface";
description
"List of LDP interfaces.";
leaf interface {
type mpls-interface-ref;
description
"Interface.";
}
container config {
description
"Configuration data.";
uses basic-discovery-timers {
if-feature per-interface-timer-config;
}
leaf igp-synchronization-delay {
if-feature per-interface-timer-config;
type uint16 {
range 3..60;
}
units seconds;
description
"Sets the interval that the LDP waits before
notifying the Interior Gateway Protocol (IGP)
that label exchange is completed so that IGP
can start advertising the normal metric for
the link.";
}
}
container state {
config false;
description
"Operational state data.";
uses basic-discovery-timers {
if-feature per-interface-timer-config;
}
leaf igp-synchronization-delay {
if-feature per-interface-timer-config;
type uint16 {
range 3..60;
}
units seconds;
description
"Sets the interval that the LDP waits before
notifying the Interior Gateway Protocol (IGP)
that label exchange is completed so that IGP
can start advertising the normal metric for
the link.";
}
leaf next-hello {
type uint16;
units seconds;
description "Time to send the next hello message.";
}
} // state
list address-family {
key "afi";
description
"Per-vrf per-af params.";
leaf afi {
type ldp-address-family;
description
"Address family type value.";
}
container config {
description
"Configuration data.";
leaf enable {
type boolean;
description
"Enable the address family on the interface.";
}
container ipv4 {
must "/if:interfaces/if:interface"
+ "[if:name = current()/../../../interface]/"
+ "ip:ipv4" {
description
"Only if IPv4 is enabled on the interface.";
}
description
"IPv4 address family.";
leaf transport-address {
type union {
type enumeration {
enum "use-interface-address" {
description
"Use interface address as the transport
address.";
}
}
type inet:ipv4-address;
}
description
"IP address to be advertised as the LDP
transport address.";
}
}
container ipv6 {
must "/if:interfaces/if:interface"
+ "[if:name = current()/../../../interface]/"
+ "ip:ipv6" {
description
"Only if IPv6 is enabled on the interface.";
}
description
"IPv6 address family.";
leaf transport-address {
type union {
type enumeration {
enum "use-interface-address" {
description
"Use interface address as the transport
address.";
}
}
type inet:ipv4-address;
}
description
"IP address to be advertised as the LDP
transport address.";
}
} // ipv6
}
container state {
config false;
description
"Operational state data.";
leaf enable {
type boolean;
description
"Enable the address family on the interface.";
}
container ipv4 {
must "/if:interfaces/if:interface"
+ "[if:name = current()/../../../interface]/"
+ "ip:ipv4" {
description
"Only if IPv4 is enabled on the interface.";
}
description
"IPv4 address family.";
leaf transport-address {
type union {
type enumeration {
enum "use-interface-address" {
description
"Use interface address as the transport
address.";
}
}
type inet:ipv4-address;
}
description
"IP address to be advertised as the LDP
transport address.";
}
list hello-adjacencies {
key "adjacent-address";
description "List of hello adjacencies.";
leaf adjacent-address {
type inet:ipv4-address;
description
"Neighbor address of the hello adjacency.";
}
uses adjacency-state-attributes;
leaf peer {
type leafref {
path "../../../../../../../../../peers/peer/"
+ "lsr-id";
}
description
"LDP peer from this adjacency.";
}
} // hello-adjacencies
}
container ipv6 {
must "/if:interfaces/if:interface"
+ "[if:name = current()/../../../interface]/"
+ "ip:ipv6" {
description
"Only if IPv6 is enabled on the interface.";
}
description
"IPv6 address family.";
leaf transport-address {
type union {
type enumeration {
enum "use-interface-address" {
description
"Use interface address as the transport
address.";
}
}
type inet:ipv4-address;
}
description
"IP address to be advertised as the LDP
transport address.";
}
list hello-adjacencies {
key "adjacent-address";
description "List of hello adjacencies.";
leaf adjacent-address {
type inet:ipv6-address;
description
"Neighbor address of the hello adjacency.";
}
uses adjacency-state-attributes;
leaf peer {
type leafref {
path "../../../../../../../../../peers/peer/"
+ "lsr-id";
}
description
"LDP peer from this adjacency.";
}
} // hello-adjacencies
} // ipv6
}
} // address-family
} // list interface
} // interfaces
container targeted
{
description
"A list of targeted neighbors for extended discovery.";
container config {
description
"Configuration data.";
uses extended-discovery-timers;
uses extended-discovery-policy-attributes;
}
container state {
config false;
description
"Operational state data.";
uses extended-discovery-timers;
uses extended-discovery-policy-attributes;
}
list address-family {
key "afi";
description
"Per-af params.";
leaf afi {
type ldp-address-family;
description
"Address family type value.";
}
container state {
config false;
description
"Operational state data.";
container ipv4 {
when "../../afi = 'ipv4'" {
description
"For IPv4.";
}
description
"IPv4 address family.";
list hello-adjacencies {
key "local-address adjacent-address";
description "List of hello adjacencies.";
leaf local-address {
type inet:ipv4-address;
description
"Local address of the hello adjacency.";
}
leaf adjacent-address {
type inet:ipv4-address;
description
"Neighbor address of the hello adjacency.";
}
uses adjacency-state-attributes;
leaf peer {
type leafref {
path "../../../../../../../../peers/peer/"
+ "lsr-id";
}
description
"LDP peer from this adjacency.";
}
} // hello-adjacencies
} // ipv4
container ipv6 {
when "../../afi = 'ipv6'" {
description
"For IPv6.";
}
description
"IPv6 address family.";
list hello-adjacencies {
key "local-address adjacent-address";
description "List of hello adjacencies.";
leaf local-address {
type inet:ipv6-address;
description
"Local address of the hello adjacency.";
}
leaf adjacent-address {
type inet:ipv6-address;
description
"Neighbor address of the hello adjacency.";
}
uses adjacency-state-attributes;
leaf peer {
type leafref {
path "../../../../../../../../peers/peer/"
+ "lsr-id";
}
description
"LDP peer from this adjacency.";
}
} // hello-adjacencies
} // ipv6
} // state
container ipv4 {
when "../afi = 'ipv4'" {
description
"For IPv4.";
}
description
"IPv4 address family.";
list target {
key "adjacent-address";
description
"Targeted discovery params.";
leaf adjacent-address {
type inet:ipv4-address;
description
"Configures a remote LDP neighbor and enables
extended LDP discovery of the specified
neighbor.";
}
container config {
description
"Configuration data.";
leaf enable {
type boolean;
description
"Enable the target.";
}
leaf local-address {
type inet:ipv4-address;
description
"The local address.";
}
}
container state {
config false;
description
"Operational state data.";
leaf enable {
type boolean;
description
"Enable the target.";
}
leaf local-address {
type inet:ipv4-address;
description
"The local address.";
}
} // state
}
} // ipv4
container ipv6 {
when "../afi = 'ipv6'" {
description
"For IPv6.";
}
description
"IPv6 address family.";
list target {
key "adjacent-address";
description
"Targeted discovery params.";
leaf adjacent-address {
type inet:ipv6-address;
description
"Configures a remote LDP neighbor and enables
extended LDP discovery of the specified
neighbor.";
}
container config {
description
"Configuration data.";
leaf enable {
type boolean;
description
"Enable the target.";
}
leaf local-address {
type inet:ipv6-address;
description
"The local address.";
}
}
container state {
config false;
description
"Operational state data.";
leaf enable {
type boolean;
description
"Enable the target.";
}
leaf local-address {
type inet:ipv6-address;
description
"The local address.";
}
} // state
}
} // ipv6
} // address-family
} // targeted
} // discovery
container forwarding-nexthop {
if-feature forwarding-nexthop-config;
description
"Configuration for forwarding nexthop.";
container interfaces {
description
"A list of interfaces on which forwarding is
disabled.";
list interface {
key "interface";
description
"List of LDP interfaces.";
leaf interface {
type mpls-interface-ref;
description
"Interface.";
}
list address-family {
key "afi";
description
"Per-vrf per-af params.";
leaf afi {
type ldp-address-family;
description
"Address family type value.";
}
container config {
description
"Configuration data.";
leaf ldp-disable {
type boolean;
description
"Disable LDP forwarding on the interface.";
}
}
container state {
config false;
description
"Operational state data.";
leaf ldp-disable {
type boolean;
description
"Disable LDP forwarding on the interface.";
}
}
} // address-family
} // list interface
} // interfaces
} // forwarding-nexthop
uses policy-container {
if-feature all-af-policy-config;
}
} // global
container peers {
description
"Peers configuration attributes.";
container config {
description
"Configuration data.";
uses peer-authentication {
if-feature global-session-authentication;
}
uses peer-attributes;
container session-downstream-on-demand {
if-feature session-downstream-on-demand-config;
description
"Session downstream-on-demand attributes.";
leaf enable {
type boolean;
description
"'true' if session downstream-on-demand is enabled.";
}
leaf peer-list {
type peer-list-ref;
description
"The name of a peer ACL.";
}
}
}
container state {
config false;
description
"Operational state data.";
uses peer-authentication {
if-feature global-session-authentication;
}
uses peer-attributes;
container session-downstream-on-demand {
if-feature session-downstream-on-demand-config;
description
"Session downstream-on-demand attributes.";
leaf enable {
type boolean;
description
"'true' if session downstream-on-demand is enabled.";
}
leaf peer-list {
type peer-list-ref;
description
"The name of a peer ACL.";
}
}
}
list peer {
key "lsr-id";
description
"List of peers.";
leaf lsr-id {
type yang:dotted-quad;
description "LSR ID.";
}
container config {
description
"Configuration data.";
leaf admin-down {
type boolean;
default false;
description
"'true' to disable the peer.";
}
container capability {
description
"Per peer capability";
}
uses peer-af-policy-container {
if-feature all-af-policy-config;
}
uses peer-authentication;
uses graceful-restart-attributes-per-peer {
if-feature per-peer-graceful-restart-config;
}
uses peer-attributes {
if-feature per-peer-session-attributes-config;
}
container address-family {
description
"Per-vrf per-af params.";
container ipv4 {
description
"IPv4 address family.";
uses peer-af-policy-container;
}
container ipv6 {
description
"IPv6 address family.";
uses peer-af-policy-container;
} // ipv6
} // address-family
}
container state {
config false;
description
"Operational state data.";
leaf admin-down {
type boolean;
default false;
description
"'true' to disable the peer.";
}
container capability {
description
"Per peer capability";
}
uses peer-af-policy-container {
if-feature all-af-policy-config;
}
uses peer-authentication;
uses graceful-restart-attributes-per-peer {
if-feature per-peer-graceful-restart-config;
}
uses peer-attributes {
if-feature per-peer-session-attributes-config;
}
container address-family {
description
"Per-vrf per-af params.";
container ipv4 {
description
"IPv4 address family.";
uses peer-af-policy-container;
list hello-adjacencies {
key "local-address adjacent-address";
description "List of hello adjacencies.";
leaf local-address {
type inet:ipv4-address;
description
"Local address of the hello adjacency.";
}
leaf adjacent-address {
type inet:ipv4-address;
description
"Neighbor address of the hello adjacency.";
}
uses adjacency-state-attributes;
leaf interface {
type mpls-interface-ref;
description "Interface for this adjacency.";
}
} // hello-adjacencies
} // ipv4
container ipv6 {
description
"IPv6 address family.";
uses peer-af-policy-container;
list hello-adjacencies {
key "local-address adjacent-address";
description "List of hello adjacencies.";
leaf local-address {
type inet:ipv6-address;
description
"Local address of the hello adjacency.";
}
leaf adjacent-address {
type inet:ipv6-address;
description
"Neighbor address of the hello adjacency.";
}
uses adjacency-state-attributes;
leaf interface {
type mpls-interface-ref;
description "Interface for this adjacency.";
}
} // hello-adjacencies
} // ipv6
} // address-family
uses peer-state-derived;
} // state
} // list peer
} // peers
} // container mpls-ldp
}
/*
* RPCs
*/
rpc mpls-ldp-clear-peer {
description
"Clears the session to the peer.";
input {
leaf lsr-id {
type union {
type yang:dotted-quad;
type uint32;
}
description
"LSR ID of peer to be cleared. If this is not provided
then all peers are cleared";
}
}
}
rpc mpls-ldp-clear-hello-adjacency {
description
"Clears the hello adjacency";
input {
container hello-adjacency {
description
"Link adjacency or targettted adjacency. If this is not
provided then all hello adjacencies are cleared";
choice hello-adjacency-type {
description "Adjacency type.";
case targeted {
container targeted {
presence "Present to clear targeted adjacencies.";
description
"Clear targeted adjacencies.";
leaf target-address {
type inet:ip-address;
description
"The target address. If this is not provided then
all targeted adjacencies are cleared";
}
} // targeted
}
case link {
container link {
presence "Present to clear link adjacencies.";
description
"Clear link adjacencies.";
leaf next-hop-interface {
type mpls-interface-ref;
description
"Interface connecting to next-hop. If this is not
provided then all link adjacencies are cleared.";
}
leaf next-hop-address {
type inet:ip-address;
must "../next-hop-interface" {
description
"Applicable when interface is specified.";
}
description
"IP address of next-hop. If this is not provided
then adjacencies to all next-hops on the given
interface are cleared.";
} // next-hop-address
} // link
}
}
}
}
}
rpc mpls-ldp-clear-peer-statistics {
description
"Clears protocol statistics (e.g. sent and received
counters).";
input {
leaf lsr-id {
type union {
type yang:dotted-quad;
type uint32;
}
description
"LSR ID of peer whose statistic are to be cleared.
If this is not provided then all peers statistics are
cleared";
}
}
}
/*
* Notifications
*/
notification mpls-ldp-peer-event {
description
"Notification event for a change of LDP peer operational
status.";
leaf event-type {
type oper-status-event-type;
description "Event type.";
}
uses ldp-peer-ref;
}
notification mpls-ldp-hello-adjacency-event {
description
"Notification event for a change of LDP adjacency operational
status.";
leaf event-type {
type oper-status-event-type;
description "Event type.";
}
uses ldp-adjacency-ref;
}
notification mpls-ldp-fec-event {
description
"Notification event for a change of FEC status.";
leaf event-type {
type oper-status-event-type;
description "Event type.";
}
uses ldp-fec-event;
}
}