Remove unused BGP OpenConfig provider implementation
[bgpcep.git] / bgp / rib-impl / src / main / yang / odl-bgp-rib-impl-cfg.yang
index c40fca060b193099bf17b1a6b61e1beb8aea4c7e..b5f20f0ba6052dab7cb6c14a72e548d8127b4acb 100644 (file)
@@ -6,17 +6,22 @@ module odl-bgp-rib-impl-cfg {
 
     import bgp-multiprotocol { prefix bgp-mp; revision-date 2013-09-19; }
     import bgp-rib { prefix rib; revision-date 2013-09-25; }
+    import bgp-rib-impl { prefix bgp-rib-impl; revision-date 2016-06-06; }
     import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
     import odl-bgp-rib-cfg { prefix bgprib; revision-date 2013-07-01; }
-    import odl-bgp-parser-spi-cfg { prefix bgpspi; revision-date 2013-11-15; }
     import odl-bgp-rib-spi-cfg { prefix ribspi; revision-date 2013-11-15; }
-    import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
+    import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
+    import ietf-yang-types { prefix yang; revision-date 2013-07-15; }
     import opendaylight-md-sal-binding {prefix mdsb; revision-date 2013-10-28; }
+    import opendaylight-md-sal-dom {prefix sal; revision-date 2013-10-28; }
+    import opendaylight-md-sal-binding-v1-codec { prefix mdsb1; revision-date 2016-07-14; }
     import netty { prefix netty; revision-date 2013-11-19; }
     import config { prefix config; revision-date 2013-04-05; }
-    import protocol-framework { prefix pf; revision-date 2014-03-13; }
-    import odl-tcpmd5-cfg { prefix tcpmd5; revision-date 2014-04-27; }
-    import odl-tcpmd5-netty-cfg { prefix tcpmd5n; revision-date 2014-04-27; }
+    import rpc-context { prefix rpcx; revision-date 2013-06-17; }
+    import odl-bgp-path-selection-mode { prefix bps; revision-date 2016-03-01;}
+    import bgp-peer { prefix peer; revision-date 2016-06-06; }
+    import bgp-stats-peer { prefix peer-stats; revision-date 2016-06-06; }
+    import bgp-stats-rib-impl { prefix rib-impl-stats; revision-date 2016-06-06; }
 
     organization "Cisco Systems, Inc.";
 
@@ -33,29 +38,22 @@ module odl-bgp-rib-impl-cfg {
         accompanies this distribution, and is available at
         http://www.eclipse.org/legal/epl-v10.html";
 
+    revision "2016-03-30" {
+        description
+            "Updated to simplify reconnection strategy.";
+    }
     revision "2013-04-09" {
         description
             "Initial revision";
     }
 
-    identity base-bgp-parser {
-        base config:module-type;
-        config:java-name-prefix BaseBGPParser;
-        config:provided-service bgpspi:extension;
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case base-bgp-parser {
-            when "/config:modules/config:module/config:type = 'base-bgp-parser'";
-        }
-    }
-
     identity bgp-dispatcher {
         description
             "Service representing a BGP Dispatcher.";
 
         base "config:service-type";
         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher";
+        config:disable-osgi-service-registration;
     }
 
     identity bgp-dispatcher-impl {
@@ -67,63 +65,6 @@ module odl-bgp-rib-impl-cfg {
     augment "/config:modules/config:module/config:configuration" {
         case bgp-dispatcher-impl {
             when "/config:modules/config:module/config:type = 'bgp-dispatcher-impl'";
-
-            container bgp-extensions {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity bgpspi:consumer-extensions;
-                    }
-                }
-            }
-
-            container boss-group {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity netty:netty-threadgroup;
-                    }
-                }
-            }
-
-            container worker-group {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity netty:netty-threadgroup;
-                    }
-                }
-            }
-
-            container md5-channel-factory {
-                uses config:service-ref {
-                    refine type {
-                        mandatory false;
-                        config:required-identity tcpmd5n:md5-channel-factory;
-                    }
-                }
-            }
-
-            container md5-server-channel-factory {
-                uses config:service-ref {
-                    refine type {
-                        mandatory false;
-                        config:required-identity tcpmd5n:md5-server-channel-factory;
-                    }
-                }
-            }
-        }
-    }
-
-    identity base-bgp-rib {
-        base config:module-type;
-        config:provided-service ribspi:extension;
-        config:java-name-prefix BaseBGPRIB;
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case base-bgp-rib {
-            when "/config:modules/config:module/config:type = 'base-bgp-rib'";
         }
     }
 
