module bgp-segment-routing { yang-version 1; namespace "urn:opendaylight:params:xml:ns:yang:bgp-segment-routing-ext"; prefix "bgp-sr"; import network-concepts { prefix netc; revision-date 2013-11-25; } import ietf-inet-types { prefix inet; revision-date 2013-07-15; } import ietf-routing-types { prefix rt-types; } organization "Cisco Systems, Inc."; contact "Iveta Halanova "; description "This module contains the base data concepts contained in draft-gredler-idr-bgp-ls-segment-routing-ext-02. Copyright (c)2015 Cisco Systems, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html"; revision 2020-01-20 { description "Update to use -no-zone-adresses"; } revision "2015-10-14" { description "Initial revision."; } typedef algorithm { reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.1.2"; type enumeration { enum shortest-path-first { value 0; } enum strict-shortest-path-first { value 1; } } } typedef weight { reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.2"; type uint8; } grouping sid-label-index { reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.3.4"; choice sid-label-index { case local-label-case { leaf local-label { type netc:mpls-label; } } case ipv6-address-case { leaf ipv6-address { type inet:ipv6-address-no-zone; } } case sid-case { leaf sid { type uint32; } } } } grouping sr-capabilities-tlv { reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.1.1"; leaf mpls-ipv4 { type boolean; } leaf mpls-ipv6 { type boolean; } leaf sr-ipv6 { type boolean; } leaf range-size { type rt-types:uint24; } uses sid-label-index; } grouping sr-algorithms-tlv { leaf-list algorithms { type algorithm; } } grouping ospf-adj-flags { reference "https://tools.ietf.org/html/draft-ietf-ospf-segment-routing-extensions-08#section-7.1"; leaf backup { type boolean; } leaf set { type boolean; } } grouping adj-flags { choice flags { case ospf-adj-flags-case { container ospf-adj-flags { uses ospf-adj-flags; } } case isis-adj-flags-case { reference "https://tools.ietf.org/html/draft-ietf-isis-segment-routing-extensions-06#section-2.2.1"; container isis-adj-flags { uses ospf-adj-flags; leaf address-family { type boolean; } } } } } grouping adj-sid-tlv { reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.2.1"; uses adj-flags; uses epe-adj-sid-tlv; } grouping epe-adj-sid-tlv { leaf weight { type weight; } uses sid-label-index; } grouping lan-adj-sid-tlv { reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.2.2"; uses adj-flags; leaf weight { type weight; } leaf iso-system-id { type netc:iso-system-identifier; } leaf neighbor-id { type inet:ipv4-address-no-zone; } uses sid-label-index; } grouping prefix-flags { leaf no-php { type boolean; } leaf explicit-null { type boolean; } } grouping prefix-sid-tlv { reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.3.1"; choice flags { case isis-prefix-flags-case { container isis-prefix-flags { reference "https://tools.ietf.org/html/draft-ietf-ospf-segment-routing-extensions-08#section-5"; uses prefix-flags; leaf readvertisement { type boolean; } leaf node-sid { type boolean; } } } case ospf-prefix-flags-case { container ospf-prefix-flags { reference "https://tools.ietf.org/html/draft-ietf-ospf-segment-routing-extensions-05#section-5"; uses prefix-flags; leaf mapping-server { type boolean; } } } } leaf algorithm { type algorithm; } uses sid-label-index; } grouping ipv6-prefix-sid-tlv { reference "https://tools.ietf.org/html/draft-previdi-isis-ipv6-prefix-sid-02#page-2"; leaf algorithm { type algorithm; } } grouping ero-flags { leaf loose { type boolean; } } grouping ero-ipv4-address { uses ero-flags; leaf address { type inet:ipv4-address-no-zone; mandatory true; } } grouping ero-ipv6-address { uses ero-flags; leaf address { type inet:ipv6-address-no-zone; mandatory true; } } grouping ero-unnumbered { uses ero-flags; leaf router-id { type uint32; } leaf interface-id { type uint32; } } grouping binding-sub-tlvs { reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.3.4"; choice binding-sub-tlv { case prefix-sid-case { container prefix-sid { uses prefix-sid-tlv; } } case ipv6-prefix-sid-case { container ipv6-prefix-sid { uses ipv6-prefix-sid-tlv; } } case sid-label-case { uses sid-label-index; } case ero-metric-case { leaf ero-metric { type netc:te-metric; } } case ipv4-ero-case { container ipv4-ero { uses ero-ipv4-address; } } case ipv6-ero-case { container ipv6-ero { uses ero-ipv6-address; } } case unnumbered-interface-id-ero-case { container unnumbered-interface-id-ero { uses ero-unnumbered; } } case ipv4-ero-backup-case { container ipv4-ero-backup { uses ero-ipv4-address; } } case ipv6-ero-backup-case { container ipv6-ero-backup { uses ero-ipv6-address; } } case unnumbered-interface-id-backup-ero-case { container unnumbered-interface-id-backup-ero { uses ero-unnumbered; } } } } grouping isis-binding-flags { reference "https://tools.ietf.org/html/draft-ietf-isis-segment-routing-extensions-06#section-2.4"; leaf address-family { type boolean; } leaf mirror-context { type boolean; } leaf spread-tlv { type boolean; } leaf leaked-from-level-2 { type boolean; } leaf attached-flag { type boolean; } } grouping ospf-binding-flags { reference "https://tools.ietf.org/html/draft-ietf-ospf-segment-routing-extensions-08#section-6"; leaf mirroring { type boolean; } } grouping binding-sid-tlv { reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.3.3"; leaf weight { type weight; } choice flags { case isis-binding-flags-case { uses isis-binding-flags; } case ospf-binding-flags-case { uses ospf-binding-flags; } } list binding-sub-tlvs { uses binding-sub-tlvs; } } grouping range-sub-tlvs { choice range-sub-tlv { case binding-sid-tlv-case { uses binding-sid-tlv; } case prefix-sid-tlv-case { container prefix-sid-tlv { uses prefix-sid-tlv; } } case ipv6-prefix-sid-tlv-case { container ipv6-prefix-sid-tlv { uses ipv6-prefix-sid-tlv; } } case sid-label-tlv-case { uses sid-label-index; } } } grouping range-tlv { reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.3.2"; leaf inter-area { type boolean; } leaf range-size { type uint16; } list sub-tlvs { uses range-sub-tlvs; } } }