Internet                                                        D. Yeung
Internet-Draft                                                     Y. Qu
Intended status: Informational                             Cisco Systems
Expires: September 10, 2, 2015                                      J. Zhang
                                                           D. Bogdanovic
                                                        Juniper Networks
                                                           K. Sreenivasa
                                           Brocade Communications System
                                                              March 9, 2015

                   Yang Data Model for OSPF Protocol
                        draft-ietf-ospf-yang-00
                        draft-ietf-ospf-yang-01

Abstract

   This document defines a YANG data model that can be used to configure
   and manage OSPF.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on September 10, 2, 2015.

Copyright Notice

   Copyright (c) 2015 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Overview  . . . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Requirements Language . . . . . . . . . . . . . . . . . .   3
   2.  Design of Data Model  . . . . . . . . . . . . . . . . . . . .   3
     2.1.  Overview  . . . . . . . . . . . . . . . . . . . . . . . .   3
     2.2.  OSPFv2 and OSPFv3 . . . . . . . . . . . . . . . . . . . .   5
     2.3.  Optional Features . . . . . . . . . . . . . . . . . . . .   5
     2.4.  Inheritance . . . . . . . . . . . . . . . . . . . . . . .   5
     2.5.  OSPF Router Configuration . . . . . . . . . . . . . . . .   5
     2.6.  OSPF Instance Configuration . . . . . . . . . . . . . . .   6
     2.7.  OSPF Area Configuration . . . . . . . . . . . . . . . . .   8   7
     2.8.  OSPF Interface Configuration  . . . . . . . . . . . . . .  10   9
     2.9.  OSPF notification . . . . . . . . . . . . . . . . . . . .  11
   3.  OSPF Segment Routing  . . . . . . . . . . . . . . . . . . . .  14
   4.  OSPF Yang Module  . . . . . . . . . . . . . . . . . . . . . .  14
   4.  20
   5.  OSPF Segment Routing Yang Module  . . . . . . . . . . . . . .  90
   6.  Security Considerations . . . . . . . . . . . . . . . . . . .  71
   5. 104
   7.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .  72
   6. 104
   8.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  72
     6.1. 104
     8.1.  Normative References  . . . . . . . . . . . . . . . . . .  72
     6.2. 104
     8.2.  Informative References  . . . . . . . . . . . . . . . . .  73 105
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  73 105

1.  Overview

   YANG [RFC6020] is a data definition language that was introduced to
   define the contents of a conceptual data store that allows networked
   devices to be managed using NETCONF [RFC6241].  YANG is proving
   relevant beyond its initial confines, as bindings to other interfaces
   (e.g.  ReST) and encodings other than XML (e.g.  JSON) are being
   defined.  Furthermore, YANG data models can be used as the basis of
   implementation for other interfaces, such as CLI and programmatic
   APIs.

   A core routing data model is defined in
   [I-D.ietf-netmod-routing-cfg], and it proposes a basis for the
   development of data models for routing protocols.  The interface data
   model is defined in [RFC7223] and is used for referencing interface
   from the routing protocol.  The key-chain data model is defined in
   [I-D.acee-rtg-yang-key-chain] and is used for referencing key-chains
   configured for authentication and for the enumeration of
   cryptographic algorithms, also used for authentication.  This
   document defines a YANG data model that can be used to configure and
   manage OSPF and it is an augment to the core routing data model.

   This document defines a YANG data model that can be used to configure
   and manage OSPF.  Both OSPFv2 [RFC2328] and OSPFv3 [RFC5340] are
   supported.  In additional to the core OSPF protocol, features
   described in different separate OSPF RFCs are also supported.  They
   includes demand circuit [RFC1793], traffic engineering [RFC3630],
   multiple address family [RFC5838], graceful restart [RFC3623]
   [RFC5187], NSSA [RFC3101] and sham link [RFC4577].  Those non-core
   features are made optional in the data model provided.

1.1.  Requirements Language

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in [RFC2119].

2.  Design of Data Model

   Although the basis of OSPF configuration elements like routers, areas
   and interfaces remains the same, the detailed configuration model
   varies among different vendors.  Differences are observed in term of
   how protocol engine is tied to routing domain, how multiple protocol
   engines could be instantiated and configuration inheritance, just to
   name a few.

   The goal of this document is to define a data model that is capable
   of representing these differences.  There is very little information
   that is designated as "mandatory", providing freedom to vendors to
   adapt this data model to their product implementation.

2.1.  Overview

   The OSPF YANG module defined in this document has all the common
   building blocks for OSPF protocol.

   The OSPF YANG module augments the routing/routing-instance/routing-
   protocols/routing-protocol path of the ietf-routing module.

   module: ospf
   +--rw routing
    +--rw routing-instance [name]
     +--rw routing-protocols
      +--rw routing-protocol [name]
        +--rw ospf
              .
              .
           +--rw all-instances-inherit {instance-inheritance}?
           |   .
           |   .
           +--rw instance* [routing-instance af]
                 .
                 .
             +--rw all-areas-inherit {area-inheritance}?
                |  . areas
             |  .  +--rw area* [area-id]
             |     .
             |     .
             |     +--rw all-interfaces-inherit {interface-inheritance}?
             |     .
             |     .
             |     +--rw virtual-links
             |     |  +--rw virtual-link* [router-id]
             |     |     .
             |     |     .
             |     +--rw sham-links
             |     |  +--rw sham-link* [local-id remote-id]
             |     |     .
             |     |     .
             |     +--rw interfaces
             |     |  +--rw interface* [interface]
             |     |     .
             |     |     .
             |     .
             |     .
             +--rw topologies
                +--rw topology* [name]

   The ospf is intended to match to the vendor specific OSPF
   configuration construct which is identified by a local identifier
   'name'.  The field 'version' allows support for OSPFv2 and OSPFv3.

   The ospf container includes one or more OSPF protocol engines, each
   encapsulated in the instance entity.  Each instance includes
   information for the routing domain it is running on based on the
   [routing-instance af] specification.  There is no default routing
   domain assumed by the data model.  For example, to enable OSPF on the
   default IPv4 routing domain of the vendor, this model requires an
   explicit instance entity with the specification like ["default"
   "ipv4-unicast"].  The instance also contains OSPF router level
   configuration

   The instance/area and instance/area/interface container contain the
   OSPF configuration for the area and interface level respectively

   The instance/topology container contain the OSPF configuration for
   topology when multi-topology feature is enabled

2.2.  OSPFv2 and OSPFv3

   The defined data model supports both OSPFv2 and OSPFv3.

   The field 'version' is used to indicate the OSPF version and is a
   mandatory.  Based on the version set, the data model change
   accordingly to accommodate the difference between the two versions.

2.3.  Optional Features

   Optional features are features beyond the basic of OSPF
   configurations and it is up to a vendor to decide the support of a
   particular feature on a particular device.

   This module has declared a number of features, such as NSR, max-LSA
   etc..  It is intended that vendors will extend the features list.

2.4.  Inheritance

   This defined data model supports configuration inheritance for
   intances, areas and interfaces.

   The all-instances-inherit, all-areas-inherit and all-interfaces-
   inherit containers provides a consistent way to configure inheritable
   command.  Inheritance is treated as a feature.  Vendors are expected
   to augment the above container to provide the list of inheritance
   command for their implementation.

2.5.  OSPF Router Configuration

   The container ospf is the top level container in this data model.  It
   contains shared information among different OSPF instances under the
   container.

       module: ospf
          +--rw ospf
             +--rw all-instances-inherit {instance-inheritance}?
             |  +--rw area
             |  +--rw interface
             +--rw operation-mode?          identityref
             +--rw instance* [routing-instance af] [af]
                .
                .

2.6.  OSPF Instance Configuration

   The container instance represents an OSPF protocol engine.  Each
   instance indicates the routing domain it is associated with based on
   [routing-instance af] and contains the router level configurations.

   The all-areas-inherit container contains area configuration that
   could be inherited to all OSPF areas defined.  Similarly, the all-
   areas-inherit also contains interface configuration that could be
   inherited to all the OSPF interfaces defined.

   module: ospf

      +--rw ospf
           .
           .
         +--rw instance* [routing-instance af]
            +--rw routing-instance     rt:routing-instance-ref [af]
            +--rw af                   identityref
            +--rw router-id?           yang:dotted-quad {router-id}?
            +--rw admin-distance
            |  +--rw (scope)?
            |     +--:(single-value)
            |     |  +--rw all?          uint8
            |     +--:(multi-values)
            |        +--rw (granularity)?
            |        |  +--:(detail)
            |        |  |  +--rw intra-area?   uint8
            |        |  |  +--rw inter-area?   uint8
            |        |  +--:(coarse)
            |        |     +--rw internal?     uint8
            |        +--rw external?     uint8
            +--rw nsr {nsr}?
            |  +--rw enable?   boolean
            +--rw graceful-restart {graceful-restart}?
            |  +--rw enable?                       boolean
            |  +--rw helper-enable?                boolean
            |  +--rw restart-interval?             uint16
            |  +--rw helper-strict-lsa-checking?   boolean
            +--rw protocol-shutdown {protocol-shutdown}?
            |  +--rw shutdown? enable?              boolean {admin-control}?
            +--rw auto-cost {auto-cost}?
            |  +--rw enable?                boolean
            |  +--rw reference-bandwidth?   uint32
            +--rw maximum spf-control
            |  +--rw paths?   uint16 {max-ecmp}?
            +--rw database-control
            |  +--rw max-lsa?   uint32 {max-lsa}?
            +--rw stub-router {stub-router}?
            |  +--rw (trigger)?
            |     +--:(always)
            |        +--rw always!
            +--rw mpls
            |  +--rw te-rid {te-rid}?
            |  |  +--rw (source)?
            |  |     +--:(interface)
            |  |     |  +--rw interface?   if:interface-ref
            |  |     +--:(explicit)
            |  |        +--rw router-id?   inet:ipv4-address
            |  +--rw ldp
            |     +--rw igp-sync?     boolean {ldp-igp-sync}?
            |     +--rw autoconfig?   boolean {ldp-igp-autoconfig}?
            +--rw fast-reroute {fast-reroute}?
            |  +--rw lfa {lfa}?
            +--rw all-areas-inherit {area-inheritance}?
            |  +--rw area
            |  +--rw interface

2.7.  OSPF Area Configuration

   The container area contains configurations of that area and the list
   of interface container represents all the OSPF interfaces active in
   the enclosing area.

   module: ospf
   +--rw ospf
      .
      .
    +--rw instance* [routing-instance af]
       .
       .
     +--rw areas
     |  +--rw area* [area-id]
     |    +--rw area-id                   area-id-type
     |    +--rw area-type?                identityref
     |    +--rw summary?                  boolean
     |    +--rw default-cost?             uint32
     |    +--rw ranges
     |    |  +--rw range* [prefix]
     |    |     +--rw prefix       inet:ip-prefix
     |    |     +--rw advertise?   boolean
     |    |     +--rw cost?        uint24
     |    +--rw all-interfaces-inherit {interface-inheritance}?
     |    |  +--rw interface
     |    +--rw virtual-links
     |    |  +--rw virtual-link* [router-id]
     |    |     +--rw router-id            yang:dotted-quad
     |    |     +--rw cost?                uint16
     |    |     +--rw hello-interval?      uint16
     |    |     +--rw dead-interval?       uint16
     |    |     +--rw retransmit-interval? uint16
     |    |     +--rw transmit-delay?      uint16
     |    |     +--rw mtu-ignore?          boolean {mtu-ignore}?
     |    |     +--rw lls?                 boolean {lls}?
     |    |     +--rw prefix-suppression?  boolean {prefix-suppression}?
     |    |     +--rw bfd?                 boolean {bfd}?
     |    |     +--rw ttl-security {ttl-security}?
     |    |     |  +--rw enable?   boolean
     |    |     |  +--rw hops?     uint8
     |    |     +--rw protocol-shutdown {protocol-if-shutdown}?
        |  |     +--rw shutdown? enable?                boolean {admin-control}?
     |    |     +--rw authentication
     |    |        +--rw (auth-type-selection)?
     |    |           +--:(auth-ipsec) {ospfv3-authentication-ipsec}?
     |    |           |  +--rw sa?                 string
     |    |           +--:(auth-trailer-key-chain)
     |    |           |  +--rw key-chain?        key-chain:key-chain-ref
     |    |           +--:(auth-trailer-key)
     |    |              +--rw key?              string
     |    |              +--rw crypto-algorithm
     |    |               +--rw (algorithm)?
     |    |                 +--:(hmac-sha1-12)                  +--:(hmac-sha-1-12) {crypto-hmac-sha-1-12}?
     |    |                  |  +--rw hmac-sha1-12?   empty
     |    |                 +--:(hmac-sha1-20)
        |  |                 |  +--rw hmac-sha1-20?   empty
        |  |                  +--:(md5)
     |    |                  |  +--rw md5?            empty
     |    |                  +--:(sha-1)
     |    |                  |  +--rw sha-1?          empty
     |    |                  +--:(hmac-sha-1)
     |    |                  |  +--rw hmac-sha-1?     empty
     |    |                  +--:(hmac-sha-256)
     |    |                  |  +--rw hmac-sha-256?   empty
     |    |                  +--:(hmac-sha-384)
     |    |                  |  +--rw hmac-sha-384?   empty
     |    |                  +--:(hmac-sha-512)
     |    |                     +--rw hmac-sha-512?   empty
     |    +--rw sham-link
     |    |  +--rw sham-link* [local-id remote-id]
     |    |     +--rw local-id             inet:ip-address
     |    |     +--rw remote-id            inet:ip-address
     |    |     +--rw cost?                uint16
     |    |     +--rw hello-interval?      uint16
     |    |     +--rw dead-interval?       uint16
     |    |     +--rw retransmit-interval? uint16
     |    |     +--rw transmit-delay?      uint16
     |    |     +--rw mtu-ignore?          boolean {mtu-ignore}?
     |    |     +--rw lls?                 boolean {lls}?
     |    |     +--rw prefix-suppression?  boolean {prefix-suppression}?
     |    |     +--rw bfd?                 boolean {bfd}?
     |    |     +--rw ttl-security {ttl-security}?
     |    |     |  +--rw enable?   boolean
     |    |     |  +--rw hops?     uint8
     |    |     +--rw protocol-shutdown {protocol-if-shutdown}?
        |  |     +--rw shutdown? enable?                boolean {admin-control}?
     |    |     +--rw authentication
     |    |        +--rw (auth-type-selection)?
     |    |           +--:(auth-ipsec) {ospfv3-authentication-ipsec}?
     |    |           |  +--rw sa?                 string
     |    |           +--:(auth-trailer-key-chain)
     |    |           |  +--rw key-chain?        key-chain:key-chain-ref
     |    |           +--:(auth-trailer-key)
     |    |              +--rw key?              string
     |    |              +--rw crypto-algorithm
     |    |               +--rw (algorithm)?
     |    |                 +--:(hmac-sha1-12)                  +--:(hmac-sha-1-12) {crypto-hmac-sha-1-12}?
     |    |                  |  +--rw hmac-sha1-12?   empty
     |    |                 +--:(hmac-sha1-20)
        |  |                 |  +--rw hmac-sha1-20?   empty
        |  |                  +--:(md5)
     |    |                  |  +--rw md5?            empty
     |    |                  +--:(sha-1)
     |    |                  |  +--rw sha-1?          empty
     |    |                  +--:(hmac-sha-1)
     |    |                  |  +--rw hmac-sha-1?     empty
     |    |                  +--:(hmac-sha-256)
     |    |                  |  +--rw hmac-sha-256?   empty
     |    |                  +--:(hmac-sha-384)
     |    |                  |  +--rw hmac-sha-384?   empty
     |    |                  +--:(hmac-sha-512)
     |    |                     +--rw hmac-sha-512?   empty
        |  +--rw range* [prefix]
        |  |  +--rw prefix       inet:ip-prefix
        |  |  +--rw advertise?   boolean
        |  |  +--rw cost?        uint24
        |  +--rw all-interfaces-inherit {interface-inheritance}?
        |  |  +--rw interface

2.8.  OSPF Interface Configuration

   The container interface contains configurations of that interface.

   The ospf-interfaces also contain interface configuration that could
   be inherited to all ospf-interface's defined.

   module: ospf
   +--rw ospf
       .
       .
    +--rw instance* [routing-instance af]
       .
       .
     +--rw areas
      |  +--rw area* [area-id]
            .
            .
      |     +--rw interfaces
      |      +--rw interface* [interface]
      |         +--rw interface              if:interface-ref
      |         +--rw network-type?          enumeration
      |         +--rw passive?               boolean
      |         +--rw demand-circuit?        boolean {demand-circuit}?
      |         +--rw multi-area multi-areas
      |         |  +--rw multi-area* [multi-area-id] {multi-area-adj}?
      |         |     +--rw multi-area-id? multi-area-id    area-id-type
      |         |     +--rw cost?            uint16
      |         +--rw static-neighbors
      |         |  +--rw neighbor* [address]
      |         |     +--rw address          inet:ip-address
      |         |     +--rw cost?            uint16
      |         |     +--rw poll-interval?   uint16
      |         |     +--rw priority?        uint8
      |         +--rw node-flag?             boolean {node-flag}?
      |         +--rw fast-reroute {fast-reroute}?
      |         |  +--rw lfa {lfa}?
      |         |     +--rw candidate-disabled?   boolean
      |         |     +--rw enabled?              boolean
      |         |     +--rw remote-lfa {remote-lfa}?
      |         |        +--rw enabled?   boolean
      |         +--rw cost?                uint16
      |         +--rw hello-interval?      uint16
      |         +--rw dead-interval?       uint16
      |         +--rw retransmit-interval? uint16
      |         +--rw transmit-delay?      uint16
      |         +--rw mtu-ignore?          boolean {mtu-ignore}?
      |         +--rw lls?                 boolean {lls}?
      |         +--rw prefix-suppression?  boolean {prefix-suppression}?
      |         +--rw bfd?                 boolean {bfd}?
      |         +--rw ttl-security {ttl-security}?
      |         |  +--rw enable?   boolean
      |         |  +--rw hops?     uint8
      |         +--rw protocol-shutdown {protocol-if-shutdown}?
        |     |  +--rw shutdown? enable?                boolean {admin-control}?
      |         +--rw authentication
      |         |  +--rw (auth-type-selection)?
      |         |   +--:(auth-ipsec) {ospfv3-authentication-ipsec}?
      |         |   |  +--rw sa?                 string
      |         |   +--:(auth-trailer-key-chain)
      |         |   |  +--rw key-chain?        key-chain:key-chain-ref
      |         |   +--:(auth-trailer-key)
      |         |      +--rw key?              string
      |         |      +--rw crypto-algorithm
      |         |         +--rw (algorithm)?
      |         |              +--:(hmac-sha1-12)            +--:(hmac-sha-1-12) {crypto-hmac-sha-1-12}?
      |         |            |  +--rw hmac-sha1-12?   empty
      |         |              +--:(hmac-sha1-20)            +--:(md5)
      |         |            |  +--rw hmac-sha1-20?   empty
        |     |              +--:(md5)
        |     |              |  +--rw md5? md5?            empty
      |         |            +--:(sha-1)
      |         |            |  +--rw sha-1?          empty
      |         |            +--:(hmac-sha-1)
      |         |            |  +--rw hmac-sha-1?     empty
      |         |            +--:(hmac-sha-256)
      |         |            |  +--rw hmac-sha-256?   empty
      |         |            +--:(hmac-sha-384)
      |         |            |  +--rw hmac-sha-384?   empty
      |         |            +--:(hmac-sha-512)
      |         |               +--rw hmac-sha-512?   empty
      |         +--rw topologies
      |            +--rw topology* [name]
      |               +--rw name    rt:rib-ref    leafref
      |               +--rw cost?   uint32

