BUG-635: implement MD5 auth option for BGP peers
[bgpcep.git] / bgp / rib-impl-config / src / main / yang / bgp-rib-impl.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module bgp-rib-impl {
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-types { prefix bgp-t; revision-date 2013-09-19; }
10     import config-bgp-rib { prefix bgprib; revision-date 2013-07-01; }
11     import config-bgp-parser-spi { prefix bgpspi; revision-date 2013-11-15; }
12     import config-bgp-rib-spi { 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
21     organization "Cisco Systems, Inc.";
22
23     contact "Robert Varga <rovarga@cisco.com>";
24
25     description
26         "This module contains the base YANG definitions for
27          BGP listener implementation.
28
29         Copyright (c)2013 Cisco Systems, Inc. All rights reserved.;
30
31         This program and the accompanying materials are made available
32         under the terms of the Eclipse Public License v1.0 which
33         accompanies this distribution, and is available at
34         http://www.eclipse.org/legal/epl-v10.html";
35
36     revision "2013-04-09" {
37         description
38             "Initial revision";
39     }
40
41     identity base-bgp-parser {
42         base config:module-type;
43         config:java-name-prefix BaseBGPParser;
44         config:provided-service bgpspi:extension;
45     }
46
47     augment "/config:modules/config:module/config:configuration" {
48         case base-bgp-parser {
49             when "/config:modules/config:module/config:type = 'base-bgp-parser'";
50         }
51     }
52
53     identity bgp-dispatcher {
54         description
55             "Service representing a BGP Dispatcher.";
56
57         base "config:service-type";
58         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher";
59     }
60
61     identity bgp-dispatcher-impl {
62         base config:module-type;
63         config:provided-service bgp-dispatcher;
64         config:java-name-prefix BGPDispatcherImpl;
65     }
66
67     augment "/config:modules/config:module/config:configuration" {
68         case bgp-dispatcher-impl {
69             when "/config:modules/config:module/config:type = 'bgp-dispatcher-impl'";
70
71             container bgp-extensions {
72                 uses config:service-ref {
73                     refine type {
74                         mandatory true;
75                         config:required-identity bgpspi:consumer-extensions;
76                     }
77                 }
78             }
79
80             container timer {
81                 uses config:service-ref {
82                     refine type {
83                         mandatory true;
84                         config:required-identity netty:netty-timer;
85                     }
86                 }
87             }
88
89             container boss-group {
90                 uses config:service-ref {
91                     refine type {
92                         mandatory true;
93                         config:required-identity netty:netty-threadgroup;
94                     }
95                 }
96             }
97
98             container worker-group {
99                 uses config:service-ref {
100                     refine type {
101                         mandatory true;
102                         config:required-identity netty:netty-threadgroup;
103                     }
104                 }
105             }
106
107             container md5-channel-factory {
108                 uses config:service-ref {
109                     refine type {
110                         mandatory false;
111                         config:required-identity tcpmd5n:md5-channel-factory;
112                     }
113                 }
114             }
115
116             container md5-server-channel-factory {
117                 uses config:service-ref {
118                     refine type {
119                         mandatory false;
120                         config:required-identity tcpmd5n:md5-server-channel-factory;
121                     }
122                 }
123             }
124         }
125     }
126
127     identity base-bgp-rib {
128         base config:module-type;
129         config:provided-service ribspi:extension;
130         config:java-name-prefix BaseBGPRIB;
131     }
132
133     augment "/config:modules/config:module/config:configuration" {
134         case base-bgp-rib {
135             when "/config:modules/config:module/config:type = 'base-bgp-rib'";
136         }
137     }
138
139     identity rib-instance {
140         description
141             "Service representing a RIB instance";
142
143         base "config:service-type";
144         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.RIB";
145     }
146
147     identity bgp-peer {
148         description
149             "BGP peer instance.";
150
151         base config:module-type;
152         config:java-name-prefix BGPPeer;
153     }
154
155     identity bgp-table-type {
156         description
157             "Service representing a AFI/SAFI pair";
158
159         base "config:service-type";
160         config:java-class "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType";
161     }
162
163     identity bgp-table-type-impl {
164         description
165             "Simple provider for bgp-table-type.";
166
167         config:provided-service bgp-table-type;
168         base config:module-type;
169         config:java-name-prefix BGPTableTypeImpl;
170     }
171
172     augment "/config:modules/config:module/config:configuration" {
173         case bgp-table-type-impl {
174             when "/config:modules/config:module/config:type = 'bgp-table-type-impl'";
175
176             leaf afi {
177                 type identityref {
178                     base bgp-t:address-family;
179                 }
180                 mandatory true;
181             }
182             leaf safi {
183                 type identityref {
184                     base bgp-t:subsequent-address-family;
185                 }
186                 mandatory true;
187             }
188         }
189     }
190
191     augment "/config:modules/config:module/config:configuration" {
192         case bgp-peer {
193             when "/config:modules/config:module/config:type = 'bgp-peer'";
194
195             leaf host {
196                 description "Remote host IP address";
197                 type inet:ip-address;
198                 mandatory true;
199             }
200
201             leaf port {
202                 description "Remote host port";
203                 type inet:port-number;
204                 default 179;
205             }
206
207             leaf holdtimer {
208                 type int16;
209                 default 180;
210             }
211
212             list advertized-table {
213                 uses config:service-ref {
214                     refine type {
215                         mandatory true;
216                         config:required-identity bgp-table-type;
217                     }
218                 }
219             }
220
221             leaf remote-as {
222                 description
223                     "Expected remote AS number. If not present, it is assumed
224                     to be the same as our local AS number.";
225                 type uint32;
226             }
227
228             leaf password {
229                 type tcpmd5:rfc2385-key;
230                 description "RFC2385 shared secret";
231             }
232
233             container rib {
234                 uses config:service-ref {
235                     refine type {
236                         mandatory true;
237                         config:required-identity rib-instance;
238                     }
239                 }
240             }
241         }
242     }
243
244     identity rib-impl {
245         base config:module-type;
246         config:provided-service bgprib:rib;
247         config:provided-service rib-instance;
248         config:java-name-prefix RIBImpl;
249     }
250
251     augment "/config:modules/config:module/config:configuration" {
252         case rib-impl {
253             when "/config:modules/config:module/config:type = 'rib-impl'";
254
255             container extensions {
256                 uses config:service-ref {
257                     refine type {
258                         mandatory true;
259                         config:required-identity ribspi:consumer-extensions;
260                     }
261                 }
262             }
263
264             container bgp-dispatcher {
265                 uses config:service-ref {
266                     refine type {
267                         mandatory true;
268                         config:required-identity bgp-dispatcher;
269                     }
270                 }
271             }
272
273             container session-reconnect-strategy {
274                 uses config:service-ref {
275                     refine type {
276                         mandatory true;
277                         config:required-identity pf:reconnect-strategy-factory;
278                     }
279                 }
280             }
281
282             container tcp-reconnect-strategy {
283                 uses config:service-ref {
284                     refine type {
285                         mandatory true;
286                         config:required-identity pf:reconnect-strategy-factory;
287                     }
288                 }
289             }
290
291             container data-provider {
292                 uses config:service-ref {
293                     refine type {
294                         mandatory true;
295                         config:required-identity mdsb:binding-data-broker;
296                     }
297                 }
298             }
299
300             leaf local-as {
301                 description "Our local AS number. Needed by best selection path attribute.";
302                 type uint32;
303                 mandatory true;
304             }
305
306             leaf bgp-id {
307                 description "Our local BGP identifier. Needed by best selection path attribute.";
308                 mandatory true;
309                 type inet:ipv4-address;
310             }
311
312             list local-table {
313                 uses config:service-ref {
314                     refine type {
315                         mandatory true;
316                         config:required-identity bgp-table-type;
317                     }
318                 }
319             }
320
321             leaf rib-id {
322                 description "Identifier of this RIB in local data store.";
323                 type rib:rib-id;
324                 mandatory true;
325             }
326         }
327     }
328 }
329