BUG-4447: BGP-LS SR extention: new YANG module 26/28426/18
authorIveta Halanova <ihalanov@cisco.com>
Wed, 28 Oct 2015 10:10:29 +0000 (11:10 +0100)
committerMilos Fabian <milfabia@cisco.com>
Wed, 28 Oct 2015 11:01:14 +0000 (11:01 +0000)
Change-Id: Icdf09f2303fc93b48c558efb9359698bec3f0d00
Signed-off-by: Iveta Halanova <ihalanov@cisco.com>
bgp/linkstate/src/main/yang/bgp-segment-routing-ext.yang [new file with mode: 0644]
concepts/src/main/yang/network-concepts.yang

diff --git a/bgp/linkstate/src/main/yang/bgp-segment-routing-ext.yang b/bgp/linkstate/src/main/yang/bgp-segment-routing-ext.yang
new file mode 100644 (file)
index 0000000..6e0e604
--- /dev/null
@@ -0,0 +1,233 @@
+module bgp-segment-routing-ext {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:bgp-segment-routing-ext";
+    prefix "bgp-sr-ext";
+
+    import network-concepts { prefix netc; revision-date 2013-11-25; }
+    import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
+
+    organization "Cisco Systems, Inc.";
+    contact "Iveta Halanova <ihalanov@cisco.com>";
+
+    description
+        "This module contains the base data concepts contained
+        in draft-gredler-idr-bgp-ls-segment-routing-ext-00.
+
+        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 "2015-10-14" {
+        description
+            "Initial revision.";
+    }
+
+    typedef algorithm {
+        reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-00#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-00#section-2.2";
+        type uint8;
+    }
+
+    grouping general-flags {
+        leaf flags {
+            type binary {
+                length "1";
+            }
+        }
+    }
+
+    grouping sid-label-index {
+        reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-00#section-2.3.4.2";
+        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;
+                }
+            }
+            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-00#section-2.1.1";
+        leaf mpls-ipv4 {
+            type boolean;
+        }
+        leaf mpls-ipv6 {
+            type boolean;
+        }
+        leaf sr-ipv6 {
+            type boolean;
+        }
+        leaf range-size {
+            type uint32 {
+                range "0..16777215";
+            }
+        }
+        uses sid-label-index;
+    }
+
+    grouping sr-algorithms-tlv {
+        leaf-list algorithms {
+            type algorithm;
+        }
+    }
+
+    grouping adj-sid-tlv {
+        reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-00#section-2.2.1";
+        uses general-flags;
+        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-00#section-2.2.2";
+        uses general-flags;
+        leaf weight {
+            type weight;
+        }
+        leaf iso-system-id {
+            type netc:iso-system-identifier;
+        }
+        uses sid-label-index;
+    }
+
+    grouping prefix-sid-tlv {
+        reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-00#section-2.3.1";
+        uses general-flags;
+        leaf algorithm {
+            type algorithm;
+        }
+        uses sid-label-index;
+    }
+
+    grouping ero-flags {
+        leaf loose {
+            type boolean;
+        }
+    }
+
+    grouping ero-ipv4-address {
+        uses ero-flags;
+        leaf address {
+            type inet:ipv4-address;
+            mandatory true;
+        }
+    }
+
+    grouping ero-ipv6-address {
+        uses ero-flags;
+        leaf address {
+            type inet:ipv6-address;
+            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-00#section-2.3.4";
+        choice binding-sub-tlv {
+            case prefix-sid-case {
+                uses 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 {
+                uses ero-ipv4-address;
+            }
+            case ipv6-ero-case {
+                uses ero-ipv6-address;
+            }
+            case unnumbered-interface-id-ero-case {
+                uses ero-unnumbered;
+            }
+            case ipv4-ero-backup-case {
+                uses ero-ipv4-address;
+            }
+            case ipv6-ero-backup-case {
+                uses ero-ipv6-address;
+            }
+            case unnumbered-interface-id-backup-ero-case {
+                uses ero-unnumbered;
+            }
+        }
+    }
+
+    grouping binding-sid-tlv {
+        reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-00#section-2.3.3";
+        leaf weight {
+            type weight;
+        }
+        uses general-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 {
+                uses 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-00#section-2.3.2";
+        leaf inter-area {
+            type boolean;
+        }
+        leaf range-size {
+            type uint16;
+        }
+        list sub-tlvs {
+            uses range-sub-tlvs;
+        }
+    }
+}
index 3a2114e2f3165ef5e46005a9d998b9fd359078fe..a4e6f28c586d4d1d710288f15011e13fe0d20554 100644 (file)
@@ -61,5 +61,12 @@ module network-concepts {
         reference "https://tools.ietf.org/html/rfc7311#section-3";
         type uint64;
     }
+
+    typedef mpls-label {
+        reference "https://tools.ietf.org/html/rfc3032#section-2.1";
+        type uint32 {
+            range "0..1048575";
+        }
+    }
 }