netconfcentral logo

ietf-mpls-ldp@2017-10-29



  module ietf-mpls-ldp {

    yang-version 1;

    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-routing {
      prefix rt;
    }
    import ietf-routing-types {
      prefix rt-types;
    }
    import ietf-interfaces {
      prefix if;
    }
    import ietf-ip {
      prefix ip;
    }

    organization "IETF MPLS Working Group";

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

     WG Chair: Loa Andersson
               <mailto:loa@pi.nu>

     WG Chair: Ross Callon
               <mailto:rcallon@juniper.net>

     WG Chair: George Swallow
               <mailto:swallow.ietf@gmail.com>

     Editor:   Kamran Raza
               <mailto:skraza@cisco.com>

     Editor:   Rajiv Asati
               <mailto:rajiva@cisco.com>

     Editor:   Xufeng Liu
               <mailto:Xufeng_Liu@jabil.com>

     Editor:   Santosh Esale
               <mailto:sesale@juniper.net>
     Editor:   Xia Chen
               <mailto:jescia.chenxia@huawei.com>

     Editor:   Himanshu Shah
               <mailto:hshah@ciena.com>";

    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 "2017-10-29" {
      description "Initial revision.";
      reference
        "RFC XXXX: YANG Data Model for MPLS LDP.";

    }


    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" {
            value 0;
            description
              "The duration is infinite.";
          }
        }
      }
      units "seconds";
      description
        "Duration represented as 32 bit seconds with infinite.";
    }

    typedef advertised-received {
      type enumeration {
        enum "advertised" {
          value 0;
          description
            "Advertised information.";
        }
        enum "received" {
          value 1;
          description
            "Received information.";
        }
      }
      description "Received or advertised.";
    }

    typedef downstream-upstream {
      type enumeration {
        enum "downstream" {
          value 0;
          description
            "Downstream information.";
        }
        enum "upstream" {
          value 1;
          description
            "Upstream information.";
        }
      }
      description "Received or advertised.";
    }

    typedef label-adv-mode {
      type enumeration {
        enum "downstream-unsolicited" {
          value 0;
          description
            "Downstream Unsolicited.";
        }
        enum "downstream-on-demand" {
          value 1;
          description
            "Downstream on Demand.";
        }
      }
      description
        "Label Advertisement Mode.";
    }

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

    identity adjacency-flag-base {
      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.";
    }

    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.";
        }
      }  // container hello-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 dropped.";
        }
      }  // container statistics
    }  // grouping adjacency-state-attributes

    grouping basic-discovery-timers {
      description
        "Basic discovery timer attributes.";
      leaf hello-holdtime {
        type uint16 {
          range "15..3600";
        }
        units "seconds";
        default '15';
        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";
        default '5';
        description
          "The interval between consecutive LDP link Hello messages
         used in basic LDP discovery";
      }
    }  // grouping 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 "../../../../../../ldp:peers/ldp:peer/ldp:lsr-id";
        }
        must
          "../advertisement-type = 'received'" {
          description
            "Applicable for received address.";
        }
        description
          "LDP peer from which this address is received.";
      }
    }  // grouping binding-address-state-attributes

    grouping binding-label-state-attributes {
      description "Label binding attributes";
      list peer {
        key "lsr-id advertisement-type";
        description
          "List of advertised and received peers.";
        leaf lsr-id {
          type leafref {
            path
              "../../../../../../../ldp:peers/ldp:peer/"
                + "ldp: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 rt-types:mpls-label;
          description
            "Advertised (outbound) or received (inbound)
           label.";
        }

        leaf used-in-forwarding {
          type boolean;
          description
            "'true' if the lable is used in forwarding.";
        }
      }  // list peer
    }  // grouping 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 {
        description
          "Extended discovery acceptance policies.";
        leaf enable {
          type boolean;
          description
            "'true' to accept; 'false' to deny.";
        }
      }  // container hello-accept
    }  // grouping extended-discovery-policy-attributes

    grouping extended-discovery-timers {
      description
        "Extended discovery timer attributes.";
      leaf hello-holdtime {
        type uint16 {
          range "15..3600";
        }
        units "seconds";
        default '45';
        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";
        default '15';
        description
          "The interval between consecutive LDP targeted Hello
         messages used in extended LDP discovery.";
      }
    }  // grouping extended-discovery-timers

    grouping global-attributes {
      description
        "Configuration attributes at global level.";
      uses instance-attributes;
    }  // grouping 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 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.";
        }
      }  // container graceful-restart
    }  // grouping 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.";
        }
      }  // container graceful-restart
    }  // grouping graceful-restart-attributes-per-peer

    grouping instance-attributes {
      description
        "Configuration attributes at instance level.";
      container capability {
        description "Configure capability.";
      }  // container capability

      uses graceful-restart-attributes;

      leaf lsr-id {
        type yang:dotted-quad;
        description
          "Specify the value to act as the LDP LSR ID.
         If this attribute is not specified, LDP uses the router
         ID as determined by the system.";
      }
    }  // grouping instance-attributes

    grouping ldp-adjacency-ref {
      description
        "An absolute reference to an LDP adjacency.";
      choice hello-adjacency-type {
        description
          "Interface or targeted adjacency.";
        container targeted {
          description "Targeted adjacency.";
          leaf target-address {
            type inet:ip-address;
            description
              "The target address.";
          }
        }  // container targeted
        container link {
          description "Link adjacency.";
          leaf next-hop-interface {
            type if: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.";
          }
        }  // container link
      }  // choice hello-adjacency-type
    }  // grouping ldp-adjacency-ref

    grouping ldp-fec-event {
      description
        "The event attributes for a change of FEC
      (Forwarding Equivalence Class) status.";
      leaf prefix {
        type inet:ip-prefix;
        description
          "The address prefix element of the FEC whose status
         has changed.";
      }
    }  // grouping ldp-fec-event

    grouping ldp-interface-ref {
      description
        "Defining a reference to LDP interface.";
      leaf name {
        type if:interface-ref;
        must
          "(/if:interfaces/if:interface[if:name=current()]/ip:ipv4)"
            + " or "
            + "(/if:interfaces/if:interface[if:name=current()]/ip:ipv6)" {
          description
            "Interface is IPv4 or IPv6.";
        }
        description
          "The name of an LDP interface.";
      }
    }  // grouping ldp-interface-ref

    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.";
      }
    }  // grouping ldp-peer-ref

    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.";
      }
    }  // grouping peer-attributes

    grouping peer-authentication {
      description
        "Peer authentication container.";
      container authentication {
        description
          "Containing authentication information.";
        choice auth-type-selection {
          description
            "Options for expressing authentication setting.";
          leaf md5-key {
            type string;
            description "MD5 Key string.";
          }
        }  // choice auth-type-selection
      }  // container authentication
    }  // grouping peer-authentication

    grouping peer-state-derived {
      description
        "Peer derived state attributes.";
      container label-advertisement-mode {
        config false;
        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.";
        }
      }  // container label-advertisement-mode

      leaf next-keep-alive {
        type uint16;
        units "seconds";
        config false;
        description
          "Time to send the next KeepAlive message.";
      }

      leaf peer-ldp-id {
        type yang:dotted-quad;
        config false;
        description "Peer LDP ID.";
      }

      container received-peer-state {
        config false;
        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 end-of-lib

          container typed-wildcard-fec {
            description
              "Configure typed-wildcard-fec capability.";
            leaf enable {
              type boolean;
              description
                "Enable typed-wildcard-fec capability.";
            }
          }  // container typed-wildcard-fec

          container upstream-label-assignment {
            description
              "Configure upstream label assignment capability.";
            leaf enable {
              type boolean;
              description
                "Enable upstream label assignment.";
            }
          }  // container upstream-label-assignment
        }  // container capability
      }  // container received-peer-state

      container session-holdtime {
        config false;
        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.";
        }
      }  // container session-holdtime

      leaf session-state {
        type enumeration {
          enum "non-existent" {
            value 0;
            description
              "NON EXISTENT state. Transport disconnected.";
          }
          enum "initialized" {
            value 1;
            description "INITIALIZED state.";
          }
          enum "openrec" {
            value 2;
            description "OPENREC state.";
          }
          enum "opensent" {
            value 3;
            description "OPENSENT state.";
          }
          enum "operational" {
            value 4;
            description "OPERATIONAL state.";
          }
        }
        config false;
        description
          "Representing the operational status.";
      }

      container tcp-connection {
        config false;
        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.";
        }
      }  // container tcp-connection

      leaf up-time {
        type string;
        config false;
        description
          "Up time. The interval format in ISO 8601.";
      }

      container statistics {
        config false;
        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 received

        container sent {
          description "Outbound statistics.";
          uses statistics-peer-received-sent;
        }  // container 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.";
        }
      }  // container statistics
    }  // grouping peer-state-derived

    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.";
      }
    }  // grouping statistics-peer-received-sent

    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.";
          uses global-attributes;

          container address-families {
            description
              "Container for address families.";
            container ipv4 {
              presence
                "Present if IPv4 is enabled, unless the 'enable'
               leaf is set to 'false'";
              description
                "IPv4 address family.";
              leaf enable {
                type boolean;
                default 'true';
                description
                  "'true' to enable the address family.";
              }

              leaf label-distribution-controlmode {
                type enumeration {
                  enum "independent" {
                    value 0;
                    description
                      "Independent label distribution control.";
                  }
                  enum "Ordered" {
                    value 1;
                    description
                      "Ordered Label Distribution Control.";
                  }
                }
                config false;
                description
                  "Label distribution control mode.";
                reference
                  "RFC5036: LDP Specification. Sec 2.6.";

              }

              container bindings {
                config false;
                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;
                }  // list 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;
                }  // list fec-label
              }  // container bindings
            }  // container ipv4
          }  // container address-families
        }  // container global

        container discovery {
          description
            "Neibgbor discovery configuration.";
          container interfaces {
            description
              "A list of interfaces for basic descovery.";
            uses basic-discovery-timers;

            list interface {
              key "name";
              description
                "List of LDP interfaces.";
              uses ldp-interface-ref;

              leaf next-hello {
                type uint16;
                units "seconds";
                config false;
                description
                  "Time to send the next hello message.";
              }

              container address-families {
                description
                  "Container for address families.";
                container ipv4 {
                  presence
                    "Present if IPv4 is enabled, unless the 'enable'
                   leaf is set to 'false'";
                  description
                    "IPv4 address family.";
                  leaf enable {
                    type boolean;
                    default 'true';
                    description
                      "Enable the address family on the interface.";
                  }

                  container hello-adjacencies {
                    config false;
                    description
                      "Containing a list of hello adjacencies.";
                    list hello-adjacency {
                      key "adjacent-address";
                      config false;
                      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.";
                      }
                    }  // list hello-adjacency
                  }  // container hello-adjacencies
                }  // container ipv4
              }  // container address-families
            }  // list interface
          }  // container interfaces

          container targeted {
            description
              "A list of targeted neighbors for extended discovery.";
            uses extended-discovery-timers;

            uses extended-discovery-policy-attributes;

            container address-families {
              description
                "Container for address families.";
              container ipv4 {
                presence
                  "Present if IPv4 is enabled.";
                description
                  "IPv4 address family.";
                container hello-adjacencies {
                  config false;
                  description
                    "Containing a list of hello adjacencies.";
                  list hello-adjacency {
                    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.";
                    }
                  }  // list hello-adjacency
                }  // container hello-adjacencies

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

                  leaf enable {
                    type boolean;
                    description
                      "Enable the target.";
                  }

                  leaf local-address {
                    type inet:ipv4-address;
                    description
                      "The local address.";
                  }
                }  // list target
              }  // container ipv4
            }  // container address-families
          }  // container targeted
        }  // container discovery

        container peers {
          description
            "Peers configuration attributes.";
          uses peer-authentication;

          uses peer-attributes;

          list peer {
            key "lsr-id";
            description "List of peers.";
            leaf lsr-id {
              type yang:dotted-quad;
              description "LSR ID.";
            }

            uses peer-authentication;

            container capability {
              description
                "Per peer capability";
            }  // container capability

            container address-families {
              description
                "Per-vrf per-af params.";
              container ipv4 {
                presence
                  "Present if IPv4 is enabled.";
                description
                  "IPv4 address family.";
                container hello-adjacencies {
                  config false;
                  description
                    "Containing a list of hello adjacencies.";
                  list hello-adjacency {
                    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 if:interface-ref;
                      description
                        "Interface for this adjacency.";
                    }
                  }  // list hello-adjacency
                }  // container hello-adjacencies
              }  // container ipv4
            }  // container address-families

            uses peer-state-derived;
          }  // list peer
        }  // container peers
      }  // container mpls-ldp
    }

    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-peer

    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.";
            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";
              }
            }  // container targeted
            container link {
              presence
                "Present to clear link adjacencies.";
              description
                "Clear link adjacencies.";
              leaf next-hop-interface {
                type leafref {
                  path "/rt:routing/rt:control-plane-protocols/mpls-ldp/discovery/interfaces/interface/name";
                }
                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.";
              }
            }  // container link
          }  // choice hello-adjacency-type
        }  // container hello-adjacency
      }
    }  // rpc mpls-ldp-clear-hello-adjacency

    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";
        }
      }
    }  // rpc mpls-ldp-clear-peer-statistics

    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-peer-event

    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-hello-adjacency-event

    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;
    }  // notification mpls-ldp-fec-event
  }  // module ietf-mpls-ldp