2.9.  OSPF notification

   This YANG model defines a list of notifications to inform client of
   important events detected during the protocol operation.  The
   notifications defined cover the common set of traps from OSPFv2 MIB
   [RFC4750] and OSPFv3 MIB [RFC5643].

   module: ospf
   notifications:
      +---n if-state-change
      |  +--ro routing-instance?        rt:routing-instance-ref
      |  +--ro routing-protocol-name?   string routing-protocol-type?   leafref
      |  +--ro instance-af
      | routing-protocol-name?   leafref
      |  +--ro af?   identityref                      leafref
      |  +--ro link-type?               identityref
      |  +--ro interface
      |  |  +--ro interface?   if:interface-ref
      |  +--ro virtual-link
      |  |  +--ro area-id?              uint32
      |  |  +--ro neighbor-router-id?   yang:dotted-quad
      |  +--ro sham-link
      |  |  +--ro area-id?          uint32
      |  |  +--ro local-ip-addr?    inet:ip-address
      |  |  +--ro remote-ip-addr?   inet:ip-address
      |  +--ro state?                   if-state-type
      +---n if-config-error
      |  +--ro routing-instance?        rt:routing-instance-ref
      |  +--ro routing-protocol-name?   string routing-protocol-type?   leafref
      |  +--ro instance-af
      | routing-protocol-name?   leafref
      |  +--ro af?   identityref                      leafref
      |  +--ro link-type?               identityref
      |  +--ro interface
      |  |  +--ro interface?       if:interface-ref
      |  |  +--ro packet-source?   yang:dotted-quad
      |  +--ro virtual-link
      |  |  +--ro area-id?              uint32
      |  |  +--ro neighbor-router-id?   yang:dotted-quad
      |  +--ro sham-link
      |  |  +--ro area-id?          uint32
      |  |  +--ro local-ip-addr?    inet:ip-address
      |  |  +--ro remote-ip-addr?   inet:ip-address
      |  +--ro packet-type?             packet-type
      |  +--ro error?                   enumeration
      +---n nbr-state-change
      |  +--ro routing-instance?        rt:routing-instance-ref
      |  +--ro routing-protocol-name?   string routing-protocol-type?   leafref
      |  +--ro instance-af
      | routing-protocol-name?   leafref
      |  +--ro af?   identityref                      leafref
      |  +--ro link-type?               identityref
      |  +--ro interface
      |  |  +--ro interface?            if:interface-ref
      |  |  +--ro neighbor-router-id?   yang:dotted-quad
      |  |  +--ro neighbor-ip-addr?     yang:dotted-quad
      |  +--ro virtual-link
      |  |  +--ro area-id?              uint32
      |  |  +--ro neighbor-router-id?   yang:dotted-quad
      |  +--ro sham-link
      |  |  +--ro area-id?              uint32
      |  |  +--ro local-ip-addr?        inet:ip-address
      |  |  +--ro neighbor-router-id?   yang:dotted-quad
      |  |  +--ro neighbor-ip-addr?     yang:dotted-quad
      |  +--ro state?                   nbr-state-type
      +---n nbr-restart-helper-status-change
      |  +--ro routing-instance?        rt:routing-instance-ref
      |  +--ro routing-protocol-name?   string routing-protocol-type?   leafref
      |  +--ro instance-af
      | routing-protocol-name?   leafref
      |  +--ro af?   identityref                      leafref
      |  +--ro link-type?               identityref
      |  +--ro interface
      |  |  +--ro interface?            if:interface-ref
      |  |  +--ro neighbor-router-id?   yang:dotted-quad
      |  |  +--ro neighbor-ip-addr?     yang:dotted-quad
      |  +--ro virtual-link
      |  |  +--ro area-id?              uint32
      |  |  +--ro neighbor-router-id?   yang:dotted-quad
      |  +--ro status?                  restart-helper-status-type
      |  +--ro age?                     uint32
      |  +--ro exit-reason?             restart-exit-reason-type
      +---n rx-bad-packet
      |  +--ro routing-instance?        rt:routing-instance-ref
      |  +--ro routing-protocol-name?   string routing-protocol-type?   leafref
      |  +--ro instance-af
      | routing-protocol-name?   leafref
      |  +--ro af?   identityref                      leafref
      |  +--ro link-type?               identityref
      |  +--ro interface
      |  |  +--ro interface?       if:interface-ref
      |  |  +--ro packet-source?   yang:dotted-quad
      |  +--ro virtual-link
      |  |  +--ro area-id?              uint32
      |  |  +--ro neighbor-router-id?   yang:dotted-quad
      |  +--ro sham-link
      |  |  +--ro area-id?          uint32
      |  |  +--ro local-ip-addr?    inet:ip-address
      |  |  +--ro remote-ip-addr?   inet:ip-address
      |  +--ro packet-type?             packet-type
      +---n lsdb-approaching-overflow
      |  +--ro routing-instance?        rt:routing-instance-ref
      |  +--ro routing-protocol-name?   string routing-protocol-type?   leafref
      |  +--ro instance-af
      | routing-protocol-name?   leafref
      |  +--ro af?   identityref                      leafref
      |  +--ro ext-lsdb-limit?          uint32
      +---n lsdb-overflow
      |  +--ro routing-instance?        rt:routing-instance-ref
      |  +--ro routing-protocol-name?   string routing-protocol-type?   leafref
      |  +--ro instance-af
      | routing-protocol-name?   leafref
      |  +--ro af?   identityref                      leafref
      |  +--ro ext-lsdb-limit?          uint32
      +---n nssa-translator-status-change
      |  +--ro routing-instance?        rt:routing-instance-ref
      |  +--ro routing-protocol-name?   string routing-protocol-type?   leafref
      |  +--ro instance-af
      | routing-protocol-name?   leafref
      |  +--ro af?   identityref                      leafref
      |  +--ro area-id?                 uint32
      |  +--ro status?                  nssa-translator-state-type
      +---n restart-status-change
         +--ro routing-instance?        rt:routing-instance-ref
         +--ro routing-protocol-name?   string routing-protocol-type?   leafref
         +--ro instance-af
         | routing-protocol-name?   leafref
         +--ro af?   identityref                      leafref
         +--ro status?                  restart-status-type
         +--ro restart-interval?        uint16
         +--ro exit-reason?             restart-exit-reason-type

