module ietf-ospfv3-extended-lsa {
yang-version 1.1;
namespace
"urn:ietf:params:xml:ns:yang:ietf-ospfv3-extended-lsa";
prefix ospfv3-e-lsa;
import ietf-routing-types {
prefix "rt-types";
}
import ietf-inet-types {
prefix "inet";
reference "RFC 6021 - 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 XXXX - A YANG Data Model for OSPF
Protocol";
}
organization
"IETF LSR - Link State Routing Working Group";
contact
"WG Web:
WG List:
Author: Acee Lindem
Author: Sharmila Palani
Author: Yingzhen Qu
";
description
"This YANG module defines the configuration
and operational state for OSPFv3 Extended LSAs, which is
common across all of the vendor implementations.
Copyright (c) 2019 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).
This version of this YANG module is part of RFC XXXX;
see the RFC itself for full legal notices.";
reference "RFC XXXX";
revision 2019-07-05 {
description
"Initial revision.";
reference
"RFC XXXX: A YANG Data Model for OSPFv3 Extended LSAs.";
}
feature extended-lsa-support {
description
"Support for OSPFv3 Extended LSAs";
reference
"RFC 8362 - OSPFv3 Link State Advertisement (LSA)
Extensibility";
}
/*
* OSPFv3 Extend LSA Type Identities
*/
identity ospfv3-e-router-lsa {
base ospf:ospfv3-lsa-type;
description
"OSPFv3 Extended Router LSA - Type 0xA021";
}
identity ospfv3-e-network-lsa {
base ospf:ospfv3-lsa-type;
description
"OSPFv3 Extended Network LSA - Type 0xA022";
}
identity ospfv3-e-summary-lsa-type {
base ospf:ospfv3-lsa-type;
description
"OSPFv3 Extended Summary LSA types";
}
identity ospfv3-e-inter-area-prefix-lsa {
base ospfv3-e-summary-lsa-type;
description
"OSPFv3 Extended Inter-area Prefix LSA - Type 0xA023";
}
identity ospfv3-e-inter-area-router-lsa {
base ospfv3-e-summary-lsa-type;
description
"OSPFv3 Exteneded Inter-area Router LSA - Type 0xA024";
}
identity ospfv3-e-external-lsa-type {
base ospf:ospfv3-lsa-type;
description
"OSPFv3 Extended External LSA types";
}
identity ospfv3-e-as-external-lsa {
base ospfv3-e-external-lsa-type;
description
"OSPFv3 Extended AS-External LSA - Type 0xC025";
}
identity ospfv3-e-nssa-lsa {
base ospfv3-e-external-lsa-type;
description
"OSPFv3 Extended Not-So-Stubby-Area (NSSA) LSA -
Type 0xA027";
}
identity ospfv3-e-link-lsa {
base ospf:ospfv3-lsa-type;
description
"OSPFv3 Extended Link LSA - Type 0x8028";
}
identity ospfv3-e-intra-area-prefix-lsa {
base ospf:ospfv3-lsa-type;
description
"OSPFv3 Extended Intra-area Prefix LSA - Type 0xA029";
}
grouping unknown-sub-tlv {
description
"Unknown TLV grouping";
container unknown-sub-tlv {
uses ospf:tlv;
description "Unknown External TLV Sub-TLV";
}
}
grouping ospfv3-lsa-prefix {
description
"OSPFv3 LSA prefix";
leaf prefix {
type inet:ip-prefix;
description
"LSA Prefix";
}
leaf prefix-options {
type bits {
bit NU {
description
"When set, the prefix should be excluded
from IPv6 unicast calculations.";
}
bit LA {
description
"When set, the prefix is actually an IPv6 interface
address of the Advertising Router.";
}
bit P {
description
"When set, the NSSA area prefix should be
translated to an AS External LSA and readvertised
by the translating NSSA Border Router.";
}
bit DN {
description
"When set, the inter-area-prefix LSA or
AS-external LSA prefix has been advertised as an
L3VPN prefix.";
}
}
description "Prefix options";
}
}
grouping ipv6-fwd-addr-sub-tlv {
container ipv6-fwd-addr-sub-tlv {
description
"IPv6 Forwarding Address Sub-TLV";
leaf ipv6-fwd-addr-sub-tlv-length {
type uint16;
description
"IPv6 Forwarding Addrss Sub-TLV Length - 16
for IPv6 address";
}
leaf forwarding-address {
type inet:ipv6-address;
description
"Forwarding address";
}
}
description
"IPv6 Forwarding Address Sub-TLV grouping";
}
grouping ipv4-fwd-addr-sub-tlv {
container ipv4-fwd-addr-sub-tlv {
description
"IPv4 Forwarding Address Sub-TLV";
leaf ipv4-fwd-addr-sub-tlv-length {
type uint16;
description
"IPv4 Forwarding Addrss Sub-TLV Length - 4
for IPv4 address";
}
leaf forwarding-address {
type inet:ipv4-address;
description
"Forwarding address";
}
}
description
"IPv4 Forwarding Address Sub-TLV grouping";
}
grouping route-tag-sub-tlv {
container route-tag-sub-tlv {
description
"Route Tag Sub-TLV";
leaf route-tag-sub-tlv-length {
type uint16;
description
"Route Tag Sub-TLV Length - 4 for 32-bit tag";
}
leaf route-tag {
type uint32;
description
"Route Tag";
}
}
description
"Route Tag Sub-TLV grouping";
}
grouping external-prefix-tlv {
container external-prefix-tlv {
description "External Prefix LSA TLV";
leaf external-prefix-tlv-length {
type uint16;
description
"External Prefix TLV Length - Variable dependent
on sub-TLVs";
}
leaf flags {
type bits {
bit E {
description
"When set, the metric specified is a Type 2
external metric.";
}
}
description "External Prefix Flags";
}
leaf metric {
type rt-types:uint24;
description "External Prefix Metric";
}
uses ospfv3-lsa-prefix;
list sub-tlvs {
description "External Prefix TLV Sub-TLVs";
uses unknown-sub-tlv;
uses ipv6-fwd-addr-sub-tlv;
uses ipv4-fwd-addr-sub-tlv;
uses route-tag-sub-tlv;
}
}
description "External Prefix TLV Grouping";
}
grouping intra-area-prefix-tlv {
container intra-prefix-tlv {
description "Intra-Area Prefix LSA TLV";
leaf intra-prefix-tlv-length {
type uint16;
description
"Intra-Area Prefix TLV Length - Variable dependent
on sub-TLVs";
}
leaf metric {
type rt-types:uint24;
description "Intra-Area Prefix Metric";
}
uses ospfv3-lsa-prefix;
list sub-tlvs {
description "Intra-Area Prefix TLV Sub-TLVs";
uses unknown-sub-tlv;
}
}
description "Intra-Area Prefix TLV Grouping";
}
grouping ipv6-link-local-tlv {
container ipv6-link-local-tlv {
description "IPv6 Link-Local LSA TLV";
leaf ipv6-link-local-tlv-length {
type uint16;
description
"IPv6 Link-Local TLV Length - Variable dependent
on sub-TLVs";
}
leaf link-local-address {
type inet:ipv6-address;
description
"IPv6 Link Local address";
}
list sub-tlvs {
description "IPv6 Link Local TLV Sub-TLVs";
uses unknown-sub-tlv;
}
}
description "IPv6 Link-Local TLV Grouping";
}
grouping ipv4-link-local-tlv {
container ipv4-link-local-tlv {
description "IPv6 Link-Local LSA TLV";
leaf ipv4-link-local-tlv-length {
type uint16;
description
"IPv4 Link-Local TLV Length - Variable dependent
on sub-TLVs";
}
leaf link-local-address {
type inet:ipv4-address;
description
"IPv4 Link Local address";
}
list sub-tlvs {
description "IPv4 Link Local TLV Sub-TLVs";
uses unknown-sub-tlv;
}
}
description "IPv4 Link-Local TLV Grouping";
}
grouping ospfv3-e-lsa-body {
description "OSPFv3 Extended LSA body.";
container e-router {
when "derived-from(../../ospf:header/ospf:type, "
+ "'ospfv3-e-router-lsa')" {
description "Only valid for OSPFv3 Extended-Router LSAs";
}
description "OSPv3 Extended Router LSA";
uses ospf:ospf-router-lsa-flags;
uses ospf:ospfv3-lsa-options;
list e-router-tlvs {
description "E-Router LSA TLVs";
container unknown-tlv {
uses ospf:tlv;
description "Unknown E-Router TLV";
}
container link-tlv {
description "E-Router LSA TLV";
leaf link-tlv-length {
type uint16;
description
"Link TLV Length - Variable dependent on sub-TLVs";
}
leaf interface-id {
type uint32;
description "Interface ID for link";
}
leaf neighbor-interface-id {
type uint32;
description "Neighbor's Interface ID for link";
}
leaf neighbor-router-id {
type rt-types:router-id;
description "Neighbor's Router ID for link";
}
leaf type {
type uint8;
description "Link type: 1 - Point-to-Point Link
2 - Transit Network Link
3 - Stub Network Link Link
4 - Virtual Link";
}
leaf metric {
type uint16;
description "Link Metric";
}
list sub-tlvs {
description "Link TLV Sub-TLVs";
uses unknown-sub-tlv;
}
}
}
}
container e-network {
when "derived-from(../../ospf:header/ospf:type, "
+ "'ospfv3-e-network-lsa')" {
description
"Only applies to E-Network LSAs.";
}
description "Extended Network LSA";
uses ospf:ospfv3-lsa-options;
list e-network-tlvs {
description "E-Network LSA TLVs";
container unknown--tlv {
uses ospf:tlv;
description "Unknown E-Network TLV";
}
container attached-router-tlv {
description "Attached Router TLV";
leaf attached-router-tlv-length {
type uint16;
description
"Attached Router TLV Length - Variable dependent
on sub-TLVs";
}
leaf Adjacent-neighbor-router-id {
type rt-types:router-id;
description "Adjacent Neighbor's Router ID";
}
list sub-tlvs {
description "Attached Router TLV Sub-TLVs";
uses unknown-sub-tlv;
}
}
}
}
container e-inter-area-prefix {
when "derived-from(../../ospf:header/ospf:type, "
+ "'ospfv3-e-inter-area-prefix-lsa')" {
description
"Only applies to E-Inter-Area-Prefix LSAs.";
}
description "Extended Inter-Area Prefix LSA";
list e-inter-prefix-tlvs {
description "E-Inter-Area-Prefix LSA TLVs";
container unknown--tlv {
uses ospf:tlv;
description "Unknown E-Inter-Area-Prefix TLV";
}
container inter-prefix-tlv {
description "Unknown E-Inter-Area-Prefix LSA TLV";
leaf inter-prefix-tlv-length {
type uint16;
description
"Inter-Area-Prefix TLV Length - Variable dependent
on sub-TLVs";
}
leaf metric {
type rt-types:uint24;
description "Inter-Area Prefix Metric";
}
uses ospfv3-lsa-prefix;
list sub-tlvs {
description "Inter-Area Prefix TLV Sub-TLVs";
uses unknown-sub-tlv;
}
}
}
}
container e-inter-area-router {
when "derived-from(../../ospf:header/ospf:type, "
+ "'ospfv3-e-inter-area-router-lsa')" {
description
"Only applies to E-Inter-Area-Router LSAs.";
}
description "Extended Inter-Area Router LSA";
list e-inter-router-tlvs {
description "E-Inter-Area-Router LSA TLVs";
container unknown-tlv {
uses ospf:tlv;
description "Unknown E-Inter-Area-Router TLV";
}
container inter-router-tlv {
description "Unknown E-Inter-Area-Router LSA TLV";
leaf inter-router-tlv-length {
type uint16;
description
"Inter-Area-Router TLV Length - Variable dependent
on sub-TLVs";
}
uses ospf:ospf-router-lsa-flags;
uses ospf:ospfv3-lsa-options;
leaf metric {
type rt-types:uint24;
description "Inter-Area Router Metric";
}
leaf destination-router-id {
type rt-types:router-id;
description "Destination Router ID";
}
list sub-tlvs {
description "Inter-Area Router TLV Sub-TLVs";
uses unknown-sub-tlv;
}
}
}
}
container e-as-external {
when "derived-from-or-self(../../ospf:header/ospf:type, "
+ "'ospfv3-e-as-external-lsa')" {
description
"Only applies to E-AS-external LSAs.";
}
list e-external-tlvs {
description "E-External LSA TLVs";
container unknown-tlv {
uses ospf:tlv;
description "Unknown E-External TLV";
}
uses external-prefix-tlv;
}
description "E-AS-External LSA.";
}
container e-nssa {
when "derived-from-or-self(../../ospf:header/ospf:type, "
+ "'ospfv3-e-nssa-lsa')" {
description
"Only applies to E-NSSA LSAs.";
}
list e-external-tlvs {
description "E-NSSA LSA TLVs";
container unknown-tlv {
uses ospf:tlv;
description "Unknown E-External TLV";
}
uses external-prefix-tlv;
}
description "E-NSSA LSA.";
}
container e-link {
when "derived-from-or-self(../../ospf:header/ospf:type, "
+ "'ospfv3-e-link-lsa')" {
description
"Only applies to Extended Link LSAs.";
}
description "E-Link LSA";
leaf rtr-priority {
type uint8;
description "Router Priority for the interface.";
}
uses ospf:ospfv3-lsa-options;
list e-link-tlvs {
description "E-Link LSA TLVs";
container unknown-tlv {
uses ospf:tlv;
description "Unknown E-Link TLV";
}
uses intra-area-prefix-tlv;
uses ipv6-link-local-tlv;
uses ipv4-link-local-tlv;
}
}
container e-intra-area-prefix {
when "derived-from-or-self(../../ospf:header/ospf:type, "
+ "'ospfv3-e-intra-area-prefix-lsa')" {
description
"Only applies to E-Intra-Area-Prefix LSAs.";
}
description "E-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 rt-types:router-id;
description
"Referenced Advertising Router";
}
list e-intra-prefix-tlvs {
description "E-Intra-Area-Prefix LSA TLVs";
container unknown-tlv {
uses ospf:tlv;
description "Unknown E-Intra-Area-Prefix TLV";
}
uses intra-area-prefix-tlv;
}
}
}
/* Configuration */
augment "/rt:routing/rt:control-plane-protocols"
+ "/rt:control-plane-protocol/ospf:ospf" {
when "/rt:routing/rt:control-plane-protocols"
+ "/rt:control-plane-protocol/rt:type = 'ospf:ospfv3'" {
description
"This augments the OSPFv3 routing protocol when used.";
}
description
"This augments the OSPFv3 protocol configuration
with segment routing.";
leaf extended-lsa-support {
if-feature extended-lsa-support;
type boolean;
default false;
description
"Enable OSPFv3 Extended LSA Support for the OSPFv3
domain";
}
}
augment "/rt:routing/rt:control-plane-protocols/"
+ "rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area" {
when "'ospf:../../../../../rt:type' = 'ospf:ospfv3'" {
description
"This augments the OSPFv3 area configuration
when used.";
}
description
"This augments the OSPFv3 protocol area
configuration with Extend LSA support";
leaf extended-lsa-support {
if-feature extended-lsa-support;
type boolean;
default false;
description
"Enable OSPFv3 Extended LSA Support for the OSPFv3 area";
}
}
/*
* Link State Database (LSDB) Augmentations
*/
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" {
when "/rt:routing/rt:control-plane-protocols"
+ "/rt:control-plane-protocol/rt:type = 'ospf:ospfv3'" {
description
"This augmentation is only valid for OSPFv3.";
}
description
"OSPFv3 Link-Scoped Extended LSAs";
}
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" {
when "../../../../../../../../../"
+ "rt:type = 'ospf:ospfv3'" {
description
"This augmentation is only valid for OSPFv3
E-Router LSAs";
}
uses ospfv3-e-lsa-body;
description
"OSPFv3 Area-Scoped Extended LSAs";
}
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" {
when "'ospf:../../../../../../../../../"
+ "rt:type' = 'ospf:ospfv3'" {
description
"This augmentation is only valid for OSPFv3.";
}
uses ospfv3-e-lsa-body;
description
"OSPFv3 AS-Scoped Extended LSAs";
}
}