All Downloads are FREE. Search and download functionalities are using the official Maven repository.

[email protected] Maven / Gradle / Ivy

module bgp-labeled-unicast {
    yang-version 1;
    namespace "urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast";
    prefix "bgp-lu";

    import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
    import ietf-routing-types { prefix rt-types; }
    import bgp-message { prefix bgp-msg; revision-date 2020-01-20; }
    import bgp-multiprotocol { prefix bgp-mp; revision-date 2018-03-29; }
    import bgp-rib { prefix bgp-rib; revision-date 2018-03-29; }
    import bgp-types { prefix bgp-t; revision-date 2020-01-20; }
    import bmp-monitor { prefix bmp-mon; revision-date 2020-01-20; }
    import network-concepts { prefix netc; revision-date 2013-11-25; }

    organization "Cisco Systems, Inc.";
    contact "GE QU "
    + " Mingming Chen ";

    description
        "This module contains the base data model of a BGP message.
        It rolls up the definitions contained in RFC3107.

        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 "2018-03-29" {
        description "Add support for add-path for all afi/safi.";
    }

    revision "2017-12-07" {
        description "Add support for add-path in base BGP NLRI.";
    }

    revision "2015-05-25" {
        description
            "Initial Version.";
    }

    identity labeled-unicast-subsequent-address-family {
        reference "https://tools.ietf.org/html/rfc3107#section-3";
        base bgp-t:subsequent-address-family;
    }

    typedef srgb {
        type rt-types:uint24;
    }

    grouping label {
        reference "https://tools.ietf.org/html/rfc3032#section-2.1";
        description
            "The lable stack entry.";
        leaf label-value {
            type netc:mpls-label;
        }
    }

    grouping labeled-unicast {
        reference "https://tools.ietf.org/html/rfc3107#section-3";
        list label-stack {
            description
                "The Label field carries one or more labels (that corresponds to
                 the stack of labels). Each label is encoded as 3
                 octets, where the high-order 20 bits contain the label value,
                 and the low order bit contains 'Bottom of Stack'.";
            uses label;
            ordered-by user;
        }
        leaf prefix {
            type inet:ip-prefix;
        }
    }

    grouping labeled-unicast-destination {
        list c-labeled-unicast-destination {
            uses labeled-unicast;
            uses bgp-msg:path-id-grouping;
        }
    }

    grouping labeled-unicast-routes-list {
        list labeled-unicast-route {
            key "route-key path-id";
            uses labeled-unicast;
            uses bgp-rib:route {
                augment "attributes/bgp-prefix-sid/bgp-prefix-sid-tlvs/bgp-prefix-sid-tlv" {
                    case lu-label-index-tlv {
                        uses label-index-tlv;
                    }
                    case lu-originator-srgb-tlv {
                        uses originator-srgb-tlv;
                    }
                }
            }
        }
    }

    grouping labeled-unicast-routes {
        container labeled-unicast-routes {
            uses labeled-unicast-routes-list;
        }
    }

    grouping labeled-unicast-ipv6-routes {
        container labeled-unicast-ipv6-routes {
            uses labeled-unicast-routes-list;
        }
    }

    augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-reach-nlri/bgp-mp:advertized-routes/bgp-mp:destination-type" {
        case destination-labeled-unicast-case {
            container destination-labeled-unicast {
                uses labeled-unicast-destination;
            }
        }
        case destination-ipv6-labeled-unicast-case {
            container destination-ipv6-labeled-unicast {
                uses labeled-unicast-destination;
            }
        }
    }

    augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-unreach-nlri/bgp-mp:withdrawn-routes/bgp-mp:destination-type" {
        case destination-labeled-unicast-case {
            container destination-labeled-unicast {
                uses labeled-unicast-destination;
            }
        }
        case destination-ipv6-labeled-unicast-case {
            container destination-ipv6-labeled-unicast {
                uses labeled-unicast-destination;
            }
        }
    }

    augment "/bgp-rib:application-rib/bgp-rib:tables/bgp-rib:routes" {
        case labeled-unicast-routes-case {
            uses labeled-unicast-routes;
        }
        case labeled-unicast-ipv6-routes-case {
            uses labeled-unicast-ipv6-routes;
        }
    }

    augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:loc-rib/bgp-rib:tables/bgp-rib:routes" {
        case labeled-unicast-routes-case {
            uses labeled-unicast-routes;
        }
        case labeled-unicast-ipv6-routes-case {
            uses labeled-unicast-ipv6-routes;
        }
    }

    augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-in/bgp-rib:tables/bgp-rib:routes" {
        case labeled-unicast-routes-case {
            uses labeled-unicast-routes;
        }
        case labeled-unicast-ipv6-routes-case {
            uses labeled-unicast-ipv6-routes;
        }
    }

    augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:effective-rib-in/bgp-rib:tables/bgp-rib:routes" {
        case labeled-unicast-routes-case {
            uses labeled-unicast-routes;
        }
        case labeled-unicast-ipv6-routes-case {
            uses labeled-unicast-ipv6-routes;
        }
    }

    augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-out/bgp-rib:tables/bgp-rib:routes" {
        case labeled-unicast-routes-case {
            uses labeled-unicast-routes;
        }
        case labeled-unicast-ipv6-routes-case {
            uses labeled-unicast-ipv6-routes;
        }
    }

    augment "/bmp-mon:bmp-monitor/bmp-mon:monitor/bmp-mon:router/bmp-mon:peer/bmp-mon:pre-policy-rib/bmp-mon:tables/bmp-mon:routes" {
        case labeled-unicast-routes-case {
            uses labeled-unicast-routes;
        }
        case labeled-unicast-ipv6-routes-case {
            uses labeled-unicast-ipv6-routes;
        }
    }

    augment "/bmp-mon:bmp-monitor/bmp-mon:monitor/bmp-mon:router/bmp-mon:peer/bmp-mon:post-policy-rib/bmp-mon:tables/bmp-mon:routes" {
        case labeled-unicast-routes-case {
            uses labeled-unicast-routes;
        }
        case labeled-unicast-ipv6-routes-case {
            uses labeled-unicast-ipv6-routes;
        }
    }

    grouping label-index-tlv {
        reference "https://tools.ietf.org/html/draft-ietf-idr-bgp-prefix-sid-02#section-4.1";
        leaf label-index-tlv {
            description "Value representing the index value in the SRGB space.";
            type uint32;
            mandatory true;
        }
    }

    grouping originator-srgb-tlv {
        reference "https://tools.ietf.org/html/draft-ietf-idr-bgp-prefix-sid-02#section-4.3";
        list srgb-value {
            description "Originator SRGB: 3 octets of base followed by 3 octets of range.";
            leaf base {
                type srgb;
                mandatory true;
            }
            leaf range {
                type srgb;
                mandatory true;
            }
        }
    }

    augment "/bgp-msg:update/bgp-msg:attributes/bgp-msg:bgp-prefix-sid/bgp-msg:bgp-prefix-sid-tlvs/bgp-msg:bgp-prefix-sid-tlv" {
        reference "https://tools.ietf.org/html/draft-ietf-idr-bgp-prefix-sid-02";
        case lu-label-index-tlv {
            uses label-index-tlv;
        }
        case lu-originator-srgb-tlv {
            uses originator-srgb-tlv;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy