<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
    <!ENTITY RFC2119 PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
    <!ENTITY RFC3688 PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3688.xml'>
    <!ENTITY RFC6020 PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6020.xml'>
    <!ENTITY RFC6241 PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6241.xml'>
    <!ENTITY RFC6242 PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6242.xml'>
    <!ENTITY RFC7950 PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7950.xml'>
    <!ENTITY RFC8022 PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8022.xml'>
    <!ENTITY RFC8040 PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8040.xml'>
    <!ENTITY RFC8340 PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8340.xml'>
    <!ENTITY RFC8341 PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8341.xml'>
    <!ENTITY RFC8349 PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8349.xml'>
    <!ENTITY RFC8446 PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8446.xml'>
    <!ENTITY RFC8666 PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8666.xml'>
    <!ENTITY RFC9129 PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml/reference.RFC.9129.xml'>
    <!ENTITY I-D.ietf-ospf-sr-yang PUBLIC ''
      'http://xml.resource.org/public/rfc/bibxml-ids/reference.I-D.ietf-ospf-sr-yang'>
    ]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc strict="no" ?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>

<?rfc rfcedstyle="yes" ?>
<?rfc subcompact="no" ?>

<rfc category="std" docName="draft-acee-lsr-ospfv3-sr-yang-08" ipr="trust200902">
  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN"
     they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the
         full title is longer than 39 characters -->

  <title abbrev="OSPFv3 SR YANG">YANG Data Model for OSPFv3 Segment Routing</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

    <author fullname="Acee Lindem" initials="A." surname="Lindem">
      <organization>Cisco Systems</organization>
      <address>
        <postal>
          <street>301 Midenhall Way</street>
          <city>Cary, NC 27513</city>
        </postal>
        <email>acee@cisco.com</email>
      </address>
    </author>
    <author fullname="Yingzhen Qu" initials="Y" surname="Qu">
      <organization>Futurewei</organization>
      <address>
        <postal>
          <street>2330 Central Expressway</street>
          <city>Santa Clara</city>
          <region>CA</region>
          <code>95050</code>
          <country>USA</country>
        </postal>
        <phone></phone>
        <email>yingzhen.qu@futurewei.com</email>
      </address>
    </author>
    <date/>

    <!-- If the month and year are both specified and are the current ones, xml2rfc will fill
         in the current day for you. If only the current year is specified, xml2rfc will fill
   in the current day and month for you. If the year is not the current one, it is
   necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the
   purpose of calculating the expiry date).  With drafts it is normally sufficient to
   specify just the year. -->

    <!-- Meta-data Declarations -->

    <area>General</area>

    <workgroup>Internet</workgroup>

    <!-- WG name at the upperleft corner of the doc,
         IETF is fine for individual submissions.
   If this element is not present, the default is "Network Working Group",
         which is used by the RFC Editor as a nod to the history of the IETF. -->

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
      <t>This document defines a YANG data module augmenting the IETF OSPF
        Segment Routing (SR) YANG model to support OSPFv3 extensions for SR. It
        can be used to configure and manage OSPFv3 Segment Routing in MPLS
        data plane. </t>
    </abstract>
  </front>

  <middle>
    <section title="Overview">
      <t>YANG <xref target="RFC7950"></xref> is a
      data definition language
      used to define the contents of a conceptual data store
      that allows networked devices to be managed using NETCONF
      <xref target="RFC6241"/>.  YANG is proving relevant beyond its
      initial confines, as bindings to other interfaces (e.g., ReST) and
      encodings other than XML (e.g., JSON) are being defined.  Furthermore,
      YANG data models can be used as the basis for implementation of other
      interfaces, such as CLI and programmatic APIs.</t>

      <t>This document defines a YANG data module augmenting the IETF OSPF SR
      YANG model <xref target="I-D.ietf-ospf-sr-yang"/>, and can be used to
      configure and manage OSPFv3 extensions for Segment Routing with the MPLS
      data plane.
      <xref target="RFC8666"/>. </t>

      <t>The augmentation defined in this document requires support for both
        the OSPF SR model and the
        OSPF base model<xref target="RFC9129"></xref>.
      </t>

      <section title="Requirements Language">
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
        document are to be interpreted as described in <xref target="RFC2119"></xref>.</t>
      </section>
    </section>


  <section title="Tree Diagrams">
    <t> Tree diagrams used in this document follow the notation defined
      in <xref target="RFC8340"/>. </t>
  </section>


  <section title="OSPFv3 Extensions for Segment Routing">

    <t>This document defines a YANG module for OSPFv3 extensions for Segment
    Routing <xref target="RFC8666"/>. It is an augmentation of the OSPF
    SR base YANG model, where the configuration for both OSPFv2 and OSPFv3
    are defined. </t>
    <t><xref target="RFC8022"/> and <xref target="RFC8349"/>
    are not referenced in the document text but within the YANG module itself.</t>


    <figure align="left">
      <artwork align="left">
