ietf-routing

This YANG module defines essential components for the management of a routing subsystem. Copyright (c) 2014 IETF Trust and the ...

  • Version: 2015-05-25

    ietf-routing@2015-05-25


    
      module ietf-routing {
    
        yang-version 1;
    
        namespace
          "urn:ietf:params:xml:ns:yang:ietf-routing";
    
        prefix rt;
    
        import ietf-yang-types {
          prefix yang;
        }
        import ietf-interfaces {
          prefix if;
        }
    
        organization
          "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
    
        contact
          "WG Web:   <http://tools.ietf.org/wg/netmod/>
    WG List:  <mailto:netmod@ietf.org>
    
    WG Chair: Thomas Nadeau
    	  <mailto:tnadeau@lucidvision.com>
    
    WG Chair: Juergen Schoenwaelder
    	  <mailto:j.schoenwaelder@jacobs-university.de>
    
    Editor:   Ladislav Lhotka
    	  <mailto:lhotka@nic.cz>";
    
        description
          "This YANG module defines essential components for the management
    of a routing subsystem.
    
    Copyright (c) 2014 IETF Trust and the persons identified as
    authors of the code. All rights reserved.
    
    Redistribution and use in source and binary forms, with or
    without modification, is permitted pursuant to, and subject to
    the license terms contained in, the Simplified BSD License set
    forth in Section 4.c of the IETF Trust's Legal Provisions
    Relating to IETF Documents
    (http://trustee.ietf.org/license-info).
    
    The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
    NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and
    'OPTIONAL' in the module text are to be interpreted as described
    in RFC 2119 (http://tools.ietf.org/html/rfc2119).
    
    This version of this YANG module is part of RFC XXXX
    (http://tools.ietf.org/html/rfcXXXX); see the RFC itself for
    full legal notices.";
    
        revision "2015-05-25" {
          description "Initial revision.";
          reference
            "RFC XXXX: A YANG Data Model for Routing Management";
    
        }
    
    
        feature multiple-ribs {
          description
            "This feature indicates that the server supports user-defined
    RIBs.
    
    Servers that do not advertise this feature SHOULD provide
    exactly one system-controlled RIB per routing-instance and
    supported address family and make them also the default RIBs.
    These RIBs then appear as entries of the list
    /routing-state/routing-instance/ribs/rib.";
        }
    
        feature router-id {
          description
            "This feature indicates that the server supports configuration
    of an explicit 32-bit router ID that is used by some routing
    protocols.
    
    Servers that do not advertise this feature set a router ID
    algorithmically, usually to one of configured IPv4 addresses.
    However, this algorithm is implementation-specific.";
        }
    
        identity address-family {
          description
            "Base identity from which identities describing address
    families are derived.";
        }
    
        identity ipv4 {
          base address-family;
          description
            "This identity represents IPv4 address family.";
        }
    
        identity ipv6 {
          base address-family;
          description
            "This identity represents IPv6 address family.";
        }
    
        identity routing-instance {
          description
            "Base identity from which identities describing routing
    instance types are derived.";
        }
    
        identity default-routing-instance {
          base routing-instance;
          description
            "This identity represents either a default routing instance, or
    the only routing instance on systems that do not support
    multiple instances.";
        }
    
        identity vrf-routing-instance {
          base routing-instance;
          description
            "This identity represents a VRF routing instance. The type is
    distinct from the default-routing-instance. There may be
    multiple vrf-routing-interfaces.";
        }
    
        identity routing-protocol {
          description
            "Base identity from which routing protocol identities are
    derived.";
        }
    
        identity direct {
          base routing-protocol;
          description
            "Routing pseudo-protocol that provides routes to directly
    connected networks.";
        }
    
        identity static {
          base routing-protocol;
          description
            "Static routing pseudo-protocol.";
        }
    
        typedef routing-instance-ref {
          type leafref {
            path "/rt:routing/rt:routing-instance/rt:name";
          }
          description
            "This type is used for leafs that reference a routing instance
    configuration.";
        }
    
        typedef routing-instance-state-ref {
          type leafref {
            path "/rt:routing-state/rt:routing-instance/rt:name";
          }
          description
            "This type is used for leafs that reference state data of a
    routing instance.";
        }
    
        typedef route-preference {
          type uint32;
          description
            "This type is used for route preferences.";
        }
    
        container routing-state {
          config false;
          description
            "State data of the routing subsystem.";
          list routing-instance {
            key "name";
            min-elements 1;
            description
              "Each list entry is a container for state data of a routing
    instance.
    
    An implementation MUST support routing instance(s) of the
    type 'rt:default-routing-instance', and MAY support other
    types. An implementation MAY restrict the number of routing
    instances of each supported type.
    
    An implementation SHOULD create at least one
    system-controlled instance, and MAY allow the clients to
    create user-controlled routing instances in
    configuration.";
            leaf name {
              type string;
              description
                "The name of the routing instance.
    
    For system-controlled instances the name is persistent,
    i.e., it SHOULD NOT change across reboots.";
            }
    
            leaf type {
              type identityref {
                base routing-instance;
              }
              description
                "The routing instance type.";
            }
    
            leaf router-id {
              type yang:dotted-quad;
              description
                "A 32-bit number in the form of a dotted quad that is used by
    some routing protocols identifying a router.";
              reference
                "RFC 2328: OSPF Version 2.";
    
            }
    
            container interfaces {
              description
                "Network layer interfaces belonging to the routing
    instance.";
              leaf-list interface {
                type if:interface-state-ref;
                description
                  "Each entry is a reference to the name of a configured
    network layer interface.";
              }
            }  // container interfaces
    
            container routing-protocols {
              description
                "Container for the list of routing protocol instances.";
              list routing-protocol {
                key "type name";
                description
                  "State data of a routing protocol instance.
    
    An implementation MUST provide exactly one
    system-controlled instance of the type 'direct'. Other
    instances MAY be created by configuration.";
                leaf type {
                  type identityref {
                    base routing-protocol;
                  }
                  description
                    "Type of the routing protocol.";
                }
    
                leaf name {
                  type string;
                  description
                    "The name of the routing protocol instance.
    
    For system-controlled instances this name is
    persistent, i.e., it SHOULD NOT change across
    reboots.";
                }
    
                container ospf {
                  description "OSPF";
                  leaf operation-mode {
                    type identityref {
                      base operation-mode;
                    }
                    description
                      "OSPF operation mode.";
                  }
    
                  list instance {
                    key "routing-instance af";
                    description
                      "An OSPF routing protocol instance.";
                    leaf routing-instance {
                      type 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 the
    enclosing routing-instance.";
                    }
    
                    leaf af {
                      type identityref {
                        base rt:address-family;
                      }
                      description
                        "Address-family of the instance.";
                    }
    
                    leaf router-id {
                      type yang:dotted-quad;
                      description
                        "Defined in RFC 2328. A 32-bit number
    that uniquely identifies the router.";
                    }
    
                    list area {
                      key "area-id";
                      description
                        "List of OSPF areas";
                      leaf area-id {
                        type area-id-type;
                        description "Area ID.";
                      }
    
                      list interface {
                        key "interface";
                        description
                          "List of OSPF interfaces.";
                        leaf interface {
                          type if:interface-ref;
                          description
                            "Interface.";
                        }
    
                        leaf network-type {
                          type enumeration {
                            enum "broadcast" {
                              value 0;
                              description
                                "Specify OSPF broadcast multi-access network.";
                            }
                            enum "non-broadcast" {
                              value 1;
                              description
                                "Specify OSPF Non-Broadcast Multi-Access
    (NBMA) network.";
                            }
                            enum
                              "point-to-multipoint" {
                              value 2;
                              description
                                "Specify OSPF point-to-multipoint network.";
                            }
                            enum
                              "point-to-point" {
                              value 3;
                              description
                                "Specify OSPF point-to-point network.";
                            }
                          }
                          description
                            "Network type.";
                        }
    
                        leaf passive {
                          type boolean;
                          description
                            "Enable/Disable passive.";
                        }
    
                        leaf demand-circuit {
                          if-feature demand-circuit;
                          type boolean;
                          description
                            "Enable/Disable demand circuit.";
                        }
    
                        container multi-area {
                          if-feature multi-area-adj;
                          description
                            "Configure ospf multi-area.";
                          leaf multi-area-id {
                            type area-id-type;
                            description
                              "Multi-area ID";
                          }
    
                          leaf cost {
                            type uint16;
                            description
                              "Interface cost for multi-area.";
                          }
                        }  // container multi-area
    
                        container static-neighbors {
                          description
                            "Static configured neighbors.";
                          list neighbor {
                            key "address";
                            description
                              "Specify a neighbor router.";
                            leaf address {
                              type inet:ip-address;
                              description
                                "Neighbor IP address.";
                            }
    
                            leaf cost {
                              type uint16 {
                                range "1..65535";
                              }
                              description
                                "Neighbor cost.";
                            }
    
                            leaf poll-interval {
                              type uint16 {
                                range "1..65535";
                              }
                              units "seconds";
                              description
                                "Neighbor poll interval.";
                            }
    
                            leaf priority {
                              type uint8 {
                                range "1..255";
                              }
                              description
                                "Neighbor priority for DR election.";
                            }
                          }  // list neighbor
                        }  // container static-neighbors
    
                        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 rtrPriority {
                          type uint8 {
                            range "0..255";
                          }
                          description
                            "Router priority for DR election.";
                        }
    
                        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 {
                          if-feature mtu-ignore;
                          type boolean;
                          description
                            "Enable/Disable ignoring of MTU in DBD packets.";
                        }
    
                        leaf lls {
                          if-feature lls;
                          type boolean;
                          description
                            "Enable/Disable link-local signaling (LLS) support.";
                        }
    
                        leaf prefix-suppression {
                          if-feature prefix-suppression;
                          type boolean;
                          description
                            "Suppress advertisement of the prefixes.";
                        }
    
                        leaf bfd {
                          if-feature bfd;
                          type boolean;
                          description
                            "Enable/disable bfd.";
                        }
    
                        container ttl-security {
                          if-feature ttl-security;
                          description
                            "TTL security check.";
                          leaf enable {
                            type boolean;
                            description
                              "Enable/Disable TTL security check.";
                          }
    
                          leaf hops {
                            type uint8 {
                              range "1..254";
                            }
                            description
                              "Maximum number of hops that a OSPF packet may
    have traveled.";
                          }
                        }  // container ttl-security
    
                        container protocol-shutdown {
                          if-feature protocol-if-shutdown;
                          description
                            "Protocol shutdown interface config state.";
                          leaf shutdown {
                            type boolean;
                            description
                              "Enable/Disable protocol shutdown on the interface.";
                          }
                        }  // container protocol-shutdown
    
                        container authentication {
                          description
                            "Authentication configuration.";
                          choice auth-type-selection {
                            description
                              "Options for expressing authentication setting";
                            case auth-ipsec {
                              when
                                "../../../../../rt:type = 'ospfv3'" {
                                description
                                  "Applied to OSPFv3 only";
                              }
                              if-feature ospfv3-authentication-ipsec;
                              leaf sa {
                                type string;
                                description
                                  "SA name";
                              }
                            }  // case auth-ipsec
                            leaf key-chain {
                              type key-chain:key-chain-ref;
                              description
                                "key-chain name";
                            }
    
                            case auth-trailer-key {
                              leaf key {
                                type string;
                                description
                                  "Key string in ASCII format.";
                              }
    
                              container crypto-algorithm {
                                description
                                  "Cryptographic algorithm associated with key.";
                                choice algorithm {
                                  description
                                    "Options for crytographic algorithm specification.";
                                  case hmac-sha-1-12 {
                                    if-feature crypto-hmac-sha-1-12;
                                    leaf hmac-sha1-12 {
                                      type empty;
                                      description
                                        "The HMAC-SHA-1-12 algorithm.";
                                    }
                                  }  // case hmac-sha-1-12
                                  leaf md5 {
                                    type empty;
                                    description
                                      "The MD5 algorithm.";
                                  }
                                  leaf sha-1 {
                                    type empty;
                                    description
                                      "The SHA-1 algorithm.";
                                  }
                                  leaf hmac-sha-1 {
                                    type empty;
                                    description
                                      "HMAC-SHA-1 authentication algorithm.";
                                  }
                                  leaf hmac-sha-256 {
                                    type empty;
                                    description
                                      "HMAC-SHA-256 authentication algorithm.";
                                  }
                                  leaf hmac-sha-384 {
                                    type empty;
                                    description
                                      "HMAC-SHA-384 authentication algorithm.";
                                  }
                                  leaf hmac-sha-512 {
                                    type empty;
                                    description
                                      "HMAC-SHA-512 authentication algorithm.";
                                  }
                                }  // choice algorithm
                              }  // container crypto-algorithm
                            }  // case auth-trailer-key
                          }  // choice auth-type-selection
                        }  // container authentication
    
                        leaf state {
                          type if-state-type;
                          description
                            "Interface state.";
                        }
    
                        leaf hello-timer {
                          type uint32;
                          units "milliseconds";
                          description
                            "Hello timer.";
                        }
    
                        leaf wait-timer {
                          type uint32;
                          units "milliseconds";
                          description
                            "Wait timer.";
                        }
    
                        leaf dr {
                          type inet:ipv4-address;
                          description "DR.";
                        }
    
                        leaf bdr {
                          type inet:ipv4-address;
                          description "BDR.";
                        }
    
                        list neighbor {
                          key "neighbor-id";
                          description
                            "List of OSPF neighbors.";
                          leaf neighbor-id {
                            type inet:ipv4-address;
                            description
                              "Neighbor ID.";
                          }
    
                          leaf address {
                            type inet:ip-address;
                            description
                              "Neighbor address.";
                          }
    
                          leaf dr {
                            type inet:ipv4-address;
                            description
                              "Designated Router.";
                          }
    
                          leaf bdr {
                            type inet:ipv4-address;
                            description
                              "Backup Designated Router.";
                          }
    
                          leaf state {
                            type nbr-state-type;
                            description
                              "OSPF neighbor state.";
                          }
                        }  // list neighbor
    
                        list link-scope-lsas {
                          when
                            "../../../../../rt:type = 'ospfv3'" {
                            description
                              "Link scope LSA only exists in OSPFv3.";
                          }
                          key "lsa-type";
                          description
                            "List OSPF link scope LSA databases";
                          leaf lsa-type {
                            type uint8;
                            description
                              "OSPF link scope LSA type.";
                          }
    
                          list link-scope-lsa {
                            key "lsa-id adv-router";
                            description
                              "List of OSPF link scope LSAs";
                            leaf lsa-id {
                              type union {
                                type inet:ipv4-address;
                                type uint32;
                              }
                              description
                                "LSA ID.";
                            }
    
                            leaf adv-router {
                              type inet:ipv4-address;
                              description
                                "Advertising router.";
                            }
    
                            leaf decoded-completed {
                              type boolean;
                              description
                                "The OSPF LSA body is fully decoded.";
                            }
    
                            leaf raw-data {
                              type yang:hex-string;
                              description
                                "The complete LSA in network byte
    order as received/sent over the wire.";
                            }
    
                            choice version {
                              description
                                "OSPFv2 or OSPFv3 LSA body.";
                              container ospfv2 {
                                when
                                  "../../../../../../../rt:type = 'ospf:ospfv2'" {
                                  description
                                    "Applied to OSPFv2 only";
                                }
                                description
                                  "OSPFv2 LSA";
                                container header {
                                  description
                                    "Decoded OSPFv2 LSA header data.";
                                  leaf option {
                                    type bits {
                                      bit DC {
                                        position
                                          0;
                                        description
                                          "When set, the router support demand circuits.";
                                      }
                                      bit P {
                                        position
                                          1;
                                        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 {
                                        position
                                          2;
                                        description
                                          "When set, the router support MOSPF.";
                                      }
                                      bit E {
                                        position
                                          3;
                                        description
                                          "This bit describes the way AS-external-LSAs
    are flooded";
                                      }
                                    }
                                    mandatory
                                      true;
                                    description
                                      "LSA option.";
                                  }
    
                                  leaf lsa-id {
                                    type inet:ipv4-address;
                                    mandatory
                                      true;
                                    description
                                      "LSA ID.";
                                  }
    
                                  leaf opaque-type {
                                    when
                                      "../../header/type = 9 or ../../header/type = 10 or ../../header/type = 11" {
                                      description
                                        "Only apply to opaque LSA.";
                                    }
                                    type uint8;
                                    mandatory
                                      true;
                                    description
                                      "Opaque type.";
                                  }
    
                                  leaf opaque-id {
                                    when
                                      "../../header/type = 9 or ../../header/type = 10 or ../../header/type = 11" {
                                      description
                                        "Only apply to opaque LSA.";
                                    }
                                    type uint24;
                                    mandatory
                                      true;
                                    description
                                      "Opaque id.";
                                  }
    
                                  leaf age {
                                    type uint16;
                                    mandatory
                                      true;
                                    description
                                      "LSA age.";
                                  }
    
                                  leaf type {
                                    type uint16;
                                    mandatory
                                      true;
                                    description
                                      "LSA type.";
                                  }
    
                                  leaf adv-router {
                                    type yang:dotted-quad;
                                    mandatory
                                      true;
                                    description
                                      "LSA advertising router.";
                                  }
    
                                  leaf seq-num {
                                    type uint32;
                                    mandatory
                                      true;
                                    description
                                      "LSA sequence number.";
                                  }
    
                                  leaf checksum {
                                    type uint16;
                                    mandatory
                                      true;
                                    description
                                      "LSA checksum.";
                                  }
    
                                  leaf length {
                                    type uint16;
                                    mandatory
                                      true;
                                    description
                                      "LSA length.";
                                  }
                                }  // container header
    
                                container body {
                                  description
                                    "Decoded OSPFv2 LSA body data.";
                                  container router {
                                    when
                                      "../../header/type = 1" {
                                      description
                                        "Only apply to Router-LSA.";
                                    }
                                    description
                                      "Router LSA.";
                                    leaf flags {
                                      type bits {
                                        bit V {
                                          position
                                            0;
                                          description
                                            "When set, the router is an endpoint of one or
    more virtual links.";
                                        }
                                        bit E {
                                          position
                                            1;
                                          description
                                            "When set, the router is an AS Boundary Router
    (ASBR).";
                                        }
                                        bit B {
                                          position
                                            2;
                                          description
                                            "When set, the router is an Area Border Router (ABR).";
                                        }
                                      }
                                      description
                                        "Flags";
                                    }
    
                                    leaf num-of-links {
                                      type uint16;
                                      description
                                        "Number of links.";
                                    }
    
                                    list link {
                                      key "link-id link-data";
                                      description
                                        "Router LSA link.";
                                      leaf link-id {
                                        type union {
                                          type inet:ipv4-address;
                                          type yang:dotted-quad;
                                        }
                                        description
                                          "Link ID";
                                      }
    
                                      leaf link-data {
                                        type union {
                                          type inet:ipv4-address;
                                          type uint32;
                                        }
                                        description
                                          "Link data.";
                                      }
    
                                      leaf type {
                                        type uint8;
                                        description
                                          "Link type.";
                                      }
    
                                      list topology {
                                        key "mt-id";
                                        description
                                          "Topology specific information.";
                                        leaf mt-id {
                                          type uint8;
                                          description
                                            "The MT-ID for topology enabled on the link.";
                                        }
    
                                        leaf metric {
                                          type uint16;
                                          description
                                            "Metric for the topology.";
                                        }
                                      }  // list topology
                                    }  // list link
                                  }  // container router
    
                                  container network {
                                    when
                                      "../../header/type = 2" {
                                      description
                                        "Only apply to network LSA.";
                                    }
                                    description
                                      "Network LSA.";
                                    leaf network-mask {
                                      type inet:ipv4-address;
                                      description
                                        "The IP address mask for the network";
                                    }
    
                                    leaf-list attached-router {
                                      type yang:dotted-quad;
                                      description
                                        "List of the routers attached to the network.";
                                    }
                                  }  // container network
    
                                  container summary {
                                    when
                                      "../../header/type = 3 or ../../header/type = 4" {
                                      description
                                        "Only apply to Summary-LSA.";
                                    }
                                    description
                                      "Summary LSA.";
                                    leaf network-mask {
                                      type inet:ipv4-address;
                                      description
                                        "The IP address mask for the network";
                                    }
    
                                    list topology {
                                      key "mt-id";
                                      description
                                        "Topology specific information.";
                                      leaf mt-id {
                                        type uint8;
                                        description
                                          "The MT-ID for topology enabled on the link.";
                                      }
    
                                      leaf metric {
                                        type uint24;
                                        description
                                          "Metric for the topology.";
                                      }
                                    }  // list topology
                                  }  // container summary
    
                                  container external {
                                    when
                                      "../../header/type = 5 or ../../header/type = 7" {
                                      description
                                        "Only apply to AS-external-LSA and NSSA-LSA.";
                                    }
                                    description
                                      "External LSA.";
                                    leaf network-mask {
                                      type inet:ipv4-address;
                                      description
                                        "The IP address mask for the network";
                                    }
    
                                    list topology {
                                      key "mt-id";
                                      description
                                        "Topology specific information.";
                                      leaf mt-id {
                                        type uint8;
                                        description
                                          "The MT-ID for topology enabled on the link.";
                                      }
    
                                      leaf flags {
                                        type bits {
                                          bit
                                            E {
                                            position
                                              0;
                                            description
                                              "When set, the metric specified is a Type 2
    external metric.";
                                          }
                                        }
                                        description
                                          "Flags.";
                                      }
    
                                      leaf metric {
                                        type uint24;
                                        description
                                          "Metric for the topology.";
                                      }
    
                                      leaf forwarding-address {
                                        type inet:ipv4-address;
                                        description
                                          "Forwarding address.";
                                      }
    
                                      leaf external-route-tag {
                                        type uint32;
                                        description
                                          "Route tag.";
                                      }
                                    }  // list topology
                                  }  // container external
    
                                  container opaque {
                                    when
                                      "../../header/type = 9 or ../../header/type = 10 or ../../header/type = 11" {
                                      description
                                        "Only apply to opaque LSA.";
                                    }
                                    description
                                      "Opaque LSA.";
                                    list unknown-tlv {
                                      key "type";
                                      description
                                        "Unknown TLV.";
                                      leaf type {
                                        type uint16;
                                        description
                                          "TLV type.";
                                      }
    
                                      leaf length {
                                        type uint16;
                                        description
                                          "TLV length.";
                                      }
    
                                      leaf value {
                                        type yang:hex-string;
                                        description
                                          "TLV value.";
                                      }
                                    }  // list unknown-tlv
    
                                    container router-address-tlv {
                                      description
                                        "Router address TLV.";
                                      leaf router-address {
                                        type inet:ipv4-address;
                                        description
                                          "Router address.";
                                      }
                                    }  // container router-address-tlv
    
                                    container link-tlv {
                                      description
                                        "Link TLV.";
                                      leaf link-type {
                                        type uint8;
                                        mandatory
                                          true;
                                        description
                                          "Link type.";
                                      }
    
                                      leaf link-id {
                                        type union {
                                          type inet:ipv4-address;
                                          type yang:dotted-quad;
                                        }
                                        mandatory
                                          true;
                                        description
                                          "Link ID.";
                                      }
    
                                      leaf-list local-if-ipv4-addr {
                                        type inet:ipv4-address;
                                        description
                                          "List of local interface IPv4 addresses.";
                                      }
    
                                      leaf-list local-remote-ipv4-addr {
                                        type inet:ipv4-address;
                                        description
                                          "List of remote interface IPv4 addresses.";
                                      }
    
                                      leaf te-metric {
                                        type uint32;
                                        description
                                          "TE metric.";
                                      }
    
                                      leaf max-bandwidth {
                                        type decimal64 {
                                          fraction-digits
                                            2;
                                        }
                                        description
                                          "Maximum bandwidth.";
                                      }
    
                                      leaf max-reservable-bandwidth {
                                        type decimal64 {
                                          fraction-digits
                                            2;
                                        }
                                        description
                                          "Maximum reservable bandwidth.";
                                      }
    
                                      leaf unreserved-bandwidth {
                                        type decimal64 {
                                          fraction-digits
                                            2;
                                        }
                                        description
                                          "Unreserved bandwidth.";
                                      }
    
                                      leaf admin-group {
                                        type uint32;
                                        description
                                          "Administrative group/Resource class/Color.";
                                      }
    
                                      list unknown-subtlv {
                                        key "type";
                                        description
                                          "Unknown sub-TLV.";
                                        leaf type {
                                          type uint16;
                                          description
                                            "TLV type.";
                                        }
    
                                        leaf length {
                                          type uint16;
                                          description
                                            "TLV length.";
                                        }
    
                                        leaf value {
                                          type yang:hex-string;
                                          description
                                            "TLV value.";
                                        }
                                      }  // list unknown-subtlv
                                    }  // container link-tlv
                                  }  // container opaque
                                }  // container body
                              }  // container ospfv2
                              container ospfv3 {
                                when
                                  "../../../../../../../rt:type = 'ospfv3'" {
                                  description
                                    "Applied to OSPFv3 only";
                                }
                                description
                                  "OSPFv3 LSA";
                                container header {
                                  description
                                    "Decoded OSPFv3 LSA header data.";
                                  leaf lsa-id {
                                    type uint32;
                                    mandatory
                                      true;
                                    description
                                      "LSA ID.";
                                  }
    
                                  leaf age {
                                    type uint16;
                                    mandatory
                                      true;
                                    description
                                      "LSA age.";
                                  }
    
                                  leaf type {
                                    type uint16;
                                    mandatory
                                      true;
                                    description
                                      "LSA type.";
                                  }
    
                                  leaf adv-router {
                                    type yang:dotted-quad;
                                    mandatory
                                      true;
                                    description
                                      "LSA advertising router.";
                                  }
    
                                  leaf seq-num {
                                    type uint32;
                                    mandatory
                                      true;
                                    description
                                      "LSA sequence number.";
                                  }
    
                                  leaf checksum {
                                    type uint16;
                                    mandatory
                                      true;
                                    description
                                      "LSA checksum.";
                                  }
    
                                  leaf length {
                                    type uint16;
                                    mandatory
                                      true;
                                    description
                                      "LSA length.";
                                  }
                                }  // container header
    
                                container body {
                                  description
                                    "Decoded OSPF LSA body data.";
                                  container router {
                                    when
                                      "../../header/type = 8193" {
                                      description
                                        "Only apply to Router-LSA.";
                                    }
                                    description
                                      "Router LSA.";
                                    leaf flags {
                                      type bits {
                                        bit V {
                                          position
                                            0;
                                          description
                                            "When set, the router is an endpoint of one or
    more virtual links.";
                                        }
                                        bit E {
                                          position
                                            1;
                                          description
                                            "When set, the router is an AS Boundary Router
    (ASBR).";
                                        }
                                        bit B {
                                          position
                                            2;
                                          description
                                            "When set, the router is an Area Border Router (ABR).";
                                        }
                                        bit Nt {
                                          position
                                            3;
                                          description
                                            "When set, the router is an NSSA border router
    that is unconditionally translating NSSA-LSAs
    into AS-external-LSAs.";
                                        }
                                      }
                                      mandatory
                                        true;
                                      description
                                        "LSA option.";
                                    }
    
                                    leaf options {
                                      type bits {
                                        bit DC {
                                          position
                                            0;
                                          description
                                            "When set, the router support demand circuits.";
                                        }
                                        bit R {
                                          position
                                            1;
                                          description
                                            "When set, the originator is an active router.";
                                        }
                                        bit N {
                                          position
                                            2;
                                          description
                                            "If set, the router is attached to an NSSA";
                                        }
                                        bit E {
                                          position
                                            3;
                                          description
                                            "This bit describes the way AS-external-LSAs
    
    are flooded";
                                        }
                                        bit V6 {
                                          position
                                            4;
                                          description
                                            "If clear, the router/link should be excluded
    from IPv6 routing calculaton";
                                        }
                                      }
                                      mandatory
                                        true;
                                      description
                                        "OSPFv3 LSA options.";
                                    }
    
                                    list link {
                                      key "interface-id neighbor-interface-id neighbor-router-id";
                                      description
                                        "Router LSA link.";
                                      leaf interface-id {
                                        type 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.";
                                      }
                                    }  // list link
                                  }  // container router
    
                                  container network {
                                    when
                                      "../../header/type = 8194" {
                                      description
                                        "Only apply to network LSA.";
                                    }
                                    description
                                      "Network LSA.";
                                    leaf options {
                                      type bits {
                                        bit DC {
                                          position
                                            0;
                                          description
                                            "When set, the router support demand circuits.";
                                        }
                                        bit R {
                                          position
                                            1;
                                          description
                                            "When set, the originator is an active router.";
                                        }
                                        bit N {
                                          position
                                            2;
                                          description
                                            "If set, the router is attached to an NSSA";
                                        }
                                        bit E {
                                          position
                                            3;
                                          description
                                            "This bit describes the way AS-external-LSAs
    
    are flooded";
                                        }
                                        bit V6 {
                                          position
                                            4;
                                          description
                                            "If clear, the router/link should be excluded
    from IPv6 routing calculaton";
                                        }
                                      }
                                      mandatory
                                        true;
                                      description
                                        "OSPFv3 LSA options.";
                                    }
    
                                    leaf-list attached-router {
                                      type yang:dotted-quad;
                                      description
                                        "List of the routers attached to the network.";
                                    }
                                  }  // container network
    
                                  container inter-area-prefix {
                                    when
                                      "../../header/type = 8195" {
                                      description
                                        "Only apply to inter-area-prefix LSA.";
                                    }
                                    description
                                      "Inter-Area-Prefix LSA.";
                                    leaf metric {
                                      type uint24;
                                      description
                                        "Metric";
                                    }
    
                                    leaf prefix {
                                      type inet:ip-prefix;
                                      description
                                        "Prefix";
                                    }
    
                                    leaf prefix-options {
                                      type bits {
                                        bit NU {
                                          position
                                            0;
                                          description
                                            "When set, the prefix should be excluded
    from IPv6 unicast calculations.";
                                        }
                                        bit LA {
                                          position
                                            1;
                                          description
                                            "When set, the prefix is actually an IPv6 interface
    address of the Advertising Router.";
                                        }
                                        bit P {
                                          position
                                            2;
                                          description
                                            "When set, the NSSA area prefix should be
    readvertised by the translating NSSA area border.";
                                        }
                                        bit DN {
                                          position
                                            3;
                                          description
                                            "When set, the inter-area-prefix-LSA or
    AS-external-LSA prefix has been advertised in a VPN
    environment.";
                                        }
                                      }
                                      mandatory
                                        true;
                                      description
                                        "Prefix options.";
                                    }
                                  }  // container inter-area-prefix
    
                                  container inter-area-router {
                                    when
                                      "../../header/type = 8196" {
                                      description
                                        "Only apply to inter-area-router LSA.";
                                    }
                                    description
                                      "Inter-Area-Router LSA.";
                                    leaf options {
                                      type bits {
                                        bit DC {
                                          position
                                            0;
                                          description
                                            "When set, the router support demand circuits.";
                                        }
                                        bit R {
                                          position
                                            1;
                                          description
                                            "When set, the originator is an active router.";
                                        }
                                        bit N {
                                          position
                                            2;
                                          description
                                            "If set, the router is attached to an NSSA";
                                        }
                                        bit E {
                                          position
                                            3;
                                          description
                                            "This bit describes the way AS-external-LSAs
    
    are flooded";
                                        }
                                        bit V6 {
                                          position
                                            4;
                                          description
                                            "If clear, the router/link should be excluded
    from IPv6 routing calculaton";
                                        }
                                      }
                                      mandatory
                                        true;
                                      description
                                        "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.";
                                    }
                                  }  // container inter-area-router
    
                                  container as-external {
                                    when
                                      "../../header/type = 16389" {
                                      description
                                        "Only apply to as-external LSA.";
                                    }
                                    description
                                      "AS-External LSA.";
                                    leaf metric {
                                      type uint24;
                                      description
                                        "Metric";
                                    }
    
                                    leaf flags {
                                      type bits {
                                        bit E {
                                          position
                                            0;
                                          description
                                            "When set, the metric specified is a Type 2
    external metric.";
                                        }
                                      }
                                      description
                                        "Flags.";
                                    }
    
                                    leaf referenced-ls-type {
                                      type uint16;
                                      description
                                        "Referenced Link State type.";
                                    }
    
                                    leaf prefix {
                                      type inet:ip-prefix;
                                      description
                                        "Prefix";
                                    }
    
                                    leaf prefix-options {
                                      type bits {
                                        bit NU {
                                          position
                                            0;
                                          description
                                            "When set, the prefix should be excluded
    from IPv6 unicast calculations.";
                                        }
                                        bit LA {
                                          position
                                            1;
                                          description
                                            "When set, the prefix is actually an IPv6 interface
    address of the Advertising Router.";
                                        }
                                        bit P {
                                          position
                                            2;
                                          description
                                            "When set, the NSSA area prefix should be
    readvertised by the translating NSSA area border.";
                                        }
                                        bit DN {
                                          position
                                            3;
                                          description
                                            "When set, the inter-area-prefix-LSA or
    AS-external-LSA prefix has been advertised in a VPN
    environment.";
                                        }
                                      }
                                      mandatory
                                        true;
                                      description
                                        "Prefix options.";
                                    }
    
                                    leaf forwarding-address {
                                      type inet:ipv6-address;
                                      description
                                        "Forwarding address.";
                                    }
    
                                    leaf external-route-tag {
                                      type uint32;
                                      description
                                        "Route tag.";
                                    }
    
                                    leaf referenced-link-state-id {
                                      type uint32;
                                      description
                                        "Referenced Link State ID.";
                                    }
                                  }  // container as-external
    
                                  container nssa {
                                    when
                                      "../../header/type = 8199" {
                                      description
                                        "Only apply to nssa LSA.";
                                    }
                                    description
                                      "NSSA LSA.";
                                    leaf metric {
                                      type uint24;
                                      description
                                        "Metric";
                                    }
    
                                    leaf flags {
                                      type bits {
                                        bit E {
                                          position
                                            0;
                                          description
                                            "When set, the metric specified is a Type 2
    external metric.";
                                        }
                                      }
                                      description
                                        "Flags.";
                                    }
    
                                    leaf referenced-ls-type {
                                      type uint16;
                                      description
                                        "Referenced Link State type.";
                                    }
    
                                    leaf prefix {
                                      type inet:ip-prefix;
                                      description
                                        "Prefix";
                                    }
    
                                    leaf prefix-options {
                                      type bits {
                                        bit NU {
                                          position
                                            0;
                                          description
                                            "When set, the prefix should be excluded
    from IPv6 unicast calculations.";
                                        }
                                        bit LA {
                                          position
                                            1;
                                          description
                                            "When set, the prefix is actually an IPv6 interface
    address of the Advertising Router.";
                                        }
                                        bit P {
                                          position
                                            2;
                                          description
                                            "When set, the NSSA area prefix should be
    readvertised by the translating NSSA area border.";
                                        }
                                        bit DN {
                                          position
                                            3;
                                          description
                                            "When set, the inter-area-prefix-LSA or
    AS-external-LSA prefix has been advertised in a VPN
    environment.";
                                        }
                                      }
                                      mandatory
                                        true;
                                      description
                                        "Prefix options.";
                                    }
    
                                    leaf forwarding-address {
                                      type inet:ipv6-address;
                                      description
                                        "Forwarding address.";
                                    }
    
                                    leaf external-route-tag {
                                      type uint32;
                                      description
                                        "Route tag.";
                                    }
    
                                    leaf referenced-link-state-id {
                                      type uint32;
                                      description
                                        "Referenced Link State ID.";
                                    }
                                  }  // container nssa
    
                                  container link {
                                    when
                                      "../../header/type = 8" {
                                      description
                                        "Only apply to link LSA.";
                                    }
                                    description
                                      "Link LSA.";
                                    leaf rtr-priority {
                                      type uint8;
                                      description
                                        "Router Priority of the interface.";
                                    }
    
                                    leaf options {
                                      type bits {
                                        bit DC {
                                          position
                                            0;
                                          description
                                            "When set, the router support demand circuits.";
                                        }
                                        bit R {
                                          position
                                            1;
                                          description
                                            "When set, the originator is an active router.";
                                        }
                                        bit N {
                                          position
                                            2;
                                          description
                                            "If set, the router is attached to an NSSA";
                                        }
                                        bit E {
                                          position
                                            3;
                                          description
                                            "This bit describes the way AS-external-LSAs
    
    are flooded";
                                        }
                                        bit V6 {
                                          position
                                            4;
                                          description
                                            "If clear, the router/link should be excluded
    from IPv6 routing calculaton";
                                        }
                                      }
                                      mandatory
                                        true;
                                      description
                                        "OSPFv3 LSA options.";
                                    }
    
                                    leaf link-local-interface-address {
                                      type inet:ipv6-address;
                                      description
                                        "The originating router's link-local
    interface address on the link.";
                                    }
    
                                    leaf num-of-prefixes {
                                      type uint32;
                                      description
                                        "Number of prefixes.";
                                    }
    
                                    list prefix {
                                      key "prefix";
                                      description
                                        "List of prefixes associated with the link.";
                                      leaf prefix {
                                        type inet:ip-prefix;
                                        description
                                          "Prefix";
                                      }
    
                                      leaf prefix-options {
                                        type bits {
                                          bit
                                            NU {
                                            position
                                              0;
                                            description
                                              "When set, the prefix should be excluded
    from IPv6 unicast calculations.";
                                          }
                                          bit
                                            LA {
                                            position
                                              1;
                                            description
                                              "When set, the prefix is actually an IPv6 interface
    address of the Advertising Router.";
                                          }
                                          bit
                                            P {
                                            position
                                              2;
                                            description
                                              "When set, the NSSA area prefix should be
    readvertised by the translating NSSA area border.";
                                          }
                                          bit
                                            DN {
                                            position
                                              3;
                                            description
                                              "When set, the inter-area-prefix-LSA or
    AS-external-LSA prefix has been advertised in a VPN
    environment.";
                                          }
                                        }
                                        mandatory
                                          true;
                                        description
                                          "Prefix options.";
                                      }
                                    }  // list prefix
                                  }  // container link
    
                                  container intra-area-prefix {
                                    when
                                      "../../header/type = 8201" {
                                      description
                                        "Only apply to intra-area-prefix LSA.";
                                    }
                                    description
                                      "Intra-Area-Prefix LSA.";
                                    leaf referenced-ls-type {
                                      type uint16;
                                      description
                                        "Referenced Link State type.";
                                    }
    
                                    leaf referenced-link-state-id {
                                      type uint32;
                                      description
                                        "Referenced Link State ID.";
                                    }
    
                                    leaf referenced-adv-router {
                                      type inet:ipv4-address;
                                      description
                                        "Referenced Advertising Router.";
                                    }
    
                                    leaf num-of-prefixes {
                                      type uint16;
                                      description
                                        "Number of prefixes.";
                                    }
    
                                    list prefix {
                                      key "prefix";
                                      description
                                        "List of prefixes associated with the link.";
                                      leaf prefix {
                                        type inet:ip-prefix;
                                        description
                                          "Prefix";
                                      }
    
                                      leaf prefix-options {
                                        type bits {
                                          bit
                                            NU {
                                            position
                                              0;
                                            description
                                              "When set, the prefix should be excluded
    from IPv6 unicast calculations.";
                                          }
                                          bit
                                            LA {
                                            position
                                              1;
                                            description
                                              "When set, the prefix is actually an IPv6 interface
    address of the Advertising Router.";
                                          }
                                          bit
                                            P {
                                            position
                                              2;
                                            description
                                              "When set, the NSSA area prefix should be
    readvertised by the translating NSSA area border.";
                                          }
                                          bit
                                            DN {
                                            position
                                              3;
                                            description
                                              "When set, the inter-area-prefix-LSA or
    AS-external-LSA prefix has been advertised in a VPN
    environment.";
                                          }
                                        }
                                        mandatory
                                          true;
                                        description
                                          "Prefix options.";
                                      }
    
                                      leaf metric {
                                        type uint24;
                                        description
                                          "Metric";
                                      }
                                    }  // list prefix
                                  }  // container intra-area-prefix
                                }  // container body
                              }  // container ospfv3
                            }  // choice version
                          }  // list link-scope-lsa
                        }  // list link-scope-lsas
    
                        list topology {
                          key "name";
                          description
                            "OSPF interface topology.";
                          leaf name {
                            type leafref {
                              path "/rt:routing/rt:routing-instance/rt:ribs/rt:rib/rt:name";
                            }
                            description
                              "One of the topology enabled on this interface";
                          }
                        }  // list topology
    
                        leaf hello-in {
                          type uint32;
                          description
                            "Hello in packets count";
                        }
    
                        leaf hello-out {
                          type uint32;
                          description
                            "Hello out packets count";
                        }
    
                        leaf db-desc-in {
                          type uint32;
                          description
                            "DB descriptor in packets count";
                        }
    
                        leaf db-desc-out {
                          type uint32;
                          description
                            "DB descriptor out packets count";
                        }
    
                        leaf ls-req-in {
                          type uint32;
                          description
                            "LS request in in packets count";
                        }
    
                        leaf ls-req-out {
                          type uint32;
                          description
                            "LS request out packets count";
                        }
    
                        leaf ls-upd-in {
                          type uint32;
                          description
                            "LS update in packets count";
                        }
    
                        leaf ls-upd-out {
                          type uint32;
                          description
                            "LS update out packets count";
                        }
    
                        leaf ls-ack-in {
                          type uint32;
                          description
                            "LS ack in packets count";
                        }
    
                        leaf ls-ack-out {
                          type uint32;
                          description
                            "LS ack out packets count";
                        }
    
                        leaf discarded {
                          type uint32;
                          description
                            "Discarded packets count";
                        }
                      }  // list interface
    
                      list area-scope-lsas {
                        key "lsa-type";
                        description
                          "List OSPF area scope LSA databases";
                        leaf lsa-type {
                          type uint8;
                          description
                            "OSPF area scope LSA type.";
                        }
    
                        list area-scope-lsa {
                          key "lsa-id adv-router";
                          description
                            "List of OSPF area scope LSAs";
                          leaf lsa-id {
                            type union {
                              type inet:ipv4-address;
                              type uint32;
                            }
                            description
                              "LSA ID.";
                          }
    
                          leaf adv-router {
                            type inet:ipv4-address;
                            description
                              "Advertising router.";
                          }
    
                          leaf decoded-completed {
                            type boolean;
                            description
                              "The OSPF LSA body is fully decoded.";
                          }
    
                          leaf raw-data {
                            type yang:hex-string;
                            description
                              "The complete LSA in network byte
    order as received/sent over the wire.";
                          }
    
                          choice version {
                            description
                              "OSPFv2 or OSPFv3 LSA body.";
                            container ospfv2 {
                              when
                                "../../../../../../rt:type = 'ospf:ospfv2'" {
                                description
                                  "Applied to OSPFv2 only";
                              }
                              description
                                "OSPFv2 LSA";
                              container header {
                                description
                                  "Decoded OSPFv2 LSA header data.";
                                leaf option {
                                  type bits {
                                    bit DC {
                                      position
                                        0;
                                      description
                                        "When set, the router support demand circuits.";
                                    }
                                    bit P {
                                      position
                                        1;
                                      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 {
                                      position
                                        2;
                                      description
                                        "When set, the router support MOSPF.";
                                    }
                                    bit E {
                                      position
                                        3;
                                      description
                                        "This bit describes the way AS-external-LSAs
    are flooded";
                                    }
                                  }
                                  mandatory
                                    true;
                                  description
                                    "LSA option.";
                                }
    
                                leaf lsa-id {
                                  type inet:ipv4-address;
                                  mandatory
                                    true;
                                  description
                                    "LSA ID.";
                                }
    
                                leaf opaque-type {
                                  when
                                    "../../header/type = 9 or ../../header/type = 10 or ../../header/type = 11" {
                                    description
                                      "Only apply to opaque LSA.";
                                  }
                                  type uint8;
                                  mandatory
                                    true;
                                  description
                                    "Opaque type.";
                                }
    
                                leaf opaque-id {
                                  when
                                    "../../header/type = 9 or ../../header/type = 10 or ../../header/type = 11" {
                                    description
                                      "Only apply to opaque LSA.";
                                  }
                                  type uint24;
                                  mandatory
                                    true;
                                  description
                                    "Opaque id.";
                                }
    
                                leaf age {
                                  type uint16;
                                  mandatory
                                    true;
                                  description
                                    "LSA age.";
                                }
    
                                leaf type {
                                  type uint16;
                                  mandatory
                                    true;
                                  description
                                    "LSA type.";
                                }
    
                                leaf adv-router {
                                  type yang:dotted-quad;
                                  mandatory
                                    true;
                                  description
                                    "LSA advertising router.";
                                }
    
                                leaf seq-num {
                                  type uint32;
                                  mandatory
                                    true;
                                  description
                                    "LSA sequence number.";
                                }
    
                                leaf checksum {
                                  type uint16;
                                  mandatory
                                    true;
                                  description
                                    "LSA checksum.";
                                }
    
                                leaf length {
                                  type uint16;
                                  mandatory
                                    true;
                                  description
                                    "LSA length.";
                                }
                              }  // container header
    
                              container body {
                                description
                                  "Decoded OSPFv2 LSA body data.";
                                container router {
                                  when
                                    "../../header/type = 1" {
                                    description
                                      "Only apply to Router-LSA.";
                                  }
                                  description
                                    "Router LSA.";
                                  leaf flags {
                                    type bits {
                                      bit V {
                                        position
                                          0;
                                        description
                                          "When set, the router is an endpoint of one or
    more virtual links.";
                                      }
                                      bit E {
                                        position
                                          1;
                                        description
                                          "When set, the router is an AS Boundary Router
    (ASBR).";
                                      }
                                      bit B {
                                        position
                                          2;
                                        description
                                          "When set, the router is an Area Border Router (ABR).";
                                      }
                                    }
                                    description
                                      "Flags";
                                  }
    
                                  leaf num-of-links {
                                    type uint16;
                                    description
                                      "Number of links.";
                                  }
    
                                  list link {
                                    key "link-id link-data";
                                    description
                                      "Router LSA link.";
                                    leaf link-id {
                                      type union {
                                        type inet:ipv4-address;
                                        type yang:dotted-quad;
                                      }
                                      description
                                        "Link ID";
                                    }
    
                                    leaf link-data {
                                      type union {
                                        type inet:ipv4-address;
                                        type uint32;
                                      }
                                      description
                                        "Link data.";
                                    }
    
                                    leaf type {
                                      type uint8;
                                      description
                                        "Link type.";
                                    }
    
                                    list topology {
                                      key "mt-id";
                                      description
                                        "Topology specific information.";
                                      leaf mt-id {
                                        type uint8;
                                        description
                                          "The MT-ID for topology enabled on the link.";
                                      }
    
                                      leaf metric {
                                        type uint16;
                                        description
                                          "Metric for the topology.";
                                      }
                                    }  // list topology
                                  }  // list link
                                }  // container router
    
                                container network {
                                  when
                                    "../../header/type = 2" {
                                    description
                                      "Only apply to network LSA.";
                                  }
                                  description
                                    "Network LSA.";
                                  leaf network-mask {
                                    type inet:ipv4-address;
                                    description
                                      "The IP address mask for the network";
                                  }
    
                                  leaf-list attached-router {
                                    type yang:dotted-quad;
                                    description
                                      "List of the routers attached to the network.";
                                  }
                                }  // container network
    
                                container summary {
                                  when
                                    "../../header/type = 3 or ../../header/type = 4" {
                                    description
                                      "Only apply to Summary-LSA.";
                                  }
                                  description
                                    "Summary LSA.";
                                  leaf network-mask {
                                    type inet:ipv4-address;
                                    description
                                      "The IP address mask for the network";
                                  }
    
                                  list topology {
                                    key "mt-id";
                                    description
                                      "Topology specific information.";
                                    leaf mt-id {
                                      type uint8;
                                      description
                                        "The MT-ID for topology enabled on the link.";
                                    }
    
                                    leaf metric {
                                      type uint24;
                                      description
                                        "Metric for the topology.";
                                    }
                                  }  // list topology
                                }  // container summary
    
                                container external {
                                  when
                                    "../../header/type = 5 or ../../header/type = 7" {
                                    description
                                      "Only apply to AS-external-LSA and NSSA-LSA.";
                                  }
                                  description
                                    "External LSA.";
                                  leaf network-mask {
                                    type inet:ipv4-address;
                                    description
                                      "The IP address mask for the network";
                                  }
    
                                  list topology {
                                    key "mt-id";
                                    description
                                      "Topology specific information.";
                                    leaf mt-id {
                                      type uint8;
                                      description
                                        "The MT-ID for topology enabled on the link.";
                                    }
    
                                    leaf flags {
                                      type bits {
                                        bit E {
                                          position
                                            0;
                                          description
                                            "When set, the metric specified is a Type 2
    external metric.";
                                        }
                                      }
                                      description
                                        "Flags.";
                                    }
    
                                    leaf metric {
                                      type uint24;
                                      description
                                        "Metric for the topology.";
                                    }
    
                                    leaf forwarding-address {
                                      type inet:ipv4-address;
                                      description
                                        "Forwarding address.";
                                    }
    
                                    leaf external-route-tag {
                                      type uint32;
                                      description
                                        "Route tag.";
                                    }
                                  }  // list topology
                                }  // container external
    
                                container opaque {
                                  when
                                    "../../header/type = 9 or ../../header/type = 10 or ../../header/type = 11" {
                                    description
                                      "Only apply to opaque LSA.";
                                  }
                                  description
                                    "Opaque LSA.";
                                  list unknown-tlv {
                                    key "type";
                                    description
                                      "Unknown TLV.";
                                    leaf type {
                                      type uint16;
                                      description
                                        "TLV type.";
                                    }
    
                                    leaf length {
                                      type uint16;
                                      description
                                        "TLV length.";
                                    }
    
                                    leaf value {
                                      type yang:hex-string;
                                      description
                                        "TLV value.";
                                    }
                                  }  // list unknown-tlv
    
                                  container router-address-tlv {
                                    description
                                      "Router address TLV.";
                                    leaf router-address {
                                      type inet:ipv4-address;
                                      description
                                        "Router address.";
                                    }
                                  }  // container router-address-tlv
    
                                  container link-tlv {
                                    description
                                      "Link TLV.";
                                    leaf link-type {
                                      type uint8;
                                      mandatory
                                        true;
                                      description
                                        "Link type.";
                                    }
    
                                    leaf link-id {
                                      type union {
                                        type inet:ipv4-address;
                                        type yang:dotted-quad;
                                      }
                                      mandatory
                                        true;
                                      description
                                        "Link ID.";
                                    }
    
                                    leaf-list local-if-ipv4-addr {
                                      type inet:ipv4-address;
                                      description
                                        "List of local interface IPv4 addresses.";
                                    }
    
                                    leaf-list local-remote-ipv4-addr {
                                      type inet:ipv4-address;
                                      description
                                        "List of remote interface IPv4 addresses.";
                                    }
    
                                    leaf te-metric {
                                      type uint32;
                                      description
                                        "TE metric.";
                                    }
    
                                    leaf max-bandwidth {
                                      type decimal64 {
                                        fraction-digits
                                          2;
                                      }
                                      description
                                        "Maximum bandwidth.";
                                    }
    
                                    leaf max-reservable-bandwidth {
                                      type decimal64 {
                                        fraction-digits
                                          2;
                                      }
                                      description
                                        "Maximum reservable bandwidth.";
                                    }
    
                                    leaf unreserved-bandwidth {
                                      type decimal64 {
                                        fraction-digits
                                          2;
                                      }
                                      description
                                        "Unreserved bandwidth.";
                                    }
    
                                    leaf admin-group {
                                      type uint32;
                                      description
                                        "Administrative group/Resource class/Color.";
                                    }
    
                                    list unknown-subtlv {
                                      key "type";
                                      description
                                        "Unknown sub-TLV.";
                                      leaf type {
                                        type uint16;
                                        description
                                          "TLV type.";
                                      }
    
                                      leaf length {
                                        type uint16;
                                        description
                                          "TLV length.";
                                      }
    
                                      leaf value {
                                        type yang:hex-string;
                                        description
                                          "TLV value.";
                                      }
                                    }  // list unknown-subtlv
                                  }  // container link-tlv
                                }  // container opaque
                              }  // container body
                            }  // container ospfv2
                            container ospfv3 {
                              when
                                "../../../../../../rt:type = 'ospfv3'" {
                                description
                                  "Applied to OSPFv3 only";
                              }
                              description
                                "OSPFv3 LSA";
                              container header {
                                description
                                  "Decoded OSPFv3 LSA header data.";
                                leaf lsa-id {
                                  type uint32;
                                  mandatory
                                    true;
                                  description
                                    "LSA ID.";
                                }
    
                                leaf age {
                                  type uint16;
                                  mandatory
                                    true;
                                  description
                                    "LSA age.";
                                }
    
                                leaf type {
                                  type uint16;
                                  mandatory
                                    true;
                                  description
                                    "LSA type.";
                                }
    
                                leaf adv-router {
                                  type yang:dotted-quad;
                                  mandatory
                                    true;
                                  description
                                    "LSA advertising router.";
                                }
    
                                leaf seq-num {
                                  type uint32;
                                  mandatory
                                    true;
                                  description
                                    "LSA sequence number.";
                                }
    
                                leaf checksum {
                                  type uint16;
                                  mandatory
                                    true;
                                  description
                                    "LSA checksum.";
                                }
    
                                leaf length {
                                  type uint16;
                                  mandatory
                                    true;
                                  description
                                    "LSA length.";
                                }
                              }  // container header
    
                              container body {
                                description
                                  "Decoded OSPF LSA body data.";
                                container router {
                                  when
                                    "../../header/type = 8193" {
                                    description
                                      "Only apply to Router-LSA.";
                                  }
                                  description
                                    "Router LSA.";
                                  leaf flags {
                                    type bits {
                                      bit V {
                                        position
                                          0;
                                        description
                                          "When set, the router is an endpoint of one or
    more virtual links.";
                                      }
                                      bit E {
                                        position
                                          1;
                                        description
                                          "When set, the router is an AS Boundary Router
    (ASBR).";
                                      }
                                      bit B {
                                        position
                                          2;
                                        description
                                          "When set, the router is an Area Border Router (ABR).";
                                      }
                                      bit Nt {
                                        position
                                          3;
                                        description
                                          "When set, the router is an NSSA border router
    that is unconditionally translating NSSA-LSAs
    into AS-external-LSAs.";
                                      }
                                    }
                                    mandatory
                                      true;
                                    description
                                      "LSA option.";
                                  }
    
                                  leaf options {
                                    type bits {
                                      bit DC {
                                        position
                                          0;
                                        description
                                          "When set, the router support demand circuits.";
                                      }
                                      bit R {
                                        position
                                          1;
                                        description
                                          "When set, the originator is an active router.";
                                      }
                                      bit N {
                                        position
                                          2;
                                        description
                                          "If set, the router is attached to an NSSA";
                                      }
                                      bit E {
                                        position
                                          3;
                                        description
                                          "This bit describes the way AS-external-LSAs
    
    are flooded";
                                      }
                                      bit V6 {
                                        position
                                          4;
                                        description
                                          "If clear, the router/link should be excluded
    from IPv6 routing calculaton";
                                      }
                                    }
                                    mandatory
                                      true;
                                    description
                                      "OSPFv3 LSA options.";
                                  }
    
                                  list link {
                                    key "interface-id neighbor-interface-id neighbor-router-id";
                                    description
                                      "Router LSA link.";
                                    leaf interface-id {
                                      type 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.";
                                    }
                                  }  // list link
                                }  // container router
    
                                container network {
                                  when
                                    "../../header/type = 8194" {
                                    description
                                      "Only apply to network LSA.";
                                  }
                                  description
                                    "Network LSA.";
                                  leaf options {
                                    type bits {
                                      bit DC {
                                        position
                                          0;
                                        description
                                          "When set, the router support demand circuits.";
                                      }
                                      bit R {
                                        position
                                          1;
                                        description
                                          "When set, the originator is an active router.";
                                      }
                                      bit N {
                                        position
                                          2;
                                        description
                                          "If set, the router is attached to an NSSA";
                                      }
                                      bit E {
                                        position
                                          3;
                                        description
                                          "This bit describes the way AS-external-LSAs
    
    are flooded";
                                      }
                                      bit V6 {
                                        position
                                          4;
                                        description
                                          "If clear, the router/link should be excluded
    from IPv6 routing calculaton";
                                      }
                                    }
                                    mandatory
                                      true;
                                    description
                                      "OSPFv3 LSA options.";
                                  }
    
                                  leaf-list attached-router {
                                    type yang:dotted-quad;
                                    description
                                      "List of the routers attached to the network.";
                                  }
                                }  // container network
    
                                container inter-area-prefix {
                                  when
                                    "../../header/type = 8195" {
                                    description
                                      "Only apply to inter-area-prefix LSA.";
                                  }
                                  description
                                    "Inter-Area-Prefix LSA.";
                                  leaf metric {
                                    type uint24;
                                    description
                                      "Metric";
                                  }
    
                                  leaf prefix {
                                    type inet:ip-prefix;
                                    description
                                      "Prefix";
                                  }
    
                                  leaf prefix-options {
                                    type bits {
                                      bit NU {
                                        position
                                          0;
                                        description
                                          "When set, the prefix should be excluded
    from IPv6 unicast calculations.";
                                      }
                                      bit LA {
                                        position
                                          1;
                                        description
                                          "When set, the prefix is actually an IPv6 interface
    address of the Advertising Router.";
                                      }
                                      bit P {
                                        position
                                          2;
                                        description
                                          "When set, the NSSA area prefix should be
    readvertised by the translating NSSA area border.";
                                      }
                                      bit DN {
                                        position
                                          3;
                                        description
                                          "When set, the inter-area-prefix-LSA or
    AS-external-LSA prefix has been advertised in a VPN
    environment.";
                                      }
                                    }
                                    mandatory
                                      true;
                                    description
                                      "Prefix options.";
                                  }
                                }  // container inter-area-prefix
    
                                container inter-area-router {
                                  when
                                    "../../header/type = 8196" {
                                    description
                                      "Only apply to inter-area-router LSA.";
                                  }
                                  description
                                    "Inter-Area-Router LSA.";
                                  leaf options {
                                    type bits {
                                      bit DC {
                                        position
                                          0;
                                        description
                                          "When set, the router support demand circuits.";
                                      }
                                      bit R {
                                        position
                                          1;
                                        description
                                          "When set, the originator is an active router.";
                                      }
                                      bit N {
                                        position
                                          2;
                                        description
                                          "If set, the router is attached to an NSSA";
                                      }
                                      bit E {
                                        position
                                          3;
                                        description
                                          "This bit describes the way AS-external-LSAs
    
    are flooded";
                                      }
                                      bit V6 {
                                        position
                                          4;
                                        description
                                          "If clear, the router/link should be excluded
    from IPv6 routing calculaton";
                                      }
                                    }
                                    mandatory
                                      true;
                                    description
                                      "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.";
                                  }
                                }  // container inter-area-router
    
                                container as-external {
                                  when
                                    "../../header/type = 16389" {
                                    description
                                      "Only apply to as-external LSA.";
                                  }
                                  description
                                    "AS-External LSA.";
                                  leaf metric {
                                    type uint24;
                                    description
                                      "Metric";
                                  }
    
                                  leaf flags {
                                    type bits {
                                      bit E {
                                        position
                                          0;
                                        description
                                          "When set, the metric specified is a Type 2
    external metric.";
                                      }
                                    }
                                    description
                                      "Flags.";
                                  }
    
                                  leaf referenced-ls-type {
                                    type uint16;
                                    description
                                      "Referenced Link State type.";
                                  }
    
                                  leaf prefix {
                                    type inet:ip-prefix;
                                    description
                                      "Prefix";
                                  }
    
                                  leaf prefix-options {
                                    type bits {
                                      bit NU {
                                        position
                                          0;
                                        description
                                          "When set, the prefix should be excluded
    from IPv6 unicast calculations.";
                                      }
                                      bit LA {
                                        position
                                          1;
                                        description
                                          "When set, the prefix is actually an IPv6 interface
    address of the Advertising Router.";
                                      }
                                      bit P {
                                        position
                                          2;
                                        description
                                          "When set, the NSSA area prefix should be
    readvertised by the translating NSSA area border.";
                                      }
                                      bit DN {
                                        position
                                          3;
                                        description
                                          "When set, the inter-area-prefix-LSA or
    AS-external-LSA prefix has been advertised in a VPN
    environment.";
                                      }
                                    }
                                    mandatory
                                      true;
                                    description
                                      "Prefix options.";
                                  }
    
                                  leaf forwarding-address {
                                    type inet:ipv6-address;
                                    description
                                      "Forwarding address.";
                                  }
    
                                  leaf external-route-tag {
                                    type uint32;
                                    description
                                      "Route tag.";
                                  }
    
                                  leaf referenced-link-state-id {
                                    type uint32;
                                    description
                                      "Referenced Link State ID.";
                                  }
                                }  // container as-external
    
                                container nssa {
                                  when
                                    "../../header/type = 8199" {
                                    description
                                      "Only apply to nssa LSA.";
                                  }
                                  description
                                    "NSSA LSA.";
                                  leaf metric {
                                    type uint24;
                                    description
                                      "Metric";
                                  }
    
                                  leaf flags {
                                    type bits {
                                      bit E {
                                        position
                                          0;
                                        description
                                          "When set, the metric specified is a Type 2
    external metric.";
                                      }
                                    }
                                    description
                                      "Flags.";
                                  }
    
                                  leaf referenced-ls-type {
                                    type uint16;
                                    description
                                      "Referenced Link State type.";
                                  }
    
                                  leaf prefix {
                                    type inet:ip-prefix;
                                    description
                                      "Prefix";
                                  }
    
                                  leaf prefix-options {
                                    type bits {
                                      bit NU {
                                        position
                                          0;
                                        description
                                          "When set, the prefix should be excluded
    from IPv6 unicast calculations.";
                                      }
                                      bit LA {
                                        position
                                          1;
                                        description
                                          "When set, the prefix is actually an IPv6 interface
    address of the Advertising Router.";
                                      }
                                      bit P {
                                        position
                                          2;
                                        description
                                          "When set, the NSSA area prefix should be
    readvertised by the translating NSSA area border.";
                                      }
                                      bit DN {
                                        position
                                          3;
                                        description
                                          "When set, the inter-area-prefix-LSA or
    AS-external-LSA prefix has been advertised in a VPN
    environment.";
                                      }
                                    }
                                    mandatory
                                      true;
                                    description
                                      "Prefix options.";
                                  }
    
                                  leaf forwarding-address {
                                    type inet:ipv6-address;
                                    description
                                      "Forwarding address.";
                                  }
    
                                  leaf external-route-tag {
                                    type uint32;
                                    description
                                      "Route tag.";
                                  }
    
                                  leaf referenced-link-state-id {
                                    type uint32;
                                    description
                                      "Referenced Link State ID.";
                                  }
                                }  // container nssa
    
                                container link {
                                  when
                                    "../../header/type = 8" {
                                    description
                                      "Only apply to link LSA.";
                                  }
                                  description
                                    "Link LSA.";
                                  leaf rtr-priority {
                                    type uint8;
                                    description
                                      "Router Priority of the interface.";
                                  }
    
                                  leaf options {
                                    type bits {
                                      bit DC {
                                        position
                                          0;
                                        description
                                          "When set, the router support demand circuits.";
                                      }
                                      bit R {
                                        position
                                          1;
                                        description
                                          "When set, the originator is an active router.";
                                      }
                                      bit N {
                                        position
                                          2;
                                        description
                                          "If set, the router is attached to an NSSA";
                                      }
                                      bit E {
                                        position
                                          3;
                                        description
                                          "This bit describes the way AS-external-LSAs
    
    are flooded";
                                      }
                                      bit V6 {
                                        position
                                          4;
                                        description
                                          "If clear, the router/link should be excluded
    from IPv6 routing calculaton";
                                      }
                                    }
                                    mandatory
                                      true;
                                    description
                                      "OSPFv3 LSA options.";
                                  }
    
                                  leaf link-local-interface-address {
                                    type inet:ipv6-address;
                                    description
                                      "The originating router's link-local
    interface address on the link.";
                                  }
    
                                  leaf num-of-prefixes {
                                    type uint32;
                                    description
                                      "Number of prefixes.";
                                  }
    
                                  list prefix {
                                    key "prefix";
                                    description
                                      "List of prefixes associated with the link.";
                                    leaf prefix {
                                      type inet:ip-prefix;
                                      description
                                        "Prefix";
                                    }
    
                                    leaf prefix-options {
                                      type bits {
                                        bit NU {
                                          position
                                            0;
                                          description
                                            "When set, the prefix should be excluded
    from IPv6 unicast calculations.";
                                        }
                                        bit LA {
                                          position
                                            1;
                                          description
                                            "When set, the prefix is actually an IPv6 interface
    address of the Advertising Router.";
                                        }
                                        bit P {
                                          position
                                            2;
                                          description
                                            "When set, the NSSA area prefix should be
    readvertised by the translating NSSA area border.";
                                        }
                                        bit DN {
                                          position
                                            3;
                                          description
                                            "When set, the inter-area-prefix-LSA or
    AS-external-LSA prefix has been advertised in a VPN
    environment.";
                                        }
                                      }
                                      mandatory
                                        true;
                                      description
                                        "Prefix options.";
                                    }
                                  }  // list prefix
                                }  // container link
    
                                container intra-area-prefix {
                                  when
                                    "../../header/type = 8201" {
                                    description
                                      "Only apply to intra-area-prefix LSA.";
                                  }
                                  description
                                    "Intra-Area-Prefix LSA.";
                                  leaf referenced-ls-type {
                                    type uint16;
                                    description
                                      "Referenced Link State type.";
                                  }
    
                                  leaf referenced-link-state-id {
                                    type uint32;
                                    description
                                      "Referenced Link State ID.";
                                  }
    
                                  leaf referenced-adv-router {
                                    type inet:ipv4-address;
                                    description
                                      "Referenced Advertising Router.";
                                  }
    
                                  leaf num-of-prefixes {
                                    type uint16;
                                    description
                                      "Number of prefixes.";
                                  }
    
                                  list prefix {
                                    key "prefix";
                                    description
                                      "List of prefixes associated with the link.";
                                    leaf prefix {
                                      type inet:ip-prefix;
                                      description
                                        "Prefix";
                                    }
    
                                    leaf prefix-options {
                                      type bits {
                                        bit NU {
                                          position
                                            0;
                                          description
                                            "When set, the prefix should be excluded
    from IPv6 unicast calculations.";
                                        }
                                        bit LA {
                                          position
                                            1;
                                          description
                                            "When set, the prefix is actually an IPv6 interface
    address of the Advertising Router.";
                                        }
                                        bit P {
                                          position
                                            2;
                                          description
                                            "When set, the NSSA area prefix should be
    readvertised by the translating NSSA area border.";
                                        }
                                        bit DN {
                                          position
                                            3;
                                          description
                                            "When set, the inter-area-prefix-LSA or
    AS-external-LSA prefix has been advertised in a VPN
    environment.";
                                        }
                                      }
                                      mandatory
                                        true;
                                      description
                                        "Prefix options.";
                                    }
    
                                    leaf metric {
                                      type uint24;
                                      description
                                        "Metric";
                                    }
                                  }  // list prefix
                                }  // container intra-area-prefix
                              }  // container body
                            }  // container ospfv3
                          }  // choice version
                        }  // list area-scope-lsa
                      }  // list area-scope-lsas
                    }  // list area
    
                    list as-scope-lsas {
                      key "lsa-type";
                      description
                        "List OSPF AS scope LSA databases";
                      leaf lsa-type {
                        type uint8;
                        description
                          "OSPF AS scope LSA type.";
                      }
    
                      list as-scope-lsa {
                        key "lsa-id adv-router";
                        description
                          "List of OSPF AS scope LSAs";
                        leaf lsa-id {
                          type union {
                            type inet:ipv4-address;
                            type uint32;
                          }
                          description "LSA ID.";
                        }
    
                        leaf adv-router {
                          type inet:ipv4-address;
                          description
                            "Advertising router.";
                        }
    
                        leaf decoded-completed {
                          type boolean;
                          description
                            "The OSPF LSA body is fully decoded.";
                        }
    
                        leaf raw-data {
                          type yang:hex-string;
                          description
                            "The complete LSA in network byte
    order as received/sent over the wire.";
                        }
    
                        choice version {
                          description
                            "OSPFv2 or OSPFv3 LSA body.";
                          container ospfv2 {
                            when
                              "../../../../../rt:type = 'ospf:ospfv2'" {
                              description
                                "Applied to OSPFv2 only";
                            }
                            description
                              "OSPFv2 LSA";
                            container header {
                              description
                                "Decoded OSPFv2 LSA header data.";
                              leaf option {
                                type bits {
                                  bit DC {
                                    position 0;
                                    description
                                      "When set, the router support demand circuits.";
                                  }
                                  bit P {
                                    position 1;
                                    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 {
                                    position 2;
                                    description
                                      "When set, the router support MOSPF.";
                                  }
                                  bit E {
                                    position 3;
                                    description
                                      "This bit describes the way AS-external-LSAs
    are flooded";
                                  }
                                }
                                mandatory true;
                                description
                                  "LSA option.";
                              }
    
                              leaf lsa-id {
                                type inet:ipv4-address;
                                mandatory true;
                                description
                                  "LSA ID.";
                              }
    
                              leaf opaque-type {
                                when
                                  "../../header/type = 9 or ../../header/type = 10 or ../../header/type = 11" {
                                  description
                                    "Only apply to opaque LSA.";
                                }
                                type uint8;
                                mandatory true;
                                description
                                  "Opaque type.";
                              }
    
                              leaf opaque-id {
                                when
                                  "../../header/type = 9 or ../../header/type = 10 or ../../header/type = 11" {
                                  description
                                    "Only apply to opaque LSA.";
                                }
                                type uint24;
                                mandatory true;
                                description
                                  "Opaque id.";
                              }
    
                              leaf age {
                                type uint16;
                                mandatory true;
                                description
                                  "LSA age.";
                              }
    
                              leaf type {
                                type uint16;
                                mandatory true;
                                description
                                  "LSA type.";
                              }
    
                              leaf adv-router {
                                type yang:dotted-quad;
                                mandatory true;
                                description
                                  "LSA advertising router.";
                              }
    
                              leaf seq-num {
                                type uint32;
                                mandatory true;
                                description
                                  "LSA sequence number.";
                              }
    
                              leaf checksum {
                                type uint16;
                                mandatory true;
                                description
                                  "LSA checksum.";
                              }
    
                              leaf length {
                                type uint16;
                                mandatory true;
                                description
                                  "LSA length.";
                              }
                            }  // container header
    
                            container body {
                              description
                                "Decoded OSPFv2 LSA body data.";
                              container router {
                                when
                                  "../../header/type = 1" {
                                  description
                                    "Only apply to Router-LSA.";
                                }
                                description
                                  "Router LSA.";
                                leaf flags {
                                  type bits {
                                    bit V {
                                      position
                                        0;
                                      description
                                        "When set, the router is an endpoint of one or
    more virtual links.";
                                    }
                                    bit E {
                                      position
                                        1;
                                      description
                                        "When set, the router is an AS Boundary Router
    (ASBR).";
                                    }
                                    bit B {
                                      position
                                        2;
                                      description
                                        "When set, the router is an Area Border Router (ABR).";
                                    }
                                  }
                                  description
                                    "Flags";
                                }
    
                                leaf num-of-links {
                                  type uint16;
                                  description
                                    "Number of links.";
                                }
    
                                list link {
                                  key "link-id link-data";
                                  description
                                    "Router LSA link.";
                                  leaf link-id {
                                    type union {
                                      type inet:ipv4-address;
                                      type yang:dotted-quad;
                                    }
                                    description
                                      "Link ID";
                                  }
    
                                  leaf link-data {
                                    type union {
                                      type inet:ipv4-address;
                                      type uint32;
                                    }
                                    description
                                      "Link data.";
                                  }
    
                                  leaf type {
                                    type uint8;
                                    description
                                      "Link type.";
                                  }
    
                                  list topology {
                                    key "mt-id";
                                    description
                                      "Topology specific information.";
                                    leaf mt-id {
                                      type uint8;
                                      description
                                        "The MT-ID for topology enabled on the link.";
                                    }
    
                                    leaf metric {
                                      type uint16;
                                      description
                                        "Metric for the topology.";
                                    }
                                  }  // list topology
                                }  // list link
                              }  // container router
    
                              container network {
                                when
                                  "../../header/type = 2" {
                                  description
                                    "Only apply to network LSA.";
                                }
                                description
                                  "Network LSA.";
                                leaf network-mask {
                                  type inet:ipv4-address;
                                  description
                                    "The IP address mask for the network";
                                }
    
                                leaf-list attached-router {
                                  type yang:dotted-quad;
                                  description
                                    "List of the routers attached to the network.";
                                }
                              }  // container network
    
                              container summary {
                                when
                                  "../../header/type = 3 or ../../header/type = 4" {
                                  description
                                    "Only apply to Summary-LSA.";
                                }
                                description
                                  "Summary LSA.";
                                leaf network-mask {
                                  type inet:ipv4-address;
                                  description
                                    "The IP address mask for the network";
                                }
    
                                list topology {
                                  key "mt-id";
                                  description
                                    "Topology specific information.";
                                  leaf mt-id {
                                    type uint8;
                                    description
                                      "The MT-ID for topology enabled on the link.";
                                  }
    
                                  leaf metric {
                                    type uint24;
                                    description
                                      "Metric for the topology.";
                                  }
                                }  // list topology
                              }  // container summary
    
                              container external {
                                when
                                  "../../header/type = 5 or ../../header/type = 7" {
                                  description
                                    "Only apply to AS-external-LSA and NSSA-LSA.";
                                }
                                description
                                  "External LSA.";
                                leaf network-mask {
                                  type inet:ipv4-address;
                                  description
                                    "The IP address mask for the network";
                                }
    
                                list topology {
                                  key "mt-id";
                                  description
                                    "Topology specific information.";
                                  leaf mt-id {
                                    type uint8;
                                    description
                                      "The MT-ID for topology enabled on the link.";
                                  }
    
                                  leaf flags {
                                    type bits {
                                      bit E {
                                        position
                                          0;
                                        description
                                          "When set, the metric specified is a Type 2
    external metric.";
                                      }
                                    }
                                    description
                                      "Flags.";
                                  }
    
                                  leaf metric {
                                    type uint24;
                                    description
                                      "Metric for the topology.";
                                  }
    
                                  leaf forwarding-address {
                                    type inet:ipv4-address;
                                    description
                                      "Forwarding address.";
                                  }
    
                                  leaf external-route-tag {
                                    type uint32;
                                    description
                                      "Route tag.";
                                  }
                                }  // list topology
                              }  // container external
    
                              container opaque {
                                when
                                  "../../header/type = 9 or ../../header/type = 10 or ../../header/type = 11" {
                                  description
                                    "Only apply to opaque LSA.";
                                }
                                description
                                  "Opaque LSA.";
                                list unknown-tlv {
                                  key "type";
                                  description
                                    "Unknown TLV.";
                                  leaf type {
                                    type uint16;
                                    description
                                      "TLV type.";
                                  }
    
                                  leaf length {
                                    type uint16;
                                    description
                                      "TLV length.";
                                  }
    
                                  leaf value {
                                    type yang:hex-string;
                                    description
                                      "TLV value.";
                                  }
                                }  // list unknown-tlv
    
                                container router-address-tlv {
                                  description
                                    "Router address TLV.";
                                  leaf router-address {
                                    type inet:ipv4-address;
                                    description
                                      "Router address.";
                                  }
                                }  // container router-address-tlv
    
                                container link-tlv {
                                  description
                                    "Link TLV.";
                                  leaf link-type {
                                    type uint8;
                                    mandatory
                                      true;
                                    description
                                      "Link type.";
                                  }
    
                                  leaf link-id {
                                    type union {
                                      type inet:ipv4-address;
                                      type yang:dotted-quad;
                                    }
                                    mandatory
                                      true;
                                    description
                                      "Link ID.";
                                  }
    
                                  leaf-list local-if-ipv4-addr {
                                    type inet:ipv4-address;
                                    description
                                      "List of local interface IPv4 addresses.";
                                  }
    
                                  leaf-list local-remote-ipv4-addr {
                                    type inet:ipv4-address;
                                    description
                                      "List of remote interface IPv4 addresses.";
                                  }
    
                                  leaf te-metric {
                                    type uint32;
                                    description
                                      "TE metric.";
                                  }
    
                                  leaf max-bandwidth {
                                    type decimal64 {
                                      fraction-digits
                                        2;
                                    }
                                    description
                                      "Maximum bandwidth.";
                                  }
    
                                  leaf max-reservable-bandwidth {
                                    type decimal64 {
                                      fraction-digits
                                        2;
                                    }
                                    description
                                      "Maximum reservable bandwidth.";
                                  }
    
                                  leaf unreserved-bandwidth {
                                    type decimal64 {
                                      fraction-digits
                                        2;
                                    }
                                    description
                                      "Unreserved bandwidth.";
                                  }
    
                                  leaf admin-group {
                                    type uint32;
                                    description
                                      "Administrative group/Resource class/Color.";
                                  }
    
                                  list unknown-subtlv {
                                    key "type";
                                    description
                                      "Unknown sub-TLV.";
                                    leaf type {
                                      type uint16;
                                      description
                                        "TLV type.";
                                    }
    
                                    leaf length {
                                      type uint16;
                                      description
                                        "TLV length.";
                                    }
    
                                    leaf value {
                                      type yang:hex-string;
                                      description
                                        "TLV value.";
                                    }
                                  }  // list unknown-subtlv
                                }  // container link-tlv
                              }  // container opaque
                            }  // container body
                          }  // container ospfv2
                          container ospfv3 {
                            when
                              "../../../../../rt:type = 'ospfv3'" {
                              description
                                "Applied to OSPFv3 only";
                            }
                            description
                              "OSPFv3 LSA";
                            container header {
                              description
                                "Decoded OSPFv3 LSA header data.";
                              leaf lsa-id {
                                type uint32;
                                mandatory true;
                                description
                                  "LSA ID.";
                              }
    
                              leaf age {
                                type uint16;
                                mandatory true;
                                description
                                  "LSA age.";
                              }
    
                              leaf type {
                                type uint16;
                                mandatory true;
                                description
                                  "LSA type.";
                              }
    
                              leaf adv-router {
                                type yang:dotted-quad;
                                mandatory true;
                                description
                                  "LSA advertising router.";
                              }
    
                              leaf seq-num {
                                type uint32;
                                mandatory true;
                                description
                                  "LSA sequence number.";
                              }
    
                              leaf checksum {
                                type uint16;
                                mandatory true;
                                description
                                  "LSA checksum.";
                              }
    
                              leaf length {
                                type uint16;
                                mandatory true;
                                description
                                  "LSA length.";
                              }
                            }  // container header
    
                            container body {
                              description
                                "Decoded OSPF LSA body data.";
                              container router {
                                when
                                  "../../header/type = 8193" {
                                  description
                                    "Only apply to Router-LSA.";
                                }
                                description
                                  "Router LSA.";
                                leaf flags {
                                  type bits {
                                    bit V {
                                      position
                                        0;
                                      description
                                        "When set, the router is an endpoint of one or
    more virtual links.";
                                    }
                                    bit E {
                                      position
                                        1;
                                      description
                                        "When set, the router is an AS Boundary Router
    (ASBR).";
                                    }
                                    bit B {
                                      position
                                        2;
                                      description
                                        "When set, the router is an Area Border Router (ABR).";
                                    }
                                    bit Nt {
                                      position
                                        3;
                                      description
                                        "When set, the router is an NSSA border router
    that is unconditionally translating NSSA-LSAs
    into AS-external-LSAs.";
                                    }
                                  }
                                  mandatory
                                    true;
                                  description
                                    "LSA option.";
                                }
    
                                leaf options {
                                  type bits {
                                    bit DC {
                                      position
                                        0;
                                      description
                                        "When set, the router support demand circuits.";
                                    }
                                    bit R {
                                      position
                                        1;
                                      description
                                        "When set, the originator is an active router.";
                                    }
                                    bit N {
                                      position
                                        2;
                                      description
                                        "If set, the router is attached to an NSSA";
                                    }
                                    bit E {
                                      position
                                        3;
                                      description
                                        "This bit describes the way AS-external-LSAs
    
    are flooded";
                                    }
                                    bit V6 {
                                      position
                                        4;
                                      description
                                        "If clear, the router/link should be excluded
    from IPv6 routing calculaton";
                                    }
                                  }
                                  mandatory
                                    true;
                                  description
                                    "OSPFv3 LSA options.";
                                }
    
                                list link {
                                  key "interface-id neighbor-interface-id neighbor-router-id";
                                  description
                                    "Router LSA link.";
                                  leaf interface-id {
                                    type 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.";
                                  }
                                }  // list link
                              }  // container router
    
                              container network {
                                when
                                  "../../header/type = 8194" {
                                  description
                                    "Only apply to network LSA.";
                                }
                                description
                                  "Network LSA.";
                                leaf options {
                                  type bits {
                                    bit DC {
                                      position
                                        0;
                                      description
                                        "When set, the router support demand circuits.";
                                    }
                                    bit R {
                                      position
                                        1;
                                      description
                                        "When set, the originator is an active router.";
                                    }
                                    bit N {
                                      position
                                        2;
                                      description
                                        "If set, the router is attached to an NSSA";
                                    }
                                    bit E {
                                      position
                                        3;
                                      description
                                        "This bit describes the way AS-external-LSAs
    
    are flooded";
                                    }
                                    bit V6 {
                                      position
                                        4;
                                      description
                                        "If clear, the router/link should be excluded
    from IPv6 routing calculaton";
                                    }
                                  }
                                  mandatory
                                    true;
                                  description
                                    "OSPFv3 LSA options.";
                                }
    
                                leaf-list attached-router {
                                  type yang:dotted-quad;
                                  description
                                    "List of the routers attached to the network.";
                                }
                              }  // container network
    
                              container inter-area-prefix {
                                when
                                  "../../header/type = 8195" {
                                  description
                                    "Only apply to inter-area-prefix LSA.";
                                }
                                description
                                  "Inter-Area-Prefix LSA.";
                                leaf metric {
                                  type uint24;
                                  description
                                    "Metric";
                                }
    
                                leaf prefix {
                                  type inet:ip-prefix;
                                  description
                                    "Prefix";
                                }
    
                                leaf prefix-options {
                                  type bits {
                                    bit NU {
                                      position
                                        0;
                                      description
                                        "When set, the prefix should be excluded
    from IPv6 unicast calculations.";
                                    }
                                    bit LA {
                                      position
                                        1;
                                      description
                                        "When set, the prefix is actually an IPv6 interface
    address of the Advertising Router.";
                                    }
                                    bit P {
                                      position
                                        2;
                                      description
                                        "When set, the NSSA area prefix should be
    readvertised by the translating NSSA area border.";
                                    }
                                    bit DN {
                                      position
                                        3;
                                      description
                                        "When set, the inter-area-prefix-LSA or
    AS-external-LSA prefix has been advertised in a VPN
    environment.";
                                    }
                                  }
                                  mandatory
                                    true;
                                  description
                                    "Prefix options.";
                                }
                              }  // container inter-area-prefix
    
                              container inter-area-router {
                                when
                                  "../../header/type = 8196" {
                                  description
                                    "Only apply to inter-area-router LSA.";
                                }
                                description
                                  "Inter-Area-Router LSA.";
                                leaf options {
                                  type bits {
                                    bit DC {
                                      position
                                        0;
                                      description
                                        "When set, the router support demand circuits.";
                                    }
                                    bit R {
                                      position
                                        1;
                                      description
                                        "When set, the originator is an active router.";
                                    }
                                    bit N {
                                      position
                                        2;
                                      description
                                        "If set, the router is attached to an NSSA";
                                    }
                                    bit E {
                                      position
                                        3;
                                      description
                                        "This bit describes the way AS-external-LSAs
    
    are flooded";
                                    }
                                    bit V6 {
                                      position
                                        4;
                                      description
                                        "If clear, the router/link should be excluded
    from IPv6 routing calculaton";
                                    }
                                  }
                                  mandatory
                                    true;
                                  description
                                    "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.";
                                }
                              }  // container inter-area-router
    
                              container as-external {
                                when
                                  "../../header/type = 16389" {
                                  description
                                    "Only apply to as-external LSA.";
                                }
                                description
                                  "AS-External LSA.";
                                leaf metric {
                                  type uint24;
                                  description
                                    "Metric";
                                }
    
                                leaf flags {
                                  type bits {
                                    bit E {
                                      position
                                        0;
                                      description
                                        "When set, the metric specified is a Type 2
    external metric.";
                                    }
                                  }
                                  description
                                    "Flags.";
                                }
    
                                leaf referenced-ls-type {
                                  type uint16;
                                  description
                                    "Referenced Link State type.";
                                }
    
                                leaf prefix {
                                  type inet:ip-prefix;
                                  description
                                    "Prefix";
                                }
    
                                leaf prefix-options {
                                  type bits {
                                    bit NU {
                                      position
                                        0;
                                      description
                                        "When set, the prefix should be excluded
    from IPv6 unicast calculations.";
                                    }
                                    bit LA {
                                      position
                                        1;
                                      description
                                        "When set, the prefix is actually an IPv6 interface
    address of the Advertising Router.";
                                    }
                                    bit P {
                                      position
                                        2;
                                      description
                                        "When set, the NSSA area prefix should be
    readvertised by the translating NSSA area border.";
                                    }
                                    bit DN {
                                      position
                                        3;
                                      description
                                        "When set, the inter-area-prefix-LSA or
    AS-external-LSA prefix has been advertised in a VPN
    environment.";
                                    }
                                  }
                                  mandatory
                                    true;
                                  description
                                    "Prefix options.";
                                }
    
                                leaf forwarding-address {
                                  type inet:ipv6-address;
                                  description
                                    "Forwarding address.";
                                }
    
                                leaf external-route-tag {
                                  type uint32;
                                  description
                                    "Route tag.";
                                }
    
                                leaf referenced-link-state-id {
                                  type uint32;
                                  description
                                    "Referenced Link State ID.";
                                }
                              }  // container as-external
    
                              container nssa {
                                when
                                  "../../header/type = 8199" {
                                  description
                                    "Only apply to nssa LSA.";
                                }
                                description
                                  "NSSA LSA.";
                                leaf metric {
                                  type uint24;
                                  description
                                    "Metric";
                                }
    
                                leaf flags {
                                  type bits {
                                    bit E {
                                      position
                                        0;
                                      description
                                        "When set, the metric specified is a Type 2
    external metric.";
                                    }
                                  }
                                  description
                                    "Flags.";
                                }
    
                                leaf referenced-ls-type {
                                  type uint16;
                                  description
                                    "Referenced Link State type.";
                                }
    
                                leaf prefix {
                                  type inet:ip-prefix;
                                  description
                                    "Prefix";
                                }
    
                                leaf prefix-options {
                                  type bits {
                                    bit NU {
                                      position
                                        0;
                                      description
                                        "When set, the prefix should be excluded
    from IPv6 unicast calculations.";
                                    }
                                    bit LA {
                                      position
                                        1;
                                      description
                                        "When set, the prefix is actually an IPv6 interface
    address of the Advertising Router.";
                                    }
                                    bit P {
                                      position
                                        2;
                                      description
                                        "When set, the NSSA area prefix should be
    readvertised by the translating NSSA area border.";
                                    }
                                    bit DN {
                                      position
                                        3;
                                      description
                                        "When set, the inter-area-prefix-LSA or
    AS-external-LSA prefix has been advertised in a VPN
    environment.";
                                    }
                                  }
                                  mandatory
                                    true;
                                  description
                                    "Prefix options.";
                                }
    
                                leaf forwarding-address {
                                  type inet:ipv6-address;
                                  description
                                    "Forwarding address.";
                                }
    
                                leaf external-route-tag {
                                  type uint32;
                                  description
                                    "Route tag.";
                                }
    
                                leaf referenced-link-state-id {
                                  type uint32;
                                  description
                                    "Referenced Link State ID.";
                                }
                              }  // container nssa
    
                              container link {
                                when
                                  "../../header/type = 8" {
                                  description
                                    "Only apply to link LSA.";
                                }
                                description
                                  "Link LSA.";
                                leaf rtr-priority {
                                  type uint8;
                                  description
                                    "Router Priority of the interface.";
                                }
    
                                leaf options {
                                  type bits {
                                    bit DC {
                                      position
                                        0;
                                      description
                                        "When set, the router support demand circuits.";
                                    }
                                    bit R {
                                      position
                                        1;
                                      description
                                        "When set, the originator is an active router.";
                                    }
                                    bit N {
                                      position
                                        2;
                                      description
                                        "If set, the router is attached to an NSSA";
                                    }
                                    bit E {
                                      position
                                        3;
                                      description
                                        "This bit describes the way AS-external-LSAs
    
    are flooded";
                                    }
                                    bit V6 {
                                      position
                                        4;
                                      description
                                        "If clear, the router/link should be excluded
    from IPv6 routing calculaton";
                                    }
                                  }
                                  mandatory
                                    true;
                                  description
                                    "OSPFv3 LSA options.";
                                }
    
                                leaf link-local-interface-address {
                                  type inet:ipv6-address;
                                  description
                                    "The originating router's link-local
    interface address on the link.";
                                }
    
                                leaf num-of-prefixes {
                                  type uint32;
                                  description
                                    "Number of prefixes.";
                                }
    
                                list prefix {
                                  key "prefix";
                                  description
                                    "List of prefixes associated with the link.";
                                  leaf prefix {
                                    type inet:ip-prefix;
                                    description
                                      "Prefix";
                                  }
    
                                  leaf prefix-options {
                                    type bits {
                                      bit NU {
                                        position
                                          0;
                                        description
                                          "When set, the prefix should be excluded
    from IPv6 unicast calculations.";
                                      }
                                      bit LA {
                                        position
                                          1;
                                        description
                                          "When set, the prefix is actually an IPv6 interface
    address of the Advertising Router.";
                                      }
                                      bit P {
                                        position
                                          2;
                                        description
                                          "When set, the NSSA area prefix should be
    readvertised by the translating NSSA area border.";
                                      }
                                      bit DN {
                                        position
                                          3;
                                        description
                                          "When set, the inter-area-prefix-LSA or
    AS-external-LSA prefix has been advertised in a VPN
    environment.";
                                      }
                                    }
                                    mandatory
                                      true;
                                    description
                                      "Prefix options.";
                                  }
                                }  // list prefix
                              }  // container link
    
                              container intra-area-prefix {
                                when
                                  "../../header/type = 8201" {
                                  description
                                    "Only apply to intra-area-prefix LSA.";
                                }
                                description
                                  "Intra-Area-Prefix LSA.";
                                leaf referenced-ls-type {
                                  type uint16;
                                  description
                                    "Referenced Link State type.";
                                }
    
                                leaf referenced-link-state-id {
                                  type uint32;
                                  description
                                    "Referenced Link State ID.";
                                }
    
                                leaf referenced-adv-router {
                                  type inet:ipv4-address;
                                  description
                                    "Referenced Advertising Router.";
                                }
    
                                leaf num-of-prefixes {
                                  type uint16;
                                  description
                                    "Number of prefixes.";
                                }
    
                                list prefix {
                                  key "prefix";
                                  description
                                    "List of prefixes associated with the link.";
                                  leaf prefix {
                                    type inet:ip-prefix;
                                    description
                                      "Prefix";
                                  }
    
                                  leaf prefix-options {
                                    type bits {
                                      bit NU {
                                        position
                                          0;
                                        description
                                          "When set, the prefix should be excluded
    from IPv6 unicast calculations.";
                                      }
                                      bit LA {
                                        position
                                          1;
                                        description
                                          "When set, the prefix is actually an IPv6 interface
    address of the Advertising Router.";
                                      }
                                      bit P {
                                        position
                                          2;
                                        description
                                          "When set, the NSSA area prefix should be
    readvertised by the translating NSSA area border.";
                                      }
                                      bit DN {
                                        position
                                          3;
                                        description
                                          "When set, the inter-area-prefix-LSA or
    AS-external-LSA prefix has been advertised in a VPN
    environment.";
                                      }
                                    }
                                    mandatory
                                      true;
                                    description
                                      "Prefix options.";
                                  }
    
                                  leaf metric {
                                    type uint24;
                                    description
                                      "Metric";
                                  }
                                }  // list prefix
                              }  // container intra-area-prefix
                            }  // container body
                          }  // container ospfv3
                        }  // choice version
                      }  // list as-scope-lsa
                    }  // list as-scope-lsas
    
                    list topology {
                      key "name";
                      description
                        "OSPF topology.";
                      leaf name {
                        type leafref {
                          path "/rt:routing/rt:routing-instance/rt:ribs/rt:rib/rt:name";
                        }
                        description "RIB";
                      }
    
                      list area {
                        key "area-id";
                        description
                          "List of ospf areas";
                        leaf area-id {
                          type area-id-type;
                          description "Area ID.";
                        }
                      }  // list area
                    }  // list topology
                  }  // list instance
                }  // container ospf
              }  // list routing-protocol
            }  // container routing-protocols
    
            container ribs {
              description "Container for RIBs.";
              list rib {
                key "name";
                min-elements 1;
                description
                  "Each entry represents a RIB identified by the 'name'
    key. All routes in a RIB MUST belong to the same address
    family.
    
    For each routing instance, an implementation SHOULD
    provide one system-controlled default RIB for each
    supported address family.";
                leaf name {
                  type string;
                  description
                    "The name of the RIB.";
                }
    
                leaf address-family {
                  type identityref {
                    base address-family;
                  }
                  mandatory true;
                  description "Address family.";
                }
    
                leaf default-rib {
                  if-feature multiple-ribs;
                  type boolean;
                  default "true";
                  description
                    "This flag has the value of 'true' if and only if the
    RIB is the default RIB for the given address family.
    
    A default RIB always receives direct routes. By
    default it also receives routes from all routing
    protocols.";
                }
    
                container routes {
                  description
                    "Current content of the RIB.";
                  list route {
                    description
                      "A RIB route entry. This data node MUST be augmented
    with information specific for routes of each address
    family.";
                    leaf route-preference {
                      type route-preference;
                      description
                        "This route attribute, also known as administrative
    distance, allows for selecting the preferred route
    among routes with the same destination prefix. A
    smaller value means a more preferred route.";
                    }
    
                    container next-hop {
                      description
                        "Route's next-hop attribute.";
                      choice next-hop-options {
                        mandatory true;
                        description
                          "Options for next-hops in state data.
    
    It is expected that other cases will be added through
    augments from other modules, e.g., for ECMP or recursive
    next-hops.";
                        case simple-next-hop {
                          description
                            "Simple next-hop is specified as an outgoing interface,
    next-hop address or both.
    
    Address-family-specific modules are expected to provide
    'next-hop-address' leaf via augmentation.";
                          leaf outgoing-interface {
                            type leafref {
                              path "/rt:routing-state/rt:routing-instance/rt:interfaces/rt:interface";
                            }
                            description
                              "Name of the outgoing interface.";
                          }
    
                          leaf next-hop-address {
                            type inet:ipv6-address;
                            description
                              "IPv6 address of the next-hop.";
                          }
    
                          leaf-list outgoing-interface {
                            type leafref {
                              path "/rt:routing-state/rt:routing-instance/rt:interfaces/rt:interface";
                            }
                            description
                              "List of the outgoing interfaces.";
                          }
    
                          leaf next-hop-address {
                            type inet:ipv4-address;
                            description
                              "IPv4 address of the next-hop.";
                          }
                        }  // case simple-next-hop
                        leaf special-next-hop {
                          type enumeration {
                            enum "blackhole" {
                              value 0;
                              description
                                "Silently discard the packet.";
                            }
                            enum "unreachable" {
                              value 1;
                              description
                                "Discard the packet and notify the sender with an error
    message indicating that the destination host is
    unreachable.";
                            }
                            enum "prohibit" {
                              value 2;
                              description
                                "Discard the packet and notify the sender with an error
    message indicating that the communication is
    administratively prohibited.";
                            }
                            enum "receive" {
                              value 3;
                              description
                                "The packet will be received by the local system.";
                            }
                          }
                          description
                            "Special next-hop options.";
                        }
                      }  // choice next-hop-options
                    }  // container next-hop
    
                    leaf source-protocol {
                      type identityref {
                        base routing-protocol;
                      }
                      mandatory true;
                      description
                        "Type of the routing protocol from which the route
    originated.";
                    }
    
                    leaf active {
                      type empty;
                      description
                        "Presence of this leaf indicates that the route is preferred
    among all routes in the same RIB that have the same
    destination prefix.";
                    }
    
                    leaf last-updated {
                      type yang:date-and-time;
                      description
                        "Time stamp of the last modification of the route. If the
    route was never modified, it is the time when the route was
    inserted into the RIB.";
                    }
    
                    leaf destination-prefix {
                      type inet:ipv6-prefix;
                      description
                        "IPv6 destination prefix.";
                    }
    
                    leaf metric {
                      type uint32;
                      description
                        "OSPF route metric.";
                    }
    
                    leaf tag {
                      type uint32;
                      default "0";
                      description
                        "OSPF route tag.";
                    }
    
                    leaf route-type {
                      type enumeration {
                        enum "intra-area" {
                          value 0;
                          description
                            "OSPF intra-area route";
                        }
                        enum "inter-area" {
                          value 1;
                          description
                            "OSPF inter-area route";
                        }
                        enum "external-1" {
                          value 2;
                          description
                            "OSPF external route type 1";
                        }
                        enum "external-2" {
                          value 3;
                          description
                            "OSPF External route type 2";
                        }
                        enum "nssa-1" {
                          value 4;
                          description
                            "OSPF NSSA external route type 1";
                        }
                        enum "nssa-2" {
                          value 5;
                          description
                            "OSPF NSSA external route type 2";
                        }
                      }
                      description
                        "OSPF route type";
                    }
    
                    leaf destination-prefix {
                      type inet:ipv4-prefix;
                      description
                        "IPv4 destination prefix.";
                    }
                  }  // list route
                }  // container routes
              }  // list rib
            }  // container ribs
          }  // list routing-instance
        }  // container routing-state
    
        container routing {
          description
            "Configuration parameters for the routing subsystem.";
          list routing-instance {
            key "name";
            description
              "Configuration of a routing instance.";
            leaf name {
              type string;
              description
                "The name of the routing instance.
    
    For system-controlled entries, the value of this leaf must
    be the same as the name of the corresponding entry in
    state data.
    
    For user-controlled entries, an arbitrary name can be
    used.";
            }
    
            leaf type {
              type identityref {
                base routing-instance;
              }
              default
                "rt:default-routing-instance";
              description
                "The type of the routing instance.";
            }
    
            leaf enabled {
              type boolean;
              default "true";
              description
                "Enable/disable the routing instance.
    
    If this parameter is false, the parent routing instance is
    disabled and does not appear in state data, despite any
    other configuration that might be present.";
            }
    
            leaf router-id {
              type yang:dotted-quad;
              description
                "A 32-bit number in the form of a dotted quad that is used by
    some routing protocols identifying a router.";
              reference
                "RFC 2328: OSPF Version 2.";
    
            }
    
            leaf description {
              type string;
              description
                "Textual description of the routing instance.";
            }
    
            container interfaces {
              description
                "Assignment of the routing instance's interfaces.";
              leaf-list interface {
                type if:interface-ref;
                description
                  "The name of a configured network layer interface to be
    assigned to the routing-instance.";
              }
            }  // container interfaces
    
            container routing-protocols {
              description
                "Configuration of routing protocol instances.";
              list routing-protocol {
                key "type name";
                description
                  "Each entry contains configuration of a routing protocol
    instance.";
                leaf type {
                  type identityref {
                    base routing-protocol;
                  }
                  description
                    "Type of the routing protocol - an identity derived
    from the 'routing-protocol' base identity.";
                }
    
                leaf name {
                  type string;
                  description
                    "An arbitrary name of the routing protocol instance.";
                }
    
                leaf description {
                  type string;
                  description
                    "Textual description of the routing protocol
    instance.";
                }
    
                container static-routes {
                  when "../type='rt:static'" {
                    description
                      "This container is only valid for the 'static'
    routing protocol.";
                  }
                  description
                    "Configuration of the 'static' pseudo-protocol.
    
    Address-family-specific modules augment this node with
    their lists of routes.";
                  container ipv6 {
                    description
                      "Configuration of a 'static' pseudo-protocol instance
    consists of a list of routes.";
                    list route {
                      key "destination-prefix";
                      ordered-by user;
                      description
                        "A user-ordered list of static routes.";
                      leaf destination-prefix {
                        type inet:ipv6-prefix;
                        mandatory true;
                        description
                          "IPv6 destination prefix.";
                      }
    
                      leaf description {
                        type string;
                        description
                          "Textual description of the route.";
                      }
    
                      container next-hop {
                        description
                          "Configuration of next-hop.";
                        choice next-hop-options {
                          mandatory true;
                          description
                            "Options for next-hops in static routes.
    
    It is expected that other cases will be added through
    augments from other modules, e.g., for Equal-Cost Multipath
    routing (ECMP).";
                          case simple-next-hop {
                            description
                              "Simple next-hop is specified as an outgoing interface,
    next-hop address or both.
    
    Address-family-specific modules are expected to provide
    'next-hop-address' leaf via augmentation.";
                            leaf outgoing-interface {
                              type leafref {
                                path "/rt:routing/rt:routing-instance/rt:interfaces/rt:interface";
                              }
                              description
                                "Name of the outgoing interface.";
                            }
                          }  // case simple-next-hop
                          leaf special-next-hop {
                            type enumeration {
                              enum "blackhole" {
                                value 0;
                                description
                                  "Silently discard the packet.";
                              }
                              enum "unreachable" {
                                value 1;
                                description
                                  "Discard the packet and notify the sender with an error
    message indicating that the destination host is
    unreachable.";
                              }
                              enum "prohibit" {
                                value 2;
                                description
                                  "Discard the packet and notify the sender with an error
    message indicating that the communication is
    administratively prohibited.";
                              }
                              enum "receive" {
                                value 3;
                                description
                                  "The packet will be received by the local system.";
                              }
                            }
                            description
                              "Special next-hop options.";
                          }
                          leaf next-hop-address {
                            type inet:ipv6-address;
                            description
                              "IPv6 address of the next-hop.";
                          }
                        }  // choice next-hop-options
                      }  // container next-hop
                    }  // list route
                  }  // container ipv6
    
                  container ipv4 {
                    description
                      "Configuration of a 'static' pseudo-protocol instance
    consists of a list of routes.";
                    list route {
                      key "destination-prefix";
                      ordered-by user;
                      description
                        "A user-ordered list of static routes.";
                      leaf destination-prefix {
                        type inet:ipv4-prefix;
                        mandatory true;
                        description
                          "IPv4 destination prefix.";
                      }
    
                      leaf description {
                        type string;
                        description
                          "Textual description of the route.";
                      }
    
                      container next-hop {
                        description
                          "Configuration of next-hop.";
                        choice next-hop-options {
                          mandatory true;
                          description
                            "Options for next-hops in static routes.
    
    It is expected that other cases will be added through
    augments from other modules, e.g., for Equal-Cost Multipath
    routing (ECMP).";
                          case simple-next-hop {
                            description
                              "Simple next-hop is specified as an outgoing interface,
    next-hop address or both.
    
    Address-family-specific modules are expected to provide
    'next-hop-address' leaf via augmentation.";
                            leaf outgoing-interface {
                              type leafref {
                                path "/rt:routing/rt:routing-instance/rt:interfaces/rt:interface";
                              }
                              description
                                "Name of the outgoing interface.";
                            }
                          }  // case simple-next-hop
                          leaf special-next-hop {
                            type enumeration {
                              enum "blackhole" {
                                value 0;
                                description
                                  "Silently discard the packet.";
                              }
                              enum "unreachable" {
                                value 1;
                                description
                                  "Discard the packet and notify the sender with an error
    message indicating that the destination host is
    unreachable.";
                              }
                              enum "prohibit" {
                                value 2;
                                description
                                  "Discard the packet and notify the sender with an error
    message indicating that the communication is
    administratively prohibited.";
                              }
                              enum "receive" {
                                value 3;
                                description
                                  "The packet will be received by the local system.";
                              }
                            }
                            description
                              "Special next-hop options.";
                          }
                          leaf next-hop-address {
                            type inet:ipv4-address;
                            description
                              "IPv4 address of the next-hop.";
                          }
                        }  // choice next-hop-options
                      }  // container next-hop
                    }  // list route
                  }  // container ipv4
                }  // container static-routes
    
                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 area
    
                    container interface {
                      description
                        "Interface config to be inherited by all interfaces
    in all instances.";
                    }  // container interface
                  }  // container all-instances-inherit
    
                  leaf operation-mode {
                    type identityref {
                      base operation-mode;
                    }
                    default
                      "ospf:ships-in-the-night";
                    description
                      "OSPF operation mode.";
                  }
    
                  list instance {
                    key "routing-instance af";
                    description
                      "An OSPF routing protocol instance.";
                    leaf routing-instance {
                      type 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 the
    enclosing routing-instance.";
                    }
    
                    leaf af {
                      type identityref {
                        base rt:address-family;
                      }
                      description
                        "Address-family of the instance.";
                    }
    
                    leaf router-id {
                      if-feature router-id;
                      type yang:dotted-quad;
                      description
                        "Defined in RFC 2328. A 32-bit number
    that uniquely identifies the router.";
                    }
    
                    container admin-distance {
                      description
                        "Admin distance config state.";
                      choice granularity {
                        description
                          "Options for expressing admin distance
    for intra-area and inter-area route";
                        case detail {
                          leaf intra-area {
                            type uint8;
                            description
                              "Admin distance for intra-area route.";
                          }
    
                          leaf inter-area {
                            type uint8;
                            description
                              "Admin distance for inter-area route.";
                          }
                        }  // case detail
                        leaf internal {
                          type uint8;
                          description
                            "Admin distance for both intra-area and
    inter-area route.";
                        }
                      }  // choice granularity
    
                      leaf external {
                        type uint8;
                        description
                          "Admin distance for both external route.";
                      }
                    }  // container admin-distance
    
                    container nsr {
                      if-feature nsr;
                      description
                        "NSR config state.";
                      leaf enable {
                        type boolean;
                        description
                          "Enable/Disable NSR.";
                      }
                    }  // container nsr
    
                    container graceful-restart {
                      if-feature graceful-restart;
                      description
                        "Graceful restart config state.";
                      leaf enable {
                        type boolean;
                        description
                          "Enable/Disable graceful restart as defined in RFC 3623.";
                      }
    
                      leaf helper-enable {
                        type boolean;
                        description
                          "Enable RestartHelperSupport in RFC 3623 Section B.2.";
                      }
    
                      leaf restart-interval {
                        type uint16 {
                          range "1..1800";
                        }
                        units "seconds";
                        default "120";
                        description
                          "RestartInterval option in RFC 3623 Section B.1.";
                      }
    
                      leaf helper-strict-lsa-checking {
                        type boolean;
                        description
                          "RestartHelperStrictLSAChecking option in RFC 3623
    Section B.2.";
                      }
                    }  // container graceful-restart
    
                    container protocol-shutdown {
                      if-feature protocol-shutdown;
                      description
                        "Protocol shutdown config state.";
                      leaf shutdown {
                        type boolean;
                        description
                          "Enable/Disable protocol shutdown.";
                      }
                    }  // container protocol-shutdown
    
                    container auto-cost {
                      if-feature auto-cost;
                      description
                        "Auto cost config state.";
                      leaf enable {
                        type boolean;
                        description
                          "Enable/Disable auto cost.";
                      }
    
                      leaf reference-bandwidth {
                        type uint32 {
                          range "1..4294967";
                        }
                        units "Mbits";
                        description
                          "Configure reference bandwidth in term of Mbits";
                      }
                    }  // container auto-cost
    
                    container maximum {
                      description
                        "OSPF limits settings.";
                      leaf paths {
                        if-feature max-ecmp;
                        type uint16 {
                          range "1..32";
                        }
                        description
                          "Maximum number of ECMP paths.";
                      }
    
                      leaf max-lsa {
                        if-feature max-lsa;
                        type uint32 {
                          range "1..4294967294";
                        }
                        description
                          "Maximum number of LSAs OSPF will receive.";
                      }
                    }  // container maximum
    
                    container mpls {
                      description
                        "OSPF MPLS config state.";
                      container te-rid {
                        if-feature te-rid;
                        description
                          "Traffic Engineering stable IP address for system.";
                        choice source {
                          description
                            "Different options for specifying TE router ID.";
                          leaf interface {
                            type if:interface-ref;
                            description
                              "Take the interface's IPv4 address as TE router ID.";
                          }
                          leaf router-id {
                            type inet:ipv4-address;
                            description
                              "Explicitly configure the TE router ID.";
                          }
                        }  // choice source
                      }  // container te-rid
    
                      container ldp {
                        description
                          "OSPF MPLS LDP config state.";
                        leaf igp-sync {
                          if-feature ldp-igp-sync;
                          type boolean;
                          description
                            "Enable LDP IGP synchronization.";
                        }
    
                        leaf autoconfig {
                          if-feature ldp-igp-autoconfig;
                          type boolean;
                          description
                            "Enable LDP IGP interface auto-configuration.";
                        }
                      }  // container ldp
                    }  // container mpls
    
                    container all-areas-inherit {
                      if-feature area-inheritance;
                      description
                        "Inheritance for all areas.";
                      container area {
                        description
                          "Area config to be inherited by all areas.";
                      }  // container area
    
                      container interface {
                        description
                          "Interface config to be inherited by all interfaces
    in all areas.";
                      }  // container interface
                    }  // container all-areas-inherit
    
                    list area {
                      key "area-id";
                      description
                        "List of ospf areas";
                      leaf area-id {
                        type area-id-type;
                        description "Area ID.";
                      }
    
                      leaf area-type {
                        type identityref {
                          base area-type;
                        }
                        default "normal";
                        description "Area type.";
                      }
    
                      leaf summary {
                        when
                          "../area-type = 'stub' or ../area-type = 'nssa'" {
                          description
                            "Summary generation valid for stub/NSSA area.";
                        }
                        type boolean;
                        description
                          "Enable/Disable summary generation to the stub or
    NSSA area.";
                      }
    
                      leaf default-cost {
                        when
                          "../area-type = 'stub' or ../area-type = 'nssa'" {
                          description
                            "Default cost for LSA advertised into stub or
    NSSA area.";
                        }
                        type uint32 {
                          range "1..16777215";
                        }
                        description
                          "Set the summary default-cost for a stub or NSSA area.";
                      }
    
                      list range {
                        key "prefix";
                        description
                          "Summarize routes matching address/mask (border
    routers only)";
                        leaf prefix {
                          type inet:ip-prefix;
                          description
                            "IPv4 or IPv6 prefix";
                        }
    
                        leaf advertise {
                          type boolean;
                          description
                            "Advertise or hide.";
                        }
    
                        leaf cost {
                          type uint24 {
                            range "0..16777214";
                          }
                          description
                            "Cost of summary route.";
                        }
                      }  // list range
    
                      container all-interfaces-inherit {
                        if-feature interface-inheritance;
                        description
                          "Inheritance for all interfaces";
                        container interface {
                          description
                            "Interface config to be inherited by all
    interfaces.";
                        }  // container interface
                      }  // container all-interfaces-inherit
    
                      list virtual-link {
                        when
                          "../area-id != '0' and ../area-type = 'normal'" {
                          description
                            "Transit area must be non-backbone normal area.";
                        }
                        key "router-id";
                        description
                          "OSPF virtual link";
                        leaf router-id {
                          type yang:dotted-quad;
                          description
                            "Virtual link router ID.";
                        }
    
                        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 rtrPriority {
                          type uint8 {
                            range "0..255";
                          }
                          description
                            "Router priority for DR election.";
                        }
    
                        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 {
                          if-feature mtu-ignore;
                          type boolean;
                          description
                            "Enable/Disable ignoring of MTU in DBD packets.";
                        }
    
                        leaf lls {
                          if-feature lls;
                          type boolean;
                          description
                            "Enable/Disable link-local signaling (LLS) support.";
                        }
    
                        leaf prefix-suppression {
                          if-feature prefix-suppression;
                          type boolean;
                          description
                            "Suppress advertisement of the prefixes.";
                        }
    
                        leaf bfd {
                          if-feature bfd;
                          type boolean;
                          description
                            "Enable/disable bfd.";
                        }
    
                        container ttl-security {
                          if-feature ttl-security;
                          description
                            "TTL security check.";
                          leaf enable {
                            type boolean;
                            description
                              "Enable/Disable TTL security check.";
                          }
    
                          leaf hops {
                            type uint8 {
                              range "1..254";
                            }
                            description
                              "Maximum number of hops that a OSPF packet may
    have traveled.";
                          }
                        }  // container ttl-security
    
                        container protocol-shutdown {
                          if-feature protocol-if-shutdown;
                          description
                            "Protocol shutdown interface config state.";
                          leaf shutdown {
                            type boolean;
                            description
                              "Enable/Disable protocol shutdown on the interface.";
                          }
                        }  // container protocol-shutdown
    
                        container authentication {
                          description
                            "Authentication configuration.";
                          choice auth-type-selection {
                            description
                              "Options for expressing authentication setting";
                            case auth-ipsec {
                              when
                                "../../../../../rt:type = 'ospfv3'" {
                                description
                                  "Applied to OSPFv3 only";
                              }
                              if-feature ospfv3-authentication-ipsec;
                              leaf sa {
                                type string;
                                description
                                  "SA name";
                              }
                            }  // case auth-ipsec
                            leaf key-chain {
                              type key-chain:key-chain-ref;
                              description
                                "key-chain name";
                            }
    
                            case auth-trailer-key {
                              leaf key {
                                type string;
                                description
                                  "Key string in ASCII format.";
                              }
    
                              container crypto-algorithm {
                                description
                                  "Cryptographic algorithm associated with key.";
                                choice algorithm {
                                  description
                                    "Options for crytographic algorithm specification.";
                                  case hmac-sha-1-12 {
                                    if-feature crypto-hmac-sha-1-12;
                                    leaf hmac-sha1-12 {
                                      type empty;
                                      description
                                        "The HMAC-SHA-1-12 algorithm.";
                                    }
                                  }  // case hmac-sha-1-12
                                  leaf md5 {
                                    type empty;
                                    description
                                      "The MD5 algorithm.";
                                  }
                                  leaf sha-1 {
                                    type empty;
                                    description
                                      "The SHA-1 algorithm.";
                                  }
                                  leaf hmac-sha-1 {
                                    type empty;
                                    description
                                      "HMAC-SHA-1 authentication algorithm.";
                                  }
                                  leaf hmac-sha-256 {
                                    type empty;
                                    description
                                      "HMAC-SHA-256 authentication algorithm.";
                                  }
                                  leaf hmac-sha-384 {
                                    type empty;
                                    description
                                      "HMAC-SHA-384 authentication algorithm.";
                                  }
                                  leaf hmac-sha-512 {
                                    type empty;
                                    description
                                      "HMAC-SHA-512 authentication algorithm.";
                                  }
                                }  // choice algorithm
                              }  // container crypto-algorithm
                            }  // case auth-trailer-key
                          }  // choice auth-type-selection
                        }  // container authentication
                      }  // list virtual-link
    
                      list sham-link {
                        key "local-id remote-id";
                        description
                          "OSPF sham link";
                        leaf local-id {
                          type inet:ip-address;
                          description
                            "Address of the local end-point.";
                        }
    
                        leaf remote-id {
                          type inet:ip-address;
                          description
                            "Address of the remote end-point.";
                        }
    
                        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 rtrPriority {
                          type uint8 {
                            range "0..255";
                          }
                          description
                            "Router priority for DR election.";
                        }
    
                        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 {
                          if-feature mtu-ignore;
                          type boolean;
                          description
                            "Enable/Disable ignoring of MTU in DBD packets.";
                        }
    
                        leaf lls {
                          if-feature lls;
                          type boolean;
                          description
                            "Enable/Disable link-local signaling (LLS) support.";
                        }
    
                        leaf prefix-suppression {
                          if-feature prefix-suppression;
                          type boolean;
                          description
                            "Suppress advertisement of the prefixes.";
                        }
    
                        leaf bfd {
                          if-feature bfd;
                          type boolean;
                          description
                            "Enable/disable bfd.";
                        }
    
                        container ttl-security {
                          if-feature ttl-security;
                          description
                            "TTL security check.";
                          leaf enable {
                            type boolean;
                            description
                              "Enable/Disable TTL security check.";
                          }
    
                          leaf hops {
                            type uint8 {
                              range "1..254";
                            }
                            description
                              "Maximum number of hops that a OSPF packet may
    have traveled.";
                          }
                        }  // container ttl-security
    
                        container protocol-shutdown {
                          if-feature protocol-if-shutdown;
                          description
                            "Protocol shutdown interface config state.";
                          leaf shutdown {
                            type boolean;
                            description
                              "Enable/Disable protocol shutdown on the interface.";
                          }
                        }  // container protocol-shutdown
    
                        container authentication {
                          description
                            "Authentication configuration.";
                          choice auth-type-selection {
                            description
                              "Options for expressing authentication setting";
                            case auth-ipsec {
                              when
                                "../../../../../rt:type = 'ospfv3'" {
                                description
                                  "Applied to OSPFv3 only";
                              }
                              if-feature ospfv3-authentication-ipsec;
                              leaf sa {
                                type string;
                                description
                                  "SA name";
                              }
                            }  // case auth-ipsec
                            leaf key-chain {
                              type key-chain:key-chain-ref;
                              description
                                "key-chain name";
                            }
    
                            case auth-trailer-key {
                              leaf key {
                                type string;
                                description
                                  "Key string in ASCII format.";
                              }
    
                              container crypto-algorithm {
                                description
                                  "Cryptographic algorithm associated with key.";
                                choice algorithm {
                                  description
                                    "Options for crytographic algorithm specification.";
                                  case hmac-sha-1-12 {
                                    if-feature crypto-hmac-sha-1-12;
                                    leaf hmac-sha1-12 {
                                      type empty;
                                      description
                                        "The HMAC-SHA-1-12 algorithm.";
                                    }
                                  }  // case hmac-sha-1-12
                                  leaf md5 {
                                    type empty;
                                    description
                                      "The MD5 algorithm.";
                                  }
                                  leaf sha-1 {
                                    type empty;
                                    description
                                      "The SHA-1 algorithm.";
                                  }
                                  leaf hmac-sha-1 {
                                    type empty;
                                    description
                                      "HMAC-SHA-1 authentication algorithm.";
                                  }
                                  leaf hmac-sha-256 {
                                    type empty;
                                    description
                                      "HMAC-SHA-256 authentication algorithm.";
                                  }
                                  leaf hmac-sha-384 {
                                    type empty;
                                    description
                                      "HMAC-SHA-384 authentication algorithm.";
                                  }
                                  leaf hmac-sha-512 {
                                    type empty;
                                    description
                                      "HMAC-SHA-512 authentication algorithm.";
                                  }
                                }  // choice algorithm
                              }  // container crypto-algorithm
                            }  // case auth-trailer-key
                          }  // choice auth-type-selection
                        }  // container authentication
                      }  // list sham-link
    
                      list interface {
                        key "interface";
                        description
                          "List of OSPF interfaces.";
                        leaf interface {
                          type if:interface-ref;
                          description
                            "Interface.";
                        }
    
                        leaf network-type {
                          type enumeration {
                            enum "broadcast" {
                              value 0;
                              description
                                "Specify OSPF broadcast multi-access network.";
                            }
                            enum "non-broadcast" {
                              value 1;
                              description
                                "Specify OSPF Non-Broadcast Multi-Access
    (NBMA) network.";
                            }
                            enum
                              "point-to-multipoint" {
                              value 2;
                              description
                                "Specify OSPF point-to-multipoint network.";
                            }
                            enum
                              "point-to-point" {
                              value 3;
                              description
                                "Specify OSPF point-to-point network.";
                            }
                          }
                          description
                            "Network type.";
                        }
    
                        leaf passive {
                          type boolean;
                          description
                            "Enable/Disable passive.";
                        }
    
                        leaf demand-circuit {
                          if-feature demand-circuit;
                          type boolean;
                          description
                            "Enable/Disable demand circuit.";
                        }
    
                        container multi-area {
                          if-feature multi-area-adj;
                          description
                            "Configure ospf multi-area.";
                          leaf multi-area-id {
                            type area-id-type;
                            description
                              "Multi-area ID";
                          }
    
                          leaf cost {
                            type uint16;
                            description
                              "Interface cost for multi-area.";
                          }
                        }  // container multi-area
    
                        container static-neighbors {
                          description
                            "Static configured neighbors.";
                          list neighbor {
                            key "address";
                            description
                              "Specify a neighbor router.";
                            leaf address {
                              type inet:ip-address;
                              description
                                "Neighbor IP address.";
                            }
    
                            leaf cost {
                              type uint16 {
                                range "1..65535";
                              }
                              description
                                "Neighbor cost.";
                            }
    
                            leaf poll-interval {
                              type uint16 {
                                range "1..65535";
                              }
                              units "seconds";
                              description
                                "Neighbor poll interval.";
                            }
    
                            leaf priority {
                              type uint8 {
                                range "1..255";
                              }
                              description
                                "Neighbor priority for DR election.";
                            }
                          }  // list neighbor
                        }  // container static-neighbors
    
                        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 rtrPriority {
                          type uint8 {
                            range "0..255";
                          }
                          description
                            "Router priority for DR election.";
                        }
    
                        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 {
                          if-feature mtu-ignore;
                          type boolean;
                          description
                            "Enable/Disable ignoring of MTU in DBD packets.";
                        }
    
                        leaf lls {
                          if-feature lls;
                          type boolean;
                          description
                            "Enable/Disable link-local signaling (LLS) support.";
                        }
    
                        leaf prefix-suppression {
                          if-feature prefix-suppression;
                          type boolean;
                          description
                            "Suppress advertisement of the prefixes.";
                        }
    
                        leaf bfd {
                          if-feature bfd;
                          type boolean;
                          description
                            "Enable/disable bfd.";
                        }
    
                        container ttl-security {
                          if-feature ttl-security;
                          description
                            "TTL security check.";
                          leaf enable {
                            type boolean;
                            description
                              "Enable/Disable TTL security check.";
                          }
    
                          leaf hops {
                            type uint8 {
                              range "1..254";
                            }
                            description
                              "Maximum number of hops that a OSPF packet may
    have traveled.";
                          }
                        }  // container ttl-security
    
                        container protocol-shutdown {
                          if-feature protocol-if-shutdown;
                          description
                            "Protocol shutdown interface config state.";
                          leaf shutdown {
                            type boolean;
                            description
                              "Enable/Disable protocol shutdown on the interface.";
                          }
                        }  // container protocol-shutdown
    
                        container authentication {
                          description
                            "Authentication configuration.";
                          choice auth-type-selection {
                            description
                              "Options for expressing authentication setting";
                            case auth-ipsec {
                              when
                                "../../../../../rt:type = 'ospfv3'" {
                                description
                                  "Applied to OSPFv3 only";
                              }
                              if-feature ospfv3-authentication-ipsec;
                              leaf sa {
                                type string;
                                description
                                  "SA name";
                              }
                            }  // case auth-ipsec
                            leaf key-chain {
                              type key-chain:key-chain-ref;
                              description
                                "key-chain name";
                            }
    
                            case auth-trailer-key {
                              leaf key {
                                type string;
                                description
                                  "Key string in ASCII format.";
                              }
    
                              container crypto-algorithm {
                                description
                                  "Cryptographic algorithm associated with key.";
                                choice algorithm {
                                  description
                                    "Options for crytographic algorithm specification.";
                                  case hmac-sha-1-12 {
                                    if-feature crypto-hmac-sha-1-12;
                                    leaf hmac-sha1-12 {
                                      type empty;
                                      description
                                        "The HMAC-SHA-1-12 algorithm.";
                                    }
                                  }  // case hmac-sha-1-12
                                  leaf md5 {
                                    type empty;
                                    description
                                      "The MD5 algorithm.";
                                  }
                                  leaf sha-1 {
                                    type empty;
                                    description
                                      "The SHA-1 algorithm.";
                                  }
                                  leaf hmac-sha-1 {
                                    type empty;
                                    description
                                      "HMAC-SHA-1 authentication algorithm.";
                                  }
                                  leaf hmac-sha-256 {
                                    type empty;
                                    description
                                      "HMAC-SHA-256 authentication algorithm.";
                                  }
                                  leaf hmac-sha-384 {
                                    type empty;
                                    description
                                      "HMAC-SHA-384 authentication algorithm.";
                                  }
                                  leaf hmac-sha-512 {
                                    type empty;
                                    description
                                      "HMAC-SHA-512 authentication algorithm.";
                                  }
                                }  // choice algorithm
                              }  // container crypto-algorithm
                            }  // case auth-trailer-key
                          }  // choice auth-type-selection
                        }  // container authentication
    
                        list topology {
                          key "name";
                          description
                            "OSPF interface topology.";
                          leaf name {
                            type leafref {
                              path "/rt:routing/rt:routing-instance/rt:ribs/rt:rib/rt:name";
                            }
                            description
                              "One of the topology enabled on this interface";
                          }
    
                          leaf cost {
                            type uint32;
                            description
                              "Interface cost for this topology";
                          }
                        }  // list topology
                      }  // list interface
                    }  // list area
    
                    list topology {
                      key "name";
                      description
                        "OSPF topology.";
                      leaf name {
                        type leafref {
                          path "/rt:routing/rt:routing-instance/rt:ribs/rt:rib/rt:name";
                        }
                        description "RIB";
                      }
    
                      list area {
                        key "area-id";
                        description
                          "List of ospf areas";
                        leaf area-id {
                          type area-id-type;
                          description "Area ID.";
                        }
    
                        leaf area-type {
                          type identityref {
                            base area-type;
                          }
                          default "normal";
                          description
                            "Area type.";
                        }
    
                        leaf summary {
                          when
                            "../area-type = 'stub' or ../area-type = 'nssa'" {
                            description
                              "Summary generation valid for stub/NSSA area.";
                          }
                          type boolean;
                          description
                            "Enable/Disable summary generation to the stub or
    NSSA area.";
                        }
    
                        leaf default-cost {
                          when
                            "../area-type = 'stub' or ../area-type = 'nssa'" {
                            description
                              "Default cost for LSA advertised into stub or
    NSSA area.";
                          }
                          type uint32 {
                            range "1..16777215";
                          }
                          description
                            "Set the summary default-cost for a stub or NSSA area.";
                        }
    
                        list range {
                          key "prefix";
                          description
                            "Summarize routes matching address/mask (border
    routers only)";
                          leaf prefix {
                            type inet:ip-prefix;
                            description
                              "IPv4 or IPv6 prefix";
                          }
    
                          leaf advertise {
                            type boolean;
                            description
                              "Advertise or hide.";
                          }
    
                          leaf cost {
                            type uint24 {
                              range
                                "0..16777214";
                            }
                            description
                              "Cost of summary route.";
                          }
                        }  // list range
                      }  // list area
                    }  // list topology
    
                    list network {
                      key "network mask";
                      ordered-by user;
                      description
                        "Enable OSPF Routing on this network";
                      leaf network {
                        type inet:ipv4-address;
                        description
                          "Enable OSPF Routing on the network address";
                      }
    
                      leaf mask {
                        type yang:dotted-quad;
                        description
                          "Network mask";
                      }
    
                      leaf-list area {
                        when "../mask";
                        type yang:dotted-quad;
                        description
                          "Area ID in dotted quad format. Example: x.x.x.x";
                      }
                    }  // list network
    
                    container redistribute {
                      description
                        "Enables redistribution of routes of a particular type.";
                      container interface {
                        description
                          "Enables redistribution of routes on interfaces.";
                        leaf cost {
                          type uint24;
                          description
                            "Cost of redistributing the interface routes.";
                        }
    
                        container LCN {
                          description
                            "Controls publishing/withdrawal of LCN interface routes.";
                          leaf enable {
                            type boolean;
                            default "true";
                          }
                        }  // container LCN
    
                        container LMP {
                          description
                            "Controls publishing/withdrawal of LMP interface routes.";
                          leaf enable {
                            type boolean;
                            default "true";
                          }
                        }  // container LMP
                      }  // container interface
    
                      container static {
                        presence
                          "Enable redistribution of all static routes";
                        description
                          "Enables redistribution of all static routes";
                        leaf cost {
                          type uint24;
                        }
                      }  // container static
                    }  // container redistribute
                  }  // list instance
                }  // container ospf
              }  // list routing-protocol
            }  // container routing-protocols
    
            container ribs {
              description
                "Configuration of RIBs.";
              list rib {
                key "name";
                description
                  "Each entry contains configuration for a RIB identified
    by the 'name' key.
    
    Entries having the same key as a system-controlled entry
    of the list /routing-state/routing-instance/ribs/rib are
    used for configuring parameters of that entry. Other
    entries define additional user-controlled RIBs.";
                leaf name {
                  type string;
                  description
                    "The name of the RIB.
    
    For system-controlled entries, the value of this leaf
    must be the same as the name of the corresponding
    entry in state data.
    
    For user-controlled entries, an arbitrary name can be
    used.";
                }
    
                leaf address-family {
                  type identityref {
                    base address-family;
                  }
                  description "Address family.";
                }
    
                leaf description {
                  type string;
                  description
                    "Textual description of the RIB.";
                }
              }  // list rib
            }  // container ribs
          }  // list routing-instance
        }  // container routing
    
        rpc fib-route {
          description
            "Return the active FIB route that a routing-instance uses for
    sending packets to a destination address.";
          input {
            leaf routing-instance-name {
              type routing-instance-state-ref;
              mandatory true;
              description
                "Name of the routing instance whose forwarding information
    base is being queried.
    
    If the routing instance with name equal to the value of
    this parameter doesn't exist, then this operation SHALL
    fail with error-tag 'data-missing' and error-app-tag
    'routing-instance-not-found'.";
            }
    
            container destination-address {
              description
                "Network layer destination address.
    
    Address family specific modules MUST augment this
    container with a leaf named 'address'.";
              leaf address-family {
                type identityref {
                  base address-family;
                }
                mandatory true;
                description "Address family.";
              }
    
              leaf address {
                type inet:ipv6-address;
                description
                  "IPv6 destination address.";
              }
    
              leaf address {
                type inet:ipv4-address;
                description
                  "IPv4 destination address.";
              }
            }  // container destination-address
          }
    
          output {
            container route {
              description
                "The active FIB route for the specified destination.
    
    If the routing instance has no active FIB route for the
    destination address, no output is returned - the server
    SHALL send an <rpc-reply> containing a single element
    <ok>.
    
    Address family specific modules MUST augment this list
    with appropriate route contents.";
              leaf address-family {
                type identityref {
                  base address-family;
                }
                mandatory true;
                description "Address family.";
              }
    
              container next-hop {
                description
                  "Route's next-hop attribute.";
                choice next-hop-options {
                  mandatory true;
                  description
                    "Options for next-hops in state data.
    
    It is expected that other cases will be added through
    augments from other modules, e.g., for ECMP or recursive
    next-hops.";
                  case simple-next-hop {
                    description
                      "Simple next-hop is specified as an outgoing interface,
    next-hop address or both.
    
    Address-family-specific modules are expected to provide
    'next-hop-address' leaf via augmentation.";
                    leaf outgoing-interface {
                      type leafref {
                        path "/rt:routing-state/rt:routing-instance/rt:interfaces/rt:interface";
                      }
                      description
                        "Name of the outgoing interface.";
                    }
    
                    leaf next-hop-address {
                      type inet:ipv6-address;
                      description
                        "IPv6 address of the next-hop.";
                    }
    
                    leaf next-hop-address {
                      type inet:ipv4-address;
                      description
                        "IPv4 address of the next-hop.";
                    }
                  }  // case simple-next-hop
                  leaf special-next-hop {
                    type enumeration {
                      enum "blackhole" {
                        value 0;
                        description
                          "Silently discard the packet.";
                      }
                      enum "unreachable" {
                        value 1;
                        description
                          "Discard the packet and notify the sender with an error
    message indicating that the destination host is
    unreachable.";
                      }
                      enum "prohibit" {
                        value 2;
                        description
                          "Discard the packet and notify the sender with an error
    message indicating that the communication is
    administratively prohibited.";
                      }
                      enum "receive" {
                        value 3;
                        description
                          "The packet will be received by the local system.";
                      }
                    }
                    description
                      "Special next-hop options.";
                  }
                }  // choice next-hop-options
              }  // container next-hop
    
              leaf source-protocol {
                type identityref {
                  base routing-protocol;
                }
                mandatory true;
                description
                  "Type of the routing protocol from which the route
    originated.";
              }
    
              leaf active {
                type empty;
                description
                  "Presence of this leaf indicates that the route is preferred
    among all routes in the same RIB that have the same
    destination prefix.";
              }
    
              leaf last-updated {
                type yang:date-and-time;
                description
                  "Time stamp of the last modification of the route. If the
    route was never modified, it is the time when the route was
    inserted into the RIB.";
              }
    
              leaf destination-prefix {
                type inet:ipv6-prefix;
                description
                  "IPv6 destination prefix.";
              }
    
              leaf destination-prefix {
                type inet:ipv4-prefix;
                description
                  "IPv4 destination prefix.";
              }
            }  // container route
          }
        }  // rpc fib-route
      }  // module ietf-routing
    

© 2024 YumaWorks, Inc. All rights reserved.