--- /dev/null
+module bgp-linkstate {
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:bgp-linkstate";
+ prefix "bgp-ls";
+
+ import ietf-inet-types {
+ prefix inet;
+ revision-date 2010-09-24;
+ }
+ import bgp-message { prefix bgp-msg;}
+ import bgp-multiprotocol { prefix bgp-mp;}
+
+ organization "Cisco Systems, Inc.";
+ contact "Dana Kutenicsova <dkutenic@cisco.com>";
+
+ description
+ "This module contains the base data model of a BGP message.
+ It rolls up the definitions contained in RFC4271
+ and draft-ietf-idr-ls-distribution-03.
+
+ Copyright (c)2013 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 "2013-09-18" {
+ description
+ "Initial revision.";
+ reference "draft-ietf-idr-ls-distribution-03";
+ }
+
+ typedef nlri-type {
+ reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2";
+ type enumeration {
+ enum node {
+ value 1;
+ }
+ enum link {
+ value 2;
+ }
+ enum ipv4-prefix {
+ value 3;
+ }
+ enum ipv6-prefix {
+ value 4;
+ }
+ }
+ }
+
+ typedef protocol-id {
+ reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2";
+ type enumeration {
+ enum unknown {
+ value 0;
+ }
+ enum isis-level1 {
+ value 1;
+ }
+ enum isis-level2 {
+ value 2;
+ }
+ enum ospf {
+ value 3;
+ }
+ enum direct {
+ value 4;
+ }
+ enum static {
+ value 5;
+ }
+ }
+ }
+
+ typedef ospf-route-type {
+ reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.3.1";
+ type enumeration {
+ enum intra-area {
+ value 1;
+ }
+ enum inter-area {
+ value 2;
+ }
+ enum external1 {
+ value 3;
+ }
+ enum external2 {
+ value 4;
+ }
+ enum nssa1 {
+ value 5;
+ }
+ enum nssa2 {
+ value 6;
+ }
+ }
+ }
+
+ typedef route-distinguisher {
+ type uint64;
+ }
+
+ typedef identifier {
+ type uint64;
+ }
+
+ typedef domain-identifier {
+ reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ type binary {
+ length "4";
+ }
+ }
+
+ typedef area-identifier {
+ reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ type binary {
+ length "4";
+ }
+ }
+
+ // concepts
+ typedef iso-system-identifier {
+ reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ type binary {
+ length "6";
+ }
+ }
+
+ typedef ipv4-interface-identifier {
+ reference "http://tools.ietf.org/html/rfc5305#section-3.2";
+ type inet:ipv4-address;
+ }
+
+ typedef ipv6-interface-identifier {
+ reference "http://tools.ietf.org/html/rfc6119#section-4.2";
+ type inet:ipv6-address;
+ }
+
+ typedef ospf-interface-identifier {
+ reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ type binary {
+ length "4";
+ }
+ }
+
+ typedef topology-identifier {
+ reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.5";
+ type uint16 {
+ range "0..4095";
+ }
+ }
+
+
+ grouping isis-router-identifier {
+ reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ leaf iso-system-id {
+ type iso-system-identifier;
+ mandatory true;
+ }
+ }
+
+ grouping isis-lan-identifier {
+ reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ container is-is-router-identifier {
+ uses isis-router-identifier;
+ }
+ leaf psn {
+ type uint8 {
+ range "1..255";
+ }
+ mandatory true;
+ }
+ }
+
+ grouping ospf-router-identifier {
+ reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ leaf ospf-router-id {
+ type binary {
+ length "4";
+ }
+ mandatory true;
+ }
+ }
+
+ grouping ospf-v2-lan-identifier {
+ reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ uses ospf-router-identifier;
+ leaf ipv4-address {
+ type ipv4-interface-identifier;
+ mandatory true;
+ }
+ }
+
+ grouping ospf-v3-lan-identifier {
+ reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ uses ospf-router-identifier;
+ leaf lan-interface {
+ type ospf-interface-identifier;
+ mandatory true;
+ }
+ }
+
+ grouping node-identifier {
+ leaf as-number {
+ type inet:as-number;
+ }
+ leaf area-id {
+ type area-identifier;
+ }
+ leaf domain-id {
+ type domain-identifier;
+ }
+ choice router-identifier {
+ case isis-node {
+ container isis-node {
+ uses isis-router-identifier;
+ }
+ }
+
+ case isis-pseudonode {
+ container isis-pseudonode {
+ uses isis-lan-identifier;
+ }
+ }
+
+ case ospf-node {
+ container ospf-node {
+ uses ospf-router-identifier;
+ }
+ }
+
+ case ospf-pseudonode {
+ container ospf-pseudonode {
+ uses ospf-v3-lan-identifier;
+ }
+ }
+ }
+ }
+
+ augment "/bgp-msg:update/bgp-msg:path-attributes/bgp-mp:mp-reach-nlri/bgp-mp:nlri/bgp-mp:nlri-type" {
+ case linkstate {
+ leaf nlri-type {
+ type nlri-type;
+ }
+ leaf distinguisher {
+ type route-distinguisher;
+ }
+ container ls-nlri {
+ leaf protocol-id {
+ type protocol-id;
+ }
+ leaf identifier {
+ type identifier;
+ }
+ container local-node-descriptors {
+ uses node-identifier;
+ }
+ container remote-node-descriptors {
+ when "../nlri-type = link";
+ uses node-identifier;
+ }
+ container Link-Descriptors {
+ when "../nlri-type = link";
+ leaf ipv4-interface-address {
+ type ipv4-interface-identifier;
+ }
+ leaf ipv6-interface-address {
+ type ipv6-interface-identifier;
+ }
+ leaf ipv4-neighbor-address {
+ type ipv4-interface-identifier;
+ }
+ leaf ipv6-neighbor-address {
+ type ipv6-interface-identifier;
+ }
+ leaf multi-topology-id {
+ type topology-identifier;
+ }
+ }
+ container prefix-descriptors {
+ when "../nlri-type = 'ipv4-prefix' or ../nlri-type = 'ipv6-prefix'";
+ leaf multi-topology-id {
+ type topology-identifier;
+ }
+ leaf ospf-route-type {
+ when "../rotocol-id = 'ospf'";
+ type ospf-route-type;
+ }
+ leaf ip-reachability-information {
+ type inet:ip-prefix;
+ }
+ }
+ }
+ }
+ }
+}
namespace "urn:opendaylight:params:xml:ns:yang:bgp-message";
prefix "bgp-msg";
- import ietf-inet-types {
+ import ietf-inet-types {
prefix inet;
revision-date 2010-09-24;
}
type bgp-subsequent-address-family;
}
}
-
+
augment "/bgp-msg:open/bgp-msg:optional-parameters/bgp-msg:parameters" {
case multiprotocol {
list capabilities {
namespace "urn:opendaylight:params:xml:ns:yang:bgpls";
prefix "nlri";
- import ietf-inet-types {
+ import ietf-inet-types {
prefix inet;
revision-date 2010-09-24;
}
+ import bgp-linkstate {
+ prefix bgp-ls;
+ }
+
organization "Cisco Systems, Inc.";
contact "Dana Kutenicsova <dkutenic@cisco.com>";
reference "RFC4271";
}
- typedef ospf-route-type {
- reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.3.1";
- type enumeration {
- enum intra-area {
- value 1;
- }
- enum inter-area {
- value 2;
- }
- enum external1 {
- value 3;
- }
- enum external2 {
- value 4;
- }
- enum nssa1 {
- value 5;
- }
- enum nssa2 {
- value 6;
- }
- }
- }
-
typedef link-protection-type {
reference "http://tools.ietf.org/html/rfc5307#section-1.2";
type enumeration {
}
}
- typedef protocol-id {
- reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2";
- type enumeration {
- enum unknown {
- value 0;
- }
- enum isis-level1 {
- value 1;
- }
- enum isis-level2 {
- value 2;
- }
- enum ospf {
- value 3;
- }
- enum direct {
- value 4;
- }
- enum static {
- value 5;
- }
- }
- }
-
- typedef area-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
- type binary {
- length "4";
- }
- }
-
typedef isis-area-identifier {
reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.3.1.2";
type binary {
}
}
- typedef domain-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
- type binary {
- length "4";
- }
- }
-
- // concepts
- typedef iso-system-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
- type binary {
- length "6";
- }
- }
-
- typedef ipv4-interface-identifier {
- reference "http://tools.ietf.org/html/rfc5305#section-3.2";
- type inet:ipv4-address;
- }
-
typedef ipv4-router-identifier {
reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.3.1.4";
type inet:ipv4-address;
}
- typedef ipv6-interface-identifier {
- reference "http://tools.ietf.org/html/rfc6119#section-4.2";
- type inet:ipv6-address;
- }
+
typedef ipv6-router-identifier {
reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.3.1.4";
type inet:ipv6-address;
}
- typedef ospf-interface-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
- type binary {
- length "4";
- }
- }
-
typedef unnumbered-link-identifier {
reference "http://tools.ietf.org/html/rfc4202#section-2.1";
type uint32;
}
}
- typedef topology-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.5";
- type uint16 {
- range "0..4095";
- }
- }
-
- grouping isis-router-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
- leaf iso-system-id {
- type iso-system-identifier;
- mandatory true;
- }
- }
-
- grouping isis-lan-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
- container is-is-router-identifier {
- uses isis-router-identifier;
- }
- leaf psn {
- type uint8 {
- range "1..255";
- }
- mandatory true;
- }
- }
-
- grouping ospf-router-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
- leaf ospf-router-id {
- type binary {
- length "4";
- }
- mandatory true;
- }
- }
-
- grouping ospf-v2-lan-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
- uses ospf-router-identifier;
- leaf ipv4-address {
- type ipv4-interface-identifier;
- mandatory true;
- }
- }
-
- grouping ospf-v3-lan-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
- uses ospf-router-identifier;
- leaf lan-interface {
- type ospf-interface-identifier;
- mandatory true;
- }
- }
-
- grouping node-identifier {
- leaf as-number {
- type inet:as-number;
- mandatory true;
- }
- leaf area-id {
- type area-identifier;
- }
- leaf domain-id {
- type domain-identifier;
- mandatory true;
- }
- choice router-identifier {
- case isis-node {
- container isis-node {
- uses isis-router-identifier;
- }
- }
-
- case isis-pseudonode {
- container isis-pseudonode {
- uses isis-lan-identifier;
- }
- }
-
- case ospf-node {
- container ospf-node {
- uses ospf-router-identifier;
- }
- }
-
- case ospf-pseudonode {
- container ospf-pseudonode {
- uses ospf-v3-lan-identifier;
- }
- }
- }
- }
grouping link-anchor {
container node-identifier {
- uses node-identifier;
+ uses bgp-ls:node-identifier;
}
choice interface-identifier {
case ipv4-iface-id {
leaf ipv4-iface-id {
- type ipv4-interface-identifier;
+ type bgp-ls:ipv4-interface-identifier;
}
}
case ipv6-iface-id {
leaf ipv6-iface-id {
- type ipv6-interface-identifier;
+ type bgp-ls:ipv6-interface-identifier;
}
}
case ospf-iface-id {
leaf ospf-iface-id {
- type ospf-interface-identifier;
+ type bgp-ls:ospf-interface-identifier;
}
}
grouping link-identifier {
leaf topology-identifier {
- type topology-identifier;
+ type bgp-ls:topology-identifier;
}
container link-anchor {
uses link-anchor;
grouping prefix-identifier {
container node-identifier {
- uses node-identifier;
+ uses bgp-ls:node-identifier;
}
leaf prefix {
type inet:ip-prefix;
grouping ospf-prefix-identifier {
uses prefix-identifier;
leaf ospf-route-t {
- type ospf-route-type;
+ type bgp-ls:ospf-route-type;
}
}
grouping network-node-state {
reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.3.1";
leaf topology-identifier {
- type topology-identifier;
+ type bgp-ls:topology-identifier;
}
leaf node-flags {
type node-flag-bits;
notification bgpls-pdu {
reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2";
- leaf route-distinguisher {
- type uint64;
+ leaf distinguisher {
+ type bgp-ls:route-distinguisher;
}
leaf protocol {
- type protocol-id;
+ type bgp-ls:protocol-id;
mandatory true;
}
leaf identifier {
- type uint64;
- mandatory true;
+ type bgp-ls:identifier;
}
choice objects {
case nodes {