module: ietf-ospfv3-sr
augment /rt:routing/rt:control-plane-protocols
        /rt:control-plane-protocol/ospf:ospf/ospf:database
        /ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa
        /ospf:version/ospf:ospfv3/ospf:ospfv3/ospf:body
        /ospf:router-information:
  +--ro sr-algorithm-tlv
  |  +--ro sr-algorithm*   uint8
  +--ro sid-range-tlvs
  |  +--ro sid-range-tlv* []
  |     +--ro range-size?    uint24
  |     +--ro sid-sub-tlv
  |        +--ro sid?   uint32
  +--ro local-block-tlvs
  |  +--ro local-block-tlv* []
  |     +--ro range-size?    uint24
  |     +--ro sid-sub-tlv
  |        +--ro sid?   uint32
  +--ro srms-preference-tlv
     +--ro preference?   uint8
augment /rt:routing/rt:control-plane-protocols
        /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
        /ospf:database/ospf:area-scope-lsa-type/ospf:area-scope-lsas
        /ospf:area-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
        /ospf:body/ospf:router-information:
  +--ro sr-algorithm-tlv
  |  +--ro sr-algorithm*   uint8
  +--ro sid-range-tlvs
  |  +--ro sid-range-tlv* []
  |     +--ro range-size?    uint24
  |     +--ro sid-sub-tlv
  |        +--ro sid?   uint32
  +--ro local-block-tlvs
  |  +--ro local-block-tlv* []
  |     +--ro range-size?    uint24
  |     +--ro sid-sub-tlv
  |        +--ro sid?   uint32
  +--ro srms-preference-tlv
     +--ro preference?   uint8
augment /rt:routing/rt:control-plane-protocols
        /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
        /ospf:interfaces/ospf:interface/ospf:database
        /ospf:link-scope-lsa-type/ospf:link-scope-lsas
        /ospf:link-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
        /ospf:body/ospf:router-information:
  +--ro sr-algorithm-tlv
  |  +--ro sr-algorithm*   uint8
  +--ro sid-range-tlvs
  |  +--ro sid-range-tlv* []
  |     +--ro range-size?    uint24
  |     +--ro sid-sub-tlv
  |        +--ro sid?   uint32
  +--ro local-block-tlvs
  |  +--ro local-block-tlv* []
  |     +--ro range-size?    uint24
  |     +--ro sid-sub-tlv
  |        +--ro sid?   uint32
  +--ro srms-preference-tlv
     +--ro preference?   uint8
augment /rt:routing/rt:control-plane-protocols
        /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
        /ospf:database/ospf:area-scope-lsa-type/ospf:area-scope-lsas
        /ospf:area-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
        /ospf:body/ospfv3-e-lsa:e-intra-area-prefix:
  +--ro ospfv3-extended-prefix-range-tlvs
     +--ro extended-prefix-range-tlv* []
        +--ro prefix-length?         uint8
        +--ro af?                    uint8
        +--ro range-size?            uint16
        +--ro prefix?                inet:ip-prefix
        +--ro perfix-sid-sub-tlvs
        |  +--ro prefix-sid-sub-tlv* []
        |     +--ro ospfv3-prefix-sid-flags
        |     |  +--ro bits*   identityref
        |     +--ro algorithm?                 uint8
        |     +--ro sid?                       uint32
        +--ro unknown-tlvs
           +--ro unknown-tlv* []
              +--ro type?     uint16
              +--ro length?   uint16
              +--ro value?    yang:hex-string
augment /rt:routing/rt:control-plane-protocols
        /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
        /ospf:database/ospf:area-scope-lsa-type/ospf:area-scope-lsas
        /ospf:area-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
        /ospf:body/ospfv3-e-lsa:e-inter-area-prefix:
  +--ro ospfv3-extended-prefix-range-tlvs
     +--ro extended-prefix-range-tlv* []
        +--ro prefix-length?         uint8
        +--ro af?                    uint8
        +--ro range-size?            uint16
        +--ro prefix?                inet:ip-prefix
        +--ro perfix-sid-sub-tlvs
        |  +--ro prefix-sid-sub-tlv* []
        |     +--ro ospfv3-prefix-sid-flags
        |     |  +--ro bits*   identityref
        |     +--ro algorithm?                 uint8
        |     +--ro sid?                       uint32
        +--ro unknown-tlvs
           +--ro unknown-tlv* []
              +--ro type?     uint16
              +--ro length?   uint16
              +--ro value?    yang:hex-string
augment /rt:routing/rt:control-plane-protocols
        /rt:control-plane-protocol/ospf:ospf/ospf:database
        /ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa
        /ospf:version/ospf:ospfv3/ospf:ospfv3/ospf:body
        /ospfv3-e-lsa:e-as-external:
  +--ro ospfv3-extended-prefix-range-tlvs
     +--ro extended-prefix-range-tlv* []
        +--ro prefix-length?         uint8
        +--ro af?                    uint8
        +--ro range-size?            uint16
        +--ro prefix?                inet:ip-prefix
        +--ro perfix-sid-sub-tlvs
        |  +--ro prefix-sid-sub-tlv* []
        |     +--ro ospfv3-prefix-sid-flags
        |     |  +--ro bits*   identityref
        |     +--ro algorithm?                 uint8
        |     +--ro sid?                       uint32
        +--ro unknown-tlvs
           +--ro unknown-tlv* []
              +--ro type?     uint16
              +--ro length?   uint16
              +--ro value?    yang:hex-string
augment /rt:routing/rt:control-plane-protocols
        /rt:control-plane-protocol/ospf:ospf/ospf:database
        /ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa
        /ospf:version/ospf:ospfv3/ospf:ospfv3/ospf:body
        /ospfv3-e-lsa:e-nssa:
  +--ro ospfv3-extended-prefix-range-tlvs
     +--ro extended-prefix-range-tlv* []
        +--ro prefix-length?         uint8
        +--ro af?                    uint8
        +--ro range-size?            uint16
        +--ro prefix?                inet:ip-prefix
        +--ro perfix-sid-sub-tlvs
        |  +--ro prefix-sid-sub-tlv* []
        |     +--ro ospfv3-prefix-sid-flags
        |     |  +--ro bits*   identityref
        |     +--ro algorithm?                 uint8
        |     +--ro sid?                       uint32
        +--ro unknown-tlvs
           +--ro unknown-tlv* []
              +--ro type?     uint16
              +--ro length?   uint16
              +--ro value?    yang:hex-string
augment /rt:routing/rt:control-plane-protocols
        /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
        /ospf:interfaces/ospf:interface/ospf:database
        /ospf:link-scope-lsa-type/ospf:link-scope-lsas
        /ospf:link-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
        /ospf:body/ospfv3-e-lsa:e-link/ospfv3-e-lsa:e-link-tlvs
        /ospfv3-e-lsa:intra-prefix-tlv:
  +--ro perfix-sid-sub-tlvs
     +--ro prefix-sid-sub-tlv* []
        +--ro ospfv3-prefix-sid-flags
        |  +--ro bits*   identityref
        +--ro algorithm?                 uint8
        +--ro sid?                       uint32
augment /rt:routing/rt:control-plane-protocols
        /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
        /ospf:database/ospf:area-scope-lsa-type/ospf:area-scope-lsas
        /ospf:area-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
        /ospf:body/ospfv3-e-lsa:e-intra-area-prefix
        /ospfv3-e-lsa:e-intra-prefix-tlvs
        /ospfv3-e-lsa:intra-prefix-tlv:
  +--ro perfix-sid-sub-tlvs
     +--ro prefix-sid-sub-tlv* []
        +--ro ospfv3-prefix-sid-flags
        |  +--ro bits*   identityref
        +--ro algorithm?                 uint8
        +--ro sid?                       uint32