@@ -133,6 +74,7 @@ module odl-bgp-rib-impl-cfg {
 
         base "config:service-type";
         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.RIB";
+        config:disable-osgi-service-registration;
     }
 
     identity bgp-peer-registry {
@@ -141,6 +83,7 @@ module odl-bgp-rib-impl-cfg {
 
         base "config:service-type";
         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry";
+        config:disable-osgi-service-registration;
     }
 
     identity strict-bgp-peer-registry {
@@ -152,8 +95,7 @@ module odl-bgp-rib-impl-cfg {
         config:java-name-prefix StrictBgpPeerRegistry;
     }
 
-
-     augment "/config:modules/config:module/config:configuration" {
+    augment "/config:modules/config:module/config:configuration" {
         case strict-bgp-peer-registry {
             when "/config:modules/config:module/config:type = 'strict-bgp-peer-registry'";
         }
@@ -169,13 +111,13 @@ module odl-bgp-rib-impl-cfg {
 
     identity bgp-peer-acceptor {
         description
-            "BGP peer acceptor that handles incomming bgp connections. Uses BGP peer registry to accept or decline incomming connections";
+            "BGP peer acceptor that handles incoming bgp connections. Uses BGP peer registry to accept or decline incoming connections";
 
         base config:module-type;
         config:java-name-prefix BGPPeerAcceptor;
     }
 
-     augment "/config:modules/config:module/config:configuration" {
+    augment "/config:modules/config:module/config:configuration" {
         case bgp-peer-acceptor {
             when "/config:modules/config:module/config:type = 'bgp-peer-acceptor'";
 
@@ -191,7 +133,7 @@ module odl-bgp-rib-impl-cfg {
                 default "179";
             }
 
-            container bgp-dispatcher {
+            container accepting-bgp-dispatcher {
                 uses config:service-ref {
                     refine type {
                         mandatory true;
@@ -200,14 +142,67 @@ module odl-bgp-rib-impl-cfg {
                 }
             }
 
-            container peer-registry {
+            container accepting-peer-registry {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity bgp-peer-registry;
+                    }
+                }
+            }
+        }
+    }
+
+    identity bgp-application-peer {
+        description
+            "Application peer handler which handles translation from custom RIB into local RIB";
+
+        base config:module-type;
+        config:java-name-prefix BGPApplicationPeer;
+    }
+
+    augment "/config:modules/config:module/config:configuration" {
+        case bgp-application-peer {
+            when "/config:modules/config:module/config:type = 'bgp-application-peer'";
+
+            container data-broker {
                 uses config:service-ref {
                     refine type {
                         mandatory true;
+                        config:required-identity sal:dom-async-data-broker;
+                    }
+                }
+            }
+
+            container target-rib {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity rib-instance;
+                    }
+                }
+            }
+
+            container bgp-peer-registry {
+                description "BGP peer registry where current instance of BGP peer will be registered.";
+                uses config:service-ref {
+                    refine type {
+                        // FIXME backwards compatibility. If not configured, GLOBAL instance is used
+                        mandatory false;
                         config:required-identity bgp-peer-registry;
                     }
                 }
             }
+
+            leaf application-rib-id {
+                type rib:application-rib-id;
+                mandatory true;
+            }
+
+            leaf bgp-peer-id {
+                type bgp-t:bgp-id;
+                mandatory true;
+            }
         }
     }
 
@@ -219,6 +214,17 @@ module odl-bgp-rib-impl-cfg {
         config:java-class "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType";
     }
 
+    identity add-path {
+        base "config:service-type";
+        config:java-class "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.mp.capabilities.add.path.capability.AddressFamilies";
+    }
+
+    identity add-path-impl {
+        config:provided-service add-path;
+        base config:module-type;
+        config:java-name-prefix AddPathImpl;
+    }
+
     identity bgp-table-type-impl {
         description
             "Simple provider for bgp-table-type.";
@@ -232,16 +238,23 @@ module odl-bgp-rib-impl-cfg {
         case bgp-table-type-impl {
             when "/config:modules/config:module/config:type = 'bgp-table-type-impl'";
 
-            leaf afi {
-                type identityref {
-                    base bgp-t:address-family;
+            uses bgp-mp:bgp-table-type;
+        }
+    }
+
+    augment "/config:modules/config:module/config:configuration" {
+        case add-path-impl {
+            when "/config:modules/config:module/config:type = 'add-path-impl'";
+            container address-family {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity bgp-table-type;
+                    }
                 }
-                mandatory true;
             }
-            leaf safi {
-                type identityref {
-                    base bgp-t:subsequent-address-family;
-                }
+            leaf send-receive {
+                type bgp-mp:send-receive;
                 mandatory true;
             }
         }
@@ -251,31 +264,10 @@ module odl-bgp-rib-impl-cfg {
         case bgp-peer {
             when "/config:modules/config:module/config:type = 'bgp-peer'";
 
-            leaf host {
-                description "Remote host IP address";
-                type inet:ip-address;
-                mandatory true;
-            }
-
-            leaf port {
-                description "Remote host port";
-                type inet:port-number;
-                default 179;
-            }
-
-            leaf holdtimer {
-                type int16;
-                default 180;
-            }
-
-            leaf initiate-connection {
-                description "If true, connection will be initiated right away from current device.
-                    If not, the peer will only be registered to peer registry and available for incomming bgp connections.";
-                type boolean;
-                default true;
-            }
+            uses peer:bgp-peer-config;
 
             list advertized-table {
+                key "type name";
                 uses config:service-ref {
                     refine type {
                         mandatory true;
@@ -284,16 +276,22 @@ module odl-bgp-rib-impl-cfg {
                 }
             }
 
-            leaf remote-as {
-                description
-                    "Expected remote AS number. If not present, it is assumed
-                    to be the same as our local AS number.";
-                type uint32;
+            list add-path {
+                key "type name";
+                uses config:service-ref {
+                    refine type {
+                        config:required-identity add-path;
+                    }
+                }
             }
 
-            leaf password {
-                type tcpmd5:rfc2385-key;
-                description "RFC2385 shared secret";
+            container rpc-registry {
+                uses config:service-ref {
+                    refine type {
+                        mandatory false;
+                        config:required-identity mdsb:binding-rpc-registry;
+                    }
+                }
             }
 
             container rib {
@@ -318,6 +316,81 @@ module odl-bgp-rib-impl-cfg {
         }
     }
 
+    identity peer-rpc;
+
+    augment "/config:modules/config:module/config:state" {
+        case bgp-peer {
+            when "/config:modules/config:module/config:type = 'bgp-peer'";
+
+            rpcx:rpc-context-instance "peer-rpc";
+            uses peer-stats:bgp-peer-stats;
+        }
+
+        case rib-impl {
+            when "/config:modules/config:module/config:type = 'rib-impl'";
+
+            uses rib-impl-stats:bgp-render-stats;
+        }
+    }
+
+    rpc reset-session {
+        description "Restart the session between BGP peers";
+        input {
+            uses rpcx:rpc-context-ref {
+                refine context-instance {
+                    rpcx:rpc-context-instance peer-rpc;
+                }
+            }
+        }
+    }
+
+    rpc reset-stats {
+        description "Reset the BGP peer statistics.";
+        input {
+            uses rpcx:rpc-context-ref {
+                refine context-instance {
+                    rpcx:rpc-context-instance peer-rpc;
+                }
+            }
+        }
+    }
+
+    identity bgp-path-selection-mode {
+        description
+            "Service representing an address family + path selection mode.";
+
+        base "config:service-type";
+        config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPBestPathSelection";
+    }
+
+    identity bgp-psm-impl {
+        base config:module-type;
+        config:provided-service bgp-path-selection-mode;
+        config:java-name-prefix BGPPSMImpl;
+    }
+
+    augment "/config:modules/config:module/config:configuration" {
+        case bgp-psm-impl {
+            when "/config:modules/config:module/config:type = 'bgp-psm-impl'";
+            container path-address-family {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity bgp-table-type;
+                    }
+                }
+            }
+            container path-selection-mode {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity bps:path-selection-mode-factory;
+                    }
+                }
+            }
+        }
+    }
+
     identity rib-impl {
         base config:module-type;
         config:provided-service bgprib:rib;
@@ -329,6 +402,8 @@ module odl-bgp-rib-impl-cfg {
         case rib-impl {
             when "/config:modules/config:module/config:type = 'rib-impl'";
 
+            uses bgp-rib-impl:bgp-rib-impl-identifiers;
+
             container extensions {
                 uses config:service-ref {
                     refine type {
@@ -347,45 +422,33 @@ module odl-bgp-rib-impl-cfg {
                 }
             }
 
-            container session-reconnect-strategy {
+            container data-provider {
                 uses config:service-ref {
                     refine type {
                         mandatory true;
-                        config:required-identity pf:reconnect-strategy-factory;
+                        config:required-identity mdsb:binding-async-data-broker;
                     }
                 }
             }
 
-            container tcp-reconnect-strategy {
+            container codec-tree-factory {
                 uses config:service-ref {
                     refine type {
                         mandatory true;
-                        config:required-identity pf:reconnect-strategy-factory;
+                        config:required-identity mdsb1:binding-v1-codec-tree-factory;
                     }
                 }
             }
 
-            container data-provider {
+            container dom-data-provider {
                 uses config:service-ref {
                     refine type {
                         mandatory true;
-                        config:required-identity mdsb:binding-data-broker;
+                        config:required-identity sal:dom-async-data-broker;
                     }
                 }
             }
 
-            leaf local-as {
-                description "Our local AS number. Needed by best selection path attribute.";
-                type uint32;
-                mandatory true;
-            }
-
-            leaf bgp-id {
-                description "Our local BGP identifier. Needed by best selection path attribute.";
-                mandatory true;
-                type inet:ipv4-address;
-            }
-
             list local-table {
                 uses config:service-ref {
                     refine type {
@@ -395,10 +458,12 @@ module odl-bgp-rib-impl-cfg {
                 }
             }
 
-            leaf rib-id {
-                description "Identifier of this RIB in local data store.";
-                type rib:rib-id;
-                mandatory true;
+            list rib-path-selection-mode {
+                uses config:service-ref {
+                    refine type {
+                        config:required-identity bgp-path-selection-mode;
+                    }
+                }
             }
         }
     }