BUG6257 Add BGP attribute PMSI tunnel to the EVPN Yang 82/46682/1
authorBruce Brandon <bb2697@att.com>
Mon, 15 Aug 2016 14:38:31 +0000 (14:38 +0000)
committerMilos Fabian <milfabia@cisco.com>
Fri, 7 Oct 2016 15:32:05 +0000 (15:32 +0000)
Add the BGP attribute "PMSI tunnel" to bgp-evpn.yang file and create
new pmsi-tunnel.yang file.

Change-Id: Ib4806a09a4e25721eb6a369f9617446f6645db54
Signed-off-by: Bruce Brandon <bb2697@att.com>
(cherry picked from commit 170546f6164b63bc773e7a3bad3c1dbbaeb50f89)

bgp/evpn/src/main/yang/bgp-evpn.yang
bgp/evpn/src/main/yang/pmsi-tunnel.yang [new file with mode: 0644]

index 30a676a15cd649e07da0801575c5b811b2639f32..4ea8927b2cdbf4417e7b3c10be3c4992c9fc255e 100644 (file)
@@ -12,6 +12,7 @@ module odl-bgp-evpn {
     import bmp-monitor { prefix bmp-mon; revision-date 2015-05-12; }
     import bgp-message { prefix bgp-msg; revision-date 2013-09-19; }
     import bgp-multiprotocol { prefix bgp-mp; revision-date 2013-09-19; }
+    import pmsi-tunnel { prefix pmsi; revision-date 2016-08-12; }
 
     organization "Cisco Systems, Inc.";
 
@@ -387,6 +388,9 @@ module odl-bgp-evpn {
                 key "route-key";
                 uses evpn;
                 uses bgp-rib:route {
+                    augment "attributes" {
+                        uses pmsi:pmsi-tunnel;
+                    }
                     augment "attributes/extended-communities/extended-community" {
                         case esi-label-extended-community-case {
                             uses esi-label-extended-community;
@@ -434,6 +438,10 @@ module odl-bgp-evpn {
         uses route-distinguisher;
     }
 
+    augment "/bgp-msg:update/bgp-msg:attributes" {
+        uses pmsi:pmsi-tunnel;
+    }
+
     augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-reach-nlri/bgp-mp:advertized-routes/bgp-mp:destination-type" {
         case destination-evpn-case {
             container destination-evpn {
diff --git a/bgp/evpn/src/main/yang/pmsi-tunnel.yang b/bgp/evpn/src/main/yang/pmsi-tunnel.yang
new file mode 100644 (file)
index 0000000..b6b3ed1
--- /dev/null
@@ -0,0 +1,141 @@
+// vi: set smarttab et sw=4 tabstop=4:
+module pmsi-tunnel {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:pmsi-tunnel";
+    prefix "pmsi-tunnel";
+
+    import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
+    import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
+    import network-concepts { prefix netc; revision-date 2013-11-25; }
+
+    organization "AT&T Services, Inc.";
+
+    contact "Bruce Brandon <bb2697@att.com>";
+
+    description
+        "This module contains the data model of a BGP attribute called the
+        P-Multicast Service Interface Tunnel (PMSI Tunnel), defined
+        in RFC6514, Section 5.
+
+        Copyright (c)2016 AT&T Services, 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 "2016-08-12" {
+        description "Initial revision";
+        reference "https://tools.ietf.org/html/rfc6514#section-5";
+    }
+
+    grouping opaque {
+        leaf opaque-type {
+            type uint8;
+        }
+        leaf opaque-extended-type {
+            type uint16;
+        }
+        leaf opaque {
+            // Base-64 encoded
+            type string;
+        }
+    }
+
+    grouping pmsi-tunnel {
+        container pmsi-tunnel {
+            description "P-Multicast Service Interface Tunnel (PMSI Tunnel) attribute";
+            reference "https://tools.ietf.org/html/rfc6514#section-5";
+
+            leaf leaf-information-required {
+                type boolean;
+                mandatory true;
+            }
+            leaf mpls-label {
+                type netc:mpls-label;
+                mandatory true;
+            }
+            choice tunnel-identifier {
+                case rsvp-te-p2mp-lsp {
+                    container rsvp-te-p2mp-lps {
+                        reference "https://tools.ietf.org/html/rfc4875#section-19.1.1";
+                        leaf p2mp-id {
+                            type uint32;
+                        }
+                        leaf tunnel-id {
+                            type uint16;
+                        }
+                        leaf address-family {
+                            type identityref {
+                                base bgp-t:address-family;
+                            }
+                        }
+                        leaf extended-tunnel-id {
+                            type inet:ip-address;
+                        }
+                    }
+                }
+                case mldp-p2mp-lsp {
+                    container mldp-p2mp-lsp {
+                        reference "https://tools.ietf.org/html/rfc6388#section-2.2";
+                        leaf address-family {
+                            type identityref {
+                                base bgp-t:address-family;
+                            }
+                        }
+                        leaf root-node-address {
+                            type inet:ip-address;
+                        }
+                        uses opaque;
+                    }
+                }
+                case pim-ssm-tree {
+                    container pim-ssm-tree {
+                        reference "https://tools.ietf.org/html/rfc6514#section-5";
+                        leaf p-root-node-address {
+                            type inet:ip-address;
+                        }
+                        leaf p-multicast-group {
+                            type inet:ip-address;
+                        }
+                    }
+                }
+                case pim-sm-tree {
+                    container pim-sm-tree {
+                        reference "https://tools.ietf.org/html/rfc6514#section-5";
+                        leaf p-sender-address {
+                            type inet:ip-address;
+                        }
+                        leaf p-multicast-group {
+                            type inet:ip-address;
+                        }
+                    }
+                }
+                case bidir-pim-tree {
+                    container bidir-pim-tree {
+                        reference "https://tools.ietf.org/html/rfc6514#section-5";
+                        leaf p-sender-address {
+                            type inet:ip-address;
+                        }
+                        leaf p-multicast-group {
+                            type inet:ip-address;
+                        }
+                    }
+                }
+                case ingress-replication {
+                    container ingress-replication {
+                        leaf receiving-endpoint-address {
+                            type inet:ip-address;
+                        }
+                    }
+                }
+                case mldp-mp2mp-lsp {
+                    container mldp-mp2mp-lsp {
+                        uses opaque;
+                    }
+                }
+            }
+        }
+    }
+}
+