augment /rt:routing/rt:control-plane-protocols
        /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
        /ospf:database/ospf:area-scope-lsa-type/ospf:area-scope-lsas
        /ospf:area-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
        /ospf:body/ospfv3-e-lsa:e-inter-area-prefix
        /ospfv3-e-lsa:e-inter-prefix-tlvs
        /ospfv3-e-lsa:inter-prefix-tlv:
  +--ro perfix-sid-sub-tlvs
     +--ro prefix-sid-sub-tlv* []
        +--ro ospfv3-prefix-sid-flags
        |  +--ro bits*   identityref
        +--ro algorithm?                 uint8
        +--ro sid?                       uint32
augment /rt:routing/rt:control-plane-protocols
        /rt:control-plane-protocol/ospf:ospf/ospf:database
        /ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa
        /ospf:version/ospf:ospfv3/ospf:ospfv3/ospf:body
        /ospfv3-e-lsa:e-as-external/ospfv3-e-lsa:e-external-tlvs
        /ospfv3-e-lsa:external-prefix-tlv:
  +--ro perfix-sid-sub-tlvs
     +--ro prefix-sid-sub-tlv* []
        +--ro ospfv3-prefix-sid-flags
        |  +--ro bits*   identityref
        +--ro algorithm?                 uint8
        +--ro sid?                       uint32
augment /rt:routing/rt:control-plane-protocols
        /rt:control-plane-protocol/ospf:ospf/ospf:database
        /ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa
        /ospf:version/ospf:ospfv3/ospf:ospfv3/ospf:body
        /ospfv3-e-lsa:e-nssa/ospfv3-e-lsa:e-external-tlvs
        /ospfv3-e-lsa:external-prefix-tlv:
  +--ro perfix-sid-sub-tlvs
     +--ro prefix-sid-sub-tlv* []
        +--ro ospfv3-prefix-sid-flags
        |  +--ro bits*   identityref
        +--ro algorithm?                 uint8
        +--ro sid?                       uint32
