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