3.  OSPF Yang Module

   <CODE BEGINS>
   module ietf-ospf {
     namespace "urn:ietf:params:xml:ns:yang:ietf-ospf";

     prefix ospf;

     import ietf-inet-types {
       prefix "inet";
     }

     import ietf-yang-types {
       prefix "yang";
     }

     import ietf-interfaces {
       prefix "if";
     }

     import ietf-routing {
       prefix "rt";
     }

     import ietf-key-chain {
       prefix "key-chain";
     }
     organization
       "Cisco Systems
        170 West Tasman Drive
        San Jose, CA 95134-1706
        USA";

     contact
       "Derek Yeung myeung@cisco.com
        Yingzhen Qu yiqu@cisco.com
        Dean Bogdanovic deanb@juniper.net
        Jeffrey Zhang zzhang@juniper.net
        Kiran Agrahara Sreenivasa kkoushik@Brocade.com";

     description
       "This Segment Routing

   In additional to the OSPF base YANG module model, this document also defines the generic configuration
        data
   a model for OSPF, which is common across all of the vendor
        implementations of the protocol. It is intended that the module
        will be extended by vendors to define vendor-specific OSPF configuration parameters and policies,
        for example route maps or route policies.

        Terms and Acronyms segment routing.

   The OSPF (ospf): Open Shortest Path First

        IP (ip): Internet Protocol

        IPv4 (ipv4):Internet Protocol Version 4

        IPv6 (ipv6): Internet Protocol Version 6

        MTU (mtu) Maximum Transmission Unit
       ";

     revision 2015-03-09 {
       description
         "Initial revision.";
       reference
         "RFC XXXX: A SR YANG Data Model for OSPF";
     }

     identity ospf {
       base "rt:routing-protocol";
       description "OSPF Protocol";
     }

     identity ospfv2 {
       base "ospf";
       description "OSPFv2";
     }

     identity ospfv3 { module requires the base "ospf";
       description "OSPFv3";
     }

     identity operation-mode {
       description
         "OSPF operation segment routing module
   [I-D.litkowski-spring-sr-yang] to be supported as there is a strong
   relationship between those modules.

   module: ietf-ospf-sr
   augment /rt:routing/rt:routing-instance/rt:routing-protocols/
            rt:routing-protocol/ospf:ospf/ospf:instance:
      +--rw segment-routing
         +--rw enabled?    boolean
         +--rw bindings
            +--rw advertise
            |  +--rw policies*   string
            +--rw receive?     boolean
   augment /rt:routing/rt:routing-instance/rt:routing-protocols/
            rt:routing-protocol/ospf:ospf/ospf:instance/ospf:areas/
            ospf:area/ospf:interfaces/ospf:interface:
      +--rw segment-routing
         +--rw adjacency-sid
            +--rw advertise-adj-group-sid* [group-id]
            |  +--rw group-id    uint32
            +--rw advertise-protection?      enumeration
   augment /rt:routing/rt:routing-instance/rt:routing-protocols/
            rt:routing-protocol/ospf:ospf/ospf:instance/ospf:areas/
            ospf:area/ospf:interfaces/ospf:interface/ospf:fast-reroute:
      +--rw ti-lfa {ti-lfa}?
         +--rw enable?   boolean
   augment /rt:routing-state/rt:routing-instance/rt:routing-protocols/
            rt:routing-protocol/ospf:ospf/ospf:instance:
      +--ro segment-routing
         +--ro enabled?    boolean
         +--ro bindings
            +--ro advertise
            |  +--ro policies*   string
            +--ro receive?     boolean
   augment /rt:routing-state/rt:routing-instance/rt:routing-protocols/
            rt:routing-protocol/ospf:ospf/ospf:instance/ospf:areas/
            ospf:area/ospf:interfaces/ospf:interface:

      +--ro segment-routing
         +--ro adjacency-sid
            +--ro advertise-adj-group-sid* [group-id]
            |  +--ro group-id    uint32
            +--ro advertise-protection?      enumeration
   augment /rt:routing-state/rt:routing-instance/rt:routing-protocols/
            rt:routing-protocol/ospf:ospf/ospf:instance/ospf:areas/
            ospf:area/ospf:interfaces/ospf:interface/ospf:database/
            ospf:link-scope-lsa-type/ospf:link-scope-lsas/
            ospf:link-scope-lsa/ospf:version/ospf:ospfv2/ospf:ospfv2/
            ospf:body/ospf:opaque/ospf:extended-prefix-tlvs/
            ospf:extended-prefix-tlv:
      +--ro perfix-sid-sub-tlvs
      |  +--ro prefix-sid-sub-tlv*
      |     +--ro flags?       bits
      |     +--ro mt-id?       uint8
      |     +--ro algorithm?   uint8
      |     +--ro sid?         uint32
      +--ro sid-binding-sub-tlvs
         +--ro sid-binding-sub-tlv*
            +--ro flags?                           bits
            +--ro mt-id?                           uint8
            +--ro weight?                          uint8
            +--ro sid-sub-tlv
            |  +--ro sid?   uint32
            +--ro ero-metric-sub-tlv
            |  +--ro metric?   uint32
            +--ro ipv4-ero-sub-tlv
            |  +--ro flags?          bits
            |  +--ro ipv4-address?   inet:ipv4-address
            +--ro unnumbered-ero-sub-tlv
            |  +--ro flags?          bits
            |  +--ro router-id?      yang:dotted-quad
            |  +--ro interface-id?   uint32
            +--ro ipv4-backup-ero-sub-tlv
            |  +--ro flags?          bits
            |  +--ro ipv4-address?   inet:ipv4-address
            +--ro unnumbered-backup-ero-sub-tlv
               +--ro flags?          bits
               +--ro router-id?      yang:dotted-quad
               +--ro interface-id?   uint32
   augment /rt:routing-state/rt:routing-instance/rt:routing-protocols/
            rt:routing-protocol/ospf:ospf/ospf:instance/ospf:areas/
            ospf:area/ospf:database/ospf:area-scope-lsa-type/
            ospf:area-scope-lsas/ospf:area-scope-lsa/ospf:version/
            ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:opaque/
            ospf:extended-prefix-tlvs/ospf:extended-prefix-tlv:
      +--ro perfix-sid-sub-tlvs
      |  +--ro prefix-sid-sub-tlv*
      |     +--ro flags?       bits
      |     +--ro mt-id?       uint8
      |     +--ro algorithm?   uint8
      |     +--ro sid?         uint32
      +--ro sid-binding-sub-tlvs
         +--ro sid-binding-sub-tlv*
            +--ro flags?                           bits
            +--ro mt-id?                           uint8
            +--ro weight?                          uint8
            +--ro sid-sub-tlv
            |  +--ro sid?   uint32
            +--ro ero-metric-sub-tlv
            |  +--ro metric?   uint32
            +--ro ipv4-ero-sub-tlv
            |  +--ro flags?          bits
            |  +--ro ipv4-address?   inet:ipv4-address
            +--ro unnumbered-ero-sub-tlv
            |  +--ro flags?          bits
            |  +--ro router-id?      yang:dotted-quad
            |  +--ro interface-id?   uint32
            +--ro ipv4-backup-ero-sub-tlv
            |  +--ro flags?          bits
            |  +--ro ipv4-address?   inet:ipv4-address
            +--ro unnumbered-backup-ero-sub-tlv
               +--ro flags?          bits
               +--ro router-id?      yang:dotted-quad
               +--ro interface-id?   uint32
   augment /rt:routing-state/rt:routing-instance/rt:routing-protocols/
            rt:routing-protocol/ospf:ospf/ospf:instance/ospf:database/
            ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa/
            ospf:version/ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:opaque/
            ospf:extended-prefix-tlvs/ospf:extended-prefix-tlv:
      +--ro perfix-sid-sub-tlvs
      |  +--ro prefix-sid-sub-tlv*
      |     +--ro flags?       bits
      |     +--ro mt-id?       uint8
      |     +--ro algorithm?   uint8
      |     +--ro sid?         uint32
      +--ro sid-binding-sub-tlvs
         +--ro sid-binding-sub-tlv*
            +--ro flags?                           bits
            +--ro mt-id?                           uint8
            +--ro weight?                          uint8
            +--ro sid-sub-tlv
            |  +--ro sid?   uint32
            +--ro ero-metric-sub-tlv
            |  +--ro metric?   uint32
            +--ro ipv4-ero-sub-tlv
            |  +--ro flags?          bits
            |  +--ro ipv4-address?   inet:ipv4-address
            +--ro unnumbered-ero-sub-tlv
            |  +--ro flags?          bits
            |  +--ro router-id?      yang:dotted-quad
            |  +--ro interface-id?   uint32
            +--ro ipv4-backup-ero-sub-tlv
            |  +--ro flags?          bits
            |  +--ro ipv4-address?   inet:ipv4-address
            +--ro unnumbered-backup-ero-sub-tlv
               +--ro flags?          bits
               +--ro router-id?      yang:dotted-quad
               +--ro interface-id?   uint32
   augment /rt:routing-state/rt:routing-instance/rt:routing-protocols/
            rt:routing-protocol/ospf:ospf/ospf:instance/ospf:areas/
            ospf:area/ospf:database/ospf:area-scope-lsa-type/
            ospf:area-scope-lsas/ospf:area-scope-lsa/ospf:version/
            ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:opaque/
            ospf:extended-link-tlvs/ospf:extended-link-tlv:
      +--ro adj-sid-sub-tlvs
      |  +--ro adj-sid-sub-tlv*
      |     +--ro flags?    bits
      |     +--ro mt-id?    uint8
      |     +--ro weight?   uint8
      |     +--ro sid?      uint32
      +--ro lan-adj-sid-sub-tlvs
         +--ro lan-adj-sid-sub-tlv*
            +--ro flags?                bits
            +--ro mt-id?                uint8
            +--ro weight?               uint8
            +--ro neighbor-router-id?   yang:dotted-quad
            +--ro sid?                  uint32
   augment /rt:routing-state/rt:routing-instance/rt:routing-protocols/
            rt:routing-protocol/ospf:ospf/ospf:instance/
            ospf:areas/ospf:area/ospf:interfaces/ospf:interface/
            ospf:database/ospf:link-scope-lsa-type/
            ospf:link-scope-lsas/ospf:link-scope-lsa/ospf:version/
            ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:opaque:
      +--ro extended-prefix-range-tlvs
      |  +--ro extended-prefix-range-tlv*
      |     +--ro range-size?             uint16
      |     +--ro flags?                  bits
      |     +--ro prefix?                 inet:ip-prefix
      |     +--ro perfix-sid-sub-tlvs
      |     |  +--ro prefix-sid-sub-tlv*
      |     |     +--ro flags?       bits
      |     |     +--ro mt-id?       uint8
      |     |     +--ro algorithm?   uint8
      |     |     +--ro sid?         uint32
      |     +--ro sid-binding-sub-tlvs
      |     |  +--ro sid-binding-sub-tlv*
      |     |     +--ro flags?                           bits
      |     |     +--ro mt-id?                           uint8
      |     |     +--ro weight?                          uint8
      |     |     +--ro sid-sub-tlv
      |     |     |  +--ro sid?   uint32
      |     |     +--ro ero-metric-sub-tlv
      |     |     |  +--ro metric?   uint32
      |     |     +--ro ipv4-ero-sub-tlv
      |     |     |  +--ro flags?          bits
      |     |     |  +--ro ipv4-address?   inet:ipv4-address
      |     |     +--ro unnumbered-ero-sub-tlv
      |     |     |  +--ro flags?          bits
      |     |     |  +--ro router-id?      yang:dotted-quad
      |     |     |  +--ro interface-id?   uint32
      |     |     +--ro ipv4-backup-ero-sub-tlv
      |     |     |  +--ro flags?          bits
      |     |     |  +--ro ipv4-address?   inet:ipv4-address
      |     |     +--ro unnumbered-backup-ero-sub-tlv
      |     |        +--ro flags?          bits
      |     |        +--ro router-id?      yang:dotted-quad
      |     |        +--ro interface-id?   uint32
      |     +--ro unknown-tlvs
      |        +--ro unknown-tlv*
      |           +--ro type?     uint16
      |           +--ro length?   uint16
      |           +--ro value?    yang:hex-string
      +--ro sr-algorithm-tlv
      |  +--ro sr-algorithm*   uint8
      +--ro sid-range-tlvs
         +--ro sid-range-tlv*
            +--ro range-size?    ospf:uint24
            +--ro sid-sub-tlv
               +--ro sid?   uint32
   augment /rt:routing-state/rt:routing-instance/rt:routing-protocols/
            rt:routing-protocol/ospf:ospf/ospf:instance/ospf:areas/
            ospf:area/ospf:database/ospf:area-scope-lsa-type/
            ospf:area-scope-lsas/ospf:area-scope-lsa/ospf:version/
            ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:opaque:
      +--ro extended-prefix-range-tlvs
      |  +--ro extended-prefix-range-tlv*
      |     +--ro range-size?             uint16
      |     +--ro flags?                  bits
      |     +--ro prefix?                 inet:ip-prefix
      |     +--ro perfix-sid-sub-tlvs
      |     |  +--ro prefix-sid-sub-tlv*
      |     |     +--ro flags?       bits
      |     |     +--ro mt-id?       uint8
      |     |     +--ro algorithm?   uint8
      |     |     +--ro sid?         uint32
      |     +--ro sid-binding-sub-tlvs
      |     |  +--ro sid-binding-sub-tlv*
      |     |     +--ro flags?                           bits
      |     |     +--ro mt-id?                           uint8
      |     |     +--ro weight?                          uint8
      |     |     +--ro sid-sub-tlv
      |     |     |  +--ro sid?   uint32
      |     |     +--ro ero-metric-sub-tlv
      |     |     |  +--ro metric?   uint32
      |     |     +--ro ipv4-ero-sub-tlv
      |     |     |  +--ro flags?          bits
      |     |     |  +--ro ipv4-address?   inet:ipv4-address
      |     |     +--ro unnumbered-ero-sub-tlv
      |     |     |  +--ro flags?          bits
      |     |     |  +--ro router-id?      yang:dotted-quad
      |     |     |  +--ro interface-id?   uint32
      |     |     +--ro ipv4-backup-ero-sub-tlv
      |     |     |  +--ro flags?          bits
      |     |     |  +--ro ipv4-address?   inet:ipv4-address
      |     |     +--ro unnumbered-backup-ero-sub-tlv
      |     |        +--ro flags?          bits
      |     |        +--ro router-id?      yang:dotted-quad
      |     |        +--ro interface-id?   uint32
      |     +--ro unknown-tlvs
      |        +--ro unknown-tlv*
      |           +--ro type?     uint16
      |           +--ro length?   uint16
      |           +--ro value?    yang:hex-string
      +--ro sr-algorithm-tlv
      |  +--ro sr-algorithm*   uint8
      +--ro sid-range-tlvs
         +--ro sid-range-tlv*
            +--ro range-size?    ospf:uint24
            +--ro sid-sub-tlv
               +--ro sid?   uint32
   augment /rt:routing-state/rt:routing-instance/rt:routing-protocols/'
            rt:routing-protocol/ospf:ospf/ospf:instance/ospf:database/
            ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa/
            ospf:version/ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:opaque:
      +--ro extended-prefix-range-tlvs
      |  +--ro extended-prefix-range-tlv*
      |     +--ro range-size?             uint16
      |     +--ro flags?                  bits
      |     +--ro prefix?                 inet:ip-prefix
      |     +--ro perfix-sid-sub-tlvs
      |     |  +--ro prefix-sid-sub-tlv*
      |     |     +--ro flags?       bits
      |     |     +--ro mt-id?       uint8
      |     |     +--ro algorithm?   uint8
      |     |     +--ro sid?         uint32
      |     +--ro sid-binding-sub-tlvs
      |     |  +--ro sid-binding-sub-tlv*
      |     |     +--ro flags?                           bits
      |     |     +--ro mt-id?                           uint8
      |     |     +--ro weight?                          uint8
      |     |     +--ro sid-sub-tlv
      |     |     |  +--ro sid?   uint32
      |     |     +--ro ero-metric-sub-tlv
      |     |     |  +--ro metric?   uint32
      |     |     +--ro ipv4-ero-sub-tlv
      |     |     |  +--ro flags?          bits
      |     |     |  +--ro ipv4-address?   inet:ipv4-address
      |     |     +--ro unnumbered-ero-sub-tlv
      |     |     |  +--ro flags?          bits
      |     |     |  +--ro router-id?      yang:dotted-quad
      |     |     |  +--ro interface-id?   uint32
      |     |     +--ro ipv4-backup-ero-sub-tlv
      |     |     |  +--ro flags?          bits
      |     |     |  +--ro ipv4-address?   inet:ipv4-address
      |     |     +--ro unnumbered-backup-ero-sub-tlv
      |     |        +--ro flags?          bits
      |     |        +--ro router-id?      yang:dotted-quad
      |     |        +--ro interface-id?   uint32
      |     +--ro unknown-tlvs
      |        +--ro unknown-tlv*
      |           +--ro type?     uint16
      |           +--ro length?   uint16
      |           +--ro value?    yang:hex-string
      +--ro sr-algorithm-tlv
      |  +--ro sr-algorithm*   uint8
      +--ro sid-range-tlvs
         +--ro sid-range-tlv*
            +--ro range-size?    ospf:uint24
            +--ro sid-sub-tlv
               +--ro sid?   uint32

4.  OSPF Yang Module

   <CODE BEGINS> file "ietf-ospf@2015-07-06.yang"
   module ietf-ospf {
     namespace "urn:ietf:params:xml:ns:yang:ietf-ospf";
     prefix ospf;

     import ietf-inet-types {
       prefix "inet";
     }

     import ietf-yang-types {
       prefix "yang";
     }

     import ietf-interfaces {
       prefix "if";
     }

     import ietf-routing {
       prefix "rt";
     }

     import ietf-key-chain {
       prefix "key-chain";
     }

     organization
       "Cisco Systems
        170 West Tasman Drive
        San Jose, CA 95134-1706
        USA";

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

         WG Chair: Acee Lindem
                   <mailto:acee@cisco.com>

         WG Chair: Abhay Roy
                   <mailto:akr@cisco.com>

         Editor:   Derek Yeung
                   <mailto:myeung@cisco.com>
         Author:   Derek Yeung
                   <mailto:myeung@cisco.com>
         Author:   Yingzhen Qu
                   <mailto:yiqu@cisco.com>
         Author:   Jeffrey Zhang
                   <mailto:zzhang@juniper.net>
         Author:   Dean Bogdanovic
                   <mailto:deanb@juniper.net>

         Author:   Kiran Agrahara Sreenivasa
                   <mailto:kkoushik@Brocade.com>";

     description
       "This YANG module defines the generic configuration
        data for OSPF, which is common across all of the vendor
        implementations of the protocol. It is intended that the module
        will be extended by vendors to define vendor-specific
        OSPF configuration parameters and policies,
        for example route maps or route policies.

        Terms and Acronyms

        OSPF (ospf): Open Shortest Path First

        IP (ip): Internet Protocol

        IPv4 (ipv4):Internet Protocol Version 4

        IPv6 (ipv6): Internet Protocol Version 6

        MTU (mtu) Maximum Transmission Unit
       ";

     revision 2015-07-06 {
       description
         "* Remove support for protocol-centric config.
          * Enclose list in container, except for instance.
          * Replace protocol-shutdown with admin-control.
          * Add IPFRR per-interface config.
          * Reorganize max-path etc node.
          * Add node-flag.
          * Align config/operation hierarchy.
          * Use relative path for reference to rib.
          * Add ability to set single admin distance.
          * Make unreserved bandwidth into list.
          * Add F and T bit to OSPFv3 external LSA.
          * Remove key statement inside LSA body.
          * Add stub router support.
          * Fix usage of af-area-config.
          * Add statistics to operation data.
          * Add local rib.
          * Use dotted-quad for all router-id fields.
          * Support more than one multi-area per interface.
          * Use uint16 for LSA type.
          * Update grouping notification-instance-hdr.
          * Rework condition for opaque type and id in OSPFv2 LSA.
          * Rename local-remote-ipv4-addr with remote-if-ipv4-addr.

          * Add virtual-link/sham-link to operation state.
          * Allow multiple link TLVs in one LSA.
          * Fix bug in as-scope-lsas.
          * Remove OSPFv3 restriction in link-scope-lsas.
          * Editorial changes.";
       reference
         "RFC XXXX: A YANG Data Model for OSPF";
     }

     revision 2015-03-09 {
       description
         "Initial revision.";
       reference
         "RFC XXXX: A YANG Data Model for OSPF";
     }

     identity ospf {
       base "rt:routing-protocol";
       description "OSPF Protocol";
     }

     identity ospfv2 {
       base "ospf";
       description "OSPFv2";
     }

     identity ospfv3 {
       base "ospf";
       description "OSPFv3";
     }

     identity operation-mode {
       description
         "OSPF operation mode.";
     }

     identity ships-in-the-night

     identity ships-in-the-night {
       base operation-mode;
       description
         "Ships-in-the-night operation mode in which
         each OSPF instance carries only one address family";
     }

     identity area-type {
       description "Base identity for OSPF area type.";
     }

     identity normal {
       base area-type;
       description "OSPF normal area.";
     }

     identity stub {
       base area-type;
       description "OSPF stub area.";
     }

     identity nssa {
       base area-type;
       description "OSPF NSSA area.";
     }

     typedef uint24 {
       type uint32 {
         range "0 .. 16777215";
       }
       description
         "24-bit unsigned integer.";
     }

     typedef area-id-type {
       type union {
         type uint32;
         type yang:dotted-quad;
       }
       description
         "Area ID type.";
     }

     typedef route-type {
       type enumeration {
         enum intra-area {
           description "OSPF intra-area route.";
         }
         enum inter-area {
           description "OSPF inter-area route.";
         }
         enum external-1 {
           description "OSPF external route type 1.";
         }
         enum external-2 {
           description "OSPF External route type 2.";
         }
         enum nssa-1 {
           description "OSPF NSSA external route type 1.";
         }
         enum nssa-2 {
           description "OSPF NSSA external route type 2.";
         }
       }
       description "OSPF route type.";
     }

     typedef if-state-type {
       type enumeration {
         enum Down {
           value "1";
           description
             "Interface down state.";
         }
         enum Loopback {
           value "2";
           description
             "Interface loopback state.";
         }
         enum Waiting {
           value "3";
           description
             "Interface waiting state.";
         }
         enum Point-to-Point {
           value "4";
           description
             "Interface point-to-point state.";
         }
         enum DR {
           value "5";
           description
             "Interface Designated Router (DR) state.";
         }
         enum BDR {
           value "6";
           description
             "Interface Backup Designated Router (BDR) state.";
         }
         enum DR-Other {
           value "7";
           description
             "Interface Other Designated Router state.";
         }
       }
       description
         "OSPF interface state type.";
     }
     typedef nbr-state-type {
       type enumeration {
         enum Down {
           value "1";
           description
             "Neighbor down state.";
         }
         enum Attempt {
           value "2";
           description
             "Neighbor attempt state.";
         }
         enum Init {
           value "3";
           description
             "Neighbor init state.";
         }
         enum 2-Way {
           value "4";
           description
             "Neighbor 2-Way state.";
         }
         enum ExStart {
           value "5";
           description
             "Neighbor exchange start state.";
         }
         enum Exchange {
           value "6";
           description
             "Neighbor exchange state.";
         }
         enum Loading {
           value "7";
           description
             "Neighbor loading state.";
         }
         enum Full {
           value "8";
           description
             "Neighbor full state.";
         }
       }
       description
         "OSPF neighbor state type.";
     }

     typedef restart-helper-status-type {
       type enumeration {
         enum Not-Helping {
           value "1";
           description
             "Restart helper status not helping.";
         }
         enum Helping {
           value "2";
           description
             "Restart helper status helping.";
         }
       }
       description
         "Restart helper status type.";
     }

     typedef restart-exit-reason-type {
       type enumeration {
         enum None {
           value "1";
           description
             "Not attempted.";
         }
         enum InProgress {
           value "2";
           description
             "Restart in progress.";
         }
         enum Completed {
           value "3";
           description
             "Successfully completed.";
         }
         enum TimedOut {
           value "4";
           description
             "Timed out.";
         }
         enum TopologyChanged {
           value "5";
           description
             "Aborted due to topology change.";
         }
       }
       description
         "Describes the outcome of the last attempt at a
         graceful restart, either by itself or acting
         as a helper.";

     }

     typedef packet-type {
       type enumeration {
         enum Hello {
           value "1";
           description
             "OSPF hello packet.";
         }
         enum Database-Descripton {
           value "2";
           description
             "OSPF database description packet.";
         }
         enum Link-State-Request {
           value "3";
           description
             "OSPF link state request packet.";
         }
         enum Link-State-Update {
           value "4";
           description
             "OSPF link state update packet.";
         }
         enum Link-State-Ack {
           value "5";
           description
             "OSPF link state acknowlegement packet.";
         }
       }
       description
         "OSPF packet type.";
     }

     typedef nssa-translator-state-type {
       type enumeration {
         enum Enabled {
           value "1";
           description
             "NSSA translator enabled state.";
         }
         enum Elected {
           description
             "NSSA translator elected state.";
         }
         enum Disabled {
           value "3";
           description
             "NSSA translator disabled state.";
         }
       }
       description
         "OSPF NSSA translator state type.";
     }

     typedef restart-status-type {
       type enumeration {
         enum Not-Restarting {
           value "1";
           description
             "Router is not restarting.";
         }
         enum Planned-Restart {
           description
             "Router is going through planned restart.";
         }
         enum Unplanned-Restart {
           value "3";
           description
             "Router is going through unplanned restart.";
         }
       }
       description
         "OSPF graceful restart status type.";
     }

     feature multi-topology {
       description
         "Support MTR.";
     }

     feature multi-area-adj {
       description
         "OSPF multi-area adjacency support as in RFC 5185.";
     }

     feature router-id {
       description
         "Set router ID per instance.";
     }

     feature demand-circuit {
       description
         "OSPF demand circuit support as in RFC 1793.";
     }
     feature mtu-ignore {
       description
         "Disable OSPF MTU mismatch detection on receiving
          DBD packets.";
     }

     feature lls {
       description
         "OSPF link-local signaling (LLS) as in RFC 5613.";
     }

     feature prefix-suppression {
       description
         "OSPF prefix suppression support as in RFC 6860.";
     }

     feature bfd {
       description
         "OSPF BFD support.";
     }

     feature ttl-security {
       description
         "OSPF ttl security check.";
     }

     feature nsr {
       description
         "Non-Stop-Routing (NSR).";
     }

     feature graceful-restart {
       description
         "Graceful OSPF Restart as defined in RFC3623 and RFC5187.";
     }

     feature admin-control {
       description
         "Administrative control of the protocol state.";
     }

     feature auto-cost {
       description
         "Calculate OSPF interface cost according to
          reference bandwidth.";
     }

     feature max-ecmp {
       description
         "Setting maximum number of ECMP paths.";
     }

     feature max-lsa {
       description
         "Setting maximum number of LSAs OSPF will receive.";
     }

     feature te-rid {
       description
         "TE router-id.";
     }

     feature ldp-igp-sync {
       description
         "LDP IGP synchronization.";
     }

     feature ldp-igp-autoconfig {
       description
         "LDP IGP auto-config.";
     }

     feature ospfv3-authentication-ipsec {
       description
         "Use IPsec for OSPFv3 authentication.";
     }

     feature fast-reroute {
      description
        "Support of IPFRR.";
     }

     feature node-flag {
      description
        "Support of node flag.";
     }

     feature lfa {
      description
        "Support of Loop Free Alternates.";
     }

     feature remote-lfa {
      description
        "Support of remote Loop Free Alternates.";
     }
     feature stub-router {
       description
         "Support of RFC6987 OSPF Stub Router Advertisement";
     }

     feature instance-inheritance {
       description
         "Support instance inheritance";
     }

     feature area-inheritance {
       description
         "Support area inheritance";
     }

     feature interface-inheritance {
       description
         "Support interface inheritance";
     }

     grouping instance-stat {
       description "Per-instance statistics";
       leaf originate-new-lsa-count {
         type yang:counter32;
         description "The number of new LSAs originated.";
       }
       leaf rx-new-lsas-count {
         type yang:counter32;
         description "The number of LSAs received.";
       }
       leaf as-scope-lsa-count {
         type yang:gauge32;
         description "The number of as-scope LSAs.";
       }
       leaf as-scope-lsa-chksum-sum {
         type uint32;
         description "The sum of the LS checksums.";
       }
       container database {
         description "Container for per AS scope LSA statistics.";
         list as-scope-lsa-type {
           description "List of AS scope LSA statistics";
           leaf lsa-type {
             type uint16;
             description "AS scope LSA type.";
           }
           leaf lsa-count {
             type yang:gauge32;
             description "The number of LSAs of the given type.";
           }
           leaf lsa-cksum-sum {
             type int32;
             description
               "The sum of the LS checksums of the given type.";
           }
         }
       }
     }

     grouping area-stat {
       description "Per-area statistics.";
       leaf spf-runs-count {
         type yang:counter32;
         description "The number of times that intra-area spf runs.";
       }
       leaf abr-count {
         type yang:gauge32;
         description "The total number of area border routers reachable
                      within this area.";
       }
       leaf asbr-count {
         type yang:gauge32;
         description "The total number of AS border routers.";
       }
       leaf ar-nssa-translator-event-count {
         type yang:counter32;
         description "The number of translator state changes.";
       }
       leaf area-scope-lsa-count {
         type yang:gauge32;
         description "The number of LSAs in this area, excluding
                      as-external LSAs.";
       }
       leaf area-scope-lsa-cksum-sum {
         type int32;
         description "The sum of the LSAs checksums.";
       }
       container database {
         description "Container for area scope LSA type statistics.";
         list area-scope-lsa-type {
           description "List of area scope LSA statistics";
           leaf lsa-type {
             type uint16;
             description "Area scope LSA type.";
           }
           leaf lsa-count {
             type yang:gauge32;
             description "The number of LSAs of the given type.";
           }
           leaf lsa-cksum-sum {
             type int32;
             description
               "The sum of the LS checksums of the given type.";
           }
         }
       }
     }

     grouping interface-stat {
       description "Per-interface statistics";
       leaf if-event-count {
         type yang:counter32;
         description
           "The number of times this interface has changed its
                        state or an error has occurred.";
       }
       leaf link-scope-lsa-count {
         type yang:gauge32;
         description "The number of LSAs.";
       }
       leaf link-scope-lsa-cksum-sum {
         type uint32;
         description "The sum of LSAs LS checksums.";
       }
       container database {
         description "Container for link scope LSA type statistics.";
         list link-scope-lsa-type {
           description "List of link scope LSA statistics";
           leaf lsa-type {
             type uint16;
             description "Link scope LSA type.";
           }
           leaf lsa-count {
             type yang:gauge32;
             description "The number of LSAs of the given type.";
           }
           leaf lsa-cksum-sum {
             type int32;
             description
               "The sum of the LS checksums of the given type.";
           }
         }
       }
     }
     grouping neighbor-stat {
       description "Per-instance statistics";
       leaf nbr-event-count {
         type yang:counter32;
         description
           "The number of times this neighbor has changed
            state or an error has occurred.";
       }
       leaf nbr-retrans-qlen {
         type yang:gauge32;
         description
           "The current length of the retransmission queue.";
       }
     }

     grouping instance-fast-reroute-config {
       description
         "This group defines global configuration of IPFRR.";
       container fast-reroute {
         if-feature fast-reroute;
         description
           "This container may be augmented with global
            parameters for IPFRR.";
         container lfa {
           if-feature lfa;
           description
             "This container may be augmented with
              global parameters for LFA.
              Creating the container has no effect on
              LFA activation.";
         }
       }
     }

     grouping interface-fast-reroute-config {
       description
         "This group defines interface configuration of IPFRR.";
       container fast-reroute {
         if-feature fast-reroute;

         container lfa {
           if-feature lfa;

           leaf candidate-disabled {
             type boolean;
             description
               "Prevent the interface to be used as backup.";
           }
           leaf enabled {
             type boolean;
             description
               "Activates LFA.
                This model assumes activation of per-prefix LFA.";
           }
           container remote-lfa {
             if-feature remote-lfa;
             leaf enabled {
               type boolean;
               description
               "Activates remote LFA.";
             }
             description
               "Remote LFA configuration.";
           }
           description
             "LFA configuration.";
         }
         description
           "Fast-reroute configuration.";
       }
     }

     grouping interface-common-config {
       description "Common configuration for all types of interfaces,
                    including virtual link and sham link";

       leaf cost {
         type uint16 {
           range "1..65535";
         }
         description
           "Interface cost.";
       }

       leaf hello-interval {
         type uint16 {
           range "1..65535";
         }
         units seconds;
         description
           "Time between hello packets.";
       }

       leaf dead-interval {
         type uint16 {
           range "1..65535";

         }
         units seconds;
         must "../dead-interval > ../hello-interval" {
           error-message "The dead interval must be "
                       + "larger than the hello interval";
           description
             "The value MUST be greater than 'hello-internval'.";
         }
         description
           "Interval after which a neighbor is declared dead.";
       }

       leaf retransmit-interval {
         type uint16 {
           range "1..65535";
         }
         units seconds;
         description
           "Time between retransmitting unacknowledged Link State
            Advertisements (LSAs).";
       }

       leaf transmit-delay {
         type uint16 {
           range "1..65535";
         }
         units seconds;
         description
           "Estimated time needed to send link-state update.";
       }

       leaf mtu-ignore {
       base operation-mode;
         if-feature mtu-ignore;
         type boolean;
         description
         "Ships-in-the-night operation mode
           "Enable/Disable ignoring of MTU in which
         each OSPF instance carries only one address family"; DBD packets.";
       }

     identity area-type

       leaf lls {
         if-feature lls;
         type boolean;
         description "Base identity for OSPF area type.";
           "Enable/Disable link-local signaling (LLS) support.";
       }

     identity normal

       leaf prefix-suppression {
       base area-type;
         if-feature prefix-suppression;
         type boolean;
         description "OSPF normal area.";
           "Suppress advertisement of the prefixes.";
       }

     identity stub

       leaf bfd {
       base area-type;
         if-feature bfd;
         type boolean;
         description "OSPF stub area.";
           "Enable/disable bfd.";
       }

     identity nssa

       container ttl-security {
       base area-type;
         if-feature ttl-security;
         description "OSPF NSSA area.";
     }

     typedef uint24 "TTL security check.";
         leaf enable {
           type uint32 {
         range "0 .. 16777215";
       } boolean;
           description
         "24-bit unsigned integer.";
             "Enable/Disable TTL security check.";
         }

     typedef area-id-type
         leaf hops {
           type union uint8 {
         type uint32;
         type yang:dotted-quad;
             range "1..254";
           }
           description
         "Area ID type.";
             "Maximum number of hops that a OSPF packet may
              have traveled.";
         }

     typedef if-state-type
       }
       leaf enable {
         if-feature admin-control;
         type enumeration {
         enum Down {
           value "1"; boolean;
         default true;
         description
             "Interface down state";
           "Enable/disable protocol on the interface.";
       }
         enum Loopback

       container authentication {
           value "2";
         description
             "Interface loopback state";
         }
         enum Waiting "Authentication configuration.";
         choice auth-type-selection {
           value "3";
           description
             "Interface waiting state";
             "Options for expressing authentication setting.";
           case auth-ipsec {
             when "../../../../../../../rt:type = 'ospfv3'" {
               description "Applied to OSPFv3 only.";
             }
         enum Point-to-Point
             if-feature ospfv3-authentication-ipsec;
             leaf sa {
           value "4";
                 type string;
                 description
             "Interface point-to-point state";
                   "SA name.";
             }
         enum DR
           }
           case auth-trailer-key-chain {
           value "5";
             leaf key-chain {
               type key-chain:key-chain-ref;
                description
             "Interface Designated Router (DR) state";
                 "key-chain name.";
               }
         enum BDR
             }
           case auth-trailer-key {
           value "6";
             leaf key {
               type string;
               description
             "Interface Backup Designated Router (BDR) state";
                 "Key string in ASCII format.";
             }
         enum DR-Other
             container crypto-algorithm {
           value "7";
               uses key-chain:crypto-algorithm-types;
               description
             "Interface Other Designated Router state";
                 "Cryptographic algorithm associated with key.";
             }
           }
       description
         "OSPF interface state type.";
         }

     typedef nbr-state-type
       }
     } // interface-common-config

     grouping interface-config {
       description "Configuration for real interfaces.";

       leaf network-type {
         type enumeration {
           enum Down "broadcast" {
           value "1";
             description
             "Neighbor down state";
               "Specify OSPF broadcast multi-access network.";
           }
           enum Attempt "non-broadcast" {
           value "2";
             description
             "Neighbor attempt state";
               "Specify OSPF Non-Broadcast Multi-Access
                (NBMA) network.";
           }
           enum Init "point-to-multipoint" {
           value "3";
             description
             "Neighbor init state";
               "Specify OSPF point-to-multipoint network.";
           }
           enum 2-Way "point-to-point" {
           value "4";
             description
             "Neighbor 2-Way state";
               "Specify OSPF point-to-point network.";

           }
         }
         enum ExStart {
           value "5";
         description
             "Neighbor exchange start state";
           "Network type.";
       }
         enum Exchange

       leaf passive {
           value "6";
         type boolean;
         description
             "Neighbor exchange state";
           "Enable/Disable passive.";
       }
         enum Loading

       leaf demand-circuit {
           value "7";
         if-feature demand-circuit;
         type boolean;
         description
             "Neighbor loading state";
           "Enable/Disable demand circuit.";
       }
         enum Full

       container multi-areas {
           value "8";
         description
             "Neighbor full state";
         }
       } "Container for multi-area config.";
         list multi-area {
           if-feature multi-area-adj;
           key multi-area-id;
           description
         "OSPF neighbor state type.";
     }
     typedef restart-helper-status-type
             "Configure ospf multi-area.";
           leaf multi-area-id {
             type enumeration {
         enum Not-Helping {
           value "1"; area-id-type;
             description
             "Restart helper status not helping.";
               "Multi-area ID";
           }
         enum Helping
           leaf cost {
           value "2";
             type uint16;
             description
             "Restart helper status helping.";
               "Interface cost for multi-area.";
           }
         }
       description
         "Restart helper status type.";
       }

     typedef restart-exit-reason-type {
       type enumeration

       container static-neighbors {
         enum None
         description "Static configured neighbors.";

         list neighbor {
           value "1";
           key "address";
           description
             "Not attempted.";
         }
         enum InProgress
             "Specify a neighbor router.";

           leaf address {
           value "2";
             type inet:ip-address;
             description
             "Restart in progress."; "Neighbor IP address.";
           }
         enum Completed

           leaf cost {
           value "3";
             type uint16 {
               range "1..65535";
             }
             description
             "Successfully completed."; "Neighbor cost.";
           }
         enum TimedOut
           leaf poll-interval {
           value "4";
             type uint16 {
               range "1..65535";
             }
             units seconds;
             description
             "Timed out."; "Neighbor poll interval.";
           }
         enum TopologyChanged
           leaf priority {
             type uint8 {
           value "5";
               range "1..255";
             }
             description
             "Aborted due to topology change."; "Neighbor priority for DR election.";
           }
         }
       }

       leaf node-flag {
         if-feature node-flag;
         type boolean;
         default false;
         description
         "Describes the outcome of the last attempt at a
         graceful restart, either by itself or acting
           "Set prefix as a helper."; node representative prefix.";
       }

     typedef packet-type
       uses interface-fast-reroute-config;
       uses interface-common-config;
     } // grouping interface-config

     grouping tlv {
       description
         "TLV";
       leaf type enumeration {
         enum Hello {
           value "1";
         type uint16;
         description
             "OSPF hello packet."; "TLV type.";
       }
         enum Database-Descripton
       leaf length {
           value "2";
           description
             "OSPF database
         type uint16;
         description packet."; "TLV length.";
       }
         enum Link-State-Request {
       leaf value "3"; {
         type yang:hex-string;
         description
             "OSPF link state request packet."; "TLV value.";
       }
         enum Link-State-Update
     }

     grouping unknown-tlvs {
           value "4";
       description
             "OSPF link state update packet.";
         }
         enum Link-State-Ack
         "Unknown TLVs grouping.
          Could be used for unknown TLVs or unknown sub-TLVs.";
       container unknown-tlvs {
           value "5";
         description
             "OSPF link state acknowlegement packet."; "All unknown TLVs.";
         list unknown-tlv {
           description "Unknown TLV.";
           uses tlv;
         }
       }
       description
         "OSPF packet type.";
     }

     typedef nssa-translator-state-type

     grouping ospfv2-router-link {
       type enumeration
       description "OSPFv2 router link.";
       leaf link-id {
         enum Enabled
         type union {
           value "1";
           type inet:ipv4-address;
           type yang:dotted-quad;
         }
         description
             "NSSA translator enabled state."; "Link ID.";
       }
         enum Elected
       leaf link-data {
         type union {
           type inet:ipv4-address;
           type uint32;
         }
         description
             "NSSA translator elected state."; "Link data.";
       }
         enum Disabled
       leaf type {
           value "3";
         type uint8;
         description
             "NSSA translator disabled state."; "Link type.";
       }
     }

     grouping ospfv2-lsa-body {
       description
         "OSPF NSSA translator state type."; "OSPFv2 LSA body.";
       container router {
         when "../../header/type = 1" {
           description
             "Only apply to Router-LSA.";
         }

     typedef restart-status-type
         description
           "Router LSA.";
         leaf flags {
           type enumeration bits {
         enum Not-Restarting
             bit V {
           value "1";
               description
             "Router
                 "When set, the router is not restarting."; an endpoint of one or
                  more virtual links.";
             }
         enum Planned-Restart
             bit E {
               description
             "Router
                 "When set, the router is going through planned restart."; an AS Boundary Router
                  (ASBR).";
             }
         enum Unplanned-Restart
             bit B {
           value "3";
               description
             "Router
                 "When set, the router is going through unplanned restart."; an Area Border
                  Router (ABR).";
             }
           }
           description
         "OSPF graceful restart status type."; "Flags.";
         }

     feature multi-topology
         leaf num-of-links {
           type uint16;
           description
         "Support MTR."; "Number of links.";
         }

     feature multi-area-adj
         container links {
           description
         "OSPF multi-area adjacency support as in RFC 5185.";
     }

     feature router-id "All router Links.";
           list link {
             description
         "Set router ID per instance.";
     }

     feature demand-circuit "Router LSA link.";
             uses ospfv2-router-link;
             container topologies {
               description
         "OSPF demand circuit support as in RFC 1793.";
     }
     feature mtu-ignore "All topologies for the link.";
               list topology {
                 description
         "Disable OSPF MTU mismatch detection
                   "Topology specific information.";
                 leaf mt-id {
                   type uint8;
                   description
                     "The MT-ID for topology enabled on receiving
          DBD packets."; the link.";
                 }

     feature lls
                 leaf metric {
                   type uint16;
                   description
         "OSPF link-local signaling (LLS) as in RFC 5613."; "Metric for the topology.";
                 }

     feature prefix-suppression
               }
             }
           }

         }
       }
       container network {
         when "../../header/type = 2" {
           description
         "OSPF prefix suppression support as in RFC 6860.";
             "Only apply to network LSA.";
         }

     feature bfd
         description
           "Network LSA.";
         leaf network-mask {
           type inet:ipv4-address;
           description
         "OSPF BFD support.";
             "The IP address mask for the network.";
         }

     feature ttl-security
         container attached-routers {
           description
         "OSPF ttl security check."; "All attached routers.";
           leaf-list attached-router {
             type yang:dotted-quad;
             description
               "List of the routers attached to the network.";
           }

     feature nsr
         }
       }
       container summary {
         when "../../header/type = 3 or "
            + "../../header/type = 4" {
           description
         "Non-Stop-Routing (NSR).";
             "Only apply to Summary-LSA.";
         }

     feature graceful-restart
         description
           "Summary LSA.";
         leaf network-mask {
           type inet:ipv4-address;
           description
         "Graceful OSPF Restart as defined in RFC3623 and RFC5187.";
             "The IP address mask for the network";
         }

     feature protocol-shutdown
         container topologies {
           description
         "Shutdown "All topologies for the protocol.";
     }

     feature auto-cost summary.";
           list topology {
             description
         "Calculate OSPF interface cost according to
          reference bandwidth.";
     }

     feature max-ecmp
               "Topology specific information.";
             leaf mt-id {
               type uint8;
               description
         "Setting maximum number of ECMP paths.";
                 "The MT-ID for topology enabled on the link.";
             }

     feature max-lsa
             leaf metric {
               type uint24;
               description
         "Setting maximum number of LSAs OSPF will receive."; "Metric for the topology.";
             }

     feature te-rid {
       description
         "TE router-id.";
           }

     feature ldp-igp-sync {
       description
         "LDP IGP synchronization.";
         }

     feature ldp-igp-autoconfig
       }
       container external {
         when "../../header/type = 5 or "
            + "../../header/type = 7" {
           description
         "LDP IGP auto-config.";
             "Only apply to AS-external-LSA and NSSA-LSA.";
         }

     feature protocol-if-shutdown
         description
           "External LSA.";
         leaf network-mask {
           type inet:ipv4-address;
           description
         "Shutdown
             "The IP address mask for the protocol over an interface."; network";
         }

     feature ospfv3-authentication-ipsec
         container topologies {
           description
         "Use IPsec "All topologies for OSPFv3 authentication.";
     }

     feature instance-inheritance the external.";
           list topology {
             description
         "Support instance inheritance";
     }

     feature area-inheritance
               "Topology specific information.";
             leaf mt-id {
               type uint8;
               description
         "Support area inheritance";
                 "The MT-ID for topology enabled on the link.";
             }

     feature interface-inheritance
             leaf flags {
               type bits {
                 bit E {
                   description
         "Support interface inheritance";
                     "When set, the metric specified is a Type 2
                      external metric.";
                 }
     grouping interface-common-config
               }
               description "Flags.";
             }
             leaf metric {
               type uint24;
               description "Common configuration "Metric for all types of interfaces,
                    including virtual link and sham link"; the topology.";
             }
             leaf cost forwarding-address {
               type uint16 {
           range "1..65535";
         } inet:ipv4-address;
               description
           "Interface cost.";
                 "Forwarding address.";
             }
             leaf hello-interval external-route-tag {
               type uint16 uint32;
               description
                 "Route tag.";
             }
           }
         }
       }
       container opaque {
         when "../../header/type = 9 or "
            + "../../header/type = 10 or "
            + "../../header/type = 11" {
           description
             "Only apply to opaque LSA.";
         }
         description
           "Opaque LSA.";

         uses unknown-tlvs;

         container router-address-tlv {
           range "1..65535";
         }
         units seconds;
           description
           "Time between hello packets.";
       }
             "Router address TLV.";
           leaf dead-interval router-address {
             type uint16 {
           range "1..65535"; inet:ipv4-address;
             description
               "Router address.";
           }
         units seconds;
         must "../dead-interval > ../hello-interval"
         }

         container link-tlvs {
           error-message "The dead interval must be "
                       + "larger than
           description "All link TLVs in the hello interval"; LSA.";
           container link-tlv {
             description
             "The value MUST be greater than 'hello-internval'.";
         } "Link TLV.";
             leaf link-type {
               type uint8;
               mandatory true;
               description
           "Interval after which a neighbor is declared dead."; "Link type.";
             }
             leaf retransmit-interval link-id {
               type uint16 union {
           range "1..65535";
                 type inet:ipv4-address;
                 type yang:dotted-quad;
               }
         units seconds;
               mandatory true;
               description
           "Time between retransmitting unacknowledged Link State
            Advertisements (LSAs)."; "Link ID.";
             }

       leaf transmit-delay
             container local-if-ipv4-addrs {
         type uint16
               description "All local interface IPv4 addresses.";
               leaf-list local-if-ipv4-addr {
           range "1..65535";
         }
         units seconds;
                 type inet:ipv4-address;
                 description
           "Estimated time needed to send link-state update.";
                   "List of local interface IPv4 addresses.";
               }

       leaf mtu-ignore
             }
             container remote-if-ipv4-addrs {
               description "All remote interface IPv4 addresses.";
               leaf-list remote-if-ipv4-addr {
         if-feature mtu-ignore;
                 type boolean; inet:ipv4-address;
                 description
           "Enable/Disable ignoring
                   "List of MTU in DBD packets."; remote interface IPv4 addresses.";
               }
             }
             leaf lls te-metric {
         if-feature lls;
               type boolean; uint32;
               description
           "Enable/Disable link-local signaling (LLS) support."; "TE metric.";
             }
             leaf prefix-suppression max-bandwidth {
         if-feature prefix-suppression;
               type boolean; decimal64 {
                 fraction-digits 2;
               }
               description
           "Suppress advertisement of the prefixes."; "Maximum bandwidth.";
             }
             leaf bfd max-reservable-bandwidth {
         if-feature bfd;
               type boolean; decimal64 {
                 fraction-digits 2;
               }
               description
           "Enable/disable bfd."; "Maximum reservable bandwidth.";
             }
             container ttl-security unreserved-bandwidths {
         if-feature ttl-security;
               description "TTL security check."; "All unreserved bandwidths.";
               list unreserved-bandwidth {
                 leaf enable priority {
                   type boolean; uint8 {
                     range "0 .. 7";
                   }
                   description
             "Enable/Disable TTL security check."; "Priority from 0 to 7.";
                 }
                 leaf hops unreserved-bandwidth {
                   type uint8 decimal64 {
             range "1..254";
                     fraction-digits 2;
                   }
                   description
             "Maximum number of hops that a OSPF packet may
              have traveled."; "Unreserved bandwidth.";
                 }
                 description
                   "List of unreserved bandwidths for different
                    priorities.";

               }
             }
       container protocol-shutdown {
         if-feature protocol-if-shutdown;
         description
           "Protocol shutdown interface config state.";
             leaf shutdown admin-group {
               type boolean; uint32;
               description
             "Enable/Disable protocol shutdown on the interface."; "Administrative group/Resource class/Color.";
             }
             uses unknown-tlvs;
           }
         }

         container authentication extended-prefix-tlvs {
           description "Authentication configuration.";
         choice auth-type-selection "All extended prefix TLVs in the LSA.";
           list extended-prefix-tlv {
             description
             "Options for expressing authentication setting";
           case auth-ipsec "Extended prefix TLV.";
             leaf route-type {
             when "../../../../../rt:type = 'ospfv3'"
               type enumeration {
                 enum unspecified {
                   value "0";
                   description "Applied to OSPFv3 only"; "Unspecified.";
                 }
             if-feature ospfv3-authentication-ipsec;
             leaf sa
                 enum intra-area {
                 type string;
                   value "1";
                   description
                   "SA name"; "OSPF intra-area route.";
                 }
                 enum inter-area {
                   value "3";
                   description "OSPF inter-area route.";
                 }
                 enum external {
                   value "5";
                   description "OSPF External route.";
                 }
           case auth-trailer-key-chain
                 enum nssa {
                   value "7";
                   description "OSPF NSSA external route.";
                 }
               }
               description "Route type.";
             }
             leaf key-chain flags {
               type key-chain:key-chain-ref; bits {
                 bit A {
                   description
                 "key-chain name";
                     "Attach flag.";
                 }
             }
           case auth-trailer-key
                 bit N {
                   description
                     "Node flag.";

                 }
               }
               description "Flags.";
             }
             leaf key prefix {
               type string; inet:ip-prefix;
               description
                 "Key string in ASCII format."; "Address prefix.";
             }
             uses unknown-tlvs;
           }
         }

         container crypto-algorithm extended-link-tlvs {
               uses key-chain:crypto-algorithm-types;
           description
                 "Cryptographic algorithm associated with key.";

             } "All extended link TLVs in the LSA.";
           list extended-link-tlv {
             description "Extended link TLV.";
             uses ospfv2-router-link;
             uses unknown-tlvs;
           }
         }
       }
     } // interface-common-config

     grouping interface-config ospfv3-lsa-options {
       description "Configuration for real interfaces."; "OSPFv3 LSA options";
       leaf network-type options {
         type enumeration bits {
           enum "broadcast"
           bit DC {
             description
               "Specify OSPF broadcast multi-access network.";
               "When set, the router support demand circuits.";
           }
           enum "non-broadcast"
           bit R {
             description
               "Specify OSPF Non-Broadcast Multi-Access
               (NBMA) network.";
               "When set, the originator is an active router.";
           }
           enum "point-to-multipoint"
           bit N {
             description
               "Specify OSPF point-to-multipoint network.";
               "If set, the router is attached to an NSSA";
           }
           enum "point-to-point"
           bit E {
             description
               "Specify OSPF point-to-point network.";
               "This bit describes the way AS-external-LSAs
                are flooded";
           }
           bit V6 {
             description
               "If clear, the router/link should be excluded
                from IPv6 routing calculaton";

           }
         }
         mandatory true;
         description
           "Network type."; "OSPFv3 LSA options.";
       }
     }

     grouping ospfv3-lsa-prefix {
       description
         "OSPFv3 LSA prefix.";

       leaf passive prefix {
         type boolean; inet:ip-prefix;
         description
           "Enable/Disable passive.";
           "Prefix.";
       }
       leaf demand-circuit prefix-options {
         if-feature demand-circuit;
         type boolean; bits {
           bit NU {
             description
           "Enable/Disable demand circuit.";
               "When set, the prefix should be excluded
                from IPv6 unicast calculations.";
           }

       container multi-area
           bit LA {
         if-feature multi-area-adj;
             description
           "Configure ospf multi-area.";
         leaf multi-area-id
               "When set, the prefix is actually an IPv6 interface
                address of the Advertising Router.";
           }
           bit P {
           type area-id-type;
             description
             "Multi-area ID";
               "When set, the NSSA area prefix should be
                readvertised by the translating NSSA area border.";
           }
         leaf cost
           bit DN {
           type uint16;
             description
             "Interface cost for multi-area.";
               "When set, the inter-area-prefix-LSA or
                AS-external-LSA prefix has been advertised in a VPN
                environment.";
           }
         }

       container static-neighbors {
         mandatory true;
         description "Static configured neighbors.";

         list neighbor "Prefix options.";
       }
     }

     grouping ospfv3-lsa-external {
           key "address";
       description
             "Specify a neighbor router.";
         "AS-External and NSSA LSA.";

       leaf address metric {
         type inet:ip-address; uint24;
         description "Neighbor IP address."; "Metric";
       }

       leaf cost flags {
         type uint16 bits {
           bit E {
               range "1..65535";
             }
             description "Neighbor cost.";
               "When set, the metric specified is a Type 2
                external metric.";
           }
           leaf poll-interval
           bit F {
             type uint16
             description
               "When set, a Forwarding Address is included
                in the LSA.";
           }
           bit T {
               range "1..65535";
             description
               "When set, an External Route Tag is included
                in the LSA.";
           }
         }
             units seconds;
         description "Neighbor poll interval."; "Flags.";
       }

       leaf priority referenced-ls-type {
         type uint8 {
               range "1..255";
             } uint16;
         description "Neighbor priority for DR election.";
           }
         } "Referenced Link State type.";
       }

       uses interface-common-config;
     } // grouping interface-config

     grouping tlv {
       description
         "TLV"; ospfv3-lsa-prefix;

       leaf type forwarding-address {
         type uint16; inet:ipv6-address;
         description "TLV type.";
           "Forwarding address.";
       }

       leaf length external-route-tag {
         type uint16; uint32;
         description "TLV length.";
           "Route tag.";
       }
       leaf value referenced-link-state-id {
         type yang:hex-string; uint32;
         description "TLV value.";
           "Referenced Link State ID.";

       }
     }

     grouping ospfv2-lsa-body ospfv3-lsa-body {
       description "OSPFv2 "OSPFv3 LSA body.";
       container router {
         when "../../header/type = 1" 8193" { // 0x2001
           description
             "Only apply to Router-LSA.";
         }
         description "Router LSA.";
         leaf flags {
           type bits {
             bit V {
               description
                 "When set, the router is an endpoint of one or
                  more virtual links.";
             }
             bit E {
               description
                 "When set, the router is an AS Boundary Router
                  (ASBR).";
             }
             bit B {
               description
                 "When set, the router is an Area Border
                  Router (ABR).";
             }
             bit Nt {
               description
                 "When set, the router is an NSSA border router
                  that is unconditionally translating NSSA-LSAs
                  into AS-external-LSAs.";
             }
           }
           mandatory true;
           description "Flags"; "LSA option.";
         }
         leaf num-of-links

         uses ospfv3-lsa-options;

         container links {
           type uint16;
           description "Number of links.";
         } "All router link.";
           list link {
           key "link-id link-data";
             description "Router LSA link.";
             leaf link-id interface-id {
               type union uint32;
               description "Interface ID.";

             }
             leaf neighbor-interface-id {
               type uint32;
               description "Neighbor Interface ID.";
             }
             leaf neighbor-router-id {
               type yang:dotted-quad;
               description "Neighbor Router ID.";
             }
             leaf type {
               type uint8;
               description "Link type.";
             }
             leaf metric {
               type uint16;
                 description "Metric.";
             }
           }
         }
       }
       container network {
         when "../../header/type = 8194" { // 0x2002
           description
             "Only apply to network LSA.";
         }
         description "Network LSA.";

         uses ospfv3-lsa-options;

         container attached-routers {
           description "All attached routers.";
           leaf-list attached-router {
             type yang:dotted-quad;
             description
               "List of the routers attached to the network.";
           }
         }
       }
       container inter-area-prefix {
         when "../../header/type = 8195" { // 0x2003
           description
             "Only apply to inter-area-prefix LSA.";
         }
         leaf metric {
           type uint24;
           description "Metric";
         }
         uses ospfv3-lsa-prefix;
         description "Inter-Area-Prefix LSA.";
       }
       container inter-area-router {
         when "../../header/type = 8196" { // 0x2004
           description
             "Only apply to inter-area-router LSA.";
         }
         uses ospfv3-lsa-options;
         leaf metric {
           type uint24;
           description "Metric.";
         }
         leaf destination-router-id {
           type yang:dotted-quad;
           description
             "The Router ID of the router being described by the LSA.";
         }
         description "Inter-Area-Router LSA.";
       }
       container as-external {
         when "../../header/type = 16389" { // 0x4005
           description
             "Only apply to as-external LSA.";
         }

         uses ospfv3-lsa-external;

         description "AS-External LSA.";
       }
       container nssa {
         when "../../header/type = 8199" {
               type inet:ipv4-address;
               type yang:dotted-quad; // 0x2007
           description
             "Only apply to nssa LSA.";
         }
         uses ospfv3-lsa-external;

         description "Link ID"; "NSSA LSA.";
       }
           leaf link-data
       container link {
             type union
         when "../../header/type = 8" {
               type inet:ipv4-address;
               type uint32;
             } // 0x0008
           description "Link data.";
             "Only apply to link LSA.";
         }
         leaf type rtr-priority {
           type uint8;
           description "Link type."; "Router Priority of the interface.";
         }
           list topology {
             key "mt-id";
             description
               "Topology specific information.";
         uses ospfv3-lsa-options;

         leaf mt-id link-local-interface-address {
           type uint8; inet:ipv6-address;
           description
             "The MT-ID for topology enabled originating router's link-local
              interface address on the link.";
         }

         leaf metric num-of-prefixes {
           type uint16; uint32;
           description "Metric "Number of prefixes.";
         }

         container prefixes {
           description "All prefixes for the topology.";
             } link.";
           list prefix {
             description "List of prefixes associated with the link.";
             uses ospfv3-lsa-prefix;
           }
         }
         description "Link LSA.";
       }
       container network intra-area-prefix {
         when "../../header/type = 2" 8201" { // 0x2009
           description
             "Only apply to network intra-area-prefix LSA.";
         }
         description
           "Network "Intra-Area-Prefix LSA.";

         leaf network-mask referenced-ls-type {
           type inet:ipv4-address; uint16;
           description
             "The IP address mask for the network"; "Referenced Link State type.";
         }
         leaf-list attached-router
         leaf referenced-link-state-id {
           type yang:dotted-quad; uint32;
           description
             "List of the routers attached to the network.";
         }
             "Referenced Link State ID.";
         }
       container summary {
         when "../../header/type = 3 or "
            + "../../header/type = 4"
         leaf referenced-adv-router {
           type inet:ipv4-address;
           description
             "Only apply to Summary-LSA.";
             "Referenced Advertising Router.";
         }
         description
           "Summary LSA.";

         leaf network-mask num-of-prefixes {
           type inet:ipv4-address; uint16;
           description
             "The IP address mask for the network"; "Number of prefixes.";

         }
         list topology
         container prefixes {
           key "mt-id";
           description
             "Topology specific information.";
           leaf mt-id "All prefixes in this LSA.";
           list prefix {
             type uint8;
             description
               "The MT-ID for topology enabled on the link.";
           } "List of prefixes in this LSA.";
             uses ospfv3-lsa-prefix;
             leaf metric {
               type uint24;
               description "Metric for the topology."; "Metric.";
             }
           }
         }
       }
       container external {
         when "../../header/type = 5 or "
            + "../../header/type = 7" {
           description
             "Only apply to AS-external-LSA and NSSA-LSA.";
     }

     grouping lsa-header {
       description
           "External LSA.";
           "Common LSA for OSPFv2 and OSPFv3";
       leaf network-mask age {
         type inet:ipv4-address; uint16;
         mandatory true;
         description
             "The IP address mask for the network"; "LSA age.";
       }
         list topology {
           key "mt-id";
           description
             "Topology specific information.";
       leaf mt-id type {
         type uint8; uint16;
         mandatory true;
         description
               "The MT-ID for topology enabled on the link."; "LSA type.";
       }
       leaf flags adv-router {
         type bits {
               bit E {
                 description
                   "When set, the metric specified is a Type 2
                   external metric.";
               }
             } yang:dotted-quad;
         mandatory true;
         description "Flags."; "LSA advertising router.";
       }
       leaf metric seq-num {
         type uint24; uint32;
         mandatory true;
         description "Metric for the topology."; "LSA sequence number.";
       }
       leaf forwarding-address checksum {
         type inet:ipv4-address; uint16;
         mandatory true;
         description
               "Forwarding address."; "LSA checksum.";
       }
       leaf external-route-tag length {
         type uint32; uint16;
         mandatory true;
         description
               "Route tag.";
           } "LSA length.";
       }

     }

     grouping ospfv2-lsa {
       description
           "OSPFv2 LSA.";
       container opaque header {
         when "../../header/type
         must "(type = 9 or "
            + "../../header/type type = 10 or type = 11) and "
            + "../../header/type = 11" "opaque-id and opaque-type "
            + "or (type != 9 and type != 10 and type != 11) "
            + "and not(opaque-id) and "
            + "not(opaque-type)" {
           description
             "Only "Opaque type and id only apply to opaque LSA.";
         }
         description
           "Opaque LSA.";

         list unknown-tlv {
           key "type";
           description "Unknown TLV.";
           uses tlv;
         }

         container router-address-tlv {
           "Decoded OSPFv2 LSA header data.";
         leaf router-address option {
           type inet:ipv4-address; bits {
             bit DC {
               description
               "Router address.";
                 "When set, the router support demand circuits.";
             }
             bit P {
               description
             "Router address TLV.";
                 "Only used in type-7 LSA. When set, the NSSA
                  border router should translate the type-7 LSA
                  to type-5 LSA.";
             }

         container link-tlv
             bit MC {
           leaf link-type
               description
                 "When set, the router support MOSPF.";
             }
             bit E {
             type uint8;
               description
                 "This bit describes the way AS-external-LSAs
                  are flooded";
             }
           }
           mandatory true;
           description "Link type."; "LSA option.";
         }
         leaf link-id {
             type union lsa-id {
           type inet:ipv4-address;
               type yang:dotted-quad;
             }
           mandatory true;
           description "Link "LSA ID.";
         }
           leaf-list local-if-ipv4-addr

         leaf opaque-type {
           type inet:ipv4-address; uint8;
           description
               "List of local interface IPv4 addresses."; "Opaque type.";
         }
           leaf-list local-remote-ipv4-addr

         leaf opaque-id {
           type inet:ipv4-address; uint24;
           description
               "List of remote interface IPv4 addresses."; "Opaque id.";
         }
           leaf te-metric

         uses lsa-header;
       }
       container body {
             type uint32;
         description "TE metric.";
           "Decoded OSPFv2 LSA body data.";
         uses ospfv2-lsa-body;
       }
           leaf max-bandwidth
     }

     grouping ospfv3-lsa {
             type decimal64
       description
           "Decoded OSPFv3 LSA.";
       container header {
               fraction-digits 2;
             }
         description "Maximum bandwidth.";
           }
           "Decoded OSPFv3 LSA header data.";
         leaf max-reservable-bandwidth lsa-id {
           type decimal64 {
               fraction-digits 2; uint32;
           mandatory true;
           description "LSA ID.";
         }
         uses lsa-header;
       }
       container body {
         description "Maximum reservable bandwidth.";
           "Decoded OSPF LSA body data.";
         uses ospfv3-lsa-body;
       }
     }

     grouping lsa-common {
       description
           "Common field for OSPF LSA represenation.";
       leaf unreserved-bandwidth decoded-completed {
         type decimal64 {
               fraction-digits 2;
             } boolean;
         description "Unreserved bandwidth.";
           "The OSPF LSA body is fully decoded.";
       }
       leaf admin-group raw-data {
         type uint32; yang:hex-string;
         description "Administrative group/Resource class/Color.";
           "The complete LSA in network byte
            order as received/sent over the wire.";
       }
           list unknown-subtlv
     }

     grouping lsa {
             key "type";
       description "Unknown sub-TLV.";
           "OSPF LSA.";
       uses tlv; lsa-common;
       choice version {
         description
           "OSPFv2 or OSPFv3 LSA body.";
         container ospfv2 {
           description "OSPFv2 LSA";
           uses ospfv2-lsa;
         }
         container ospfv3 {
           description
             "Link TLV."; "OSPFv3 LSA";
           uses ospfv3-lsa;
         }
       }
     }

     grouping ospfv3-lsa-options lsa-key {
       description "OSPFv3
         "OSPF LSA options"; key.";
       leaf options lsa-id {
         type bits {
           bit DC union {
           type inet:ipv4-address;
           type uint32;
         }
         description
               "When set, the router support demand circuits.";
           "LSA ID.";
       }
           bit R
       leaf adv-router {
         type inet:ipv4-address;
         description
               "When set, the originator is an active
           "Advertising router.";
       }
           bit N
     }

     grouping af-area-config {
       description
         "OSPF address-family specific area config state.";
       container ranges {
         description "Container for summary ranges";
         list range {
           key "prefix";
           description
             "Summarize routes matching address/mask (border
              routers only)";
           leaf prefix {
             type inet:ip-prefix;
             description
               "If set, the router is attached to an NSSA";
               "IPv4 or IPv6 prefix";
           }
           bit E
           leaf advertise {
             type boolean;
             description
               "This bit describes the way AS-external-LSAs
               are flooded";
               "Advertise or hide.";
           }
           bit V6
           leaf cost {
             type uint24 {
               range "0..16777214";
             }
             description
               "If clear, the router/link should be excluded
                from IPv6 routing calculaton";
               "Cost of summary route.";
           }
         }
         mandatory true;
         description "OSPFv3 LSA options.";
       }
     }

     grouping ospfv3-lsa-prefix area-config {
       description
         "OSPFv3 LSA prefix.";
         "OSPF area config state.";
       leaf prefix area-type {
         type inet:ip-prefix; identityref {
           base area-type;
         }
         default normal;
         description
           "Prefix";
           "Area type.";
       }

       leaf prefix-options {
         type bits summary {
           bit NU
         when "../area-type = 'stub' or ../area-type = 'nssa'" {
           description
               "When set, the prefix should be excluded
               from IPv6 unicast calculations.";
             "Summary generation valid for stub/NSSA area.";
         }
           bit LA {
         type boolean;
         description
               "When set, the prefix is actually an IPv6 interface
               address of
           "Enable/Disable summary generation to the Advertising Router."; stub or
            NSSA area.";
       }
           bit P

       leaf default-cost {
         when "../area-type = 'stub' or ../area-type = 'nssa'" {
             description
               "When set, the NSSA area prefix should be
               readvertised by the translating
               "Default cost for LSA advertised into stub or
                NSSA area border."; area.";
         }
           bit DN
         type uint32 {
           range "1..16777215";
         }
         description
               "When set,
           "Set the inter-area-prefix-LSA or
               AS-external-LSA prefix has been advertised in summary default-cost for a VPN
               environment."; stub or NSSA area.";
       }
     }
         mandatory true;

     grouping local-rib {
       description "Prefix options.";

       } "Local-rib grouping.";
       container local-rib {
         description "Local-rib.";
         list route {
           key "prefix";
           description "Routes";
           leaf prefix {
             type inet:ip-prefix;
             description "Destination prefix.";
           }

     grouping ospfv3-lsa-external
           container next-hops {
             description
         "AS-External and NSSA LSA."; "All next hops for the route.";
             list next-hop {
               key "next-hop";
               description "List of next hop for the route";
               leaf metric outgoing-interface {
                 type uint24; if:interface-ref;
                 description "Metric";
                   "Name of the outgoing interface.";
               }
               leaf flags next-hop {
                type bits {
           bit E { inet:ip-address;
                description
               "When set, the metric specified is a Type 2
               external metric."; "Nexthop address.";
               }
             }
         description "Flags.";
           }
           leaf referenced-ls-type metric {
             type uint16; uint32;
             description "Referenced Link State type."; "Metric for this route.";
           }

       uses ospfv3-lsa-prefix;
           leaf forwarding-address route-type {
             type inet:ipv6-address; route-type;
             description
           "Forwarding address."; "Route type for this route.";
           }
           leaf external-route-tag route-tag {
             type uint32;
             description "Route tag."; tag for this route.";
           }
         }
       }
     }

     grouping instance-config {
       description
         "OSPF instance config state.";
       leaf referenced-link-state-id router-id {
         if-feature router-id;
         type uint32; yang:dotted-quad;
         description
           "Referenced Link State ID.";
       }
           "Defined in RFC 2328. A 32-bit number
            that uniquely identifies the router.";
       }

     grouping ospfv3-lsa-body

       container admin-distance {
         description "OSPFv3 LSA body.";
       container router "Admin distance config state.";
         choice scope {
         when "../../header/type = 8193"
           description
             "Options for expressing admin distance
              as single or multiple values.";
           case single-value { // 0x2001
                   leaf all {
                     type uint8;
               description
             "Only apply to Router-LSA.";
                 "Admin distance for intra-area, inter-area and
                  external route.";
             }
           }
           case multi-values {
             choice granularity {
               description "Router LSA.";
                 "Options for expressing admin distance
                  for intra-area and inter-area route.";
               case detail {
                 leaf flags intra-area {
                   type bits {
             bit V { uint8;
                   description
                 "When set, the router is an endpoint of one or
                 more virtual links.";
                     "Admin distance for intra-area route.";
                 }
             bit E
                 leaf inter-area {
                   type uint8;
                   description
                 "When set, the router is an AS Boundary Router
                 (ASBR).";
                     "Admin distance for inter-area route.";

                 }
             bit B
               }
               case coarse {
                 leaf internal {
                   type uint8;
                   description
                 "When set, the router is an Area Border Router (ABR).";
                     "Admin distance for both intra-area and
                      inter-area route.";
                 }
             bit Nt
               }
             }
             leaf external {
               description
                 "When set, the router is an NSSA border router
                 that is unconditionally translating NSSA-LSAs
                 into AS-external-LSAs.";
               type uint8;
               description
                 "Admin distance for both external route.";
             }
           }
           mandatory true;
           description "LSA option.";
         }

         uses ospfv3-lsa-options;

         list link
       }

       container nsr {
           key "interface-id neighbor-interface-id neighbor-router-id";
         if-feature nsr;
         description "Router LSA link.";
           "NSR config state.";
         leaf interface-id enable {
           type uint32; boolean;
           description "Interface ID.";
             "Enable/Disable NSR.";
         }
       }

       container graceful-restart {
         if-feature graceful-restart;
         description
           "Graceful restart config state.";
         leaf neighbor-interface-id enable {
           type uint32; boolean;
           description "Neighbor Interface ID.";
             "Enable/Disable graceful restart as defined in RFC 3623.";
         }
         leaf neighbor-router-id helper-enable {
           type yang:dotted-quad; boolean;
           description "Neighbor Router ID";
             "Enable RestartHelperSupport in RFC 3623 Section B.2.";
         }
         leaf type restart-interval {
           type uint8; uint16 {
             range "1..1800";  // Range is defined in RFC 3623.

           }
           units seconds;
           default "120";  // Default is defined in RFC 3623.
           description "Link type.";
             "RestartInterval option in RFC 3623 Section B.1.";
         }
         leaf metric helper-strict-lsa-checking {
           type uint16; boolean;
           description "Metric.";
           }
         }
             "RestartHelperStrictLSAChecking option in RFC 3623
              Section B.2.";
         }
       container network {
         when "../../header/type = 8194" { // 0x2002
           description
             "Only apply to network LSA.";
       }
         description "Network LSA.";

         uses ospfv3-lsa-options;

         leaf-list attached-router

       leaf enable {
         if-feature admin-control;
         type yang:dotted-quad; boolean;
         default true;
         description
             "List of the routers attached to
           "Enable/Disable the network.";
         } protocol.";
       }

       container inter-area-prefix {
         when "../../header/type = 8195" auto-cost { // 0x2003
         if-feature auto-cost;
         description
             "Only apply to inter-area-prefix LSA.";
         }
           "Auto cost config state.";
         leaf metric enable {
           type uint24;
           description "Metric";
         }

         uses ospfv3-lsa-prefix; boolean;
           description "Inter-Area-Prefix LSA.";
             "Enable/Disable auto cost.";
         }
       container inter-area-router
         leaf reference-bandwidth {
           when "../../header/type "../enable = 8196" 'true'" { // 0x2004
             description "Only apply to inter-area-router LSA."; when auto cost is enabled";
           }
         uses ospfv3-lsa-options;
         leaf metric {
           type uint24; uint32 {
             range "1..4294967";
           }
           units Mbits;
           description "Metric";
             "Configure reference bandwidth in term of Mbits";
         }
       }

       container spf-control {
         leaf destination-router-id paths {
           if-feature max-ecmp;
           type yang:dotted-quad; uint16 {
             range "1..32";
           }
           description
             "The Router ID
             "Maximum number of the router being described by the LSA."; ECMP paths.";
         }
         description "Inter-Area-Router LSA."; "SPF calculation control.";
       }

       container as-external database-control {
         when "../../header/type = 16389"
         leaf max-lsa { // 0x2007
           if-feature max-lsa;
           type uint32 {
             range "1..4294967294";
           }
           description
             "Only apply to as-external LSA.";
             "Maximum number of LSAs OSPF will receive.";
         }

         uses ospfv3-lsa-external;
         description "AS-External LSA."; "Database maintenance control.";
       }

       container nssa stub-router {
         when "../../header/type = 8199"
         if-feature stub-router;
         description "Set maximum metric configuration";

         choice trigger { // 0x2007
           description
             "Only apply
             "Specific different triggers to nssa LSA.";
         }
         uses ospfv3-lsa-external; enable stub router.";
           container always {
             presence
               "Enables maximum metric for non-stub router link";
             description "NSSA LSA."; "Set maximum metric always configuration";
           }
         }
       }

       container link mpls {
         when "../../header/type = 8"
         description
           "OSPF MPLS config state.";
         container te-rid { // 0x0008
           if-feature te-rid;
           description
             "Only apply to link LSA.";
         }
             "Traffic Engineering stable IP address for system.";
           choice source {
             description
               "Different options for specifying TE router ID.";
             case interface {
               leaf rtr-priority interface {
                 type uint8; if:interface-ref;
                 description "Router Priority of
                   "Take the interface."; interface's IPv4 address as TE
                    router ID.";
               }

         uses ospfv3-lsa-options;
             }
             case explicit {
               leaf link-local-interface-address router-id {
                 type inet:ipv6-address; inet:ipv4-address;
                 description
             "The originating router's link-local
             interface address on
                   "Explicitly configure the link."; TE router ID.";
               }
             }
           }
         }
         container ldp {
           description
             "OSPF MPLS LDP config state.";
           leaf num-of-prefixes igp-sync {
             if-feature ldp-igp-sync;
             type uint32; boolean;
             description "Number of prefixes.";
               "Enable LDP IGP synchronization.";
           }

         list prefix
           leaf autoconfig {
           key "prefix";
             if-feature ldp-igp-autoconfig;
             type boolean;
             description "List of prefixes associated with the link.";
           uses ospfv3-lsa-prefix;
               "Enable LDP IGP interface auto-configuration.";
           }
         description "Link LSA.";
         }
       container intra-area-prefix
       }
       uses instance-fast-reroute-config;
     }

     grouping interface-operation {
         when "../../header/type = 8201"
       description
         "OSPF interface operation state.";
       reference "RFC2328 Section 9";
       uses interface-config;

       leaf state { // 0x2009
         type if-state-type;
         description
             "Only apply to intra-area-prefix LSA."; "Interface state.";
       }
         description "Intra-Area-Prefix LSA.";

       leaf referenced-ls-type hello-timer {
         type uint16; uint32;
         units "milliseconds";
         description "Referenced Link State type."; "Hello timer.";
       }

       leaf referenced-link-state-id wait-timer {
         type uint32;
         units "milliseconds";
         description
             "Referenced Link State ID."; "Wait timer.";
       }

       leaf referenced-adv-router dr {
         type inet:ipv4-address;
         description
             "Referenced Advertising Router."; "DR.";
       }

       leaf num-of-prefixes bdr {
         type uint16; inet:ipv4-address;
         description "Number of prefixes."; "BDR.";
       }
         list prefix

       container statistics {
           key "prefix";
         description "List of prefixes associated with the link."; "Per interface statistics";
         uses ospfv3-lsa-prefix;
           leaf metric {
             type uint24;
             description "Metric";
           }
         } interface-stat;
       }
     } // interface-operation

     grouping lsa-header neighbor-operation {
       description
           "Common LSA for OSPFv2 and OSPFv3";
         "OSPF neighbor operation data.";

       leaf age address {
         type uint16;
         mandatory true; inet:ip-address;
         description "LSA age.";
           "Neighbor address.";
       }
       leaf type dr {
         type uint16;
         mandatory true; yang:dotted-quad;
         description "LSA type.";
           "Designated Router.";
       }
       leaf adv-router bdr {
         type yang:dotted-quad;
         mandatory true;
         description "LSA advertising router.";
           "Backup Designated Router.";
       }
       leaf seq-num state {
         type uint32;
         mandatory true; nbr-state-type;
         description "LSA sequence number.";
           "OSPF neighbor state.";

       }
       leaf checksum
       container statistics {
         type uint16;
         mandatory true;
         description "LSA checksum."; "Per neighbor statistics";
         uses neighbor-stat;
       }
     }

     grouping instance-operation {
       description
         "OSPF Address Family operation state.";
       leaf length router-id {
         type uint16;
         mandatory true; yang:dotted-quad;
         description "LSA length.";
           "Defined in RFC 2328. A 32-bit number
            that uniquely identifies the router.";
       }

       uses local-rib;

       container statistics {
         description "Per instance statistics";
         uses instance-stat;
       }
     }

     grouping ospfv2-lsa

     augment "/rt:routing/rt:routing-instance/rt:routing-protocols/"
           + "rt:routing-protocol" {
        when "rt:type = 'ospf:ospfv2' or rt:type = 'ospf:ospfv3'" {
         description
           "This augment is only valid for a routing protocol instance
            of OSPF (type 'ospfv2' or 'ospfv3').";
       }
       description "OSPF augmentation.";

       container ospf {
         description
           "OSPF.";

         container all-instances-inherit {
           if-feature instance-inheritance;
           description
             "Inheritance support to all instances.";
           container area {
             description
               "Area config to be inherited by all areas in
               all instances.";
           }
           container interface {
             description
               "Interface config to be inherited by all interfaces
                in all instances.";
           }
         }

         leaf operation-mode {
           type identityref {
             base operation-mode;
           }
           default ospf:ships-in-the-night;
           description
           "OSPFv2 LSA.";
       container header
             "OSPF operation mode.";
         }

         list instance {
           key "af";
           description
           "Decoded OSPFv2 LSA header data.";
             "An OSPF routing protocol instance.";

           leaf option af {
             type bits {
             bit DC identityref {
               base rt:address-family;
             }
             description
                 "When set,
               "Address-family of the router support demand circuits."; instance.";
           }
             bit P

           uses instance-config;

           container all-areas-inherit {
             if-feature area-inheritance;
             description
                 "Only used in type-7 LSA. When set, the NSSA
                 border router should translate the type-7 LSA
                 to type-5 LSA.";
             }
             bit MC
               "Inheritance for all areas.";
             container area {
               description
                 "When set, the router support MOSPF.";
                 "Area config to be inherited by all areas.";
             }
             bit E
             container interface {
               description
                 "This bit describes the way AS-external-LSAs
                 are flooded";
                 "Interface config to be inherited by all interfaces
                  in all areas.";
             }
           }
           mandatory true;

           container areas {
             description "LSA option.";
         } "All areas.";
             list area {
               key "area-id";
               description
                 "List of ospf areas";
               leaf lsa-id area-id {
                 type inet:ipv4-address;
           mandatory true; area-id-type;
                 description "LSA
                   "Area ID.";
               }

         leaf opaque-type

               uses area-config;
               uses af-area-config {
                 when "../../header/type = 9 or "
              + "../../header/type "../../operation-mode = 10 or "
                    + "../../header/type = 11" "'ospf:ships-in-the-night'" {
                   description
               "Only apply to opaque LSA.";
                     "Ships in the night configuration.";
                 }
           type uint8;
           mandatory true;
           description "Opaque type.";
               }

         leaf opaque-id
               container all-interfaces-inherit {
           when "../../header/type = 9 or "
              + "../../header/type = 10 or "
              + "../../header/type = 11"
                 if-feature interface-inheritance;
                 description
                   "Inheritance for all interfaces";
                 container interface {
                   description
               "Only apply
                     "Interface config to opaque LSA.";
           }
           type uint24;
           mandatory true;
           description "Opaque id."; be inherited by all
                      interfaces.";
                 }
         uses lsa-header;
               }

               container body virtual-links {
                 description
           "Decoded OSPFv2 LSA body data.";
         uses ospfv2-lsa-body;
       }
     }

     grouping ospfv3-lsa "All virtual links.";
                 list virtual-link {
       description
           "Decoded OSPFv3 LSA.";
       container header
                   when "../../area-id != '0' and "
                      + "../../area-type = 'normal'" {
                     description
           "Decoded OSPFv3 LSA header data.";
                       "Transit area must be non-backbone normal area.";
                   }
                   key "router-id";
                   description
                     "OSPF virtual link";
                   leaf lsa-id router-id {
                     type uint32;
           mandatory true; yang:dotted-quad;
                     description "LSA
                       "Virtual link router ID.";
                   }

                   uses lsa-header; interface-common-config;
                 }
               }
               container body sham-links {
                 description
           "Decoded OSPF LSA body data.";
         uses ospfv3-lsa-body;
       }
     }

     grouping lsa-common "All sham links.";
                 list sham-link {
                   key "local-id remote-id";
                   description
           "Common field for OSPF LSA represenation.";
                     "OSPF sham link";
                   leaf decoded-completed local-id {
                     type boolean; inet:ip-address;
                     description
           "The OSPF LSA body is fully decoded.";
                       "Address of the local end-point.";
                   }
                   leaf raw-data remote-id {
                     type yang:hex-string; inet:ip-address;
                     description
           "The complete LSA in network byte
           order as received/sent over
                       "Address of the wire."; remote end-point.";
                   }
                   uses interface-common-config;
                 }

     grouping link-scope-lsa
               }
               container interfaces {
                 description
           "OSPF link-scope LSA.";
       uses lsa-common;
       choice version "All interfaces.";
                 list interface {
                   key "interface";
                   description
           "OSPFv2 or OSPFv3 LSA body.";
         container ospfv2 {
           when "../../../../../../../rt:type = 'ospfv2'"
                     "List of OSPF interfaces.";
                   leaf interface {
                     type if:interface-ref;
                     description "Applied to OSPFv2 only";
                       "Interface.";
                   }
           description "OSPFv2 LSA";
                   uses ospfv2-lsa; interface-config;
                 } // list of interfaces
               }
             } // list of areas
           }
         } // list of instance
       } // container ospfv3 ospf
     }

     augment "/rt:routing/rt:routing-instance/rt:routing-protocols/"
           + "rt:routing-protocol/ospf:ospf/ospf:instance" {
       when "../../../../../../../rt:type "../../rt:type = 'ospfv3'" 'ospf:ospfv2' or
             ../../rt:type = 'ospf:ospfv3'" {
         description "Applied to OSPFv3 only";
           "This augment is only valid for OSPF
           (type 'ospfv2' or 'ospfv3').";
       }
       if-feature multi-topology;
       description "OSPFv3 LSA";
           uses ospfv3-lsa;
         }
         "OSPF multi-topology routing-protocol augmentation.";
       container topologies {
         description "All topologies.";
         list topology {
           // Topology must be in the same routing-instance
           //  and of same AF as the container.
           key "name";
           description "OSPF topology.";
           leaf name {
             type leafref {
               path "../../../../../../../rt:ribs/rt:rib/rt:name";
             }
             description "RIB";
           }

     grouping area-scope-lsa
           container areas {
             description "All areas of the topology.";
             list area {
               key "area-id";
               description
                 "List of ospf areas";
               leaf area-id {
                 type area-id-type;
                 description
           "OSPF area-scope LSA.";
                   "Area ID.";
               }
               uses lsa-common;
       choice version {
         description
           "OSPFv2 or OSPFv3 LSA body.";
         container ospfv2 area-config;
               uses af-area-config {
                 when "../../../../../../rt:type "../../../../operation-mode = 'ospfv2'" "
                    + "'ospf:ships-in-the-night'" {
                   description "Applied to OSPFv2 only";
                     "Ships in the night configuration.";
                 }
           description "OSPFv2 LSA";
           uses ospfv2-lsa;
               }
         container ospfv3
             }
           }
         }
       }
     }

     augment "/rt:routing/rt:routing-instance/rt:routing-protocols/"
           + "rt:routing-protocol/ospf:ospf/ospf:instance/"
           + "ospf:areas/ospf:area/ospf:interfaces/ospf:interface" {
       when "../../../../../../rt:type = 'ospfv3'" 'ospf:ospfv2'" {
         description "Applied to OSPFv3 only";
           "This augment is only valid for OSPFv2.";
       }
       if-feature ospf:multi-topology;
       description "OSPFv3 LSA";
           uses ospfv3-lsa;
         }
       }
     }

     grouping as-scope-lsa "OSPF multi-topology interface augmentation.";
       container topologies {
         description
           "OSPF AS-scope LSA.";
       uses lsa-common;
       choice version "All topologies for the interface.";
         list topology {
           key "name";
           description
           "OSPFv2 or OSPFv3 LSA body.";
         container ospfv2 "OSPF interface topology.";
           leaf name {
           when "../../../../../rt:type = 'ospfv2'"
             type leafref {
               path "../../../../../../../../../../../"
                  + "rt:ribs/rt:rib/rt:name";
             }
             description "Applied to OSPFv2 only";
               "One of the topology enabled on this interface.";
           }
           leaf cost {
              type uint32;
              description "OSPFv2 LSA";
           uses ospfv2-lsa;
                "Interface cost for this topology.";
           }
         container ospfv3
         }
       }
     }

     augment "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocols/rt:routing-protocol" {
       when "../../../../../rt:type "rt:type = 'ospfv3'" 'ospf:ospfv2' or rt:type = 'ospf:ospfv3'"  {
         description "Applied to OSPFv3 only";
           "This augment is only valid for a routing protocol instance
            of type 'ospfv2' or 'ospfv3'.";
       }
       description "OSPFv3 LSA";
           uses ospfv3-lsa;
         }
       }
     }

     grouping lsa-key
            "OSPF operation state.";
       container ospf {
         description
         "OSPF LSA key."; "OSPF";

         leaf lsa-id operation-mode {
           type union identityref {
           type inet:ipv4-address;
           type uint32;
             base operation-mode;
           }
           description
           "LSA ID.";
             "OSPF operation mode.";
         }

         list instance {
           key "af";
           description
             "An OSPF routing protocol instance.";

           leaf adv-router af {
             type inet:ipv4-address;
         description
           "Advertising router."; identityref {
               base rt:address-family;
             }
             description
               "Address-family of the instance.";
           }

     grouping af-area-config

           uses instance-operation;

           container areas {
             description
         "OSPF address-family specific area config state."; "All areas";
             list range {
         key "prefix";
         description
           "Summarize routes matching address/mask (border
            routers only)"; area {
               key "area-id";
               description "List of OSPF areas";
               leaf prefix area-id {
                 type inet:ip-prefix; area-id-type;
                 description
             "IPv4 or IPv6 prefix"; "Area ID.";
               }
         leaf advertise

               container statistics {
           type boolean;
                 description
             "Advertise or hide."; "Per area statistics";
                 uses area-stat;
               }

               container virtual-links {
                 description "All virtual links.";
                 list virtual-link {
                   description
                     "OSPF virtual link";
                   leaf cost router-id {
                     type uint24 {
             range "0..16777214";
           } yang:dotted-quad;
                     description
             "Cost of summary route.";
                       "Virtual link router ID.";
                   }

                   uses interface-operation;
                 }
               }

     grouping area-config
               container sham-links {
                 description "All sham links.";
                 list sham-link {
                   description
                     "OSPF area config state."; sham link";
                   leaf area-type local-id {
                     type identityref {
           base area-type;
         }
         default normal; inet:ip-address;
                     description
           "Area type.";
                       "Address of the local end-point.";

                   }
                   leaf summary {
         when "../area-type = 'stub' or ../area-type = 'nssa'" remote-id {
                     type inet:ip-address;
                     description
             "Summary generation valid for stub/NSSA area.";
                       "Address of the remote end-point.";
                   }
         type boolean;
                   uses interface-operation;
                 }
               }

               container interfaces {
                 description
           "Enable/Disable summary generation to "All interfaces in the stub or
           NSSA area.";
       }

       leaf default-cost
                 list interface {
         when "../area-type = 'stub' or ../area-type = 'nssa'"
                   key "interface";
                   description
                     "List of OSPF interfaces.";
                   leaf interface {
                     // Should it refer to config state leaf?
                     type if:interface-ref;
                     description
               "Default cost for LSA advertised into stub or
               NSSA area."; "Interface.";
                   }
         type uint32

                   uses interface-operation;

                   container neighbors {
           range "1..16777215";
         }
                     description
           "Set "All neighbors on the summary default-cost for a stub or NSSA area.";
       }

       uses af-area-config interface.";
                     list neighbor {
         when "../../operation-mode = 'ospf:ships-in-the-night'"
                       key "neighbor-router-id";
                       description
                         "List of OSPF neighbors.";
                       leaf neighbor-router-id {
                         type yang:dotted-quad;
                         description
             "Ships in the night configuration.";
                           "Neighbor router ID.";
                       }

                       uses neighbor-operation;
                     } // list of OSPF neighbors
                   }

     grouping instance-config

                   container database {
                     description
         "OSPF instance config state.";
       leaf router-id "Link scope LSA database.";
                     list link-scope-lsa-type {
                       key "lsa-type";
                       description
                         "List OSPF link scope LSA databases.";
                       leaf lsa-type {
         if-feature router-id;
                         type yang:dotted-quad; uint16;
                         description
           "Defined in RFC 2328. A 32-bit number
            that uniquely identifies the router."; "OSPF link scope LSA type.";
                       }
                       container admin-distance link-scope-lsas {
                         description "Admin distance config state.";
         choice granularity
                           "All link scope LSAs of this LSA type.";
                         list link-scope-lsa {
                           key "lsa-id adv-router";
                           description
             "Options for expressing admin distance
              for intra-area and inter-area route";
           case detail "List of OSPF link scope LSAs";
                           uses lsa-key;
                           uses lsa {
             leaf intra-area
                             refine "version/ospfv2/ospfv2" {
               type uint8;
               description
                 "Admin distance for intra-area route.";
             }
             leaf inter-area
                               must "../../../../../../../../../../../"
                                  + "rt:type = 'ospfv2'" {
               type uint8;
                                 description
                 "Admin distance for inter-area route."; "OSPFv2 LSA.";
                               }
                             }
           case coarse
                             refine "version/ospfv3/ospfv3" {
             leaf internal
                               must "../../../../../../../../../../../"
                                  + "rt:type = 'ospfv3'" {
               type uint8;
                                 description
                 "Admin distance for both intra-area and
                  inter-area route."; "OSPFv3 LSA.";
                               }
                             }
                           }
         leaf external {
           type uint8;
           description
             "Admin distance for both external route.";
                         }
                       }

       container nsr {
         if-feature nsr;
         description
           "NSR config state.";
         leaf enable {
           type boolean;
           description
             "Enable/Disable NSR.";
                     } // list link-scope-lsas
                   }
                 } // list of OSPF interfaces
               }

               container graceful-restart database {
         if-feature graceful-restart;
                 description
           "Graceful restart config state.";
         leaf enable "Area scope LSA database.";
                 list area-scope-lsa-type {
           type boolean;
                   key "lsa-type";
                   description
             "Enable/Disable graceful restart as defined in RFC 3623.";
         } "List OSPF area scope LSA databases.";
                   leaf helper-enable lsa-type {
                     type boolean; uint16;
                     description
             "Enable RestartHelperSupport in RFC 3623 Section B.2."; "OSPF area scope LSA type.";
                   }
         leaf restart-interval
                   container area-scope-lsas {
           type uint16
                     description "All area scope LSA of this LSA type.";
                     list area-scope-lsa {
             range "1..1800";  // Range is defined in RFC 3623.
           }
           units seconds;
           default "120";  // Default is defined in RFC 3623.
                       key "lsa-id adv-router";
                       description
             "RestartInterval option in RFC 3623 Section B.1.";
         }
         leaf helper-strict-lsa-checking "List of OSPF area scope LSAs";
                       uses lsa-key;
                       uses lsa {
                         refine "version/ospfv2/ospfv2" {
                           must "../../../../../../../../../"
                              + "rt:type = 'ospfv2'" {
           type boolean;
                             description
             "RestartHelperStrictLSAChecking option in RFC 3623
             Section B.2."; "OSPFv2 LSA.";
                           }
                         }

       container protocol-shutdown
                         refine "version/ospfv3/ospfv3" {
         if-feature protocol-shutdown;
         description
           "Protocol shutdown config state.";
         leaf shutdown
                           must "../../../../../../../../../"
                              + "rt:type = 'ospfv3'" {
           type boolean;
                             description
             "Enable/Disable protocol shutdown."; "OSPFv3 LSA.";
                           }
                         }
                       }
                     }
                   }
                 } // list area-scope-lsas
               }
             } // list of OSPF areas
           }
           container auto-cost database {
         if-feature auto-cost;
             description
           "Auto cost config state.";
         leaf enable "AS scope LSA database.";
             list as-scope-lsa-type {
           type boolean;
               key "lsa-type";
               description
             "Enable/Disable auto cost.";
         } "List OSPF AS scope LSA databases.";
               leaf reference-bandwidth lsa-type {
                 type uint32 {
             range "1..4294967";
           }
           units Mbits; uint16;
                 description
             "Configure reference bandwidth in term of Mbits";
         } "OSPF AS scope LSA type.";
               }
               container maximum as-scope-lsas {
                 description
           "OSPF limits settings.";
         leaf paths {
           if-feature max-ecmp;
           type uint16 "All AS scope of LSA of this LSA type.";
                 list as-scope-lsa {
             range "1..32";
           }
                   key "lsa-id adv-router";
                   description
             "Maximum number "List of ECMP paths.";
         }
         leaf max-lsa OSPF area scope LSAs";
                   uses lsa-key;
                   uses lsa {
           if-feature max-lsa;
           type uint32
                     refine "version/ospfv2/ospfv2" {
                       must "../../../../../../../rt:type = 'ospfv2'" {
             range "1..4294967294";
           }
                         description
             "Maximum number of LSAs OSPF will receive."; "OSPFv2 LSA.";
                       }
                     }

       container mpls
                     refine "version/ospfv3/ospfv3" {
                       must "../../../../../../../rt:type = 'ospfv3'" {
                         description
           "OSPF MPLS config state."; "OSPFv3 LSA.";
                       }
                     }
                   }
                 }
               }
             } // list as-scope-lsas
           }

         } // list of instances
       } // container te-rid ospf
     }

     augment "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocols/rt:routing-protocol/"
           + "ospf:ospf/ospf:instance" {
       when "../../rt:type = 'ospf:ospfv2'" {
           if-feature te-rid;
         description
             "Traffic Engineering stable IP address
           "This augment is only valid for system.";
           choice source OSPFv2.";
       }
       if-feature multi-topology;
       description
         "OSPF multi-topology routing-protocol augmentation.";
       container topologies {
         description
               "Different options for specifying TE router ID.";
             case interface "All topologies.";
         list topology {
           // Topology must be in the same routing-instance
           // and of same AF as the container.
           key "name";
           description "OSPF topology.";
           leaf interface name {
             type if:interface-ref;
                 description
                   "Take the interface's IPv4 address as TE router ID."; leafref {
               path "../../../../../../../"
                  + "rt:ribs/rt:rib/rt:name";
             }
             description "RIB";
           }
             case explicit

           uses local-rib;

           container areas {
             description "All areas in the topology.";
             list area {
               key "area-id";
               description
                 "List of ospf areas";
               leaf router-id area-id {
                 type inet:ipv4-address; area-id-type;
                 description
                   "Explicitly configure the TE router
                   "Area ID.";
               }
             }
           }
         }
         container ldp
       }
     }
     augment "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocols/rt:routing-protocol/"
           + "ospf:ospf/ospf:instance/ospf:areas/ospf:area/"
           + "ospf:interfaces/ospf:interface" {
           description
             "OSPF MPLS LDP config state.";
           leaf igp-sync
       when "../../../../../../rt:type = 'ospf:ospfv2'" {
             if-feature ldp-igp-sync;
             type boolean;
         description
               "Enable LDP IGP synchronization.";
           "This augment is only valid for OSPFv2.";
       }
           leaf autoconfig {
       if-feature ldp-igp-autoconfig;
             type boolean; ospf:multi-topology;
       description
               "Enable LDP IGP "OSPF multi-topology interface auto-configuration.";
           }
         }
       }
     }

     grouping interface-operation augmentation.";
       container topologies {
         description "All topologies.";
         list topology {
           key "name";
           description "OSPF interface operation state.";
       reference "RFC2328 Section 9";
       uses interface-config; topology.";
           leaf state name {
             type if-state-type;
         description "Interface state.";
       }

       leaf hello-timer leafref {
         type uint32;
         units "milliseconds";
         description "Hello timer.";
               path "../../../../../../../../../../../"
                  + "rt:ribs/rt:rib/rt:name";
             }

       leaf wait-timer {
         type uint32;
         units "milliseconds";
             description "Wait timer.";
               "One of the topology enabled on this interface.";
           }

       leaf dr {
         type inet:ipv4-address;
         description "DR.";
         }

       leaf bdr {
         type inet:ipv4-address;
         description "BDR.";
       }
     } // interface-operation

     grouping neighbor-operation {
       description
         "OSPF neighbor operation data.";

       leaf address {
         type inet:ip-address;
         description
           "Neighbor address.";
       }
       leaf dr route-content {
         type inet:ipv4-address;
       description
           "Designated Router.";
       }
         "This grouping defines OSPF-specific route attributes.";
       leaf bdr metric {
         type inet:ipv4-address; uint32;
         description
           "Backup Designated Router."; "OSPF route metric.";
       }
       leaf state tag {
         type nbr-state-type; uint32;
         default "0";
         description "OSPF neighbor state.";
       } route tag.";
       }

     grouping instance-operation {
       description
         "OSPF Address Family operation state.";
       leaf router-id route-type {
         type yang:dotted-quad;
         description
           "Defined in RFC 2328. A 32-bit number
            that uniquely identifies the router."; route-type;
         description "OSPF route type";
       }
     }

     augment "/rt:routing/rt:routing-instance/rt:routing-protocols/" "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocol" "rt:ribs/rt:rib/rt:routes/rt:route" {
       when "rt:type "rt:source-protocol = 'ospf:ospfv2' or rt:type "
          + "rt:source-protocol = 'ospf:ospfv3'" {
         description
           "This augment is only valid for a routing routes whose source
            protocol instance
            of OSPF (type 'ospfv2' or 'ospfv3')."; is OSPF.";
         }
        description "OSPF augmentation.";

       container ospf {
         description
           "OSPF.";

         container all-instances-inherit {
           if-feature instance-inheritance;
           description
             "Inheritance support to all instances.";

           container area
          "OSPF-specific route attributes.";
        uses route-content;
     }

     identity if-link-type {
       description
               "Area config to be inherited by all areas in
               all instances.";
           }
           container "Base identity for OSPF interface link type.";
     }

     identity if-link-type-normal {
       base if-link-type;
       description
               "Interface config to be inherited by all interfaces
               in all instances.";
           } "OSPF interface link type normal.";
     }

         leaf operation-mode

     identity if-link-type-virtual-link {
       base if-link-type;
       description "OSPF interface link type identityref virtual link.";
     }

     identity if-link-type-sham-link {
       base operation-mode;
           }
           default ospf:ships-in-the-night; if-link-type;
       description "OSPF operation mode."; interface link type sham link.";
     }

         list instance

     grouping notification-instance-hdr {
           key "routing-instance af";
       description
             "An OSPF routing protocol instance.";
        "This group describes common instance specific
         data for notifications.";

       leaf routing-instance {
         type rt:routing-instance-ref;
         description
               "For protocol centric model, which is supported in
               default-instance only, this could reference any layer 3
               routing-instance.
               For routing-instance centric model, must reference
           "Describe the
               enclosing routing-instance."; routing instance.";
       }

       leaf af routing-protocol-type {
         type identityref leafref {
               base rt:address-family;
           path "/rt:routing/rt:routing-instance"
              + "[rt:name=current()/../routing-instance]/"
              + "rt:routing-protocols/rt:routing-protocol/"
              + "rt:type";
         }
         must ". = 'ospf:ospfv2' or . = 'ospf:ospfv3'" {
           description "Only interested in OSPF routing protocol";
         }
         description
               "Address-family
          "Describes the type of the instance."; OSPF routing protocol.";
       }

           uses instance-config;

           container all-areas-inherit

       leaf routing-protocol-name {
             if-feature area-inheritance;
             description
               "Inheritance for all areas.";
             container area
         type leafref {
               description
                 "Area config to be inherited by all areas.";
           path "/rt:routing/rt:routing-instance"
              + "[rt:name=current()/../routing-instance]/"
              + "rt:routing-protocols/rt:routing-protocol"
              + "[rt:type=current()/../routing-protocol-type]/"
              + "rt:name";
         }
             container interface {
         description
                 "Interface config to be inherited by all interfaces
                 in all areas.";
          "Describes the name of the OSPF routing protocol.";
       }

       leaf af {
         type leafref {
           path "/rt:routing/rt:routing-instance"
              + "[rt:name=current()/../routing-instance]/"
              + "rt:routing-protocols/rt:routing-protocol"
              + "[rt:name=current()/../routing-protocol-name]"
              + "[rt:type=current()/../routing-protocol-type]/"
              + "ospf:ospf/ospf:instance/af";
         }

           list area {
             key "area-id";
         description
               "List
           "Describes the address family of ospf areas"; the OSPF instance.";
       }
     }

     notification if-state-change {
       uses notification-instance-hdr;

       leaf area-id link-type {
         type area-id-type; identityref {
           base if-link-type;
         }
         description
                 "Area ID."; "Type of OSPF interface.";
       }

             uses area-config;

       container all-interfaces-inherit interface {
               if-feature interface-inheritance;
         description
                 "Inheritance for all interfaces";
               container "Normal interface.";
         leaf interface {
           type if:interface-ref;
           description
                   "Interface config to be inherited by all
                   interfaces."; "Interface.";
         }

       }

             list
       container virtual-link {
               when "../area-id != '0' and "
                  + "../area-type = 'normal'"
         description "virtual-link.";
         leaf area-id {
           type uint32;
           description
                   "Transit area must be non-backbone normal area."; "Area ID.";
         }
               key "router-id";
               description
                 "OSPF virtual link";
         leaf router-id neighbor-router-id {
           type yang:dotted-quad;
           description
                   "Virtual link "Neighbor router ID."; id.";
         }

               uses interface-common-config;
       }

             list
       container sham-link {
               key "local-id remote-id";
         description
                 "OSPF sham link"; "sham-link.";
         leaf local-id area-id {
           type uint32;
           description "Area ID.";
         }
         leaf local-ip-addr {
           type inet:ip-address;
           description
                   "Address of the "Sham link local end-point."; address.";
         }

         leaf remote-id remote-ip-addr {
           type inet:ip-address;
           description
                   "Address of the "Sham link remote end-point."; address.";
         }
               uses interface-common-config;
       }

             list interface {
               key "interface";
               description
                 "List of OSPF interfaces.";

       leaf interface state {
         type if:interface-ref; if-state-type;
         description
                   "Interface.";
               }
               uses interface-config;
             } // list of interfaces
           } // list of areas
         } // list of instance
       } // container ospf "Interface state.";
       }

     augment "/rt:routing/rt:routing-instance/rt:routing-protocols/"
           + "rt:routing-protocol/ospf:ospf/ospf:instance" {
       when "../../rt:type = 'ospf:ospfv2' or
             ../../rt:type = 'ospf:ospfv3'" {

       description
         "This augment notification is only valid for OSPF
           (type 'ospfv2' or 'ospfv3')."; sent when interface
         state change is detected.";
     }
       if-feature multi-topology;
       description
         "OSPF multi-topology routing-protocol augmentation.";
       list topology

     notification if-config-error {
         // Topology must be in the same routing-instance
         //  and
       uses notification-instance-hdr;

       leaf link-type {
         type identityref {
           base if-link-type;
         }
         description "Type of same AF as the container.
         key "name"; OSPF interface.";
       }
       container interface {
         description "OSPF topology."; "Normal interface.";
         leaf name interface {
           type rt:rib-ref; if:interface-ref;
           description "RIB"; "Interface.";
         }
         list area
         leaf packet-source {
           key "area-id";
           type yang:dotted-quad;
           description
             "List of ospf areas"; "Source address.";
         }
       }
       container virtual-link {
         description "virtual-link.";
         leaf area-id {
           type area-id-type; uint32;
           description "Area ID.";
         }
           uses area-config;
         }
         leaf neighbor-router-id {
           type yang:dotted-quad;
           description "Neighbor router id.";
         }
       }

     augment "/rt:routing/rt:routing-instance/rt:routing-protocols/"
           + "rt:routing-protocol/ospf:ospf/ospf:instance/"
           + "ospf:area/ospf:interface"

       container sham-link {
       when "../../../../rt:type = 'ospf:ospfv2'"
         description "sham-link.";
         leaf area-id {
           type uint32;
           description
           "This augment is only valid for OSPFv2."; "Area ID.";
         }
       if-feature ospf:multi-topology;
         leaf local-ip-addr {
           type inet:ip-address;
           description "OSPF multi-topology interface augmentation.";
       list topology "Sham link local address.";
         }

         leaf remote-ip-addr {
         key "name";
           type inet:ip-address;
           description "OSPF interface topology."; "Sham link remote address.";
         }
       }

       leaf name packet-type {
         type rt:rib-ref; packet-type;
         description
             "One of the topology enabled on this interface"; "OSPF packet type.";
       }

       leaf cost error {
         type uint32; enumeration {
           enum "badVersion" {
             description
              "Interface cost for this topology"; "Bad version.";
           }
           enum "areaMismatch" {
             description "Area mistmatch.";
           }
           enum "unknownNbmaNbr" {
             description "Unknown NBMA neighbor.";
           }

     augment "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocols/rt:routing-protocol"
           enum "unknownVirtualNbr" {
       when "rt:type = 'ospf:ospfv2' or rt:type = 'ospf:ospfv3'"
             description "Unknown virtual link neighbor.";
           }
           enum "authTypeMismatch" {
             description
           "This augment is only valid for a routing protocol instance
            of "Auth type 'ospfv2' or 'ospfv3'."; mismatch.";
           }
           enum "authFailure" {
             description
            "OSPF configuration.";
       container ospf "Auth failure.";
           }
           enum "netMaskMismatch" {
             description "OSPF"; "Network mask mismatch.";
           }
           enum "helloIntervalMismatch" {
             description "Hello interval mismatch.";
           }
           enum "deadIntervalMismatch" {
             description "Dead interval mismatch.";
           }
           enum "optionMismatch" {
             description "Option mismatch.";
           }
           enum "mtuMismatch" {
             description "MTU mismatch.";
           }
           enum "duplicateRouterId" {
             description "Duplicate router ID.";
           }
           enum "noError" {
             description "No error.";
           }
         }
         description "Error code.";
       }
       description
         "This notification is sent when interface
          config error is detected.";
     }

     notification nbr-state-change {
       uses notification-instance-hdr;
       leaf operation-mode link-type {
         type identityref {
           base operation-mode; if-link-type;
         }
         description
             "OSPF operation mode."; "Type of OSPF interface.";
       }

         list instance

       container interface {
           key "routing-instance af";
         description
             "An OSPF routing protocol instance."; "Normal interface.";
         leaf routing-instance interface {
           type rt:routing-instance-ref; if:interface-ref;
           description
               "For protocol centric model, which is supported in
               default-instance only, this could reference any layer 3
               routing-instance.
               For routing-instance centric model, must reference the
               enclosing routing-instance."; "Interface.";
         }
         leaf af neighbor-router-id {
           type identityref {
               base rt:address-family; yang:dotted-quad;
           description "Neighbor router id.";
         }
         leaf neighbor-ip-addr {
           type yang:dotted-quad;
           description
               "Address-family of the instance."; "Neighbor address.";
         }

           uses instance-operation;

           list area
       }
       container virtual-link {
             key "area-id";
         description "List of OSPF areas"; "virtual-link.";
         leaf area-id {
           type area-id-type; uint32;
           description "Area ID.";
         }
             list interface {
               key "interface";
               description
                 "List of OSPF interfaces.";
         leaf interface neighbor-router-id {
                 // Should it refer to config state leaf?
           type if:interface-ref; yang:dotted-quad;
           description "Interface."; "Neighbor router id.";
         }

               uses interface-operation;

               list neighbor
       }
       container sham-link {
                 key "neighbor-id";
         description
                   "List of OSPF neighbors."; "sham-link.";
         leaf neighbor-id area-id {
           type inet:ipv4-address; uint32;
           description
                     "Neighbor "Area ID.";
         }

                 uses neighbor-operation;
               } // list of OSPF neighbors

               list link-scope-lsas {
                 when "../../../../../rt:type = 'ospfv3'"
         leaf local-ip-addr {
           type inet:ip-address;
           description
                     "Link scope LSA only exists in OSPFv3.";
                 }
                 key "lsa-type";
                 description "List OSPF "Sham link scope LSA databases"; local address.";
         }
         leaf lsa-type neighbor-router-id {
           type uint8; yang:dotted-quad;
           description "OSPF link scope LSA type."; "Neighbor router id.";
         }
                 list link-scope-lsa
         leaf neighbor-ip-addr {
                   key "lsa-id adv-router";
           type yang:dotted-quad;
           description "List of OSPF link scope LSAs";
                   uses lsa-key;
                   uses link-scope-lsa;
                 } "Neighbor address.";
         } // list link-scope-lsas
       } // list of OSPF interfaces

             list area-scope-lsas {
               key "lsa-type";
               description "List OSPF area scope LSA databases";

       leaf lsa-type state {
           type uint8; nbr-state-type;
         description "OSPF area scope LSA type."; "Neighbor state.";
       }
               list area-scope-lsa {
                 key "lsa-id adv-router";

       description "List of OSPF area scope LSAs";
                 uses lsa-key;
                 uses area-scope-lsa;
               }
             } // list area-scope-lsas
         "This notification is sent when neighbor
          state change is detected.";
     } // list of OSPF areas

           list as-scope-lsas

     notification nbr-restart-helper-status-change {
             key "lsa-type";
             description "List OSPF AS scope LSA databases";
       uses notification-instance-hdr;

       leaf lsa-type link-type {
         type uint8;
               description "OSPF AS scope LSA type.";
             }
             list as-scope-lsa identityref {
               key "lsa-id adv-router";
           base if-link-type;
         }
         description "List "Type of OSPF AS scope LSAs";
               uses lsa-key;
               uses as-scope-lsa;
             }
           } // list as-scope-lsas
         } // list of instances interface.";
       } //

       container ospf
     }

     augment "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocols/rt:routing-protocol/"
           + "ospf:ospf/ospf:instance" interface {
       when "../../rt:type = 'ospf:ospfv2'"
         description "Normal interface.";
         leaf interface {
           type if:interface-ref;
           description
           "This augment is only valid for OSPFv2."; "Interface.";
         }
       if-feature multi-topology;
       description
         "OSPF multi-topology routing-protocol augmentation.";
       list topology
         leaf neighbor-router-id {
         // Topology must be in the same routing-instance
         // and of same AF as the container.
         key "name";
           type yang:dotted-quad;
           description "OSPF topology."; "Neighbor router id.";
         }
         leaf name neighbor-ip-addr {
           type rt:rib-ref; yang:dotted-quad;
           description "RIB"; "Neighbor address.";
         }
         list area
       }
       container virtual-link {
           key "area-id";
         description
             "List of ospf areas"; "virtual-link.";
         leaf area-id {
           type area-id-type; uint32;
           description "Area ID.";
         }
         leaf neighbor-router-id {
           type yang:dotted-quad;
           description "Neighbor router id.";
         }
       }

       leaf status {
         type restart-helper-status-type;
         description "Restart helper status.";
       }

     augment "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocols/rt:routing-protocol/"
           + "ospf:ospf/ospf:instance/ospf:area/ospf:interface"

       leaf age {
       when "../../../../rt:type = 'ospf:ospfv2'"
         type uint32;
         units seconds;
         description
           "Remaining time in current OSPF graceful restart
            interval, if the router is acting as a restart
            helper for the neighbor.";
       }

       leaf exit-reason {
         type restart-exit-reason-type;
         description
           "Restart helper exit reason.";
       }
       description
         "This augment notification is only valid for OSPFv2."; sent when neighbor restart
          helper status change is detected.";
     }

     notification rx-bad-packet {
       uses notification-instance-hdr;

       leaf link-type {
         type identityref {
           base if-link-type;
         }
       if-feature ospf:multi-topology;
         description "OSPF multi-topology "Type of OSPF interface.";
       }

       container interface augmentation.";
       list topology {
         key "name";
         description "OSPF interface topology."; "Normal interface.";
         leaf name interface {
           type rt:rib-ref; if:interface-ref;
           description
             "One of the topology enabled on this interface"; "Interface.";
         }
         leaf packet-source {
           type yang:dotted-quad;
           description "Source address.";
         }

       }

     grouping route-content
       container virtual-link {
         description
         "This grouping defines OSPF-specific route attributes."; "virtual-link.";
         leaf metric area-id {
           type uint32;
           description "OSPF route metric."; "Area ID.";
         }
         leaf tag neighbor-router-id {
           type uint32;
         default "0"; yang:dotted-quad;
           description "OSPF route tag."; "Neighbor router id.";
         }
       }

       container sham-link {
         description "sham-link.";
         leaf route-type area-id {
           type enumeration {
           enum intra-area { uint32;
           description "OSPF intra-area route"; "Area ID.";
         }
           enum inter-area
         leaf local-ip-addr {
           type inet:ip-address;
           description "OSPF inter-area route"; "Sham link local address.";
         }
           enum external-1

         leaf remote-ip-addr {
             description "OSPF external route
           type 1"; inet:ip-address;
           description "Sham link remote address.";
         }
           enum external-2
       }

       leaf packet-type {
         type packet-type;
         description "OSPF External route type 2"; packet type.";
       }
           enum nssa-1 {

       description "OSPF NSSA external route type 1";
         "This notification is sent when an OSPF packet
          has been received on a interface that cannot be parsed.";
     }
           enum nssa-2

     notification lsdb-approaching-overflow {
       uses notification-instance-hdr;

       leaf ext-lsdb-limit {
             description "OSPF NSSA external route
         type 2";
           }
         } uint32;
         description "OSPF route type";
           "The maximum number of non-default AS-external LSAs
            entries that can be stored in the link state database.";

       }

       description
         "This notification is sent when the number of LSAs
          in the router's link state database has exceeded
          ninety percent of the ext-lsdb-limit.";
     }

     augment "/rt:routing-state/rt:ribs/rt:rib/rt:routes/rt:route"

     notification lsdb-overflow {
       when "rt:source-protocol = 'ospf:ospfv2' or "
          + "rt:source-protocol = 'ospf:ospfv3'"
       uses notification-instance-hdr;

       leaf ext-lsdb-limit {
         type uint32;
         description
           "The maximum number of non-default AS-external LSAs
            entries that can be stored in the link state database.";
       }

       description
         "This augment is only valid for a routes whose source
            protocol notification is OSPF."; sent when the number of LSAs
          in the router's link state database has exceeded
          ext-lsdb-limit.";
     }
        description
          "OSPF-specific route attributes.";

     notification nssa-translator-status-change {
       uses route-content;
     }

     identity if-link-type notification-instance-hdr;

       leaf area-id {
         type uint32;
         description "Base identity for OSPF interface link type."; "Area ID.";
       }

     identity if-link-type-normal

       leaf status {
       base if-link-type;
       description "OSPF interface link
         type normal.";
     }

     identity if-link-type-virtual-link {
       base if-link-type; nssa-translator-state-type;
         description "OSPF interface link type virtual link.";
           "NSSA translator status.";
       }

     identity if-link-type-sham-link {
       base if-link-type;

       description "OSPF interface link type sham link.";
         "This notification is sent when there is a change
          in the router's ability to translate OSPF NSSA LSAs
          OSPF AS-External LSAs.";
     }

     grouping notification-instance-hdr

     notification restart-status-change {
       uses notification-instance-hdr;

       leaf status {
         type restart-status-type;
         description
        "This group describes common instance specific
         data for notifications.";
           "Restart status.";
       }

       leaf routing-instance restart-interval {
         type rt:routing-instance-ref; uint16 {
           range "1..1800";
         }
         units seconds;
         default "120";
         description
           "Describe the routing instance.";
           "Restart interval.";
       }

       leaf routing-protocol-name exit-reason {
         type string; restart-exit-reason-type;
         description
          "Describes
           "Restart exit reason.";
       }

       description
         "This notification is sent when the name of graceful restart
          state for the router has changed.";
     }
   }
   <CODE ENDS>

