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 netty { prefix netty; revision-date 2013-11-19; }
16 import config { prefix config; revision-date 2013-04-05; }
17 import protocol-framework { prefix pf; revision-date 2014-03-13; }
18 import odl-tcpmd5-cfg { prefix tcpmd5; revision-date 2014-04-27; }
19 import odl-tcpmd5-netty-cfg { prefix tcpmd5n; revision-date 2014-04-27; }
20 import rpc-context { prefix rpcx; revision-date 2013-06-17; }
22 organization "Cisco Systems, Inc.";
24 contact "Robert Varga <rovarga@cisco.com>";
27 "This module contains the base YANG definitions for
28 BGP listener implementation.
30 Copyright (c)2013 Cisco Systems, Inc. All rights reserved.;
32 This program and the accompanying materials are made available
33 under the terms of the Eclipse Public License v1.0 which
34 accompanies this distribution, and is available at
35 http://www.eclipse.org/legal/epl-v10.html";
37 revision "2013-04-09" {
42 identity base-bgp-parser {
43 base config:module-type;
44 config:java-name-prefix BaseBGPParser;
45 config:provided-service bgpspi:extension;
48 augment "/config:modules/config:module/config:configuration" {
49 case base-bgp-parser {
50 when "/config:modules/config:module/config:type = 'base-bgp-parser'";
54 identity bgp-dispatcher {
56 "Service representing a BGP Dispatcher.";
58 base "config:service-type";
59 config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher";
62 identity bgp-dispatcher-impl {
63 base config:module-type;
64 config:provided-service bgp-dispatcher;
65 config:java-name-prefix BGPDispatcherImpl;
68 augment "/config:modules/config:module/config:configuration" {
69 case bgp-dispatcher-impl {
70 when "/config:modules/config:module/config:type = 'bgp-dispatcher-impl'";
72 container bgp-extensions {
73 uses config:service-ref {
76 config:required-identity bgpspi:consumer-extensions;
81 container boss-group {
82 uses config:service-ref {
85 config:required-identity netty:netty-threadgroup;
90 container worker-group {
91 uses config:service-ref {
94 config:required-identity netty:netty-threadgroup;
99 container md5-channel-factory {
100 uses config:service-ref {
103 config:required-identity tcpmd5n:md5-channel-factory;
108 container md5-server-channel-factory {
109 uses config:service-ref {
112 config:required-identity tcpmd5n:md5-server-channel-factory;
119 identity base-bgp-rib {
120 base config:module-type;
121 config:provided-service ribspi:extension;
122 config:java-name-prefix BaseBGPRIB;
125 augment "/config:modules/config:module/config:configuration" {
127 when "/config:modules/config:module/config:type = 'base-bgp-rib'";
131 identity rib-instance {
133 "Service representing a RIB instance";
135 base "config:service-type";
136 config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.RIB";
139 identity bgp-peer-registry {
141 "Registry of BGP peers. Every new BGP in/out connection looks for peers to handle bgp messages in this registry";
143 base "config:service-type";
144 config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry";
147 identity strict-bgp-peer-registry {
149 "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";
151 config:provided-service bgp-peer-registry;
152 base config:module-type;
153 config:java-name-prefix StrictBgpPeerRegistry;
157 augment "/config:modules/config:module/config:configuration" {
158 case strict-bgp-peer-registry {
159 when "/config:modules/config:module/config:type = 'strict-bgp-peer-registry'";
165 "BGP peer instance.";
167 base config:module-type;
168 config:java-name-prefix BGPPeer;
171 identity bgp-peer-acceptor {
173 "BGP peer acceptor that handles incomming bgp connections. Uses BGP peer registry to accept or decline incomming connections";
175 base config:module-type;
176 config:java-name-prefix BGPPeerAcceptor;
179 augment "/config:modules/config:module/config:configuration" {
180 case bgp-peer-acceptor {
181 when "/config:modules/config:module/config:type = 'bgp-peer-acceptor'";
183 leaf binding-address {
184 description "IP address to bind to";
185 type inet:ip-address;
190 description "Port to bind to";
191 type inet:port-number;
195 container accepting-bgp-dispatcher {
196 uses config:service-ref {
199 config:required-identity bgp-dispatcher;
204 container accepting-peer-registry {
205 uses config:service-ref {
208 config:required-identity bgp-peer-registry;
215 identity bgp-application-peer {
217 "Application peer handler which handles translation from custom RIB into local RIB";
219 base config:module-type;
220 config:java-name-prefix BGPApplicationPeer;
223 augment "/config:modules/config:module/config:configuration" {
224 case bgp-application-peer {
225 when "/config:modules/config:module/config:type = 'bgp-application-peer'";
227 container data-broker {
228 uses config:service-ref {
231 config:required-identity mdsb:binding-async-data-broker;
236 container target-rib {
237 uses config:service-ref {
240 config:required-identity rib-instance;
245 leaf application-rib-id {
246 type rib:application-rib-id;
251 type inet:ipv4-address;
257 identity bgp-table-type {
259 "Service representing a AFI/SAFI pair";
261 base "config:service-type";
262 config:java-class "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType";
265 identity bgp-table-type-impl {
267 "Simple provider for bgp-table-type.";
269 config:provided-service bgp-table-type;
270 base config:module-type;
271 config:java-name-prefix BGPTableTypeImpl;
274 augment "/config:modules/config:module/config:configuration" {
275 case bgp-table-type-impl {
276 when "/config:modules/config:module/config:type = 'bgp-table-type-impl'";
280 base bgp-t:address-family;
286 base bgp-t:subsequent-address-family;
293 augment "/config:modules/config:module/config:configuration" {
295 when "/config:modules/config:module/config:type = 'bgp-peer'";
298 description "Remote host IP address";
299 type inet:ip-address;
304 description "Remote host port";
305 type inet:port-number;
314 leaf initiate-connection {
315 description "If true, connection will be initiated right away from current device.
316 If not, the peer will only be registered to peer registry and available for incomming bgp connections.";
321 list advertized-table {
322 uses config:service-ref {
325 config:required-identity bgp-table-type;
332 "Expected remote AS number. If not present, it is assumed
333 to be the same as our local AS number.";
338 type tcpmd5:rfc2385-key;
339 description "RFC2385 shared secret";
343 uses config:service-ref {
346 config:required-identity rib-instance;
351 container peer-registry {
352 description "BGP peer registry where current instance of BGP peer will be registered.";
353 uses config:service-ref {
355 // FIXME backwards compatibility. If not configured, GLOBAL instance is used
357 config:required-identity bgp-peer-registry;
364 grouping message-state {
366 description "Total number of BGP messages.";
372 description "The BGP message timestamp (seconds).";
378 grouping message-stats {
380 description "The received BGP messages statistics.";
385 description "The sent BGP messages statistics.";
392 description "The BGP error code.";
398 description "The BGP error sub-code.";
404 grouping preferences {
406 description "The BGP Identifier.";
412 description "The IP address of BGP connection.";
418 description "The port for connection between the BGP peers.";
424 description "Autonomous system number.";
430 description "Time interval (in seconds) for HoldTimer proposed by the peer.";
435 leaf four-octet-as-capability {
436 description "The BGP peer 4 byte AS numbers support capability.";
441 list advertized-table-types {
442 description "The BGP Table-type capabilities advertized by the BGP peer.";
444 description "Address Family Identifier.";
449 description "Subsequent Address Family Identifier.";
458 augment "/config:modules/config:module/config:state" {
460 when "/config:modules/config:module/config:type = 'bgp-peer'";
462 rpcx:rpc-context-instance "peer-rpc";
464 container bgp-peer-state {
468 description "The table name - composed of AFI and SAFI.";
473 description "The total number of routes in table.";
479 leaf session-established-count {
480 description "The total number of time the BGP session was transitioned to Up state.";
486 container bgp-session-state {
489 description "The BGP peer connection state.";
493 leaf session-duration {
494 description "The session duration (time formated d:HH:mm:ss).";
498 leaf holdtime-current {
499 description "Time interval (in seconds) for HoldTimer established with the peer.";
504 leaf keepalive-current {
505 description "Time interval (in seconds) for KeepAlive established with the peer.";
510 container speaker-preferences {
511 description "The BGP speaker preferences, to which this BGP peer is connected.";
515 container peer-preferences {
516 description "The BGP peer preferences.";
520 container messages-stats {
521 description "The BGP messages statistics.";
522 container total-msgs {
523 description "The statistics for all received/sent BGP messages.";
527 container keep-alive-msgs {
528 description "The statistics for received/sent BGP Keep-Alive messages.";
532 container update-msgs {
533 description "The statistics for received/sent BGP Update messages.";
537 container error-msgs {
538 container error-received {
539 description "The received BGP Error (notification) messages statistics.";
544 container error-sent {
545 description "The sent BGP Error (notification) messages statistics.";
556 description "Restart the session between BGP peers";
558 uses rpcx:rpc-context-ref {
559 refine context-instance {
560 rpcx:rpc-context-instance peer-rpc;
567 description "Reset the BGP peer statistics.";
569 uses rpcx:rpc-context-ref {
570 refine context-instance {
571 rpcx:rpc-context-instance peer-rpc;
578 base config:module-type;
579 config:provided-service bgprib:rib;
580 config:provided-service rib-instance;
581 config:java-name-prefix RIBImpl;
584 augment "/config:modules/config:module/config:configuration" {
586 when "/config:modules/config:module/config:type = 'rib-impl'";
588 container extensions {
589 uses config:service-ref {
592 config:required-identity ribspi:consumer-extensions;
597 container bgp-dispatcher {
598 uses config:service-ref {
601 config:required-identity bgp-dispatcher;
606 container session-reconnect-strategy {
607 uses config:service-ref {
610 config:required-identity pf:reconnect-strategy-factory;
615 container tcp-reconnect-strategy {
616 uses config:service-ref {
619 config:required-identity pf:reconnect-strategy-factory;
624 container data-provider {
625 uses config:service-ref {
628 config:required-identity mdsb:binding-async-data-broker;
634 description "Our local AS number. Needed by best selection path attribute.";
640 description "Our local BGP identifier. Needed by best selection path attribute.";
642 type inet:ipv4-address;
646 uses config:service-ref {
649 config:required-identity bgp-table-type;
655 description "Identifier of this RIB in local data store.";