Add LLGR openconfig extension 61/78761/3
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 13 Dec 2018 15:55:53 +0000 (16:55 +0100)
committerRobert Varga <nite@hq.sk>
Thu, 13 Dec 2018 17:53:57 +0000 (17:53 +0000)
This adds the configuration extension, so that LLGR can be
configured through OpenConfig.

JIRA: BGPCEP-495
Change-Id: Iadcd3915e094a750418480df7b237da88fca00cd
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/openconfig-api/src/main/yang/bgp-ll-graceful-restart.yang [new file with mode: 0644]

diff --git a/bgp/openconfig-api/src/main/yang/bgp-ll-graceful-restart.yang b/bgp/openconfig-api/src/main/yang/bgp-ll-graceful-restart.yang
new file mode 100644 (file)
index 0000000..4de99a3
--- /dev/null
@@ -0,0 +1,71 @@
+module bgp-ll-graceful-restart {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:bgp:ll-graceful-restart";
+    prefix "odl-bgp-ll-graceful-restart";
+
+    import openconfig-network-instance { prefix netinst; }
+    import bgp-openconfig-extensions { prefix bgp-op-ext; }
+    import openconfig-bgp-types { prefix bgp-types; }
+
+    description
+            "This module contains the extensions from
+            draft-uttaro-idr-bgp-persistence-04.
+
+            Copyright (c) 2018 AT&T Intellectual Property. 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-11-12" {
+        description "Initial revision";
+    }
+
+    identity LLGR_STALE {
+        base bgp-types:bgp-well-known-std-community;
+        description
+            "LLGR_STALE community can be used to mark stale routes retained for a longer period of time.
+             Such long-lived stale routes are to be handled according to the procedures specified in RFC";
+        reference "https://tools.ietf.org/html/draft-uttaro-idr-bgp-persistence-04";
+    }
+
+    identity NO_LLGR {
+            base bgp-types:bgp-well-known-std-community;
+            description
+                "NO_LLGR community can be used to mark routes which a BGP speaker does not want treated according
+                 to long-lived graceful restart procedures, as detailed in RFC";
+            reference "https://tools.ietf.org/html/draft-uttaro-idr-bgp-persistence-04";
+    }
+
+    grouping afi-safi-ll-graceful-restart {
+        container ll-graceful-restart {
+            container config {
+                leaf long-lived-stale-time {
+                    description
+                        "Value of time in second which we keep routes of given af-safi after
+                        graceful restart timer expired. If zero value afi-safi wil not be advertised
+                        in long-lived graceful restart capability";
+                    type uint32 {
+                        range 0..16777215;
+                    }
+                    units seconds;
+                    default 0;
+                }
+            }
+        }
+    }
+
+    augment "/netinst:network-instances/netinst:network-instance/netinst:protocols/netinst:protocol/" +
+        "bgp-op-ext:bgp/bgp-op-ext:peer-groups/bgp-op-ext:peer-group/bgp-op-ext:afi-safis/" +
+        "bgp-op-ext:afi-safi/bgp-op-ext:graceful-restart/bgp-op-ext:config" {
+            description "Add per peer-group afi-safi long-lived graceful restart config";
+            uses afi-safi-ll-graceful-restart;
+        }
+
+    augment "/netinst:network-instances/netinst:network-instance/netinst:protocols/netinst:protocol/" +
+            "bgp-op-ext:bgp/bgp-op-ext:neighbors/bgp-op-ext:neighbor/bgp-op-ext:afi-safis/" +
+            "bgp-op-ext:afi-safi/bgp-op-ext:graceful-restart/bgp-op-ext:config" {
+                description "Add per peer-group afi-safi long-lived graceful restart config";
+                uses afi-safi-ll-graceful-restart;
+            }
+}