5.  OSPF routing protocol."; Segment Routing Yang Module

   <CODE BEGINS> file "ietf-ospf-sr@2015-07-06.yang"
   module ietf-ospf-sr {
     namespace "urn:ietf:params:xml:ns:yang:ietf-ospf-sr";

     prefix ospf-sr;

     import ietf-inet-types {
       prefix "inet";
     }

       container instance-af

     import ietf-yang-types {
         leaf af
       prefix "yang";
     }

     import ietf-routing {
           type identityref
       prefix "rt";
     }
     import ietf-segment-routing {
             base rt:address-family;
       prefix "sr";
     }
           description
             "Address-family of the instance.";
     import ietf-ospf {
       prefix "ospf";
     }

     organization
       "Cisco Systems
        170 West Tasman Drive
        San Jose, CA 95134-1706
        USA";

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

         WG Chair: Acee Lindem
                   <mailto:acee@cisco.com>

         WG Chair: Abhay Roy
                   <mailto:akr@cisco.com>

         Editor:   Derek Yeung
                   <mailto:myeung@cisco.com>
         Author:   Derek Yeung
                   <mailto:myeung@cisco.com>
         Author:   Yingzhen Qu
                   <mailto:yiqu@cisco.com>
         Author:   Jeffrey Zhang
                   <mailto:zzhang@juniper.net>
         Author:   Ing-Wher Chen
                   <mailto:ing-wher.chen@ericsson.com>
         Author:   Greg Hankins
                   <mailto:greg.hankins@alcatel-lucent.com>";

     description
          "Describes
       "This YANG module defines the address family generic configuration
        data for OSPF, which is common across all of the vendor
        implementations of the protocol. It is intended that the module
        will be extended by vendors to define vendor-specific
        OSPF instance.";
       }
     }

     notification if-state-change {
       uses notification-instance-hdr;

       leaf link-type {
         type identityref configuration parameters and policies,
        for example route maps or route policies.

        Terms and Acronyms

        OSPF (ospf): Open Shortest Path First

        IP (ip): Internet Protocol
        IPv4 (ipv4):Internet Protocol Version 4

        IPv6 (ipv6): Internet Protocol Version 6

        MTU (mtu) Maximum Transmission Unit
       ";

     revision 2015-07-06 {
           base if-link-type;
         }
       description "Type of
         "Initial revision.";
       reference
         "RFC XXXX: A YANG Data Model for OSPF interface."; Segment Routing";
     }

       container interface {
         description "Normal interface.";
         leaf interface

     feature ti-lfa {
           type if:interface-ref;
       description "Interface.";
         }
         "Enhance IPFRR with ti-lfa support";
     }
       container virtual-link

     /* Configuration */

     augment "/rt:routing/rt:routing-instance/rt:routing-protocols"
           + "/rt:routing-protocol/ospf:ospf/ospf:instance" {
         description "virtual-link.";
         leaf area-id
       when "../../rt:type = 'ospf:ospfv2' or "
          + "../../rt:type = 'ospf:ospfv3'" {
           type uint32;
         description "Area ID.";
         "This augment OSPF routing protocol when used";
       }
         leaf neighbor-router-id {
           type yang:dotted-quad;
       description "Neighbor router id.";
         }
        "This augments OSPF protocol configuration
         with segment routing.";
       uses sr:controlplane-cfg;
     }
       container sham-link

     augment "/rt:routing/rt:routing-instance/rt:routing-protocols/"
           + "rt:routing-protocol/ospf:ospf/ospf:instance/"
           + "ospf:areas/ospf:area/ospf:interfaces/ospf:interface" {
         description "sham-link.";
         leaf area-id
       when "../../../../../../rt:type = 'ospf:ospfv2' or "
          + "../../../../../../rt:type = 'ospf:ospfv3'" {
           type uint32;
         description "Area ID.";
         "This augment OSPF routing protocol when used";
       }
         leaf local-ip-addr {
           type inet:ip-address;
       description "Sham link local address.";
        "This augments OSPF protocol configuration
         with segment routing.";

       uses sr:igp-interface-cfg;
     }

         leaf remote-ip-addr
     augment "/rt:routing/rt:routing-instance/rt:routing-protocols/"
           + "rt:routing-protocol/ospf:ospf/ospf:instance/"
           + "ospf:areas/ospf:area/ospf:interfaces/ospf:interface/"
           + "ospf:fast-reroute" {
           type inet:ip-address;
           description "Sham link remote address.";
         }
       }

       leaf state
       when "../../../../../../../rt:type = 'ospf:ospfv2' or "
          + "../../../../../../../rt:type = 'ospf:ospfv3'" {
         type if-state-type;
         description "Interface state.";
       }
         description
           "This notification is sent augment OSPF routing protocol when interface
         state change is detected.";

     }

     notification if-config-error {
       uses notification-instance-hdr;

       leaf link-type {
         type identityref {
           base if-link-type; used";
       }
       description "Type of OSPF interface.";
       }
         "This augments ISIS IP FRR with TILFA.";

       container interface ti-lfa {
         description "Normal interface.";
         if-feature ti-lfa;
         leaf interface enable {
           type if:interface-ref; boolean;
           description "Interface.";
            "Enables TI-LFA computation.";
         }
         leaf packet-source {
           type yang:dotted-quad;
         description "Source address.";
           "TILFA configuration.";
       }
     }
       container virtual-link

     /* Operational states */

     augment "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocols/rt:routing-protocol/"
           + "ospf:ospf/ospf:instance" {
         description "virtual-link.";
         leaf area-id
       when "../../rt:type = 'ospf:ospfv2' or "
          + "../../rt:type = 'ospf:ospfv3'" {
           type uint32;
         description "Area ID.";
         "This augment OSPF routing protocol when used";
       }
         leaf neighbor-router-id
       description
        "This augments OSPF protocol configuration
         with segment routing.";

       uses sr:controlplane-cfg;
     }

     augment "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocols/rt:routing-protocol/"
           + "ospf:ospf/ospf:instance/ospf:areas/ospf:area/"
           + "ospf:interfaces/ospf:interface" {
       when "../../../../../../rt:type = 'ospf:ospfv2' or "
          + "../../../../../../rt:type = 'ospf:ospfv3'" {
           type yang:dotted-quad;
         description "Neighbor router id.";
         "This augment OSPF routing protocol when used";
       }
       description
        "This augments OSPF protocol configuration
         with segment routing.";

       uses sr:igp-interface-cfg;
     }

     /* Database */

     grouping sid-sub-tlv {
       description "SID/Label sub-tlv grouping.";
       container sham-link sid-sub-tlv {
         description "sham-link.";
           "Used to advertise the SID/Label associated with a prefix or
            adjacency.";
         leaf area-id sid {
           type uint32;
           description "Area ID."; "A 20 bit label or 32 bit SID.";
         }
         leaf local-ip-addr {
           type inet:ip-address;
           description "Sham link local address.";
       }

         leaf remote-ip-addr
     }

     grouping prefix-sid-sub-tlvs {
           type inet:ip-address;
       description "Sham link remote address.";
         }
       }

       leaf packet-type "Prefix SID sub-tlvs";
       container perfix-sid-sub-tlvs{
         description "prefix sid sub-tlv.";
         list prefix-sid-sub-tlv {
         type packet-type;
           description "OSPF packet type.";
       } "prefix sid sub-tlv.";
           leaf error flags {
             type enumeration {
           enum "badVersion" {
             description "Bad version";
           }
           enum "areaMismatch" bits {
             description "Area mistmatch";
           }
           enum "unknownNbmaNbr"
               bit NP {
                 description "Unknown NBMA neighbor";
                   "No-PHP flag.";
               }
           enum "unknownVirtualNbr"
               bit M {
                 description "Unknown virtual link neighbor";
                   "Mapping server flag.";
               }
           enum "authTypeMismatch"
               bit E {
                 description "Auth type mismatch";
                   "Explicit-NULL flag.";
               }
           enum "authFailure"
               bit V {
                 description "Auth failure";
                   "Value/Index flag.";
               }
           enum "netMaskMismatch"
               bit L {
                 description "Network mask mismatch";
                   "Local flag.";
               }
           enum "helloIntervalMismatch" {
             description "Hello interval mismatch";
             }
           enum "deadIntervalMismatch" {
             description "Dead interval mismatch"; "Flags.";
           }
           enum "optionMismatch"
           leaf mt-id {
             type uint8;
             description "Option mismatch"; "Multi-topology ID.";
           }
           enum "mtuMismatch"
           leaf algorithm {
             type uint8;
             description "MTU mismatch";
               "The algorithm the prefix-sid is associated with.";
           }
           enum "duplicateRouterId"
           leaf sid {
             type uint32;
             description "Duplicate router ID"; "An index or label.";
           }
           enum "noError" {
             description "No error";
         }
       }
         description "Error code.";
     }

     grouping sid-binding-sub-tlvs {
       description
         "This notification is sent when interface
         config error is detected.";
     }

     notification nbr-state-change "SID/Label binding sub-tlv grouping.";
       container sid-binding-sub-tlvs {
       uses notification-instance-hdr;
         description "sid binding sub-tlvs.";
         list sid-binding-sub-tlv {
           description "sid binding sub-tlv.";
           leaf link-type flags {
             type identityref bits {
               bit M {
           base if-link-type;
         }
                 description "Type of OSPF interface.";
                   "Mirroring context flag.";
               }
             }

       container interface {
             description "Normal interface."; "Flags.";
           }
           leaf interface mt-id {
             type if:interface-ref; uint8;
             description "Interface."; "Multi-topology ID.";
           }
           leaf neighbor-router-id weight {
             type yang:dotted-quad; uint8;
             description "Neighbor router id."; "Weight for load-balancing purposes.";
           }
           uses sid-sub-tlv;

           container ero-metric-sub-tlv {
             description "The cost of an ERO path.";
             leaf neighbor-ip-addr metric {
               type yang:dotted-quad; uint32;
               description "Neighbor address."; "The aggregate IGP or TE path cost.";
             }
           }

           container virtual-link ipv4-ero-sub-tlv {
             description "virtual-link.";
               "The ipv4 ERO sub-tlv describes a path segment
                            using ipv4 address.";
             leaf area-id flags {
               type uint32; bits {
                 bit L {
                   description "Area ID.";
                     "If set, then the segment path is designated as
                      'loose'. Otherwise as 'strict'.";
                 }
               }
               description "Flags.";
             }
             leaf neighbor-router-id ipv4-address {
               type yang:dotted-quad; inet:ipv4-address;
               description "Neighbor router id."; "The address of the explicit route hop.";
             }
           }
           container sham-link unnumbered-ero-sub-tlv {
             description "sham-link."; "The unnumbered interface ID ERO sub-tlv
                          describes a path segment that includes an
                          unnumbered interface.";
             leaf area-id flags {
               type uint32; bits {
                 bit L {
                   description "Area ID.";
                     "If set, then the segment path is designated as
                      'loose'. Otherwise as 'strict'.";
                 }
               }
         leaf local-ip-addr {
           type inet:ip-address;
               description "Sham link local address."; "Flags.";
             }
             leaf neighbor-router-id router-id {
               type yang:dotted-quad;
               description "Neighbor router id."; "Router-id of the next-hop.";
             }
             leaf neighbor-ip-addr interface-id {
               type yang:dotted-quad; uint32;
               description "Neighbor address.";
                 "The identifier assigned to the link by the
                                  router specified by the router-id.";
             }
           }
           container ipv4-backup-ero-sub-tlv {
             description
               "The ipv4 backup ERO sub-tlv describes a path
                            segment using ipv4 address.";
             leaf state flags {
               type nbr-state-type; bits {
                 bit L {
                   description "Neighbor state.";
                     "If set, then the segment path is designated as
                                  'loose'. Otherwise as 'strict'.";
                 }
               }
               description
         "This notification is sent when neighbor
         state change is detected."; "Flags.";
             }

     notification nbr-restart-helper-status-change {
       uses notification-instance-hdr;
             leaf link-type ipv4-address {
               type identityref {
           base if-link-type;
         } inet:ipv4-address;
               description "Type "The address of OSPF interface."; the explicit route hop.";
             }
           }
           container interface unnumbered-backup-ero-sub-tlv {
             description "Normal "The unnumbered interface ID backup ERO sub-tlv
                          describes a path segment that includes an
                          unnumbered interface.";
             leaf interface flags {
               type if:interface-ref; bits {
                 bit L {
                   description "Interface.";
                     "If set, then the segment path is designated as
                      'loose'. Otherwise as 'strict'.";
                 }
               }
               description "Flags.";
             }
             leaf neighbor-router-id router-id {
               type yang:dotted-quad;
               description "Neighbor router id."; "Router-id of the next-hop.";
             }
             leaf neighbor-ip-addr interface-id {
               type yang:dotted-quad; uint32;
               description "Neighbor address.";
                 "The identifier assigned to the link by the
                                   router specified by the router-id.";

             }
           }
         }
       }
     }

     grouping extended-prefix-range-tlvs {
       description "Extended prefix range TLV grouping.";

       container virtual-link extended-prefix-range-tlvs {
         description "virtual-link."; "The list of range of prefixes.";
         list extended-prefix-range-tlv {    //type=2?
           description "The range of prefixes.";
           leaf area-id range-size {
             type uint32; uint16;
             description "Area ID."; "The number of prefixes covered by the
                          advertisement.";
           }
           leaf neighbor-router-id flags {
             type yang:dotted-quad; bits {
               bit IA {
                 description "Neighbor router id.";
                   "Inter-Area flag.";
               }
             }
             description "Flags.";
           }
           leaf status prefix {
             type restart-helper-status-type; inet:ip-prefix;
             description "Restart helper status."; "Address prefix.";
           }

       leaf age
           uses prefix-sid-sub-tlvs;
           uses sid-binding-sub-tlvs;
           uses ospf:unknown-tlvs;
         }
       }
     }

     grouping sr-algorithm-tlv {
       description "SR algorithm TLV grouping.";
       container sr-algorithm-tlv {
         description "All SR algorithm TLVs.";
         leaf-list sr-algorithm {
           type uint32;
         units seconds; uint8;
           description
           "Remaining time in current OSPF graceful restart
           interval, if
             "The algorithms that the router is acting as a restart
           helper for the neighbor."; currently using.";
         }
       }

     }

     grouping sid-range-tlvs {
       description "sid-range-tlvs grouping.";
       container sid-range-tlvs {
         description "List of SID range TLVs.";
         list sid-range-tlv {
           description "SID range TLV.";
           leaf exit-reason range-size {
             type restart-exit-reason-type; ospf:uint24;
             description
           "Restart helper exit reason."; "The SID range.";
           }
           uses sid-sub-tlv;
         }
       }
     }

     augment "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocols/rt:routing-protocol/"
           + "ospf:ospf/ospf:instance/ospf:areas/ospf:area/"
           + "ospf:interfaces/ospf:interface/ospf:database/"
           + "ospf:link-scope-lsa-type/ospf:link-scope-lsas/"
           + "ospf:link-scope-lsa/ospf:version/ospf:ospfv2/"
           + "ospf:ospfv2/ospf:body/ospf:opaque/"
           + "ospf:extended-prefix-tlvs/ospf:extended-prefix-tlv" {
       when "../../../../../../../../../../../../../../../../../"
          + "rt:type = 'ospf:ospfv2'" {
         description
           "This notification augment is sent only valid for OSPFv2.";
       }
       description
         "SR specific TLVs for OSPFv2 extended prefix TLV
          in type 9 opaque LSA.";
       uses prefix-sid-sub-tlvs;
       uses sid-binding-sub-tlvs;
     }

     augment "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocols/rt:routing-protocol/"
           + "ospf:ospf/ospf:instance/ospf:areas/"
           + "ospf:area/ospf:database/"
           + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
           + "ospf:area-scope-lsa/ospf:version/ospf:ospfv2/"
           + "ospf:ospfv2/ospf:body/ospf:opaque/"
           + "ospf:extended-prefix-tlvs/ospf:extended-prefix-tlv" {
       when neighbor restart
         helper status change "../../../../../../../../../../../../../../../"
          + "rt:type = 'ospf:ospfv2'" {
         description
           "This augment is detected."; only valid for OSPFv2.";
       }

     notification rx-bad-packet {
       description
         "SR specific TLVs for OSPFv2 extended prefix TLV
          in type 10 opaque LSA.";
       uses notification-instance-hdr;

       leaf link-type prefix-sid-sub-tlvs;
       uses sid-binding-sub-tlvs;
     }

     augment "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocols/rt:routing-protocol/"
           + "ospf:ospf/ospf:instance/ospf:database/"
           + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
           + "ospf:as-scope-lsa/ospf:version/ospf:ospfv2/"
           + "ospf:ospfv2/ospf:body/ospf:opaque/"
           + "ospf:extended-prefix-tlvs/ospf:extended-prefix-tlv" {
         type identityref
       when "../../../../../../../../../../../../../"
          + "rt:type = 'ospf:ospfv2'" {
           base if-link-type;
         description
           "This augment is only valid for OSPFv2.";
       }
       description "Type of OSPF interface.";
         "SR specific TLVs for OSPFv2 extended prefix TLV
          in type 11 opaque LSA.";
       uses prefix-sid-sub-tlvs;
       uses sid-binding-sub-tlvs;
     }

       container interface

     augment "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocols/rt:routing-protocol/"
           + "ospf:ospf/ospf:instance/ospf:areas/"
           + "ospf:area/ospf:database/"
           + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
           + "ospf:area-scope-lsa/ospf:version/ospf:ospfv2/"
           + "ospf:ospfv2/ospf:body/ospf:opaque/"
           + "ospf:extended-link-tlvs/ospf:extended-link-tlv" {
         description "Normal interface.";
         leaf interface
       when "../../../../../../../../../../../../../../../"
          + "rt:type = 'ospf:ospfv2'" {
           type if:interface-ref;
         description "Interface.";
           "This augment is only valid for OSPFv2.";
       }
         leaf packet-source {
           type yang:dotted-quad;
       description "Source address.";
         }
       }
         "SR specific TLVs for OSPFv2 extended link TLV
          in type 10 opaque LSA.";

       container virtual-link adj-sid-sub-tlvs {
         description "virtual-link.";
         leaf area-id "Adj-sid is optional sub-tlv.";
         list adj-sid-sub-tlv {
           type uint32;
           description "Area ID.";
         } "List of adj-sid sub-tlv.";
           leaf neighbor-router-id flags {
             type yang:dotted-quad;
           description "Neighbor router id.";
         }
       }

       container sham-link bits {
         description "sham-link.";
         leaf area-id
               bit B {
           type uint32;
                 description "Area ID.";
                   "Backup flag.";
               }
         leaf local-ip-addr
               bit V {
           type inet:ip-address;
                 description "Sham link local address.";
                   "Value/Index flag.";
               }

         leaf remote-ip-addr
               bit L {
           type inet:ip-address;
                 description "Sham link remote address.";
                   "Local/Global flag.";
               }
       }

       leaf packet-type
               bit S {
         type packet-type;
         description "OSPF packet type.";
       }
                 description
         "This notification is sent when an OSPF packet
         has been received on a interface that cannot be parsed.";
                   "Set flag.";
               }

     notification lsdb-approaching-overflow {
       uses notification-instance-hdr;

       leaf ext-lsdb-limit {
         type uint32;
         description
           "The maximum number of non-default AS-external LSAs
           entries that can be stored in the link state database.";
             }
             description
         "This notification is sent when the number of LSAs
         in the router's link state database has exceeded
         ninety percent of the ext-lsdb-limit."; "Flags.";
           }

     notification lsdb-overflow {
       uses notification-instance-hdr;
           leaf ext-lsdb-limit mt-id {
             type uint32;
         description
           "The maximum number of non-default AS-external LSAs
           entries that can be stored in the link state database.";
       } uint8;
             description
         "This notification is sent when the number of LSAs
         in the router's link state database has exceeded
         ext-lsdb-limit."; "Multi-topology ID.";
           }

     notification nssa-translator-status-change
           leaf weight {
       uses notification-instance-hdr;
             type uint8;
             description "Weight used for load-balancing.";
           }
           leaf area-id sid {
             type uint32;
             description "Area ID."; "sid index/label.";
           }
         }
       }

       container lan-adj-sid-sub-tlvs {
         description "Lan adj-sid is optional sub-tlv.";
         list lan-adj-sid-sub-tlv {
           description "List of lan-adj-sid sub-tlv.";
           leaf status flags {
             type nssa-translator-state-type; bits {
               bit B {
                 description
           "NSSA translator status.";
                   "Backup flag.";
               }
               bit V {
                 description
         "This notification is sent when there is a change
         in the router's ability to translate OSPF NSSA LSAs
         OSPF AS-External LSAs.";
                   "Value/Index flag.";
               }

     notification restart-status-change
               bit L {
       uses notification-instance-hdr;
                 description
                   "Local/Global flag.";
               }
               bit S {
                 description
                   "Set flag.";
               }
             }
             description "Flags.";
           }
           leaf status mt-id {
             type restart-status-type; uint8;
             description
           "Restart status."; "Multi-topology ID.";
           }
           leaf restart-interval weight {
             type uint16 {
           range "1..1800"; uint8;
             description "Weight used for load-balancing.";
           }
         units seconds;
         default "120";
           leaf neighbor-router-id {
             type yang:dotted-quad;
             description
           "Restart interval."; "Neighbor router ID.";
           }
           leaf exit-reason sid {
             type restart-exit-reason-type; uint32;
             description
           "Restart exit reason."; "sid index/label.";
           }
         }
       }
     }

     augment "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocols/rt:routing-protocol/"
           + "ospf:ospf/ospf:instance/ospf:areas/ospf:area/"
           + "ospf:interfaces/ospf:interface/ospf:database/"
           + "ospf:link-scope-lsa-type/ospf:link-scope-lsas/"
           + "ospf:link-scope-lsa/ospf:version/ospf:ospfv2/"
           + "ospf:ospfv2/ospf:body/ospf:opaque" {
       when "../../../../../../../../../../../../../../../"
          + "rt:type = 'ospf:ospfv2'" {
         description
           "This augment is only valid for OSPFv2.";
       }

       description
         "SR specific TLVs for OSPFv2 type 9 opaque LSA.";

       uses extended-prefix-range-tlvs;
       uses sr-algorithm-tlv;
       uses sid-range-tlvs;
     }

     augment "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocols/rt:routing-protocol/"
           + "ospf:ospf/ospf:instance/ospf:areas/"
           + "ospf:area/ospf:database/"
           + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
           + "ospf:area-scope-lsa/ospf:version/ospf:ospfv2/"
           + "ospf:ospfv2/ospf:body/ospf:opaque" {
       when "../../../../../../../../../../../../../"
          + "rt:type = 'ospf:ospfv2'" {
         description
           "This notification augment is sent only valid for OSPFv2.";
       }

       description
         "SR specific TLVs for OSPFv2 type 10 opaque LSA.";

       uses extended-prefix-range-tlvs;
       uses sr-algorithm-tlv;
       uses sid-range-tlvs;
     }

     augment "/rt:routing-state/rt:routing-instance/"
           + "rt:routing-protocols/rt:routing-protocol/"
           + "ospf:ospf/ospf:instance/ospf:database/"
           + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
           + "ospf:as-scope-lsa/ospf:version/ospf:ospfv2/"
           + "ospf:ospfv2/ospf:body/ospf:opaque" {
       when the graceful restart
         state "../../../../../../../../../../../"
          + "rt:type = 'ospf:ospfv2'" {
         description
           "This augment is only valid for the router has changed."; OSPFv2.";
       }
       description
         "SR specific TLVs for OSPFv2 type 11 opaque LSA.";

       uses extended-prefix-range-tlvs;
       uses sr-algorithm-tlv;
       uses sid-range-tlvs;
     }
   }
   <CODE ENDS>