augment /rt:routing/rt:control-plane-protocols
        /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
        /ospf:database/ospf:area-scope-lsa-type/ospf:area-scope-lsas
        /ospf:area-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
        /ospf:body/ospfv3-e-lsa:e-router/ospfv3-e-lsa:e-router-tlvs
        /ospfv3-e-lsa:link-tlv:
  +--ro adj-sid-sub-tlvs
  |  +--ro adj-sid-sub-tlv* []
  |     +--ro adj-sid-flags
  |     |  +--ro bits*   identityref
  |     +--ro weight?          uint8
  |     +--ro sid?             uint32
  +--ro lan-adj-sid-sub-tlvs
     +--ro lan-adj-sid-sub-tlv* []
        +--ro lan-adj-sid-flags
        |  +--ro bits*   identityref
        +--ro weight?               uint8
        +--ro neighbor-router-id?   yang:dotted-quad
        +--ro sid?                  uint32
      </artwork>
    </figure>

        <t>
    <figure>
      <artwork><![CDATA[
<CODE BEGINS> file "ietf-ospfv3-sr@2022-10-21.yang"
module ietf-ospfv3-sr {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-ospfv3-sr";

  prefix ospfv3-sr;

  import ietf-inet-types {
    prefix "inet";
    reference
      "RFC 6991: Common YANG Data Types";
  }

  import ietf-yang-types {
    prefix "yang";
    reference
      "RFC 6991: Common YANG Data Types";
  }

  import ietf-routing {
    prefix "rt";
    reference
      "RFC 8349: A YANG Data Model for Routing Management
                 (NMDA Version)";

  }

  import ietf-ospf {
    prefix "ospf";
    reference
      "RFC 9129: YANG Data Model for the OSPF Protocol";

  }

  import ietf-ospfv3-extended-lsa {
    prefix "ospfv3-e-lsa";
  }

  import ietf-ospf-sr {
    prefix "ospf-sr";
  }

  organization
    "IETF LSR - Link State Routing Working Group";

  contact
     "WG Web:   <https://datatracker.ietf.org/wg/lsr/>
      WG List:  <mailto:lsr@ietf.org>

      Author:   Yingzhen Qu
                <mailto:yqu@futurewei.com>
      Author:   Acee Lindem
                <mailto:acee@cisco.com>";

  description
    "This YANG module defines the operational state for OSPFv3
     Segment Routing, which is common across all of the vendor
     implementations. It is intended that the module will be
     extended by vendors to define vendor-specific OSPFv3
     Segment Routing configuration and operational parameters
     and policies.

     This YANG model conforms to the Network Management
     Datastore Architecture (NMDA) as described in RFC 8342.

     Copyright (c) 2022 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 Revised BSD License set
     forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX;
     see the RFC itself for full legal notices.

     The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
     NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED',
     'MAY', and 'OPTIONAL' in this document are to be interpreted as
     described in BCP 14 (RFC 2119) (RFC 8174) when, and only when,
     they appear in all capitals, as shown here.";

  reference "RFC XXXX";

  revision 2022-10-21 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: A YANG Data Model for OSPFv3 Segment Routing.";
  }

  /* groupings */
  grouping ospfv3-prefix-sid-sub-tlvs {
    description "Prefix Segment ID (SID) sub-TLVs.";
    container perfix-sid-sub-tlvs{
      description "Prefix SID sub-TLV.";
      list prefix-sid-sub-tlv {
        description "Prefix SID sub-TLV.";
        container ospfv3-prefix-sid-flags {
          leaf-list bits {
            type identityref {
              base ospf-sr:prefix-sid-bit;
            }
            description
              "Prefix SID Sub-TLV flag bits list.";
          }
          description "Segment Identifier (SID) Flags.";
        }
        leaf algorithm {
          type uint8;
          description
            "The algorithm associated with the prefix-SID.";
        }
        leaf sid {
          type uint32;
          description "An index or label.";
        }
      }
    }
  }

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

    container ospfv3-extended-prefix-range-tlvs {
      description "The list of extended prefix range TLVs.";
      list extended-prefix-range-tlv {
        description "The range of prefixes.";
        leaf prefix-length {
          type uint8;
          description "Length of prefix in bits.";
        }
        leaf af {
          type uint8;
          description "Address family for the prefix.";
        }
        leaf range-size {
          type uint16;
          description "The number of prefixes covered by the
                       advertisement.";
        }
        leaf prefix {
          type inet:ip-prefix;
          description "Address prefix.";
        }
        uses ospfv3-prefix-sid-sub-tlvs;
        uses ospf:unknown-tlvs;
      }
    }
  }

  grouping ospfv3-adj-sid-sub-tlvs {
    description "Adjacency SID sub TLV grouping.";
    container adj-sid-sub-tlvs {
      description "Adjacency SID optional sub-TLVs.";
      list adj-sid-sub-tlv {
        description "List of Adjacency SID sub-TLVs.";
        container adj-sid-flags {
          leaf-list bits {
            type identityref {
              base ospf-sr:adj-sid-bit;
            }
            description "Adj sid sub-tlv flags list.";
          }
          description "Adj-sid sub-tlv flags.";
        }
        leaf weight {
          type uint8;
          description "Weight used for load-balancing.";
        }
        leaf sid {
          type uint32;
          description "Segment Identifier (SID) index/label.";
        }
      }
    }
  }

  grouping ospfv3-lan-adj-sid-sub-tlvs {
    description "LAN adj-sid sub TLV grouping.";
    container lan-adj-sid-sub-tlvs {
      description "LAN Adjacency SID optional sub-TLVs.";
      list lan-adj-sid-sub-tlv {
        description "List of LAN adjacency SID sub-TLVs.";
        container lan-adj-sid-flags {
          leaf-list bits {
            type identityref {
              base ospf-sr:adj-sid-bit;
            }
            description "LAN adj sid sub-tlv flags list.";
          }
          description "LAN adj-sid sub-tlv flags.";
        }
        leaf weight {
          type uint8;
          description "Weight used for load-balancing.";
        }
        leaf neighbor-router-id {
          type yang:dotted-quad;
          description "Neighbor router ID.";
        }
        leaf sid {
          type uint32;
          description "Segment Identifier (SID) index/label.";
        }
      }
    }
  }

  /* Database */
  /* Segment Routing Capabilities */
  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:database/"
        + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
        + "ospf:as-scope-lsa/ospf:version/ospf:ospfv3/"
        + "ospf:ospfv3/ospf:body/ospf:router-information" {
    when "../../../../../../../../"
       + "rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3.";
    }
    description
      "SR specific TLVs for OSPFv3 Router Information
       opaque LSA.";
    uses ospf-sr:sr-algorithm-tlv;
    uses ospf-sr:sid-range-tlvs;
    uses ospf-sr:local-block-tlvs;
    uses ospf-sr:srms-preference-tlv;
  }

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:areas/"
        + "ospf:area/ospf:database/"
        + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
        + "ospf:area-scope-lsa/ospf:version/ospf:ospfv3/"
        + "ospf:ospfv3/ospf:body/ospf:router-information" {
    when "../../../../../../../../../../"
       + "rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3.";
    }

    description
      "SR specific TLVs for OSPFv3 Router Information LSA.";

    uses ospf-sr:sr-algorithm-tlv;
    uses ospf-sr:sid-range-tlvs;
    uses ospf-sr:local-block-tlvs;
    uses ospf-sr:srms-preference-tlv;
  }

  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol/"
        + "ospf:ospf/ospf:areas/ospf:area/"
        + "ospf:interfaces/ospf:interface/ospf:database/"
        + "ospf:link-scope-lsa-type/ospf:link-scope-lsas/"
        + "ospf:link-scope-lsa/ospf:version/ospf:ospfv3/"
        + "ospf:ospfv3/ospf:body/ospf:router-information" {
    when "../../../../../../../../../../../../"
       + "rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3.";
    }

    description
      "SR specific TLVs for OSPFv3 Router Information LSA.";

    uses ospf-sr:sr-algorithm-tlv;
    uses ospf-sr:sid-range-tlvs;
    uses ospf-sr:local-block-tlvs;
    uses ospf-sr:srms-preference-tlv;
  }

  /* OSPFv3 Extended Prefix Range TLV */
  augment "/rt:routing/"
    + "rt:control-plane-protocols/rt:control-plane-protocol/"
    + "ospf:ospf/ospf:areas/ospf:area/ospf:database/"
    + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
    + "ospf:area-scope-lsa/ospf:version/ospf:ospfv3/"
    + "ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-intra-area-prefix" {
    when "../../../../../../../../../../"
      + "rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3
         E-Router LSAs";
    }
    uses ospfv3-extended-prefix-range-tlvs;
    description
      "OSPFv3 Area-Scoped E-Intra-Area-Prefix LSA.";
  }

  augment "/rt:routing/"
    + "rt:control-plane-protocols/rt:control-plane-protocol/"
    + "ospf:ospf/ospf:areas/ospf:area/ospf:database/"
    + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
    + "ospf:area-scope-lsa/ospf:version/ospf:ospfv3/"
    + "ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-inter-area-prefix" {
    when "../../../../../../../../../../"
      + "rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3
         E-Router LSAs";
    }
    uses ospfv3-extended-prefix-range-tlvs;
    description
      "OSPFv3 Area-Scoped E-Inter-Area-Prefix LSA.";
  }

  augment "/rt:routing/"
    + "rt:control-plane-protocols/rt:control-plane-protocol/"
    + "ospf:ospf/ospf:database/"
    + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
    + "ospf:as-scope-lsa/ospf:version/ospf:ospfv3/"
    + "ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-as-external" {
    when "'ospf:../../../../../../../../../"
      + "rt:type' = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3.";
    }
    uses ospfv3-extended-prefix-range-tlvs;
    description
      "OSPFv3 AS-Scoped E-AS-External LSA.";
  }

  augment "/rt:routing/"
    + "rt:control-plane-protocols/rt:control-plane-protocol/"
    + "ospf:ospf/ospf:database/"
    + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
    + "ospf:as-scope-lsa/ospf:version/ospf:ospfv3/"
    + "ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-nssa" {
    when "'ospf:../../../../../../../../../"
      + "rt:type' = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3.";
    }
    uses ospfv3-extended-prefix-range-tlvs;
    description
      "OSPFv3 AS-Scoped E-NSSA LSA.";
  }

  /* Prefix SID Sub-TLV in Intra-Area Prefix TLV */
  augment "/rt:routing/"
    + "rt:control-plane-protocols/rt:control-plane-protocol/"
    + "ospf:ospf/ospf:areas/ospf:area/ospf:interfaces/"
    + "ospf:interface/"
    + "ospf:database/ospf:link-scope-lsa-type/ospf:link-scope-lsas/"
    + "ospf:link-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3/"
    + "ospf:body/ospfv3-e-lsa:e-link/"
    + "ospfv3-e-lsa:e-link-tlvs/ospfv3-e-lsa:intra-prefix-tlv" {
    when "../../../../../../../../../../../../../../"
      + "rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3
         E-Router LSAs";
    }
    uses ospfv3-prefix-sid-sub-tlvs;
    description
      "OSPFv3 Link-Scoped Intra-Area Prefix TLV.";
  }

  augment "/rt:routing/"
    + "rt:control-plane-protocols/rt:control-plane-protocol/"
    + "ospf:ospf/ospf:areas/ospf:area/ospf:database/"
    + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
    + "ospf:area-scope-lsa/ospf:version/ospf:ospfv3/"
    + "ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-intra-area-prefix/"
    + "ospfv3-e-lsa:e-intra-prefix-tlvs/"
    +  "ospfv3-e-lsa:intra-prefix-tlv" {
    when "../../../../../../../../../../../../"
      + "rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3
         E-Router LSAs";
    }
    uses ospfv3-prefix-sid-sub-tlvs;
    description
      "OSPFv3 Area-Scoped Intra-Area Prefix TLV.";
  }


  /* Prefix SID Sub-TLV in Inter-Area Prefix TLV */
  augment "/rt:routing/"
    + "rt:control-plane-protocols/rt:control-plane-protocol/"
    + "ospf:ospf/ospf:areas/ospf:area/ospf:database/"
    + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
    + "ospf:area-scope-lsa/ospf:version/ospf:ospfv3/"
    + "ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-inter-area-prefix/"
    + "ospfv3-e-lsa:e-inter-prefix-tlvs/"
    + "ospfv3-e-lsa:inter-prefix-tlv" {
    when "../../../../../../../../../../../../"
      + "rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3
         E-Router LSAs";
    }
    uses ospfv3-prefix-sid-sub-tlvs;
    description
      "OSPFv3 Area-Scoped Inter-Area Prefix TLV.";
  }

  /* Prefix SID Sub-TLV in External Prefix TLV */
  augment "/rt:routing/"
    + "rt:control-plane-protocols/rt:control-plane-protocol/"
    + "ospf:ospf/ospf:database/"
    + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
    + "ospf:as-scope-lsa/ospf:version/ospf:ospfv3/"
    + "ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-as-external/"
    + "ospfv3-e-lsa:e-external-tlvs/"
    + "ospfv3-e-lsa:external-prefix-tlv" {
    when "'ospf:../../../../../../../../../"
      + "rt:type' = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3.";
    }
    uses ospfv3-prefix-sid-sub-tlvs;
    description
      "OSPFv3 AS-Scoped External Prefix TLV.";
  }

  augment "/rt:routing/"
    + "rt:control-plane-protocols/rt:control-plane-protocol/"
    + "ospf:ospf/ospf:database/"
    + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
    + "ospf:as-scope-lsa/ospf:version/ospf:ospfv3/"
    + "ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-nssa/"
    + "ospfv3-e-lsa:e-external-tlvs/"
    + "ospfv3-e-lsa:external-prefix-tlv" {
    when "'ospf:../../../../../../../../../"
      + "rt:type' = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3.";
    }
    uses ospfv3-prefix-sid-sub-tlvs;
    description
      "OSPFv3 AS-Scoped External Prefix TLV.";
  }

  /* Adj-SID sub-TLV */
  augment "/rt:routing/"
    + "rt:control-plane-protocols/rt:control-plane-protocol/"
    + "ospf:ospf/ospf:areas/ospf:area/ospf:database/"
    + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
    + "ospf:area-scope-lsa/ospf:version/ospf:ospfv3/"
    + "ospf:ospfv3/ospf:body/ospfv3-e-lsa:e-router/"
    + "ospfv3-e-lsa:e-router-tlvs/ospfv3-e-lsa:link-tlv" {
    when "../../../../../../../../../../../../"
      + "rt:type = 'ospf:ospfv3'" {
      description
        "This augmentation is only valid for OSPFv3
         E-Router LSAs";
    }
    uses ospfv3-adj-sid-sub-tlvs;
    uses ospfv3-lan-adj-sid-sub-tlvs;
    description
      "OSPFv3 Area-Scoped Adj-SID Sub-TLV.";
  }
}
<CODE ENDS>
      ]]></artwork>
    </figure>
  </t>

  </section>



    <section anchor="Security" title="Security Considerations">
    <t>The YANG modules specified in this document define a schema for
       data that is designed to be accessed via network
       management protocols such as NETCONF <xref target="RFC6241"/> or
       RESTCONF <xref target="RFC8040"/>. The lowest NETCONF layer is the secure transport
       layer, and the mandatory-to-implement secure transport is Secure Shell (SSH)
       <xref target="RFC6242"/>. The lowest RESTCONF layer is HTTPS, and the
       mandatory-to-implement secure transport is TLS <xref target="RFC8446"/>.</t>

   <t>The Network Configuration Access Control Model (NACM) [<xref target="RFC8341"/> provides the
      means to restrict access for particular NETCONF or RESTCONF users to a
      pre-configured subset of all available NETCONF or RESTCONF protocol
      operations and content.</t>

   <t>Some of the readable data nodes in the modules
      may be considered sensitive or vulnerable in some network environments. It is thus
      important to control read access (e.g., via get, get-config, or notification)
      to these data nodes. The exposure of the Link State Database (LSDB) will
      expose the detailed topology of the network. This may be undesirable since
      both due to the fact that exposure may facilitate other attacks. Additionally,
      network operators may consider their topologies to be sensitive confidential
      data.</t>
      <list style="empty">
        <t>/ospf:ospfv3/ospf:body/ospf:router-information/sr-algorithm-tlv</t>
        <t>/ospf:ospfv3/ospf:body/ospf:router-information/sid-range-tlvs</t>
        <t>/ospf:ospfv3/ospf:body/ospf:router-information/local-block-tlvs</t>
        <t>/ospf:ospfv3/ospf:body/ospf:router-information/srms-preference-tlv</t>
        <t>/ospfv3-extended-prefix-range-tlvs</t>
        <t>/prefix-sid-sub-tlvs</t>
        <t>/adj-sid-sub-tlvs</t>
        <t>/lan-adj-sid-sub-tlvs</t>
      </list>
   </section>
<section title="IANA Considerations">
<t>This document registers URIs in the IETF XML registry
   <xref target="RFC3688"/>.  Following the format in <xref target="RFC3688"/>,
   the following registrations is requested to be made:
   <figure>
   <artwork>
   URI: urn:ietf:params:xml:ns:yang:ietf-ospfv3-sr
   Registrant Contact: The IESG.
   XML: N/A, the requested URI is an XML namespace.
   </artwork>
   </figure>
</t>
   <t>This document registers the YANG modules in the YANG Module Names
   registry <xref target="RFC6020"/>.
   <figure>
   <artwork>
   name: ietf-ospfv3-sr
   namespace: urn:ietf:params:xml:ns:yang:ietf-ospfv3-sr
   prefix: ospfv3-sr
   reference: RFC XXXX
   </artwork>
   </figure>

   </t>
</section>
    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>This document was produced using Marshall Rose's xml2rfc tool.</t>
      <t>The YANG model was developed using the suite of YANG tools written
         and maintained by numerous authors.</t>
    </section>
  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

     Both are cited textually in the same manner: by using xref elements.
     If you use the PI option, xml2rfc will, by default, try to find included files in the same
     directory as the including file. You can also define the XML_LIBRARY environment variable
     with a value containing a set of directories to search.  These can be either in the local
     filing system or remote ones accessed by http (http://domain/dir/... ).-->

    <references title="Normative References">
      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
      &RFC2119;
      &RFC3688;
      &RFC6020;
      &RFC6241;
      &RFC6242;
      &RFC7950;
      &RFC8022;
      &RFC8040;
      &RFC8341;
      &RFC8349;
      &RFC8446;
      &RFC8666;
      &RFC9129;
      &I-D.ietf-ospf-sr-yang;
   </references>
    <references title="Informative References">
      <!-- Here we use entities that we defined at the beginning. -->
      &RFC8340;
    </references>

  </back>
</rfc>
