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 {
323 uses config:service-ref {
326 config:required-identity bgp-table-type;
333 "Expected remote AS number. If not present, it is assumed
334 to be the same as our local AS number.";
339 type tcpmd5:rfc2385-key;
340 description "RFC2385 shared secret";
344 uses config:service-ref {
347 config:required-identity rib-instance;
352 container peer-registry {
353 description "BGP peer registry where current instance of BGP peer will be registered.";
354 uses config:service-ref {
356 // FIXME backwards compatibility. If not configured, GLOBAL instance is used
358 config:required-identity bgp-peer-registry;
365 grouping message-state {
367 description "Total number of BGP messages.";
373 description "The BGP message timestamp (seconds).";
379 grouping message-stats {
381 description "The received BGP messages statistics.";
386 description "The sent BGP messages statistics.";
393 description "The BGP error code.";
399 description "The BGP error sub-code.";
405 grouping preferences {
407 description "The BGP Identifier.";
413 description "The IP address of BGP connection.";
419 description "The port for connection between the BGP peers.";
425 description "Autonomous system number.";
431 description "Time interval (in seconds) for HoldTimer proposed by the peer.";
436 leaf four-octet-as-capability {
437 description "The BGP peer 4 byte AS numbers support capability.";
442 list advertized-table-types {
443 description "The BGP Table-type capabilities advertized by the BGP peer.";
445 description "Address Family Identifier.";
450 description "Subsequent Address Family Identifier.";
459 augment "/config:modules/config:module/config:state" {
461 when "/config:modules/config:module/config:type = 'bgp-peer'";
463 rpcx:rpc-context-instance "peer-rpc";
465 container bgp-peer-state {
469 description "The table name - composed of AFI and SAFI.";
474 description "The total number of routes in table.";
480 leaf session-established-count {
481 description "The total number of time the BGP session was transitioned to Up state.";
487 container bgp-session-state {
490 description "The BGP peer connection state.";
494 leaf session-duration {
495 description "The session duration (time formated d:HH:mm:ss).";
499 leaf holdtime-current {
500 description "Time interval (in seconds) for HoldTimer established with the peer.";
505 leaf keepalive-current {
506 description "Time interval (in seconds) for KeepAlive established with the peer.";
511 container speaker-preferences {
512 description "The BGP speaker preferences, to which this BGP peer is connected.";
516 container peer-preferences {
517 description "The BGP peer preferences.";
521 container messages-stats {
522 description "The BGP messages statistics.";
523 container total-msgs {
524 description "The statistics for all received/sent BGP messages.";
528 container keep-alive-msgs {
529 description "The statistics for received/sent BGP Keep-Alive messages.";
533 container update-msgs {
534 description "The statistics for received/sent BGP Update messages.";
538 container error-msgs {
539 container error-received {
540 description "The received BGP Error (notification) messages statistics.";
545 container error-sent {
546 description "The sent BGP Error (notification) messages statistics.";
557 description "Restart the session between BGP peers";
559 uses rpcx:rpc-context-ref {
560 refine context-instance {
561 rpcx:rpc-context-instance peer-rpc;
568 description "Reset the BGP peer statistics.";
570 uses rpcx:rpc-context-ref {
571 refine context-instance {
572 rpcx:rpc-context-instance peer-rpc;
579 base config:module-type;
580 config:provided-service bgprib:rib;
581 config:provided-service rib-instance;
582 config:java-name-prefix RIBImpl;
585 augment "/config:modules/config:module/config:configuration" {
587 when "/config:modules/config:module/config:type = 'rib-impl'";
589 container extensions {
590 uses config:service-ref {
593 config:required-identity ribspi:consumer-extensions;
598 container bgp-dispatcher {
599 uses config:service-ref {
602 config:required-identity bgp-dispatcher;
607 container session-reconnect-strategy {
608 uses config:service-ref {
611 config:required-identity pf:reconnect-strategy-factory;
616 container tcp-reconnect-strategy {
617 uses config:service-ref {
620 config:required-identity pf:reconnect-strategy-factory;
625 container data-provider {
626 uses config:service-ref {
629 config:required-identity mdsb:binding-async-data-broker;
635 description "Our local AS number. Needed by best selection path attribute.";
641 description "Our local BGP identifier. Needed by best selection path attribute.";
643 type inet:ipv4-address;
647 uses config:service-ref {
650 config:required-identity bgp-table-type;
656 description "Identifier of this RIB in local data store.";