Remove unused BGP OpenConfig provider implementation
[bgpcep.git] / bgp / rib-impl / src / main / yang / odl-bgp-rib-impl-cfg.yang
index 1d5ac44b44ed23e8a110aefd558584d2c6741a71..b5f20f0ba6052dab7cb6c14a72e548d8127b4acb 100644 (file)
@@ -6,20 +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 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-openconfig-spi-cfg { prefix bgp-oc-spi; revision-date 2015-09-25; }
     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.";
 
@@ -45,24 +47,13 @@ module odl-bgp-rib-impl-cfg {
             "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 {
@@ -74,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'";
         }
     }
 
@@ -140,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 {
@@ -148,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 {
@@ -159,7 +95,6 @@ module odl-bgp-rib-impl-cfg {
         config:java-name-prefix StrictBgpPeerRegistry;
     }
 
-
     augment "/config:modules/config:module/config:configuration" {
         case strict-bgp-peer-registry {
             when "/config:modules/config:module/config:type = 'strict-bgp-peer-registry'";
@@ -265,7 +200,7 @@ module odl-bgp-rib-impl-cfg {
             }
 
             leaf bgp-peer-id {
-                type inet:ipv4-address;
+                type bgp-t:bgp-id;
                 mandatory true;
             }
         }
@@ -303,18 +238,7 @@ 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;
-                }
-                mandatory true;
-            }
-            leaf safi {
-                type identityref {
-                    base bgp-t:subsequent-address-family;
-                }
-                mandatory true;
-            }
+            uses bgp-mp:bgp-table-type;
         }
     }
 
@@ -340,43 +264,7 @@ 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 retrytimer {
-                type int16;
-                default 10;
-            }
-
-            leaf peer-role {
-                type rib:peer-role;
-                default ibgp;
-            }
-
-            leaf simple-routing-policy {
-                type rib:simple-routing-policy;
-            }
-
-            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";
@@ -397,21 +285,13 @@ module odl-bgp-rib-impl-cfg {
                 }
             }
 
-            leaf route-refresh {
-                type boolean;
-                default "true";
-            }
-
-            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;
-            }
-
-            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 {
@@ -433,143 +313,6 @@ module odl-bgp-rib-impl-cfg {
                     }
                 }
             }
-            container rpc-registry {
-                uses config:service-ref {
-                    refine type {
-                        mandatory false;
-                        config:required-identity mdsb:binding-rpc-registry;
-                    }
-                }
-            }
-        }
-    }
-
-    grouping message-state {
-        leaf count {
-            description "Total number of BGP messages.";
-            type uint32;
-            default 0;
-        }
-
-        leaf timestamp {
-            description "The BGP message timestamp (seconds).";
-            type uint32;
-            default 0;
-        }
-    }
-
-    grouping message-stats {
-        container received {
-            description "The received BGP messages statistics.";
-            uses message-state;
-        }
-
-        container sent {
-            description "The sent BGP messages statistics.";
-            uses message-state;
-        }
-    }
-
-    grouping error {
-        leaf code {
-            description "The BGP error code.";
-            type uint8;
-            default 0;
-        }
-
-        leaf sub-code {
-            description "The BGP error sub-code.";
-            type uint8;
-            default 0;
-        }
-    }
-
-    grouping afi-safi {
-        leaf afi {
-            description "Address Family Identifier.";
-            type string;
-            default "";
-        }
-        leaf safi {
-            description "Subsequent Address Family Identifier.";
-            type string;
-            default "";
-        }
-    }
-
-    grouping preferences {
-        leaf bgp-id {
-            description "The BGP Identifier.";
-            type string;
-            default "";
-        }
-
-        leaf address {
-            description "The IP address of BGP connection.";
-            type string;
-            default "";
-        }
-
-        leaf port {
-            description "The port for connection between the BGP peers.";
-            type uint16;
-            default 0;
-        }
-
-        leaf as {
-            description "Autonomous system number.";
-            type uint32;
-            default 0;
-        }
-
-        leaf holdtime {
-            description "Time interval (in seconds) for HoldTimer proposed by the peer.";
-            type uint16;
-            default 0;
-        }
-
-        leaf four-octet-as-capability {
-            description "The BGP peer 4 byte AS numbers support capability.";
-            type boolean;
-            default "false";
-        }
-
-        leaf bgp-extended-message-capability {
-            description "The bgp extended message support capability.";
-            type boolean;
-            default "false";
-        }
-
-        leaf gr-capability {
-            description "BGP graceful restart support capability.";
-            type boolean;
-            default "false";
-        }
-
-        leaf add-path-capability {
-            type boolean;
-            default "false";
-        }
-
-        leaf route-refresh-capability {
-            reference "https://tools.ietf.org/html/rfc2918";
-            type boolean;
-            default "false";
-        }
-
-        list advertized-table-types {
-            description "The BGP Table-type capabilities advertized by the BGP peer.";
-            uses afi-safi;
-        }
-
-        list advertised-add-path-table-types {
-            description "The BGP Table-type capabilities advertized by the BGP peer.";
-            uses afi-safi;
-            leaf send-receive {
-                description "Send Receive Add Path Configuration.";
-                type string;
-                default "";
-            }
         }
     }
 