4.

6.  Security Considerations

   The data model defined does not create any security implications.

   This draft does not change any underlying security issues inherent in
   [I-D.ietf-netmod-routing-cfg].

5.

7.  Acknowledgements

   The authors wish to thank Acee Lindem, Yi Yang, Alexander Clemm,
   Gaurav Gupta, Ing-Wher Chen, Ladislav Lhotka, Stephane Litkowski and Litkowski,
   Greg Hankins and Manish Gupta for their thorough reviews and helpful
   comments.

   This document was produced using Marshall Rose's xml2rfc tool.

6.

8.  References

6.1.

8.1.  Normative References

   [RFC1793]  Moy, J., "Extending OSPF to Support Demand Circuits", RFC
              1793, April 1995.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC2328]  Moy, J., "OSPF Version 2", STD 54, RFC 2328, April 1998.

   [RFC3101]  Murphy, P., "The OSPF Not-So-Stubby Area (NSSA) Option",
              RFC 3101, January 2003.

   [RFC3623]  Moy, J., Pillay-Esnault, P., and A. Lindem, "Graceful OSPF
              Restart", RFC 3623, November 2003.

   [RFC3630]  Katz, D., Kompella, K., and D. Yeung, "Traffic Engineering
              (TE) Extensions to OSPF Version 2", RFC 3630, September
              2003.

   [RFC4577]  Rosen, E., Psenak, P., and P. Pillay-Esnault, "OSPF as the
              Provider/Customer Edge Protocol for BGP/MPLS IP Virtual
              Private Networks (VPNs)", RFC 4577, June 2006.

   [RFC4750]  Joyal, D., Galecki, P., Giacalone, S., Coltun, R., and F.
              Baker, "OSPF Version 2 Management Information Base", RFC
              4750, December 2006.

   [RFC5187]  Pillay-Esnault, P. and A. Lindem, "OSPFv3 Graceful
              Restart", RFC 5187, June 2008.

   [RFC5340]  Coltun, R., Ferguson, D., Moy, J., and A. Lindem, "OSPF
              for IPv6", RFC 5340, July 2008.

   [RFC5643]  Joyal, D. and V. Manral, "Management Information Base for
              OSPFv3", RFC 5643, August 2009.

   [RFC5838]  Lindem, A., Mirtorabi, S., Roy, A., Barnes, M., and R.
              Aggarwal, "Support of Address Families in OSPFv3", RFC
              5838, April 2010.

   [RFC6020]  Bjorklund, M., "YANG - A Data Modeling Language for the
              Network Configuration Protocol (NETCONF)", RFC 6020,
              October 2010.

   [RFC6241]  Enns, R., Bjorklund, M., Schoenwaelder, J., and A.
              Bierman, "Network Configuration Protocol (NETCONF)", RFC
              6241, June 2011.

   [RFC7223]  Bjorklund, M., "A YANG Data Model for Interface
              Management", RFC 7223, May 2014.

