BUG-4692: Migrate TCP-MD5 support in bgp package to netty's native-epoll
[bgpcep.git] / bgp / rib-impl / src / main / yang / odl-bgp-rib-impl-cfg.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module odl-bgp-rib-impl-cfg {
3     yang-version 1;
4     namespace "urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl";
5     prefix "bgprib-impl";
6
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-rib-impl { prefix bgp-rib-impl; revision-date 2016-06-06; }
10     import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
11     import odl-bgp-rib-cfg { prefix bgprib; revision-date 2013-07-01; }
12     import odl-bgp-parser-spi-cfg { prefix bgpspi; revision-date 2013-11-15; }
13     import odl-bgp-rib-spi-cfg { prefix ribspi; revision-date 2013-11-15; }
14     import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
15     import ietf-yang-types { prefix yang; revision-date 2013-07-15; }
16     import opendaylight-md-sal-binding {prefix mdsb; revision-date 2013-10-28; }
17     import opendaylight-md-sal-dom {prefix sal; revision-date 2013-10-28; }
18     import netty { prefix netty; revision-date 2013-11-19; }
19     import config { prefix config; revision-date 2013-04-05; }
20     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
21     import odl-bgp-openconfig-spi-cfg { prefix bgp-oc-spi; revision-date 2015-09-25; }
22     import odl-bgp-path-selection-mode { prefix bps; revision-date 2016-03-01;}
23     import bgp-peer { prefix peer; revision-date 2016-06-06; }
24     import bgp-stats-peer { prefix peer-stats; revision-date 2016-06-06; }
25     import bgp-stats-rib-impl { prefix rib-impl-stats; revision-date 2016-06-06; }
26
27     organization "Cisco Systems, Inc.";
28
29     contact "Robert Varga <rovarga@cisco.com>";
30
31     description
32         "This module contains the base YANG definitions for
33          BGP listener implementation.
34
35         Copyright (c)2013 Cisco Systems, Inc. All rights reserved.;
36
37         This program and the accompanying materials are made available
38         under the terms of the Eclipse Public License v1.0 which
39         accompanies this distribution, and is available at
40         http://www.eclipse.org/legal/epl-v10.html";
41
42     revision "2016-03-30" {
43         description
44             "Updated to simplify reconnection strategy.";
45     }
46     revision "2013-04-09" {
47         description
48             "Initial revision";
49     }
50
51     identity bgp-dispatcher {
52         description
53             "Service representing a BGP Dispatcher.";
54
55         base "config:service-type";
56         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher";
57     }
58
59     identity bgp-dispatcher-impl {
60         base config:module-type;
61         config:provided-service bgp-dispatcher;
62         config:java-name-prefix BGPDispatcherImpl;
63     }
64
65     augment "/config:modules/config:module/config:configuration" {
66         case bgp-dispatcher-impl {
67             when "/config:modules/config:module/config:type = 'bgp-dispatcher-impl'";
68
69             container bgp-extensions {
70                 uses config:service-ref {
71                     refine type {
72                         mandatory true;
73                         config:required-identity bgpspi:consumer-extensions;
74                     }
75                 }
76             }
77
78             container boss-group {
79                 uses config:service-ref {
80                     refine type {
81                         mandatory true;
82                         config:required-identity netty:netty-threadgroup;
83                     }
84                 }
85             }
86
87             container worker-group {
88                 uses config:service-ref {
89                     refine type {
90                         mandatory true;
91                         config:required-identity netty:netty-threadgroup;
92                     }
93                 }
94             }
95         }
96     }
97
98     identity rib-instance {
99         description
100             "Service representing a RIB instance";
101
102         base "config:service-type";
103         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.RIB";
104     }
105
106     identity bgp-peer-registry {
107         description
108             "Registry of BGP peers. Every new BGP in/out connection looks for peers to handle bgp messages in this registry";
109
110         base "config:service-type";
111         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry";
112     }
113
114     identity strict-bgp-peer-registry {
115         description
116             "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";
117
118         config:provided-service bgp-peer-registry;
119         base config:module-type;
120         config:java-name-prefix StrictBgpPeerRegistry;
121     }
122
123     augment "/config:modules/config:module/config:configuration" {
124         case strict-bgp-peer-registry {
125             when "/config:modules/config:module/config:type = 'strict-bgp-peer-registry'";
126         }
127     }
128
129     identity bgp-peer {
130         description
131             "BGP peer instance.";
132
133         base config:module-type;
134         config:java-name-prefix BGPPeer;
135     }
136
137     identity bgp-peer-acceptor {
138         description
139             "BGP peer acceptor that handles incoming bgp connections. Uses BGP peer registry to accept or decline incoming connections";
140
141         base config:module-type;
142         config:java-name-prefix BGPPeerAcceptor;
143     }
144
145     augment "/config:modules/config:module/config:configuration" {
146         case bgp-peer-acceptor {
147             when "/config:modules/config:module/config:type = 'bgp-peer-acceptor'";
148
149             leaf binding-address {
150                 description "IP address to bind to";
151                 type inet:ip-address;
152                 default "0.0.0.0";
153             }
154
155             leaf binding-port {
156                 description "Port to bind to";
157                 type inet:port-number;
158                 default "179";
159             }
160
161             container accepting-bgp-dispatcher {
162                 uses config:service-ref {
163                     refine type {
164                         mandatory true;
165                         config:required-identity bgp-dispatcher;
166                     }
167                 }
168             }
169
170             container accepting-peer-registry {
171                 uses config:service-ref {
172                     refine type {
173                         mandatory true;
174                         config:required-identity bgp-peer-registry;
175                     }
176                 }
177             }
178         }
179     }
180
181     identity bgp-application-peer {
182         description
183             "Application peer handler which handles translation from custom RIB into local RIB";
184
185         base config:module-type;
186         config:java-name-prefix BGPApplicationPeer;
187     }
188
189     augment "/config:modules/config:module/config:configuration" {
190         case bgp-application-peer {
191             when "/config:modules/config:module/config:type = 'bgp-application-peer'";
192
193             container data-broker {
194                 uses config:service-ref {
195                     refine type {
196                         mandatory true;
197                         config:required-identity sal:dom-async-data-broker;
198                     }
199                 }
200             }
201
202             container target-rib {
203                 uses config:service-ref {
204                     refine type {
205                         mandatory true;
206                         config:required-identity rib-instance;
207                     }
208                 }
209             }
210
211             container bgp-peer-registry {
212                 description "BGP peer registry where current instance of BGP peer will be registered.";
213                 uses config:service-ref {
214                     refine type {
215                         // FIXME backwards compatibility. If not configured, GLOBAL instance is used
216                         mandatory false;
217                         config:required-identity bgp-peer-registry;
218                     }
219                 }
220             }
221
222             leaf application-rib-id {
223                 type rib:application-rib-id;
224                 mandatory true;
225             }
226
227             leaf bgp-peer-id {
228                 type bgp-t:bgp-id;
229                 mandatory true;
230             }
231         }
232     }
233
234     identity bgp-table-type {
235         description
236             "Service representing a AFI/SAFI pair";
237
238         base "config:service-type";
239         config:java-class "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType";
240     }
241
242     identity add-path {
243         base "config:service-type";
244         config:java-class "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.mp.capabilities.add.path.capability.AddressFamilies";
245     }
246
247     identity add-path-impl {
248         config:provided-service add-path;
249         base config:module-type;
250         config:java-name-prefix AddPathImpl;
251     }
252
253     identity bgp-table-type-impl {
254         description
255             "Simple provider for bgp-table-type.";
256
257         config:provided-service bgp-table-type;
258         base config:module-type;
259         config:java-name-prefix BGPTableTypeImpl;
260     }
261
262     augment "/config:modules/config:module/config:configuration" {
263         case bgp-table-type-impl {
264             when "/config:modules/config:module/config:type = 'bgp-table-type-impl'";
265
266             uses bgp-mp:bgp-table-type;
267         }
268     }
269
270     augment "/config:modules/config:module/config:configuration" {
271         case add-path-impl {
272             when "/config:modules/config:module/config:type = 'add-path-impl'";
273             container address-family {
274                 uses config:service-ref {
275                     refine type {
276                         mandatory true;
277                         config:required-identity bgp-table-type;
278                     }
279                 }
280             }
281             leaf send-receive {
282                 type bgp-mp:send-receive;
283                 mandatory true;
284             }
285         }
286     }
287
288     augment "/config:modules/config:module/config:configuration" {
289         case bgp-peer {
290             when "/config:modules/config:module/config:type = 'bgp-peer'";
291
292             uses peer:bgp-peer-config;
293
294             list advertized-table {
295                 key "type name";
296                 uses config:service-ref {
297                     refine type {
298                         mandatory true;
299                         config:required-identity bgp-table-type;
300                     }
301                 }
302             }
303
304             list add-path {
305                 key "type name";
306                 uses config:service-ref {
307                     refine type {
308                         config:required-identity add-path;
309                     }
310                 }
311             }
312
313             container rpc-registry {
314                 uses config:service-ref {
315                     refine type {
316                         mandatory false;
317                         config:required-identity mdsb:binding-rpc-registry;
318                     }
319                 }
320             }
321
322             container rib {
323                 uses config:service-ref {
324                     refine type {
325                         mandatory true;
326                         config:required-identity rib-instance;
327                     }
328                 }
329             }
330
331             container peer-registry {
332                 description "BGP peer registry where current instance of BGP peer will be registered.";
333                 uses config:service-ref {
334                     refine type {
335                         // FIXME backwards compatibility. If not configured, GLOBAL instance is used
336                         mandatory false;
337                         config:required-identity bgp-peer-registry;
338                     }
339                 }
340             }
341         }
342     }
343
344     identity peer-rpc;
345
346     augment "/config:modules/config:module/config:state" {
347         case bgp-peer {
348             when "/config:modules/config:module/config:type = 'bgp-peer'";
349
350             rpcx:rpc-context-instance "peer-rpc";
351             uses peer-stats:bgp-peer-stats;
352         }
353
354         case rib-impl {
355             when "/config:modules/config:module/config:type = 'rib-impl'";
356
357             uses rib-impl-stats:bgp-render-stats;
358         }
359     }
360
361     rpc reset-session {
362         description "Restart the session between BGP peers";
363         input {
364             uses rpcx:rpc-context-ref {
365                 refine context-instance {
366                     rpcx:rpc-context-instance peer-rpc;
367                 }
368             }
369         }
370     }
371
372     rpc reset-stats {
373         description "Reset the BGP peer statistics.";
374         input {
375             uses rpcx:rpc-context-ref {
376                 refine context-instance {
377                     rpcx:rpc-context-instance peer-rpc;
378                 }
379             }
380         }
381     }
382
383     identity bgp-path-selection-mode {
384         description
385             "Service representing an address family + path selection mode.";
386
387         base "config:service-type";
388         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPBestPathSelection";
389     }
390
391     identity bgp-psm-impl {
392         base config:module-type;
393         config:provided-service bgp-path-selection-mode;
394         config:java-name-prefix BGPPSMImpl;
395     }
396
397     augment "/config:modules/config:module/config:configuration" {
398         case bgp-psm-impl {
399             when "/config:modules/config:module/config:type = 'bgp-psm-impl'";
400             container path-address-family {
401                 uses config:service-ref {
402                     refine type {
403                         mandatory true;
404                         config:required-identity bgp-table-type;
405                     }
406                 }
407             }
408             container path-selection-mode {
409                 uses config:service-ref {
410                     refine type {
411                         mandatory true;
412                         config:required-identity bps:path-selection-mode-factory;
413                     }
414                 }
415             }
416         }
417     }
418
419     identity rib-impl {
420         base config:module-type;
421         config:provided-service bgprib:rib;
422         config:provided-service rib-instance;
423         config:java-name-prefix RIBImpl;
424     }
425
426     augment "/config:modules/config:module/config:configuration" {
427         case rib-impl {
428             when "/config:modules/config:module/config:type = 'rib-impl'";
429
430             uses bgp-rib-impl:bgp-rib-impl-identifiers;
431
432             container extensions {
433                 uses config:service-ref {
434                     refine type {
435                         mandatory true;
436                         config:required-identity ribspi:consumer-extensions;
437                     }
438                 }
439             }
440
441             container bgp-dispatcher {
442                 uses config:service-ref {
443                     refine type {
444                         mandatory true;
445                         config:required-identity bgp-dispatcher;
446                     }
447                 }
448             }
449
450             container data-provider {
451                 uses config:service-ref {
452                     refine type {
453                         mandatory true;
454                         config:required-identity mdsb:binding-async-data-broker;
455                     }
456                 }
457             }
458
459             container codec-tree-factory {
460                 uses config:service-ref {
461                     refine type {
462                         mandatory true;
463                         config:required-identity mdsb:binding-codec-tree-factory;
464                     }
465                 }
466             }
467
468             container dom-data-provider {
469                 uses config:service-ref {
470                     refine type {
471                         mandatory true;
472                         config:required-identity sal:dom-async-data-broker;
473                     }
474                 }
475             }
476
477             container openconfig-provider {
478                 uses config:service-ref {
479                     refine type {
480                         mandatory false;
481                         config:required-identity bgp-oc-spi:bgp-openconfig-provider;
482                     }
483                 }
484             }
485
486             list local-table {
487                 uses config:service-ref {
488                     refine type {
489                         mandatory true;
490                         config:required-identity bgp-table-type;
491                     }
492                 }
493             }
494
495             list rib-path-selection-mode {
496                 uses config:service-ref {
497                     refine type {
498                         config:required-identity bgp-path-selection-mode;
499                     }
500                 }
501             }
502         }
503     }
504 }
505