@@ -580,100 +323,13 @@ module odl-bgp-rib-impl-cfg {
             when "/config:modules/config:module/config:type = 'bgp-peer'";
 
             rpcx:rpc-context-instance "peer-rpc";
+            uses peer-stats:bgp-peer-stats;
+        }
 
-            container bgp-peer-state {
-                list route-table {
-
-                    leaf table-type {
-                        description "The table name - composed of AFI and SAFI.";
-                        type string;
-                    }
-
-                    leaf routes-count {
-                        description "The total number of routes in table.";
-                        type uint32;
-                        default 0;
-                    }
-                }
-
-                leaf session-established-count {
-                    description "The total number of time the BGP session was transitioned to Up state.";
-                    type uint32;
-                    default 0;
-                }
-            }
-
-            container bgp-session-state {
-
-                leaf session-state {
-                    description "The BGP peer connection state.";
-                    type string;
-                }
-
-                leaf session-duration {
-                    description "The session duration (time formated d:HH:mm:ss).";
-                    type string;
-                }
-
-                leaf holdtime-current {
-                    description "Time interval (in seconds) for HoldTimer established with the peer.";
-                    type uint16;
-                    default 0;
-                }
-
-                leaf keepalive-current {
-                    description "Time interval (in seconds) for KeepAlive established with the peer.";
-                    type uint16;
-                    default 0;
-                }
-
-                container speaker-preferences {
-                    description "The BGP speaker preferences, to which this BGP peer is connected.";
-                    uses preferences;
-                }
-
-                container peer-preferences {
-                    description "The BGP peer preferences.";
-                    uses preferences;
-                }
-
-                container messages-stats {
-                    description "The BGP messages statistics.";
-                    container total-msgs {
-                        description "The statistics for all received/sent BGP messages.";
-                        uses message-stats;
-                    }
-
-                    container keep-alive-msgs {
-                        description "The statistics for received/sent BGP Keep-Alive messages.";
-                        uses message-stats;
-                    }
-
-                    container update-msgs {
-                        description "The statistics for received/sent BGP Update messages.";
-                        uses message-stats;
-                    }
-
-                    container route-refresh-msgs {
-                        description "The statistics for received/sent BGP Route Refresh messages.";
-                        uses message-stats;
-                    }
+        case rib-impl {
+            when "/config:modules/config:module/config:type = 'rib-impl'";
 
-                    container error-msgs {
-                        container error-received {
-                            description "The received BGP Error (notification) messages statistics.";
-                            uses message-state;
-                            uses error;
-                        }
-
-                        container error-sent {
-                            description "The sent BGP Error (notification) messages statistics.";
-                            uses message-state;
-                            uses error;
-                        }
-                    }
-                }
-            }
+            uses rib-impl-stats:bgp-render-stats;
         }
     }
 
@@ -686,9 +342,9 @@ module odl-bgp-rib-impl-cfg {
                 }
             }
         }
-     }
+    }
 
-     rpc reset-stats {
+    rpc reset-stats {
         description "Reset the BGP peer statistics.";
         input {
             uses rpcx:rpc-context-ref {
@@ -697,7 +353,7 @@ module odl-bgp-rib-impl-cfg {
                 }
             }
         }
-     }
+    }
 
     identity bgp-path-selection-mode {
         description
@@ -746,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 {
@@ -777,7 +435,7 @@ module odl-bgp-rib-impl-cfg {
                 uses config:service-ref {
                     refine type {
                         mandatory true;
-                        config:required-identity mdsb:binding-codec-tree-factory;
+                        config:required-identity mdsb1:binding-v1-codec-tree-factory;
                     }
                 }
             }
@@ -791,27 +449,6 @@ module odl-bgp-rib-impl-cfg {
                 }
             }
 
-            container openconfig-provider {
-                uses config:service-ref {
-                    refine type {
-                        mandatory false;
-                        config:required-identity bgp-oc-spi:bgp-openconfig-provider;
-                    }
-                }
-            }
-
-            leaf local-as {
-                description "Our local AS number. Needed by best selection path attribute.";
-                type uint32;
-                mandatory true;
-            }
-
-            leaf bgp-rib-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 {
@@ -821,18 +458,6 @@ module odl-bgp-rib-impl-cfg {
                 }
             }
 
-            leaf rib-id {
-                description "Identifier of this RIB in local data store.";
-                type rib:rib-id;
-                mandatory true;
-            }
-
-            leaf cluster-id {
-                description "IBGP identifier. Needed by route reflection.";
-                reference "https://tools.ietf.org/html/rfc4456#section-7";
-                type inet:ipv4-address;
-            }
-
             list rib-path-selection-mode {
                 uses config:service-ref {
                     refine type {