6.2.

8.2.  Informative References

   [I-D.acee-rtg-yang-key-chain]
              Lindem, A., Qu, Y., Yeung, D., Chen, H., Zhang, J., and Y.
              Yang, "Key Chain YANG Data Model", draft-acee-rtg-yang-
              key-chain-03
              key-chain-07 (work in progress), March July 2015.

   [I-D.ietf-netmod-routing-cfg]
              Lhotka, L. and A. Lindem, "A YANG Data Model for Routing
              Management", draft-ietf-netmod-routing-cfg-17 draft-ietf-netmod-routing-cfg-19 (work in
              progress), March May 2015.

   [I-D.litkowski-spring-sr-yang]
              Litkowski, S., Qu, Y., Sarkar, P., and J. Tantsura, "YANG
              Data Model for Segment Routing", draft-litkowski-spring-
              sr-yang-01 (work in progress), June 2015.

Authors' Addresses

   Derek Yeung
   Cisco Systems
   170 West Tasman Drive
   San Jose, CA  95134
   USA

   EMail: myeung@cisco.com
   Yingzhen Qu
   Cisco Systems
   170 West Tasman Drive
   San Jose, CA  95134
   USA

   EMail: yiqu@cisco.com

   Jeffrey Zhang
   Juniper Networks
   10 Technology Park Drive
   Westford, MA  01886
   USA

   EMail: zzhang@juniper.net

   Dean Bogdanovic
   Juniper Networks
   10 Technology Park Drive
   Westford, MA  01886
   USA

   EMail: deanb@juniper.net

   Kiran Agrahara Sreenivasa
   Brocade Communications System
   9442 Capital of Texas Hwy North
   Arboretum Plaza One, Suite 500
   Austin, TX  78759
   USA

   EMail: kkoushik@brocade.com