1 // vi: set smarttab et sw=4 tabstop=4:
2 module odl-bgp-rib-impl-cfg {
4 namespace "urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl";
7 import bgp-multiprotocol { prefix bgp-mp; revision-date 2013-09-19; }
8 import bgp-rib { prefix rib; revision-date 2013-09-25; }
9 import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
10 import odl-bgp-rib-cfg { prefix bgprib; revision-date 2013-07-01; }
11 import odl-bgp-parser-spi-cfg { prefix bgpspi; revision-date 2013-11-15; }
12 import odl-bgp-rib-spi-cfg { prefix ribspi; revision-date 2013-11-15; }
13 import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
14 import opendaylight-md-sal-binding {prefix mdsb; revision-date 2013-10-28; }
15 import opendaylight-md-sal-dom {prefix sal; revision-date 2013-10-28; }
16 import netty { prefix netty; revision-date 2013-11-19; }
17 import config { prefix config; revision-date 2013-04-05; }
18 import protocol-framework { prefix pf; revision-date 2014-03-13; }
19 import odl-tcpmd5-cfg { prefix tcpmd5; revision-date 2014-04-27; }
20 import odl-tcpmd5-netty-cfg { prefix tcpmd5n; revision-date 2014-04-27; }
21 import rpc-context { prefix rpcx; revision-date 2013-06-17; }
23 organization "Cisco Systems, Inc.";
25 contact "Robert Varga <rovarga@cisco.com>";
28 "This module contains the base YANG definitions for
29 BGP listener implementation.
31 Copyright (c)2013 Cisco Systems, Inc. All rights reserved.;
33 This program and the accompanying materials are made available
34 under the terms of the Eclipse Public License v1.0 which
35 accompanies this distribution, and is available at
36 http://www.eclipse.org/legal/epl-v10.html";
38 revision "2013-04-09" {
43 identity base-bgp-parser {
44 base config:module-type;
45 config:java-name-prefix BaseBGPParser;
46 config:provided-service bgpspi:extension;
49 augment "/config:modules/config:module/config:configuration" {
50 case base-bgp-parser {
51 when "/config:modules/config:module/config:type = 'base-bgp-parser'";
55 identity bgp-dispatcher {
57 "Service representing a BGP Dispatcher.";
59 base "config:service-type";
60 config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher";
63 identity bgp-dispatcher-impl {
64 base config:module-type;
65 config:provided-service bgp-dispatcher;
66 config:java-name-prefix BGPDispatcherImpl;
69 augment "/config:modules/config:module/config:configuration" {
70 case bgp-dispatcher-impl {
71 when "/config:modules/config:module/config:type = 'bgp-dispatcher-impl'";
73 container bgp-extensions {
74 uses config:service-ref {
77 config:required-identity bgpspi:consumer-extensions;
82 container boss-group {
83 uses config:service-ref {
86 config:required-identity netty:netty-threadgroup;
91 container worker-group {
92 uses config:service-ref {
95 config:required-identity netty:netty-threadgroup;
100 container md5-channel-factory {
101 uses config:service-ref {
104 config:required-identity tcpmd5n:md5-channel-factory;
109 container md5-server-channel-factory {
110 uses config:service-ref {
113 config:required-identity tcpmd5n:md5-server-channel-factory;
120 identity base-bgp-rib {
121 base config:module-type;
122 config:provided-service ribspi:extension;
123 config:java-name-prefix BaseBGPRIB;
126 augment "/config:modules/config:module/config:configuration" {
128 when "/config:modules/config:module/config:type = 'base-bgp-rib'";
132 identity rib-instance {
134 "Service representing a RIB instance";
136 base "config:service-type";
137 config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.RIB";
140 identity bgp-peer-registry {
142 "Registry of BGP peers. Every new BGP in/out connection looks for peers to handle bgp messages in this registry";
144 base "config:service-type";
145 config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry";
148 identity strict-bgp-peer-registry {
150 "Registry of BGP peers that allows only one connection per 2 peers. Uses IP address for Peer identification and BGP Ids to resolve duplicate connections";
152 config:provided-service bgp-peer-registry;
153 base config:module-type;
154 config:java-name-prefix StrictBgpPeerRegistry;
158 augment "/config:modules/config:module/config:configuration" {
159 case strict-bgp-peer-registry {
160 when "/config:modules/config:module/config:type = 'strict-bgp-peer-registry'";
166 "BGP peer instance.";
168 base config:module-type;
169 config:java-name-prefix BGPPeer;
172 identity bgp-peer-acceptor {
174 "BGP peer acceptor that handles incomming bgp connections. Uses BGP peer registry to accept or decline incomming connections";
176 base config:module-type;
177 config:java-name-prefix BGPPeerAcceptor;
180 augment "/config:modules/config:module/config:configuration" {
181 case bgp-peer-acceptor {
182 when "/config:modules/config:module/config:type = 'bgp-peer-acceptor'";
184 leaf binding-address {
185 description "IP address to bind to";
186 type inet:ip-address;
191 description "Port to bind to";
192 type inet:port-number;
196 container accepting-bgp-dispatcher {
197 uses config:service-ref {
200 config:required-identity bgp-dispatcher;
205 container accepting-peer-registry {
206 uses config:service-ref {
209 config:required-identity bgp-peer-registry;
216 identity bgp-application-peer {
218 "Application peer handler which handles translation from custom RIB into local RIB";
220 base config:module-type;
221 config:java-name-prefix BGPApplicationPeer;
224 augment "/config:modules/config:module/config:configuration" {
225 case bgp-application-peer {
226 when "/config:modules/config:module/config:type = 'bgp-application-peer'";
228 container data-broker {
229 uses config:service-ref {
232 config:required-identity sal:dom-async-data-broker;
237 container target-rib {
238 uses config:service-ref {
241 config:required-identity rib-instance;
246 leaf application-rib-id {
247 type rib:application-rib-id;
252 type inet:ipv4-address;
258 identity bgp-table-type {
260 "Service representing a AFI/SAFI pair";
262 base "config:service-type";
263 config:java-class "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType";
266 identity bgp-table-type-impl {
268 "Simple provider for bgp-table-type.";
270 config:provided-service bgp-table-type;
271 base config:module-type;
272 config:java-name-prefix BGPTableTypeImpl;
275 augment "/config:modules/config:module/config:configuration" {
276 case bgp-table-type-impl {
277 when "/config:modules/config:module/config:type = 'bgp-table-type-impl'";
281 base bgp-t:address-family;
287 base bgp-t:subsequent-address-family;
294 augment "/config:modules/config:module/config:configuration" {
296 when "/config:modules/config:module/config:type = 'bgp-peer'";
299 description "Remote host IP address";
300 type inet:ip-address;
305 description "Remote host port";
306 type inet:port-number;
315 leaf initiate-connection {
316 description "If true, connection will be initiated right away from current device.
317 If not, the peer will only be registered to peer registry and available for incomming bgp connections.";
322 list advertized-table {
324 uses config:service-ref {
327 config:required-identity bgp-table-type;
334 "Expected remote AS number. If not present, it is assumed
335 to be the same as our local AS number.";
340 type tcpmd5:rfc2385-key;
341 description "RFC2385 shared secret";
345 uses config:service-ref {
348 config:required-identity rib-instance;
353 container peer-registry {
354 description "BGP peer registry where current instance of BGP peer will be registered.";
355 uses config:service-ref {
357 // FIXME backwards compatibility. If not configured, GLOBAL instance is used
359 config:required-identity bgp-peer-registry;
366 grouping message-state {
368 description "Total number of BGP messages.";
374 description "The BGP message timestamp (seconds).";
380 grouping message-stats {
382 description "The received BGP messages statistics.";
387 description "The sent BGP messages statistics.";
394 description "The BGP error code.";
400 description "The BGP error sub-code.";
406 grouping preferences {
408 description "The BGP Identifier.";
414 description "The IP address of BGP connection.";
420 description "The port for connection between the BGP peers.";
426 description "Autonomous system number.";
432 description "Time interval (in seconds) for HoldTimer proposed by the peer.";
437 leaf four-octet-as-capability {
438 description "The BGP peer 4 byte AS numbers support capability.";
444 description "BGP graceful restart support capability.";
449 list advertized-table-types {
450 description "The BGP Table-type capabilities advertized by the BGP peer.";
452 description "Address Family Identifier.";
457 description "Subsequent Address Family Identifier.";
466 augment "/config:modules/config:module/config:state" {
468 when "/config:modules/config:module/config:type = 'bgp-peer'";
470 rpcx:rpc-context-instance "peer-rpc";
472 container bgp-peer-state {
476 description "The table name - composed of AFI and SAFI.";
481 description "The total number of routes in table.";
487 leaf session-established-count {
488 description "The total number of time the BGP session was transitioned to Up state.";
494 container bgp-session-state {
497 description "The BGP peer connection state.";
501 leaf session-duration {
502 description "The session duration (time formated d:HH:mm:ss).";
506 leaf holdtime-current {
507 description "Time interval (in seconds) for HoldTimer established with the peer.";
512 leaf keepalive-current {
513 description "Time interval (in seconds) for KeepAlive established with the peer.";
518 container speaker-preferences {
519 description "The BGP speaker preferences, to which this BGP peer is connected.";
523 container peer-preferences {
524 description "The BGP peer preferences.";
528 container messages-stats {
529 description "The BGP messages statistics.";
530 container total-msgs {
531 description "The statistics for all received/sent BGP messages.";
535 container keep-alive-msgs {
536 description "The statistics for received/sent BGP Keep-Alive messages.";
540 container update-msgs {
541 description "The statistics for received/sent BGP Update messages.";
545 container error-msgs {
546 container error-received {
547 description "The received BGP Error (notification) messages statistics.";
552 container error-sent {
553 description "The sent BGP Error (notification) messages statistics.";
564 description "Restart the session between BGP peers";
566 uses rpcx:rpc-context-ref {
567 refine context-instance {
568 rpcx:rpc-context-instance peer-rpc;
575 description "Reset the BGP peer statistics.";
577 uses rpcx:rpc-context-ref {
578 refine context-instance {
579 rpcx:rpc-context-instance peer-rpc;
586 base config:module-type;
587 config:provided-service bgprib:rib;
588 config:provided-service rib-instance;
589 config:java-name-prefix RIBImpl;
592 augment "/config:modules/config:module/config:configuration" {
594 when "/config:modules/config:module/config:type = 'rib-impl'";
596 container extensions {
597 uses config:service-ref {
600 config:required-identity ribspi:consumer-extensions;
605 container bgp-dispatcher {
606 uses config:service-ref {
609 config:required-identity bgp-dispatcher;
614 container session-reconnect-strategy {
615 uses config:service-ref {
618 config:required-identity pf:reconnect-strategy-factory;
623 container tcp-reconnect-strategy {
624 uses config:service-ref {
627 config:required-identity pf:reconnect-strategy-factory;
632 container data-provider {
633 uses config:service-ref {
636 config:required-identity mdsb:binding-async-data-broker;
641 container codec-tree-factory {
642 uses config:service-ref {
645 config:required-identity mdsb:binding-codec-tree-factory;
650 container dom-data-provider {
651 uses config:service-ref {
654 config:required-identity sal:dom-async-data-broker;
660 description "Our local AS number. Needed by best selection path attribute.";
666 description "Our local BGP identifier. Needed by best selection path attribute.";
668 type inet:ipv4-address;
672 uses config:service-ref {
675 config:required-identity bgp-table-type;
681 description "Identifier of this RIB in local data store.";
687 description "IBGP identifier. Needed by route reflection.";
688 reference "https://tools.ietf.org/html/rfc4456#section-7";
689 type inet:ipv4-address;